From 1e0a507c4450fd73753af1c2804c4d8e532f35c1 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 9 Mar 2026 19:03:21 +0000 Subject: [PATCH 1/8] Initial plan From 85368acea4c4688d543f5a4a1071b6b18931e9b7 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 9 Mar 2026 19:08:51 +0000 Subject: [PATCH 2/8] fix: resolve default values from emitter options JSON schema Co-authored-by: markcowl <1054056+markcowl@users.noreply.github.com> --- packages/compiler/src/core/library.ts | 1 + .../compiler/src/core/schema-validator.ts | 2 + .../test/core/emitter-options.test.ts | 76 +++++++++++++++++++ 3 files changed, 79 insertions(+) diff --git a/packages/compiler/src/core/library.ts b/packages/compiler/src/core/library.ts index 24687c6f774..6c417ee5987 100644 --- a/packages/compiler/src/core/library.ts +++ b/packages/compiler/src/core/library.ts @@ -88,6 +88,7 @@ export function createTypeSpecLibrary< if (!emitterOptionValidator && lib.emitter?.options) { emitterOptionValidator = createJSONSchemaValidator(lib.emitter.options, { coerceTypes: true, + useDefaults: true, }); } return emitterOptionValidator; diff --git a/packages/compiler/src/core/schema-validator.ts b/packages/compiler/src/core/schema-validator.ts index f5b7d4439c1..0817d3c6788 100644 --- a/packages/compiler/src/core/schema-validator.ts +++ b/packages/compiler/src/core/schema-validator.ts @@ -16,6 +16,7 @@ import { export interface JSONSchemaValidatorOptions { coerceTypes?: boolean; strict?: boolean; + useDefaults?: boolean; } function absolutePathStatus(path: string): "valid" | "not-absolute" | "windows-style" { @@ -35,6 +36,7 @@ export function createJSONSchemaValidator( const ajv = new Ajv({ strict: options.strict, coerceTypes: options.coerceTypes, + useDefaults: options.useDefaults, allowUnionTypes: true, allErrors: true, } satisfies Options); diff --git a/packages/compiler/test/core/emitter-options.test.ts b/packages/compiler/test/core/emitter-options.test.ts index d0aa5077980..20f9365224f 100644 --- a/packages/compiler/test/core/emitter-options.test.ts +++ b/packages/compiler/test/core/emitter-options.test.ts @@ -20,6 +20,22 @@ const fakeEmitter = createTypeSpecLibrary({ }, }); +const fakeEmitterWithDefaults = createTypeSpecLibrary({ + name: "fake-emitter-defaults", + diagnostics: {}, + emitter: { + options: { + type: "object", + properties: { + "target-name": { type: "string", nullable: true, default: "defaultTarget" }, + "max-files": { type: "number", nullable: true, default: 10 }, + verbose: { type: "boolean", nullable: true, default: false }, + }, + additionalProperties: false, + }, + }, +}); + describe("compiler: emitter options", () => { async function runWithEmitterOptions( options: Record, @@ -127,4 +143,64 @@ describe("compiler: emitter options", () => { }); }); }); + + describe("schema defaults", () => { + async function runWithDefaultsEmitter( + options: Record, + ): Promise<[EmitContext | undefined, readonly Diagnostic[]]> { + let emitContext: EmitContext | undefined; + const diagnostics = await Tester.files({ + "node_modules/fake-emitter-defaults/package.json": JSON.stringify({ + main: "index.js", + }), + "node_modules/fake-emitter-defaults/index.js": mockFile.js({ + $lib: fakeEmitterWithDefaults, + $onEmit: (ctx: EmitContext) => { + emitContext = ctx; + }, + }), + }).diagnose("", { + compilerOptions: { + emit: ["fake-emitter-defaults"], + options: { + "fake-emitter-defaults": options, + }, + }, + }); + return [emitContext, diagnostics]; + } + + it("applies default values from schema when options are not provided", async () => { + const [context, diagnostics] = await runWithDefaultsEmitter({}); + expectDiagnosticEmpty(diagnostics); + ok(context, "Emit context should have been set."); + strictEqual(context.options["target-name"], "defaultTarget"); + strictEqual(context.options["max-files"], 10); + strictEqual(context.options["verbose"], false); + }); + + it("user-provided values override defaults", async () => { + const [context, diagnostics] = await runWithDefaultsEmitter({ + "target-name": "custom", + "max-files": 20, + verbose: true, + }); + expectDiagnosticEmpty(diagnostics); + ok(context, "Emit context should have been set."); + strictEqual(context.options["target-name"], "custom"); + strictEqual(context.options["max-files"], 20); + strictEqual(context.options["verbose"], true); + }); + + it("applies defaults only for missing options", async () => { + const [context, diagnostics] = await runWithDefaultsEmitter({ + "target-name": "custom", + }); + expectDiagnosticEmpty(diagnostics); + ok(context, "Emit context should have been set."); + strictEqual(context.options["target-name"], "custom"); + strictEqual(context.options["max-files"], 10); + strictEqual(context.options["verbose"], false); + }); + }); }); From a8d0071fbe0ecffd8dc0fbb6599477082f4f504f Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 9 Mar 2026 19:11:29 +0000 Subject: [PATCH 3/8] chore: add changelog entry for emitter options defaults fix Co-authored-by: markcowl <1054056+markcowl@users.noreply.github.com> --- ...opilot-fix-emitter-options-defaults-2026-2-9-19-8-57.md | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 .chronus/changes/copilot-fix-emitter-options-defaults-2026-2-9-19-8-57.md diff --git a/.chronus/changes/copilot-fix-emitter-options-defaults-2026-2-9-19-8-57.md b/.chronus/changes/copilot-fix-emitter-options-defaults-2026-2-9-19-8-57.md new file mode 100644 index 00000000000..4a8643a6da5 --- /dev/null +++ b/.chronus/changes/copilot-fix-emitter-options-defaults-2026-2-9-19-8-57.md @@ -0,0 +1,7 @@ +--- +changeKind: fix +packages: + - "@typespec/compiler" +--- + +Resolve default values from emitter options JSON schema \ No newline at end of file From 9f2b680a6f88ab06bcbfe7d914b07797aa44809a Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 16 Mar 2026 19:37:36 +0000 Subject: [PATCH 4/8] fix: resolve default values from emitter options JSON schema Merge latest main and reapply changes cleanly. Added useDefaults option to JSONSchemaValidatorOptions and enabled it for emitter option validation. Added tests for schema default values. Co-authored-by: markcowl <1054056+markcowl@users.noreply.github.com> --- ...itter-options-defaults-2026-2-9-19-8-57.md | 7 -- ...tter-options-defaults-2026-3-16-19-32-0.md | 7 ++ packages/compiler/src/core/library.ts | 1 + .../compiler/src/core/schema-validator.ts | 2 + .../test/core/emitter-options.test.ts | 76 +++++++++++++++++++ 5 files changed, 86 insertions(+), 7 deletions(-) delete mode 100644 .chronus/changes/copilot-fix-emitter-options-defaults-2026-2-9-19-8-57.md create mode 100644 .chronus/changes/fix-emitter-options-defaults-2026-3-16-19-32-0.md diff --git a/.chronus/changes/copilot-fix-emitter-options-defaults-2026-2-9-19-8-57.md b/.chronus/changes/copilot-fix-emitter-options-defaults-2026-2-9-19-8-57.md deleted file mode 100644 index 4a8643a6da5..00000000000 --- a/.chronus/changes/copilot-fix-emitter-options-defaults-2026-2-9-19-8-57.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -changeKind: fix -packages: - - "@typespec/compiler" ---- - -Resolve default values from emitter options JSON schema \ No newline at end of file diff --git a/.chronus/changes/fix-emitter-options-defaults-2026-3-16-19-32-0.md b/.chronus/changes/fix-emitter-options-defaults-2026-3-16-19-32-0.md new file mode 100644 index 00000000000..04532cf3df7 --- /dev/null +++ b/.chronus/changes/fix-emitter-options-defaults-2026-3-16-19-32-0.md @@ -0,0 +1,7 @@ +--- +changeKind: fix +packages: + - "@typespec/compiler" +--- + +Resolve default values from emitter options JSON schema. When an emitter defines `default` values in its JSON schema options, those defaults are now applied to `context.options` in `$onEmit`. diff --git a/packages/compiler/src/core/library.ts b/packages/compiler/src/core/library.ts index 24687c6f774..6c417ee5987 100644 --- a/packages/compiler/src/core/library.ts +++ b/packages/compiler/src/core/library.ts @@ -88,6 +88,7 @@ export function createTypeSpecLibrary< if (!emitterOptionValidator && lib.emitter?.options) { emitterOptionValidator = createJSONSchemaValidator(lib.emitter.options, { coerceTypes: true, + useDefaults: true, }); } return emitterOptionValidator; diff --git a/packages/compiler/src/core/schema-validator.ts b/packages/compiler/src/core/schema-validator.ts index f5b7d4439c1..0817d3c6788 100644 --- a/packages/compiler/src/core/schema-validator.ts +++ b/packages/compiler/src/core/schema-validator.ts @@ -16,6 +16,7 @@ import { export interface JSONSchemaValidatorOptions { coerceTypes?: boolean; strict?: boolean; + useDefaults?: boolean; } function absolutePathStatus(path: string): "valid" | "not-absolute" | "windows-style" { @@ -35,6 +36,7 @@ export function createJSONSchemaValidator( const ajv = new Ajv({ strict: options.strict, coerceTypes: options.coerceTypes, + useDefaults: options.useDefaults, allowUnionTypes: true, allErrors: true, } satisfies Options); diff --git a/packages/compiler/test/core/emitter-options.test.ts b/packages/compiler/test/core/emitter-options.test.ts index d0aa5077980..20f9365224f 100644 --- a/packages/compiler/test/core/emitter-options.test.ts +++ b/packages/compiler/test/core/emitter-options.test.ts @@ -20,6 +20,22 @@ const fakeEmitter = createTypeSpecLibrary({ }, }); +const fakeEmitterWithDefaults = createTypeSpecLibrary({ + name: "fake-emitter-defaults", + diagnostics: {}, + emitter: { + options: { + type: "object", + properties: { + "target-name": { type: "string", nullable: true, default: "defaultTarget" }, + "max-files": { type: "number", nullable: true, default: 10 }, + verbose: { type: "boolean", nullable: true, default: false }, + }, + additionalProperties: false, + }, + }, +}); + describe("compiler: emitter options", () => { async function runWithEmitterOptions( options: Record, @@ -127,4 +143,64 @@ describe("compiler: emitter options", () => { }); }); }); + + describe("schema defaults", () => { + async function runWithDefaultsEmitter( + options: Record, + ): Promise<[EmitContext | undefined, readonly Diagnostic[]]> { + let emitContext: EmitContext | undefined; + const diagnostics = await Tester.files({ + "node_modules/fake-emitter-defaults/package.json": JSON.stringify({ + main: "index.js", + }), + "node_modules/fake-emitter-defaults/index.js": mockFile.js({ + $lib: fakeEmitterWithDefaults, + $onEmit: (ctx: EmitContext) => { + emitContext = ctx; + }, + }), + }).diagnose("", { + compilerOptions: { + emit: ["fake-emitter-defaults"], + options: { + "fake-emitter-defaults": options, + }, + }, + }); + return [emitContext, diagnostics]; + } + + it("applies default values from schema when options are not provided", async () => { + const [context, diagnostics] = await runWithDefaultsEmitter({}); + expectDiagnosticEmpty(diagnostics); + ok(context, "Emit context should have been set."); + strictEqual(context.options["target-name"], "defaultTarget"); + strictEqual(context.options["max-files"], 10); + strictEqual(context.options["verbose"], false); + }); + + it("user-provided values override defaults", async () => { + const [context, diagnostics] = await runWithDefaultsEmitter({ + "target-name": "custom", + "max-files": 20, + verbose: true, + }); + expectDiagnosticEmpty(diagnostics); + ok(context, "Emit context should have been set."); + strictEqual(context.options["target-name"], "custom"); + strictEqual(context.options["max-files"], 20); + strictEqual(context.options["verbose"], true); + }); + + it("applies defaults only for missing options", async () => { + const [context, diagnostics] = await runWithDefaultsEmitter({ + "target-name": "custom", + }); + expectDiagnosticEmpty(diagnostics); + ok(context, "Emit context should have been set."); + strictEqual(context.options["target-name"], "custom"); + strictEqual(context.options["max-files"], 10); + strictEqual(context.options["verbose"], false); + }); + }); }); From 35063bb665113330f7705f8f28b7dbc2158812ac Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Mon, 16 Mar 2026 21:21:08 +0000 Subject: [PATCH 5/8] fix(openapi3): resolve "Duplicate type name" error for named union with bytes in multipart body (#10046) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - [x] Analyze root cause of "Duplicate type name" error for multipart union with bytes - [x] Fix `addUsagesInOperation` in `visibility-usage.ts` to traverse multipart body part types - [x] Add test case for union with bytes in multipart body - [x] Add changelog entry - [x] Build and test changes (all 2482 tests pass) - [x] Apply prettier formatting
Original prompt > > ---- > > *This section details on the original issue you should resolve* > > OpenAPI emitter fails on union with bytes for multipart > The following definition > > ```tsp > import "@typespec/http"; > using Http; > > union CreateVideoMultipartBodyInputReference { > bytes, > ImageRefParam, > } > union ImageRefParam { > { > @maxLength(20971520) > image_url: url, > }, > { > file_id: string, > }, > } > model CreateVideoMultipartBody { > > input_reference?: HttpPart; > } > > op createVideo( > @header > contentType: "multipart/form-data", > > @multipartBody > body: CreateVideoMultipartBody, > ): void; > ``` > > Fails with this error message : Duplicate type name: 'CreateVideoMultipartBodyInputReference'. Check @friendlyName decorators and overlap with types in TypeSpec or service namespace. > > Interestingly, if we replace bytes by string or something else, the emission starts working. I'd expect it to work with bytes as well. > > > ## Comments on the Issue (you are @copilot in this section) > > > >
- Fixes microsoft/typespec#10045 --- 💬 Send tasks to Copilot coding agent from [Slack](https://gh.io/cca-slack-docs) and [Teams](https://gh.io/cca-teams-docs) to turn conversations into code. Copilot posts an update in your thread when it's finished. --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: baywet <7905502+baywet@users.noreply.github.com> --- ...penapi3-multipart-union-bytes-2026-3-16.md | 7 +++++ packages/openapi3/src/visibility-usage.ts | 10 +++++++ packages/openapi3/test/multipart.test.ts | 27 +++++++++++++++++++ 3 files changed, 44 insertions(+) create mode 100644 .chronus/changes/fix-openapi3-multipart-union-bytes-2026-3-16.md diff --git a/.chronus/changes/fix-openapi3-multipart-union-bytes-2026-3-16.md b/.chronus/changes/fix-openapi3-multipart-union-bytes-2026-3-16.md new file mode 100644 index 00000000000..264194d9ed4 --- /dev/null +++ b/.chronus/changes/fix-openapi3-multipart-union-bytes-2026-3-16.md @@ -0,0 +1,7 @@ +--- +changeKind: fix +packages: + - "@typespec/openapi3" +--- + +Fix OpenAPI emitter failing with "Duplicate type name" error when using a named union with a `bytes` variant in a multipart body (e.g. `HttpPart` where `MyUnion` includes `bytes`). diff --git a/packages/openapi3/src/visibility-usage.ts b/packages/openapi3/src/visibility-usage.ts index b01ed33dedb..2e30d48499b 100644 --- a/packages/openapi3/src/visibility-usage.ts +++ b/packages/openapi3/src/visibility-usage.ts @@ -152,6 +152,16 @@ function addUsagesInOperation( navigateReferencedTypes(httpOperation.parameters.body.type, visibility, (type, vis) => trackUsage(metadataInfo, usages, type, vis), ); + // For multipart bodies, also navigate part types directly. HttpPart wrappers are + // empty models with no properties, so navigateReferencedTypes won't reach T through + // normal property traversal, causing T to be incorrectly treated as unreachable. + if (httpOperation.parameters.body.bodyKind === "multipart") { + for (const part of httpOperation.parameters.body.parts) { + navigateReferencedTypes(part.body.type, visibility, (type, vis) => + trackUsage(metadataInfo, usages, type, vis), + ); + } + } } for (const param of httpOperation.parameters.parameters) { navigateReferencedTypes(param.param, visibility, (type, vis) => diff --git a/packages/openapi3/test/multipart.test.ts b/packages/openapi3/test/multipart.test.ts index 1858f48e0f7..b5a53caa25d 100644 --- a/packages/openapi3/test/multipart.test.ts +++ b/packages/openapi3/test/multipart.test.ts @@ -91,6 +91,33 @@ worksFor(supportedVersions, ({ openApiFor }) => { description: "My doc", }); }); + + it("named union with bytes variant does not cause 'Duplicate type name' error", async () => { + const res = await openApiFor( + ` + union BinaryOrJson { + bytes, + { file_id: string }, + } + op upload(@header contentType: "multipart/form-data", @multipartBody body: { attachment: HttpPart }): void; + `, + ); + const op = res.paths["/"].post; + // The union should be referenced as a $ref (not inlined), and should be available in components + expect(op.requestBody.content["multipart/form-data"].schema.properties.attachment.$ref).toEqual( + "#/components/schemas/BinaryOrJson", + ); + const schema = res.components.schemas.BinaryOrJson; + expect(schema).toBeDefined(); + // The schema should use anyOf with 2 variants + expect(schema.anyOf).toHaveLength(2); + // The object variant ({file_id: string}) should appear in the schema regardless of version + expect(schema.anyOf).toContainEqual({ + type: "object", + properties: { file_id: { type: "string" } }, + required: ["file_id"], + }); + }); }); worksFor(["3.0.0"], ({ openApiFor }) => { From 40e0fa0c77086bb40e55ef0778571f5ac0c60778 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 16 Mar 2026 22:25:13 +0000 Subject: [PATCH 6/8] fix: apply JSON schema defaults to emitter options Enable useDefaults in AJV for the emitter option validator so that default values defined in the JSON schema are applied to context.options. Fixes #8489 --- .../emitter-options-use-defaults-2026-3-16-22-18-0.md | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 .chronus/changes/emitter-options-use-defaults-2026-3-16-22-18-0.md diff --git a/.chronus/changes/emitter-options-use-defaults-2026-3-16-22-18-0.md b/.chronus/changes/emitter-options-use-defaults-2026-3-16-22-18-0.md new file mode 100644 index 00000000000..95963f17f1e --- /dev/null +++ b/.chronus/changes/emitter-options-use-defaults-2026-3-16-22-18-0.md @@ -0,0 +1,7 @@ +--- +changeKind: fix +packages: + - "@typespec/compiler" +--- + +Apply JSON schema `default` values to emitter options so they appear in `context.options` during `$onEmit`. From 77b4692b7cd781bccc617e7ddceb66683e006b9d Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 16 Mar 2026 22:26:33 +0000 Subject: [PATCH 7/8] chore: remove unrelated files from PR Remove files that were accidentally included via a merge commit. Only the emitter options defaults fix should be in this PR. Co-authored-by: markcowl <1054056+markcowl@users.noreply.github.com> --- ...n-read-only-model-tests-2026-3-6-8-0-10.md | 7 - ...-union-python-tests-2026-03-06-02-30-00.md | 7 - ...2-nested-tags-support-2026-2-1-17-38-24.md | 8 - ...-special-words-enum-2026-02-26-12-04-50.md | 7 - ...-namespace-validation-2026-2-5-21-37-19.md | 7 - ...d-xml-datetime-test-2026-02-11-19-21-36.md | 7 - ...eserialization-test-2026-03-04-05-46-13.md | 6 - ...t-add-xml-enum-test-2026-02-09-22-43-28.md | 7 - ...ort-resolve-codefix-2026-02-26-15-20-26.md | 7 - ...-comparison-in-mockapi-2026-2-6-2-25-28.md | 7 - ...ing-invalid-references-2026-1-9-13-16-6.md | 7 - ...schema-peer-reference-2026-1-6-20-32-20.md | 7 - ...sp-debug-message-issue-2026-1-6-5-49-13.md | 8 - ...rts-mergepatcupdate-2026-03-04-01-11-36.md | 7 - ...d-codefixes-support-2026-02-26-15-20-26.md | 7 - ...r-package-description-2026-3-4-13-43-32.md | 7 - ...tes-testing-framework-2026-1-5-20-11-37.md | 7 - .../cs-extensible-enums-2026-1-12-13-32-47.md | 8 - ...tter-options-cli-info-2026-2-2-13-22-29.md | 8 - ...xport-extensible-enum-2026-2-3-14-47-18.md | 7 - ...ose-set-operation-id-2026-1-11-14-48-58.md | 8 - ...mitter-status-codes-2026-03-04-00-54-22.md | 7 - ...tter-options-defaults-2026-3-16-19-32-0.md | 7 - ...ch-ssl-npm-registry-2026-02-25-19-45-00.md | 7 - ...-join-query-and-colon-2026-2-5-14-53-23.md | 7 - ...er-csharp-template-parameter-2026-03-04.md | 7 - ...anifest-management-2026-1-19-23-57-14-2.md | 8 - ...-manifest-management-2026-1-19-23-57-14.md | 9 - ...-as-json-custom-scalar-2026-2-25-20-0-0.md | 9 - ...rator-state-display-2026-02-02-13-19-46.md | 7 - ...3-nullable-array-constraints-2026-02-25.md | 7 - .../glecaros-file-types-2026-2-3-22-49-17.md | 7 - .../glecaros-file-types-2026-2-3-23-44-19.md | 7 - ...meration-results-test-2026-2-23-22-33-2.md | 7 - ...te-compiler-tester-v2-2026-2-5-15-46-30.md | 8 - ...igrate-tester-v2-libs-2026-2-4-17-51-22.md | 8 - ...ly-writeonly-import-2026-02-18-19-31-00.md | 10 - ...yground-config-as-yaml-2026-1-28-2-0-58.md | 8 - ...layground-speed-init-2026-1-23-16-10-50.md | 8 - ...diff-upstream-skill-2026-02-26-14-34-52.md | 7 - ...emove-includeRootSlash-2026-3-9-2-53-15.md | 7 - ...on-removeEnumPadding-2026-1-27-12-23-22.md | 7 - ...lity-explicit-warning-2026-2-3-13-48-25.md | 7 - ...pgrade-deps-feb-2026-2-2026-1-28-1-9-46.md | 41 --- ...mber-default-instance-2026-1-10-13-31-6.md | 7 - ...mple-msft-extern-fn-2025-10-21-12-47-57.md | 7 - ...mple-msft-extern-fn-2025-10-21-12-48-30.md | 24 -- ...sft-internal-symbols-2026-1-20-15-37-30.md | 7 - ...-msft-internal-symbols-2026-2-2-9-55-50.md | 7 - .../defaultclient/HeaderParamAsyncClient.java | 123 ------- .../defaultclient/HeaderParamClient.java | 119 ------- .../HeaderParamClientBuilder.java | 307 ---------------- .../defaultclient/MixedParamsAsyncClient.java | 127 ------- .../defaultclient/MixedParamsClient.java | 123 ------- .../MixedParamsClientBuilder.java | 307 ---------------- .../MultipleParamsAsyncClient.java | 123 ------- .../defaultclient/MultipleParamsClient.java | 119 ------- .../MultipleParamsClientBuilder.java | 326 ----------------- .../defaultclient/ParamAliasAsyncClient.java | 106 ------ .../defaultclient/ParamAliasClient.java | 102 ------ .../ParamAliasClientBuilder.java | 307 ---------------- .../defaultclient/PathParamAsyncClient.java | 185 ---------- .../defaultclient/PathParamClient.java | 179 ---------- .../defaultclient/PathParamClientBuilder.java | 307 ---------------- .../defaultclient/QueryParamAsyncClient.java | 185 ---------- .../defaultclient/QueryParamClient.java | 179 ---------- .../QueryParamClientBuilder.java | 307 ---------------- .../implementation/HeaderParamClientImpl.java | 272 -------------- .../implementation/MixedParamsClientImpl.java | 279 --------------- .../MultipleParamsClientImpl.java | 293 --------------- .../implementation/ParamAliasClientImpl.java | 241 ------------- .../implementation/PathParamClientImpl.java | 335 ----------------- .../implementation/QueryParamClientImpl.java | 335 ----------------- .../implementation/package-info.java | 11 - .../defaultclient/models/BlobProperties.java | 154 -------- .../defaultclient/models/Input.java | 83 ----- .../defaultclient/models/WithBodyRequest.java | 83 ----- .../defaultclient/models/package-info.java | 11 - .../defaultclient/package-info.java | 11 - ...dividuallyNestedWithHeaderAsyncClient.java | 170 --------- .../IndividuallyNestedWithHeaderClient.java | 164 --------- ...viduallyNestedWithHeaderClientBuilder.java | 309 ---------------- ...ndividuallyNestedWithMixedAsyncClient.java | 180 ---------- .../IndividuallyNestedWithMixedClient.java | 174 --------- ...ividuallyNestedWithMixedClientBuilder.java | 309 ---------------- ...viduallyNestedWithMultipleAsyncClient.java | 170 --------- .../IndividuallyNestedWithMultipleClient.java | 164 --------- ...duallyNestedWithMultipleClientBuilder.java | 329 ----------------- ...duallyNestedWithParamAliasAsyncClient.java | 106 ------ ...ndividuallyNestedWithParamAliasClient.java | 102 ------ ...allyNestedWithParamAliasClientBuilder.java | 312 ---------------- ...IndividuallyNestedWithPathAsyncClient.java | 185 ---------- .../IndividuallyNestedWithPathClient.java | 179 ---------- ...dividuallyNestedWithPathClientBuilder.java | 309 ---------------- ...ndividuallyNestedWithQueryAsyncClient.java | 185 ---------- .../IndividuallyNestedWithQueryClient.java | 179 ---------- ...ividuallyNestedWithQueryClientBuilder.java | 309 ---------------- ...ndividuallyNestedWithHeaderClientImpl.java | 306 ---------------- ...IndividuallyNestedWithMixedClientImpl.java | 313 ---------------- ...ividuallyNestedWithMultipleClientImpl.java | 328 ----------------- ...iduallyNestedWithParamAliasClientImpl.java | 242 ------------- .../IndividuallyNestedWithPathClientImpl.java | 336 ------------------ ...IndividuallyNestedWithQueryClientImpl.java | 336 ------------------ .../implementation/package-info.java | 11 - .../models/BlobProperties.java | 154 -------- .../models/package-info.java | 11 - .../individuallyclient/package-info.java | 11 - .../IndividuallyParentAsyncClient.java | 98 ----- .../IndividuallyParentClient.java | 97 ----- .../IndividuallyParentClientBuilder.java | 288 --------------- ...allyParentNestedWithHeaderAsyncClient.java | 170 --------- ...ividuallyParentNestedWithHeaderClient.java | 164 --------- ...lyParentNestedWithHeaderClientBuilder.java | 312 ---------------- ...uallyParentNestedWithMixedAsyncClient.java | 180 ---------- ...dividuallyParentNestedWithMixedClient.java | 174 --------- ...llyParentNestedWithMixedClientBuilder.java | 312 ---------------- ...lyParentNestedWithMultipleAsyncClient.java | 170 --------- ...iduallyParentNestedWithMultipleClient.java | 164 --------- ...ParentNestedWithMultipleClientBuilder.java | 332 ----------------- ...ParentNestedWithParamAliasAsyncClient.java | 106 ------ ...uallyParentNestedWithParamAliasClient.java | 102 ------ ...rentNestedWithParamAliasClientBuilder.java | 313 ---------------- ...duallyParentNestedWithPathAsyncClient.java | 185 ---------- ...ndividuallyParentNestedWithPathClient.java | 179 ---------- ...allyParentNestedWithPathClientBuilder.java | 312 ---------------- ...uallyParentNestedWithQueryAsyncClient.java | 185 ---------- ...dividuallyParentNestedWithQueryClient.java | 179 ---------- ...llyParentNestedWithQueryClientBuilder.java | 312 ---------------- .../IndividuallyParentClientImpl.java | 166 --------- ...uallyParentNestedWithHeaderClientImpl.java | 306 ---------------- ...duallyParentNestedWithMixedClientImpl.java | 313 ---------------- ...llyParentNestedWithMultipleClientImpl.java | 328 ----------------- ...yParentNestedWithParamAliasClientImpl.java | 243 ------------- ...iduallyParentNestedWithPathClientImpl.java | 336 ------------------ ...duallyParentNestedWithQueryClientImpl.java | 336 ------------------ .../implementation/package-info.java | 11 - .../models/BlobProperties.java | 154 -------- .../models/package-info.java | 11 - .../package-info.java | 11 - ...initialization-defaultclient_metadata.json | 1 - ...alization-individuallyclient_metadata.json | 1 - ...ion-individuallyparentclient_metadata.json | 1 - ...entinitialization-defaultclient.properties | 2 - ...itialization-individuallyclient.properties | 2 - ...zation-individuallyparentclient.properties | 2 - .../generated/HeaderParamClientTestBase.java | 106 ------ ...ividuallyNestedWithPathClientTestBase.java | 112 ------ ...llyParentNestedWithPathClientTestBase.java | 126 ------- 148 files changed, 18834 deletions(-) delete mode 100644 .chronus/changes/add-flatten-read-only-model-tests-2026-3-6-8-0-10.md delete mode 100644 .chronus/changes/add-noauth-union-python-tests-2026-03-06-02-30-00.md delete mode 100644 .chronus/changes/copilot-add-oas-32-nested-tags-support-2026-2-1-17-38-24.md delete mode 100644 .chronus/changes/copilot-add-special-words-enum-2026-02-26-12-04-50.md delete mode 100644 .chronus/changes/copilot-add-versioned-namespace-validation-2026-2-5-21-37-19.md delete mode 100644 .chronus/changes/copilot-add-xml-datetime-test-2026-02-11-19-21-36.md delete mode 100644 .chronus/changes/copilot-add-xml-deserialization-test-2026-03-04-05-46-13.md delete mode 100644 .chronus/changes/copilot-add-xml-enum-test-2026-02-09-22-43-28.md delete mode 100644 .chronus/changes/copilot-compiler-export-resolve-codefix-2026-02-26-15-20-26.md delete mode 100644 .chronus/changes/copilot-fix-float-comparison-in-mockapi-2026-2-6-2-25-28.md delete mode 100644 .chronus/changes/copilot-fix-interpolating-invalid-references-2026-1-9-13-16-6.md delete mode 100644 .chronus/changes/copilot-fix-jsonschema-peer-reference-2026-1-6-20-32-20.md delete mode 100644 .chronus/changes/copilot-fix-lsp-debug-message-issue-2026-1-6-5-49-13.md delete mode 100644 .chronus/changes/copilot-fix-missing-namespace-imports-mergepatcupdate-2026-03-04-01-11-36.md delete mode 100644 .chronus/changes/copilot-playground-codefixes-support-2026-02-26-15-20-26.md delete mode 100644 .chronus/changes/copilot-update-compiler-package-description-2026-3-4-13-43-32.md delete mode 100644 .chronus/changes/copilot-update-init-templates-testing-framework-2026-1-5-20-11-37.md delete mode 100644 .chronus/changes/cs-extensible-enums-2026-1-12-13-32-47.md delete mode 100644 .chronus/changes/emitter-options-cli-info-2026-2-2-13-22-29.md delete mode 100644 .chronus/changes/export-extensible-enum-2026-2-3-14-47-18.md delete mode 100644 .chronus/changes/expose-set-operation-id-2026-1-11-14-48-58.md delete mode 100644 .chronus/changes/fix-csharp-emitter-status-codes-2026-03-04-00-54-22.md delete mode 100644 .chronus/changes/fix-emitter-options-defaults-2026-3-16-19-32-0.md delete mode 100644 .chronus/changes/fix-fetch-ssl-npm-registry-2026-02-25-19-45-00.md delete mode 100644 .chronus/changes/fix-http-no-join-query-and-colon-2026-2-5-14-53-23.md delete mode 100644 .chronus/changes/fix-http-server-csharp-template-parameter-2026-03-04.md delete mode 100644 .chronus/changes/fix-https-specs-manifest-management-2026-1-19-23-57-14-2.md delete mode 100644 .chronus/changes/fix-https-specs-manifest-management-2026-1-19-23-57-14.md delete mode 100644 .chronus/changes/fix-ice-serialize-value-as-json-custom-scalar-2026-2-25-20-0-0.md delete mode 100644 .chronus/changes/fix-symbol-decorator-state-display-2026-02-02-13-19-46.md delete mode 100644 .chronus/changes/fix-tsp-openapi3-nullable-array-constraints-2026-02-25.md delete mode 100644 .chronus/changes/glecaros-file-types-2026-2-3-22-49-17.md delete mode 100644 .chronus/changes/glecaros-file-types-2026-2-3-23-44-19.md delete mode 100644 .chronus/changes/http-client-python-xml-enumeration-results-test-2026-2-23-22-33-2.md delete mode 100644 .chronus/changes/migrate-compiler-tester-v2-2026-2-5-15-46-30.md delete mode 100644 .chronus/changes/migrate-tester-v2-libs-2026-2-4-17-51-22.md delete mode 100644 .chronus/changes/openapi3-support-readonly-writeonly-import-2026-02-18-19-31-00.md delete mode 100644 .chronus/changes/playground-config-as-yaml-2026-1-28-2-0-58.md delete mode 100644 .chronus/changes/playground-speed-init-2026-1-23-16-10-50.md delete mode 100644 .chronus/changes/python-diff-upstream-skill-2026-02-26-14-34-52.md delete mode 100644 .chronus/changes/python-remove-includeRootSlash-2026-3-9-2-53-15.md delete mode 100644 .chronus/changes/python-removeEnumPadding-2026-1-27-12-23-22.md delete mode 100644 .chronus/changes/remove-implicit-optionality-explicit-warning-2026-2-3-13-48-25.md delete mode 100644 .chronus/changes/upgrade-deps-feb-2026-2-2026-1-28-1-9-46.md delete mode 100644 .chronus/changes/witemple-msft-alias-member-default-instance-2026-1-10-13-31-6.md delete mode 100644 .chronus/changes/witemple-msft-extern-fn-2025-10-21-12-47-57.md delete mode 100644 .chronus/changes/witemple-msft-extern-fn-2025-10-21-12-48-30.md delete mode 100644 .chronus/changes/witemple-msft-internal-symbols-2026-1-20-15-37-30.md delete mode 100644 .chronus/changes/witemple-msft-internal-symbols-2026-2-2-9-55-50.md delete mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/defaultclient/HeaderParamAsyncClient.java delete mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/defaultclient/HeaderParamClient.java delete mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/defaultclient/HeaderParamClientBuilder.java delete mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/defaultclient/MixedParamsAsyncClient.java delete mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/defaultclient/MixedParamsClient.java delete mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/defaultclient/MixedParamsClientBuilder.java delete mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/defaultclient/MultipleParamsAsyncClient.java delete mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/defaultclient/MultipleParamsClient.java delete mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/defaultclient/MultipleParamsClientBuilder.java delete mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/defaultclient/ParamAliasAsyncClient.java delete mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/defaultclient/ParamAliasClient.java delete mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/defaultclient/ParamAliasClientBuilder.java delete mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/defaultclient/PathParamAsyncClient.java delete mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/defaultclient/PathParamClient.java delete mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/defaultclient/PathParamClientBuilder.java delete mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/defaultclient/QueryParamAsyncClient.java delete mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/defaultclient/QueryParamClient.java delete mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/defaultclient/QueryParamClientBuilder.java delete mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/defaultclient/implementation/HeaderParamClientImpl.java delete mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/defaultclient/implementation/MixedParamsClientImpl.java delete mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/defaultclient/implementation/MultipleParamsClientImpl.java delete mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/defaultclient/implementation/ParamAliasClientImpl.java delete mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/defaultclient/implementation/PathParamClientImpl.java delete mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/defaultclient/implementation/QueryParamClientImpl.java delete mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/defaultclient/implementation/package-info.java delete mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/defaultclient/models/BlobProperties.java delete mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/defaultclient/models/Input.java delete mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/defaultclient/models/WithBodyRequest.java delete mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/defaultclient/models/package-info.java delete mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/defaultclient/package-info.java delete mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyclient/IndividuallyNestedWithHeaderAsyncClient.java delete mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyclient/IndividuallyNestedWithHeaderClient.java delete mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyclient/IndividuallyNestedWithHeaderClientBuilder.java delete mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyclient/IndividuallyNestedWithMixedAsyncClient.java delete mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyclient/IndividuallyNestedWithMixedClient.java delete mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyclient/IndividuallyNestedWithMixedClientBuilder.java delete mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyclient/IndividuallyNestedWithMultipleAsyncClient.java delete mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyclient/IndividuallyNestedWithMultipleClient.java delete mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyclient/IndividuallyNestedWithMultipleClientBuilder.java delete mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyclient/IndividuallyNestedWithParamAliasAsyncClient.java delete mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyclient/IndividuallyNestedWithParamAliasClient.java delete mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyclient/IndividuallyNestedWithParamAliasClientBuilder.java delete mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyclient/IndividuallyNestedWithPathAsyncClient.java delete mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyclient/IndividuallyNestedWithPathClient.java delete mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyclient/IndividuallyNestedWithPathClientBuilder.java delete mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyclient/IndividuallyNestedWithQueryAsyncClient.java delete mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyclient/IndividuallyNestedWithQueryClient.java delete mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyclient/IndividuallyNestedWithQueryClientBuilder.java delete mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyclient/implementation/IndividuallyNestedWithHeaderClientImpl.java delete mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyclient/implementation/IndividuallyNestedWithMixedClientImpl.java delete mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyclient/implementation/IndividuallyNestedWithMultipleClientImpl.java delete mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyclient/implementation/IndividuallyNestedWithParamAliasClientImpl.java delete mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyclient/implementation/IndividuallyNestedWithPathClientImpl.java delete mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyclient/implementation/IndividuallyNestedWithQueryClientImpl.java delete mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyclient/implementation/package-info.java delete mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyclient/models/BlobProperties.java delete mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyclient/models/package-info.java delete mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyclient/package-info.java delete mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyparentclient/IndividuallyParentAsyncClient.java delete mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyparentclient/IndividuallyParentClient.java delete mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyparentclient/IndividuallyParentClientBuilder.java delete mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyparentclient/IndividuallyParentNestedWithHeaderAsyncClient.java delete mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyparentclient/IndividuallyParentNestedWithHeaderClient.java delete mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyparentclient/IndividuallyParentNestedWithHeaderClientBuilder.java delete mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyparentclient/IndividuallyParentNestedWithMixedAsyncClient.java delete mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyparentclient/IndividuallyParentNestedWithMixedClient.java delete mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyparentclient/IndividuallyParentNestedWithMixedClientBuilder.java delete mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyparentclient/IndividuallyParentNestedWithMultipleAsyncClient.java delete mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyparentclient/IndividuallyParentNestedWithMultipleClient.java delete mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyparentclient/IndividuallyParentNestedWithMultipleClientBuilder.java delete mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyparentclient/IndividuallyParentNestedWithParamAliasAsyncClient.java delete mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyparentclient/IndividuallyParentNestedWithParamAliasClient.java delete mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyparentclient/IndividuallyParentNestedWithParamAliasClientBuilder.java delete mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyparentclient/IndividuallyParentNestedWithPathAsyncClient.java delete mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyparentclient/IndividuallyParentNestedWithPathClient.java delete mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyparentclient/IndividuallyParentNestedWithPathClientBuilder.java delete mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyparentclient/IndividuallyParentNestedWithQueryAsyncClient.java delete mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyparentclient/IndividuallyParentNestedWithQueryClient.java delete mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyparentclient/IndividuallyParentNestedWithQueryClientBuilder.java delete mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyparentclient/implementation/IndividuallyParentClientImpl.java delete mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyparentclient/implementation/IndividuallyParentNestedWithHeaderClientImpl.java delete mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyparentclient/implementation/IndividuallyParentNestedWithMixedClientImpl.java delete mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyparentclient/implementation/IndividuallyParentNestedWithMultipleClientImpl.java delete mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyparentclient/implementation/IndividuallyParentNestedWithParamAliasClientImpl.java delete mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyparentclient/implementation/IndividuallyParentNestedWithPathClientImpl.java delete mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyparentclient/implementation/IndividuallyParentNestedWithQueryClientImpl.java delete mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyparentclient/implementation/package-info.java delete mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyparentclient/models/BlobProperties.java delete mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyparentclient/models/package-info.java delete mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyparentclient/package-info.java delete mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/resources/META-INF/_specs_-azure-clientgenerator-core-clientinitialization-defaultclient_metadata.json delete mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/resources/META-INF/_specs_-azure-clientgenerator-core-clientinitialization-individuallyclient_metadata.json delete mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/resources/META-INF/_specs_-azure-clientgenerator-core-clientinitialization-individuallyparentclient_metadata.json delete mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/resources/_specs_-azure-clientgenerator-core-clientinitialization-defaultclient.properties delete mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/resources/_specs_-azure-clientgenerator-core-clientinitialization-individuallyclient.properties delete mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/resources/_specs_-azure-clientgenerator-core-clientinitialization-individuallyparentclient.properties delete mode 100644 packages/http-client-java/generator/http-client-generator-test/src/test/java/_specs_/azure/clientgenerator/core/clientinitialization/defaultclient/generated/HeaderParamClientTestBase.java delete mode 100644 packages/http-client-java/generator/http-client-generator-test/src/test/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyclient/generated/IndividuallyNestedWithPathClientTestBase.java delete mode 100644 packages/http-client-java/generator/http-client-generator-test/src/test/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyparentclient/generated/IndividuallyParentNestedWithPathClientTestBase.java diff --git a/.chronus/changes/add-flatten-read-only-model-tests-2026-3-6-8-0-10.md b/.chronus/changes/add-flatten-read-only-model-tests-2026-3-6-8-0-10.md deleted file mode 100644 index e4bbcfb6773..00000000000 --- a/.chronus/changes/add-flatten-read-only-model-tests-2026-3-6-8-0-10.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -changeKind: internal -packages: - - "@typespec/http-client-python" ---- - -Add test cases for flatten property with read-only properties (putFlattenReadOnlyModel and putFlattenUnknownModel scenarios). diff --git a/.chronus/changes/add-noauth-union-python-tests-2026-03-06-02-30-00.md b/.chronus/changes/add-noauth-union-python-tests-2026-03-06-02-30-00.md deleted file mode 100644 index 265e8f78c14..00000000000 --- a/.chronus/changes/add-noauth-union-python-tests-2026-03-06-02-30-00.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -changeKind: internal -packages: - - "@typespec/http-client-python" ---- - -Add mock API tests for authentication/noauth/union Spector case (sync + async). diff --git a/.chronus/changes/copilot-add-oas-32-nested-tags-support-2026-2-1-17-38-24.md b/.chronus/changes/copilot-add-oas-32-nested-tags-support-2026-2-1-17-38-24.md deleted file mode 100644 index 1dbc399a12f..00000000000 --- a/.chronus/changes/copilot-add-oas-32-nested-tags-support-2026-2-1-17-38-24.md +++ /dev/null @@ -1,8 +0,0 @@ ---- -changeKind: feature -packages: - - "@typespec/openapi" - - "@typespec/openapi3" ---- - -Add support for OpenAPI 3.2 nested tags via `parent` field in `@tagMetadata` decorator \ No newline at end of file diff --git a/.chronus/changes/copilot-add-special-words-enum-2026-02-26-12-04-50.md b/.chronus/changes/copilot-add-special-words-enum-2026-02-26-12-04-50.md deleted file mode 100644 index 275564f4140..00000000000 --- a/.chronus/changes/copilot-add-special-words-enum-2026-02-26-12-04-50.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -changeKind: feature -packages: - - "@typespec/http-specs" ---- - -Add spector case for extensible enum with special word member names diff --git a/.chronus/changes/copilot-add-versioned-namespace-validation-2026-2-5-21-37-19.md b/.chronus/changes/copilot-add-versioned-namespace-validation-2026-2-5-21-37-19.md deleted file mode 100644 index 3047c2cc49f..00000000000 --- a/.chronus/changes/copilot-add-versioned-namespace-validation-2026-2-5-21-37-19.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -changeKind: fix -packages: - - "@typespec/compiler" ---- - -Fix `@overload` interface validation failing when the enclosing namespace is versioned \ No newline at end of file diff --git a/.chronus/changes/copilot-add-xml-datetime-test-2026-02-11-19-21-36.md b/.chronus/changes/copilot-add-xml-datetime-test-2026-02-11-19-21-36.md deleted file mode 100644 index f848784f478..00000000000 --- a/.chronus/changes/copilot-add-xml-datetime-test-2026-02-11-19-21-36.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -changeKind: feature -packages: - - "@typespec/http-specs" ---- - -Add test case for XML model with datetime properties (rfc3339 and rfc7231 encodings) diff --git a/.chronus/changes/copilot-add-xml-deserialization-test-2026-03-04-05-46-13.md b/.chronus/changes/copilot-add-xml-deserialization-test-2026-03-04-05-46-13.md deleted file mode 100644 index e006e732936..00000000000 --- a/.chronus/changes/copilot-add-xml-deserialization-test-2026-03-04-05-46-13.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -changeKind: fix -packages: - - "@typespec/http-client-python" ---- -Return empty list instead of None for non-optional unwrapped XML list fields during deserialization diff --git a/.chronus/changes/copilot-add-xml-enum-test-2026-02-09-22-43-28.md b/.chronus/changes/copilot-add-xml-enum-test-2026-02-09-22-43-28.md deleted file mode 100644 index 3d4fa35812d..00000000000 --- a/.chronus/changes/copilot-add-xml-enum-test-2026-02-09-22-43-28.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -changeKind: feature -packages: - - "@typespec/http-specs" ---- - -Add test case for XML model with enum property diff --git a/.chronus/changes/copilot-compiler-export-resolve-codefix-2026-02-26-15-20-26.md b/.chronus/changes/copilot-compiler-export-resolve-codefix-2026-02-26-15-20-26.md deleted file mode 100644 index 5b8d5db6b70..00000000000 --- a/.chronus/changes/copilot-compiler-export-resolve-codefix-2026-02-26-15-20-26.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -changeKind: feature -packages: - - "@typespec/compiler" ---- - -Export `resolveCodeFix` function to allow resolving a `CodeFix` into `CodeFixEdit[]` without the LSP layer. diff --git a/.chronus/changes/copilot-fix-float-comparison-in-mockapi-2026-2-6-2-25-28.md b/.chronus/changes/copilot-fix-float-comparison-in-mockapi-2026-2-6-2-25-28.md deleted file mode 100644 index 5d6b60064d3..00000000000 --- a/.chronus/changes/copilot-fix-float-comparison-in-mockapi-2026-2-6-2-25-28.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -changeKind: fix -packages: - - "@typespec/http-specs" ---- - -Fix float comparison in duration encode mockapi for query and header params to use numeric comparison instead of string comparison, allowing values like `35625.0` to match `35625` \ No newline at end of file diff --git a/.chronus/changes/copilot-fix-interpolating-invalid-references-2026-1-9-13-16-6.md b/.chronus/changes/copilot-fix-interpolating-invalid-references-2026-1-9-13-16-6.md deleted file mode 100644 index 6368670162f..00000000000 --- a/.chronus/changes/copilot-fix-interpolating-invalid-references-2026-1-9-13-16-6.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -changeKind: fix -packages: - - "@typespec/compiler" ---- - -Don't report `non-literal-string-template` diagnostic when interpolating an invalid reference \ No newline at end of file diff --git a/.chronus/changes/copilot-fix-jsonschema-peer-reference-2026-1-6-20-32-20.md b/.chronus/changes/copilot-fix-jsonschema-peer-reference-2026-1-6-20-32-20.md deleted file mode 100644 index 70d54b3f4a4..00000000000 --- a/.chronus/changes/copilot-fix-jsonschema-peer-reference-2026-1-6-20-32-20.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -changeKind: fix -packages: - - "@typespec/openapi3" ---- - -importer - Fix OpenAPI3 import to support JSON Schema 2020-12 sibling keywords alongside $ref (default, constraints, deprecated, etc.) \ No newline at end of file diff --git a/.chronus/changes/copilot-fix-lsp-debug-message-issue-2026-1-6-5-49-13.md b/.chronus/changes/copilot-fix-lsp-debug-message-issue-2026-1-6-5-49-13.md deleted file mode 100644 index 51dddb2892a..00000000000 --- a/.chronus/changes/copilot-fix-lsp-debug-message-issue-2026-1-6-5-49-13.md +++ /dev/null @@ -1,8 +0,0 @@ ---- -changeKind: internal -packages: - - "@typespec/compiler" - - typespec-vscode ---- - -Gate debug logs behind TYPESPEC_DEBUG environment variable to suppress spam messages during compilation \ No newline at end of file diff --git a/.chronus/changes/copilot-fix-missing-namespace-imports-mergepatcupdate-2026-03-04-01-11-36.md b/.chronus/changes/copilot-fix-missing-namespace-imports-mergepatcupdate-2026-03-04-01-11-36.md deleted file mode 100644 index f432bd604af..00000000000 --- a/.chronus/changes/copilot-fix-missing-namespace-imports-mergepatcupdate-2026-03-04-01-11-36.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -changeKind: fix -packages: - - "@typespec/http-server-csharp" ---- - -Fix missing `using` namespace imports in C# files generated from `MergePatchUpdate` when model properties reference enum or named types from a different namespace diff --git a/.chronus/changes/copilot-playground-codefixes-support-2026-02-26-15-20-26.md b/.chronus/changes/copilot-playground-codefixes-support-2026-02-26-15-20-26.md deleted file mode 100644 index e5e6010ce2f..00000000000 --- a/.chronus/changes/copilot-playground-codefixes-support-2026-02-26-15-20-26.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -changeKind: feature -packages: - - "@typespec/playground" ---- - -Add codefix support in the playground. Quick fixes are now surfaced as Monaco code actions when the cursor is on a diagnostic. diff --git a/.chronus/changes/copilot-update-compiler-package-description-2026-3-4-13-43-32.md b/.chronus/changes/copilot-update-compiler-package-description-2026-3-4-13-43-32.md deleted file mode 100644 index 8df4d360c7b..00000000000 --- a/.chronus/changes/copilot-update-compiler-package-description-2026-3-4-13-43-32.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -changeKind: internal -packages: - - "@typespec/compiler" ---- - -Update package description to remove outdated "Preview" label diff --git a/.chronus/changes/copilot-update-init-templates-testing-framework-2026-1-5-20-11-37.md b/.chronus/changes/copilot-update-init-templates-testing-framework-2026-1-5-20-11-37.md deleted file mode 100644 index cf2f9c23e28..00000000000 --- a/.chronus/changes/copilot-update-init-templates-testing-framework-2026-1-5-20-11-37.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -changeKind: internal -packages: - - "@typespec/compiler" ---- - -Update init templates to use createTester API and modern ESLint configuration \ No newline at end of file diff --git a/.chronus/changes/cs-extensible-enums-2026-1-12-13-32-47.md b/.chronus/changes/cs-extensible-enums-2026-1-12-13-32-47.md deleted file mode 100644 index a9cf004ae1d..00000000000 --- a/.chronus/changes/cs-extensible-enums-2026-1-12-13-32-47.md +++ /dev/null @@ -1,8 +0,0 @@ ---- -# Change versionKind to one of: internal, fix, dependencies, feature, deprecation, breaking -changeKind: feature -packages: - - "@typespec/emitter-framework" ---- - -[csharp] Add new `ExtensibleEnumDeclaration` component allowing an unbound enum representation using a c# `struct` diff --git a/.chronus/changes/emitter-options-cli-info-2026-2-2-13-22-29.md b/.chronus/changes/emitter-options-cli-info-2026-2-2-13-22-29.md deleted file mode 100644 index d8da42a41b9..00000000000 --- a/.chronus/changes/emitter-options-cli-info-2026-2-2-13-22-29.md +++ /dev/null @@ -1,8 +0,0 @@ ---- -# Change versionKind to one of: internal, fix, dependencies, feature, deprecation, breaking -changeKind: feature -packages: - - "@typespec/compiler" ---- - -`tsp info` now accepts an optional `` argument to display detailed information about a specific library or emitter, including all available options. diff --git a/.chronus/changes/export-extensible-enum-2026-2-3-14-47-18.md b/.chronus/changes/export-extensible-enum-2026-2-3-14-47-18.md deleted file mode 100644 index 0b2f5e436ac..00000000000 --- a/.chronus/changes/export-extensible-enum-2026-2-3-14-47-18.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -changeKind: fix -packages: - - "@typespec/emitter-framework" ---- - -Add the missing export in index for extensible-enum in csharp diff --git a/.chronus/changes/expose-set-operation-id-2026-1-11-14-48-58.md b/.chronus/changes/expose-set-operation-id-2026-1-11-14-48-58.md deleted file mode 100644 index 603c8ad335b..00000000000 --- a/.chronus/changes/expose-set-operation-id-2026-1-11-14-48-58.md +++ /dev/null @@ -1,8 +0,0 @@ ---- -# Change versionKind to one of: internal, fix, dependencies, feature, deprecation, breaking -changeKind: fix -packages: - - "@typespec/openapi" ---- - -[API] Expose `setOperationId` diff --git a/.chronus/changes/fix-csharp-emitter-status-codes-2026-03-04-00-54-22.md b/.chronus/changes/fix-csharp-emitter-status-codes-2026-03-04-00-54-22.md deleted file mode 100644 index 22be7cedb04..00000000000 --- a/.chronus/changes/fix-csharp-emitter-status-codes-2026-03-04-00-54-22.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -changeKind: fix -packages: - - "@typespec/http-server-csharp" ---- - -Fix controller generation to use correct ASP.NET Core result methods for non-200/204 status codes. Previously all operations returned `Ok(...)` or `NoContent()` regardless of the declared status code. Now operations returning 202 use `Accepted(...)`, and other status codes use `StatusCode(code, ...)`. diff --git a/.chronus/changes/fix-emitter-options-defaults-2026-3-16-19-32-0.md b/.chronus/changes/fix-emitter-options-defaults-2026-3-16-19-32-0.md deleted file mode 100644 index 04532cf3df7..00000000000 --- a/.chronus/changes/fix-emitter-options-defaults-2026-3-16-19-32-0.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -changeKind: fix -packages: - - "@typespec/compiler" ---- - -Resolve default values from emitter options JSON schema. When an emitter defines `default` values in its JSON schema options, those defaults are now applied to `context.options` in `$onEmit`. diff --git a/.chronus/changes/fix-fetch-ssl-npm-registry-2026-02-25-19-45-00.md b/.chronus/changes/fix-fetch-ssl-npm-registry-2026-02-25-19-45-00.md deleted file mode 100644 index e5755ca4ecf..00000000000 --- a/.chronus/changes/fix-fetch-ssl-npm-registry-2026-02-25-19-45-00.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -changeKind: fix -packages: - - "@typespec/compiler" ---- - -Support `TYPESPEC_NPM_REGISTRY` environment variable to configure the npm registry used by `tsp init` and `tsp install` when fetching package manifests and downloading packages. diff --git a/.chronus/changes/fix-http-no-join-query-and-colon-2026-2-5-14-53-23.md b/.chronus/changes/fix-http-no-join-query-and-colon-2026-2-5-14-53-23.md deleted file mode 100644 index 76e79e3dbbf..00000000000 --- a/.chronus/changes/fix-http-no-join-query-and-colon-2026-2-5-14-53-23.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -changeKind: fix -packages: - - "@typespec/http" ---- - -Do not join routes starting with `?` or `:` with `/`(e.g. `@route("?pet=cat)` would result in `/?pet=cat`) diff --git a/.chronus/changes/fix-http-server-csharp-template-parameter-2026-03-04.md b/.chronus/changes/fix-http-server-csharp-template-parameter-2026-03-04.md deleted file mode 100644 index c574fda1eb7..00000000000 --- a/.chronus/changes/fix-http-server-csharp-template-parameter-2026-03-04.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -changeKind: fix -packages: - - "@typespec/http-server-csharp" ---- - -Fix crash when emitting interfaces that contain template operations. Template operations (e.g. `getItem(): T`) within interfaces will simply be skipped when emitting the interface. diff --git a/.chronus/changes/fix-https-specs-manifest-management-2026-1-19-23-57-14-2.md b/.chronus/changes/fix-https-specs-manifest-management-2026-1-19-23-57-14-2.md deleted file mode 100644 index 9fb37b8000d..00000000000 --- a/.chronus/changes/fix-https-specs-manifest-management-2026-1-19-23-57-14-2.md +++ /dev/null @@ -1,8 +0,0 @@ ---- -# Change versionKind to one of: internal, fix, dependencies, feature, deprecation, breaking -changeKind: internal -packages: - - "@typespec/http-specs" ---- - -Better way to deal with manifests diff --git a/.chronus/changes/fix-https-specs-manifest-management-2026-1-19-23-57-14.md b/.chronus/changes/fix-https-specs-manifest-management-2026-1-19-23-57-14.md deleted file mode 100644 index f0f55598931..00000000000 --- a/.chronus/changes/fix-https-specs-manifest-management-2026-1-19-23-57-14.md +++ /dev/null @@ -1,9 +0,0 @@ ---- -# Change versionKind to one of: internal, fix, dependencies, feature, deprecation, breaking -changeKind: fix -packages: - - "@typespec/spec-coverage-sdk" - - "@typespec/spector" ---- - -Update to how coverage manifest are managed. The manifest upload each individual one as a single file diff --git a/.chronus/changes/fix-ice-serialize-value-as-json-custom-scalar-2026-2-25-20-0-0.md b/.chronus/changes/fix-ice-serialize-value-as-json-custom-scalar-2026-2-25-20-0-0.md deleted file mode 100644 index 25affad8bba..00000000000 --- a/.chronus/changes/fix-ice-serialize-value-as-json-custom-scalar-2026-2-25-20-0-0.md +++ /dev/null @@ -1,9 +0,0 @@ ---- -changeKind: fix -packages: - - "@typespec/compiler" ---- - -Fix crash when using custom scalar initializer in examples or default values - [API] Fix crash in `serializeValueAsJson` when a custom scalar initializer has no recognized constructor (e.g. `S.i()` with no args). Now returns `undefined` instead of crashing. - diff --git a/.chronus/changes/fix-symbol-decorator-state-display-2026-02-02-13-19-46.md b/.chronus/changes/fix-symbol-decorator-state-display-2026-02-02-13-19-46.md deleted file mode 100644 index 18c593935c8..00000000000 --- a/.chronus/changes/fix-symbol-decorator-state-display-2026-02-02-13-19-46.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -changeKind: fix -packages: - - "@typespec/html-program-viewer" ---- - -Fix type graph viewer to display Symbol-keyed decorator state diff --git a/.chronus/changes/fix-tsp-openapi3-nullable-array-constraints-2026-02-25.md b/.chronus/changes/fix-tsp-openapi3-nullable-array-constraints-2026-02-25.md deleted file mode 100644 index 11c35b62cd8..00000000000 --- a/.chronus/changes/fix-tsp-openapi3-nullable-array-constraints-2026-02-25.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -changeKind: fix -packages: - - "@typespec/openapi3" ---- - -openapi3 - Fix `tsp-openapi3` ignoring array constraints (`minItems`, `maxItems`) on nullable arrays defined with `anyOf` + `null` diff --git a/.chronus/changes/glecaros-file-types-2026-2-3-22-49-17.md b/.chronus/changes/glecaros-file-types-2026-2-3-22-49-17.md deleted file mode 100644 index c2e5a32570e..00000000000 --- a/.chronus/changes/glecaros-file-types-2026-2-3-22-49-17.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -changeKind: feature -packages: - - "@typespec/openapi3" ---- - -`file-type` can now receive an array to allow emitting both `json` and `yaml` output in the same run. \ No newline at end of file diff --git a/.chronus/changes/glecaros-file-types-2026-2-3-23-44-19.md b/.chronus/changes/glecaros-file-types-2026-2-3-23-44-19.md deleted file mode 100644 index ed9f0627572..00000000000 --- a/.chronus/changes/glecaros-file-types-2026-2-3-23-44-19.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -changeKind: feature -packages: - - "@typespec/playground" ---- - -Add support for oneOf option schemas. \ No newline at end of file diff --git a/.chronus/changes/http-client-python-xml-enumeration-results-test-2026-2-23-22-33-2.md b/.chronus/changes/http-client-python-xml-enumeration-results-test-2026-2-23-22-33-2.md deleted file mode 100644 index c4a7ac65651..00000000000 --- a/.chronus/changes/http-client-python-xml-enumeration-results-test-2026-2-23-22-33-2.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -changeKind: internal -packages: - - "@typespec/http-client-python" ---- - -Add unit test for deserializing Azure Blob Storage EnumerationResults XML payload with attributes, empty list element, and empty string element. diff --git a/.chronus/changes/migrate-compiler-tester-v2-2026-2-5-15-46-30.md b/.chronus/changes/migrate-compiler-tester-v2-2026-2-5-15-46-30.md deleted file mode 100644 index 318aedfea24..00000000000 --- a/.chronus/changes/migrate-compiler-tester-v2-2026-2-5-15-46-30.md +++ /dev/null @@ -1,8 +0,0 @@ ---- -# Change versionKind to one of: internal, fix, dependencies, feature, deprecation, breaking -changeKind: internal -packages: - - "@typespec/compiler" ---- - -Migrate compiler test to tester v2 diff --git a/.chronus/changes/migrate-tester-v2-libs-2026-2-4-17-51-22.md b/.chronus/changes/migrate-tester-v2-libs-2026-2-4-17-51-22.md deleted file mode 100644 index f98f0d1ea29..00000000000 --- a/.chronus/changes/migrate-tester-v2-libs-2026-2-4-17-51-22.md +++ /dev/null @@ -1,8 +0,0 @@ ---- -# Change versionKind to one of: internal, fix, dependencies, feature, deprecation, breaking -changeKind: internal -packages: - - "@typespec/html-program-viewer" ---- - -Migrate all libraries except compiler to tester v2 diff --git a/.chronus/changes/openapi3-support-readonly-writeonly-import-2026-02-18-19-31-00.md b/.chronus/changes/openapi3-support-readonly-writeonly-import-2026-02-18-19-31-00.md deleted file mode 100644 index 0c550ed3334..00000000000 --- a/.chronus/changes/openapi3-support-readonly-writeonly-import-2026-02-18-19-31-00.md +++ /dev/null @@ -1,10 +0,0 @@ ---- -changeKind: feature -packages: - - "@typespec/openapi3" ---- - -Import tool: Support importing `readOnly` and `writeOnly` properties from OpenAPI. -- `readOnly: true` is converted to `@visibility(Lifecycle.Read)` -- `writeOnly: true` is converted to `@visibility(Lifecycle.Create)` -- Both properties are mutually exclusive, a warning is emitted if both are present and both are ignored diff --git a/.chronus/changes/playground-config-as-yaml-2026-1-28-2-0-58.md b/.chronus/changes/playground-config-as-yaml-2026-1-28-2-0-58.md deleted file mode 100644 index 7773a0f2faa..00000000000 --- a/.chronus/changes/playground-config-as-yaml-2026-1-28-2-0-58.md +++ /dev/null @@ -1,8 +0,0 @@ ---- -# Change versionKind to one of: internal, fix, dependencies, feature, deprecation, breaking -changeKind: feature -packages: - - "@typespec/playground" ---- - -Redesigned emitter options dialog into a config panel allowing to edit the raw `tspconfig.yaml` diff --git a/.chronus/changes/playground-speed-init-2026-1-23-16-10-50.md b/.chronus/changes/playground-speed-init-2026-1-23-16-10-50.md deleted file mode 100644 index a2d135195d7..00000000000 --- a/.chronus/changes/playground-speed-init-2026-1-23-16-10-50.md +++ /dev/null @@ -1,8 +0,0 @@ ---- -# Change versionKind to one of: internal, fix, dependencies, feature, deprecation, breaking -changeKind: fix -packages: - - "@typespec/playground" ---- - -Optimization: Fetch all libraries in parallel diff --git a/.chronus/changes/python-diff-upstream-skill-2026-02-26-14-34-52.md b/.chronus/changes/python-diff-upstream-skill-2026-02-26-14-34-52.md deleted file mode 100644 index 985fc71b66d..00000000000 --- a/.chronus/changes/python-diff-upstream-skill-2026-02-26-14-34-52.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -changeKind: internal -packages: - - "@typespec/http-client-python" ---- - -Add diff-upstream skill for comparing generated code against autorest.python baseline diff --git a/.chronus/changes/python-remove-includeRootSlash-2026-3-9-2-53-15.md b/.chronus/changes/python-remove-includeRootSlash-2026-3-9-2-53-15.md deleted file mode 100644 index 2e03aae584f..00000000000 --- a/.chronus/changes/python-remove-includeRootSlash-2026-3-9-2-53-15.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -changeKind: fix -packages: - - "@typespec/http-client-python" ---- - -Remove includeRootSlash client option logic, which should be handled at the TypeSpec core level diff --git a/.chronus/changes/python-removeEnumPadding-2026-1-27-12-23-22.md b/.chronus/changes/python-removeEnumPadding-2026-1-27-12-23-22.md deleted file mode 100644 index c0e8e0fa7ab..00000000000 --- a/.chronus/changes/python-removeEnumPadding-2026-1-27-12-23-22.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -changeKind: feature -packages: - - "@typespec/http-client-python" ---- - -Remove enum value padding because we generate our enum value names with upper case so there is no need diff --git a/.chronus/changes/remove-implicit-optionality-explicit-warning-2026-2-3-13-48-25.md b/.chronus/changes/remove-implicit-optionality-explicit-warning-2026-2-3-13-48-25.md deleted file mode 100644 index 78495272ef5..00000000000 --- a/.chronus/changes/remove-implicit-optionality-explicit-warning-2026-2-3-13-48-25.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -changeKind: fix -packages: - - "@typespec/http" ---- - -Remove `patch-implicit-optional` warning. diff --git a/.chronus/changes/upgrade-deps-feb-2026-2-2026-1-28-1-9-46.md b/.chronus/changes/upgrade-deps-feb-2026-2-2026-1-28-1-9-46.md deleted file mode 100644 index 351a5eaf71e..00000000000 --- a/.chronus/changes/upgrade-deps-feb-2026-2-2026-1-28-1-9-46.md +++ /dev/null @@ -1,41 +0,0 @@ ---- -# Change versionKind to one of: internal, fix, dependencies, feature, deprecation, breaking -changeKind: dependencies -packages: - - "@typespec/asset-emitter" - - "@typespec/bundler" - - "@typespec/compiler" - - "@typespec/emitter-framework" - - "@typespec/eslint-plugin" - - "@typespec/events" - - "@typespec/html-program-viewer" - - "@typespec/http-canonicalization" - - "@typespec/http-client-js" - - "@typespec/http-client" - - "@typespec/http-server-csharp" - - "@typespec/http-server-js" - - "@typespec/http-specs" - - "@typespec/http" - - "@typespec/internal-build-utils" - - "@typespec/json-schema" - - "@typespec/library-linter" - - "@typespec/mutator-framework" - - "@typespec/openapi" - - "@typespec/openapi3" - - "@typespec/playground" - - "@typespec/prettier-plugin-typespec" - - "@typespec/protobuf" - - "@typespec/rest" - - "@typespec/spec-api" - - "@typespec/spec-coverage-sdk" - - "@typespec/spector" - - "@typespec/sse" - - "@typespec/streams" - - tmlanguage-generator - - "@typespec/tspd" - - typespec-vscode - - "@typespec/versioning" - - "@typespec/xml" ---- - -Upgrade dependencies diff --git a/.chronus/changes/witemple-msft-alias-member-default-instance-2026-1-10-13-31-6.md b/.chronus/changes/witemple-msft-alias-member-default-instance-2026-1-10-13-31-6.md deleted file mode 100644 index 496f70842e4..00000000000 --- a/.chronus/changes/witemple-msft-alias-member-default-instance-2026-1-10-13-31-6.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -changeKind: fix -packages: - - "@typespec/compiler" ---- - -Fixed an issue where referencing a member of a templated alias with defaultable parameters would fail to instantiate the alias, leaking template parameters. \ No newline at end of file diff --git a/.chronus/changes/witemple-msft-extern-fn-2025-10-21-12-47-57.md b/.chronus/changes/witemple-msft-extern-fn-2025-10-21-12-47-57.md deleted file mode 100644 index 97a5c093727..00000000000 --- a/.chronus/changes/witemple-msft-extern-fn-2025-10-21-12-47-57.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -changeKind: feature -packages: - - "@typespec/compiler" ---- - -Added support for Functions, a new type graph entity and language feature. Functions enable library authors to provide input-output style transforms that operate on types and values. See [the Functions Documentation](https://typespec.io/docs/language-basics/functions/) for more information about the use and implementation of functions. diff --git a/.chronus/changes/witemple-msft-extern-fn-2025-10-21-12-48-30.md b/.chronus/changes/witemple-msft-extern-fn-2025-10-21-12-48-30.md deleted file mode 100644 index 649b11b768d..00000000000 --- a/.chronus/changes/witemple-msft-extern-fn-2025-10-21-12-48-30.md +++ /dev/null @@ -1,24 +0,0 @@ ---- -changeKind: internal -packages: - - "@typespec/events" - - "@typespec/html-program-viewer" - - "@typespec/http-client" - - "@typespec/http" - - "@typespec/json-schema" - - "@typespec/openapi" - - "@typespec/protobuf" - - "@typespec/rest" - - "@typespec/spector" - - "@typespec/sse" - - "@typespec/streams" - - "@typespec/tspd" - - "@typespec/versioning" - - "@typespec/xml" - - "@typespec/openapi3" - - "@typespec/http-server-csharp" ---- - -Updated `tspd` to generate extern function signatures. Regenerated all extern signatures. - -Corrected any exhaustive matches over type/value kinds to account for Function types/values. diff --git a/.chronus/changes/witemple-msft-internal-symbols-2026-1-20-15-37-30.md b/.chronus/changes/witemple-msft-internal-symbols-2026-1-20-15-37-30.md deleted file mode 100644 index 875004d80f6..00000000000 --- a/.chronus/changes/witemple-msft-internal-symbols-2026-1-20-15-37-30.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -changeKind: feature -packages: - - "@typespec/compiler" ---- - -Added experimental support for `internal` modifiers on type declarations. Any type _except `namespace`_ can be declared `internal`. An `internal` symbol can only be accessed from within the same package where it was declared. diff --git a/.chronus/changes/witemple-msft-internal-symbols-2026-2-2-9-55-50.md b/.chronus/changes/witemple-msft-internal-symbols-2026-2-2-9-55-50.md deleted file mode 100644 index 4195732120f..00000000000 --- a/.chronus/changes/witemple-msft-internal-symbols-2026-2-2-9-55-50.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -changeKind: internal -packages: - - "@typespec/tspd" ---- - -Updated documentation generation to ignore items tagged `internal`. \ No newline at end of file diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/defaultclient/HeaderParamAsyncClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/defaultclient/HeaderParamAsyncClient.java deleted file mode 100644 index 199262de6a5..00000000000 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/defaultclient/HeaderParamAsyncClient.java +++ /dev/null @@ -1,123 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package _specs_.azure.clientgenerator.core.clientinitialization.defaultclient; - -import _specs_.azure.clientgenerator.core.clientinitialization.defaultclient.implementation.HeaderParamClientImpl; -import _specs_.azure.clientgenerator.core.clientinitialization.defaultclient.models.Input; -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.BinaryData; -import com.azure.core.util.FluxUtil; -import reactor.core.publisher.Mono; - -/** - * Initializes a new instance of the asynchronous HeaderParamClient type. - */ -@ServiceClient(builder = HeaderParamClientBuilder.class, isAsync = true) -public final class HeaderParamAsyncClient { - @Generated - private final HeaderParamClientImpl serviceClient; - - /** - * Initializes an instance of HeaderParamAsyncClient class. - * - * @param serviceClient the service client implementation. - */ - @Generated - HeaderParamAsyncClient(HeaderParamClientImpl serviceClient) { - this.serviceClient = serviceClient; - } - - /** - * The withQuery operation. - * - * @param id The id 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 {@link Response} on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> withQueryWithResponse(String id, RequestOptions requestOptions) { - return this.serviceClient.withQueryWithResponseAsync(id, requestOptions); - } - - /** - * The withBody operation. - *

Request Body Schema

- * - *
-     * {@code
-     * {
-     *     name: String (Required)
-     * }
-     * }
-     * 
- * - * @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. - * @throws ResourceNotFoundException thrown if the request 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> withBodyWithResponse(BinaryData body, RequestOptions requestOptions) { - return this.serviceClient.withBodyWithResponseAsync(body, requestOptions); - } - - /** - * The withQuery operation. - * - * @param id The id 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 A {@link Mono} that completes when a successful response is received. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono withQuery(String id) { - // Generated convenience method for withQueryWithResponse - RequestOptions requestOptions = new RequestOptions(); - return withQueryWithResponse(id, requestOptions).flatMap(FluxUtil::toMono); - } - - /** - * The withBody operation. - * - * @param body The body 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 A {@link Mono} that completes when a successful response is received. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono withBody(Input body) { - // Generated convenience method for withBodyWithResponse - RequestOptions requestOptions = new RequestOptions(); - return withBodyWithResponse(BinaryData.fromObject(body), requestOptions).flatMap(FluxUtil::toMono); - } -} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/defaultclient/HeaderParamClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/defaultclient/HeaderParamClient.java deleted file mode 100644 index 89f1ea9ee4c..00000000000 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/defaultclient/HeaderParamClient.java +++ /dev/null @@ -1,119 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package _specs_.azure.clientgenerator.core.clientinitialization.defaultclient; - -import _specs_.azure.clientgenerator.core.clientinitialization.defaultclient.implementation.HeaderParamClientImpl; -import _specs_.azure.clientgenerator.core.clientinitialization.defaultclient.models.Input; -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.BinaryData; - -/** - * Initializes a new instance of the synchronous HeaderParamClient type. - */ -@ServiceClient(builder = HeaderParamClientBuilder.class) -public final class HeaderParamClient { - @Generated - private final HeaderParamClientImpl serviceClient; - - /** - * Initializes an instance of HeaderParamClient class. - * - * @param serviceClient the service client implementation. - */ - @Generated - HeaderParamClient(HeaderParamClientImpl serviceClient) { - this.serviceClient = serviceClient; - } - - /** - * The withQuery operation. - * - * @param id The id 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 {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response withQueryWithResponse(String id, RequestOptions requestOptions) { - return this.serviceClient.withQueryWithResponse(id, requestOptions); - } - - /** - * The withBody operation. - *

Request Body Schema

- * - *
-     * {@code
-     * {
-     *     name: String (Required)
-     * }
-     * }
-     * 
- * - * @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. - * @throws ResourceNotFoundException thrown if the request 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 withBodyWithResponse(BinaryData body, RequestOptions requestOptions) { - return this.serviceClient.withBodyWithResponse(body, requestOptions); - } - - /** - * The withQuery operation. - * - * @param id The id 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. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public void withQuery(String id) { - // Generated convenience method for withQueryWithResponse - RequestOptions requestOptions = new RequestOptions(); - withQueryWithResponse(id, requestOptions).getValue(); - } - - /** - * The withBody operation. - * - * @param body The body 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. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public void withBody(Input body) { - // Generated convenience method for withBodyWithResponse - RequestOptions requestOptions = new RequestOptions(); - withBodyWithResponse(BinaryData.fromObject(body), requestOptions).getValue(); - } -} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/defaultclient/HeaderParamClientBuilder.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/defaultclient/HeaderParamClientBuilder.java deleted file mode 100644 index 5f08efc49c8..00000000000 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/defaultclient/HeaderParamClientBuilder.java +++ /dev/null @@ -1,307 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package _specs_.azure.clientgenerator.core.clientinitialization.defaultclient; - -import _specs_.azure.clientgenerator.core.clientinitialization.defaultclient.implementation.HeaderParamClientImpl; -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.HttpLogOptions; -import com.azure.core.http.policy.HttpLoggingPolicy; -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 java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.Objects; - -/** - * A builder for creating a new instance of the HeaderParamClient type. - */ -@ServiceClientBuilder(serviceClients = { HeaderParamClient.class, HeaderParamAsyncClient.class }) -public final class HeaderParamClientBuilder 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("_specs_-azure-clientgenerator-core-clientinitialization-defaultclient.properties"); - - @Generated - private final List pipelinePolicies; - - /** - * Create an instance of the HeaderParamClientBuilder. - */ - @Generated - public HeaderParamClientBuilder() { - this.pipelinePolicies = new ArrayList<>(); - } - - /* - * The HTTP client used to send the request. - */ - @Generated - private HttpClient httpClient; - - /** - * {@inheritDoc}. - */ - @Generated - @Override - public HeaderParamClientBuilder httpClient(HttpClient httpClient) { - this.httpClient = httpClient; - return this; - } - - /* - * The HTTP pipeline to send requests through. - */ - @Generated - private HttpPipeline pipeline; - - /** - * {@inheritDoc}. - */ - @Generated - @Override - public HeaderParamClientBuilder 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 logging configuration for HTTP requests and responses. - */ - @Generated - private HttpLogOptions httpLogOptions; - - /** - * {@inheritDoc}. - */ - @Generated - @Override - public HeaderParamClientBuilder 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 HeaderParamClientBuilder 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 HeaderParamClientBuilder retryOptions(RetryOptions retryOptions) { - this.retryOptions = retryOptions; - return this; - } - - /** - * {@inheritDoc}. - */ - @Generated - @Override - public HeaderParamClientBuilder 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 HeaderParamClientBuilder configuration(Configuration configuration) { - this.configuration = configuration; - return this; - } - - /* - * The service endpoint - */ - @Generated - private String endpoint; - - /** - * {@inheritDoc}. - */ - @Generated - @Override - public HeaderParamClientBuilder endpoint(String endpoint) { - this.endpoint = endpoint; - return this; - } - - /* - * - */ - @Generated - private String name; - - /** - * Sets. - * - * @param name the name value. - * @return the HeaderParamClientBuilder. - */ - @Generated - public HeaderParamClientBuilder name(String name) { - this.name = name; - 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 HeaderParamClientBuilder. - */ - @Generated - public HeaderParamClientBuilder retryPolicy(RetryPolicy retryPolicy) { - this.retryPolicy = retryPolicy; - return this; - } - - /** - * Builds an instance of HeaderParamClientImpl with the provided parameters. - * - * @return an instance of HeaderParamClientImpl. - */ - @Generated - private HeaderParamClientImpl buildInnerClient() { - this.validateClient(); - HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); - String localEndpoint = (endpoint != null) ? endpoint : "http://localhost:3000"; - HeaderParamClientImpl client = new HeaderParamClientImpl(localPipeline, - JacksonAdapter.createDefaultSerializerAdapter(), localEndpoint, this.name); - 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(name, "'name' 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 HeaderParamAsyncClient class. - * - * @return an instance of HeaderParamAsyncClient. - */ - @Generated - public HeaderParamAsyncClient buildAsyncClient() { - return new HeaderParamAsyncClient(buildInnerClient()); - } - - /** - * Builds an instance of HeaderParamClient class. - * - * @return an instance of HeaderParamClient. - */ - @Generated - public HeaderParamClient buildClient() { - return new HeaderParamClient(buildInnerClient()); - } - - private static final ClientLogger LOGGER = new ClientLogger(HeaderParamClientBuilder.class); -} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/defaultclient/MixedParamsAsyncClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/defaultclient/MixedParamsAsyncClient.java deleted file mode 100644 index bd7a724adc1..00000000000 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/defaultclient/MixedParamsAsyncClient.java +++ /dev/null @@ -1,127 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package _specs_.azure.clientgenerator.core.clientinitialization.defaultclient; - -import _specs_.azure.clientgenerator.core.clientinitialization.defaultclient.implementation.MixedParamsClientImpl; -import _specs_.azure.clientgenerator.core.clientinitialization.defaultclient.models.WithBodyRequest; -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.BinaryData; -import com.azure.core.util.FluxUtil; -import reactor.core.publisher.Mono; - -/** - * Initializes a new instance of the asynchronous MixedParamsClient type. - */ -@ServiceClient(builder = MixedParamsClientBuilder.class, isAsync = true) -public final class MixedParamsAsyncClient { - @Generated - private final MixedParamsClientImpl serviceClient; - - /** - * Initializes an instance of MixedParamsAsyncClient class. - * - * @param serviceClient the service client implementation. - */ - @Generated - MixedParamsAsyncClient(MixedParamsClientImpl serviceClient) { - this.serviceClient = serviceClient; - } - - /** - * The withQuery operation. - * - * @param region The region parameter. - * @param id The id 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 {@link Response} on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> withQueryWithResponse(String region, String id, RequestOptions requestOptions) { - return this.serviceClient.withQueryWithResponseAsync(region, id, requestOptions); - } - - /** - * The withBody operation. - *

Request Body Schema

- * - *
-     * {@code
-     * {
-     *     name: String (Required)
-     * }
-     * }
-     * 
- * - * @param region The region 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. - * @throws ResourceNotFoundException thrown if the request 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> withBodyWithResponse(String region, BinaryData body, RequestOptions requestOptions) { - return this.serviceClient.withBodyWithResponseAsync(region, body, requestOptions); - } - - /** - * The withQuery operation. - * - * @param region The region parameter. - * @param id The id 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 A {@link Mono} that completes when a successful response is received. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono withQuery(String region, String id) { - // Generated convenience method for withQueryWithResponse - RequestOptions requestOptions = new RequestOptions(); - return withQueryWithResponse(region, id, requestOptions).flatMap(FluxUtil::toMono); - } - - /** - * The withBody operation. - * - * @param region The region parameter. - * @param body The body 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 A {@link Mono} that completes when a successful response is received. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono withBody(String region, WithBodyRequest body) { - // Generated convenience method for withBodyWithResponse - RequestOptions requestOptions = new RequestOptions(); - return withBodyWithResponse(region, BinaryData.fromObject(body), requestOptions).flatMap(FluxUtil::toMono); - } -} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/defaultclient/MixedParamsClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/defaultclient/MixedParamsClient.java deleted file mode 100644 index f0ec7dbdac1..00000000000 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/defaultclient/MixedParamsClient.java +++ /dev/null @@ -1,123 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package _specs_.azure.clientgenerator.core.clientinitialization.defaultclient; - -import _specs_.azure.clientgenerator.core.clientinitialization.defaultclient.implementation.MixedParamsClientImpl; -import _specs_.azure.clientgenerator.core.clientinitialization.defaultclient.models.WithBodyRequest; -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.BinaryData; - -/** - * Initializes a new instance of the synchronous MixedParamsClient type. - */ -@ServiceClient(builder = MixedParamsClientBuilder.class) -public final class MixedParamsClient { - @Generated - private final MixedParamsClientImpl serviceClient; - - /** - * Initializes an instance of MixedParamsClient class. - * - * @param serviceClient the service client implementation. - */ - @Generated - MixedParamsClient(MixedParamsClientImpl serviceClient) { - this.serviceClient = serviceClient; - } - - /** - * The withQuery operation. - * - * @param region The region parameter. - * @param id The id 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 {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response withQueryWithResponse(String region, String id, RequestOptions requestOptions) { - return this.serviceClient.withQueryWithResponse(region, id, requestOptions); - } - - /** - * The withBody operation. - *

Request Body Schema

- * - *
-     * {@code
-     * {
-     *     name: String (Required)
-     * }
-     * }
-     * 
- * - * @param region The region 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. - * @throws ResourceNotFoundException thrown if the request 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 withBodyWithResponse(String region, BinaryData body, RequestOptions requestOptions) { - return this.serviceClient.withBodyWithResponse(region, body, requestOptions); - } - - /** - * The withQuery operation. - * - * @param region The region parameter. - * @param id The id 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. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public void withQuery(String region, String id) { - // Generated convenience method for withQueryWithResponse - RequestOptions requestOptions = new RequestOptions(); - withQueryWithResponse(region, id, requestOptions).getValue(); - } - - /** - * The withBody operation. - * - * @param region The region parameter. - * @param body The body 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. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public void withBody(String region, WithBodyRequest body) { - // Generated convenience method for withBodyWithResponse - RequestOptions requestOptions = new RequestOptions(); - withBodyWithResponse(region, BinaryData.fromObject(body), requestOptions).getValue(); - } -} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/defaultclient/MixedParamsClientBuilder.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/defaultclient/MixedParamsClientBuilder.java deleted file mode 100644 index 74619a2b586..00000000000 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/defaultclient/MixedParamsClientBuilder.java +++ /dev/null @@ -1,307 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package _specs_.azure.clientgenerator.core.clientinitialization.defaultclient; - -import _specs_.azure.clientgenerator.core.clientinitialization.defaultclient.implementation.MixedParamsClientImpl; -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.HttpLogOptions; -import com.azure.core.http.policy.HttpLoggingPolicy; -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 java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.Objects; - -/** - * A builder for creating a new instance of the MixedParamsClient type. - */ -@ServiceClientBuilder(serviceClients = { MixedParamsClient.class, MixedParamsAsyncClient.class }) -public final class MixedParamsClientBuilder 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("_specs_-azure-clientgenerator-core-clientinitialization-defaultclient.properties"); - - @Generated - private final List pipelinePolicies; - - /** - * Create an instance of the MixedParamsClientBuilder. - */ - @Generated - public MixedParamsClientBuilder() { - this.pipelinePolicies = new ArrayList<>(); - } - - /* - * The HTTP client used to send the request. - */ - @Generated - private HttpClient httpClient; - - /** - * {@inheritDoc}. - */ - @Generated - @Override - public MixedParamsClientBuilder httpClient(HttpClient httpClient) { - this.httpClient = httpClient; - return this; - } - - /* - * The HTTP pipeline to send requests through. - */ - @Generated - private HttpPipeline pipeline; - - /** - * {@inheritDoc}. - */ - @Generated - @Override - public MixedParamsClientBuilder 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 logging configuration for HTTP requests and responses. - */ - @Generated - private HttpLogOptions httpLogOptions; - - /** - * {@inheritDoc}. - */ - @Generated - @Override - public MixedParamsClientBuilder 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 MixedParamsClientBuilder 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 MixedParamsClientBuilder retryOptions(RetryOptions retryOptions) { - this.retryOptions = retryOptions; - return this; - } - - /** - * {@inheritDoc}. - */ - @Generated - @Override - public MixedParamsClientBuilder 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 MixedParamsClientBuilder configuration(Configuration configuration) { - this.configuration = configuration; - return this; - } - - /* - * The service endpoint - */ - @Generated - private String endpoint; - - /** - * {@inheritDoc}. - */ - @Generated - @Override - public MixedParamsClientBuilder endpoint(String endpoint) { - this.endpoint = endpoint; - return this; - } - - /* - * - */ - @Generated - private String name; - - /** - * Sets. - * - * @param name the name value. - * @return the MixedParamsClientBuilder. - */ - @Generated - public MixedParamsClientBuilder name(String name) { - this.name = name; - 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 MixedParamsClientBuilder. - */ - @Generated - public MixedParamsClientBuilder retryPolicy(RetryPolicy retryPolicy) { - this.retryPolicy = retryPolicy; - return this; - } - - /** - * Builds an instance of MixedParamsClientImpl with the provided parameters. - * - * @return an instance of MixedParamsClientImpl. - */ - @Generated - private MixedParamsClientImpl buildInnerClient() { - this.validateClient(); - HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); - String localEndpoint = (endpoint != null) ? endpoint : "http://localhost:3000"; - MixedParamsClientImpl client = new MixedParamsClientImpl(localPipeline, - JacksonAdapter.createDefaultSerializerAdapter(), localEndpoint, this.name); - 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(name, "'name' 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 MixedParamsAsyncClient class. - * - * @return an instance of MixedParamsAsyncClient. - */ - @Generated - public MixedParamsAsyncClient buildAsyncClient() { - return new MixedParamsAsyncClient(buildInnerClient()); - } - - /** - * Builds an instance of MixedParamsClient class. - * - * @return an instance of MixedParamsClient. - */ - @Generated - public MixedParamsClient buildClient() { - return new MixedParamsClient(buildInnerClient()); - } - - private static final ClientLogger LOGGER = new ClientLogger(MixedParamsClientBuilder.class); -} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/defaultclient/MultipleParamsAsyncClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/defaultclient/MultipleParamsAsyncClient.java deleted file mode 100644 index 87e44896097..00000000000 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/defaultclient/MultipleParamsAsyncClient.java +++ /dev/null @@ -1,123 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package _specs_.azure.clientgenerator.core.clientinitialization.defaultclient; - -import _specs_.azure.clientgenerator.core.clientinitialization.defaultclient.implementation.MultipleParamsClientImpl; -import _specs_.azure.clientgenerator.core.clientinitialization.defaultclient.models.Input; -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.BinaryData; -import com.azure.core.util.FluxUtil; -import reactor.core.publisher.Mono; - -/** - * Initializes a new instance of the asynchronous MultipleParamsClient type. - */ -@ServiceClient(builder = MultipleParamsClientBuilder.class, isAsync = true) -public final class MultipleParamsAsyncClient { - @Generated - private final MultipleParamsClientImpl serviceClient; - - /** - * Initializes an instance of MultipleParamsAsyncClient class. - * - * @param serviceClient the service client implementation. - */ - @Generated - MultipleParamsAsyncClient(MultipleParamsClientImpl serviceClient) { - this.serviceClient = serviceClient; - } - - /** - * The withQuery operation. - * - * @param id The id 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 {@link Response} on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> withQueryWithResponse(String id, RequestOptions requestOptions) { - return this.serviceClient.withQueryWithResponseAsync(id, requestOptions); - } - - /** - * The withBody operation. - *

Request Body Schema

- * - *
-     * {@code
-     * {
-     *     name: String (Required)
-     * }
-     * }
-     * 
- * - * @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. - * @throws ResourceNotFoundException thrown if the request 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> withBodyWithResponse(BinaryData body, RequestOptions requestOptions) { - return this.serviceClient.withBodyWithResponseAsync(body, requestOptions); - } - - /** - * The withQuery operation. - * - * @param id The id 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 A {@link Mono} that completes when a successful response is received. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono withQuery(String id) { - // Generated convenience method for withQueryWithResponse - RequestOptions requestOptions = new RequestOptions(); - return withQueryWithResponse(id, requestOptions).flatMap(FluxUtil::toMono); - } - - /** - * The withBody operation. - * - * @param body The body 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 A {@link Mono} that completes when a successful response is received. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono withBody(Input body) { - // Generated convenience method for withBodyWithResponse - RequestOptions requestOptions = new RequestOptions(); - return withBodyWithResponse(BinaryData.fromObject(body), requestOptions).flatMap(FluxUtil::toMono); - } -} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/defaultclient/MultipleParamsClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/defaultclient/MultipleParamsClient.java deleted file mode 100644 index 3135bfd1966..00000000000 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/defaultclient/MultipleParamsClient.java +++ /dev/null @@ -1,119 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package _specs_.azure.clientgenerator.core.clientinitialization.defaultclient; - -import _specs_.azure.clientgenerator.core.clientinitialization.defaultclient.implementation.MultipleParamsClientImpl; -import _specs_.azure.clientgenerator.core.clientinitialization.defaultclient.models.Input; -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.BinaryData; - -/** - * Initializes a new instance of the synchronous MultipleParamsClient type. - */ -@ServiceClient(builder = MultipleParamsClientBuilder.class) -public final class MultipleParamsClient { - @Generated - private final MultipleParamsClientImpl serviceClient; - - /** - * Initializes an instance of MultipleParamsClient class. - * - * @param serviceClient the service client implementation. - */ - @Generated - MultipleParamsClient(MultipleParamsClientImpl serviceClient) { - this.serviceClient = serviceClient; - } - - /** - * The withQuery operation. - * - * @param id The id 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 {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response withQueryWithResponse(String id, RequestOptions requestOptions) { - return this.serviceClient.withQueryWithResponse(id, requestOptions); - } - - /** - * The withBody operation. - *

Request Body Schema

- * - *
-     * {@code
-     * {
-     *     name: String (Required)
-     * }
-     * }
-     * 
- * - * @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. - * @throws ResourceNotFoundException thrown if the request 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 withBodyWithResponse(BinaryData body, RequestOptions requestOptions) { - return this.serviceClient.withBodyWithResponse(body, requestOptions); - } - - /** - * The withQuery operation. - * - * @param id The id 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. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public void withQuery(String id) { - // Generated convenience method for withQueryWithResponse - RequestOptions requestOptions = new RequestOptions(); - withQueryWithResponse(id, requestOptions).getValue(); - } - - /** - * The withBody operation. - * - * @param body The body 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. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public void withBody(Input body) { - // Generated convenience method for withBodyWithResponse - RequestOptions requestOptions = new RequestOptions(); - withBodyWithResponse(BinaryData.fromObject(body), requestOptions).getValue(); - } -} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/defaultclient/MultipleParamsClientBuilder.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/defaultclient/MultipleParamsClientBuilder.java deleted file mode 100644 index 6f4fe5840fc..00000000000 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/defaultclient/MultipleParamsClientBuilder.java +++ /dev/null @@ -1,326 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package _specs_.azure.clientgenerator.core.clientinitialization.defaultclient; - -import _specs_.azure.clientgenerator.core.clientinitialization.defaultclient.implementation.MultipleParamsClientImpl; -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.HttpLogOptions; -import com.azure.core.http.policy.HttpLoggingPolicy; -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 java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.Objects; - -/** - * A builder for creating a new instance of the MultipleParamsClient type. - */ -@ServiceClientBuilder(serviceClients = { MultipleParamsClient.class, MultipleParamsAsyncClient.class }) -public final class MultipleParamsClientBuilder 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("_specs_-azure-clientgenerator-core-clientinitialization-defaultclient.properties"); - - @Generated - private final List pipelinePolicies; - - /** - * Create an instance of the MultipleParamsClientBuilder. - */ - @Generated - public MultipleParamsClientBuilder() { - this.pipelinePolicies = new ArrayList<>(); - } - - /* - * The HTTP client used to send the request. - */ - @Generated - private HttpClient httpClient; - - /** - * {@inheritDoc}. - */ - @Generated - @Override - public MultipleParamsClientBuilder httpClient(HttpClient httpClient) { - this.httpClient = httpClient; - return this; - } - - /* - * The HTTP pipeline to send requests through. - */ - @Generated - private HttpPipeline pipeline; - - /** - * {@inheritDoc}. - */ - @Generated - @Override - public MultipleParamsClientBuilder 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 logging configuration for HTTP requests and responses. - */ - @Generated - private HttpLogOptions httpLogOptions; - - /** - * {@inheritDoc}. - */ - @Generated - @Override - public MultipleParamsClientBuilder 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 MultipleParamsClientBuilder 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 MultipleParamsClientBuilder retryOptions(RetryOptions retryOptions) { - this.retryOptions = retryOptions; - return this; - } - - /** - * {@inheritDoc}. - */ - @Generated - @Override - public MultipleParamsClientBuilder 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 MultipleParamsClientBuilder configuration(Configuration configuration) { - this.configuration = configuration; - return this; - } - - /* - * The service endpoint - */ - @Generated - private String endpoint; - - /** - * {@inheritDoc}. - */ - @Generated - @Override - public MultipleParamsClientBuilder endpoint(String endpoint) { - this.endpoint = endpoint; - return this; - } - - /* - * - */ - @Generated - private String name; - - /** - * Sets. - * - * @param name the name value. - * @return the MultipleParamsClientBuilder. - */ - @Generated - public MultipleParamsClientBuilder name(String name) { - this.name = name; - return this; - } - - /* - * - */ - @Generated - private String region; - - /** - * Sets. - * - * @param region the region value. - * @return the MultipleParamsClientBuilder. - */ - @Generated - public MultipleParamsClientBuilder region(String region) { - this.region = region; - 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 MultipleParamsClientBuilder. - */ - @Generated - public MultipleParamsClientBuilder retryPolicy(RetryPolicy retryPolicy) { - this.retryPolicy = retryPolicy; - return this; - } - - /** - * Builds an instance of MultipleParamsClientImpl with the provided parameters. - * - * @return an instance of MultipleParamsClientImpl. - */ - @Generated - private MultipleParamsClientImpl buildInnerClient() { - this.validateClient(); - HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); - String localEndpoint = (endpoint != null) ? endpoint : "http://localhost:3000"; - MultipleParamsClientImpl client = new MultipleParamsClientImpl(localPipeline, - JacksonAdapter.createDefaultSerializerAdapter(), localEndpoint, this.name, this.region); - 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(name, "'name' cannot be null."); - Objects.requireNonNull(region, "'region' 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 MultipleParamsAsyncClient class. - * - * @return an instance of MultipleParamsAsyncClient. - */ - @Generated - public MultipleParamsAsyncClient buildAsyncClient() { - return new MultipleParamsAsyncClient(buildInnerClient()); - } - - /** - * Builds an instance of MultipleParamsClient class. - * - * @return an instance of MultipleParamsClient. - */ - @Generated - public MultipleParamsClient buildClient() { - return new MultipleParamsClient(buildInnerClient()); - } - - private static final ClientLogger LOGGER = new ClientLogger(MultipleParamsClientBuilder.class); -} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/defaultclient/ParamAliasAsyncClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/defaultclient/ParamAliasAsyncClient.java deleted file mode 100644 index 15dc398995f..00000000000 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/defaultclient/ParamAliasAsyncClient.java +++ /dev/null @@ -1,106 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package _specs_.azure.clientgenerator.core.clientinitialization.defaultclient; - -import _specs_.azure.clientgenerator.core.clientinitialization.defaultclient.implementation.ParamAliasClientImpl; -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 reactor.core.publisher.Mono; - -/** - * Initializes a new instance of the asynchronous ParamAliasClient type. - */ -@ServiceClient(builder = ParamAliasClientBuilder.class, isAsync = true) -public final class ParamAliasAsyncClient { - @Generated - private final ParamAliasClientImpl serviceClient; - - /** - * Initializes an instance of ParamAliasAsyncClient class. - * - * @param serviceClient the service client implementation. - */ - @Generated - ParamAliasAsyncClient(ParamAliasClientImpl serviceClient) { - this.serviceClient = serviceClient; - } - - /** - * The withAliasedName 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> withAliasedNameWithResponse(RequestOptions requestOptions) { - return this.serviceClient.withAliasedNameWithResponseAsync(requestOptions); - } - - /** - * The withOriginalName 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> withOriginalNameWithResponse(RequestOptions requestOptions) { - return this.serviceClient.withOriginalNameWithResponseAsync(requestOptions); - } - - /** - * The withAliasedName 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 withAliasedName() { - // Generated convenience method for withAliasedNameWithResponse - RequestOptions requestOptions = new RequestOptions(); - return withAliasedNameWithResponse(requestOptions).flatMap(FluxUtil::toMono); - } - - /** - * The withOriginalName 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 withOriginalName() { - // Generated convenience method for withOriginalNameWithResponse - RequestOptions requestOptions = new RequestOptions(); - return withOriginalNameWithResponse(requestOptions).flatMap(FluxUtil::toMono); - } -} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/defaultclient/ParamAliasClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/defaultclient/ParamAliasClient.java deleted file mode 100644 index fb4db9e8c8b..00000000000 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/defaultclient/ParamAliasClient.java +++ /dev/null @@ -1,102 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package _specs_.azure.clientgenerator.core.clientinitialization.defaultclient; - -import _specs_.azure.clientgenerator.core.clientinitialization.defaultclient.implementation.ParamAliasClientImpl; -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; - -/** - * Initializes a new instance of the synchronous ParamAliasClient type. - */ -@ServiceClient(builder = ParamAliasClientBuilder.class) -public final class ParamAliasClient { - @Generated - private final ParamAliasClientImpl serviceClient; - - /** - * Initializes an instance of ParamAliasClient class. - * - * @param serviceClient the service client implementation. - */ - @Generated - ParamAliasClient(ParamAliasClientImpl serviceClient) { - this.serviceClient = serviceClient; - } - - /** - * The withAliasedName 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 withAliasedNameWithResponse(RequestOptions requestOptions) { - return this.serviceClient.withAliasedNameWithResponse(requestOptions); - } - - /** - * The withOriginalName 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 withOriginalNameWithResponse(RequestOptions requestOptions) { - return this.serviceClient.withOriginalNameWithResponse(requestOptions); - } - - /** - * The withAliasedName 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 withAliasedName() { - // Generated convenience method for withAliasedNameWithResponse - RequestOptions requestOptions = new RequestOptions(); - withAliasedNameWithResponse(requestOptions).getValue(); - } - - /** - * The withOriginalName 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 withOriginalName() { - // Generated convenience method for withOriginalNameWithResponse - RequestOptions requestOptions = new RequestOptions(); - withOriginalNameWithResponse(requestOptions).getValue(); - } -} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/defaultclient/ParamAliasClientBuilder.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/defaultclient/ParamAliasClientBuilder.java deleted file mode 100644 index e458847dc15..00000000000 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/defaultclient/ParamAliasClientBuilder.java +++ /dev/null @@ -1,307 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package _specs_.azure.clientgenerator.core.clientinitialization.defaultclient; - -import _specs_.azure.clientgenerator.core.clientinitialization.defaultclient.implementation.ParamAliasClientImpl; -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.HttpLogOptions; -import com.azure.core.http.policy.HttpLoggingPolicy; -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 java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.Objects; - -/** - * A builder for creating a new instance of the ParamAliasClient type. - */ -@ServiceClientBuilder(serviceClients = { ParamAliasClient.class, ParamAliasAsyncClient.class }) -public final class ParamAliasClientBuilder 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("_specs_-azure-clientgenerator-core-clientinitialization-defaultclient.properties"); - - @Generated - private final List pipelinePolicies; - - /** - * Create an instance of the ParamAliasClientBuilder. - */ - @Generated - public ParamAliasClientBuilder() { - this.pipelinePolicies = new ArrayList<>(); - } - - /* - * The HTTP client used to send the request. - */ - @Generated - private HttpClient httpClient; - - /** - * {@inheritDoc}. - */ - @Generated - @Override - public ParamAliasClientBuilder httpClient(HttpClient httpClient) { - this.httpClient = httpClient; - return this; - } - - /* - * The HTTP pipeline to send requests through. - */ - @Generated - private HttpPipeline pipeline; - - /** - * {@inheritDoc}. - */ - @Generated - @Override - public ParamAliasClientBuilder 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 logging configuration for HTTP requests and responses. - */ - @Generated - private HttpLogOptions httpLogOptions; - - /** - * {@inheritDoc}. - */ - @Generated - @Override - public ParamAliasClientBuilder 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 ParamAliasClientBuilder 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 ParamAliasClientBuilder retryOptions(RetryOptions retryOptions) { - this.retryOptions = retryOptions; - return this; - } - - /** - * {@inheritDoc}. - */ - @Generated - @Override - public ParamAliasClientBuilder 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 ParamAliasClientBuilder configuration(Configuration configuration) { - this.configuration = configuration; - return this; - } - - /* - * The service endpoint - */ - @Generated - private String endpoint; - - /** - * {@inheritDoc}. - */ - @Generated - @Override - public ParamAliasClientBuilder endpoint(String endpoint) { - this.endpoint = endpoint; - return this; - } - - /* - * - */ - @Generated - private String blobName; - - /** - * Sets. - * - * @param blobName the blobName value. - * @return the ParamAliasClientBuilder. - */ - @Generated - public ParamAliasClientBuilder blobName(String blobName) { - this.blobName = blobName; - 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 ParamAliasClientBuilder. - */ - @Generated - public ParamAliasClientBuilder retryPolicy(RetryPolicy retryPolicy) { - this.retryPolicy = retryPolicy; - return this; - } - - /** - * Builds an instance of ParamAliasClientImpl with the provided parameters. - * - * @return an instance of ParamAliasClientImpl. - */ - @Generated - private ParamAliasClientImpl buildInnerClient() { - this.validateClient(); - HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); - String localEndpoint = (endpoint != null) ? endpoint : "http://localhost:3000"; - ParamAliasClientImpl client = new ParamAliasClientImpl(localPipeline, - JacksonAdapter.createDefaultSerializerAdapter(), localEndpoint, this.blobName); - 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(blobName, "'blobName' 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 ParamAliasAsyncClient class. - * - * @return an instance of ParamAliasAsyncClient. - */ - @Generated - public ParamAliasAsyncClient buildAsyncClient() { - return new ParamAliasAsyncClient(buildInnerClient()); - } - - /** - * Builds an instance of ParamAliasClient class. - * - * @return an instance of ParamAliasClient. - */ - @Generated - public ParamAliasClient buildClient() { - return new ParamAliasClient(buildInnerClient()); - } - - private static final ClientLogger LOGGER = new ClientLogger(ParamAliasClientBuilder.class); -} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/defaultclient/PathParamAsyncClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/defaultclient/PathParamAsyncClient.java deleted file mode 100644 index a306c54dea1..00000000000 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/defaultclient/PathParamAsyncClient.java +++ /dev/null @@ -1,185 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package _specs_.azure.clientgenerator.core.clientinitialization.defaultclient; - -import _specs_.azure.clientgenerator.core.clientinitialization.defaultclient.implementation.PathParamClientImpl; -import _specs_.azure.clientgenerator.core.clientinitialization.defaultclient.models.BlobProperties; -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.BinaryData; -import com.azure.core.util.FluxUtil; -import reactor.core.publisher.Mono; - -/** - * Initializes a new instance of the asynchronous PathParamClient type. - */ -@ServiceClient(builder = PathParamClientBuilder.class, isAsync = true) -public final class PathParamAsyncClient { - @Generated - private final PathParamClientImpl serviceClient; - - /** - * Initializes an instance of PathParamAsyncClient class. - * - * @param serviceClient the service client implementation. - */ - @Generated - PathParamAsyncClient(PathParamClientImpl serviceClient) { - this.serviceClient = serviceClient; - } - - /** - * The withQuery operation. - *

Query Parameters

- * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
formatStringNoThe format parameter
- * You can add these to a request with {@link RequestOptions#addQueryParam} - * - * @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> withQueryWithResponse(RequestOptions requestOptions) { - return this.serviceClient.withQueryWithResponseAsync(requestOptions); - } - - /** - * The getStandalone operation. - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     name: String (Required)
-     *     size: long (Required)
-     *     contentType: String (Required)
-     *     createdOn: OffsetDateTime (Required)
-     * }
-     * }
-     * 
- * - * @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 properties of a blob along with {@link Response} on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getStandaloneWithResponse(RequestOptions requestOptions) { - return this.serviceClient.getStandaloneWithResponseAsync(requestOptions); - } - - /** - * The deleteStandalone 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> deleteStandaloneWithResponse(RequestOptions requestOptions) { - return this.serviceClient.deleteStandaloneWithResponseAsync(requestOptions); - } - - /** - * The withQuery operation. - * - * @param format The format 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 A {@link Mono} that completes when a successful response is received. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono withQuery(String format) { - // Generated convenience method for withQueryWithResponse - RequestOptions requestOptions = new RequestOptions(); - if (format != null) { - requestOptions.addQueryParam("format", format, false); - } - return withQueryWithResponse(requestOptions).flatMap(FluxUtil::toMono); - } - - /** - * The withQuery 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 withQuery() { - // Generated convenience method for withQueryWithResponse - RequestOptions requestOptions = new RequestOptions(); - return withQueryWithResponse(requestOptions).flatMap(FluxUtil::toMono); - } - - /** - * The getStandalone 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 properties of a blob on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getStandalone() { - // Generated convenience method for getStandaloneWithResponse - RequestOptions requestOptions = new RequestOptions(); - return getStandaloneWithResponse(requestOptions).flatMap(FluxUtil::toMono) - .map(protocolMethodData -> protocolMethodData.toObject(BlobProperties.class)); - } - - /** - * The deleteStandalone 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 deleteStandalone() { - // Generated convenience method for deleteStandaloneWithResponse - RequestOptions requestOptions = new RequestOptions(); - return deleteStandaloneWithResponse(requestOptions).flatMap(FluxUtil::toMono); - } -} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/defaultclient/PathParamClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/defaultclient/PathParamClient.java deleted file mode 100644 index cb9a4566244..00000000000 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/defaultclient/PathParamClient.java +++ /dev/null @@ -1,179 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package _specs_.azure.clientgenerator.core.clientinitialization.defaultclient; - -import _specs_.azure.clientgenerator.core.clientinitialization.defaultclient.implementation.PathParamClientImpl; -import _specs_.azure.clientgenerator.core.clientinitialization.defaultclient.models.BlobProperties; -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.BinaryData; - -/** - * Initializes a new instance of the synchronous PathParamClient type. - */ -@ServiceClient(builder = PathParamClientBuilder.class) -public final class PathParamClient { - @Generated - private final PathParamClientImpl serviceClient; - - /** - * Initializes an instance of PathParamClient class. - * - * @param serviceClient the service client implementation. - */ - @Generated - PathParamClient(PathParamClientImpl serviceClient) { - this.serviceClient = serviceClient; - } - - /** - * The withQuery operation. - *

Query Parameters

- * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
formatStringNoThe format parameter
- * You can add these to a request with {@link RequestOptions#addQueryParam} - * - * @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 withQueryWithResponse(RequestOptions requestOptions) { - return this.serviceClient.withQueryWithResponse(requestOptions); - } - - /** - * The getStandalone operation. - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     name: String (Required)
-     *     size: long (Required)
-     *     contentType: String (Required)
-     *     createdOn: OffsetDateTime (Required)
-     * }
-     * }
-     * 
- * - * @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 properties of a blob along with {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getStandaloneWithResponse(RequestOptions requestOptions) { - return this.serviceClient.getStandaloneWithResponse(requestOptions); - } - - /** - * The deleteStandalone 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 deleteStandaloneWithResponse(RequestOptions requestOptions) { - return this.serviceClient.deleteStandaloneWithResponse(requestOptions); - } - - /** - * The withQuery operation. - * - * @param format The format 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. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public void withQuery(String format) { - // Generated convenience method for withQueryWithResponse - RequestOptions requestOptions = new RequestOptions(); - if (format != null) { - requestOptions.addQueryParam("format", format, false); - } - withQueryWithResponse(requestOptions).getValue(); - } - - /** - * The withQuery 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 withQuery() { - // Generated convenience method for withQueryWithResponse - RequestOptions requestOptions = new RequestOptions(); - withQueryWithResponse(requestOptions).getValue(); - } - - /** - * The getStandalone 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 properties of a blob. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public BlobProperties getStandalone() { - // Generated convenience method for getStandaloneWithResponse - RequestOptions requestOptions = new RequestOptions(); - return getStandaloneWithResponse(requestOptions).getValue().toObject(BlobProperties.class); - } - - /** - * The deleteStandalone 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 deleteStandalone() { - // Generated convenience method for deleteStandaloneWithResponse - RequestOptions requestOptions = new RequestOptions(); - deleteStandaloneWithResponse(requestOptions).getValue(); - } -} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/defaultclient/PathParamClientBuilder.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/defaultclient/PathParamClientBuilder.java deleted file mode 100644 index 6293f96269d..00000000000 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/defaultclient/PathParamClientBuilder.java +++ /dev/null @@ -1,307 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package _specs_.azure.clientgenerator.core.clientinitialization.defaultclient; - -import _specs_.azure.clientgenerator.core.clientinitialization.defaultclient.implementation.PathParamClientImpl; -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.HttpLogOptions; -import com.azure.core.http.policy.HttpLoggingPolicy; -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 java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.Objects; - -/** - * A builder for creating a new instance of the PathParamClient type. - */ -@ServiceClientBuilder(serviceClients = { PathParamClient.class, PathParamAsyncClient.class }) -public final class PathParamClientBuilder 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("_specs_-azure-clientgenerator-core-clientinitialization-defaultclient.properties"); - - @Generated - private final List pipelinePolicies; - - /** - * Create an instance of the PathParamClientBuilder. - */ - @Generated - public PathParamClientBuilder() { - this.pipelinePolicies = new ArrayList<>(); - } - - /* - * The HTTP client used to send the request. - */ - @Generated - private HttpClient httpClient; - - /** - * {@inheritDoc}. - */ - @Generated - @Override - public PathParamClientBuilder httpClient(HttpClient httpClient) { - this.httpClient = httpClient; - return this; - } - - /* - * The HTTP pipeline to send requests through. - */ - @Generated - private HttpPipeline pipeline; - - /** - * {@inheritDoc}. - */ - @Generated - @Override - public PathParamClientBuilder 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 logging configuration for HTTP requests and responses. - */ - @Generated - private HttpLogOptions httpLogOptions; - - /** - * {@inheritDoc}. - */ - @Generated - @Override - public PathParamClientBuilder 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 PathParamClientBuilder 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 PathParamClientBuilder retryOptions(RetryOptions retryOptions) { - this.retryOptions = retryOptions; - return this; - } - - /** - * {@inheritDoc}. - */ - @Generated - @Override - public PathParamClientBuilder 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 PathParamClientBuilder configuration(Configuration configuration) { - this.configuration = configuration; - return this; - } - - /* - * The service endpoint - */ - @Generated - private String endpoint; - - /** - * {@inheritDoc}. - */ - @Generated - @Override - public PathParamClientBuilder endpoint(String endpoint) { - this.endpoint = endpoint; - return this; - } - - /* - * - */ - @Generated - private String blobName; - - /** - * Sets. - * - * @param blobName the blobName value. - * @return the PathParamClientBuilder. - */ - @Generated - public PathParamClientBuilder blobName(String blobName) { - this.blobName = blobName; - 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 PathParamClientBuilder. - */ - @Generated - public PathParamClientBuilder retryPolicy(RetryPolicy retryPolicy) { - this.retryPolicy = retryPolicy; - return this; - } - - /** - * Builds an instance of PathParamClientImpl with the provided parameters. - * - * @return an instance of PathParamClientImpl. - */ - @Generated - private PathParamClientImpl buildInnerClient() { - this.validateClient(); - HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); - String localEndpoint = (endpoint != null) ? endpoint : "http://localhost:3000"; - PathParamClientImpl client = new PathParamClientImpl(localPipeline, - JacksonAdapter.createDefaultSerializerAdapter(), localEndpoint, this.blobName); - 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(blobName, "'blobName' 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 PathParamAsyncClient class. - * - * @return an instance of PathParamAsyncClient. - */ - @Generated - public PathParamAsyncClient buildAsyncClient() { - return new PathParamAsyncClient(buildInnerClient()); - } - - /** - * Builds an instance of PathParamClient class. - * - * @return an instance of PathParamClient. - */ - @Generated - public PathParamClient buildClient() { - return new PathParamClient(buildInnerClient()); - } - - private static final ClientLogger LOGGER = new ClientLogger(PathParamClientBuilder.class); -} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/defaultclient/QueryParamAsyncClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/defaultclient/QueryParamAsyncClient.java deleted file mode 100644 index 5612353885f..00000000000 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/defaultclient/QueryParamAsyncClient.java +++ /dev/null @@ -1,185 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package _specs_.azure.clientgenerator.core.clientinitialization.defaultclient; - -import _specs_.azure.clientgenerator.core.clientinitialization.defaultclient.implementation.QueryParamClientImpl; -import _specs_.azure.clientgenerator.core.clientinitialization.defaultclient.models.BlobProperties; -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.BinaryData; -import com.azure.core.util.FluxUtil; -import reactor.core.publisher.Mono; - -/** - * Initializes a new instance of the asynchronous QueryParamClient type. - */ -@ServiceClient(builder = QueryParamClientBuilder.class, isAsync = true) -public final class QueryParamAsyncClient { - @Generated - private final QueryParamClientImpl serviceClient; - - /** - * Initializes an instance of QueryParamAsyncClient class. - * - * @param serviceClient the service client implementation. - */ - @Generated - QueryParamAsyncClient(QueryParamClientImpl serviceClient) { - this.serviceClient = serviceClient; - } - - /** - * The withQuery operation. - *

Query Parameters

- * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
formatStringNoThe format parameter
- * You can add these to a request with {@link RequestOptions#addQueryParam} - * - * @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> withQueryWithResponse(RequestOptions requestOptions) { - return this.serviceClient.withQueryWithResponseAsync(requestOptions); - } - - /** - * The getStandalone operation. - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     name: String (Required)
-     *     size: long (Required)
-     *     contentType: String (Required)
-     *     createdOn: OffsetDateTime (Required)
-     * }
-     * }
-     * 
- * - * @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 properties of a blob along with {@link Response} on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getStandaloneWithResponse(RequestOptions requestOptions) { - return this.serviceClient.getStandaloneWithResponseAsync(requestOptions); - } - - /** - * The deleteStandalone 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> deleteStandaloneWithResponse(RequestOptions requestOptions) { - return this.serviceClient.deleteStandaloneWithResponseAsync(requestOptions); - } - - /** - * The withQuery operation. - * - * @param format The format 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 A {@link Mono} that completes when a successful response is received. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono withQuery(String format) { - // Generated convenience method for withQueryWithResponse - RequestOptions requestOptions = new RequestOptions(); - if (format != null) { - requestOptions.addQueryParam("format", format, false); - } - return withQueryWithResponse(requestOptions).flatMap(FluxUtil::toMono); - } - - /** - * The withQuery 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 withQuery() { - // Generated convenience method for withQueryWithResponse - RequestOptions requestOptions = new RequestOptions(); - return withQueryWithResponse(requestOptions).flatMap(FluxUtil::toMono); - } - - /** - * The getStandalone 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 properties of a blob on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getStandalone() { - // Generated convenience method for getStandaloneWithResponse - RequestOptions requestOptions = new RequestOptions(); - return getStandaloneWithResponse(requestOptions).flatMap(FluxUtil::toMono) - .map(protocolMethodData -> protocolMethodData.toObject(BlobProperties.class)); - } - - /** - * The deleteStandalone 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 deleteStandalone() { - // Generated convenience method for deleteStandaloneWithResponse - RequestOptions requestOptions = new RequestOptions(); - return deleteStandaloneWithResponse(requestOptions).flatMap(FluxUtil::toMono); - } -} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/defaultclient/QueryParamClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/defaultclient/QueryParamClient.java deleted file mode 100644 index f37d717bc17..00000000000 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/defaultclient/QueryParamClient.java +++ /dev/null @@ -1,179 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package _specs_.azure.clientgenerator.core.clientinitialization.defaultclient; - -import _specs_.azure.clientgenerator.core.clientinitialization.defaultclient.implementation.QueryParamClientImpl; -import _specs_.azure.clientgenerator.core.clientinitialization.defaultclient.models.BlobProperties; -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.BinaryData; - -/** - * Initializes a new instance of the synchronous QueryParamClient type. - */ -@ServiceClient(builder = QueryParamClientBuilder.class) -public final class QueryParamClient { - @Generated - private final QueryParamClientImpl serviceClient; - - /** - * Initializes an instance of QueryParamClient class. - * - * @param serviceClient the service client implementation. - */ - @Generated - QueryParamClient(QueryParamClientImpl serviceClient) { - this.serviceClient = serviceClient; - } - - /** - * The withQuery operation. - *

Query Parameters

- * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
formatStringNoThe format parameter
- * You can add these to a request with {@link RequestOptions#addQueryParam} - * - * @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 withQueryWithResponse(RequestOptions requestOptions) { - return this.serviceClient.withQueryWithResponse(requestOptions); - } - - /** - * The getStandalone operation. - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     name: String (Required)
-     *     size: long (Required)
-     *     contentType: String (Required)
-     *     createdOn: OffsetDateTime (Required)
-     * }
-     * }
-     * 
- * - * @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 properties of a blob along with {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getStandaloneWithResponse(RequestOptions requestOptions) { - return this.serviceClient.getStandaloneWithResponse(requestOptions); - } - - /** - * The deleteStandalone 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 deleteStandaloneWithResponse(RequestOptions requestOptions) { - return this.serviceClient.deleteStandaloneWithResponse(requestOptions); - } - - /** - * The withQuery operation. - * - * @param format The format 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. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public void withQuery(String format) { - // Generated convenience method for withQueryWithResponse - RequestOptions requestOptions = new RequestOptions(); - if (format != null) { - requestOptions.addQueryParam("format", format, false); - } - withQueryWithResponse(requestOptions).getValue(); - } - - /** - * The withQuery 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 withQuery() { - // Generated convenience method for withQueryWithResponse - RequestOptions requestOptions = new RequestOptions(); - withQueryWithResponse(requestOptions).getValue(); - } - - /** - * The getStandalone 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 properties of a blob. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public BlobProperties getStandalone() { - // Generated convenience method for getStandaloneWithResponse - RequestOptions requestOptions = new RequestOptions(); - return getStandaloneWithResponse(requestOptions).getValue().toObject(BlobProperties.class); - } - - /** - * The deleteStandalone 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 deleteStandalone() { - // Generated convenience method for deleteStandaloneWithResponse - RequestOptions requestOptions = new RequestOptions(); - deleteStandaloneWithResponse(requestOptions).getValue(); - } -} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/defaultclient/QueryParamClientBuilder.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/defaultclient/QueryParamClientBuilder.java deleted file mode 100644 index 88e06209f2c..00000000000 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/defaultclient/QueryParamClientBuilder.java +++ /dev/null @@ -1,307 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package _specs_.azure.clientgenerator.core.clientinitialization.defaultclient; - -import _specs_.azure.clientgenerator.core.clientinitialization.defaultclient.implementation.QueryParamClientImpl; -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.HttpLogOptions; -import com.azure.core.http.policy.HttpLoggingPolicy; -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 java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.Objects; - -/** - * A builder for creating a new instance of the QueryParamClient type. - */ -@ServiceClientBuilder(serviceClients = { QueryParamClient.class, QueryParamAsyncClient.class }) -public final class QueryParamClientBuilder 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("_specs_-azure-clientgenerator-core-clientinitialization-defaultclient.properties"); - - @Generated - private final List pipelinePolicies; - - /** - * Create an instance of the QueryParamClientBuilder. - */ - @Generated - public QueryParamClientBuilder() { - this.pipelinePolicies = new ArrayList<>(); - } - - /* - * The HTTP client used to send the request. - */ - @Generated - private HttpClient httpClient; - - /** - * {@inheritDoc}. - */ - @Generated - @Override - public QueryParamClientBuilder httpClient(HttpClient httpClient) { - this.httpClient = httpClient; - return this; - } - - /* - * The HTTP pipeline to send requests through. - */ - @Generated - private HttpPipeline pipeline; - - /** - * {@inheritDoc}. - */ - @Generated - @Override - public QueryParamClientBuilder 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 logging configuration for HTTP requests and responses. - */ - @Generated - private HttpLogOptions httpLogOptions; - - /** - * {@inheritDoc}. - */ - @Generated - @Override - public QueryParamClientBuilder 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 QueryParamClientBuilder 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 QueryParamClientBuilder retryOptions(RetryOptions retryOptions) { - this.retryOptions = retryOptions; - return this; - } - - /** - * {@inheritDoc}. - */ - @Generated - @Override - public QueryParamClientBuilder 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 QueryParamClientBuilder configuration(Configuration configuration) { - this.configuration = configuration; - return this; - } - - /* - * The service endpoint - */ - @Generated - private String endpoint; - - /** - * {@inheritDoc}. - */ - @Generated - @Override - public QueryParamClientBuilder endpoint(String endpoint) { - this.endpoint = endpoint; - return this; - } - - /* - * - */ - @Generated - private String blobName; - - /** - * Sets. - * - * @param blobName the blobName value. - * @return the QueryParamClientBuilder. - */ - @Generated - public QueryParamClientBuilder blobName(String blobName) { - this.blobName = blobName; - 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 QueryParamClientBuilder. - */ - @Generated - public QueryParamClientBuilder retryPolicy(RetryPolicy retryPolicy) { - this.retryPolicy = retryPolicy; - return this; - } - - /** - * Builds an instance of QueryParamClientImpl with the provided parameters. - * - * @return an instance of QueryParamClientImpl. - */ - @Generated - private QueryParamClientImpl buildInnerClient() { - this.validateClient(); - HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); - String localEndpoint = (endpoint != null) ? endpoint : "http://localhost:3000"; - QueryParamClientImpl client = new QueryParamClientImpl(localPipeline, - JacksonAdapter.createDefaultSerializerAdapter(), localEndpoint, this.blobName); - 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(blobName, "'blobName' 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 QueryParamAsyncClient class. - * - * @return an instance of QueryParamAsyncClient. - */ - @Generated - public QueryParamAsyncClient buildAsyncClient() { - return new QueryParamAsyncClient(buildInnerClient()); - } - - /** - * Builds an instance of QueryParamClient class. - * - * @return an instance of QueryParamClient. - */ - @Generated - public QueryParamClient buildClient() { - return new QueryParamClient(buildInnerClient()); - } - - private static final ClientLogger LOGGER = new ClientLogger(QueryParamClientBuilder.class); -} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/defaultclient/implementation/HeaderParamClientImpl.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/defaultclient/implementation/HeaderParamClientImpl.java deleted file mode 100644 index 77e8bce8fa1..00000000000 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/defaultclient/implementation/HeaderParamClientImpl.java +++ /dev/null @@ -1,272 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package _specs_.azure.clientgenerator.core.clientinitialization.defaultclient.implementation; - -import com.azure.core.annotation.BodyParam; -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.Post; -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.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.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 com.azure.core.util.serializer.JacksonAdapter; -import com.azure.core.util.serializer.SerializerAdapter; -import reactor.core.publisher.Mono; - -/** - * Initializes a new instance of the HeaderParamClient type. - */ -public final class HeaderParamClientImpl { - /** - * The proxy service used to perform REST calls. - */ - private final HeaderParamClientService service; - - /** - * Service host. - */ - private final String endpoint; - - /** - * Gets Service host. - * - * @return the endpoint value. - */ - public String getEndpoint() { - return this.endpoint; - } - - /** - */ - private final String name; - - /** - * Gets. - * - * @return the name value. - */ - public String getName() { - return this.name; - } - - /** - * 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; - } - - /** - * Initializes an instance of HeaderParamClient client. - * - * @param endpoint Service host. - * @param name - */ - public HeaderParamClientImpl(String endpoint, String name) { - this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), - JacksonAdapter.createDefaultSerializerAdapter(), endpoint, name); - } - - /** - * Initializes an instance of HeaderParamClient client. - * - * @param httpPipeline The HTTP pipeline to send requests through. - * @param endpoint Service host. - * @param name - */ - public HeaderParamClientImpl(HttpPipeline httpPipeline, String endpoint, String name) { - this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint, name); - } - - /** - * Initializes an instance of HeaderParamClient client. - * - * @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 name - */ - public HeaderParamClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint, - String name) { - this.httpPipeline = httpPipeline; - this.serializerAdapter = serializerAdapter; - this.endpoint = endpoint; - this.name = name; - this.service = RestProxy.create(HeaderParamClientService.class, this.httpPipeline, this.getSerializerAdapter()); - } - - /** - * The interface defining all the services for HeaderParamClient to be used by the proxy service to perform REST - * calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "HeaderParamClient") - public interface HeaderParamClientService { - @Get("/azure/client-generator-core/client-initialization/default/header-param/with-query") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withQuery(@HostParam("endpoint") String endpoint, @HeaderParam("name") String name, - @QueryParam("id") String id, RequestOptions requestOptions, Context context); - - @Get("/azure/client-generator-core/client-initialization/default/header-param/with-query") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withQuerySync(@HostParam("endpoint") String endpoint, @HeaderParam("name") String name, - @QueryParam("id") String id, RequestOptions requestOptions, Context context); - - @Post("/azure/client-generator-core/client-initialization/default/header-param/with-body") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withBody(@HostParam("endpoint") String endpoint, @HeaderParam("name") String name, - @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); - - @Post("/azure/client-generator-core/client-initialization/default/header-param/with-body") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withBodySync(@HostParam("endpoint") String endpoint, @HeaderParam("name") String name, - @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, - RequestOptions requestOptions, Context context); - } - - /** - * The withQuery operation. - * - * @param id The id 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 {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> withQueryWithResponseAsync(String id, RequestOptions requestOptions) { - return FluxUtil - .withContext(context -> service.withQuery(this.getEndpoint(), this.getName(), id, requestOptions, context)); - } - - /** - * The withQuery operation. - * - * @param id The id 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 {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response withQueryWithResponse(String id, RequestOptions requestOptions) { - return service.withQuerySync(this.getEndpoint(), this.getName(), id, requestOptions, Context.NONE); - } - - /** - * The withBody operation. - *

Request Body Schema

- * - *
-     * {@code
-     * {
-     *     name: String (Required)
-     * }
-     * }
-     * 
- * - * @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. - * @throws ResourceNotFoundException thrown if the request 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> withBodyWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.withBody(this.getEndpoint(), this.getName(), contentType, body, - requestOptions, context)); - } - - /** - * The withBody operation. - *

Request Body Schema

- * - *
-     * {@code
-     * {
-     *     name: String (Required)
-     * }
-     * }
-     * 
- * - * @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. - * @throws ResourceNotFoundException thrown if the request 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 withBodyWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.withBodySync(this.getEndpoint(), this.getName(), contentType, body, requestOptions, - Context.NONE); - } -} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/defaultclient/implementation/MixedParamsClientImpl.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/defaultclient/implementation/MixedParamsClientImpl.java deleted file mode 100644 index 271682bc702..00000000000 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/defaultclient/implementation/MixedParamsClientImpl.java +++ /dev/null @@ -1,279 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package _specs_.azure.clientgenerator.core.clientinitialization.defaultclient.implementation; - -import com.azure.core.annotation.BodyParam; -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.Post; -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.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.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 com.azure.core.util.serializer.JacksonAdapter; -import com.azure.core.util.serializer.SerializerAdapter; -import reactor.core.publisher.Mono; - -/** - * Initializes a new instance of the MixedParamsClient type. - */ -public final class MixedParamsClientImpl { - /** - * The proxy service used to perform REST calls. - */ - private final MixedParamsClientService service; - - /** - * Service host. - */ - private final String endpoint; - - /** - * Gets Service host. - * - * @return the endpoint value. - */ - public String getEndpoint() { - return this.endpoint; - } - - /** - */ - private final String name; - - /** - * Gets. - * - * @return the name value. - */ - public String getName() { - return this.name; - } - - /** - * 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; - } - - /** - * Initializes an instance of MixedParamsClient client. - * - * @param endpoint Service host. - * @param name - */ - public MixedParamsClientImpl(String endpoint, String name) { - this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), - JacksonAdapter.createDefaultSerializerAdapter(), endpoint, name); - } - - /** - * Initializes an instance of MixedParamsClient client. - * - * @param httpPipeline The HTTP pipeline to send requests through. - * @param endpoint Service host. - * @param name - */ - public MixedParamsClientImpl(HttpPipeline httpPipeline, String endpoint, String name) { - this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint, name); - } - - /** - * Initializes an instance of MixedParamsClient client. - * - * @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 name - */ - public MixedParamsClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint, - String name) { - this.httpPipeline = httpPipeline; - this.serializerAdapter = serializerAdapter; - this.endpoint = endpoint; - this.name = name; - this.service = RestProxy.create(MixedParamsClientService.class, this.httpPipeline, this.getSerializerAdapter()); - } - - /** - * The interface defining all the services for MixedParamsClient to be used by the proxy service to perform REST - * calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "MixedParamsClient") - public interface MixedParamsClientService { - @Get("/azure/client-generator-core/client-initialization/default/mixed-params/with-query") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withQuery(@HostParam("endpoint") String endpoint, @HeaderParam("name") String name, - @QueryParam("region") String region, @QueryParam("id") String id, RequestOptions requestOptions, - Context context); - - @Get("/azure/client-generator-core/client-initialization/default/mixed-params/with-query") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withQuerySync(@HostParam("endpoint") String endpoint, @HeaderParam("name") String name, - @QueryParam("region") String region, @QueryParam("id") String id, RequestOptions requestOptions, - Context context); - - @Post("/azure/client-generator-core/client-initialization/default/mixed-params/with-body") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withBody(@HostParam("endpoint") String endpoint, @HeaderParam("name") String name, - @QueryParam("region") String region, @HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); - - @Post("/azure/client-generator-core/client-initialization/default/mixed-params/with-body") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withBodySync(@HostParam("endpoint") String endpoint, @HeaderParam("name") String name, - @QueryParam("region") String region, @HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); - } - - /** - * The withQuery operation. - * - * @param region The region parameter. - * @param id The id 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 {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> withQueryWithResponseAsync(String region, String id, RequestOptions requestOptions) { - return FluxUtil.withContext( - context -> service.withQuery(this.getEndpoint(), this.getName(), region, id, requestOptions, context)); - } - - /** - * The withQuery operation. - * - * @param region The region parameter. - * @param id The id 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 {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response withQueryWithResponse(String region, String id, RequestOptions requestOptions) { - return service.withQuerySync(this.getEndpoint(), this.getName(), region, id, requestOptions, Context.NONE); - } - - /** - * The withBody operation. - *

Request Body Schema

- * - *
-     * {@code
-     * {
-     *     name: String (Required)
-     * }
-     * }
-     * 
- * - * @param region The region 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. - * @throws ResourceNotFoundException thrown if the request 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> withBodyWithResponseAsync(String region, BinaryData body, - RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.withBody(this.getEndpoint(), this.getName(), region, contentType, - body, requestOptions, context)); - } - - /** - * The withBody operation. - *

Request Body Schema

- * - *
-     * {@code
-     * {
-     *     name: String (Required)
-     * }
-     * }
-     * 
- * - * @param region The region 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. - * @throws ResourceNotFoundException thrown if the request 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 withBodyWithResponse(String region, BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.withBodySync(this.getEndpoint(), this.getName(), region, contentType, body, requestOptions, - Context.NONE); - } -} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/defaultclient/implementation/MultipleParamsClientImpl.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/defaultclient/implementation/MultipleParamsClientImpl.java deleted file mode 100644 index 5481937e75e..00000000000 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/defaultclient/implementation/MultipleParamsClientImpl.java +++ /dev/null @@ -1,293 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package _specs_.azure.clientgenerator.core.clientinitialization.defaultclient.implementation; - -import com.azure.core.annotation.BodyParam; -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.Post; -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.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.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 com.azure.core.util.serializer.JacksonAdapter; -import com.azure.core.util.serializer.SerializerAdapter; -import reactor.core.publisher.Mono; - -/** - * Initializes a new instance of the MultipleParamsClient type. - */ -public final class MultipleParamsClientImpl { - /** - * The proxy service used to perform REST calls. - */ - private final MultipleParamsClientService service; - - /** - * Service host. - */ - private final String endpoint; - - /** - * Gets Service host. - * - * @return the endpoint value. - */ - public String getEndpoint() { - return this.endpoint; - } - - /** - */ - private final String name; - - /** - * Gets. - * - * @return the name value. - */ - public String getName() { - return this.name; - } - - /** - */ - private final String region; - - /** - * Gets. - * - * @return the region value. - */ - public String getRegion() { - return this.region; - } - - /** - * 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; - } - - /** - * Initializes an instance of MultipleParamsClient client. - * - * @param endpoint Service host. - * @param name - * @param region - */ - public MultipleParamsClientImpl(String endpoint, String name, String region) { - this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), - JacksonAdapter.createDefaultSerializerAdapter(), endpoint, name, region); - } - - /** - * Initializes an instance of MultipleParamsClient client. - * - * @param httpPipeline The HTTP pipeline to send requests through. - * @param endpoint Service host. - * @param name - * @param region - */ - public MultipleParamsClientImpl(HttpPipeline httpPipeline, String endpoint, String name, String region) { - this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint, name, region); - } - - /** - * Initializes an instance of MultipleParamsClient client. - * - * @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 name - * @param region - */ - public MultipleParamsClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint, - String name, String region) { - this.httpPipeline = httpPipeline; - this.serializerAdapter = serializerAdapter; - this.endpoint = endpoint; - this.name = name; - this.region = region; - this.service - = RestProxy.create(MultipleParamsClientService.class, this.httpPipeline, this.getSerializerAdapter()); - } - - /** - * The interface defining all the services for MultipleParamsClient to be used by the proxy service to perform REST - * calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "MultipleParamsClient") - public interface MultipleParamsClientService { - @Get("/azure/client-generator-core/client-initialization/default/multiple-params/with-query") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withQuery(@HostParam("endpoint") String endpoint, @HeaderParam("name") String name, - @QueryParam("region") String region, @QueryParam("id") String id, RequestOptions requestOptions, - Context context); - - @Get("/azure/client-generator-core/client-initialization/default/multiple-params/with-query") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withQuerySync(@HostParam("endpoint") String endpoint, @HeaderParam("name") String name, - @QueryParam("region") String region, @QueryParam("id") String id, RequestOptions requestOptions, - Context context); - - @Post("/azure/client-generator-core/client-initialization/default/multiple-params/with-body") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withBody(@HostParam("endpoint") String endpoint, @HeaderParam("name") String name, - @QueryParam("region") String region, @HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); - - @Post("/azure/client-generator-core/client-initialization/default/multiple-params/with-body") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withBodySync(@HostParam("endpoint") String endpoint, @HeaderParam("name") String name, - @QueryParam("region") String region, @HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); - } - - /** - * The withQuery operation. - * - * @param id The id 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 {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> withQueryWithResponseAsync(String id, RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.withQuery(this.getEndpoint(), this.getName(), this.getRegion(), - id, requestOptions, context)); - } - - /** - * The withQuery operation. - * - * @param id The id 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 {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response withQueryWithResponse(String id, RequestOptions requestOptions) { - return service.withQuerySync(this.getEndpoint(), this.getName(), this.getRegion(), id, requestOptions, - Context.NONE); - } - - /** - * The withBody operation. - *

Request Body Schema

- * - *
-     * {@code
-     * {
-     *     name: String (Required)
-     * }
-     * }
-     * 
- * - * @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. - * @throws ResourceNotFoundException thrown if the request 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> withBodyWithResponseAsync(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.withBody(this.getEndpoint(), this.getName(), this.getRegion(), - contentType, body, requestOptions, context)); - } - - /** - * The withBody operation. - *

Request Body Schema

- * - *
-     * {@code
-     * {
-     *     name: String (Required)
-     * }
-     * }
-     * 
- * - * @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. - * @throws ResourceNotFoundException thrown if the request 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 withBodyWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/json"; - return service.withBodySync(this.getEndpoint(), this.getName(), this.getRegion(), contentType, body, - requestOptions, Context.NONE); - } -} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/defaultclient/implementation/ParamAliasClientImpl.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/defaultclient/implementation/ParamAliasClientImpl.java deleted file mode 100644 index 4ac7c32b572..00000000000 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/defaultclient/implementation/ParamAliasClientImpl.java +++ /dev/null @@ -1,241 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package _specs_.azure.clientgenerator.core.clientinitialization.defaultclient.implementation; - -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.PathParam; -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.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.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 com.azure.core.util.serializer.JacksonAdapter; -import com.azure.core.util.serializer.SerializerAdapter; -import reactor.core.publisher.Mono; - -/** - * Initializes a new instance of the ParamAliasClient type. - */ -public final class ParamAliasClientImpl { - /** - * The proxy service used to perform REST calls. - */ - private final ParamAliasClientService service; - - /** - * Service host. - */ - private final String endpoint; - - /** - * Gets Service host. - * - * @return the endpoint value. - */ - public String getEndpoint() { - return this.endpoint; - } - - /** - */ - private final String blobName; - - /** - * Gets. - * - * @return the blobName value. - */ - public String getBlobName() { - return this.blobName; - } - - /** - * 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; - } - - /** - * Initializes an instance of ParamAliasClient client. - * - * @param endpoint Service host. - * @param blobName - */ - public ParamAliasClientImpl(String endpoint, String blobName) { - this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), - JacksonAdapter.createDefaultSerializerAdapter(), endpoint, blobName); - } - - /** - * Initializes an instance of ParamAliasClient client. - * - * @param httpPipeline The HTTP pipeline to send requests through. - * @param endpoint Service host. - * @param blobName - */ - public ParamAliasClientImpl(HttpPipeline httpPipeline, String endpoint, String blobName) { - this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint, blobName); - } - - /** - * Initializes an instance of ParamAliasClient client. - * - * @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 blobName - */ - public ParamAliasClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint, - String blobName) { - this.httpPipeline = httpPipeline; - this.serializerAdapter = serializerAdapter; - this.endpoint = endpoint; - this.blobName = blobName; - this.service = RestProxy.create(ParamAliasClientService.class, this.httpPipeline, this.getSerializerAdapter()); - } - - /** - * The interface defining all the services for ParamAliasClient to be used by the proxy service to perform REST - * calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "ParamAliasClient") - public interface ParamAliasClientService { - @Get("/azure/client-generator-core/client-initialization/default/param-alias/{blob}/with-aliased-name") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withAliasedName(@HostParam("endpoint") String endpoint, @PathParam("blob") String blobName, - RequestOptions requestOptions, Context context); - - @Get("/azure/client-generator-core/client-initialization/default/param-alias/{blob}/with-aliased-name") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withAliasedNameSync(@HostParam("endpoint") String endpoint, @PathParam("blob") String blobName, - RequestOptions requestOptions, Context context); - - @Get("/azure/client-generator-core/client-initialization/default/param-alias/{blobName}/with-original-name") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withOriginalName(@HostParam("endpoint") String endpoint, - @PathParam("blobName") String blobName, RequestOptions requestOptions, Context context); - - @Get("/azure/client-generator-core/client-initialization/default/param-alias/{blobName}/with-original-name") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withOriginalNameSync(@HostParam("endpoint") String endpoint, - @PathParam("blobName") String blobName, RequestOptions requestOptions, Context context); - } - - /** - * The withAliasedName 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> withAliasedNameWithResponseAsync(RequestOptions requestOptions) { - return FluxUtil.withContext( - context -> service.withAliasedName(this.getEndpoint(), this.getBlobName(), requestOptions, context)); - } - - /** - * The withAliasedName 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 withAliasedNameWithResponse(RequestOptions requestOptions) { - return service.withAliasedNameSync(this.getEndpoint(), this.getBlobName(), requestOptions, Context.NONE); - } - - /** - * The withOriginalName 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> withOriginalNameWithResponseAsync(RequestOptions requestOptions) { - return FluxUtil.withContext( - context -> service.withOriginalName(this.getEndpoint(), this.getBlobName(), requestOptions, context)); - } - - /** - * The withOriginalName 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 withOriginalNameWithResponse(RequestOptions requestOptions) { - return service.withOriginalNameSync(this.getEndpoint(), this.getBlobName(), requestOptions, Context.NONE); - } -} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/defaultclient/implementation/PathParamClientImpl.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/defaultclient/implementation/PathParamClientImpl.java deleted file mode 100644 index 3da147ba50e..00000000000 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/defaultclient/implementation/PathParamClientImpl.java +++ /dev/null @@ -1,335 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package _specs_.azure.clientgenerator.core.clientinitialization.defaultclient.implementation; - -import com.azure.core.annotation.Delete; -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; -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.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.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 com.azure.core.util.serializer.JacksonAdapter; -import com.azure.core.util.serializer.SerializerAdapter; -import reactor.core.publisher.Mono; - -/** - * Initializes a new instance of the PathParamClient type. - */ -public final class PathParamClientImpl { - /** - * The proxy service used to perform REST calls. - */ - private final PathParamClientService service; - - /** - * Service host. - */ - private final String endpoint; - - /** - * Gets Service host. - * - * @return the endpoint value. - */ - public String getEndpoint() { - return this.endpoint; - } - - /** - */ - private final String blobName; - - /** - * Gets. - * - * @return the blobName value. - */ - public String getBlobName() { - return this.blobName; - } - - /** - * 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; - } - - /** - * Initializes an instance of PathParamClient client. - * - * @param endpoint Service host. - * @param blobName - */ - public PathParamClientImpl(String endpoint, String blobName) { - this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), - JacksonAdapter.createDefaultSerializerAdapter(), endpoint, blobName); - } - - /** - * Initializes an instance of PathParamClient client. - * - * @param httpPipeline The HTTP pipeline to send requests through. - * @param endpoint Service host. - * @param blobName - */ - public PathParamClientImpl(HttpPipeline httpPipeline, String endpoint, String blobName) { - this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint, blobName); - } - - /** - * Initializes an instance of PathParamClient client. - * - * @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 blobName - */ - public PathParamClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint, - String blobName) { - this.httpPipeline = httpPipeline; - this.serializerAdapter = serializerAdapter; - this.endpoint = endpoint; - this.blobName = blobName; - this.service = RestProxy.create(PathParamClientService.class, this.httpPipeline, this.getSerializerAdapter()); - } - - /** - * The interface defining all the services for PathParamClient to be used by the proxy service to perform REST - * calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "PathParamClient") - public interface PathParamClientService { - @Get("/azure/client-generator-core/client-initialization/default/path/{blobName}/with-query") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withQuery(@HostParam("endpoint") String endpoint, @PathParam("blobName") String blobName, - RequestOptions requestOptions, Context context); - - @Get("/azure/client-generator-core/client-initialization/default/path/{blobName}/with-query") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withQuerySync(@HostParam("endpoint") String endpoint, @PathParam("blobName") String blobName, - RequestOptions requestOptions, Context context); - - @Get("/azure/client-generator-core/client-initialization/default/path/{blobName}/get-standalone") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getStandalone(@HostParam("endpoint") String endpoint, - @PathParam("blobName") String blobName, @HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); - - @Get("/azure/client-generator-core/client-initialization/default/path/{blobName}/get-standalone") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getStandaloneSync(@HostParam("endpoint") String endpoint, - @PathParam("blobName") String blobName, @HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); - - @Delete("/azure/client-generator-core/client-initialization/default/path/{blobName}") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> deleteStandalone(@HostParam("endpoint") String endpoint, - @PathParam("blobName") String blobName, RequestOptions requestOptions, Context context); - - @Delete("/azure/client-generator-core/client-initialization/default/path/{blobName}") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Response deleteStandaloneSync(@HostParam("endpoint") String endpoint, - @PathParam("blobName") String blobName, RequestOptions requestOptions, Context context); - } - - /** - * The withQuery operation. - *

Query Parameters

- * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
formatStringNoThe format parameter
- * You can add these to a request with {@link RequestOptions#addQueryParam} - * - * @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> withQueryWithResponseAsync(RequestOptions requestOptions) { - return FluxUtil - .withContext(context -> service.withQuery(this.getEndpoint(), this.getBlobName(), requestOptions, context)); - } - - /** - * The withQuery operation. - *

Query Parameters

- * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
formatStringNoThe format parameter
- * You can add these to a request with {@link RequestOptions#addQueryParam} - * - * @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 withQueryWithResponse(RequestOptions requestOptions) { - return service.withQuerySync(this.getEndpoint(), this.getBlobName(), requestOptions, Context.NONE); - } - - /** - * The getStandalone operation. - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     name: String (Required)
-     *     size: long (Required)
-     *     contentType: String (Required)
-     *     createdOn: OffsetDateTime (Required)
-     * }
-     * }
-     * 
- * - * @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 properties of a blob along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getStandaloneWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.getStandalone(this.getEndpoint(), this.getBlobName(), accept, requestOptions, context)); - } - - /** - * The getStandalone operation. - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     name: String (Required)
-     *     size: long (Required)
-     *     contentType: String (Required)
-     *     createdOn: OffsetDateTime (Required)
-     * }
-     * }
-     * 
- * - * @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 properties of a blob along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getStandaloneWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.getStandaloneSync(this.getEndpoint(), this.getBlobName(), accept, requestOptions, Context.NONE); - } - - /** - * The deleteStandalone 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> deleteStandaloneWithResponseAsync(RequestOptions requestOptions) { - return FluxUtil.withContext( - context -> service.deleteStandalone(this.getEndpoint(), this.getBlobName(), requestOptions, context)); - } - - /** - * The deleteStandalone 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 deleteStandaloneWithResponse(RequestOptions requestOptions) { - return service.deleteStandaloneSync(this.getEndpoint(), this.getBlobName(), requestOptions, Context.NONE); - } -} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/defaultclient/implementation/QueryParamClientImpl.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/defaultclient/implementation/QueryParamClientImpl.java deleted file mode 100644 index 98e28569e3f..00000000000 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/defaultclient/implementation/QueryParamClientImpl.java +++ /dev/null @@ -1,335 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package _specs_.azure.clientgenerator.core.clientinitialization.defaultclient.implementation; - -import com.azure.core.annotation.Delete; -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.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.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.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 com.azure.core.util.serializer.JacksonAdapter; -import com.azure.core.util.serializer.SerializerAdapter; -import reactor.core.publisher.Mono; - -/** - * Initializes a new instance of the QueryParamClient type. - */ -public final class QueryParamClientImpl { - /** - * The proxy service used to perform REST calls. - */ - private final QueryParamClientService service; - - /** - * Service host. - */ - private final String endpoint; - - /** - * Gets Service host. - * - * @return the endpoint value. - */ - public String getEndpoint() { - return this.endpoint; - } - - /** - */ - private final String blobName; - - /** - * Gets. - * - * @return the blobName value. - */ - public String getBlobName() { - return this.blobName; - } - - /** - * 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; - } - - /** - * Initializes an instance of QueryParamClient client. - * - * @param endpoint Service host. - * @param blobName - */ - public QueryParamClientImpl(String endpoint, String blobName) { - this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), - JacksonAdapter.createDefaultSerializerAdapter(), endpoint, blobName); - } - - /** - * Initializes an instance of QueryParamClient client. - * - * @param httpPipeline The HTTP pipeline to send requests through. - * @param endpoint Service host. - * @param blobName - */ - public QueryParamClientImpl(HttpPipeline httpPipeline, String endpoint, String blobName) { - this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint, blobName); - } - - /** - * Initializes an instance of QueryParamClient client. - * - * @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 blobName - */ - public QueryParamClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint, - String blobName) { - this.httpPipeline = httpPipeline; - this.serializerAdapter = serializerAdapter; - this.endpoint = endpoint; - this.blobName = blobName; - this.service = RestProxy.create(QueryParamClientService.class, this.httpPipeline, this.getSerializerAdapter()); - } - - /** - * The interface defining all the services for QueryParamClient to be used by the proxy service to perform REST - * calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "QueryParamClient") - public interface QueryParamClientService { - @Get("/azure/client-generator-core/client-initialization/default/query/with-query") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withQuery(@HostParam("endpoint") String endpoint, @QueryParam("blobName") String blobName, - RequestOptions requestOptions, Context context); - - @Get("/azure/client-generator-core/client-initialization/default/query/with-query") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withQuerySync(@HostParam("endpoint") String endpoint, @QueryParam("blobName") String blobName, - RequestOptions requestOptions, Context context); - - @Get("/azure/client-generator-core/client-initialization/default/query/get-standalone") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getStandalone(@HostParam("endpoint") String endpoint, - @QueryParam("blobName") String blobName, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); - - @Get("/azure/client-generator-core/client-initialization/default/query/get-standalone") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getStandaloneSync(@HostParam("endpoint") String endpoint, - @QueryParam("blobName") String blobName, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); - - @Delete("/azure/client-generator-core/client-initialization/default/query/delete-resource") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> deleteStandalone(@HostParam("endpoint") String endpoint, - @QueryParam("blobName") String blobName, RequestOptions requestOptions, Context context); - - @Delete("/azure/client-generator-core/client-initialization/default/query/delete-resource") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Response deleteStandaloneSync(@HostParam("endpoint") String endpoint, - @QueryParam("blobName") String blobName, RequestOptions requestOptions, Context context); - } - - /** - * The withQuery operation. - *

Query Parameters

- * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
formatStringNoThe format parameter
- * You can add these to a request with {@link RequestOptions#addQueryParam} - * - * @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> withQueryWithResponseAsync(RequestOptions requestOptions) { - return FluxUtil - .withContext(context -> service.withQuery(this.getEndpoint(), this.getBlobName(), requestOptions, context)); - } - - /** - * The withQuery operation. - *

Query Parameters

- * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
formatStringNoThe format parameter
- * You can add these to a request with {@link RequestOptions#addQueryParam} - * - * @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 withQueryWithResponse(RequestOptions requestOptions) { - return service.withQuerySync(this.getEndpoint(), this.getBlobName(), requestOptions, Context.NONE); - } - - /** - * The getStandalone operation. - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     name: String (Required)
-     *     size: long (Required)
-     *     contentType: String (Required)
-     *     createdOn: OffsetDateTime (Required)
-     * }
-     * }
-     * 
- * - * @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 properties of a blob along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getStandaloneWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.getStandalone(this.getEndpoint(), this.getBlobName(), accept, requestOptions, context)); - } - - /** - * The getStandalone operation. - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     name: String (Required)
-     *     size: long (Required)
-     *     contentType: String (Required)
-     *     createdOn: OffsetDateTime (Required)
-     * }
-     * }
-     * 
- * - * @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 properties of a blob along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getStandaloneWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.getStandaloneSync(this.getEndpoint(), this.getBlobName(), accept, requestOptions, Context.NONE); - } - - /** - * The deleteStandalone 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> deleteStandaloneWithResponseAsync(RequestOptions requestOptions) { - return FluxUtil.withContext( - context -> service.deleteStandalone(this.getEndpoint(), this.getBlobName(), requestOptions, context)); - } - - /** - * The deleteStandalone 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 deleteStandaloneWithResponse(RequestOptions requestOptions) { - return service.deleteStandaloneSync(this.getEndpoint(), this.getBlobName(), requestOptions, Context.NONE); - } -} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/defaultclient/implementation/package-info.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/defaultclient/implementation/package-info.java deleted file mode 100644 index 95c5a227936..00000000000 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/defaultclient/implementation/package-info.java +++ /dev/null @@ -1,11 +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 DefaultClient. - * Test for client initialization decorator - moving parameters from method to client level. - * - */ -package _specs_.azure.clientgenerator.core.clientinitialization.defaultclient.implementation; diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/defaultclient/models/BlobProperties.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/defaultclient/models/BlobProperties.java deleted file mode 100644 index d89c3c1bb2c..00000000000 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/defaultclient/models/BlobProperties.java +++ /dev/null @@ -1,154 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package _specs_.azure.clientgenerator.core.clientinitialization.defaultclient.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.OffsetDateTime; -import java.time.format.DateTimeFormatter; - -/** - * Properties of a blob. - */ -@Immutable -public final class BlobProperties implements JsonSerializable { - /* - * The name property. - */ - @Generated - private final String name; - - /* - * The size property. - */ - @Generated - private final long size; - - /* - * The contentType property. - */ - @Generated - private final String contentType; - - /* - * The createdOn property. - */ - @Generated - private final OffsetDateTime createdOn; - - /** - * Creates an instance of BlobProperties class. - * - * @param name the name value to set. - * @param size the size value to set. - * @param contentType the contentType value to set. - * @param createdOn the createdOn value to set. - */ - @Generated - private BlobProperties(String name, long size, String contentType, OffsetDateTime createdOn) { - this.name = name; - this.size = size; - this.contentType = contentType; - this.createdOn = createdOn; - } - - /** - * Get the name property: The name property. - * - * @return the name value. - */ - @Generated - public String getName() { - return this.name; - } - - /** - * Get the size property: The size property. - * - * @return the size value. - */ - @Generated - public long getSize() { - return this.size; - } - - /** - * Get the contentType property: The contentType property. - * - * @return the contentType value. - */ - @Generated - public String getContentType() { - return this.contentType; - } - - /** - * Get the createdOn property: The createdOn property. - * - * @return the createdOn value. - */ - @Generated - public OffsetDateTime getCreatedOn() { - return this.createdOn; - } - - /** - * {@inheritDoc} - */ - @Generated - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("name", this.name); - jsonWriter.writeLongField("size", this.size); - jsonWriter.writeStringField("contentType", this.contentType); - jsonWriter.writeStringField("createdOn", - this.createdOn == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.createdOn)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of BlobProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of BlobProperties 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 BlobProperties. - */ - @Generated - public static BlobProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - String name = null; - long size = 0L; - String contentType = null; - OffsetDateTime createdOn = null; - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("name".equals(fieldName)) { - name = reader.getString(); - } else if ("size".equals(fieldName)) { - size = reader.getLong(); - } else if ("contentType".equals(fieldName)) { - contentType = reader.getString(); - } else if ("createdOn".equals(fieldName)) { - createdOn = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else { - reader.skipChildren(); - } - } - return new BlobProperties(name, size, contentType, createdOn); - }); - } -} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/defaultclient/models/Input.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/defaultclient/models/Input.java deleted file mode 100644 index 850a0a709a5..00000000000 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/defaultclient/models/Input.java +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package _specs_.azure.clientgenerator.core.clientinitialization.defaultclient.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 Input model. - */ -@Immutable -public final class Input implements JsonSerializable { - /* - * The name property. - */ - @Generated - private final String name; - - /** - * Creates an instance of Input class. - * - * @param name the name value to set. - */ - @Generated - public Input(String name) { - this.name = name; - } - - /** - * Get the name property: The name property. - * - * @return the name value. - */ - @Generated - public String getName() { - return this.name; - } - - /** - * {@inheritDoc} - */ - @Generated - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("name", this.name); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of Input from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of Input 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 Input. - */ - @Generated - public static Input fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - String name = null; - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("name".equals(fieldName)) { - name = reader.getString(); - } else { - reader.skipChildren(); - } - } - return new Input(name); - }); - } -} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/defaultclient/models/WithBodyRequest.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/defaultclient/models/WithBodyRequest.java deleted file mode 100644 index f90a86e77ac..00000000000 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/defaultclient/models/WithBodyRequest.java +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package _specs_.azure.clientgenerator.core.clientinitialization.defaultclient.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 WithBodyRequest model. - */ -@Immutable -public final class WithBodyRequest implements JsonSerializable { - /* - * The name property. - */ - @Generated - private final String name; - - /** - * Creates an instance of WithBodyRequest class. - * - * @param name the name value to set. - */ - @Generated - public WithBodyRequest(String name) { - this.name = name; - } - - /** - * Get the name property: The name property. - * - * @return the name value. - */ - @Generated - public String getName() { - return this.name; - } - - /** - * {@inheritDoc} - */ - @Generated - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("name", this.name); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of WithBodyRequest from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of WithBodyRequest 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 WithBodyRequest. - */ - @Generated - public static WithBodyRequest fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - String name = null; - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("name".equals(fieldName)) { - name = reader.getString(); - } else { - reader.skipChildren(); - } - } - return new WithBodyRequest(name); - }); - } -} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/defaultclient/models/package-info.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/defaultclient/models/package-info.java deleted file mode 100644 index 029a6aa22c0..00000000000 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/defaultclient/models/package-info.java +++ /dev/null @@ -1,11 +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 DefaultClient. - * Test for client initialization decorator - moving parameters from method to client level. - * - */ -package _specs_.azure.clientgenerator.core.clientinitialization.defaultclient.models; diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/defaultclient/package-info.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/defaultclient/package-info.java deleted file mode 100644 index 59ca2121be6..00000000000 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/defaultclient/package-info.java +++ /dev/null @@ -1,11 +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 DefaultClient. - * Test for client initialization decorator - moving parameters from method to client level. - * - */ -package _specs_.azure.clientgenerator.core.clientinitialization.defaultclient; diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyclient/IndividuallyNestedWithHeaderAsyncClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyclient/IndividuallyNestedWithHeaderAsyncClient.java deleted file mode 100644 index db261f11fba..00000000000 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyclient/IndividuallyNestedWithHeaderAsyncClient.java +++ /dev/null @@ -1,170 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package _specs_.azure.clientgenerator.core.clientinitialization.individuallyclient; - -import _specs_.azure.clientgenerator.core.clientinitialization.individuallyclient.implementation.IndividuallyNestedWithHeaderClientImpl; -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 reactor.core.publisher.Mono; - -/** - * Initializes a new instance of the asynchronous IndividuallyNestedWithHeaderClient type. - */ -@ServiceClient(builder = IndividuallyNestedWithHeaderClientBuilder.class, isAsync = true) -public final class IndividuallyNestedWithHeaderAsyncClient { - @Generated - private final IndividuallyNestedWithHeaderClientImpl serviceClient; - - /** - * Initializes an instance of IndividuallyNestedWithHeaderAsyncClient class. - * - * @param serviceClient the service client implementation. - */ - @Generated - IndividuallyNestedWithHeaderAsyncClient(IndividuallyNestedWithHeaderClientImpl serviceClient) { - this.serviceClient = serviceClient; - } - - /** - * The withQuery operation. - *

Query Parameters

- * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
formatStringNoThe format parameter
- * You can add these to a request with {@link RequestOptions#addQueryParam} - * - * @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> withQueryWithResponse(RequestOptions requestOptions) { - return this.serviceClient.withQueryWithResponseAsync(requestOptions); - } - - /** - * The getStandalone 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> getStandaloneWithResponse(RequestOptions requestOptions) { - return this.serviceClient.getStandaloneWithResponseAsync(requestOptions); - } - - /** - * The deleteStandalone 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> deleteStandaloneWithResponse(RequestOptions requestOptions) { - return this.serviceClient.deleteStandaloneWithResponseAsync(requestOptions); - } - - /** - * The withQuery operation. - * - * @param format The format 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 A {@link Mono} that completes when a successful response is received. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono withQuery(String format) { - // Generated convenience method for withQueryWithResponse - RequestOptions requestOptions = new RequestOptions(); - if (format != null) { - requestOptions.addQueryParam("format", format, false); - } - return withQueryWithResponse(requestOptions).flatMap(FluxUtil::toMono); - } - - /** - * The withQuery 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 withQuery() { - // Generated convenience method for withQueryWithResponse - RequestOptions requestOptions = new RequestOptions(); - return withQueryWithResponse(requestOptions).flatMap(FluxUtil::toMono); - } - - /** - * The getStandalone 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 getStandalone() { - // Generated convenience method for getStandaloneWithResponse - RequestOptions requestOptions = new RequestOptions(); - return getStandaloneWithResponse(requestOptions).flatMap(FluxUtil::toMono); - } - - /** - * The deleteStandalone 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 deleteStandalone() { - // Generated convenience method for deleteStandaloneWithResponse - RequestOptions requestOptions = new RequestOptions(); - return deleteStandaloneWithResponse(requestOptions).flatMap(FluxUtil::toMono); - } -} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyclient/IndividuallyNestedWithHeaderClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyclient/IndividuallyNestedWithHeaderClient.java deleted file mode 100644 index 1c3b8655840..00000000000 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyclient/IndividuallyNestedWithHeaderClient.java +++ /dev/null @@ -1,164 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package _specs_.azure.clientgenerator.core.clientinitialization.individuallyclient; - -import _specs_.azure.clientgenerator.core.clientinitialization.individuallyclient.implementation.IndividuallyNestedWithHeaderClientImpl; -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; - -/** - * Initializes a new instance of the synchronous IndividuallyNestedWithHeaderClient type. - */ -@ServiceClient(builder = IndividuallyNestedWithHeaderClientBuilder.class) -public final class IndividuallyNestedWithHeaderClient { - @Generated - private final IndividuallyNestedWithHeaderClientImpl serviceClient; - - /** - * Initializes an instance of IndividuallyNestedWithHeaderClient class. - * - * @param serviceClient the service client implementation. - */ - @Generated - IndividuallyNestedWithHeaderClient(IndividuallyNestedWithHeaderClientImpl serviceClient) { - this.serviceClient = serviceClient; - } - - /** - * The withQuery operation. - *

Query Parameters

- * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
formatStringNoThe format parameter
- * You can add these to a request with {@link RequestOptions#addQueryParam} - * - * @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 withQueryWithResponse(RequestOptions requestOptions) { - return this.serviceClient.withQueryWithResponse(requestOptions); - } - - /** - * The getStandalone 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 getStandaloneWithResponse(RequestOptions requestOptions) { - return this.serviceClient.getStandaloneWithResponse(requestOptions); - } - - /** - * The deleteStandalone 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 deleteStandaloneWithResponse(RequestOptions requestOptions) { - return this.serviceClient.deleteStandaloneWithResponse(requestOptions); - } - - /** - * The withQuery operation. - * - * @param format The format 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. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public void withQuery(String format) { - // Generated convenience method for withQueryWithResponse - RequestOptions requestOptions = new RequestOptions(); - if (format != null) { - requestOptions.addQueryParam("format", format, false); - } - withQueryWithResponse(requestOptions).getValue(); - } - - /** - * The withQuery 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 withQuery() { - // Generated convenience method for withQueryWithResponse - RequestOptions requestOptions = new RequestOptions(); - withQueryWithResponse(requestOptions).getValue(); - } - - /** - * The getStandalone 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 getStandalone() { - // Generated convenience method for getStandaloneWithResponse - RequestOptions requestOptions = new RequestOptions(); - getStandaloneWithResponse(requestOptions).getValue(); - } - - /** - * The deleteStandalone 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 deleteStandalone() { - // Generated convenience method for deleteStandaloneWithResponse - RequestOptions requestOptions = new RequestOptions(); - deleteStandaloneWithResponse(requestOptions).getValue(); - } -} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyclient/IndividuallyNestedWithHeaderClientBuilder.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyclient/IndividuallyNestedWithHeaderClientBuilder.java deleted file mode 100644 index 409a296c736..00000000000 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyclient/IndividuallyNestedWithHeaderClientBuilder.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 _specs_.azure.clientgenerator.core.clientinitialization.individuallyclient; - -import _specs_.azure.clientgenerator.core.clientinitialization.individuallyclient.implementation.IndividuallyNestedWithHeaderClientImpl; -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.HttpLogOptions; -import com.azure.core.http.policy.HttpLoggingPolicy; -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 java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.Objects; - -/** - * A builder for creating a new instance of the IndividuallyNestedWithHeaderClient type. - */ -@ServiceClientBuilder( - serviceClients = { IndividuallyNestedWithHeaderClient.class, IndividuallyNestedWithHeaderAsyncClient.class }) -public final class IndividuallyNestedWithHeaderClientBuilder 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("_specs_-azure-clientgenerator-core-clientinitialization-individuallyclient.properties"); - - @Generated - private final List pipelinePolicies; - - /** - * Create an instance of the IndividuallyNestedWithHeaderClientBuilder. - */ - @Generated - public IndividuallyNestedWithHeaderClientBuilder() { - this.pipelinePolicies = new ArrayList<>(); - } - - /* - * The HTTP client used to send the request. - */ - @Generated - private HttpClient httpClient; - - /** - * {@inheritDoc}. - */ - @Generated - @Override - public IndividuallyNestedWithHeaderClientBuilder httpClient(HttpClient httpClient) { - this.httpClient = httpClient; - return this; - } - - /* - * The HTTP pipeline to send requests through. - */ - @Generated - private HttpPipeline pipeline; - - /** - * {@inheritDoc}. - */ - @Generated - @Override - public IndividuallyNestedWithHeaderClientBuilder 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 logging configuration for HTTP requests and responses. - */ - @Generated - private HttpLogOptions httpLogOptions; - - /** - * {@inheritDoc}. - */ - @Generated - @Override - public IndividuallyNestedWithHeaderClientBuilder 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 IndividuallyNestedWithHeaderClientBuilder 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 IndividuallyNestedWithHeaderClientBuilder retryOptions(RetryOptions retryOptions) { - this.retryOptions = retryOptions; - return this; - } - - /** - * {@inheritDoc}. - */ - @Generated - @Override - public IndividuallyNestedWithHeaderClientBuilder 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 IndividuallyNestedWithHeaderClientBuilder configuration(Configuration configuration) { - this.configuration = configuration; - return this; - } - - /* - * The service endpoint - */ - @Generated - private String endpoint; - - /** - * {@inheritDoc}. - */ - @Generated - @Override - public IndividuallyNestedWithHeaderClientBuilder endpoint(String endpoint) { - this.endpoint = endpoint; - return this; - } - - /* - * - */ - @Generated - private String name; - - /** - * Sets. - * - * @param name the name value. - * @return the IndividuallyNestedWithHeaderClientBuilder. - */ - @Generated - public IndividuallyNestedWithHeaderClientBuilder name(String name) { - this.name = name; - 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 IndividuallyNestedWithHeaderClientBuilder. - */ - @Generated - public IndividuallyNestedWithHeaderClientBuilder retryPolicy(RetryPolicy retryPolicy) { - this.retryPolicy = retryPolicy; - return this; - } - - /** - * Builds an instance of IndividuallyNestedWithHeaderClientImpl with the provided parameters. - * - * @return an instance of IndividuallyNestedWithHeaderClientImpl. - */ - @Generated - private IndividuallyNestedWithHeaderClientImpl buildInnerClient() { - this.validateClient(); - HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); - String localEndpoint = (endpoint != null) ? endpoint : "http://localhost:3000"; - IndividuallyNestedWithHeaderClientImpl client = new IndividuallyNestedWithHeaderClientImpl(localPipeline, - JacksonAdapter.createDefaultSerializerAdapter(), localEndpoint, this.name); - 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(name, "'name' 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 IndividuallyNestedWithHeaderAsyncClient class. - * - * @return an instance of IndividuallyNestedWithHeaderAsyncClient. - */ - @Generated - public IndividuallyNestedWithHeaderAsyncClient buildAsyncClient() { - return new IndividuallyNestedWithHeaderAsyncClient(buildInnerClient()); - } - - /** - * Builds an instance of IndividuallyNestedWithHeaderClient class. - * - * @return an instance of IndividuallyNestedWithHeaderClient. - */ - @Generated - public IndividuallyNestedWithHeaderClient buildClient() { - return new IndividuallyNestedWithHeaderClient(buildInnerClient()); - } - - private static final ClientLogger LOGGER = new ClientLogger(IndividuallyNestedWithHeaderClientBuilder.class); -} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyclient/IndividuallyNestedWithMixedAsyncClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyclient/IndividuallyNestedWithMixedAsyncClient.java deleted file mode 100644 index 53c3cee677f..00000000000 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyclient/IndividuallyNestedWithMixedAsyncClient.java +++ /dev/null @@ -1,180 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package _specs_.azure.clientgenerator.core.clientinitialization.individuallyclient; - -import _specs_.azure.clientgenerator.core.clientinitialization.individuallyclient.implementation.IndividuallyNestedWithMixedClientImpl; -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 reactor.core.publisher.Mono; - -/** - * Initializes a new instance of the asynchronous IndividuallyNestedWithMixedClient type. - */ -@ServiceClient(builder = IndividuallyNestedWithMixedClientBuilder.class, isAsync = true) -public final class IndividuallyNestedWithMixedAsyncClient { - @Generated - private final IndividuallyNestedWithMixedClientImpl serviceClient; - - /** - * Initializes an instance of IndividuallyNestedWithMixedAsyncClient class. - * - * @param serviceClient the service client implementation. - */ - @Generated - IndividuallyNestedWithMixedAsyncClient(IndividuallyNestedWithMixedClientImpl serviceClient) { - this.serviceClient = serviceClient; - } - - /** - * The withQuery operation. - *

Query Parameters

- * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
formatStringNoThe format parameter
- * You can add these to a request with {@link RequestOptions#addQueryParam} - * - * @param region The region 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 {@link Response} on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> withQueryWithResponse(String region, RequestOptions requestOptions) { - return this.serviceClient.withQueryWithResponseAsync(region, requestOptions); - } - - /** - * The getStandalone operation. - * - * @param region The region 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 {@link Response} on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getStandaloneWithResponse(String region, RequestOptions requestOptions) { - return this.serviceClient.getStandaloneWithResponseAsync(region, requestOptions); - } - - /** - * The deleteStandalone operation. - * - * @param region The region 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 {@link Response} on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteStandaloneWithResponse(String region, RequestOptions requestOptions) { - return this.serviceClient.deleteStandaloneWithResponseAsync(region, requestOptions); - } - - /** - * The withQuery operation. - * - * @param region The region parameter. - * @param format The format 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 A {@link Mono} that completes when a successful response is received. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono withQuery(String region, String format) { - // Generated convenience method for withQueryWithResponse - RequestOptions requestOptions = new RequestOptions(); - if (format != null) { - requestOptions.addQueryParam("format", format, false); - } - return withQueryWithResponse(region, requestOptions).flatMap(FluxUtil::toMono); - } - - /** - * The withQuery operation. - * - * @param region The region 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 A {@link Mono} that completes when a successful response is received. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono withQuery(String region) { - // Generated convenience method for withQueryWithResponse - RequestOptions requestOptions = new RequestOptions(); - return withQueryWithResponse(region, requestOptions).flatMap(FluxUtil::toMono); - } - - /** - * The getStandalone operation. - * - * @param region The region 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 A {@link Mono} that completes when a successful response is received. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getStandalone(String region) { - // Generated convenience method for getStandaloneWithResponse - RequestOptions requestOptions = new RequestOptions(); - return getStandaloneWithResponse(region, requestOptions).flatMap(FluxUtil::toMono); - } - - /** - * The deleteStandalone operation. - * - * @param region The region 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 A {@link Mono} that completes when a successful response is received. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteStandalone(String region) { - // Generated convenience method for deleteStandaloneWithResponse - RequestOptions requestOptions = new RequestOptions(); - return deleteStandaloneWithResponse(region, requestOptions).flatMap(FluxUtil::toMono); - } -} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyclient/IndividuallyNestedWithMixedClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyclient/IndividuallyNestedWithMixedClient.java deleted file mode 100644 index ef09cdbfc1b..00000000000 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyclient/IndividuallyNestedWithMixedClient.java +++ /dev/null @@ -1,174 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package _specs_.azure.clientgenerator.core.clientinitialization.individuallyclient; - -import _specs_.azure.clientgenerator.core.clientinitialization.individuallyclient.implementation.IndividuallyNestedWithMixedClientImpl; -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; - -/** - * Initializes a new instance of the synchronous IndividuallyNestedWithMixedClient type. - */ -@ServiceClient(builder = IndividuallyNestedWithMixedClientBuilder.class) -public final class IndividuallyNestedWithMixedClient { - @Generated - private final IndividuallyNestedWithMixedClientImpl serviceClient; - - /** - * Initializes an instance of IndividuallyNestedWithMixedClient class. - * - * @param serviceClient the service client implementation. - */ - @Generated - IndividuallyNestedWithMixedClient(IndividuallyNestedWithMixedClientImpl serviceClient) { - this.serviceClient = serviceClient; - } - - /** - * The withQuery operation. - *

Query Parameters

- * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
formatStringNoThe format parameter
- * You can add these to a request with {@link RequestOptions#addQueryParam} - * - * @param region The region 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 {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response withQueryWithResponse(String region, RequestOptions requestOptions) { - return this.serviceClient.withQueryWithResponse(region, requestOptions); - } - - /** - * The getStandalone operation. - * - * @param region The region 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 {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getStandaloneWithResponse(String region, RequestOptions requestOptions) { - return this.serviceClient.getStandaloneWithResponse(region, requestOptions); - } - - /** - * The deleteStandalone operation. - * - * @param region The region 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 {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteStandaloneWithResponse(String region, RequestOptions requestOptions) { - return this.serviceClient.deleteStandaloneWithResponse(region, requestOptions); - } - - /** - * The withQuery operation. - * - * @param region The region parameter. - * @param format The format 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. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public void withQuery(String region, String format) { - // Generated convenience method for withQueryWithResponse - RequestOptions requestOptions = new RequestOptions(); - if (format != null) { - requestOptions.addQueryParam("format", format, false); - } - withQueryWithResponse(region, requestOptions).getValue(); - } - - /** - * The withQuery operation. - * - * @param region The region 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. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public void withQuery(String region) { - // Generated convenience method for withQueryWithResponse - RequestOptions requestOptions = new RequestOptions(); - withQueryWithResponse(region, requestOptions).getValue(); - } - - /** - * The getStandalone operation. - * - * @param region The region 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. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public void getStandalone(String region) { - // Generated convenience method for getStandaloneWithResponse - RequestOptions requestOptions = new RequestOptions(); - getStandaloneWithResponse(region, requestOptions).getValue(); - } - - /** - * The deleteStandalone operation. - * - * @param region The region 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. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public void deleteStandalone(String region) { - // Generated convenience method for deleteStandaloneWithResponse - RequestOptions requestOptions = new RequestOptions(); - deleteStandaloneWithResponse(region, requestOptions).getValue(); - } -} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyclient/IndividuallyNestedWithMixedClientBuilder.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyclient/IndividuallyNestedWithMixedClientBuilder.java deleted file mode 100644 index 33cef9e20a8..00000000000 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyclient/IndividuallyNestedWithMixedClientBuilder.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 _specs_.azure.clientgenerator.core.clientinitialization.individuallyclient; - -import _specs_.azure.clientgenerator.core.clientinitialization.individuallyclient.implementation.IndividuallyNestedWithMixedClientImpl; -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.HttpLogOptions; -import com.azure.core.http.policy.HttpLoggingPolicy; -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 java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.Objects; - -/** - * A builder for creating a new instance of the IndividuallyNestedWithMixedClient type. - */ -@ServiceClientBuilder( - serviceClients = { IndividuallyNestedWithMixedClient.class, IndividuallyNestedWithMixedAsyncClient.class }) -public final class IndividuallyNestedWithMixedClientBuilder 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("_specs_-azure-clientgenerator-core-clientinitialization-individuallyclient.properties"); - - @Generated - private final List pipelinePolicies; - - /** - * Create an instance of the IndividuallyNestedWithMixedClientBuilder. - */ - @Generated - public IndividuallyNestedWithMixedClientBuilder() { - this.pipelinePolicies = new ArrayList<>(); - } - - /* - * The HTTP client used to send the request. - */ - @Generated - private HttpClient httpClient; - - /** - * {@inheritDoc}. - */ - @Generated - @Override - public IndividuallyNestedWithMixedClientBuilder httpClient(HttpClient httpClient) { - this.httpClient = httpClient; - return this; - } - - /* - * The HTTP pipeline to send requests through. - */ - @Generated - private HttpPipeline pipeline; - - /** - * {@inheritDoc}. - */ - @Generated - @Override - public IndividuallyNestedWithMixedClientBuilder 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 logging configuration for HTTP requests and responses. - */ - @Generated - private HttpLogOptions httpLogOptions; - - /** - * {@inheritDoc}. - */ - @Generated - @Override - public IndividuallyNestedWithMixedClientBuilder 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 IndividuallyNestedWithMixedClientBuilder 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 IndividuallyNestedWithMixedClientBuilder retryOptions(RetryOptions retryOptions) { - this.retryOptions = retryOptions; - return this; - } - - /** - * {@inheritDoc}. - */ - @Generated - @Override - public IndividuallyNestedWithMixedClientBuilder 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 IndividuallyNestedWithMixedClientBuilder configuration(Configuration configuration) { - this.configuration = configuration; - return this; - } - - /* - * The service endpoint - */ - @Generated - private String endpoint; - - /** - * {@inheritDoc}. - */ - @Generated - @Override - public IndividuallyNestedWithMixedClientBuilder endpoint(String endpoint) { - this.endpoint = endpoint; - return this; - } - - /* - * - */ - @Generated - private String name; - - /** - * Sets. - * - * @param name the name value. - * @return the IndividuallyNestedWithMixedClientBuilder. - */ - @Generated - public IndividuallyNestedWithMixedClientBuilder name(String name) { - this.name = name; - 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 IndividuallyNestedWithMixedClientBuilder. - */ - @Generated - public IndividuallyNestedWithMixedClientBuilder retryPolicy(RetryPolicy retryPolicy) { - this.retryPolicy = retryPolicy; - return this; - } - - /** - * Builds an instance of IndividuallyNestedWithMixedClientImpl with the provided parameters. - * - * @return an instance of IndividuallyNestedWithMixedClientImpl. - */ - @Generated - private IndividuallyNestedWithMixedClientImpl buildInnerClient() { - this.validateClient(); - HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); - String localEndpoint = (endpoint != null) ? endpoint : "http://localhost:3000"; - IndividuallyNestedWithMixedClientImpl client = new IndividuallyNestedWithMixedClientImpl(localPipeline, - JacksonAdapter.createDefaultSerializerAdapter(), localEndpoint, this.name); - 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(name, "'name' 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 IndividuallyNestedWithMixedAsyncClient class. - * - * @return an instance of IndividuallyNestedWithMixedAsyncClient. - */ - @Generated - public IndividuallyNestedWithMixedAsyncClient buildAsyncClient() { - return new IndividuallyNestedWithMixedAsyncClient(buildInnerClient()); - } - - /** - * Builds an instance of IndividuallyNestedWithMixedClient class. - * - * @return an instance of IndividuallyNestedWithMixedClient. - */ - @Generated - public IndividuallyNestedWithMixedClient buildClient() { - return new IndividuallyNestedWithMixedClient(buildInnerClient()); - } - - private static final ClientLogger LOGGER = new ClientLogger(IndividuallyNestedWithMixedClientBuilder.class); -} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyclient/IndividuallyNestedWithMultipleAsyncClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyclient/IndividuallyNestedWithMultipleAsyncClient.java deleted file mode 100644 index 2a6bc41f29c..00000000000 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyclient/IndividuallyNestedWithMultipleAsyncClient.java +++ /dev/null @@ -1,170 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package _specs_.azure.clientgenerator.core.clientinitialization.individuallyclient; - -import _specs_.azure.clientgenerator.core.clientinitialization.individuallyclient.implementation.IndividuallyNestedWithMultipleClientImpl; -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 reactor.core.publisher.Mono; - -/** - * Initializes a new instance of the asynchronous IndividuallyNestedWithMultipleClient type. - */ -@ServiceClient(builder = IndividuallyNestedWithMultipleClientBuilder.class, isAsync = true) -public final class IndividuallyNestedWithMultipleAsyncClient { - @Generated - private final IndividuallyNestedWithMultipleClientImpl serviceClient; - - /** - * Initializes an instance of IndividuallyNestedWithMultipleAsyncClient class. - * - * @param serviceClient the service client implementation. - */ - @Generated - IndividuallyNestedWithMultipleAsyncClient(IndividuallyNestedWithMultipleClientImpl serviceClient) { - this.serviceClient = serviceClient; - } - - /** - * The withQuery operation. - *

Query Parameters

- * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
formatStringNoThe format parameter
- * You can add these to a request with {@link RequestOptions#addQueryParam} - * - * @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> withQueryWithResponse(RequestOptions requestOptions) { - return this.serviceClient.withQueryWithResponseAsync(requestOptions); - } - - /** - * The getStandalone 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> getStandaloneWithResponse(RequestOptions requestOptions) { - return this.serviceClient.getStandaloneWithResponseAsync(requestOptions); - } - - /** - * The deleteStandalone 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> deleteStandaloneWithResponse(RequestOptions requestOptions) { - return this.serviceClient.deleteStandaloneWithResponseAsync(requestOptions); - } - - /** - * The withQuery operation. - * - * @param format The format 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 A {@link Mono} that completes when a successful response is received. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono withQuery(String format) { - // Generated convenience method for withQueryWithResponse - RequestOptions requestOptions = new RequestOptions(); - if (format != null) { - requestOptions.addQueryParam("format", format, false); - } - return withQueryWithResponse(requestOptions).flatMap(FluxUtil::toMono); - } - - /** - * The withQuery 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 withQuery() { - // Generated convenience method for withQueryWithResponse - RequestOptions requestOptions = new RequestOptions(); - return withQueryWithResponse(requestOptions).flatMap(FluxUtil::toMono); - } - - /** - * The getStandalone 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 getStandalone() { - // Generated convenience method for getStandaloneWithResponse - RequestOptions requestOptions = new RequestOptions(); - return getStandaloneWithResponse(requestOptions).flatMap(FluxUtil::toMono); - } - - /** - * The deleteStandalone 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 deleteStandalone() { - // Generated convenience method for deleteStandaloneWithResponse - RequestOptions requestOptions = new RequestOptions(); - return deleteStandaloneWithResponse(requestOptions).flatMap(FluxUtil::toMono); - } -} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyclient/IndividuallyNestedWithMultipleClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyclient/IndividuallyNestedWithMultipleClient.java deleted file mode 100644 index 87001b2643b..00000000000 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyclient/IndividuallyNestedWithMultipleClient.java +++ /dev/null @@ -1,164 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package _specs_.azure.clientgenerator.core.clientinitialization.individuallyclient; - -import _specs_.azure.clientgenerator.core.clientinitialization.individuallyclient.implementation.IndividuallyNestedWithMultipleClientImpl; -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; - -/** - * Initializes a new instance of the synchronous IndividuallyNestedWithMultipleClient type. - */ -@ServiceClient(builder = IndividuallyNestedWithMultipleClientBuilder.class) -public final class IndividuallyNestedWithMultipleClient { - @Generated - private final IndividuallyNestedWithMultipleClientImpl serviceClient; - - /** - * Initializes an instance of IndividuallyNestedWithMultipleClient class. - * - * @param serviceClient the service client implementation. - */ - @Generated - IndividuallyNestedWithMultipleClient(IndividuallyNestedWithMultipleClientImpl serviceClient) { - this.serviceClient = serviceClient; - } - - /** - * The withQuery operation. - *

Query Parameters

- * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
formatStringNoThe format parameter
- * You can add these to a request with {@link RequestOptions#addQueryParam} - * - * @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 withQueryWithResponse(RequestOptions requestOptions) { - return this.serviceClient.withQueryWithResponse(requestOptions); - } - - /** - * The getStandalone 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 getStandaloneWithResponse(RequestOptions requestOptions) { - return this.serviceClient.getStandaloneWithResponse(requestOptions); - } - - /** - * The deleteStandalone 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 deleteStandaloneWithResponse(RequestOptions requestOptions) { - return this.serviceClient.deleteStandaloneWithResponse(requestOptions); - } - - /** - * The withQuery operation. - * - * @param format The format 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. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public void withQuery(String format) { - // Generated convenience method for withQueryWithResponse - RequestOptions requestOptions = new RequestOptions(); - if (format != null) { - requestOptions.addQueryParam("format", format, false); - } - withQueryWithResponse(requestOptions).getValue(); - } - - /** - * The withQuery 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 withQuery() { - // Generated convenience method for withQueryWithResponse - RequestOptions requestOptions = new RequestOptions(); - withQueryWithResponse(requestOptions).getValue(); - } - - /** - * The getStandalone 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 getStandalone() { - // Generated convenience method for getStandaloneWithResponse - RequestOptions requestOptions = new RequestOptions(); - getStandaloneWithResponse(requestOptions).getValue(); - } - - /** - * The deleteStandalone 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 deleteStandalone() { - // Generated convenience method for deleteStandaloneWithResponse - RequestOptions requestOptions = new RequestOptions(); - deleteStandaloneWithResponse(requestOptions).getValue(); - } -} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyclient/IndividuallyNestedWithMultipleClientBuilder.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyclient/IndividuallyNestedWithMultipleClientBuilder.java deleted file mode 100644 index 903427389f8..00000000000 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyclient/IndividuallyNestedWithMultipleClientBuilder.java +++ /dev/null @@ -1,329 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package _specs_.azure.clientgenerator.core.clientinitialization.individuallyclient; - -import _specs_.azure.clientgenerator.core.clientinitialization.individuallyclient.implementation.IndividuallyNestedWithMultipleClientImpl; -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.HttpLogOptions; -import com.azure.core.http.policy.HttpLoggingPolicy; -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 java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.Objects; - -/** - * A builder for creating a new instance of the IndividuallyNestedWithMultipleClient type. - */ -@ServiceClientBuilder( - serviceClients = { IndividuallyNestedWithMultipleClient.class, IndividuallyNestedWithMultipleAsyncClient.class }) -public final class IndividuallyNestedWithMultipleClientBuilder - 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("_specs_-azure-clientgenerator-core-clientinitialization-individuallyclient.properties"); - - @Generated - private final List pipelinePolicies; - - /** - * Create an instance of the IndividuallyNestedWithMultipleClientBuilder. - */ - @Generated - public IndividuallyNestedWithMultipleClientBuilder() { - this.pipelinePolicies = new ArrayList<>(); - } - - /* - * The HTTP client used to send the request. - */ - @Generated - private HttpClient httpClient; - - /** - * {@inheritDoc}. - */ - @Generated - @Override - public IndividuallyNestedWithMultipleClientBuilder httpClient(HttpClient httpClient) { - this.httpClient = httpClient; - return this; - } - - /* - * The HTTP pipeline to send requests through. - */ - @Generated - private HttpPipeline pipeline; - - /** - * {@inheritDoc}. - */ - @Generated - @Override - public IndividuallyNestedWithMultipleClientBuilder 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 logging configuration for HTTP requests and responses. - */ - @Generated - private HttpLogOptions httpLogOptions; - - /** - * {@inheritDoc}. - */ - @Generated - @Override - public IndividuallyNestedWithMultipleClientBuilder 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 IndividuallyNestedWithMultipleClientBuilder 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 IndividuallyNestedWithMultipleClientBuilder retryOptions(RetryOptions retryOptions) { - this.retryOptions = retryOptions; - return this; - } - - /** - * {@inheritDoc}. - */ - @Generated - @Override - public IndividuallyNestedWithMultipleClientBuilder 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 IndividuallyNestedWithMultipleClientBuilder configuration(Configuration configuration) { - this.configuration = configuration; - return this; - } - - /* - * The service endpoint - */ - @Generated - private String endpoint; - - /** - * {@inheritDoc}. - */ - @Generated - @Override - public IndividuallyNestedWithMultipleClientBuilder endpoint(String endpoint) { - this.endpoint = endpoint; - return this; - } - - /* - * - */ - @Generated - private String name; - - /** - * Sets. - * - * @param name the name value. - * @return the IndividuallyNestedWithMultipleClientBuilder. - */ - @Generated - public IndividuallyNestedWithMultipleClientBuilder name(String name) { - this.name = name; - return this; - } - - /* - * - */ - @Generated - private String region; - - /** - * Sets. - * - * @param region the region value. - * @return the IndividuallyNestedWithMultipleClientBuilder. - */ - @Generated - public IndividuallyNestedWithMultipleClientBuilder region(String region) { - this.region = region; - 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 IndividuallyNestedWithMultipleClientBuilder. - */ - @Generated - public IndividuallyNestedWithMultipleClientBuilder retryPolicy(RetryPolicy retryPolicy) { - this.retryPolicy = retryPolicy; - return this; - } - - /** - * Builds an instance of IndividuallyNestedWithMultipleClientImpl with the provided parameters. - * - * @return an instance of IndividuallyNestedWithMultipleClientImpl. - */ - @Generated - private IndividuallyNestedWithMultipleClientImpl buildInnerClient() { - this.validateClient(); - HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); - String localEndpoint = (endpoint != null) ? endpoint : "http://localhost:3000"; - IndividuallyNestedWithMultipleClientImpl client = new IndividuallyNestedWithMultipleClientImpl(localPipeline, - JacksonAdapter.createDefaultSerializerAdapter(), localEndpoint, this.name, this.region); - 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(name, "'name' cannot be null."); - Objects.requireNonNull(region, "'region' 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 IndividuallyNestedWithMultipleAsyncClient class. - * - * @return an instance of IndividuallyNestedWithMultipleAsyncClient. - */ - @Generated - public IndividuallyNestedWithMultipleAsyncClient buildAsyncClient() { - return new IndividuallyNestedWithMultipleAsyncClient(buildInnerClient()); - } - - /** - * Builds an instance of IndividuallyNestedWithMultipleClient class. - * - * @return an instance of IndividuallyNestedWithMultipleClient. - */ - @Generated - public IndividuallyNestedWithMultipleClient buildClient() { - return new IndividuallyNestedWithMultipleClient(buildInnerClient()); - } - - private static final ClientLogger LOGGER = new ClientLogger(IndividuallyNestedWithMultipleClientBuilder.class); -} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyclient/IndividuallyNestedWithParamAliasAsyncClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyclient/IndividuallyNestedWithParamAliasAsyncClient.java deleted file mode 100644 index 3af980f242a..00000000000 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyclient/IndividuallyNestedWithParamAliasAsyncClient.java +++ /dev/null @@ -1,106 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package _specs_.azure.clientgenerator.core.clientinitialization.individuallyclient; - -import _specs_.azure.clientgenerator.core.clientinitialization.individuallyclient.implementation.IndividuallyNestedWithParamAliasClientImpl; -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 reactor.core.publisher.Mono; - -/** - * Initializes a new instance of the asynchronous IndividuallyNestedWithParamAliasClient type. - */ -@ServiceClient(builder = IndividuallyNestedWithParamAliasClientBuilder.class, isAsync = true) -public final class IndividuallyNestedWithParamAliasAsyncClient { - @Generated - private final IndividuallyNestedWithParamAliasClientImpl serviceClient; - - /** - * Initializes an instance of IndividuallyNestedWithParamAliasAsyncClient class. - * - * @param serviceClient the service client implementation. - */ - @Generated - IndividuallyNestedWithParamAliasAsyncClient(IndividuallyNestedWithParamAliasClientImpl serviceClient) { - this.serviceClient = serviceClient; - } - - /** - * The withAliasedName 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> withAliasedNameWithResponse(RequestOptions requestOptions) { - return this.serviceClient.withAliasedNameWithResponseAsync(requestOptions); - } - - /** - * The withOriginalName 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> withOriginalNameWithResponse(RequestOptions requestOptions) { - return this.serviceClient.withOriginalNameWithResponseAsync(requestOptions); - } - - /** - * The withAliasedName 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 withAliasedName() { - // Generated convenience method for withAliasedNameWithResponse - RequestOptions requestOptions = new RequestOptions(); - return withAliasedNameWithResponse(requestOptions).flatMap(FluxUtil::toMono); - } - - /** - * The withOriginalName 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 withOriginalName() { - // Generated convenience method for withOriginalNameWithResponse - RequestOptions requestOptions = new RequestOptions(); - return withOriginalNameWithResponse(requestOptions).flatMap(FluxUtil::toMono); - } -} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyclient/IndividuallyNestedWithParamAliasClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyclient/IndividuallyNestedWithParamAliasClient.java deleted file mode 100644 index 2ca0e3612ab..00000000000 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyclient/IndividuallyNestedWithParamAliasClient.java +++ /dev/null @@ -1,102 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package _specs_.azure.clientgenerator.core.clientinitialization.individuallyclient; - -import _specs_.azure.clientgenerator.core.clientinitialization.individuallyclient.implementation.IndividuallyNestedWithParamAliasClientImpl; -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; - -/** - * Initializes a new instance of the synchronous IndividuallyNestedWithParamAliasClient type. - */ -@ServiceClient(builder = IndividuallyNestedWithParamAliasClientBuilder.class) -public final class IndividuallyNestedWithParamAliasClient { - @Generated - private final IndividuallyNestedWithParamAliasClientImpl serviceClient; - - /** - * Initializes an instance of IndividuallyNestedWithParamAliasClient class. - * - * @param serviceClient the service client implementation. - */ - @Generated - IndividuallyNestedWithParamAliasClient(IndividuallyNestedWithParamAliasClientImpl serviceClient) { - this.serviceClient = serviceClient; - } - - /** - * The withAliasedName 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 withAliasedNameWithResponse(RequestOptions requestOptions) { - return this.serviceClient.withAliasedNameWithResponse(requestOptions); - } - - /** - * The withOriginalName 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 withOriginalNameWithResponse(RequestOptions requestOptions) { - return this.serviceClient.withOriginalNameWithResponse(requestOptions); - } - - /** - * The withAliasedName 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 withAliasedName() { - // Generated convenience method for withAliasedNameWithResponse - RequestOptions requestOptions = new RequestOptions(); - withAliasedNameWithResponse(requestOptions).getValue(); - } - - /** - * The withOriginalName 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 withOriginalName() { - // Generated convenience method for withOriginalNameWithResponse - RequestOptions requestOptions = new RequestOptions(); - withOriginalNameWithResponse(requestOptions).getValue(); - } -} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyclient/IndividuallyNestedWithParamAliasClientBuilder.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyclient/IndividuallyNestedWithParamAliasClientBuilder.java deleted file mode 100644 index f79386da364..00000000000 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyclient/IndividuallyNestedWithParamAliasClientBuilder.java +++ /dev/null @@ -1,312 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package _specs_.azure.clientgenerator.core.clientinitialization.individuallyclient; - -import _specs_.azure.clientgenerator.core.clientinitialization.individuallyclient.implementation.IndividuallyNestedWithParamAliasClientImpl; -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.HttpLogOptions; -import com.azure.core.http.policy.HttpLoggingPolicy; -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 java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.Objects; - -/** - * A builder for creating a new instance of the IndividuallyNestedWithParamAliasClient type. - */ -@ServiceClientBuilder( - serviceClients = { - IndividuallyNestedWithParamAliasClient.class, - IndividuallyNestedWithParamAliasAsyncClient.class }) -public final class IndividuallyNestedWithParamAliasClientBuilder - 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("_specs_-azure-clientgenerator-core-clientinitialization-individuallyclient.properties"); - - @Generated - private final List pipelinePolicies; - - /** - * Create an instance of the IndividuallyNestedWithParamAliasClientBuilder. - */ - @Generated - public IndividuallyNestedWithParamAliasClientBuilder() { - this.pipelinePolicies = new ArrayList<>(); - } - - /* - * The HTTP client used to send the request. - */ - @Generated - private HttpClient httpClient; - - /** - * {@inheritDoc}. - */ - @Generated - @Override - public IndividuallyNestedWithParamAliasClientBuilder httpClient(HttpClient httpClient) { - this.httpClient = httpClient; - return this; - } - - /* - * The HTTP pipeline to send requests through. - */ - @Generated - private HttpPipeline pipeline; - - /** - * {@inheritDoc}. - */ - @Generated - @Override - public IndividuallyNestedWithParamAliasClientBuilder 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 logging configuration for HTTP requests and responses. - */ - @Generated - private HttpLogOptions httpLogOptions; - - /** - * {@inheritDoc}. - */ - @Generated - @Override - public IndividuallyNestedWithParamAliasClientBuilder 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 IndividuallyNestedWithParamAliasClientBuilder 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 IndividuallyNestedWithParamAliasClientBuilder retryOptions(RetryOptions retryOptions) { - this.retryOptions = retryOptions; - return this; - } - - /** - * {@inheritDoc}. - */ - @Generated - @Override - public IndividuallyNestedWithParamAliasClientBuilder 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 IndividuallyNestedWithParamAliasClientBuilder configuration(Configuration configuration) { - this.configuration = configuration; - return this; - } - - /* - * The service endpoint - */ - @Generated - private String endpoint; - - /** - * {@inheritDoc}. - */ - @Generated - @Override - public IndividuallyNestedWithParamAliasClientBuilder endpoint(String endpoint) { - this.endpoint = endpoint; - return this; - } - - /* - * - */ - @Generated - private String blobName; - - /** - * Sets. - * - * @param blobName the blobName value. - * @return the IndividuallyNestedWithParamAliasClientBuilder. - */ - @Generated - public IndividuallyNestedWithParamAliasClientBuilder blobName(String blobName) { - this.blobName = blobName; - 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 IndividuallyNestedWithParamAliasClientBuilder. - */ - @Generated - public IndividuallyNestedWithParamAliasClientBuilder retryPolicy(RetryPolicy retryPolicy) { - this.retryPolicy = retryPolicy; - return this; - } - - /** - * Builds an instance of IndividuallyNestedWithParamAliasClientImpl with the provided parameters. - * - * @return an instance of IndividuallyNestedWithParamAliasClientImpl. - */ - @Generated - private IndividuallyNestedWithParamAliasClientImpl buildInnerClient() { - this.validateClient(); - HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); - String localEndpoint = (endpoint != null) ? endpoint : "http://localhost:3000"; - IndividuallyNestedWithParamAliasClientImpl client = new IndividuallyNestedWithParamAliasClientImpl( - localPipeline, JacksonAdapter.createDefaultSerializerAdapter(), localEndpoint, this.blobName); - 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(blobName, "'blobName' 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 IndividuallyNestedWithParamAliasAsyncClient class. - * - * @return an instance of IndividuallyNestedWithParamAliasAsyncClient. - */ - @Generated - public IndividuallyNestedWithParamAliasAsyncClient buildAsyncClient() { - return new IndividuallyNestedWithParamAliasAsyncClient(buildInnerClient()); - } - - /** - * Builds an instance of IndividuallyNestedWithParamAliasClient class. - * - * @return an instance of IndividuallyNestedWithParamAliasClient. - */ - @Generated - public IndividuallyNestedWithParamAliasClient buildClient() { - return new IndividuallyNestedWithParamAliasClient(buildInnerClient()); - } - - private static final ClientLogger LOGGER = new ClientLogger(IndividuallyNestedWithParamAliasClientBuilder.class); -} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyclient/IndividuallyNestedWithPathAsyncClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyclient/IndividuallyNestedWithPathAsyncClient.java deleted file mode 100644 index de5fabcb75f..00000000000 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyclient/IndividuallyNestedWithPathAsyncClient.java +++ /dev/null @@ -1,185 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package _specs_.azure.clientgenerator.core.clientinitialization.individuallyclient; - -import _specs_.azure.clientgenerator.core.clientinitialization.individuallyclient.implementation.IndividuallyNestedWithPathClientImpl; -import _specs_.azure.clientgenerator.core.clientinitialization.individuallyclient.models.BlobProperties; -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.BinaryData; -import com.azure.core.util.FluxUtil; -import reactor.core.publisher.Mono; - -/** - * Initializes a new instance of the asynchronous IndividuallyNestedWithPathClient type. - */ -@ServiceClient(builder = IndividuallyNestedWithPathClientBuilder.class, isAsync = true) -public final class IndividuallyNestedWithPathAsyncClient { - @Generated - private final IndividuallyNestedWithPathClientImpl serviceClient; - - /** - * Initializes an instance of IndividuallyNestedWithPathAsyncClient class. - * - * @param serviceClient the service client implementation. - */ - @Generated - IndividuallyNestedWithPathAsyncClient(IndividuallyNestedWithPathClientImpl serviceClient) { - this.serviceClient = serviceClient; - } - - /** - * The withQuery operation. - *

Query Parameters

- * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
formatStringNoThe format parameter
- * You can add these to a request with {@link RequestOptions#addQueryParam} - * - * @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> withQueryWithResponse(RequestOptions requestOptions) { - return this.serviceClient.withQueryWithResponseAsync(requestOptions); - } - - /** - * The getStandalone operation. - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     name: String (Required)
-     *     size: long (Required)
-     *     contentType: String (Required)
-     *     createdOn: OffsetDateTime (Required)
-     * }
-     * }
-     * 
- * - * @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 properties of a blob along with {@link Response} on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getStandaloneWithResponse(RequestOptions requestOptions) { - return this.serviceClient.getStandaloneWithResponseAsync(requestOptions); - } - - /** - * The deleteStandalone 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> deleteStandaloneWithResponse(RequestOptions requestOptions) { - return this.serviceClient.deleteStandaloneWithResponseAsync(requestOptions); - } - - /** - * The withQuery operation. - * - * @param format The format 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 A {@link Mono} that completes when a successful response is received. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono withQuery(String format) { - // Generated convenience method for withQueryWithResponse - RequestOptions requestOptions = new RequestOptions(); - if (format != null) { - requestOptions.addQueryParam("format", format, false); - } - return withQueryWithResponse(requestOptions).flatMap(FluxUtil::toMono); - } - - /** - * The withQuery 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 withQuery() { - // Generated convenience method for withQueryWithResponse - RequestOptions requestOptions = new RequestOptions(); - return withQueryWithResponse(requestOptions).flatMap(FluxUtil::toMono); - } - - /** - * The getStandalone 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 properties of a blob on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getStandalone() { - // Generated convenience method for getStandaloneWithResponse - RequestOptions requestOptions = new RequestOptions(); - return getStandaloneWithResponse(requestOptions).flatMap(FluxUtil::toMono) - .map(protocolMethodData -> protocolMethodData.toObject(BlobProperties.class)); - } - - /** - * The deleteStandalone 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 deleteStandalone() { - // Generated convenience method for deleteStandaloneWithResponse - RequestOptions requestOptions = new RequestOptions(); - return deleteStandaloneWithResponse(requestOptions).flatMap(FluxUtil::toMono); - } -} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyclient/IndividuallyNestedWithPathClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyclient/IndividuallyNestedWithPathClient.java deleted file mode 100644 index 164c42056a1..00000000000 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyclient/IndividuallyNestedWithPathClient.java +++ /dev/null @@ -1,179 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package _specs_.azure.clientgenerator.core.clientinitialization.individuallyclient; - -import _specs_.azure.clientgenerator.core.clientinitialization.individuallyclient.implementation.IndividuallyNestedWithPathClientImpl; -import _specs_.azure.clientgenerator.core.clientinitialization.individuallyclient.models.BlobProperties; -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.BinaryData; - -/** - * Initializes a new instance of the synchronous IndividuallyNestedWithPathClient type. - */ -@ServiceClient(builder = IndividuallyNestedWithPathClientBuilder.class) -public final class IndividuallyNestedWithPathClient { - @Generated - private final IndividuallyNestedWithPathClientImpl serviceClient; - - /** - * Initializes an instance of IndividuallyNestedWithPathClient class. - * - * @param serviceClient the service client implementation. - */ - @Generated - IndividuallyNestedWithPathClient(IndividuallyNestedWithPathClientImpl serviceClient) { - this.serviceClient = serviceClient; - } - - /** - * The withQuery operation. - *

Query Parameters

- * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
formatStringNoThe format parameter
- * You can add these to a request with {@link RequestOptions#addQueryParam} - * - * @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 withQueryWithResponse(RequestOptions requestOptions) { - return this.serviceClient.withQueryWithResponse(requestOptions); - } - - /** - * The getStandalone operation. - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     name: String (Required)
-     *     size: long (Required)
-     *     contentType: String (Required)
-     *     createdOn: OffsetDateTime (Required)
-     * }
-     * }
-     * 
- * - * @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 properties of a blob along with {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getStandaloneWithResponse(RequestOptions requestOptions) { - return this.serviceClient.getStandaloneWithResponse(requestOptions); - } - - /** - * The deleteStandalone 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 deleteStandaloneWithResponse(RequestOptions requestOptions) { - return this.serviceClient.deleteStandaloneWithResponse(requestOptions); - } - - /** - * The withQuery operation. - * - * @param format The format 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. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public void withQuery(String format) { - // Generated convenience method for withQueryWithResponse - RequestOptions requestOptions = new RequestOptions(); - if (format != null) { - requestOptions.addQueryParam("format", format, false); - } - withQueryWithResponse(requestOptions).getValue(); - } - - /** - * The withQuery 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 withQuery() { - // Generated convenience method for withQueryWithResponse - RequestOptions requestOptions = new RequestOptions(); - withQueryWithResponse(requestOptions).getValue(); - } - - /** - * The getStandalone 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 properties of a blob. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public BlobProperties getStandalone() { - // Generated convenience method for getStandaloneWithResponse - RequestOptions requestOptions = new RequestOptions(); - return getStandaloneWithResponse(requestOptions).getValue().toObject(BlobProperties.class); - } - - /** - * The deleteStandalone 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 deleteStandalone() { - // Generated convenience method for deleteStandaloneWithResponse - RequestOptions requestOptions = new RequestOptions(); - deleteStandaloneWithResponse(requestOptions).getValue(); - } -} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyclient/IndividuallyNestedWithPathClientBuilder.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyclient/IndividuallyNestedWithPathClientBuilder.java deleted file mode 100644 index 717cfd3c82e..00000000000 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyclient/IndividuallyNestedWithPathClientBuilder.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 _specs_.azure.clientgenerator.core.clientinitialization.individuallyclient; - -import _specs_.azure.clientgenerator.core.clientinitialization.individuallyclient.implementation.IndividuallyNestedWithPathClientImpl; -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.HttpLogOptions; -import com.azure.core.http.policy.HttpLoggingPolicy; -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 java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.Objects; - -/** - * A builder for creating a new instance of the IndividuallyNestedWithPathClient type. - */ -@ServiceClientBuilder( - serviceClients = { IndividuallyNestedWithPathClient.class, IndividuallyNestedWithPathAsyncClient.class }) -public final class IndividuallyNestedWithPathClientBuilder 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("_specs_-azure-clientgenerator-core-clientinitialization-individuallyclient.properties"); - - @Generated - private final List pipelinePolicies; - - /** - * Create an instance of the IndividuallyNestedWithPathClientBuilder. - */ - @Generated - public IndividuallyNestedWithPathClientBuilder() { - this.pipelinePolicies = new ArrayList<>(); - } - - /* - * The HTTP client used to send the request. - */ - @Generated - private HttpClient httpClient; - - /** - * {@inheritDoc}. - */ - @Generated - @Override - public IndividuallyNestedWithPathClientBuilder httpClient(HttpClient httpClient) { - this.httpClient = httpClient; - return this; - } - - /* - * The HTTP pipeline to send requests through. - */ - @Generated - private HttpPipeline pipeline; - - /** - * {@inheritDoc}. - */ - @Generated - @Override - public IndividuallyNestedWithPathClientBuilder 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 logging configuration for HTTP requests and responses. - */ - @Generated - private HttpLogOptions httpLogOptions; - - /** - * {@inheritDoc}. - */ - @Generated - @Override - public IndividuallyNestedWithPathClientBuilder 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 IndividuallyNestedWithPathClientBuilder 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 IndividuallyNestedWithPathClientBuilder retryOptions(RetryOptions retryOptions) { - this.retryOptions = retryOptions; - return this; - } - - /** - * {@inheritDoc}. - */ - @Generated - @Override - public IndividuallyNestedWithPathClientBuilder 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 IndividuallyNestedWithPathClientBuilder configuration(Configuration configuration) { - this.configuration = configuration; - return this; - } - - /* - * The service endpoint - */ - @Generated - private String endpoint; - - /** - * {@inheritDoc}. - */ - @Generated - @Override - public IndividuallyNestedWithPathClientBuilder endpoint(String endpoint) { - this.endpoint = endpoint; - return this; - } - - /* - * - */ - @Generated - private String blobName; - - /** - * Sets. - * - * @param blobName the blobName value. - * @return the IndividuallyNestedWithPathClientBuilder. - */ - @Generated - public IndividuallyNestedWithPathClientBuilder blobName(String blobName) { - this.blobName = blobName; - 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 IndividuallyNestedWithPathClientBuilder. - */ - @Generated - public IndividuallyNestedWithPathClientBuilder retryPolicy(RetryPolicy retryPolicy) { - this.retryPolicy = retryPolicy; - return this; - } - - /** - * Builds an instance of IndividuallyNestedWithPathClientImpl with the provided parameters. - * - * @return an instance of IndividuallyNestedWithPathClientImpl. - */ - @Generated - private IndividuallyNestedWithPathClientImpl buildInnerClient() { - this.validateClient(); - HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); - String localEndpoint = (endpoint != null) ? endpoint : "http://localhost:3000"; - IndividuallyNestedWithPathClientImpl client = new IndividuallyNestedWithPathClientImpl(localPipeline, - JacksonAdapter.createDefaultSerializerAdapter(), localEndpoint, this.blobName); - 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(blobName, "'blobName' 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 IndividuallyNestedWithPathAsyncClient class. - * - * @return an instance of IndividuallyNestedWithPathAsyncClient. - */ - @Generated - public IndividuallyNestedWithPathAsyncClient buildAsyncClient() { - return new IndividuallyNestedWithPathAsyncClient(buildInnerClient()); - } - - /** - * Builds an instance of IndividuallyNestedWithPathClient class. - * - * @return an instance of IndividuallyNestedWithPathClient. - */ - @Generated - public IndividuallyNestedWithPathClient buildClient() { - return new IndividuallyNestedWithPathClient(buildInnerClient()); - } - - private static final ClientLogger LOGGER = new ClientLogger(IndividuallyNestedWithPathClientBuilder.class); -} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyclient/IndividuallyNestedWithQueryAsyncClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyclient/IndividuallyNestedWithQueryAsyncClient.java deleted file mode 100644 index 411ab4f0400..00000000000 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyclient/IndividuallyNestedWithQueryAsyncClient.java +++ /dev/null @@ -1,185 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package _specs_.azure.clientgenerator.core.clientinitialization.individuallyclient; - -import _specs_.azure.clientgenerator.core.clientinitialization.individuallyclient.implementation.IndividuallyNestedWithQueryClientImpl; -import _specs_.azure.clientgenerator.core.clientinitialization.individuallyclient.models.BlobProperties; -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.BinaryData; -import com.azure.core.util.FluxUtil; -import reactor.core.publisher.Mono; - -/** - * Initializes a new instance of the asynchronous IndividuallyNestedWithQueryClient type. - */ -@ServiceClient(builder = IndividuallyNestedWithQueryClientBuilder.class, isAsync = true) -public final class IndividuallyNestedWithQueryAsyncClient { - @Generated - private final IndividuallyNestedWithQueryClientImpl serviceClient; - - /** - * Initializes an instance of IndividuallyNestedWithQueryAsyncClient class. - * - * @param serviceClient the service client implementation. - */ - @Generated - IndividuallyNestedWithQueryAsyncClient(IndividuallyNestedWithQueryClientImpl serviceClient) { - this.serviceClient = serviceClient; - } - - /** - * The withQuery operation. - *

Query Parameters

- * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
formatStringNoThe format parameter
- * You can add these to a request with {@link RequestOptions#addQueryParam} - * - * @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> withQueryWithResponse(RequestOptions requestOptions) { - return this.serviceClient.withQueryWithResponseAsync(requestOptions); - } - - /** - * The getStandalone operation. - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     name: String (Required)
-     *     size: long (Required)
-     *     contentType: String (Required)
-     *     createdOn: OffsetDateTime (Required)
-     * }
-     * }
-     * 
- * - * @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 properties of a blob along with {@link Response} on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getStandaloneWithResponse(RequestOptions requestOptions) { - return this.serviceClient.getStandaloneWithResponseAsync(requestOptions); - } - - /** - * The deleteStandalone 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> deleteStandaloneWithResponse(RequestOptions requestOptions) { - return this.serviceClient.deleteStandaloneWithResponseAsync(requestOptions); - } - - /** - * The withQuery operation. - * - * @param format The format 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 A {@link Mono} that completes when a successful response is received. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono withQuery(String format) { - // Generated convenience method for withQueryWithResponse - RequestOptions requestOptions = new RequestOptions(); - if (format != null) { - requestOptions.addQueryParam("format", format, false); - } - return withQueryWithResponse(requestOptions).flatMap(FluxUtil::toMono); - } - - /** - * The withQuery 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 withQuery() { - // Generated convenience method for withQueryWithResponse - RequestOptions requestOptions = new RequestOptions(); - return withQueryWithResponse(requestOptions).flatMap(FluxUtil::toMono); - } - - /** - * The getStandalone 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 properties of a blob on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getStandalone() { - // Generated convenience method for getStandaloneWithResponse - RequestOptions requestOptions = new RequestOptions(); - return getStandaloneWithResponse(requestOptions).flatMap(FluxUtil::toMono) - .map(protocolMethodData -> protocolMethodData.toObject(BlobProperties.class)); - } - - /** - * The deleteStandalone 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 deleteStandalone() { - // Generated convenience method for deleteStandaloneWithResponse - RequestOptions requestOptions = new RequestOptions(); - return deleteStandaloneWithResponse(requestOptions).flatMap(FluxUtil::toMono); - } -} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyclient/IndividuallyNestedWithQueryClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyclient/IndividuallyNestedWithQueryClient.java deleted file mode 100644 index f70932d97ce..00000000000 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyclient/IndividuallyNestedWithQueryClient.java +++ /dev/null @@ -1,179 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package _specs_.azure.clientgenerator.core.clientinitialization.individuallyclient; - -import _specs_.azure.clientgenerator.core.clientinitialization.individuallyclient.implementation.IndividuallyNestedWithQueryClientImpl; -import _specs_.azure.clientgenerator.core.clientinitialization.individuallyclient.models.BlobProperties; -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.BinaryData; - -/** - * Initializes a new instance of the synchronous IndividuallyNestedWithQueryClient type. - */ -@ServiceClient(builder = IndividuallyNestedWithQueryClientBuilder.class) -public final class IndividuallyNestedWithQueryClient { - @Generated - private final IndividuallyNestedWithQueryClientImpl serviceClient; - - /** - * Initializes an instance of IndividuallyNestedWithQueryClient class. - * - * @param serviceClient the service client implementation. - */ - @Generated - IndividuallyNestedWithQueryClient(IndividuallyNestedWithQueryClientImpl serviceClient) { - this.serviceClient = serviceClient; - } - - /** - * The withQuery operation. - *

Query Parameters

- * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
formatStringNoThe format parameter
- * You can add these to a request with {@link RequestOptions#addQueryParam} - * - * @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 withQueryWithResponse(RequestOptions requestOptions) { - return this.serviceClient.withQueryWithResponse(requestOptions); - } - - /** - * The getStandalone operation. - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     name: String (Required)
-     *     size: long (Required)
-     *     contentType: String (Required)
-     *     createdOn: OffsetDateTime (Required)
-     * }
-     * }
-     * 
- * - * @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 properties of a blob along with {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getStandaloneWithResponse(RequestOptions requestOptions) { - return this.serviceClient.getStandaloneWithResponse(requestOptions); - } - - /** - * The deleteStandalone 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 deleteStandaloneWithResponse(RequestOptions requestOptions) { - return this.serviceClient.deleteStandaloneWithResponse(requestOptions); - } - - /** - * The withQuery operation. - * - * @param format The format 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. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public void withQuery(String format) { - // Generated convenience method for withQueryWithResponse - RequestOptions requestOptions = new RequestOptions(); - if (format != null) { - requestOptions.addQueryParam("format", format, false); - } - withQueryWithResponse(requestOptions).getValue(); - } - - /** - * The withQuery 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 withQuery() { - // Generated convenience method for withQueryWithResponse - RequestOptions requestOptions = new RequestOptions(); - withQueryWithResponse(requestOptions).getValue(); - } - - /** - * The getStandalone 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 properties of a blob. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public BlobProperties getStandalone() { - // Generated convenience method for getStandaloneWithResponse - RequestOptions requestOptions = new RequestOptions(); - return getStandaloneWithResponse(requestOptions).getValue().toObject(BlobProperties.class); - } - - /** - * The deleteStandalone 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 deleteStandalone() { - // Generated convenience method for deleteStandaloneWithResponse - RequestOptions requestOptions = new RequestOptions(); - deleteStandaloneWithResponse(requestOptions).getValue(); - } -} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyclient/IndividuallyNestedWithQueryClientBuilder.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyclient/IndividuallyNestedWithQueryClientBuilder.java deleted file mode 100644 index d6fb4e21a36..00000000000 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyclient/IndividuallyNestedWithQueryClientBuilder.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 _specs_.azure.clientgenerator.core.clientinitialization.individuallyclient; - -import _specs_.azure.clientgenerator.core.clientinitialization.individuallyclient.implementation.IndividuallyNestedWithQueryClientImpl; -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.HttpLogOptions; -import com.azure.core.http.policy.HttpLoggingPolicy; -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 java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.Objects; - -/** - * A builder for creating a new instance of the IndividuallyNestedWithQueryClient type. - */ -@ServiceClientBuilder( - serviceClients = { IndividuallyNestedWithQueryClient.class, IndividuallyNestedWithQueryAsyncClient.class }) -public final class IndividuallyNestedWithQueryClientBuilder 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("_specs_-azure-clientgenerator-core-clientinitialization-individuallyclient.properties"); - - @Generated - private final List pipelinePolicies; - - /** - * Create an instance of the IndividuallyNestedWithQueryClientBuilder. - */ - @Generated - public IndividuallyNestedWithQueryClientBuilder() { - this.pipelinePolicies = new ArrayList<>(); - } - - /* - * The HTTP client used to send the request. - */ - @Generated - private HttpClient httpClient; - - /** - * {@inheritDoc}. - */ - @Generated - @Override - public IndividuallyNestedWithQueryClientBuilder httpClient(HttpClient httpClient) { - this.httpClient = httpClient; - return this; - } - - /* - * The HTTP pipeline to send requests through. - */ - @Generated - private HttpPipeline pipeline; - - /** - * {@inheritDoc}. - */ - @Generated - @Override - public IndividuallyNestedWithQueryClientBuilder 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 logging configuration for HTTP requests and responses. - */ - @Generated - private HttpLogOptions httpLogOptions; - - /** - * {@inheritDoc}. - */ - @Generated - @Override - public IndividuallyNestedWithQueryClientBuilder 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 IndividuallyNestedWithQueryClientBuilder 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 IndividuallyNestedWithQueryClientBuilder retryOptions(RetryOptions retryOptions) { - this.retryOptions = retryOptions; - return this; - } - - /** - * {@inheritDoc}. - */ - @Generated - @Override - public IndividuallyNestedWithQueryClientBuilder 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 IndividuallyNestedWithQueryClientBuilder configuration(Configuration configuration) { - this.configuration = configuration; - return this; - } - - /* - * The service endpoint - */ - @Generated - private String endpoint; - - /** - * {@inheritDoc}. - */ - @Generated - @Override - public IndividuallyNestedWithQueryClientBuilder endpoint(String endpoint) { - this.endpoint = endpoint; - return this; - } - - /* - * - */ - @Generated - private String blobName; - - /** - * Sets. - * - * @param blobName the blobName value. - * @return the IndividuallyNestedWithQueryClientBuilder. - */ - @Generated - public IndividuallyNestedWithQueryClientBuilder blobName(String blobName) { - this.blobName = blobName; - 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 IndividuallyNestedWithQueryClientBuilder. - */ - @Generated - public IndividuallyNestedWithQueryClientBuilder retryPolicy(RetryPolicy retryPolicy) { - this.retryPolicy = retryPolicy; - return this; - } - - /** - * Builds an instance of IndividuallyNestedWithQueryClientImpl with the provided parameters. - * - * @return an instance of IndividuallyNestedWithQueryClientImpl. - */ - @Generated - private IndividuallyNestedWithQueryClientImpl buildInnerClient() { - this.validateClient(); - HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); - String localEndpoint = (endpoint != null) ? endpoint : "http://localhost:3000"; - IndividuallyNestedWithQueryClientImpl client = new IndividuallyNestedWithQueryClientImpl(localPipeline, - JacksonAdapter.createDefaultSerializerAdapter(), localEndpoint, this.blobName); - 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(blobName, "'blobName' 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 IndividuallyNestedWithQueryAsyncClient class. - * - * @return an instance of IndividuallyNestedWithQueryAsyncClient. - */ - @Generated - public IndividuallyNestedWithQueryAsyncClient buildAsyncClient() { - return new IndividuallyNestedWithQueryAsyncClient(buildInnerClient()); - } - - /** - * Builds an instance of IndividuallyNestedWithQueryClient class. - * - * @return an instance of IndividuallyNestedWithQueryClient. - */ - @Generated - public IndividuallyNestedWithQueryClient buildClient() { - return new IndividuallyNestedWithQueryClient(buildInnerClient()); - } - - private static final ClientLogger LOGGER = new ClientLogger(IndividuallyNestedWithQueryClientBuilder.class); -} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyclient/implementation/IndividuallyNestedWithHeaderClientImpl.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyclient/implementation/IndividuallyNestedWithHeaderClientImpl.java deleted file mode 100644 index 5e3f94b1cff..00000000000 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyclient/implementation/IndividuallyNestedWithHeaderClientImpl.java +++ /dev/null @@ -1,306 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package _specs_.azure.clientgenerator.core.clientinitialization.individuallyclient.implementation; - -import com.azure.core.annotation.Delete; -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.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.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.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 com.azure.core.util.serializer.JacksonAdapter; -import com.azure.core.util.serializer.SerializerAdapter; -import reactor.core.publisher.Mono; - -/** - * Initializes a new instance of the IndividuallyNestedWithHeaderClient type. - */ -public final class IndividuallyNestedWithHeaderClientImpl { - /** - * The proxy service used to perform REST calls. - */ - private final IndividuallyNestedWithHeaderClientService service; - - /** - * Service host. - */ - private final String endpoint; - - /** - * Gets Service host. - * - * @return the endpoint value. - */ - public String getEndpoint() { - return this.endpoint; - } - - /** - */ - private final String name; - - /** - * Gets. - * - * @return the name value. - */ - public String getName() { - return this.name; - } - - /** - * 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; - } - - /** - * Initializes an instance of IndividuallyNestedWithHeaderClient client. - * - * @param endpoint Service host. - * @param name - */ - public IndividuallyNestedWithHeaderClientImpl(String endpoint, String name) { - this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), - JacksonAdapter.createDefaultSerializerAdapter(), endpoint, name); - } - - /** - * Initializes an instance of IndividuallyNestedWithHeaderClient client. - * - * @param httpPipeline The HTTP pipeline to send requests through. - * @param endpoint Service host. - * @param name - */ - public IndividuallyNestedWithHeaderClientImpl(HttpPipeline httpPipeline, String endpoint, String name) { - this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint, name); - } - - /** - * Initializes an instance of IndividuallyNestedWithHeaderClient client. - * - * @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 name - */ - public IndividuallyNestedWithHeaderClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, - String endpoint, String name) { - this.httpPipeline = httpPipeline; - this.serializerAdapter = serializerAdapter; - this.endpoint = endpoint; - this.name = name; - this.service = RestProxy.create(IndividuallyNestedWithHeaderClientService.class, this.httpPipeline, - this.getSerializerAdapter()); - } - - /** - * The interface defining all the services for IndividuallyNestedWithHeaderClient to be used by the proxy service to - * perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "IndividuallyNestedWithHeaderClient") - public interface IndividuallyNestedWithHeaderClientService { - @Get("/azure/client-generator-core/client-initialization/individually/nested-default-individually-header/with-query") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withQuery(@HostParam("endpoint") String endpoint, @HeaderParam("name") String name, - RequestOptions requestOptions, Context context); - - @Get("/azure/client-generator-core/client-initialization/individually/nested-default-individually-header/with-query") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withQuerySync(@HostParam("endpoint") String endpoint, @HeaderParam("name") String name, - RequestOptions requestOptions, Context context); - - @Get("/azure/client-generator-core/client-initialization/individually/nested-default-individually-header/get-standalone") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getStandalone(@HostParam("endpoint") String endpoint, @HeaderParam("name") String name, - RequestOptions requestOptions, Context context); - - @Get("/azure/client-generator-core/client-initialization/individually/nested-default-individually-header/get-standalone") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getStandaloneSync(@HostParam("endpoint") String endpoint, @HeaderParam("name") String name, - RequestOptions requestOptions, Context context); - - @Delete("/azure/client-generator-core/client-initialization/individually/nested-default-individually-header/delete-standalone") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> deleteStandalone(@HostParam("endpoint") String endpoint, @HeaderParam("name") String name, - RequestOptions requestOptions, Context context); - - @Delete("/azure/client-generator-core/client-initialization/individually/nested-default-individually-header/delete-standalone") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Response deleteStandaloneSync(@HostParam("endpoint") String endpoint, @HeaderParam("name") String name, - RequestOptions requestOptions, Context context); - } - - /** - * The withQuery operation. - *

Query Parameters

- * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
formatStringNoThe format parameter
- * You can add these to a request with {@link RequestOptions#addQueryParam} - * - * @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> withQueryWithResponseAsync(RequestOptions requestOptions) { - return FluxUtil - .withContext(context -> service.withQuery(this.getEndpoint(), this.getName(), requestOptions, context)); - } - - /** - * The withQuery operation. - *

Query Parameters

- * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
formatStringNoThe format parameter
- * You can add these to a request with {@link RequestOptions#addQueryParam} - * - * @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 withQueryWithResponse(RequestOptions requestOptions) { - return service.withQuerySync(this.getEndpoint(), this.getName(), requestOptions, Context.NONE); - } - - /** - * The getStandalone 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> getStandaloneWithResponseAsync(RequestOptions requestOptions) { - return FluxUtil - .withContext(context -> service.getStandalone(this.getEndpoint(), this.getName(), requestOptions, context)); - } - - /** - * The getStandalone 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 getStandaloneWithResponse(RequestOptions requestOptions) { - return service.getStandaloneSync(this.getEndpoint(), this.getName(), requestOptions, Context.NONE); - } - - /** - * The deleteStandalone 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> deleteStandaloneWithResponseAsync(RequestOptions requestOptions) { - return FluxUtil.withContext( - context -> service.deleteStandalone(this.getEndpoint(), this.getName(), requestOptions, context)); - } - - /** - * The deleteStandalone 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 deleteStandaloneWithResponse(RequestOptions requestOptions) { - return service.deleteStandaloneSync(this.getEndpoint(), this.getName(), requestOptions, Context.NONE); - } -} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyclient/implementation/IndividuallyNestedWithMixedClientImpl.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyclient/implementation/IndividuallyNestedWithMixedClientImpl.java deleted file mode 100644 index dfba5ce4572..00000000000 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyclient/implementation/IndividuallyNestedWithMixedClientImpl.java +++ /dev/null @@ -1,313 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package _specs_.azure.clientgenerator.core.clientinitialization.individuallyclient.implementation; - -import com.azure.core.annotation.Delete; -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.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.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.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 com.azure.core.util.serializer.JacksonAdapter; -import com.azure.core.util.serializer.SerializerAdapter; -import reactor.core.publisher.Mono; - -/** - * Initializes a new instance of the IndividuallyNestedWithMixedClient type. - */ -public final class IndividuallyNestedWithMixedClientImpl { - /** - * The proxy service used to perform REST calls. - */ - private final IndividuallyNestedWithMixedClientService service; - - /** - * Service host. - */ - private final String endpoint; - - /** - * Gets Service host. - * - * @return the endpoint value. - */ - public String getEndpoint() { - return this.endpoint; - } - - /** - */ - private final String name; - - /** - * Gets. - * - * @return the name value. - */ - public String getName() { - return this.name; - } - - /** - * 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; - } - - /** - * Initializes an instance of IndividuallyNestedWithMixedClient client. - * - * @param endpoint Service host. - * @param name - */ - public IndividuallyNestedWithMixedClientImpl(String endpoint, String name) { - this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), - JacksonAdapter.createDefaultSerializerAdapter(), endpoint, name); - } - - /** - * Initializes an instance of IndividuallyNestedWithMixedClient client. - * - * @param httpPipeline The HTTP pipeline to send requests through. - * @param endpoint Service host. - * @param name - */ - public IndividuallyNestedWithMixedClientImpl(HttpPipeline httpPipeline, String endpoint, String name) { - this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint, name); - } - - /** - * Initializes an instance of IndividuallyNestedWithMixedClient client. - * - * @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 name - */ - public IndividuallyNestedWithMixedClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, - String endpoint, String name) { - this.httpPipeline = httpPipeline; - this.serializerAdapter = serializerAdapter; - this.endpoint = endpoint; - this.name = name; - this.service = RestProxy.create(IndividuallyNestedWithMixedClientService.class, this.httpPipeline, - this.getSerializerAdapter()); - } - - /** - * The interface defining all the services for IndividuallyNestedWithMixedClient to be used by the proxy service to - * perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "IndividuallyNestedWithMixedClient") - public interface IndividuallyNestedWithMixedClientService { - @Get("/azure/client-generator-core/client-initialization/individually/nested-default-individually-mixed/with-query") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withQuery(@HostParam("endpoint") String endpoint, @HeaderParam("name") String name, - @QueryParam("region") String region, RequestOptions requestOptions, Context context); - - @Get("/azure/client-generator-core/client-initialization/individually/nested-default-individually-mixed/with-query") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withQuerySync(@HostParam("endpoint") String endpoint, @HeaderParam("name") String name, - @QueryParam("region") String region, RequestOptions requestOptions, Context context); - - @Get("/azure/client-generator-core/client-initialization/individually/nested-default-individually-mixed/get-standalone") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getStandalone(@HostParam("endpoint") String endpoint, @HeaderParam("name") String name, - @QueryParam("region") String region, RequestOptions requestOptions, Context context); - - @Get("/azure/client-generator-core/client-initialization/individually/nested-default-individually-mixed/get-standalone") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getStandaloneSync(@HostParam("endpoint") String endpoint, @HeaderParam("name") String name, - @QueryParam("region") String region, RequestOptions requestOptions, Context context); - - @Delete("/azure/client-generator-core/client-initialization/individually/nested-default-individually-mixed/delete-standalone") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> deleteStandalone(@HostParam("endpoint") String endpoint, @HeaderParam("name") String name, - @QueryParam("region") String region, RequestOptions requestOptions, Context context); - - @Delete("/azure/client-generator-core/client-initialization/individually/nested-default-individually-mixed/delete-standalone") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Response deleteStandaloneSync(@HostParam("endpoint") String endpoint, @HeaderParam("name") String name, - @QueryParam("region") String region, RequestOptions requestOptions, Context context); - } - - /** - * The withQuery operation. - *

Query Parameters

- * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
formatStringNoThe format parameter
- * You can add these to a request with {@link RequestOptions#addQueryParam} - * - * @param region The region 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 {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> withQueryWithResponseAsync(String region, RequestOptions requestOptions) { - return FluxUtil.withContext( - context -> service.withQuery(this.getEndpoint(), this.getName(), region, requestOptions, context)); - } - - /** - * The withQuery operation. - *

Query Parameters

- * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
formatStringNoThe format parameter
- * You can add these to a request with {@link RequestOptions#addQueryParam} - * - * @param region The region 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 {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response withQueryWithResponse(String region, RequestOptions requestOptions) { - return service.withQuerySync(this.getEndpoint(), this.getName(), region, requestOptions, Context.NONE); - } - - /** - * The getStandalone operation. - * - * @param region The region 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 {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getStandaloneWithResponseAsync(String region, RequestOptions requestOptions) { - return FluxUtil.withContext( - context -> service.getStandalone(this.getEndpoint(), this.getName(), region, requestOptions, context)); - } - - /** - * The getStandalone operation. - * - * @param region The region 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 {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getStandaloneWithResponse(String region, RequestOptions requestOptions) { - return service.getStandaloneSync(this.getEndpoint(), this.getName(), region, requestOptions, Context.NONE); - } - - /** - * The deleteStandalone operation. - * - * @param region The region 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 {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteStandaloneWithResponseAsync(String region, RequestOptions requestOptions) { - return FluxUtil.withContext( - context -> service.deleteStandalone(this.getEndpoint(), this.getName(), region, requestOptions, context)); - } - - /** - * The deleteStandalone operation. - * - * @param region The region 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 {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteStandaloneWithResponse(String region, RequestOptions requestOptions) { - return service.deleteStandaloneSync(this.getEndpoint(), this.getName(), region, requestOptions, Context.NONE); - } -} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyclient/implementation/IndividuallyNestedWithMultipleClientImpl.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyclient/implementation/IndividuallyNestedWithMultipleClientImpl.java deleted file mode 100644 index f310a4e56cf..00000000000 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyclient/implementation/IndividuallyNestedWithMultipleClientImpl.java +++ /dev/null @@ -1,328 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package _specs_.azure.clientgenerator.core.clientinitialization.individuallyclient.implementation; - -import com.azure.core.annotation.Delete; -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.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.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.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 com.azure.core.util.serializer.JacksonAdapter; -import com.azure.core.util.serializer.SerializerAdapter; -import reactor.core.publisher.Mono; - -/** - * Initializes a new instance of the IndividuallyNestedWithMultipleClient type. - */ -public final class IndividuallyNestedWithMultipleClientImpl { - /** - * The proxy service used to perform REST calls. - */ - private final IndividuallyNestedWithMultipleClientService service; - - /** - * Service host. - */ - private final String endpoint; - - /** - * Gets Service host. - * - * @return the endpoint value. - */ - public String getEndpoint() { - return this.endpoint; - } - - /** - */ - private final String name; - - /** - * Gets. - * - * @return the name value. - */ - public String getName() { - return this.name; - } - - /** - */ - private final String region; - - /** - * Gets. - * - * @return the region value. - */ - public String getRegion() { - return this.region; - } - - /** - * 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; - } - - /** - * Initializes an instance of IndividuallyNestedWithMultipleClient client. - * - * @param endpoint Service host. - * @param name - * @param region - */ - public IndividuallyNestedWithMultipleClientImpl(String endpoint, String name, String region) { - this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), - JacksonAdapter.createDefaultSerializerAdapter(), endpoint, name, region); - } - - /** - * Initializes an instance of IndividuallyNestedWithMultipleClient client. - * - * @param httpPipeline The HTTP pipeline to send requests through. - * @param endpoint Service host. - * @param name - * @param region - */ - public IndividuallyNestedWithMultipleClientImpl(HttpPipeline httpPipeline, String endpoint, String name, - String region) { - this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint, name, region); - } - - /** - * Initializes an instance of IndividuallyNestedWithMultipleClient client. - * - * @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 name - * @param region - */ - public IndividuallyNestedWithMultipleClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, - String endpoint, String name, String region) { - this.httpPipeline = httpPipeline; - this.serializerAdapter = serializerAdapter; - this.endpoint = endpoint; - this.name = name; - this.region = region; - this.service = RestProxy.create(IndividuallyNestedWithMultipleClientService.class, this.httpPipeline, - this.getSerializerAdapter()); - } - - /** - * The interface defining all the services for IndividuallyNestedWithMultipleClient to be used by the proxy service - * to perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "IndividuallyNestedWithMultipleClient") - public interface IndividuallyNestedWithMultipleClientService { - @Get("/azure/client-generator-core/client-initialization/individually/nested-default-individually-multiple/with-query") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withQuery(@HostParam("endpoint") String endpoint, @HeaderParam("name") String name, - @QueryParam("region") String region, RequestOptions requestOptions, Context context); - - @Get("/azure/client-generator-core/client-initialization/individually/nested-default-individually-multiple/with-query") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withQuerySync(@HostParam("endpoint") String endpoint, @HeaderParam("name") String name, - @QueryParam("region") String region, RequestOptions requestOptions, Context context); - - @Get("/azure/client-generator-core/client-initialization/individually/nested-default-individually-multiple/get-standalone") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getStandalone(@HostParam("endpoint") String endpoint, @HeaderParam("name") String name, - @QueryParam("region") String region, RequestOptions requestOptions, Context context); - - @Get("/azure/client-generator-core/client-initialization/individually/nested-default-individually-multiple/get-standalone") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getStandaloneSync(@HostParam("endpoint") String endpoint, @HeaderParam("name") String name, - @QueryParam("region") String region, RequestOptions requestOptions, Context context); - - @Delete("/azure/client-generator-core/client-initialization/individually/nested-default-individually-multiple/delete-standalone") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> deleteStandalone(@HostParam("endpoint") String endpoint, @HeaderParam("name") String name, - @QueryParam("region") String region, RequestOptions requestOptions, Context context); - - @Delete("/azure/client-generator-core/client-initialization/individually/nested-default-individually-multiple/delete-standalone") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Response deleteStandaloneSync(@HostParam("endpoint") String endpoint, @HeaderParam("name") String name, - @QueryParam("region") String region, RequestOptions requestOptions, Context context); - } - - /** - * The withQuery operation. - *

Query Parameters

- * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
formatStringNoThe format parameter
- * You can add these to a request with {@link RequestOptions#addQueryParam} - * - * @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> withQueryWithResponseAsync(RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.withQuery(this.getEndpoint(), this.getName(), this.getRegion(), - requestOptions, context)); - } - - /** - * The withQuery operation. - *

Query Parameters

- * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
formatStringNoThe format parameter
- * You can add these to a request with {@link RequestOptions#addQueryParam} - * - * @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 withQueryWithResponse(RequestOptions requestOptions) { - return service.withQuerySync(this.getEndpoint(), this.getName(), this.getRegion(), requestOptions, - Context.NONE); - } - - /** - * The getStandalone 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> getStandaloneWithResponseAsync(RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.getStandalone(this.getEndpoint(), this.getName(), - this.getRegion(), requestOptions, context)); - } - - /** - * The getStandalone 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 getStandaloneWithResponse(RequestOptions requestOptions) { - return service.getStandaloneSync(this.getEndpoint(), this.getName(), this.getRegion(), requestOptions, - Context.NONE); - } - - /** - * The deleteStandalone 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> deleteStandaloneWithResponseAsync(RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.deleteStandalone(this.getEndpoint(), this.getName(), - this.getRegion(), requestOptions, context)); - } - - /** - * The deleteStandalone 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 deleteStandaloneWithResponse(RequestOptions requestOptions) { - return service.deleteStandaloneSync(this.getEndpoint(), this.getName(), this.getRegion(), requestOptions, - Context.NONE); - } -} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyclient/implementation/IndividuallyNestedWithParamAliasClientImpl.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyclient/implementation/IndividuallyNestedWithParamAliasClientImpl.java deleted file mode 100644 index 6d43e497941..00000000000 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyclient/implementation/IndividuallyNestedWithParamAliasClientImpl.java +++ /dev/null @@ -1,242 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package _specs_.azure.clientgenerator.core.clientinitialization.individuallyclient.implementation; - -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.PathParam; -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.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.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 com.azure.core.util.serializer.JacksonAdapter; -import com.azure.core.util.serializer.SerializerAdapter; -import reactor.core.publisher.Mono; - -/** - * Initializes a new instance of the IndividuallyNestedWithParamAliasClient type. - */ -public final class IndividuallyNestedWithParamAliasClientImpl { - /** - * The proxy service used to perform REST calls. - */ - private final IndividuallyNestedWithParamAliasClientService service; - - /** - * Service host. - */ - private final String endpoint; - - /** - * Gets Service host. - * - * @return the endpoint value. - */ - public String getEndpoint() { - return this.endpoint; - } - - /** - */ - private final String blobName; - - /** - * Gets. - * - * @return the blobName value. - */ - public String getBlobName() { - return this.blobName; - } - - /** - * 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; - } - - /** - * Initializes an instance of IndividuallyNestedWithParamAliasClient client. - * - * @param endpoint Service host. - * @param blobName - */ - public IndividuallyNestedWithParamAliasClientImpl(String endpoint, String blobName) { - this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), - JacksonAdapter.createDefaultSerializerAdapter(), endpoint, blobName); - } - - /** - * Initializes an instance of IndividuallyNestedWithParamAliasClient client. - * - * @param httpPipeline The HTTP pipeline to send requests through. - * @param endpoint Service host. - * @param blobName - */ - public IndividuallyNestedWithParamAliasClientImpl(HttpPipeline httpPipeline, String endpoint, String blobName) { - this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint, blobName); - } - - /** - * Initializes an instance of IndividuallyNestedWithParamAliasClient client. - * - * @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 blobName - */ - public IndividuallyNestedWithParamAliasClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, - String endpoint, String blobName) { - this.httpPipeline = httpPipeline; - this.serializerAdapter = serializerAdapter; - this.endpoint = endpoint; - this.blobName = blobName; - this.service = RestProxy.create(IndividuallyNestedWithParamAliasClientService.class, this.httpPipeline, - this.getSerializerAdapter()); - } - - /** - * The interface defining all the services for IndividuallyNestedWithParamAliasClient to be used by the proxy - * service to perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "IndividuallyNestedWithParamAliasClient") - public interface IndividuallyNestedWithParamAliasClientService { - @Get("/azure/client-generator-core/client-initialization/individually/nested-default-individually-param-alias/{blob}/with-aliased-name") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withAliasedName(@HostParam("endpoint") String endpoint, @PathParam("blob") String blobName, - RequestOptions requestOptions, Context context); - - @Get("/azure/client-generator-core/client-initialization/individually/nested-default-individually-param-alias/{blob}/with-aliased-name") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withAliasedNameSync(@HostParam("endpoint") String endpoint, @PathParam("blob") String blobName, - RequestOptions requestOptions, Context context); - - @Get("/azure/client-generator-core/client-initialization/individually/nested-default-individually-param-alias/{blobName}/with-original-name") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withOriginalName(@HostParam("endpoint") String endpoint, - @PathParam("blobName") String blobName, RequestOptions requestOptions, Context context); - - @Get("/azure/client-generator-core/client-initialization/individually/nested-default-individually-param-alias/{blobName}/with-original-name") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withOriginalNameSync(@HostParam("endpoint") String endpoint, - @PathParam("blobName") String blobName, RequestOptions requestOptions, Context context); - } - - /** - * The withAliasedName 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> withAliasedNameWithResponseAsync(RequestOptions requestOptions) { - return FluxUtil.withContext( - context -> service.withAliasedName(this.getEndpoint(), this.getBlobName(), requestOptions, context)); - } - - /** - * The withAliasedName 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 withAliasedNameWithResponse(RequestOptions requestOptions) { - return service.withAliasedNameSync(this.getEndpoint(), this.getBlobName(), requestOptions, Context.NONE); - } - - /** - * The withOriginalName 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> withOriginalNameWithResponseAsync(RequestOptions requestOptions) { - return FluxUtil.withContext( - context -> service.withOriginalName(this.getEndpoint(), this.getBlobName(), requestOptions, context)); - } - - /** - * The withOriginalName 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 withOriginalNameWithResponse(RequestOptions requestOptions) { - return service.withOriginalNameSync(this.getEndpoint(), this.getBlobName(), requestOptions, Context.NONE); - } -} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyclient/implementation/IndividuallyNestedWithPathClientImpl.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyclient/implementation/IndividuallyNestedWithPathClientImpl.java deleted file mode 100644 index c82909a98ce..00000000000 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyclient/implementation/IndividuallyNestedWithPathClientImpl.java +++ /dev/null @@ -1,336 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package _specs_.azure.clientgenerator.core.clientinitialization.individuallyclient.implementation; - -import com.azure.core.annotation.Delete; -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; -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.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.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 com.azure.core.util.serializer.JacksonAdapter; -import com.azure.core.util.serializer.SerializerAdapter; -import reactor.core.publisher.Mono; - -/** - * Initializes a new instance of the IndividuallyNestedWithPathClient type. - */ -public final class IndividuallyNestedWithPathClientImpl { - /** - * The proxy service used to perform REST calls. - */ - private final IndividuallyNestedWithPathClientService service; - - /** - * Service host. - */ - private final String endpoint; - - /** - * Gets Service host. - * - * @return the endpoint value. - */ - public String getEndpoint() { - return this.endpoint; - } - - /** - */ - private final String blobName; - - /** - * Gets. - * - * @return the blobName value. - */ - public String getBlobName() { - return this.blobName; - } - - /** - * 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; - } - - /** - * Initializes an instance of IndividuallyNestedWithPathClient client. - * - * @param endpoint Service host. - * @param blobName - */ - public IndividuallyNestedWithPathClientImpl(String endpoint, String blobName) { - this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), - JacksonAdapter.createDefaultSerializerAdapter(), endpoint, blobName); - } - - /** - * Initializes an instance of IndividuallyNestedWithPathClient client. - * - * @param httpPipeline The HTTP pipeline to send requests through. - * @param endpoint Service host. - * @param blobName - */ - public IndividuallyNestedWithPathClientImpl(HttpPipeline httpPipeline, String endpoint, String blobName) { - this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint, blobName); - } - - /** - * Initializes an instance of IndividuallyNestedWithPathClient client. - * - * @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 blobName - */ - public IndividuallyNestedWithPathClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, - String endpoint, String blobName) { - this.httpPipeline = httpPipeline; - this.serializerAdapter = serializerAdapter; - this.endpoint = endpoint; - this.blobName = blobName; - this.service = RestProxy.create(IndividuallyNestedWithPathClientService.class, this.httpPipeline, - this.getSerializerAdapter()); - } - - /** - * The interface defining all the services for IndividuallyNestedWithPathClient to be used by the proxy service to - * perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "IndividuallyNestedWithPathClient") - public interface IndividuallyNestedWithPathClientService { - @Get("/azure/client-generator-core/client-initialization/individually/nested-default-individually/{blobName}/with-query") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withQuery(@HostParam("endpoint") String endpoint, @PathParam("blobName") String blobName, - RequestOptions requestOptions, Context context); - - @Get("/azure/client-generator-core/client-initialization/individually/nested-default-individually/{blobName}/with-query") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withQuerySync(@HostParam("endpoint") String endpoint, @PathParam("blobName") String blobName, - RequestOptions requestOptions, Context context); - - @Get("/azure/client-generator-core/client-initialization/individually/nested-default-individually/{blobName}/get-standalone") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getStandalone(@HostParam("endpoint") String endpoint, - @PathParam("blobName") String blobName, @HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); - - @Get("/azure/client-generator-core/client-initialization/individually/nested-default-individually/{blobName}/get-standalone") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getStandaloneSync(@HostParam("endpoint") String endpoint, - @PathParam("blobName") String blobName, @HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); - - @Delete("/azure/client-generator-core/client-initialization/individually/nested-default-individually/{blobName}") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> deleteStandalone(@HostParam("endpoint") String endpoint, - @PathParam("blobName") String blobName, RequestOptions requestOptions, Context context); - - @Delete("/azure/client-generator-core/client-initialization/individually/nested-default-individually/{blobName}") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Response deleteStandaloneSync(@HostParam("endpoint") String endpoint, - @PathParam("blobName") String blobName, RequestOptions requestOptions, Context context); - } - - /** - * The withQuery operation. - *

Query Parameters

- * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
formatStringNoThe format parameter
- * You can add these to a request with {@link RequestOptions#addQueryParam} - * - * @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> withQueryWithResponseAsync(RequestOptions requestOptions) { - return FluxUtil - .withContext(context -> service.withQuery(this.getEndpoint(), this.getBlobName(), requestOptions, context)); - } - - /** - * The withQuery operation. - *

Query Parameters

- * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
formatStringNoThe format parameter
- * You can add these to a request with {@link RequestOptions#addQueryParam} - * - * @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 withQueryWithResponse(RequestOptions requestOptions) { - return service.withQuerySync(this.getEndpoint(), this.getBlobName(), requestOptions, Context.NONE); - } - - /** - * The getStandalone operation. - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     name: String (Required)
-     *     size: long (Required)
-     *     contentType: String (Required)
-     *     createdOn: OffsetDateTime (Required)
-     * }
-     * }
-     * 
- * - * @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 properties of a blob along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getStandaloneWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.getStandalone(this.getEndpoint(), this.getBlobName(), accept, requestOptions, context)); - } - - /** - * The getStandalone operation. - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     name: String (Required)
-     *     size: long (Required)
-     *     contentType: String (Required)
-     *     createdOn: OffsetDateTime (Required)
-     * }
-     * }
-     * 
- * - * @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 properties of a blob along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getStandaloneWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.getStandaloneSync(this.getEndpoint(), this.getBlobName(), accept, requestOptions, Context.NONE); - } - - /** - * The deleteStandalone 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> deleteStandaloneWithResponseAsync(RequestOptions requestOptions) { - return FluxUtil.withContext( - context -> service.deleteStandalone(this.getEndpoint(), this.getBlobName(), requestOptions, context)); - } - - /** - * The deleteStandalone 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 deleteStandaloneWithResponse(RequestOptions requestOptions) { - return service.deleteStandaloneSync(this.getEndpoint(), this.getBlobName(), requestOptions, Context.NONE); - } -} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyclient/implementation/IndividuallyNestedWithQueryClientImpl.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyclient/implementation/IndividuallyNestedWithQueryClientImpl.java deleted file mode 100644 index 5704371b6f2..00000000000 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyclient/implementation/IndividuallyNestedWithQueryClientImpl.java +++ /dev/null @@ -1,336 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package _specs_.azure.clientgenerator.core.clientinitialization.individuallyclient.implementation; - -import com.azure.core.annotation.Delete; -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.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.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.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 com.azure.core.util.serializer.JacksonAdapter; -import com.azure.core.util.serializer.SerializerAdapter; -import reactor.core.publisher.Mono; - -/** - * Initializes a new instance of the IndividuallyNestedWithQueryClient type. - */ -public final class IndividuallyNestedWithQueryClientImpl { - /** - * The proxy service used to perform REST calls. - */ - private final IndividuallyNestedWithQueryClientService service; - - /** - * Service host. - */ - private final String endpoint; - - /** - * Gets Service host. - * - * @return the endpoint value. - */ - public String getEndpoint() { - return this.endpoint; - } - - /** - */ - private final String blobName; - - /** - * Gets. - * - * @return the blobName value. - */ - public String getBlobName() { - return this.blobName; - } - - /** - * 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; - } - - /** - * Initializes an instance of IndividuallyNestedWithQueryClient client. - * - * @param endpoint Service host. - * @param blobName - */ - public IndividuallyNestedWithQueryClientImpl(String endpoint, String blobName) { - this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), - JacksonAdapter.createDefaultSerializerAdapter(), endpoint, blobName); - } - - /** - * Initializes an instance of IndividuallyNestedWithQueryClient client. - * - * @param httpPipeline The HTTP pipeline to send requests through. - * @param endpoint Service host. - * @param blobName - */ - public IndividuallyNestedWithQueryClientImpl(HttpPipeline httpPipeline, String endpoint, String blobName) { - this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint, blobName); - } - - /** - * Initializes an instance of IndividuallyNestedWithQueryClient client. - * - * @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 blobName - */ - public IndividuallyNestedWithQueryClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, - String endpoint, String blobName) { - this.httpPipeline = httpPipeline; - this.serializerAdapter = serializerAdapter; - this.endpoint = endpoint; - this.blobName = blobName; - this.service = RestProxy.create(IndividuallyNestedWithQueryClientService.class, this.httpPipeline, - this.getSerializerAdapter()); - } - - /** - * The interface defining all the services for IndividuallyNestedWithQueryClient to be used by the proxy service to - * perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "IndividuallyNestedWithQueryClient") - public interface IndividuallyNestedWithQueryClientService { - @Get("/azure/client-generator-core/client-initialization/individually/nested-default-individually-query/with-query") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withQuery(@HostParam("endpoint") String endpoint, @QueryParam("blobName") String blobName, - RequestOptions requestOptions, Context context); - - @Get("/azure/client-generator-core/client-initialization/individually/nested-default-individually-query/with-query") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withQuerySync(@HostParam("endpoint") String endpoint, @QueryParam("blobName") String blobName, - RequestOptions requestOptions, Context context); - - @Get("/azure/client-generator-core/client-initialization/individually/nested-default-individually-query/get-standalone") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getStandalone(@HostParam("endpoint") String endpoint, - @QueryParam("blobName") String blobName, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); - - @Get("/azure/client-generator-core/client-initialization/individually/nested-default-individually-query/get-standalone") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getStandaloneSync(@HostParam("endpoint") String endpoint, - @QueryParam("blobName") String blobName, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); - - @Delete("/azure/client-generator-core/client-initialization/individually/nested-default-individually-query/delete-resource") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> deleteStandalone(@HostParam("endpoint") String endpoint, - @QueryParam("blobName") String blobName, RequestOptions requestOptions, Context context); - - @Delete("/azure/client-generator-core/client-initialization/individually/nested-default-individually-query/delete-resource") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Response deleteStandaloneSync(@HostParam("endpoint") String endpoint, - @QueryParam("blobName") String blobName, RequestOptions requestOptions, Context context); - } - - /** - * The withQuery operation. - *

Query Parameters

- * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
formatStringNoThe format parameter
- * You can add these to a request with {@link RequestOptions#addQueryParam} - * - * @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> withQueryWithResponseAsync(RequestOptions requestOptions) { - return FluxUtil - .withContext(context -> service.withQuery(this.getEndpoint(), this.getBlobName(), requestOptions, context)); - } - - /** - * The withQuery operation. - *

Query Parameters

- * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
formatStringNoThe format parameter
- * You can add these to a request with {@link RequestOptions#addQueryParam} - * - * @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 withQueryWithResponse(RequestOptions requestOptions) { - return service.withQuerySync(this.getEndpoint(), this.getBlobName(), requestOptions, Context.NONE); - } - - /** - * The getStandalone operation. - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     name: String (Required)
-     *     size: long (Required)
-     *     contentType: String (Required)
-     *     createdOn: OffsetDateTime (Required)
-     * }
-     * }
-     * 
- * - * @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 properties of a blob along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getStandaloneWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.getStandalone(this.getEndpoint(), this.getBlobName(), accept, requestOptions, context)); - } - - /** - * The getStandalone operation. - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     name: String (Required)
-     *     size: long (Required)
-     *     contentType: String (Required)
-     *     createdOn: OffsetDateTime (Required)
-     * }
-     * }
-     * 
- * - * @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 properties of a blob along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getStandaloneWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.getStandaloneSync(this.getEndpoint(), this.getBlobName(), accept, requestOptions, Context.NONE); - } - - /** - * The deleteStandalone 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> deleteStandaloneWithResponseAsync(RequestOptions requestOptions) { - return FluxUtil.withContext( - context -> service.deleteStandalone(this.getEndpoint(), this.getBlobName(), requestOptions, context)); - } - - /** - * The deleteStandalone 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 deleteStandaloneWithResponse(RequestOptions requestOptions) { - return service.deleteStandaloneSync(this.getEndpoint(), this.getBlobName(), requestOptions, Context.NONE); - } -} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyclient/implementation/package-info.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyclient/implementation/package-info.java deleted file mode 100644 index 5e9e3e01216..00000000000 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyclient/implementation/package-info.java +++ /dev/null @@ -1,11 +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 IndividuallyClient. - * Test for client initialization decorator - moving parameters from method to client level. - * - */ -package _specs_.azure.clientgenerator.core.clientinitialization.individuallyclient.implementation; diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyclient/models/BlobProperties.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyclient/models/BlobProperties.java deleted file mode 100644 index 74ff6516b86..00000000000 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyclient/models/BlobProperties.java +++ /dev/null @@ -1,154 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package _specs_.azure.clientgenerator.core.clientinitialization.individuallyclient.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.OffsetDateTime; -import java.time.format.DateTimeFormatter; - -/** - * Properties of a blob. - */ -@Immutable -public final class BlobProperties implements JsonSerializable { - /* - * The name property. - */ - @Generated - private final String name; - - /* - * The size property. - */ - @Generated - private final long size; - - /* - * The contentType property. - */ - @Generated - private final String contentType; - - /* - * The createdOn property. - */ - @Generated - private final OffsetDateTime createdOn; - - /** - * Creates an instance of BlobProperties class. - * - * @param name the name value to set. - * @param size the size value to set. - * @param contentType the contentType value to set. - * @param createdOn the createdOn value to set. - */ - @Generated - private BlobProperties(String name, long size, String contentType, OffsetDateTime createdOn) { - this.name = name; - this.size = size; - this.contentType = contentType; - this.createdOn = createdOn; - } - - /** - * Get the name property: The name property. - * - * @return the name value. - */ - @Generated - public String getName() { - return this.name; - } - - /** - * Get the size property: The size property. - * - * @return the size value. - */ - @Generated - public long getSize() { - return this.size; - } - - /** - * Get the contentType property: The contentType property. - * - * @return the contentType value. - */ - @Generated - public String getContentType() { - return this.contentType; - } - - /** - * Get the createdOn property: The createdOn property. - * - * @return the createdOn value. - */ - @Generated - public OffsetDateTime getCreatedOn() { - return this.createdOn; - } - - /** - * {@inheritDoc} - */ - @Generated - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("name", this.name); - jsonWriter.writeLongField("size", this.size); - jsonWriter.writeStringField("contentType", this.contentType); - jsonWriter.writeStringField("createdOn", - this.createdOn == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.createdOn)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of BlobProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of BlobProperties 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 BlobProperties. - */ - @Generated - public static BlobProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - String name = null; - long size = 0L; - String contentType = null; - OffsetDateTime createdOn = null; - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("name".equals(fieldName)) { - name = reader.getString(); - } else if ("size".equals(fieldName)) { - size = reader.getLong(); - } else if ("contentType".equals(fieldName)) { - contentType = reader.getString(); - } else if ("createdOn".equals(fieldName)) { - createdOn = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else { - reader.skipChildren(); - } - } - return new BlobProperties(name, size, contentType, createdOn); - }); - } -} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyclient/models/package-info.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyclient/models/package-info.java deleted file mode 100644 index 34507e7f5a6..00000000000 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyclient/models/package-info.java +++ /dev/null @@ -1,11 +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 IndividuallyClient. - * Test for client initialization decorator - moving parameters from method to client level. - * - */ -package _specs_.azure.clientgenerator.core.clientinitialization.individuallyclient.models; diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyclient/package-info.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyclient/package-info.java deleted file mode 100644 index 59b682bced7..00000000000 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyclient/package-info.java +++ /dev/null @@ -1,11 +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 IndividuallyClient. - * Test for client initialization decorator - moving parameters from method to client level. - * - */ -package _specs_.azure.clientgenerator.core.clientinitialization.individuallyclient; diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyparentclient/IndividuallyParentAsyncClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyparentclient/IndividuallyParentAsyncClient.java deleted file mode 100644 index 2d98f370747..00000000000 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyparentclient/IndividuallyParentAsyncClient.java +++ /dev/null @@ -1,98 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package _specs_.azure.clientgenerator.core.clientinitialization.individuallyparentclient; - -import _specs_.azure.clientgenerator.core.clientinitialization.individuallyparentclient.implementation.IndividuallyParentClientImpl; -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.ServiceClient; - -/** - * Initializes a new instance of the asynchronous IndividuallyParentClient type. - */ -@ServiceClient(builder = IndividuallyParentClientBuilder.class, isAsync = true) -public final class IndividuallyParentAsyncClient { - @Generated - private final IndividuallyParentClientImpl serviceClient; - - /** - * Initializes an instance of IndividuallyParentAsyncClient class. - * - * @param serviceClient the service client implementation. - */ - @Generated - IndividuallyParentAsyncClient(IndividuallyParentClientImpl serviceClient) { - this.serviceClient = serviceClient; - } - - /** - * Gets an instance of IndividuallyParentNestedWithPathAsyncClient class. - * - * @param blobName The blobName parameter. - * @return an instance of IndividuallyParentNestedWithPathAsyncClient class. - */ - public IndividuallyParentNestedWithPathAsyncClient getIndividuallyParentNestedWithPathAsyncClient(String blobName) { - return new IndividuallyParentNestedWithPathAsyncClient( - serviceClient.getIndividuallyParentNestedWithPathClient(blobName)); - } - - /** - * Gets an instance of IndividuallyParentNestedWithQueryAsyncClient class. - * - * @param blobName The blobName parameter. - * @return an instance of IndividuallyParentNestedWithQueryAsyncClient class. - */ - public IndividuallyParentNestedWithQueryAsyncClient - getIndividuallyParentNestedWithQueryAsyncClient(String blobName) { - return new IndividuallyParentNestedWithQueryAsyncClient( - serviceClient.getIndividuallyParentNestedWithQueryClient(blobName)); - } - - /** - * Gets an instance of IndividuallyParentNestedWithHeaderAsyncClient class. - * - * @param name The name parameter. - * @return an instance of IndividuallyParentNestedWithHeaderAsyncClient class. - */ - public IndividuallyParentNestedWithHeaderAsyncClient getIndividuallyParentNestedWithHeaderAsyncClient(String name) { - return new IndividuallyParentNestedWithHeaderAsyncClient( - serviceClient.getIndividuallyParentNestedWithHeaderClient(name)); - } - - /** - * Gets an instance of IndividuallyParentNestedWithMultipleAsyncClient class. - * - * @param name The name parameter. - * @param region The region parameter. - * @return an instance of IndividuallyParentNestedWithMultipleAsyncClient class. - */ - public IndividuallyParentNestedWithMultipleAsyncClient - getIndividuallyParentNestedWithMultipleAsyncClient(String name, String region) { - return new IndividuallyParentNestedWithMultipleAsyncClient( - serviceClient.getIndividuallyParentNestedWithMultipleClient(name, region)); - } - - /** - * Gets an instance of IndividuallyParentNestedWithMixedAsyncClient class. - * - * @param name The name parameter. - * @return an instance of IndividuallyParentNestedWithMixedAsyncClient class. - */ - public IndividuallyParentNestedWithMixedAsyncClient getIndividuallyParentNestedWithMixedAsyncClient(String name) { - return new IndividuallyParentNestedWithMixedAsyncClient( - serviceClient.getIndividuallyParentNestedWithMixedClient(name)); - } - - /** - * Gets an instance of IndividuallyParentNestedWithParamAliasAsyncClient class. - * - * @param blobName The blobName parameter. - * @return an instance of IndividuallyParentNestedWithParamAliasAsyncClient class. - */ - public IndividuallyParentNestedWithParamAliasAsyncClient - getIndividuallyParentNestedWithParamAliasAsyncClient(String blobName) { - return new IndividuallyParentNestedWithParamAliasAsyncClient( - serviceClient.getIndividuallyParentNestedWithParamAliasClient(blobName)); - } -} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyparentclient/IndividuallyParentClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyparentclient/IndividuallyParentClient.java deleted file mode 100644 index d9cc3676476..00000000000 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyparentclient/IndividuallyParentClient.java +++ /dev/null @@ -1,97 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package _specs_.azure.clientgenerator.core.clientinitialization.individuallyparentclient; - -import _specs_.azure.clientgenerator.core.clientinitialization.individuallyparentclient.implementation.IndividuallyParentClientImpl; -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.ServiceClient; - -/** - * Initializes a new instance of the synchronous IndividuallyParentClient type. - */ -@ServiceClient(builder = IndividuallyParentClientBuilder.class) -public final class IndividuallyParentClient { - @Generated - private final IndividuallyParentClientImpl serviceClient; - - /** - * Initializes an instance of IndividuallyParentClient class. - * - * @param serviceClient the service client implementation. - */ - @Generated - IndividuallyParentClient(IndividuallyParentClientImpl serviceClient) { - this.serviceClient = serviceClient; - } - - /** - * Gets an instance of IndividuallyParentNestedWithPathClient class. - * - * @param blobName The blobName parameter. - * @return an instance of IndividuallyParentNestedWithPathClient class. - */ - public IndividuallyParentNestedWithPathClient getIndividuallyParentNestedWithPathClient(String blobName) { - return new IndividuallyParentNestedWithPathClient( - serviceClient.getIndividuallyParentNestedWithPathClient(blobName)); - } - - /** - * Gets an instance of IndividuallyParentNestedWithQueryClient class. - * - * @param blobName The blobName parameter. - * @return an instance of IndividuallyParentNestedWithQueryClient class. - */ - public IndividuallyParentNestedWithQueryClient getIndividuallyParentNestedWithQueryClient(String blobName) { - return new IndividuallyParentNestedWithQueryClient( - serviceClient.getIndividuallyParentNestedWithQueryClient(blobName)); - } - - /** - * Gets an instance of IndividuallyParentNestedWithHeaderClient class. - * - * @param name The name parameter. - * @return an instance of IndividuallyParentNestedWithHeaderClient class. - */ - public IndividuallyParentNestedWithHeaderClient getIndividuallyParentNestedWithHeaderClient(String name) { - return new IndividuallyParentNestedWithHeaderClient( - serviceClient.getIndividuallyParentNestedWithHeaderClient(name)); - } - - /** - * Gets an instance of IndividuallyParentNestedWithMultipleClient class. - * - * @param name The name parameter. - * @param region The region parameter. - * @return an instance of IndividuallyParentNestedWithMultipleClient class. - */ - public IndividuallyParentNestedWithMultipleClient getIndividuallyParentNestedWithMultipleClient(String name, - String region) { - return new IndividuallyParentNestedWithMultipleClient( - serviceClient.getIndividuallyParentNestedWithMultipleClient(name, region)); - } - - /** - * Gets an instance of IndividuallyParentNestedWithMixedClient class. - * - * @param name The name parameter. - * @return an instance of IndividuallyParentNestedWithMixedClient class. - */ - public IndividuallyParentNestedWithMixedClient getIndividuallyParentNestedWithMixedClient(String name) { - return new IndividuallyParentNestedWithMixedClient( - serviceClient.getIndividuallyParentNestedWithMixedClient(name)); - } - - /** - * Gets an instance of IndividuallyParentNestedWithParamAliasClient class. - * - * @param blobName The blobName parameter. - * @return an instance of IndividuallyParentNestedWithParamAliasClient class. - */ - public IndividuallyParentNestedWithParamAliasClient - getIndividuallyParentNestedWithParamAliasClient(String blobName) { - return new IndividuallyParentNestedWithParamAliasClient( - serviceClient.getIndividuallyParentNestedWithParamAliasClient(blobName)); - } -} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyparentclient/IndividuallyParentClientBuilder.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyparentclient/IndividuallyParentClientBuilder.java deleted file mode 100644 index 05527a9fa97..00000000000 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyparentclient/IndividuallyParentClientBuilder.java +++ /dev/null @@ -1,288 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package _specs_.azure.clientgenerator.core.clientinitialization.individuallyparentclient; - -import _specs_.azure.clientgenerator.core.clientinitialization.individuallyparentclient.implementation.IndividuallyParentClientImpl; -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.HttpLogOptions; -import com.azure.core.http.policy.HttpLoggingPolicy; -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 java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.Objects; - -/** - * A builder for creating a new instance of the IndividuallyParentClient type. - */ -@ServiceClientBuilder(serviceClients = { IndividuallyParentClient.class, IndividuallyParentAsyncClient.class }) -public final class IndividuallyParentClientBuilder 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("_specs_-azure-clientgenerator-core-clientinitialization-individuallyparentclient.properties"); - - @Generated - private final List pipelinePolicies; - - /** - * Create an instance of the IndividuallyParentClientBuilder. - */ - @Generated - public IndividuallyParentClientBuilder() { - this.pipelinePolicies = new ArrayList<>(); - } - - /* - * The HTTP client used to send the request. - */ - @Generated - private HttpClient httpClient; - - /** - * {@inheritDoc}. - */ - @Generated - @Override - public IndividuallyParentClientBuilder httpClient(HttpClient httpClient) { - this.httpClient = httpClient; - return this; - } - - /* - * The HTTP pipeline to send requests through. - */ - @Generated - private HttpPipeline pipeline; - - /** - * {@inheritDoc}. - */ - @Generated - @Override - public IndividuallyParentClientBuilder 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 logging configuration for HTTP requests and responses. - */ - @Generated - private HttpLogOptions httpLogOptions; - - /** - * {@inheritDoc}. - */ - @Generated - @Override - public IndividuallyParentClientBuilder 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 IndividuallyParentClientBuilder 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 IndividuallyParentClientBuilder retryOptions(RetryOptions retryOptions) { - this.retryOptions = retryOptions; - return this; - } - - /** - * {@inheritDoc}. - */ - @Generated - @Override - public IndividuallyParentClientBuilder 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 IndividuallyParentClientBuilder configuration(Configuration configuration) { - this.configuration = configuration; - return this; - } - - /* - * The service endpoint - */ - @Generated - private String endpoint; - - /** - * {@inheritDoc}. - */ - @Generated - @Override - public IndividuallyParentClientBuilder 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 IndividuallyParentClientBuilder. - */ - @Generated - public IndividuallyParentClientBuilder retryPolicy(RetryPolicy retryPolicy) { - this.retryPolicy = retryPolicy; - return this; - } - - /** - * Builds an instance of IndividuallyParentClientImpl with the provided parameters. - * - * @return an instance of IndividuallyParentClientImpl. - */ - @Generated - private IndividuallyParentClientImpl buildInnerClient() { - this.validateClient(); - HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); - String localEndpoint = (endpoint != null) ? endpoint : "http://localhost:3000"; - IndividuallyParentClientImpl client = new IndividuallyParentClientImpl(localPipeline, - JacksonAdapter.createDefaultSerializerAdapter(), localEndpoint); - 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. - } - - @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 IndividuallyParentAsyncClient class. - * - * @return an instance of IndividuallyParentAsyncClient. - */ - @Generated - public IndividuallyParentAsyncClient buildAsyncClient() { - return new IndividuallyParentAsyncClient(buildInnerClient()); - } - - /** - * Builds an instance of IndividuallyParentClient class. - * - * @return an instance of IndividuallyParentClient. - */ - @Generated - public IndividuallyParentClient buildClient() { - return new IndividuallyParentClient(buildInnerClient()); - } - - private static final ClientLogger LOGGER = new ClientLogger(IndividuallyParentClientBuilder.class); -} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyparentclient/IndividuallyParentNestedWithHeaderAsyncClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyparentclient/IndividuallyParentNestedWithHeaderAsyncClient.java deleted file mode 100644 index a40dc2c42e3..00000000000 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyparentclient/IndividuallyParentNestedWithHeaderAsyncClient.java +++ /dev/null @@ -1,170 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package _specs_.azure.clientgenerator.core.clientinitialization.individuallyparentclient; - -import _specs_.azure.clientgenerator.core.clientinitialization.individuallyparentclient.implementation.IndividuallyParentNestedWithHeaderClientImpl; -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 reactor.core.publisher.Mono; - -/** - * Initializes a new instance of the asynchronous IndividuallyParentNestedWithHeaderClient type. - */ -@ServiceClient(builder = IndividuallyParentNestedWithHeaderClientBuilder.class, isAsync = true) -public final class IndividuallyParentNestedWithHeaderAsyncClient { - @Generated - private final IndividuallyParentNestedWithHeaderClientImpl serviceClient; - - /** - * Initializes an instance of IndividuallyParentNestedWithHeaderAsyncClient class. - * - * @param serviceClient the service client implementation. - */ - @Generated - IndividuallyParentNestedWithHeaderAsyncClient(IndividuallyParentNestedWithHeaderClientImpl serviceClient) { - this.serviceClient = serviceClient; - } - - /** - * The withQuery operation. - *

Query Parameters

- * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
formatStringNoThe format parameter
- * You can add these to a request with {@link RequestOptions#addQueryParam} - * - * @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> withQueryWithResponse(RequestOptions requestOptions) { - return this.serviceClient.withQueryWithResponseAsync(requestOptions); - } - - /** - * The getStandalone 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> getStandaloneWithResponse(RequestOptions requestOptions) { - return this.serviceClient.getStandaloneWithResponseAsync(requestOptions); - } - - /** - * The deleteStandalone 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> deleteStandaloneWithResponse(RequestOptions requestOptions) { - return this.serviceClient.deleteStandaloneWithResponseAsync(requestOptions); - } - - /** - * The withQuery operation. - * - * @param format The format 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 A {@link Mono} that completes when a successful response is received. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono withQuery(String format) { - // Generated convenience method for withQueryWithResponse - RequestOptions requestOptions = new RequestOptions(); - if (format != null) { - requestOptions.addQueryParam("format", format, false); - } - return withQueryWithResponse(requestOptions).flatMap(FluxUtil::toMono); - } - - /** - * The withQuery 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 withQuery() { - // Generated convenience method for withQueryWithResponse - RequestOptions requestOptions = new RequestOptions(); - return withQueryWithResponse(requestOptions).flatMap(FluxUtil::toMono); - } - - /** - * The getStandalone 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 getStandalone() { - // Generated convenience method for getStandaloneWithResponse - RequestOptions requestOptions = new RequestOptions(); - return getStandaloneWithResponse(requestOptions).flatMap(FluxUtil::toMono); - } - - /** - * The deleteStandalone 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 deleteStandalone() { - // Generated convenience method for deleteStandaloneWithResponse - RequestOptions requestOptions = new RequestOptions(); - return deleteStandaloneWithResponse(requestOptions).flatMap(FluxUtil::toMono); - } -} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyparentclient/IndividuallyParentNestedWithHeaderClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyparentclient/IndividuallyParentNestedWithHeaderClient.java deleted file mode 100644 index 9d4b1b57268..00000000000 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyparentclient/IndividuallyParentNestedWithHeaderClient.java +++ /dev/null @@ -1,164 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package _specs_.azure.clientgenerator.core.clientinitialization.individuallyparentclient; - -import _specs_.azure.clientgenerator.core.clientinitialization.individuallyparentclient.implementation.IndividuallyParentNestedWithHeaderClientImpl; -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; - -/** - * Initializes a new instance of the synchronous IndividuallyParentNestedWithHeaderClient type. - */ -@ServiceClient(builder = IndividuallyParentNestedWithHeaderClientBuilder.class) -public final class IndividuallyParentNestedWithHeaderClient { - @Generated - private final IndividuallyParentNestedWithHeaderClientImpl serviceClient; - - /** - * Initializes an instance of IndividuallyParentNestedWithHeaderClient class. - * - * @param serviceClient the service client implementation. - */ - @Generated - IndividuallyParentNestedWithHeaderClient(IndividuallyParentNestedWithHeaderClientImpl serviceClient) { - this.serviceClient = serviceClient; - } - - /** - * The withQuery operation. - *

Query Parameters

- * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
formatStringNoThe format parameter
- * You can add these to a request with {@link RequestOptions#addQueryParam} - * - * @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 withQueryWithResponse(RequestOptions requestOptions) { - return this.serviceClient.withQueryWithResponse(requestOptions); - } - - /** - * The getStandalone 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 getStandaloneWithResponse(RequestOptions requestOptions) { - return this.serviceClient.getStandaloneWithResponse(requestOptions); - } - - /** - * The deleteStandalone 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 deleteStandaloneWithResponse(RequestOptions requestOptions) { - return this.serviceClient.deleteStandaloneWithResponse(requestOptions); - } - - /** - * The withQuery operation. - * - * @param format The format 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. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public void withQuery(String format) { - // Generated convenience method for withQueryWithResponse - RequestOptions requestOptions = new RequestOptions(); - if (format != null) { - requestOptions.addQueryParam("format", format, false); - } - withQueryWithResponse(requestOptions).getValue(); - } - - /** - * The withQuery 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 withQuery() { - // Generated convenience method for withQueryWithResponse - RequestOptions requestOptions = new RequestOptions(); - withQueryWithResponse(requestOptions).getValue(); - } - - /** - * The getStandalone 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 getStandalone() { - // Generated convenience method for getStandaloneWithResponse - RequestOptions requestOptions = new RequestOptions(); - getStandaloneWithResponse(requestOptions).getValue(); - } - - /** - * The deleteStandalone 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 deleteStandalone() { - // Generated convenience method for deleteStandaloneWithResponse - RequestOptions requestOptions = new RequestOptions(); - deleteStandaloneWithResponse(requestOptions).getValue(); - } -} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyparentclient/IndividuallyParentNestedWithHeaderClientBuilder.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyparentclient/IndividuallyParentNestedWithHeaderClientBuilder.java deleted file mode 100644 index 79ca34e701a..00000000000 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyparentclient/IndividuallyParentNestedWithHeaderClientBuilder.java +++ /dev/null @@ -1,312 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package _specs_.azure.clientgenerator.core.clientinitialization.individuallyparentclient; - -import _specs_.azure.clientgenerator.core.clientinitialization.individuallyparentclient.implementation.IndividuallyParentNestedWithHeaderClientImpl; -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.HttpLogOptions; -import com.azure.core.http.policy.HttpLoggingPolicy; -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 java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.Objects; - -/** - * A builder for creating a new instance of the IndividuallyParentNestedWithHeaderClient type. - */ -@ServiceClientBuilder( - serviceClients = { - IndividuallyParentNestedWithHeaderClient.class, - IndividuallyParentNestedWithHeaderAsyncClient.class }) -public final class IndividuallyParentNestedWithHeaderClientBuilder - 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("_specs_-azure-clientgenerator-core-clientinitialization-individuallyparentclient.properties"); - - @Generated - private final List pipelinePolicies; - - /** - * Create an instance of the IndividuallyParentNestedWithHeaderClientBuilder. - */ - @Generated - public IndividuallyParentNestedWithHeaderClientBuilder() { - this.pipelinePolicies = new ArrayList<>(); - } - - /* - * The HTTP client used to send the request. - */ - @Generated - private HttpClient httpClient; - - /** - * {@inheritDoc}. - */ - @Generated - @Override - public IndividuallyParentNestedWithHeaderClientBuilder httpClient(HttpClient httpClient) { - this.httpClient = httpClient; - return this; - } - - /* - * The HTTP pipeline to send requests through. - */ - @Generated - private HttpPipeline pipeline; - - /** - * {@inheritDoc}. - */ - @Generated - @Override - public IndividuallyParentNestedWithHeaderClientBuilder 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 logging configuration for HTTP requests and responses. - */ - @Generated - private HttpLogOptions httpLogOptions; - - /** - * {@inheritDoc}. - */ - @Generated - @Override - public IndividuallyParentNestedWithHeaderClientBuilder 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 IndividuallyParentNestedWithHeaderClientBuilder 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 IndividuallyParentNestedWithHeaderClientBuilder retryOptions(RetryOptions retryOptions) { - this.retryOptions = retryOptions; - return this; - } - - /** - * {@inheritDoc}. - */ - @Generated - @Override - public IndividuallyParentNestedWithHeaderClientBuilder 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 IndividuallyParentNestedWithHeaderClientBuilder configuration(Configuration configuration) { - this.configuration = configuration; - return this; - } - - /* - * The service endpoint - */ - @Generated - private String endpoint; - - /** - * {@inheritDoc}. - */ - @Generated - @Override - public IndividuallyParentNestedWithHeaderClientBuilder endpoint(String endpoint) { - this.endpoint = endpoint; - return this; - } - - /* - * - */ - @Generated - private String name; - - /** - * Sets. - * - * @param name the name value. - * @return the IndividuallyParentNestedWithHeaderClientBuilder. - */ - @Generated - public IndividuallyParentNestedWithHeaderClientBuilder name(String name) { - this.name = name; - 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 IndividuallyParentNestedWithHeaderClientBuilder. - */ - @Generated - public IndividuallyParentNestedWithHeaderClientBuilder retryPolicy(RetryPolicy retryPolicy) { - this.retryPolicy = retryPolicy; - return this; - } - - /** - * Builds an instance of IndividuallyParentNestedWithHeaderClientImpl with the provided parameters. - * - * @return an instance of IndividuallyParentNestedWithHeaderClientImpl. - */ - @Generated - private IndividuallyParentNestedWithHeaderClientImpl buildInnerClient() { - this.validateClient(); - HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); - String localEndpoint = (endpoint != null) ? endpoint : "http://localhost:3000"; - IndividuallyParentNestedWithHeaderClientImpl client = new IndividuallyParentNestedWithHeaderClientImpl( - localPipeline, JacksonAdapter.createDefaultSerializerAdapter(), localEndpoint, this.name); - 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(name, "'name' 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 IndividuallyParentNestedWithHeaderAsyncClient class. - * - * @return an instance of IndividuallyParentNestedWithHeaderAsyncClient. - */ - @Generated - public IndividuallyParentNestedWithHeaderAsyncClient buildAsyncClient() { - return new IndividuallyParentNestedWithHeaderAsyncClient(buildInnerClient()); - } - - /** - * Builds an instance of IndividuallyParentNestedWithHeaderClient class. - * - * @return an instance of IndividuallyParentNestedWithHeaderClient. - */ - @Generated - public IndividuallyParentNestedWithHeaderClient buildClient() { - return new IndividuallyParentNestedWithHeaderClient(buildInnerClient()); - } - - private static final ClientLogger LOGGER = new ClientLogger(IndividuallyParentNestedWithHeaderClientBuilder.class); -} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyparentclient/IndividuallyParentNestedWithMixedAsyncClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyparentclient/IndividuallyParentNestedWithMixedAsyncClient.java deleted file mode 100644 index 4a58ed6c184..00000000000 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyparentclient/IndividuallyParentNestedWithMixedAsyncClient.java +++ /dev/null @@ -1,180 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package _specs_.azure.clientgenerator.core.clientinitialization.individuallyparentclient; - -import _specs_.azure.clientgenerator.core.clientinitialization.individuallyparentclient.implementation.IndividuallyParentNestedWithMixedClientImpl; -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 reactor.core.publisher.Mono; - -/** - * Initializes a new instance of the asynchronous IndividuallyParentNestedWithMixedClient type. - */ -@ServiceClient(builder = IndividuallyParentNestedWithMixedClientBuilder.class, isAsync = true) -public final class IndividuallyParentNestedWithMixedAsyncClient { - @Generated - private final IndividuallyParentNestedWithMixedClientImpl serviceClient; - - /** - * Initializes an instance of IndividuallyParentNestedWithMixedAsyncClient class. - * - * @param serviceClient the service client implementation. - */ - @Generated - IndividuallyParentNestedWithMixedAsyncClient(IndividuallyParentNestedWithMixedClientImpl serviceClient) { - this.serviceClient = serviceClient; - } - - /** - * The withQuery operation. - *

Query Parameters

- * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
formatStringNoThe format parameter
- * You can add these to a request with {@link RequestOptions#addQueryParam} - * - * @param region The region 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 {@link Response} on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> withQueryWithResponse(String region, RequestOptions requestOptions) { - return this.serviceClient.withQueryWithResponseAsync(region, requestOptions); - } - - /** - * The getStandalone operation. - * - * @param region The region 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 {@link Response} on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getStandaloneWithResponse(String region, RequestOptions requestOptions) { - return this.serviceClient.getStandaloneWithResponseAsync(region, requestOptions); - } - - /** - * The deleteStandalone operation. - * - * @param region The region 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 {@link Response} on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteStandaloneWithResponse(String region, RequestOptions requestOptions) { - return this.serviceClient.deleteStandaloneWithResponseAsync(region, requestOptions); - } - - /** - * The withQuery operation. - * - * @param region The region parameter. - * @param format The format 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 A {@link Mono} that completes when a successful response is received. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono withQuery(String region, String format) { - // Generated convenience method for withQueryWithResponse - RequestOptions requestOptions = new RequestOptions(); - if (format != null) { - requestOptions.addQueryParam("format", format, false); - } - return withQueryWithResponse(region, requestOptions).flatMap(FluxUtil::toMono); - } - - /** - * The withQuery operation. - * - * @param region The region 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 A {@link Mono} that completes when a successful response is received. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono withQuery(String region) { - // Generated convenience method for withQueryWithResponse - RequestOptions requestOptions = new RequestOptions(); - return withQueryWithResponse(region, requestOptions).flatMap(FluxUtil::toMono); - } - - /** - * The getStandalone operation. - * - * @param region The region 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 A {@link Mono} that completes when a successful response is received. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getStandalone(String region) { - // Generated convenience method for getStandaloneWithResponse - RequestOptions requestOptions = new RequestOptions(); - return getStandaloneWithResponse(region, requestOptions).flatMap(FluxUtil::toMono); - } - - /** - * The deleteStandalone operation. - * - * @param region The region 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 A {@link Mono} that completes when a successful response is received. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteStandalone(String region) { - // Generated convenience method for deleteStandaloneWithResponse - RequestOptions requestOptions = new RequestOptions(); - return deleteStandaloneWithResponse(region, requestOptions).flatMap(FluxUtil::toMono); - } -} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyparentclient/IndividuallyParentNestedWithMixedClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyparentclient/IndividuallyParentNestedWithMixedClient.java deleted file mode 100644 index a3937047c2c..00000000000 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyparentclient/IndividuallyParentNestedWithMixedClient.java +++ /dev/null @@ -1,174 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package _specs_.azure.clientgenerator.core.clientinitialization.individuallyparentclient; - -import _specs_.azure.clientgenerator.core.clientinitialization.individuallyparentclient.implementation.IndividuallyParentNestedWithMixedClientImpl; -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; - -/** - * Initializes a new instance of the synchronous IndividuallyParentNestedWithMixedClient type. - */ -@ServiceClient(builder = IndividuallyParentNestedWithMixedClientBuilder.class) -public final class IndividuallyParentNestedWithMixedClient { - @Generated - private final IndividuallyParentNestedWithMixedClientImpl serviceClient; - - /** - * Initializes an instance of IndividuallyParentNestedWithMixedClient class. - * - * @param serviceClient the service client implementation. - */ - @Generated - IndividuallyParentNestedWithMixedClient(IndividuallyParentNestedWithMixedClientImpl serviceClient) { - this.serviceClient = serviceClient; - } - - /** - * The withQuery operation. - *

Query Parameters

- * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
formatStringNoThe format parameter
- * You can add these to a request with {@link RequestOptions#addQueryParam} - * - * @param region The region 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 {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response withQueryWithResponse(String region, RequestOptions requestOptions) { - return this.serviceClient.withQueryWithResponse(region, requestOptions); - } - - /** - * The getStandalone operation. - * - * @param region The region 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 {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getStandaloneWithResponse(String region, RequestOptions requestOptions) { - return this.serviceClient.getStandaloneWithResponse(region, requestOptions); - } - - /** - * The deleteStandalone operation. - * - * @param region The region 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 {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteStandaloneWithResponse(String region, RequestOptions requestOptions) { - return this.serviceClient.deleteStandaloneWithResponse(region, requestOptions); - } - - /** - * The withQuery operation. - * - * @param region The region parameter. - * @param format The format 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. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public void withQuery(String region, String format) { - // Generated convenience method for withQueryWithResponse - RequestOptions requestOptions = new RequestOptions(); - if (format != null) { - requestOptions.addQueryParam("format", format, false); - } - withQueryWithResponse(region, requestOptions).getValue(); - } - - /** - * The withQuery operation. - * - * @param region The region 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. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public void withQuery(String region) { - // Generated convenience method for withQueryWithResponse - RequestOptions requestOptions = new RequestOptions(); - withQueryWithResponse(region, requestOptions).getValue(); - } - - /** - * The getStandalone operation. - * - * @param region The region 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. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public void getStandalone(String region) { - // Generated convenience method for getStandaloneWithResponse - RequestOptions requestOptions = new RequestOptions(); - getStandaloneWithResponse(region, requestOptions).getValue(); - } - - /** - * The deleteStandalone operation. - * - * @param region The region 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. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public void deleteStandalone(String region) { - // Generated convenience method for deleteStandaloneWithResponse - RequestOptions requestOptions = new RequestOptions(); - deleteStandaloneWithResponse(region, requestOptions).getValue(); - } -} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyparentclient/IndividuallyParentNestedWithMixedClientBuilder.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyparentclient/IndividuallyParentNestedWithMixedClientBuilder.java deleted file mode 100644 index 32ea151be29..00000000000 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyparentclient/IndividuallyParentNestedWithMixedClientBuilder.java +++ /dev/null @@ -1,312 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package _specs_.azure.clientgenerator.core.clientinitialization.individuallyparentclient; - -import _specs_.azure.clientgenerator.core.clientinitialization.individuallyparentclient.implementation.IndividuallyParentNestedWithMixedClientImpl; -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.HttpLogOptions; -import com.azure.core.http.policy.HttpLoggingPolicy; -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 java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.Objects; - -/** - * A builder for creating a new instance of the IndividuallyParentNestedWithMixedClient type. - */ -@ServiceClientBuilder( - serviceClients = { - IndividuallyParentNestedWithMixedClient.class, - IndividuallyParentNestedWithMixedAsyncClient.class }) -public final class IndividuallyParentNestedWithMixedClientBuilder - 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("_specs_-azure-clientgenerator-core-clientinitialization-individuallyparentclient.properties"); - - @Generated - private final List pipelinePolicies; - - /** - * Create an instance of the IndividuallyParentNestedWithMixedClientBuilder. - */ - @Generated - public IndividuallyParentNestedWithMixedClientBuilder() { - this.pipelinePolicies = new ArrayList<>(); - } - - /* - * The HTTP client used to send the request. - */ - @Generated - private HttpClient httpClient; - - /** - * {@inheritDoc}. - */ - @Generated - @Override - public IndividuallyParentNestedWithMixedClientBuilder httpClient(HttpClient httpClient) { - this.httpClient = httpClient; - return this; - } - - /* - * The HTTP pipeline to send requests through. - */ - @Generated - private HttpPipeline pipeline; - - /** - * {@inheritDoc}. - */ - @Generated - @Override - public IndividuallyParentNestedWithMixedClientBuilder 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 logging configuration for HTTP requests and responses. - */ - @Generated - private HttpLogOptions httpLogOptions; - - /** - * {@inheritDoc}. - */ - @Generated - @Override - public IndividuallyParentNestedWithMixedClientBuilder 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 IndividuallyParentNestedWithMixedClientBuilder 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 IndividuallyParentNestedWithMixedClientBuilder retryOptions(RetryOptions retryOptions) { - this.retryOptions = retryOptions; - return this; - } - - /** - * {@inheritDoc}. - */ - @Generated - @Override - public IndividuallyParentNestedWithMixedClientBuilder 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 IndividuallyParentNestedWithMixedClientBuilder configuration(Configuration configuration) { - this.configuration = configuration; - return this; - } - - /* - * The service endpoint - */ - @Generated - private String endpoint; - - /** - * {@inheritDoc}. - */ - @Generated - @Override - public IndividuallyParentNestedWithMixedClientBuilder endpoint(String endpoint) { - this.endpoint = endpoint; - return this; - } - - /* - * - */ - @Generated - private String name; - - /** - * Sets. - * - * @param name the name value. - * @return the IndividuallyParentNestedWithMixedClientBuilder. - */ - @Generated - public IndividuallyParentNestedWithMixedClientBuilder name(String name) { - this.name = name; - 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 IndividuallyParentNestedWithMixedClientBuilder. - */ - @Generated - public IndividuallyParentNestedWithMixedClientBuilder retryPolicy(RetryPolicy retryPolicy) { - this.retryPolicy = retryPolicy; - return this; - } - - /** - * Builds an instance of IndividuallyParentNestedWithMixedClientImpl with the provided parameters. - * - * @return an instance of IndividuallyParentNestedWithMixedClientImpl. - */ - @Generated - private IndividuallyParentNestedWithMixedClientImpl buildInnerClient() { - this.validateClient(); - HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); - String localEndpoint = (endpoint != null) ? endpoint : "http://localhost:3000"; - IndividuallyParentNestedWithMixedClientImpl client = new IndividuallyParentNestedWithMixedClientImpl( - localPipeline, JacksonAdapter.createDefaultSerializerAdapter(), localEndpoint, this.name); - 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(name, "'name' 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 IndividuallyParentNestedWithMixedAsyncClient class. - * - * @return an instance of IndividuallyParentNestedWithMixedAsyncClient. - */ - @Generated - public IndividuallyParentNestedWithMixedAsyncClient buildAsyncClient() { - return new IndividuallyParentNestedWithMixedAsyncClient(buildInnerClient()); - } - - /** - * Builds an instance of IndividuallyParentNestedWithMixedClient class. - * - * @return an instance of IndividuallyParentNestedWithMixedClient. - */ - @Generated - public IndividuallyParentNestedWithMixedClient buildClient() { - return new IndividuallyParentNestedWithMixedClient(buildInnerClient()); - } - - private static final ClientLogger LOGGER = new ClientLogger(IndividuallyParentNestedWithMixedClientBuilder.class); -} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyparentclient/IndividuallyParentNestedWithMultipleAsyncClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyparentclient/IndividuallyParentNestedWithMultipleAsyncClient.java deleted file mode 100644 index 56f0f11ec20..00000000000 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyparentclient/IndividuallyParentNestedWithMultipleAsyncClient.java +++ /dev/null @@ -1,170 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package _specs_.azure.clientgenerator.core.clientinitialization.individuallyparentclient; - -import _specs_.azure.clientgenerator.core.clientinitialization.individuallyparentclient.implementation.IndividuallyParentNestedWithMultipleClientImpl; -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 reactor.core.publisher.Mono; - -/** - * Initializes a new instance of the asynchronous IndividuallyParentNestedWithMultipleClient type. - */ -@ServiceClient(builder = IndividuallyParentNestedWithMultipleClientBuilder.class, isAsync = true) -public final class IndividuallyParentNestedWithMultipleAsyncClient { - @Generated - private final IndividuallyParentNestedWithMultipleClientImpl serviceClient; - - /** - * Initializes an instance of IndividuallyParentNestedWithMultipleAsyncClient class. - * - * @param serviceClient the service client implementation. - */ - @Generated - IndividuallyParentNestedWithMultipleAsyncClient(IndividuallyParentNestedWithMultipleClientImpl serviceClient) { - this.serviceClient = serviceClient; - } - - /** - * The withQuery operation. - *

Query Parameters

- * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
formatStringNoThe format parameter
- * You can add these to a request with {@link RequestOptions#addQueryParam} - * - * @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> withQueryWithResponse(RequestOptions requestOptions) { - return this.serviceClient.withQueryWithResponseAsync(requestOptions); - } - - /** - * The getStandalone 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> getStandaloneWithResponse(RequestOptions requestOptions) { - return this.serviceClient.getStandaloneWithResponseAsync(requestOptions); - } - - /** - * The deleteStandalone 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> deleteStandaloneWithResponse(RequestOptions requestOptions) { - return this.serviceClient.deleteStandaloneWithResponseAsync(requestOptions); - } - - /** - * The withQuery operation. - * - * @param format The format 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 A {@link Mono} that completes when a successful response is received. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono withQuery(String format) { - // Generated convenience method for withQueryWithResponse - RequestOptions requestOptions = new RequestOptions(); - if (format != null) { - requestOptions.addQueryParam("format", format, false); - } - return withQueryWithResponse(requestOptions).flatMap(FluxUtil::toMono); - } - - /** - * The withQuery 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 withQuery() { - // Generated convenience method for withQueryWithResponse - RequestOptions requestOptions = new RequestOptions(); - return withQueryWithResponse(requestOptions).flatMap(FluxUtil::toMono); - } - - /** - * The getStandalone 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 getStandalone() { - // Generated convenience method for getStandaloneWithResponse - RequestOptions requestOptions = new RequestOptions(); - return getStandaloneWithResponse(requestOptions).flatMap(FluxUtil::toMono); - } - - /** - * The deleteStandalone 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 deleteStandalone() { - // Generated convenience method for deleteStandaloneWithResponse - RequestOptions requestOptions = new RequestOptions(); - return deleteStandaloneWithResponse(requestOptions).flatMap(FluxUtil::toMono); - } -} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyparentclient/IndividuallyParentNestedWithMultipleClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyparentclient/IndividuallyParentNestedWithMultipleClient.java deleted file mode 100644 index 0d5ea371b8c..00000000000 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyparentclient/IndividuallyParentNestedWithMultipleClient.java +++ /dev/null @@ -1,164 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package _specs_.azure.clientgenerator.core.clientinitialization.individuallyparentclient; - -import _specs_.azure.clientgenerator.core.clientinitialization.individuallyparentclient.implementation.IndividuallyParentNestedWithMultipleClientImpl; -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; - -/** - * Initializes a new instance of the synchronous IndividuallyParentNestedWithMultipleClient type. - */ -@ServiceClient(builder = IndividuallyParentNestedWithMultipleClientBuilder.class) -public final class IndividuallyParentNestedWithMultipleClient { - @Generated - private final IndividuallyParentNestedWithMultipleClientImpl serviceClient; - - /** - * Initializes an instance of IndividuallyParentNestedWithMultipleClient class. - * - * @param serviceClient the service client implementation. - */ - @Generated - IndividuallyParentNestedWithMultipleClient(IndividuallyParentNestedWithMultipleClientImpl serviceClient) { - this.serviceClient = serviceClient; - } - - /** - * The withQuery operation. - *

Query Parameters

- * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
formatStringNoThe format parameter
- * You can add these to a request with {@link RequestOptions#addQueryParam} - * - * @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 withQueryWithResponse(RequestOptions requestOptions) { - return this.serviceClient.withQueryWithResponse(requestOptions); - } - - /** - * The getStandalone 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 getStandaloneWithResponse(RequestOptions requestOptions) { - return this.serviceClient.getStandaloneWithResponse(requestOptions); - } - - /** - * The deleteStandalone 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 deleteStandaloneWithResponse(RequestOptions requestOptions) { - return this.serviceClient.deleteStandaloneWithResponse(requestOptions); - } - - /** - * The withQuery operation. - * - * @param format The format 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. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public void withQuery(String format) { - // Generated convenience method for withQueryWithResponse - RequestOptions requestOptions = new RequestOptions(); - if (format != null) { - requestOptions.addQueryParam("format", format, false); - } - withQueryWithResponse(requestOptions).getValue(); - } - - /** - * The withQuery 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 withQuery() { - // Generated convenience method for withQueryWithResponse - RequestOptions requestOptions = new RequestOptions(); - withQueryWithResponse(requestOptions).getValue(); - } - - /** - * The getStandalone 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 getStandalone() { - // Generated convenience method for getStandaloneWithResponse - RequestOptions requestOptions = new RequestOptions(); - getStandaloneWithResponse(requestOptions).getValue(); - } - - /** - * The deleteStandalone 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 deleteStandalone() { - // Generated convenience method for deleteStandaloneWithResponse - RequestOptions requestOptions = new RequestOptions(); - deleteStandaloneWithResponse(requestOptions).getValue(); - } -} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyparentclient/IndividuallyParentNestedWithMultipleClientBuilder.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyparentclient/IndividuallyParentNestedWithMultipleClientBuilder.java deleted file mode 100644 index d20811188c1..00000000000 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyparentclient/IndividuallyParentNestedWithMultipleClientBuilder.java +++ /dev/null @@ -1,332 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package _specs_.azure.clientgenerator.core.clientinitialization.individuallyparentclient; - -import _specs_.azure.clientgenerator.core.clientinitialization.individuallyparentclient.implementation.IndividuallyParentNestedWithMultipleClientImpl; -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.HttpLogOptions; -import com.azure.core.http.policy.HttpLoggingPolicy; -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 java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.Objects; - -/** - * A builder for creating a new instance of the IndividuallyParentNestedWithMultipleClient type. - */ -@ServiceClientBuilder( - serviceClients = { - IndividuallyParentNestedWithMultipleClient.class, - IndividuallyParentNestedWithMultipleAsyncClient.class }) -public final class IndividuallyParentNestedWithMultipleClientBuilder - 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("_specs_-azure-clientgenerator-core-clientinitialization-individuallyparentclient.properties"); - - @Generated - private final List pipelinePolicies; - - /** - * Create an instance of the IndividuallyParentNestedWithMultipleClientBuilder. - */ - @Generated - public IndividuallyParentNestedWithMultipleClientBuilder() { - this.pipelinePolicies = new ArrayList<>(); - } - - /* - * The HTTP client used to send the request. - */ - @Generated - private HttpClient httpClient; - - /** - * {@inheritDoc}. - */ - @Generated - @Override - public IndividuallyParentNestedWithMultipleClientBuilder httpClient(HttpClient httpClient) { - this.httpClient = httpClient; - return this; - } - - /* - * The HTTP pipeline to send requests through. - */ - @Generated - private HttpPipeline pipeline; - - /** - * {@inheritDoc}. - */ - @Generated - @Override - public IndividuallyParentNestedWithMultipleClientBuilder 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 logging configuration for HTTP requests and responses. - */ - @Generated - private HttpLogOptions httpLogOptions; - - /** - * {@inheritDoc}. - */ - @Generated - @Override - public IndividuallyParentNestedWithMultipleClientBuilder 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 IndividuallyParentNestedWithMultipleClientBuilder 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 IndividuallyParentNestedWithMultipleClientBuilder retryOptions(RetryOptions retryOptions) { - this.retryOptions = retryOptions; - return this; - } - - /** - * {@inheritDoc}. - */ - @Generated - @Override - public IndividuallyParentNestedWithMultipleClientBuilder 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 IndividuallyParentNestedWithMultipleClientBuilder configuration(Configuration configuration) { - this.configuration = configuration; - return this; - } - - /* - * The service endpoint - */ - @Generated - private String endpoint; - - /** - * {@inheritDoc}. - */ - @Generated - @Override - public IndividuallyParentNestedWithMultipleClientBuilder endpoint(String endpoint) { - this.endpoint = endpoint; - return this; - } - - /* - * - */ - @Generated - private String name; - - /** - * Sets. - * - * @param name the name value. - * @return the IndividuallyParentNestedWithMultipleClientBuilder. - */ - @Generated - public IndividuallyParentNestedWithMultipleClientBuilder name(String name) { - this.name = name; - return this; - } - - /* - * - */ - @Generated - private String region; - - /** - * Sets. - * - * @param region the region value. - * @return the IndividuallyParentNestedWithMultipleClientBuilder. - */ - @Generated - public IndividuallyParentNestedWithMultipleClientBuilder region(String region) { - this.region = region; - 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 IndividuallyParentNestedWithMultipleClientBuilder. - */ - @Generated - public IndividuallyParentNestedWithMultipleClientBuilder retryPolicy(RetryPolicy retryPolicy) { - this.retryPolicy = retryPolicy; - return this; - } - - /** - * Builds an instance of IndividuallyParentNestedWithMultipleClientImpl with the provided parameters. - * - * @return an instance of IndividuallyParentNestedWithMultipleClientImpl. - */ - @Generated - private IndividuallyParentNestedWithMultipleClientImpl buildInnerClient() { - this.validateClient(); - HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); - String localEndpoint = (endpoint != null) ? endpoint : "http://localhost:3000"; - IndividuallyParentNestedWithMultipleClientImpl client = new IndividuallyParentNestedWithMultipleClientImpl( - localPipeline, JacksonAdapter.createDefaultSerializerAdapter(), localEndpoint, this.name, this.region); - 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(name, "'name' cannot be null."); - Objects.requireNonNull(region, "'region' 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 IndividuallyParentNestedWithMultipleAsyncClient class. - * - * @return an instance of IndividuallyParentNestedWithMultipleAsyncClient. - */ - @Generated - public IndividuallyParentNestedWithMultipleAsyncClient buildAsyncClient() { - return new IndividuallyParentNestedWithMultipleAsyncClient(buildInnerClient()); - } - - /** - * Builds an instance of IndividuallyParentNestedWithMultipleClient class. - * - * @return an instance of IndividuallyParentNestedWithMultipleClient. - */ - @Generated - public IndividuallyParentNestedWithMultipleClient buildClient() { - return new IndividuallyParentNestedWithMultipleClient(buildInnerClient()); - } - - private static final ClientLogger LOGGER - = new ClientLogger(IndividuallyParentNestedWithMultipleClientBuilder.class); -} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyparentclient/IndividuallyParentNestedWithParamAliasAsyncClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyparentclient/IndividuallyParentNestedWithParamAliasAsyncClient.java deleted file mode 100644 index 94679aa6002..00000000000 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyparentclient/IndividuallyParentNestedWithParamAliasAsyncClient.java +++ /dev/null @@ -1,106 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package _specs_.azure.clientgenerator.core.clientinitialization.individuallyparentclient; - -import _specs_.azure.clientgenerator.core.clientinitialization.individuallyparentclient.implementation.IndividuallyParentNestedWithParamAliasClientImpl; -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 reactor.core.publisher.Mono; - -/** - * Initializes a new instance of the asynchronous IndividuallyParentNestedWithParamAliasClient type. - */ -@ServiceClient(builder = IndividuallyParentNestedWithParamAliasClientBuilder.class, isAsync = true) -public final class IndividuallyParentNestedWithParamAliasAsyncClient { - @Generated - private final IndividuallyParentNestedWithParamAliasClientImpl serviceClient; - - /** - * Initializes an instance of IndividuallyParentNestedWithParamAliasAsyncClient class. - * - * @param serviceClient the service client implementation. - */ - @Generated - IndividuallyParentNestedWithParamAliasAsyncClient(IndividuallyParentNestedWithParamAliasClientImpl serviceClient) { - this.serviceClient = serviceClient; - } - - /** - * The withAliasedName 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> withAliasedNameWithResponse(RequestOptions requestOptions) { - return this.serviceClient.withAliasedNameWithResponseAsync(requestOptions); - } - - /** - * The withOriginalName 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> withOriginalNameWithResponse(RequestOptions requestOptions) { - return this.serviceClient.withOriginalNameWithResponseAsync(requestOptions); - } - - /** - * The withAliasedName 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 withAliasedName() { - // Generated convenience method for withAliasedNameWithResponse - RequestOptions requestOptions = new RequestOptions(); - return withAliasedNameWithResponse(requestOptions).flatMap(FluxUtil::toMono); - } - - /** - * The withOriginalName 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 withOriginalName() { - // Generated convenience method for withOriginalNameWithResponse - RequestOptions requestOptions = new RequestOptions(); - return withOriginalNameWithResponse(requestOptions).flatMap(FluxUtil::toMono); - } -} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyparentclient/IndividuallyParentNestedWithParamAliasClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyparentclient/IndividuallyParentNestedWithParamAliasClient.java deleted file mode 100644 index d4e8214339e..00000000000 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyparentclient/IndividuallyParentNestedWithParamAliasClient.java +++ /dev/null @@ -1,102 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package _specs_.azure.clientgenerator.core.clientinitialization.individuallyparentclient; - -import _specs_.azure.clientgenerator.core.clientinitialization.individuallyparentclient.implementation.IndividuallyParentNestedWithParamAliasClientImpl; -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; - -/** - * Initializes a new instance of the synchronous IndividuallyParentNestedWithParamAliasClient type. - */ -@ServiceClient(builder = IndividuallyParentNestedWithParamAliasClientBuilder.class) -public final class IndividuallyParentNestedWithParamAliasClient { - @Generated - private final IndividuallyParentNestedWithParamAliasClientImpl serviceClient; - - /** - * Initializes an instance of IndividuallyParentNestedWithParamAliasClient class. - * - * @param serviceClient the service client implementation. - */ - @Generated - IndividuallyParentNestedWithParamAliasClient(IndividuallyParentNestedWithParamAliasClientImpl serviceClient) { - this.serviceClient = serviceClient; - } - - /** - * The withAliasedName 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 withAliasedNameWithResponse(RequestOptions requestOptions) { - return this.serviceClient.withAliasedNameWithResponse(requestOptions); - } - - /** - * The withOriginalName 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 withOriginalNameWithResponse(RequestOptions requestOptions) { - return this.serviceClient.withOriginalNameWithResponse(requestOptions); - } - - /** - * The withAliasedName 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 withAliasedName() { - // Generated convenience method for withAliasedNameWithResponse - RequestOptions requestOptions = new RequestOptions(); - withAliasedNameWithResponse(requestOptions).getValue(); - } - - /** - * The withOriginalName 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 withOriginalName() { - // Generated convenience method for withOriginalNameWithResponse - RequestOptions requestOptions = new RequestOptions(); - withOriginalNameWithResponse(requestOptions).getValue(); - } -} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyparentclient/IndividuallyParentNestedWithParamAliasClientBuilder.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyparentclient/IndividuallyParentNestedWithParamAliasClientBuilder.java deleted file mode 100644 index 4a6bd194a01..00000000000 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyparentclient/IndividuallyParentNestedWithParamAliasClientBuilder.java +++ /dev/null @@ -1,313 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package _specs_.azure.clientgenerator.core.clientinitialization.individuallyparentclient; - -import _specs_.azure.clientgenerator.core.clientinitialization.individuallyparentclient.implementation.IndividuallyParentNestedWithParamAliasClientImpl; -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.HttpLogOptions; -import com.azure.core.http.policy.HttpLoggingPolicy; -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 java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.Objects; - -/** - * A builder for creating a new instance of the IndividuallyParentNestedWithParamAliasClient type. - */ -@ServiceClientBuilder( - serviceClients = { - IndividuallyParentNestedWithParamAliasClient.class, - IndividuallyParentNestedWithParamAliasAsyncClient.class }) -public final class IndividuallyParentNestedWithParamAliasClientBuilder - 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("_specs_-azure-clientgenerator-core-clientinitialization-individuallyparentclient.properties"); - - @Generated - private final List pipelinePolicies; - - /** - * Create an instance of the IndividuallyParentNestedWithParamAliasClientBuilder. - */ - @Generated - public IndividuallyParentNestedWithParamAliasClientBuilder() { - this.pipelinePolicies = new ArrayList<>(); - } - - /* - * The HTTP client used to send the request. - */ - @Generated - private HttpClient httpClient; - - /** - * {@inheritDoc}. - */ - @Generated - @Override - public IndividuallyParentNestedWithParamAliasClientBuilder httpClient(HttpClient httpClient) { - this.httpClient = httpClient; - return this; - } - - /* - * The HTTP pipeline to send requests through. - */ - @Generated - private HttpPipeline pipeline; - - /** - * {@inheritDoc}. - */ - @Generated - @Override - public IndividuallyParentNestedWithParamAliasClientBuilder 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 logging configuration for HTTP requests and responses. - */ - @Generated - private HttpLogOptions httpLogOptions; - - /** - * {@inheritDoc}. - */ - @Generated - @Override - public IndividuallyParentNestedWithParamAliasClientBuilder 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 IndividuallyParentNestedWithParamAliasClientBuilder 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 IndividuallyParentNestedWithParamAliasClientBuilder retryOptions(RetryOptions retryOptions) { - this.retryOptions = retryOptions; - return this; - } - - /** - * {@inheritDoc}. - */ - @Generated - @Override - public IndividuallyParentNestedWithParamAliasClientBuilder 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 IndividuallyParentNestedWithParamAliasClientBuilder configuration(Configuration configuration) { - this.configuration = configuration; - return this; - } - - /* - * The service endpoint - */ - @Generated - private String endpoint; - - /** - * {@inheritDoc}. - */ - @Generated - @Override - public IndividuallyParentNestedWithParamAliasClientBuilder endpoint(String endpoint) { - this.endpoint = endpoint; - return this; - } - - /* - * - */ - @Generated - private String blobName; - - /** - * Sets. - * - * @param blobName the blobName value. - * @return the IndividuallyParentNestedWithParamAliasClientBuilder. - */ - @Generated - public IndividuallyParentNestedWithParamAliasClientBuilder blobName(String blobName) { - this.blobName = blobName; - 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 IndividuallyParentNestedWithParamAliasClientBuilder. - */ - @Generated - public IndividuallyParentNestedWithParamAliasClientBuilder retryPolicy(RetryPolicy retryPolicy) { - this.retryPolicy = retryPolicy; - return this; - } - - /** - * Builds an instance of IndividuallyParentNestedWithParamAliasClientImpl with the provided parameters. - * - * @return an instance of IndividuallyParentNestedWithParamAliasClientImpl. - */ - @Generated - private IndividuallyParentNestedWithParamAliasClientImpl buildInnerClient() { - this.validateClient(); - HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); - String localEndpoint = (endpoint != null) ? endpoint : "http://localhost:3000"; - IndividuallyParentNestedWithParamAliasClientImpl client = new IndividuallyParentNestedWithParamAliasClientImpl( - localPipeline, JacksonAdapter.createDefaultSerializerAdapter(), localEndpoint, this.blobName); - 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(blobName, "'blobName' 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 IndividuallyParentNestedWithParamAliasAsyncClient class. - * - * @return an instance of IndividuallyParentNestedWithParamAliasAsyncClient. - */ - @Generated - public IndividuallyParentNestedWithParamAliasAsyncClient buildAsyncClient() { - return new IndividuallyParentNestedWithParamAliasAsyncClient(buildInnerClient()); - } - - /** - * Builds an instance of IndividuallyParentNestedWithParamAliasClient class. - * - * @return an instance of IndividuallyParentNestedWithParamAliasClient. - */ - @Generated - public IndividuallyParentNestedWithParamAliasClient buildClient() { - return new IndividuallyParentNestedWithParamAliasClient(buildInnerClient()); - } - - private static final ClientLogger LOGGER - = new ClientLogger(IndividuallyParentNestedWithParamAliasClientBuilder.class); -} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyparentclient/IndividuallyParentNestedWithPathAsyncClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyparentclient/IndividuallyParentNestedWithPathAsyncClient.java deleted file mode 100644 index fcdab9bed81..00000000000 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyparentclient/IndividuallyParentNestedWithPathAsyncClient.java +++ /dev/null @@ -1,185 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package _specs_.azure.clientgenerator.core.clientinitialization.individuallyparentclient; - -import _specs_.azure.clientgenerator.core.clientinitialization.individuallyparentclient.implementation.IndividuallyParentNestedWithPathClientImpl; -import _specs_.azure.clientgenerator.core.clientinitialization.individuallyparentclient.models.BlobProperties; -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.BinaryData; -import com.azure.core.util.FluxUtil; -import reactor.core.publisher.Mono; - -/** - * Initializes a new instance of the asynchronous IndividuallyParentNestedWithPathClient type. - */ -@ServiceClient(builder = IndividuallyParentNestedWithPathClientBuilder.class, isAsync = true) -public final class IndividuallyParentNestedWithPathAsyncClient { - @Generated - private final IndividuallyParentNestedWithPathClientImpl serviceClient; - - /** - * Initializes an instance of IndividuallyParentNestedWithPathAsyncClient class. - * - * @param serviceClient the service client implementation. - */ - @Generated - IndividuallyParentNestedWithPathAsyncClient(IndividuallyParentNestedWithPathClientImpl serviceClient) { - this.serviceClient = serviceClient; - } - - /** - * The withQuery operation. - *

Query Parameters

- * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
formatStringNoThe format parameter
- * You can add these to a request with {@link RequestOptions#addQueryParam} - * - * @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> withQueryWithResponse(RequestOptions requestOptions) { - return this.serviceClient.withQueryWithResponseAsync(requestOptions); - } - - /** - * The getStandalone operation. - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     name: String (Required)
-     *     size: long (Required)
-     *     contentType: String (Required)
-     *     createdOn: OffsetDateTime (Required)
-     * }
-     * }
-     * 
- * - * @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 properties of a blob along with {@link Response} on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getStandaloneWithResponse(RequestOptions requestOptions) { - return this.serviceClient.getStandaloneWithResponseAsync(requestOptions); - } - - /** - * The deleteStandalone 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> deleteStandaloneWithResponse(RequestOptions requestOptions) { - return this.serviceClient.deleteStandaloneWithResponseAsync(requestOptions); - } - - /** - * The withQuery operation. - * - * @param format The format 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 A {@link Mono} that completes when a successful response is received. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono withQuery(String format) { - // Generated convenience method for withQueryWithResponse - RequestOptions requestOptions = new RequestOptions(); - if (format != null) { - requestOptions.addQueryParam("format", format, false); - } - return withQueryWithResponse(requestOptions).flatMap(FluxUtil::toMono); - } - - /** - * The withQuery 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 withQuery() { - // Generated convenience method for withQueryWithResponse - RequestOptions requestOptions = new RequestOptions(); - return withQueryWithResponse(requestOptions).flatMap(FluxUtil::toMono); - } - - /** - * The getStandalone 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 properties of a blob on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getStandalone() { - // Generated convenience method for getStandaloneWithResponse - RequestOptions requestOptions = new RequestOptions(); - return getStandaloneWithResponse(requestOptions).flatMap(FluxUtil::toMono) - .map(protocolMethodData -> protocolMethodData.toObject(BlobProperties.class)); - } - - /** - * The deleteStandalone 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 deleteStandalone() { - // Generated convenience method for deleteStandaloneWithResponse - RequestOptions requestOptions = new RequestOptions(); - return deleteStandaloneWithResponse(requestOptions).flatMap(FluxUtil::toMono); - } -} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyparentclient/IndividuallyParentNestedWithPathClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyparentclient/IndividuallyParentNestedWithPathClient.java deleted file mode 100644 index 3d91bcd3a7f..00000000000 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyparentclient/IndividuallyParentNestedWithPathClient.java +++ /dev/null @@ -1,179 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package _specs_.azure.clientgenerator.core.clientinitialization.individuallyparentclient; - -import _specs_.azure.clientgenerator.core.clientinitialization.individuallyparentclient.implementation.IndividuallyParentNestedWithPathClientImpl; -import _specs_.azure.clientgenerator.core.clientinitialization.individuallyparentclient.models.BlobProperties; -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.BinaryData; - -/** - * Initializes a new instance of the synchronous IndividuallyParentNestedWithPathClient type. - */ -@ServiceClient(builder = IndividuallyParentNestedWithPathClientBuilder.class) -public final class IndividuallyParentNestedWithPathClient { - @Generated - private final IndividuallyParentNestedWithPathClientImpl serviceClient; - - /** - * Initializes an instance of IndividuallyParentNestedWithPathClient class. - * - * @param serviceClient the service client implementation. - */ - @Generated - IndividuallyParentNestedWithPathClient(IndividuallyParentNestedWithPathClientImpl serviceClient) { - this.serviceClient = serviceClient; - } - - /** - * The withQuery operation. - *

Query Parameters

- * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
formatStringNoThe format parameter
- * You can add these to a request with {@link RequestOptions#addQueryParam} - * - * @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 withQueryWithResponse(RequestOptions requestOptions) { - return this.serviceClient.withQueryWithResponse(requestOptions); - } - - /** - * The getStandalone operation. - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     name: String (Required)
-     *     size: long (Required)
-     *     contentType: String (Required)
-     *     createdOn: OffsetDateTime (Required)
-     * }
-     * }
-     * 
- * - * @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 properties of a blob along with {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getStandaloneWithResponse(RequestOptions requestOptions) { - return this.serviceClient.getStandaloneWithResponse(requestOptions); - } - - /** - * The deleteStandalone 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 deleteStandaloneWithResponse(RequestOptions requestOptions) { - return this.serviceClient.deleteStandaloneWithResponse(requestOptions); - } - - /** - * The withQuery operation. - * - * @param format The format 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. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public void withQuery(String format) { - // Generated convenience method for withQueryWithResponse - RequestOptions requestOptions = new RequestOptions(); - if (format != null) { - requestOptions.addQueryParam("format", format, false); - } - withQueryWithResponse(requestOptions).getValue(); - } - - /** - * The withQuery 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 withQuery() { - // Generated convenience method for withQueryWithResponse - RequestOptions requestOptions = new RequestOptions(); - withQueryWithResponse(requestOptions).getValue(); - } - - /** - * The getStandalone 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 properties of a blob. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public BlobProperties getStandalone() { - // Generated convenience method for getStandaloneWithResponse - RequestOptions requestOptions = new RequestOptions(); - return getStandaloneWithResponse(requestOptions).getValue().toObject(BlobProperties.class); - } - - /** - * The deleteStandalone 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 deleteStandalone() { - // Generated convenience method for deleteStandaloneWithResponse - RequestOptions requestOptions = new RequestOptions(); - deleteStandaloneWithResponse(requestOptions).getValue(); - } -} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyparentclient/IndividuallyParentNestedWithPathClientBuilder.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyparentclient/IndividuallyParentNestedWithPathClientBuilder.java deleted file mode 100644 index 0619b12c4e7..00000000000 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyparentclient/IndividuallyParentNestedWithPathClientBuilder.java +++ /dev/null @@ -1,312 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package _specs_.azure.clientgenerator.core.clientinitialization.individuallyparentclient; - -import _specs_.azure.clientgenerator.core.clientinitialization.individuallyparentclient.implementation.IndividuallyParentNestedWithPathClientImpl; -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.HttpLogOptions; -import com.azure.core.http.policy.HttpLoggingPolicy; -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 java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.Objects; - -/** - * A builder for creating a new instance of the IndividuallyParentNestedWithPathClient type. - */ -@ServiceClientBuilder( - serviceClients = { - IndividuallyParentNestedWithPathClient.class, - IndividuallyParentNestedWithPathAsyncClient.class }) -public final class IndividuallyParentNestedWithPathClientBuilder - 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("_specs_-azure-clientgenerator-core-clientinitialization-individuallyparentclient.properties"); - - @Generated - private final List pipelinePolicies; - - /** - * Create an instance of the IndividuallyParentNestedWithPathClientBuilder. - */ - @Generated - public IndividuallyParentNestedWithPathClientBuilder() { - this.pipelinePolicies = new ArrayList<>(); - } - - /* - * The HTTP client used to send the request. - */ - @Generated - private HttpClient httpClient; - - /** - * {@inheritDoc}. - */ - @Generated - @Override - public IndividuallyParentNestedWithPathClientBuilder httpClient(HttpClient httpClient) { - this.httpClient = httpClient; - return this; - } - - /* - * The HTTP pipeline to send requests through. - */ - @Generated - private HttpPipeline pipeline; - - /** - * {@inheritDoc}. - */ - @Generated - @Override - public IndividuallyParentNestedWithPathClientBuilder 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 logging configuration for HTTP requests and responses. - */ - @Generated - private HttpLogOptions httpLogOptions; - - /** - * {@inheritDoc}. - */ - @Generated - @Override - public IndividuallyParentNestedWithPathClientBuilder 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 IndividuallyParentNestedWithPathClientBuilder 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 IndividuallyParentNestedWithPathClientBuilder retryOptions(RetryOptions retryOptions) { - this.retryOptions = retryOptions; - return this; - } - - /** - * {@inheritDoc}. - */ - @Generated - @Override - public IndividuallyParentNestedWithPathClientBuilder 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 IndividuallyParentNestedWithPathClientBuilder configuration(Configuration configuration) { - this.configuration = configuration; - return this; - } - - /* - * The service endpoint - */ - @Generated - private String endpoint; - - /** - * {@inheritDoc}. - */ - @Generated - @Override - public IndividuallyParentNestedWithPathClientBuilder endpoint(String endpoint) { - this.endpoint = endpoint; - return this; - } - - /* - * - */ - @Generated - private String blobName; - - /** - * Sets. - * - * @param blobName the blobName value. - * @return the IndividuallyParentNestedWithPathClientBuilder. - */ - @Generated - public IndividuallyParentNestedWithPathClientBuilder blobName(String blobName) { - this.blobName = blobName; - 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 IndividuallyParentNestedWithPathClientBuilder. - */ - @Generated - public IndividuallyParentNestedWithPathClientBuilder retryPolicy(RetryPolicy retryPolicy) { - this.retryPolicy = retryPolicy; - return this; - } - - /** - * Builds an instance of IndividuallyParentNestedWithPathClientImpl with the provided parameters. - * - * @return an instance of IndividuallyParentNestedWithPathClientImpl. - */ - @Generated - private IndividuallyParentNestedWithPathClientImpl buildInnerClient() { - this.validateClient(); - HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); - String localEndpoint = (endpoint != null) ? endpoint : "http://localhost:3000"; - IndividuallyParentNestedWithPathClientImpl client = new IndividuallyParentNestedWithPathClientImpl( - localPipeline, JacksonAdapter.createDefaultSerializerAdapter(), localEndpoint, this.blobName); - 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(blobName, "'blobName' 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 IndividuallyParentNestedWithPathAsyncClient class. - * - * @return an instance of IndividuallyParentNestedWithPathAsyncClient. - */ - @Generated - public IndividuallyParentNestedWithPathAsyncClient buildAsyncClient() { - return new IndividuallyParentNestedWithPathAsyncClient(buildInnerClient()); - } - - /** - * Builds an instance of IndividuallyParentNestedWithPathClient class. - * - * @return an instance of IndividuallyParentNestedWithPathClient. - */ - @Generated - public IndividuallyParentNestedWithPathClient buildClient() { - return new IndividuallyParentNestedWithPathClient(buildInnerClient()); - } - - private static final ClientLogger LOGGER = new ClientLogger(IndividuallyParentNestedWithPathClientBuilder.class); -} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyparentclient/IndividuallyParentNestedWithQueryAsyncClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyparentclient/IndividuallyParentNestedWithQueryAsyncClient.java deleted file mode 100644 index e3cae797d80..00000000000 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyparentclient/IndividuallyParentNestedWithQueryAsyncClient.java +++ /dev/null @@ -1,185 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package _specs_.azure.clientgenerator.core.clientinitialization.individuallyparentclient; - -import _specs_.azure.clientgenerator.core.clientinitialization.individuallyparentclient.implementation.IndividuallyParentNestedWithQueryClientImpl; -import _specs_.azure.clientgenerator.core.clientinitialization.individuallyparentclient.models.BlobProperties; -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.BinaryData; -import com.azure.core.util.FluxUtil; -import reactor.core.publisher.Mono; - -/** - * Initializes a new instance of the asynchronous IndividuallyParentNestedWithQueryClient type. - */ -@ServiceClient(builder = IndividuallyParentNestedWithQueryClientBuilder.class, isAsync = true) -public final class IndividuallyParentNestedWithQueryAsyncClient { - @Generated - private final IndividuallyParentNestedWithQueryClientImpl serviceClient; - - /** - * Initializes an instance of IndividuallyParentNestedWithQueryAsyncClient class. - * - * @param serviceClient the service client implementation. - */ - @Generated - IndividuallyParentNestedWithQueryAsyncClient(IndividuallyParentNestedWithQueryClientImpl serviceClient) { - this.serviceClient = serviceClient; - } - - /** - * The withQuery operation. - *

Query Parameters

- * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
formatStringNoThe format parameter
- * You can add these to a request with {@link RequestOptions#addQueryParam} - * - * @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> withQueryWithResponse(RequestOptions requestOptions) { - return this.serviceClient.withQueryWithResponseAsync(requestOptions); - } - - /** - * The getStandalone operation. - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     name: String (Required)
-     *     size: long (Required)
-     *     contentType: String (Required)
-     *     createdOn: OffsetDateTime (Required)
-     * }
-     * }
-     * 
- * - * @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 properties of a blob along with {@link Response} on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getStandaloneWithResponse(RequestOptions requestOptions) { - return this.serviceClient.getStandaloneWithResponseAsync(requestOptions); - } - - /** - * The deleteStandalone 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> deleteStandaloneWithResponse(RequestOptions requestOptions) { - return this.serviceClient.deleteStandaloneWithResponseAsync(requestOptions); - } - - /** - * The withQuery operation. - * - * @param format The format 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 A {@link Mono} that completes when a successful response is received. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono withQuery(String format) { - // Generated convenience method for withQueryWithResponse - RequestOptions requestOptions = new RequestOptions(); - if (format != null) { - requestOptions.addQueryParam("format", format, false); - } - return withQueryWithResponse(requestOptions).flatMap(FluxUtil::toMono); - } - - /** - * The withQuery 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 withQuery() { - // Generated convenience method for withQueryWithResponse - RequestOptions requestOptions = new RequestOptions(); - return withQueryWithResponse(requestOptions).flatMap(FluxUtil::toMono); - } - - /** - * The getStandalone 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 properties of a blob on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getStandalone() { - // Generated convenience method for getStandaloneWithResponse - RequestOptions requestOptions = new RequestOptions(); - return getStandaloneWithResponse(requestOptions).flatMap(FluxUtil::toMono) - .map(protocolMethodData -> protocolMethodData.toObject(BlobProperties.class)); - } - - /** - * The deleteStandalone 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 deleteStandalone() { - // Generated convenience method for deleteStandaloneWithResponse - RequestOptions requestOptions = new RequestOptions(); - return deleteStandaloneWithResponse(requestOptions).flatMap(FluxUtil::toMono); - } -} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyparentclient/IndividuallyParentNestedWithQueryClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyparentclient/IndividuallyParentNestedWithQueryClient.java deleted file mode 100644 index 5069a7cd006..00000000000 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyparentclient/IndividuallyParentNestedWithQueryClient.java +++ /dev/null @@ -1,179 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package _specs_.azure.clientgenerator.core.clientinitialization.individuallyparentclient; - -import _specs_.azure.clientgenerator.core.clientinitialization.individuallyparentclient.implementation.IndividuallyParentNestedWithQueryClientImpl; -import _specs_.azure.clientgenerator.core.clientinitialization.individuallyparentclient.models.BlobProperties; -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.BinaryData; - -/** - * Initializes a new instance of the synchronous IndividuallyParentNestedWithQueryClient type. - */ -@ServiceClient(builder = IndividuallyParentNestedWithQueryClientBuilder.class) -public final class IndividuallyParentNestedWithQueryClient { - @Generated - private final IndividuallyParentNestedWithQueryClientImpl serviceClient; - - /** - * Initializes an instance of IndividuallyParentNestedWithQueryClient class. - * - * @param serviceClient the service client implementation. - */ - @Generated - IndividuallyParentNestedWithQueryClient(IndividuallyParentNestedWithQueryClientImpl serviceClient) { - this.serviceClient = serviceClient; - } - - /** - * The withQuery operation. - *

Query Parameters

- * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
formatStringNoThe format parameter
- * You can add these to a request with {@link RequestOptions#addQueryParam} - * - * @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 withQueryWithResponse(RequestOptions requestOptions) { - return this.serviceClient.withQueryWithResponse(requestOptions); - } - - /** - * The getStandalone operation. - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     name: String (Required)
-     *     size: long (Required)
-     *     contentType: String (Required)
-     *     createdOn: OffsetDateTime (Required)
-     * }
-     * }
-     * 
- * - * @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 properties of a blob along with {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getStandaloneWithResponse(RequestOptions requestOptions) { - return this.serviceClient.getStandaloneWithResponse(requestOptions); - } - - /** - * The deleteStandalone 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 deleteStandaloneWithResponse(RequestOptions requestOptions) { - return this.serviceClient.deleteStandaloneWithResponse(requestOptions); - } - - /** - * The withQuery operation. - * - * @param format The format 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. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public void withQuery(String format) { - // Generated convenience method for withQueryWithResponse - RequestOptions requestOptions = new RequestOptions(); - if (format != null) { - requestOptions.addQueryParam("format", format, false); - } - withQueryWithResponse(requestOptions).getValue(); - } - - /** - * The withQuery 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 withQuery() { - // Generated convenience method for withQueryWithResponse - RequestOptions requestOptions = new RequestOptions(); - withQueryWithResponse(requestOptions).getValue(); - } - - /** - * The getStandalone 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 properties of a blob. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public BlobProperties getStandalone() { - // Generated convenience method for getStandaloneWithResponse - RequestOptions requestOptions = new RequestOptions(); - return getStandaloneWithResponse(requestOptions).getValue().toObject(BlobProperties.class); - } - - /** - * The deleteStandalone 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 deleteStandalone() { - // Generated convenience method for deleteStandaloneWithResponse - RequestOptions requestOptions = new RequestOptions(); - deleteStandaloneWithResponse(requestOptions).getValue(); - } -} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyparentclient/IndividuallyParentNestedWithQueryClientBuilder.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyparentclient/IndividuallyParentNestedWithQueryClientBuilder.java deleted file mode 100644 index 2534362896a..00000000000 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyparentclient/IndividuallyParentNestedWithQueryClientBuilder.java +++ /dev/null @@ -1,312 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package _specs_.azure.clientgenerator.core.clientinitialization.individuallyparentclient; - -import _specs_.azure.clientgenerator.core.clientinitialization.individuallyparentclient.implementation.IndividuallyParentNestedWithQueryClientImpl; -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.HttpLogOptions; -import com.azure.core.http.policy.HttpLoggingPolicy; -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 java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.Objects; - -/** - * A builder for creating a new instance of the IndividuallyParentNestedWithQueryClient type. - */ -@ServiceClientBuilder( - serviceClients = { - IndividuallyParentNestedWithQueryClient.class, - IndividuallyParentNestedWithQueryAsyncClient.class }) -public final class IndividuallyParentNestedWithQueryClientBuilder - 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("_specs_-azure-clientgenerator-core-clientinitialization-individuallyparentclient.properties"); - - @Generated - private final List pipelinePolicies; - - /** - * Create an instance of the IndividuallyParentNestedWithQueryClientBuilder. - */ - @Generated - public IndividuallyParentNestedWithQueryClientBuilder() { - this.pipelinePolicies = new ArrayList<>(); - } - - /* - * The HTTP client used to send the request. - */ - @Generated - private HttpClient httpClient; - - /** - * {@inheritDoc}. - */ - @Generated - @Override - public IndividuallyParentNestedWithQueryClientBuilder httpClient(HttpClient httpClient) { - this.httpClient = httpClient; - return this; - } - - /* - * The HTTP pipeline to send requests through. - */ - @Generated - private HttpPipeline pipeline; - - /** - * {@inheritDoc}. - */ - @Generated - @Override - public IndividuallyParentNestedWithQueryClientBuilder 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 logging configuration for HTTP requests and responses. - */ - @Generated - private HttpLogOptions httpLogOptions; - - /** - * {@inheritDoc}. - */ - @Generated - @Override - public IndividuallyParentNestedWithQueryClientBuilder 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 IndividuallyParentNestedWithQueryClientBuilder 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 IndividuallyParentNestedWithQueryClientBuilder retryOptions(RetryOptions retryOptions) { - this.retryOptions = retryOptions; - return this; - } - - /** - * {@inheritDoc}. - */ - @Generated - @Override - public IndividuallyParentNestedWithQueryClientBuilder 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 IndividuallyParentNestedWithQueryClientBuilder configuration(Configuration configuration) { - this.configuration = configuration; - return this; - } - - /* - * The service endpoint - */ - @Generated - private String endpoint; - - /** - * {@inheritDoc}. - */ - @Generated - @Override - public IndividuallyParentNestedWithQueryClientBuilder endpoint(String endpoint) { - this.endpoint = endpoint; - return this; - } - - /* - * - */ - @Generated - private String blobName; - - /** - * Sets. - * - * @param blobName the blobName value. - * @return the IndividuallyParentNestedWithQueryClientBuilder. - */ - @Generated - public IndividuallyParentNestedWithQueryClientBuilder blobName(String blobName) { - this.blobName = blobName; - 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 IndividuallyParentNestedWithQueryClientBuilder. - */ - @Generated - public IndividuallyParentNestedWithQueryClientBuilder retryPolicy(RetryPolicy retryPolicy) { - this.retryPolicy = retryPolicy; - return this; - } - - /** - * Builds an instance of IndividuallyParentNestedWithQueryClientImpl with the provided parameters. - * - * @return an instance of IndividuallyParentNestedWithQueryClientImpl. - */ - @Generated - private IndividuallyParentNestedWithQueryClientImpl buildInnerClient() { - this.validateClient(); - HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); - String localEndpoint = (endpoint != null) ? endpoint : "http://localhost:3000"; - IndividuallyParentNestedWithQueryClientImpl client = new IndividuallyParentNestedWithQueryClientImpl( - localPipeline, JacksonAdapter.createDefaultSerializerAdapter(), localEndpoint, this.blobName); - 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(blobName, "'blobName' 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 IndividuallyParentNestedWithQueryAsyncClient class. - * - * @return an instance of IndividuallyParentNestedWithQueryAsyncClient. - */ - @Generated - public IndividuallyParentNestedWithQueryAsyncClient buildAsyncClient() { - return new IndividuallyParentNestedWithQueryAsyncClient(buildInnerClient()); - } - - /** - * Builds an instance of IndividuallyParentNestedWithQueryClient class. - * - * @return an instance of IndividuallyParentNestedWithQueryClient. - */ - @Generated - public IndividuallyParentNestedWithQueryClient buildClient() { - return new IndividuallyParentNestedWithQueryClient(buildInnerClient()); - } - - private static final ClientLogger LOGGER = new ClientLogger(IndividuallyParentNestedWithQueryClientBuilder.class); -} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyparentclient/implementation/IndividuallyParentClientImpl.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyparentclient/implementation/IndividuallyParentClientImpl.java deleted file mode 100644 index e5ac51fd7ff..00000000000 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyparentclient/implementation/IndividuallyParentClientImpl.java +++ /dev/null @@ -1,166 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package _specs_.azure.clientgenerator.core.clientinitialization.individuallyparentclient.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; -import java.util.Objects; - -/** - * Initializes a new instance of the IndividuallyParentClient type. - */ -public final class IndividuallyParentClientImpl { - /** - * 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. - */ - 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; - } - - /** - * Initializes an instance of IndividuallyParentClient client. - * - * @param endpoint Service host. - */ - public IndividuallyParentClientImpl(String endpoint) { - this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), - JacksonAdapter.createDefaultSerializerAdapter(), endpoint); - } - - /** - * Initializes an instance of IndividuallyParentClient client. - * - * @param httpPipeline The HTTP pipeline to send requests through. - * @param endpoint Service host. - */ - public IndividuallyParentClientImpl(HttpPipeline httpPipeline, String endpoint) { - this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint); - } - - /** - * Initializes an instance of IndividuallyParentClient client. - * - * @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 IndividuallyParentClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, - String endpoint) { - this.httpPipeline = httpPipeline; - this.serializerAdapter = serializerAdapter; - this.endpoint = endpoint; - } - - /** - * Gets an instance of IndividuallyParentNestedWithPathClientImpl class. - * - * @param blobName The blobName parameter. - * @return an instance of IndividuallyParentNestedWithPathClientImpl class. - */ - public IndividuallyParentNestedWithPathClientImpl getIndividuallyParentNestedWithPathClient(String blobName) { - Objects.requireNonNull(blobName, "'blobName' cannot be null."); - return new IndividuallyParentNestedWithPathClientImpl(httpPipeline, serializerAdapter, endpoint, blobName); - } - - /** - * Gets an instance of IndividuallyParentNestedWithQueryClientImpl class. - * - * @param blobName The blobName parameter. - * @return an instance of IndividuallyParentNestedWithQueryClientImpl class. - */ - public IndividuallyParentNestedWithQueryClientImpl getIndividuallyParentNestedWithQueryClient(String blobName) { - Objects.requireNonNull(blobName, "'blobName' cannot be null."); - return new IndividuallyParentNestedWithQueryClientImpl(httpPipeline, serializerAdapter, endpoint, blobName); - } - - /** - * Gets an instance of IndividuallyParentNestedWithHeaderClientImpl class. - * - * @param name The name parameter. - * @return an instance of IndividuallyParentNestedWithHeaderClientImpl class. - */ - public IndividuallyParentNestedWithHeaderClientImpl getIndividuallyParentNestedWithHeaderClient(String name) { - Objects.requireNonNull(name, "'name' cannot be null."); - return new IndividuallyParentNestedWithHeaderClientImpl(httpPipeline, serializerAdapter, endpoint, name); - } - - /** - * Gets an instance of IndividuallyParentNestedWithMultipleClientImpl class. - * - * @param name The name parameter. - * @param region The region parameter. - * @return an instance of IndividuallyParentNestedWithMultipleClientImpl class. - */ - public IndividuallyParentNestedWithMultipleClientImpl getIndividuallyParentNestedWithMultipleClient(String name, - String region) { - Objects.requireNonNull(name, "'name' cannot be null."); - Objects.requireNonNull(region, "'region' cannot be null."); - return new IndividuallyParentNestedWithMultipleClientImpl(httpPipeline, serializerAdapter, endpoint, name, - region); - } - - /** - * Gets an instance of IndividuallyParentNestedWithMixedClientImpl class. - * - * @param name The name parameter. - * @return an instance of IndividuallyParentNestedWithMixedClientImpl class. - */ - public IndividuallyParentNestedWithMixedClientImpl getIndividuallyParentNestedWithMixedClient(String name) { - Objects.requireNonNull(name, "'name' cannot be null."); - return new IndividuallyParentNestedWithMixedClientImpl(httpPipeline, serializerAdapter, endpoint, name); - } - - /** - * Gets an instance of IndividuallyParentNestedWithParamAliasClientImpl class. - * - * @param blobName The blobName parameter. - * @return an instance of IndividuallyParentNestedWithParamAliasClientImpl class. - */ - public IndividuallyParentNestedWithParamAliasClientImpl - getIndividuallyParentNestedWithParamAliasClient(String blobName) { - Objects.requireNonNull(blobName, "'blobName' cannot be null."); - return new IndividuallyParentNestedWithParamAliasClientImpl(httpPipeline, serializerAdapter, endpoint, - blobName); - } -} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyparentclient/implementation/IndividuallyParentNestedWithHeaderClientImpl.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyparentclient/implementation/IndividuallyParentNestedWithHeaderClientImpl.java deleted file mode 100644 index c9749079256..00000000000 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyparentclient/implementation/IndividuallyParentNestedWithHeaderClientImpl.java +++ /dev/null @@ -1,306 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package _specs_.azure.clientgenerator.core.clientinitialization.individuallyparentclient.implementation; - -import com.azure.core.annotation.Delete; -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.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.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.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 com.azure.core.util.serializer.JacksonAdapter; -import com.azure.core.util.serializer.SerializerAdapter; -import reactor.core.publisher.Mono; - -/** - * Initializes a new instance of the IndividuallyParentNestedWithHeaderClient type. - */ -public final class IndividuallyParentNestedWithHeaderClientImpl { - /** - * The proxy service used to perform REST calls. - */ - private final IndividuallyParentNestedWithHeaderClientService service; - - /** - * Service host. - */ - private final String endpoint; - - /** - * Gets Service host. - * - * @return the endpoint value. - */ - public String getEndpoint() { - return this.endpoint; - } - - /** - */ - private final String name; - - /** - * Gets. - * - * @return the name value. - */ - public String getName() { - return this.name; - } - - /** - * 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; - } - - /** - * Initializes an instance of IndividuallyParentNestedWithHeaderClient client. - * - * @param endpoint Service host. - * @param name - */ - public IndividuallyParentNestedWithHeaderClientImpl(String endpoint, String name) { - this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), - JacksonAdapter.createDefaultSerializerAdapter(), endpoint, name); - } - - /** - * Initializes an instance of IndividuallyParentNestedWithHeaderClient client. - * - * @param httpPipeline The HTTP pipeline to send requests through. - * @param endpoint Service host. - * @param name - */ - public IndividuallyParentNestedWithHeaderClientImpl(HttpPipeline httpPipeline, String endpoint, String name) { - this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint, name); - } - - /** - * Initializes an instance of IndividuallyParentNestedWithHeaderClient client. - * - * @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 name - */ - public IndividuallyParentNestedWithHeaderClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, - String endpoint, String name) { - this.httpPipeline = httpPipeline; - this.serializerAdapter = serializerAdapter; - this.endpoint = endpoint; - this.name = name; - this.service = RestProxy.create(IndividuallyParentNestedWithHeaderClientService.class, this.httpPipeline, - this.getSerializerAdapter()); - } - - /** - * The interface defining all the services for IndividuallyParentNestedWithHeaderClient to be used by the proxy - * service to perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "IndividuallyParentNestedWithHeaderClient") - public interface IndividuallyParentNestedWithHeaderClientService { - @Get("/azure/client-generator-core/client-initialization/individually-parent/nested-default-individually-parent-header/with-query") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withQuery(@HostParam("endpoint") String endpoint, @HeaderParam("name") String name, - RequestOptions requestOptions, Context context); - - @Get("/azure/client-generator-core/client-initialization/individually-parent/nested-default-individually-parent-header/with-query") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withQuerySync(@HostParam("endpoint") String endpoint, @HeaderParam("name") String name, - RequestOptions requestOptions, Context context); - - @Get("/azure/client-generator-core/client-initialization/individually-parent/nested-default-individually-parent-header/get-standalone") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getStandalone(@HostParam("endpoint") String endpoint, @HeaderParam("name") String name, - RequestOptions requestOptions, Context context); - - @Get("/azure/client-generator-core/client-initialization/individually-parent/nested-default-individually-parent-header/get-standalone") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getStandaloneSync(@HostParam("endpoint") String endpoint, @HeaderParam("name") String name, - RequestOptions requestOptions, Context context); - - @Delete("/azure/client-generator-core/client-initialization/individually-parent/nested-default-individually-parent-header/delete-standalone") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> deleteStandalone(@HostParam("endpoint") String endpoint, @HeaderParam("name") String name, - RequestOptions requestOptions, Context context); - - @Delete("/azure/client-generator-core/client-initialization/individually-parent/nested-default-individually-parent-header/delete-standalone") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Response deleteStandaloneSync(@HostParam("endpoint") String endpoint, @HeaderParam("name") String name, - RequestOptions requestOptions, Context context); - } - - /** - * The withQuery operation. - *

Query Parameters

- * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
formatStringNoThe format parameter
- * You can add these to a request with {@link RequestOptions#addQueryParam} - * - * @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> withQueryWithResponseAsync(RequestOptions requestOptions) { - return FluxUtil - .withContext(context -> service.withQuery(this.getEndpoint(), this.getName(), requestOptions, context)); - } - - /** - * The withQuery operation. - *

Query Parameters

- * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
formatStringNoThe format parameter
- * You can add these to a request with {@link RequestOptions#addQueryParam} - * - * @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 withQueryWithResponse(RequestOptions requestOptions) { - return service.withQuerySync(this.getEndpoint(), this.getName(), requestOptions, Context.NONE); - } - - /** - * The getStandalone 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> getStandaloneWithResponseAsync(RequestOptions requestOptions) { - return FluxUtil - .withContext(context -> service.getStandalone(this.getEndpoint(), this.getName(), requestOptions, context)); - } - - /** - * The getStandalone 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 getStandaloneWithResponse(RequestOptions requestOptions) { - return service.getStandaloneSync(this.getEndpoint(), this.getName(), requestOptions, Context.NONE); - } - - /** - * The deleteStandalone 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> deleteStandaloneWithResponseAsync(RequestOptions requestOptions) { - return FluxUtil.withContext( - context -> service.deleteStandalone(this.getEndpoint(), this.getName(), requestOptions, context)); - } - - /** - * The deleteStandalone 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 deleteStandaloneWithResponse(RequestOptions requestOptions) { - return service.deleteStandaloneSync(this.getEndpoint(), this.getName(), requestOptions, Context.NONE); - } -} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyparentclient/implementation/IndividuallyParentNestedWithMixedClientImpl.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyparentclient/implementation/IndividuallyParentNestedWithMixedClientImpl.java deleted file mode 100644 index efb36a71a1d..00000000000 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyparentclient/implementation/IndividuallyParentNestedWithMixedClientImpl.java +++ /dev/null @@ -1,313 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package _specs_.azure.clientgenerator.core.clientinitialization.individuallyparentclient.implementation; - -import com.azure.core.annotation.Delete; -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.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.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.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 com.azure.core.util.serializer.JacksonAdapter; -import com.azure.core.util.serializer.SerializerAdapter; -import reactor.core.publisher.Mono; - -/** - * Initializes a new instance of the IndividuallyParentNestedWithMixedClient type. - */ -public final class IndividuallyParentNestedWithMixedClientImpl { - /** - * The proxy service used to perform REST calls. - */ - private final IndividuallyParentNestedWithMixedClientService service; - - /** - * Service host. - */ - private final String endpoint; - - /** - * Gets Service host. - * - * @return the endpoint value. - */ - public String getEndpoint() { - return this.endpoint; - } - - /** - */ - private final String name; - - /** - * Gets. - * - * @return the name value. - */ - public String getName() { - return this.name; - } - - /** - * 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; - } - - /** - * Initializes an instance of IndividuallyParentNestedWithMixedClient client. - * - * @param endpoint Service host. - * @param name - */ - public IndividuallyParentNestedWithMixedClientImpl(String endpoint, String name) { - this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), - JacksonAdapter.createDefaultSerializerAdapter(), endpoint, name); - } - - /** - * Initializes an instance of IndividuallyParentNestedWithMixedClient client. - * - * @param httpPipeline The HTTP pipeline to send requests through. - * @param endpoint Service host. - * @param name - */ - public IndividuallyParentNestedWithMixedClientImpl(HttpPipeline httpPipeline, String endpoint, String name) { - this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint, name); - } - - /** - * Initializes an instance of IndividuallyParentNestedWithMixedClient client. - * - * @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 name - */ - public IndividuallyParentNestedWithMixedClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, - String endpoint, String name) { - this.httpPipeline = httpPipeline; - this.serializerAdapter = serializerAdapter; - this.endpoint = endpoint; - this.name = name; - this.service = RestProxy.create(IndividuallyParentNestedWithMixedClientService.class, this.httpPipeline, - this.getSerializerAdapter()); - } - - /** - * The interface defining all the services for IndividuallyParentNestedWithMixedClient to be used by the proxy - * service to perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "IndividuallyParentNestedWithMixedClient") - public interface IndividuallyParentNestedWithMixedClientService { - @Get("/azure/client-generator-core/client-initialization/individually-parent/nested-default-individually-parent-mixed/with-query") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withQuery(@HostParam("endpoint") String endpoint, @HeaderParam("name") String name, - @QueryParam("region") String region, RequestOptions requestOptions, Context context); - - @Get("/azure/client-generator-core/client-initialization/individually-parent/nested-default-individually-parent-mixed/with-query") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withQuerySync(@HostParam("endpoint") String endpoint, @HeaderParam("name") String name, - @QueryParam("region") String region, RequestOptions requestOptions, Context context); - - @Get("/azure/client-generator-core/client-initialization/individually-parent/nested-default-individually-parent-mixed/get-standalone") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getStandalone(@HostParam("endpoint") String endpoint, @HeaderParam("name") String name, - @QueryParam("region") String region, RequestOptions requestOptions, Context context); - - @Get("/azure/client-generator-core/client-initialization/individually-parent/nested-default-individually-parent-mixed/get-standalone") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getStandaloneSync(@HostParam("endpoint") String endpoint, @HeaderParam("name") String name, - @QueryParam("region") String region, RequestOptions requestOptions, Context context); - - @Delete("/azure/client-generator-core/client-initialization/individually-parent/nested-default-individually-parent-mixed/delete-standalone") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> deleteStandalone(@HostParam("endpoint") String endpoint, @HeaderParam("name") String name, - @QueryParam("region") String region, RequestOptions requestOptions, Context context); - - @Delete("/azure/client-generator-core/client-initialization/individually-parent/nested-default-individually-parent-mixed/delete-standalone") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Response deleteStandaloneSync(@HostParam("endpoint") String endpoint, @HeaderParam("name") String name, - @QueryParam("region") String region, RequestOptions requestOptions, Context context); - } - - /** - * The withQuery operation. - *

Query Parameters

- * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
formatStringNoThe format parameter
- * You can add these to a request with {@link RequestOptions#addQueryParam} - * - * @param region The region 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 {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> withQueryWithResponseAsync(String region, RequestOptions requestOptions) { - return FluxUtil.withContext( - context -> service.withQuery(this.getEndpoint(), this.getName(), region, requestOptions, context)); - } - - /** - * The withQuery operation. - *

Query Parameters

- * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
formatStringNoThe format parameter
- * You can add these to a request with {@link RequestOptions#addQueryParam} - * - * @param region The region 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 {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response withQueryWithResponse(String region, RequestOptions requestOptions) { - return service.withQuerySync(this.getEndpoint(), this.getName(), region, requestOptions, Context.NONE); - } - - /** - * The getStandalone operation. - * - * @param region The region 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 {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getStandaloneWithResponseAsync(String region, RequestOptions requestOptions) { - return FluxUtil.withContext( - context -> service.getStandalone(this.getEndpoint(), this.getName(), region, requestOptions, context)); - } - - /** - * The getStandalone operation. - * - * @param region The region 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 {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getStandaloneWithResponse(String region, RequestOptions requestOptions) { - return service.getStandaloneSync(this.getEndpoint(), this.getName(), region, requestOptions, Context.NONE); - } - - /** - * The deleteStandalone operation. - * - * @param region The region 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 {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteStandaloneWithResponseAsync(String region, RequestOptions requestOptions) { - return FluxUtil.withContext( - context -> service.deleteStandalone(this.getEndpoint(), this.getName(), region, requestOptions, context)); - } - - /** - * The deleteStandalone operation. - * - * @param region The region 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 {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteStandaloneWithResponse(String region, RequestOptions requestOptions) { - return service.deleteStandaloneSync(this.getEndpoint(), this.getName(), region, requestOptions, Context.NONE); - } -} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyparentclient/implementation/IndividuallyParentNestedWithMultipleClientImpl.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyparentclient/implementation/IndividuallyParentNestedWithMultipleClientImpl.java deleted file mode 100644 index 3127e122df8..00000000000 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyparentclient/implementation/IndividuallyParentNestedWithMultipleClientImpl.java +++ /dev/null @@ -1,328 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package _specs_.azure.clientgenerator.core.clientinitialization.individuallyparentclient.implementation; - -import com.azure.core.annotation.Delete; -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.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.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.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 com.azure.core.util.serializer.JacksonAdapter; -import com.azure.core.util.serializer.SerializerAdapter; -import reactor.core.publisher.Mono; - -/** - * Initializes a new instance of the IndividuallyParentNestedWithMultipleClient type. - */ -public final class IndividuallyParentNestedWithMultipleClientImpl { - /** - * The proxy service used to perform REST calls. - */ - private final IndividuallyParentNestedWithMultipleClientService service; - - /** - * Service host. - */ - private final String endpoint; - - /** - * Gets Service host. - * - * @return the endpoint value. - */ - public String getEndpoint() { - return this.endpoint; - } - - /** - */ - private final String name; - - /** - * Gets. - * - * @return the name value. - */ - public String getName() { - return this.name; - } - - /** - */ - private final String region; - - /** - * Gets. - * - * @return the region value. - */ - public String getRegion() { - return this.region; - } - - /** - * 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; - } - - /** - * Initializes an instance of IndividuallyParentNestedWithMultipleClient client. - * - * @param endpoint Service host. - * @param name - * @param region - */ - public IndividuallyParentNestedWithMultipleClientImpl(String endpoint, String name, String region) { - this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), - JacksonAdapter.createDefaultSerializerAdapter(), endpoint, name, region); - } - - /** - * Initializes an instance of IndividuallyParentNestedWithMultipleClient client. - * - * @param httpPipeline The HTTP pipeline to send requests through. - * @param endpoint Service host. - * @param name - * @param region - */ - public IndividuallyParentNestedWithMultipleClientImpl(HttpPipeline httpPipeline, String endpoint, String name, - String region) { - this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint, name, region); - } - - /** - * Initializes an instance of IndividuallyParentNestedWithMultipleClient client. - * - * @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 name - * @param region - */ - public IndividuallyParentNestedWithMultipleClientImpl(HttpPipeline httpPipeline, - SerializerAdapter serializerAdapter, String endpoint, String name, String region) { - this.httpPipeline = httpPipeline; - this.serializerAdapter = serializerAdapter; - this.endpoint = endpoint; - this.name = name; - this.region = region; - this.service = RestProxy.create(IndividuallyParentNestedWithMultipleClientService.class, this.httpPipeline, - this.getSerializerAdapter()); - } - - /** - * The interface defining all the services for IndividuallyParentNestedWithMultipleClient to be used by the proxy - * service to perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "IndividuallyParentNestedWithMultipleClient") - public interface IndividuallyParentNestedWithMultipleClientService { - @Get("/azure/client-generator-core/client-initialization/individually-parent/nested-default-individually-parent-multiple/with-query") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withQuery(@HostParam("endpoint") String endpoint, @HeaderParam("name") String name, - @QueryParam("region") String region, RequestOptions requestOptions, Context context); - - @Get("/azure/client-generator-core/client-initialization/individually-parent/nested-default-individually-parent-multiple/with-query") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withQuerySync(@HostParam("endpoint") String endpoint, @HeaderParam("name") String name, - @QueryParam("region") String region, RequestOptions requestOptions, Context context); - - @Get("/azure/client-generator-core/client-initialization/individually-parent/nested-default-individually-parent-multiple/get-standalone") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getStandalone(@HostParam("endpoint") String endpoint, @HeaderParam("name") String name, - @QueryParam("region") String region, RequestOptions requestOptions, Context context); - - @Get("/azure/client-generator-core/client-initialization/individually-parent/nested-default-individually-parent-multiple/get-standalone") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getStandaloneSync(@HostParam("endpoint") String endpoint, @HeaderParam("name") String name, - @QueryParam("region") String region, RequestOptions requestOptions, Context context); - - @Delete("/azure/client-generator-core/client-initialization/individually-parent/nested-default-individually-parent-multiple/delete-standalone") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> deleteStandalone(@HostParam("endpoint") String endpoint, @HeaderParam("name") String name, - @QueryParam("region") String region, RequestOptions requestOptions, Context context); - - @Delete("/azure/client-generator-core/client-initialization/individually-parent/nested-default-individually-parent-multiple/delete-standalone") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Response deleteStandaloneSync(@HostParam("endpoint") String endpoint, @HeaderParam("name") String name, - @QueryParam("region") String region, RequestOptions requestOptions, Context context); - } - - /** - * The withQuery operation. - *

Query Parameters

- * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
formatStringNoThe format parameter
- * You can add these to a request with {@link RequestOptions#addQueryParam} - * - * @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> withQueryWithResponseAsync(RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.withQuery(this.getEndpoint(), this.getName(), this.getRegion(), - requestOptions, context)); - } - - /** - * The withQuery operation. - *

Query Parameters

- * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
formatStringNoThe format parameter
- * You can add these to a request with {@link RequestOptions#addQueryParam} - * - * @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 withQueryWithResponse(RequestOptions requestOptions) { - return service.withQuerySync(this.getEndpoint(), this.getName(), this.getRegion(), requestOptions, - Context.NONE); - } - - /** - * The getStandalone 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> getStandaloneWithResponseAsync(RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.getStandalone(this.getEndpoint(), this.getName(), - this.getRegion(), requestOptions, context)); - } - - /** - * The getStandalone 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 getStandaloneWithResponse(RequestOptions requestOptions) { - return service.getStandaloneSync(this.getEndpoint(), this.getName(), this.getRegion(), requestOptions, - Context.NONE); - } - - /** - * The deleteStandalone 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> deleteStandaloneWithResponseAsync(RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.deleteStandalone(this.getEndpoint(), this.getName(), - this.getRegion(), requestOptions, context)); - } - - /** - * The deleteStandalone 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 deleteStandaloneWithResponse(RequestOptions requestOptions) { - return service.deleteStandaloneSync(this.getEndpoint(), this.getName(), this.getRegion(), requestOptions, - Context.NONE); - } -} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyparentclient/implementation/IndividuallyParentNestedWithParamAliasClientImpl.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyparentclient/implementation/IndividuallyParentNestedWithParamAliasClientImpl.java deleted file mode 100644 index c45bcc7fe62..00000000000 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyparentclient/implementation/IndividuallyParentNestedWithParamAliasClientImpl.java +++ /dev/null @@ -1,243 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package _specs_.azure.clientgenerator.core.clientinitialization.individuallyparentclient.implementation; - -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.PathParam; -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.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.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 com.azure.core.util.serializer.JacksonAdapter; -import com.azure.core.util.serializer.SerializerAdapter; -import reactor.core.publisher.Mono; - -/** - * Initializes a new instance of the IndividuallyParentNestedWithParamAliasClient type. - */ -public final class IndividuallyParentNestedWithParamAliasClientImpl { - /** - * The proxy service used to perform REST calls. - */ - private final IndividuallyParentNestedWithParamAliasClientService service; - - /** - * Service host. - */ - private final String endpoint; - - /** - * Gets Service host. - * - * @return the endpoint value. - */ - public String getEndpoint() { - return this.endpoint; - } - - /** - */ - private final String blobName; - - /** - * Gets. - * - * @return the blobName value. - */ - public String getBlobName() { - return this.blobName; - } - - /** - * 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; - } - - /** - * Initializes an instance of IndividuallyParentNestedWithParamAliasClient client. - * - * @param endpoint Service host. - * @param blobName - */ - public IndividuallyParentNestedWithParamAliasClientImpl(String endpoint, String blobName) { - this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), - JacksonAdapter.createDefaultSerializerAdapter(), endpoint, blobName); - } - - /** - * Initializes an instance of IndividuallyParentNestedWithParamAliasClient client. - * - * @param httpPipeline The HTTP pipeline to send requests through. - * @param endpoint Service host. - * @param blobName - */ - public IndividuallyParentNestedWithParamAliasClientImpl(HttpPipeline httpPipeline, String endpoint, - String blobName) { - this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint, blobName); - } - - /** - * Initializes an instance of IndividuallyParentNestedWithParamAliasClient client. - * - * @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 blobName - */ - public IndividuallyParentNestedWithParamAliasClientImpl(HttpPipeline httpPipeline, - SerializerAdapter serializerAdapter, String endpoint, String blobName) { - this.httpPipeline = httpPipeline; - this.serializerAdapter = serializerAdapter; - this.endpoint = endpoint; - this.blobName = blobName; - this.service = RestProxy.create(IndividuallyParentNestedWithParamAliasClientService.class, this.httpPipeline, - this.getSerializerAdapter()); - } - - /** - * The interface defining all the services for IndividuallyParentNestedWithParamAliasClient to be used by the proxy - * service to perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "IndividuallyParentNestedWithParamAliasClient") - public interface IndividuallyParentNestedWithParamAliasClientService { - @Get("/azure/client-generator-core/client-initialization/individually-parent/nested-default-individually-parent-param-alias/{blob}/with-aliased-name") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withAliasedName(@HostParam("endpoint") String endpoint, @PathParam("blob") String blobName, - RequestOptions requestOptions, Context context); - - @Get("/azure/client-generator-core/client-initialization/individually-parent/nested-default-individually-parent-param-alias/{blob}/with-aliased-name") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withAliasedNameSync(@HostParam("endpoint") String endpoint, @PathParam("blob") String blobName, - RequestOptions requestOptions, Context context); - - @Get("/azure/client-generator-core/client-initialization/individually-parent/nested-default-individually-parent-param-alias/{blobName}/with-original-name") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withOriginalName(@HostParam("endpoint") String endpoint, - @PathParam("blobName") String blobName, RequestOptions requestOptions, Context context); - - @Get("/azure/client-generator-core/client-initialization/individually-parent/nested-default-individually-parent-param-alias/{blobName}/with-original-name") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withOriginalNameSync(@HostParam("endpoint") String endpoint, - @PathParam("blobName") String blobName, RequestOptions requestOptions, Context context); - } - - /** - * The withAliasedName 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> withAliasedNameWithResponseAsync(RequestOptions requestOptions) { - return FluxUtil.withContext( - context -> service.withAliasedName(this.getEndpoint(), this.getBlobName(), requestOptions, context)); - } - - /** - * The withAliasedName 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 withAliasedNameWithResponse(RequestOptions requestOptions) { - return service.withAliasedNameSync(this.getEndpoint(), this.getBlobName(), requestOptions, Context.NONE); - } - - /** - * The withOriginalName 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> withOriginalNameWithResponseAsync(RequestOptions requestOptions) { - return FluxUtil.withContext( - context -> service.withOriginalName(this.getEndpoint(), this.getBlobName(), requestOptions, context)); - } - - /** - * The withOriginalName 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 withOriginalNameWithResponse(RequestOptions requestOptions) { - return service.withOriginalNameSync(this.getEndpoint(), this.getBlobName(), requestOptions, Context.NONE); - } -} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyparentclient/implementation/IndividuallyParentNestedWithPathClientImpl.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyparentclient/implementation/IndividuallyParentNestedWithPathClientImpl.java deleted file mode 100644 index bcf99fe6094..00000000000 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyparentclient/implementation/IndividuallyParentNestedWithPathClientImpl.java +++ /dev/null @@ -1,336 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package _specs_.azure.clientgenerator.core.clientinitialization.individuallyparentclient.implementation; - -import com.azure.core.annotation.Delete; -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; -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.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.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 com.azure.core.util.serializer.JacksonAdapter; -import com.azure.core.util.serializer.SerializerAdapter; -import reactor.core.publisher.Mono; - -/** - * Initializes a new instance of the IndividuallyParentNestedWithPathClient type. - */ -public final class IndividuallyParentNestedWithPathClientImpl { - /** - * The proxy service used to perform REST calls. - */ - private final IndividuallyParentNestedWithPathClientService service; - - /** - * Service host. - */ - private final String endpoint; - - /** - * Gets Service host. - * - * @return the endpoint value. - */ - public String getEndpoint() { - return this.endpoint; - } - - /** - */ - private final String blobName; - - /** - * Gets. - * - * @return the blobName value. - */ - public String getBlobName() { - return this.blobName; - } - - /** - * 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; - } - - /** - * Initializes an instance of IndividuallyParentNestedWithPathClient client. - * - * @param endpoint Service host. - * @param blobName - */ - public IndividuallyParentNestedWithPathClientImpl(String endpoint, String blobName) { - this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), - JacksonAdapter.createDefaultSerializerAdapter(), endpoint, blobName); - } - - /** - * Initializes an instance of IndividuallyParentNestedWithPathClient client. - * - * @param httpPipeline The HTTP pipeline to send requests through. - * @param endpoint Service host. - * @param blobName - */ - public IndividuallyParentNestedWithPathClientImpl(HttpPipeline httpPipeline, String endpoint, String blobName) { - this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint, blobName); - } - - /** - * Initializes an instance of IndividuallyParentNestedWithPathClient client. - * - * @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 blobName - */ - public IndividuallyParentNestedWithPathClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, - String endpoint, String blobName) { - this.httpPipeline = httpPipeline; - this.serializerAdapter = serializerAdapter; - this.endpoint = endpoint; - this.blobName = blobName; - this.service = RestProxy.create(IndividuallyParentNestedWithPathClientService.class, this.httpPipeline, - this.getSerializerAdapter()); - } - - /** - * The interface defining all the services for IndividuallyParentNestedWithPathClient to be used by the proxy - * service to perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "IndividuallyParentNestedWithPathClient") - public interface IndividuallyParentNestedWithPathClientService { - @Get("/azure/client-generator-core/client-initialization/individually-parent/nested-default-individually-parent/{blobName}/with-query") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withQuery(@HostParam("endpoint") String endpoint, @PathParam("blobName") String blobName, - RequestOptions requestOptions, Context context); - - @Get("/azure/client-generator-core/client-initialization/individually-parent/nested-default-individually-parent/{blobName}/with-query") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withQuerySync(@HostParam("endpoint") String endpoint, @PathParam("blobName") String blobName, - RequestOptions requestOptions, Context context); - - @Get("/azure/client-generator-core/client-initialization/individually-parent/nested-default-individually-parent/{blobName}/get-standalone") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getStandalone(@HostParam("endpoint") String endpoint, - @PathParam("blobName") String blobName, @HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); - - @Get("/azure/client-generator-core/client-initialization/individually-parent/nested-default-individually-parent/{blobName}/get-standalone") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getStandaloneSync(@HostParam("endpoint") String endpoint, - @PathParam("blobName") String blobName, @HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); - - @Delete("/azure/client-generator-core/client-initialization/individually-parent/nested-default-individually-parent/{blobName}") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> deleteStandalone(@HostParam("endpoint") String endpoint, - @PathParam("blobName") String blobName, RequestOptions requestOptions, Context context); - - @Delete("/azure/client-generator-core/client-initialization/individually-parent/nested-default-individually-parent/{blobName}") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Response deleteStandaloneSync(@HostParam("endpoint") String endpoint, - @PathParam("blobName") String blobName, RequestOptions requestOptions, Context context); - } - - /** - * The withQuery operation. - *

Query Parameters

- * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
formatStringNoThe format parameter
- * You can add these to a request with {@link RequestOptions#addQueryParam} - * - * @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> withQueryWithResponseAsync(RequestOptions requestOptions) { - return FluxUtil - .withContext(context -> service.withQuery(this.getEndpoint(), this.getBlobName(), requestOptions, context)); - } - - /** - * The withQuery operation. - *

Query Parameters

- * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
formatStringNoThe format parameter
- * You can add these to a request with {@link RequestOptions#addQueryParam} - * - * @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 withQueryWithResponse(RequestOptions requestOptions) { - return service.withQuerySync(this.getEndpoint(), this.getBlobName(), requestOptions, Context.NONE); - } - - /** - * The getStandalone operation. - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     name: String (Required)
-     *     size: long (Required)
-     *     contentType: String (Required)
-     *     createdOn: OffsetDateTime (Required)
-     * }
-     * }
-     * 
- * - * @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 properties of a blob along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getStandaloneWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.getStandalone(this.getEndpoint(), this.getBlobName(), accept, requestOptions, context)); - } - - /** - * The getStandalone operation. - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     name: String (Required)
-     *     size: long (Required)
-     *     contentType: String (Required)
-     *     createdOn: OffsetDateTime (Required)
-     * }
-     * }
-     * 
- * - * @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 properties of a blob along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getStandaloneWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.getStandaloneSync(this.getEndpoint(), this.getBlobName(), accept, requestOptions, Context.NONE); - } - - /** - * The deleteStandalone 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> deleteStandaloneWithResponseAsync(RequestOptions requestOptions) { - return FluxUtil.withContext( - context -> service.deleteStandalone(this.getEndpoint(), this.getBlobName(), requestOptions, context)); - } - - /** - * The deleteStandalone 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 deleteStandaloneWithResponse(RequestOptions requestOptions) { - return service.deleteStandaloneSync(this.getEndpoint(), this.getBlobName(), requestOptions, Context.NONE); - } -} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyparentclient/implementation/IndividuallyParentNestedWithQueryClientImpl.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyparentclient/implementation/IndividuallyParentNestedWithQueryClientImpl.java deleted file mode 100644 index c66818ef39b..00000000000 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyparentclient/implementation/IndividuallyParentNestedWithQueryClientImpl.java +++ /dev/null @@ -1,336 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package _specs_.azure.clientgenerator.core.clientinitialization.individuallyparentclient.implementation; - -import com.azure.core.annotation.Delete; -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.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.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.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 com.azure.core.util.serializer.JacksonAdapter; -import com.azure.core.util.serializer.SerializerAdapter; -import reactor.core.publisher.Mono; - -/** - * Initializes a new instance of the IndividuallyParentNestedWithQueryClient type. - */ -public final class IndividuallyParentNestedWithQueryClientImpl { - /** - * The proxy service used to perform REST calls. - */ - private final IndividuallyParentNestedWithQueryClientService service; - - /** - * Service host. - */ - private final String endpoint; - - /** - * Gets Service host. - * - * @return the endpoint value. - */ - public String getEndpoint() { - return this.endpoint; - } - - /** - */ - private final String blobName; - - /** - * Gets. - * - * @return the blobName value. - */ - public String getBlobName() { - return this.blobName; - } - - /** - * 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; - } - - /** - * Initializes an instance of IndividuallyParentNestedWithQueryClient client. - * - * @param endpoint Service host. - * @param blobName - */ - public IndividuallyParentNestedWithQueryClientImpl(String endpoint, String blobName) { - this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), - JacksonAdapter.createDefaultSerializerAdapter(), endpoint, blobName); - } - - /** - * Initializes an instance of IndividuallyParentNestedWithQueryClient client. - * - * @param httpPipeline The HTTP pipeline to send requests through. - * @param endpoint Service host. - * @param blobName - */ - public IndividuallyParentNestedWithQueryClientImpl(HttpPipeline httpPipeline, String endpoint, String blobName) { - this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint, blobName); - } - - /** - * Initializes an instance of IndividuallyParentNestedWithQueryClient client. - * - * @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 blobName - */ - public IndividuallyParentNestedWithQueryClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, - String endpoint, String blobName) { - this.httpPipeline = httpPipeline; - this.serializerAdapter = serializerAdapter; - this.endpoint = endpoint; - this.blobName = blobName; - this.service = RestProxy.create(IndividuallyParentNestedWithQueryClientService.class, this.httpPipeline, - this.getSerializerAdapter()); - } - - /** - * The interface defining all the services for IndividuallyParentNestedWithQueryClient to be used by the proxy - * service to perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "IndividuallyParentNestedWithQueryClient") - public interface IndividuallyParentNestedWithQueryClientService { - @Get("/azure/client-generator-core/client-initialization/individually-parent/nested-default-individually-parent-query/with-query") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> withQuery(@HostParam("endpoint") String endpoint, @QueryParam("blobName") String blobName, - RequestOptions requestOptions, Context context); - - @Get("/azure/client-generator-core/client-initialization/individually-parent/nested-default-individually-parent-query/with-query") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Response withQuerySync(@HostParam("endpoint") String endpoint, @QueryParam("blobName") String blobName, - RequestOptions requestOptions, Context context); - - @Get("/azure/client-generator-core/client-initialization/individually-parent/nested-default-individually-parent-query/get-standalone") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getStandalone(@HostParam("endpoint") String endpoint, - @QueryParam("blobName") String blobName, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); - - @Get("/azure/client-generator-core/client-initialization/individually-parent/nested-default-individually-parent-query/get-standalone") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getStandaloneSync(@HostParam("endpoint") String endpoint, - @QueryParam("blobName") String blobName, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); - - @Delete("/azure/client-generator-core/client-initialization/individually-parent/nested-default-individually-parent-query/delete-resource") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> deleteStandalone(@HostParam("endpoint") String endpoint, - @QueryParam("blobName") String blobName, RequestOptions requestOptions, Context context); - - @Delete("/azure/client-generator-core/client-initialization/individually-parent/nested-default-individually-parent-query/delete-resource") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Response deleteStandaloneSync(@HostParam("endpoint") String endpoint, - @QueryParam("blobName") String blobName, RequestOptions requestOptions, Context context); - } - - /** - * The withQuery operation. - *

Query Parameters

- * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
formatStringNoThe format parameter
- * You can add these to a request with {@link RequestOptions#addQueryParam} - * - * @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> withQueryWithResponseAsync(RequestOptions requestOptions) { - return FluxUtil - .withContext(context -> service.withQuery(this.getEndpoint(), this.getBlobName(), requestOptions, context)); - } - - /** - * The withQuery operation. - *

Query Parameters

- * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
formatStringNoThe format parameter
- * You can add these to a request with {@link RequestOptions#addQueryParam} - * - * @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 withQueryWithResponse(RequestOptions requestOptions) { - return service.withQuerySync(this.getEndpoint(), this.getBlobName(), requestOptions, Context.NONE); - } - - /** - * The getStandalone operation. - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     name: String (Required)
-     *     size: long (Required)
-     *     contentType: String (Required)
-     *     createdOn: OffsetDateTime (Required)
-     * }
-     * }
-     * 
- * - * @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 properties of a blob along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getStandaloneWithResponseAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.getStandalone(this.getEndpoint(), this.getBlobName(), accept, requestOptions, context)); - } - - /** - * The getStandalone operation. - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     name: String (Required)
-     *     size: long (Required)
-     *     contentType: String (Required)
-     *     createdOn: OffsetDateTime (Required)
-     * }
-     * }
-     * 
- * - * @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 properties of a blob along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getStandaloneWithResponse(RequestOptions requestOptions) { - final String accept = "application/json"; - return service.getStandaloneSync(this.getEndpoint(), this.getBlobName(), accept, requestOptions, Context.NONE); - } - - /** - * The deleteStandalone 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> deleteStandaloneWithResponseAsync(RequestOptions requestOptions) { - return FluxUtil.withContext( - context -> service.deleteStandalone(this.getEndpoint(), this.getBlobName(), requestOptions, context)); - } - - /** - * The deleteStandalone 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 deleteStandaloneWithResponse(RequestOptions requestOptions) { - return service.deleteStandaloneSync(this.getEndpoint(), this.getBlobName(), requestOptions, Context.NONE); - } -} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyparentclient/implementation/package-info.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyparentclient/implementation/package-info.java deleted file mode 100644 index 38e4e189db6..00000000000 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyparentclient/implementation/package-info.java +++ /dev/null @@ -1,11 +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 IndividuallyParentClient. - * Test for client initialization decorator - moving parameters from method to client level. - * - */ -package _specs_.azure.clientgenerator.core.clientinitialization.individuallyparentclient.implementation; diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyparentclient/models/BlobProperties.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyparentclient/models/BlobProperties.java deleted file mode 100644 index 9896d015b25..00000000000 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyparentclient/models/BlobProperties.java +++ /dev/null @@ -1,154 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package _specs_.azure.clientgenerator.core.clientinitialization.individuallyparentclient.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.OffsetDateTime; -import java.time.format.DateTimeFormatter; - -/** - * Properties of a blob. - */ -@Immutable -public final class BlobProperties implements JsonSerializable { - /* - * The name property. - */ - @Generated - private final String name; - - /* - * The size property. - */ - @Generated - private final long size; - - /* - * The contentType property. - */ - @Generated - private final String contentType; - - /* - * The createdOn property. - */ - @Generated - private final OffsetDateTime createdOn; - - /** - * Creates an instance of BlobProperties class. - * - * @param name the name value to set. - * @param size the size value to set. - * @param contentType the contentType value to set. - * @param createdOn the createdOn value to set. - */ - @Generated - private BlobProperties(String name, long size, String contentType, OffsetDateTime createdOn) { - this.name = name; - this.size = size; - this.contentType = contentType; - this.createdOn = createdOn; - } - - /** - * Get the name property: The name property. - * - * @return the name value. - */ - @Generated - public String getName() { - return this.name; - } - - /** - * Get the size property: The size property. - * - * @return the size value. - */ - @Generated - public long getSize() { - return this.size; - } - - /** - * Get the contentType property: The contentType property. - * - * @return the contentType value. - */ - @Generated - public String getContentType() { - return this.contentType; - } - - /** - * Get the createdOn property: The createdOn property. - * - * @return the createdOn value. - */ - @Generated - public OffsetDateTime getCreatedOn() { - return this.createdOn; - } - - /** - * {@inheritDoc} - */ - @Generated - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("name", this.name); - jsonWriter.writeLongField("size", this.size); - jsonWriter.writeStringField("contentType", this.contentType); - jsonWriter.writeStringField("createdOn", - this.createdOn == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.createdOn)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of BlobProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of BlobProperties 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 BlobProperties. - */ - @Generated - public static BlobProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - String name = null; - long size = 0L; - String contentType = null; - OffsetDateTime createdOn = null; - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("name".equals(fieldName)) { - name = reader.getString(); - } else if ("size".equals(fieldName)) { - size = reader.getLong(); - } else if ("contentType".equals(fieldName)) { - contentType = reader.getString(); - } else if ("createdOn".equals(fieldName)) { - createdOn = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else { - reader.skipChildren(); - } - } - return new BlobProperties(name, size, contentType, createdOn); - }); - } -} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyparentclient/models/package-info.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyparentclient/models/package-info.java deleted file mode 100644 index 0cfc765fd39..00000000000 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyparentclient/models/package-info.java +++ /dev/null @@ -1,11 +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 IndividuallyParentClient. - * Test for client initialization decorator - moving parameters from method to client level. - * - */ -package _specs_.azure.clientgenerator.core.clientinitialization.individuallyparentclient.models; diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyparentclient/package-info.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyparentclient/package-info.java deleted file mode 100644 index d7088f0d782..00000000000 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyparentclient/package-info.java +++ /dev/null @@ -1,11 +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 IndividuallyParentClient. - * Test for client initialization decorator - moving parameters from method to client level. - * - */ -package _specs_.azure.clientgenerator.core.clientinitialization.individuallyparentclient; diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/resources/META-INF/_specs_-azure-clientgenerator-core-clientinitialization-defaultclient_metadata.json b/packages/http-client-java/generator/http-client-generator-test/src/main/resources/META-INF/_specs_-azure-clientgenerator-core-clientinitialization-defaultclient_metadata.json deleted file mode 100644 index 772945b850f..00000000000 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/resources/META-INF/_specs_-azure-clientgenerator-core-clientinitialization-defaultclient_metadata.json +++ /dev/null @@ -1 +0,0 @@ -{"flavor":"Azure","apiVersions":{},"crossLanguageDefinitions":{"_specs_.azure.clientgenerator.core.clientinitialization.defaultclient.HeaderParamAsyncClient":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.DefaultClient.HeaderParam","_specs_.azure.clientgenerator.core.clientinitialization.defaultclient.HeaderParamAsyncClient.withBody":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.DefaultClient.HeaderParam.withBody","_specs_.azure.clientgenerator.core.clientinitialization.defaultclient.HeaderParamAsyncClient.withBodyWithResponse":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.DefaultClient.HeaderParam.withBody","_specs_.azure.clientgenerator.core.clientinitialization.defaultclient.HeaderParamAsyncClient.withQuery":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.DefaultClient.HeaderParam.withQuery","_specs_.azure.clientgenerator.core.clientinitialization.defaultclient.HeaderParamAsyncClient.withQueryWithResponse":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.DefaultClient.HeaderParam.withQuery","_specs_.azure.clientgenerator.core.clientinitialization.defaultclient.HeaderParamClient":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.DefaultClient.HeaderParam","_specs_.azure.clientgenerator.core.clientinitialization.defaultclient.HeaderParamClient.withBody":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.DefaultClient.HeaderParam.withBody","_specs_.azure.clientgenerator.core.clientinitialization.defaultclient.HeaderParamClient.withBodyWithResponse":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.DefaultClient.HeaderParam.withBody","_specs_.azure.clientgenerator.core.clientinitialization.defaultclient.HeaderParamClient.withQuery":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.DefaultClient.HeaderParam.withQuery","_specs_.azure.clientgenerator.core.clientinitialization.defaultclient.HeaderParamClient.withQueryWithResponse":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.DefaultClient.HeaderParam.withQuery","_specs_.azure.clientgenerator.core.clientinitialization.defaultclient.HeaderParamClientBuilder":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.DefaultClient.HeaderParam","_specs_.azure.clientgenerator.core.clientinitialization.defaultclient.MixedParamsAsyncClient":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.DefaultClient.MixedParams","_specs_.azure.clientgenerator.core.clientinitialization.defaultclient.MixedParamsAsyncClient.withBody":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.DefaultClient.MixedParams.withBody","_specs_.azure.clientgenerator.core.clientinitialization.defaultclient.MixedParamsAsyncClient.withBodyWithResponse":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.DefaultClient.MixedParams.withBody","_specs_.azure.clientgenerator.core.clientinitialization.defaultclient.MixedParamsAsyncClient.withQuery":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.DefaultClient.MixedParams.withQuery","_specs_.azure.clientgenerator.core.clientinitialization.defaultclient.MixedParamsAsyncClient.withQueryWithResponse":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.DefaultClient.MixedParams.withQuery","_specs_.azure.clientgenerator.core.clientinitialization.defaultclient.MixedParamsClient":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.DefaultClient.MixedParams","_specs_.azure.clientgenerator.core.clientinitialization.defaultclient.MixedParamsClient.withBody":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.DefaultClient.MixedParams.withBody","_specs_.azure.clientgenerator.core.clientinitialization.defaultclient.MixedParamsClient.withBodyWithResponse":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.DefaultClient.MixedParams.withBody","_specs_.azure.clientgenerator.core.clientinitialization.defaultclient.MixedParamsClient.withQuery":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.DefaultClient.MixedParams.withQuery","_specs_.azure.clientgenerator.core.clientinitialization.defaultclient.MixedParamsClient.withQueryWithResponse":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.DefaultClient.MixedParams.withQuery","_specs_.azure.clientgenerator.core.clientinitialization.defaultclient.MixedParamsClientBuilder":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.DefaultClient.MixedParams","_specs_.azure.clientgenerator.core.clientinitialization.defaultclient.MultipleParamsAsyncClient":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.DefaultClient.MultipleParams","_specs_.azure.clientgenerator.core.clientinitialization.defaultclient.MultipleParamsAsyncClient.withBody":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.DefaultClient.MultipleParams.withBody","_specs_.azure.clientgenerator.core.clientinitialization.defaultclient.MultipleParamsAsyncClient.withBodyWithResponse":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.DefaultClient.MultipleParams.withBody","_specs_.azure.clientgenerator.core.clientinitialization.defaultclient.MultipleParamsAsyncClient.withQuery":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.DefaultClient.MultipleParams.withQuery","_specs_.azure.clientgenerator.core.clientinitialization.defaultclient.MultipleParamsAsyncClient.withQueryWithResponse":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.DefaultClient.MultipleParams.withQuery","_specs_.azure.clientgenerator.core.clientinitialization.defaultclient.MultipleParamsClient":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.DefaultClient.MultipleParams","_specs_.azure.clientgenerator.core.clientinitialization.defaultclient.MultipleParamsClient.withBody":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.DefaultClient.MultipleParams.withBody","_specs_.azure.clientgenerator.core.clientinitialization.defaultclient.MultipleParamsClient.withBodyWithResponse":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.DefaultClient.MultipleParams.withBody","_specs_.azure.clientgenerator.core.clientinitialization.defaultclient.MultipleParamsClient.withQuery":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.DefaultClient.MultipleParams.withQuery","_specs_.azure.clientgenerator.core.clientinitialization.defaultclient.MultipleParamsClient.withQueryWithResponse":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.DefaultClient.MultipleParams.withQuery","_specs_.azure.clientgenerator.core.clientinitialization.defaultclient.MultipleParamsClientBuilder":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.DefaultClient.MultipleParams","_specs_.azure.clientgenerator.core.clientinitialization.defaultclient.ParamAliasAsyncClient":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.DefaultClient.ParamAlias","_specs_.azure.clientgenerator.core.clientinitialization.defaultclient.ParamAliasAsyncClient.withAliasedName":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.DefaultClient.ParamAlias.withAliasedName","_specs_.azure.clientgenerator.core.clientinitialization.defaultclient.ParamAliasAsyncClient.withAliasedNameWithResponse":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.DefaultClient.ParamAlias.withAliasedName","_specs_.azure.clientgenerator.core.clientinitialization.defaultclient.ParamAliasAsyncClient.withOriginalName":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.DefaultClient.ParamAlias.withOriginalName","_specs_.azure.clientgenerator.core.clientinitialization.defaultclient.ParamAliasAsyncClient.withOriginalNameWithResponse":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.DefaultClient.ParamAlias.withOriginalName","_specs_.azure.clientgenerator.core.clientinitialization.defaultclient.ParamAliasClient":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.DefaultClient.ParamAlias","_specs_.azure.clientgenerator.core.clientinitialization.defaultclient.ParamAliasClient.withAliasedName":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.DefaultClient.ParamAlias.withAliasedName","_specs_.azure.clientgenerator.core.clientinitialization.defaultclient.ParamAliasClient.withAliasedNameWithResponse":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.DefaultClient.ParamAlias.withAliasedName","_specs_.azure.clientgenerator.core.clientinitialization.defaultclient.ParamAliasClient.withOriginalName":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.DefaultClient.ParamAlias.withOriginalName","_specs_.azure.clientgenerator.core.clientinitialization.defaultclient.ParamAliasClient.withOriginalNameWithResponse":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.DefaultClient.ParamAlias.withOriginalName","_specs_.azure.clientgenerator.core.clientinitialization.defaultclient.ParamAliasClientBuilder":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.DefaultClient.ParamAlias","_specs_.azure.clientgenerator.core.clientinitialization.defaultclient.PathParamAsyncClient":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.DefaultClient.PathParam","_specs_.azure.clientgenerator.core.clientinitialization.defaultclient.PathParamAsyncClient.deleteStandalone":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.DefaultClient.PathParam.deleteStandalone","_specs_.azure.clientgenerator.core.clientinitialization.defaultclient.PathParamAsyncClient.deleteStandaloneWithResponse":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.DefaultClient.PathParam.deleteStandalone","_specs_.azure.clientgenerator.core.clientinitialization.defaultclient.PathParamAsyncClient.getStandalone":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.DefaultClient.PathParam.getStandalone","_specs_.azure.clientgenerator.core.clientinitialization.defaultclient.PathParamAsyncClient.getStandaloneWithResponse":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.DefaultClient.PathParam.getStandalone","_specs_.azure.clientgenerator.core.clientinitialization.defaultclient.PathParamAsyncClient.withQuery":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.DefaultClient.PathParam.withQuery","_specs_.azure.clientgenerator.core.clientinitialization.defaultclient.PathParamAsyncClient.withQueryWithResponse":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.DefaultClient.PathParam.withQuery","_specs_.azure.clientgenerator.core.clientinitialization.defaultclient.PathParamClient":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.DefaultClient.PathParam","_specs_.azure.clientgenerator.core.clientinitialization.defaultclient.PathParamClient.deleteStandalone":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.DefaultClient.PathParam.deleteStandalone","_specs_.azure.clientgenerator.core.clientinitialization.defaultclient.PathParamClient.deleteStandaloneWithResponse":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.DefaultClient.PathParam.deleteStandalone","_specs_.azure.clientgenerator.core.clientinitialization.defaultclient.PathParamClient.getStandalone":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.DefaultClient.PathParam.getStandalone","_specs_.azure.clientgenerator.core.clientinitialization.defaultclient.PathParamClient.getStandaloneWithResponse":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.DefaultClient.PathParam.getStandalone","_specs_.azure.clientgenerator.core.clientinitialization.defaultclient.PathParamClient.withQuery":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.DefaultClient.PathParam.withQuery","_specs_.azure.clientgenerator.core.clientinitialization.defaultclient.PathParamClient.withQueryWithResponse":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.DefaultClient.PathParam.withQuery","_specs_.azure.clientgenerator.core.clientinitialization.defaultclient.PathParamClientBuilder":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.DefaultClient.PathParam","_specs_.azure.clientgenerator.core.clientinitialization.defaultclient.QueryParamAsyncClient":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.DefaultClient.QueryParam","_specs_.azure.clientgenerator.core.clientinitialization.defaultclient.QueryParamAsyncClient.deleteStandalone":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.DefaultClient.QueryParam.deleteStandalone","_specs_.azure.clientgenerator.core.clientinitialization.defaultclient.QueryParamAsyncClient.deleteStandaloneWithResponse":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.DefaultClient.QueryParam.deleteStandalone","_specs_.azure.clientgenerator.core.clientinitialization.defaultclient.QueryParamAsyncClient.getStandalone":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.DefaultClient.QueryParam.getStandalone","_specs_.azure.clientgenerator.core.clientinitialization.defaultclient.QueryParamAsyncClient.getStandaloneWithResponse":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.DefaultClient.QueryParam.getStandalone","_specs_.azure.clientgenerator.core.clientinitialization.defaultclient.QueryParamAsyncClient.withQuery":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.DefaultClient.QueryParam.withQuery","_specs_.azure.clientgenerator.core.clientinitialization.defaultclient.QueryParamAsyncClient.withQueryWithResponse":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.DefaultClient.QueryParam.withQuery","_specs_.azure.clientgenerator.core.clientinitialization.defaultclient.QueryParamClient":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.DefaultClient.QueryParam","_specs_.azure.clientgenerator.core.clientinitialization.defaultclient.QueryParamClient.deleteStandalone":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.DefaultClient.QueryParam.deleteStandalone","_specs_.azure.clientgenerator.core.clientinitialization.defaultclient.QueryParamClient.deleteStandaloneWithResponse":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.DefaultClient.QueryParam.deleteStandalone","_specs_.azure.clientgenerator.core.clientinitialization.defaultclient.QueryParamClient.getStandalone":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.DefaultClient.QueryParam.getStandalone","_specs_.azure.clientgenerator.core.clientinitialization.defaultclient.QueryParamClient.getStandaloneWithResponse":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.DefaultClient.QueryParam.getStandalone","_specs_.azure.clientgenerator.core.clientinitialization.defaultclient.QueryParamClient.withQuery":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.DefaultClient.QueryParam.withQuery","_specs_.azure.clientgenerator.core.clientinitialization.defaultclient.QueryParamClient.withQueryWithResponse":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.DefaultClient.QueryParam.withQuery","_specs_.azure.clientgenerator.core.clientinitialization.defaultclient.QueryParamClientBuilder":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.DefaultClient.QueryParam","_specs_.azure.clientgenerator.core.clientinitialization.defaultclient.models.BlobProperties":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.DefaultClient.BlobProperties","_specs_.azure.clientgenerator.core.clientinitialization.defaultclient.models.Input":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.DefaultClient.Input","_specs_.azure.clientgenerator.core.clientinitialization.defaultclient.models.WithBodyRequest":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.DefaultClient.withBody.Request.anonymous"},"generatedFiles":["src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/defaultclient/HeaderParamAsyncClient.java","src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/defaultclient/HeaderParamClient.java","src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/defaultclient/HeaderParamClientBuilder.java","src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/defaultclient/MixedParamsAsyncClient.java","src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/defaultclient/MixedParamsClient.java","src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/defaultclient/MixedParamsClientBuilder.java","src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/defaultclient/MultipleParamsAsyncClient.java","src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/defaultclient/MultipleParamsClient.java","src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/defaultclient/MultipleParamsClientBuilder.java","src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/defaultclient/ParamAliasAsyncClient.java","src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/defaultclient/ParamAliasClient.java","src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/defaultclient/ParamAliasClientBuilder.java","src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/defaultclient/PathParamAsyncClient.java","src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/defaultclient/PathParamClient.java","src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/defaultclient/PathParamClientBuilder.java","src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/defaultclient/QueryParamAsyncClient.java","src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/defaultclient/QueryParamClient.java","src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/defaultclient/QueryParamClientBuilder.java","src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/defaultclient/implementation/HeaderParamClientImpl.java","src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/defaultclient/implementation/MixedParamsClientImpl.java","src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/defaultclient/implementation/MultipleParamsClientImpl.java","src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/defaultclient/implementation/ParamAliasClientImpl.java","src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/defaultclient/implementation/PathParamClientImpl.java","src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/defaultclient/implementation/QueryParamClientImpl.java","src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/defaultclient/implementation/package-info.java","src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/defaultclient/models/BlobProperties.java","src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/defaultclient/models/Input.java","src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/defaultclient/models/WithBodyRequest.java","src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/defaultclient/models/package-info.java","src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/defaultclient/package-info.java","src/main/java/module-info.java"]} \ No newline at end of file diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/resources/META-INF/_specs_-azure-clientgenerator-core-clientinitialization-individuallyclient_metadata.json b/packages/http-client-java/generator/http-client-generator-test/src/main/resources/META-INF/_specs_-azure-clientgenerator-core-clientinitialization-individuallyclient_metadata.json deleted file mode 100644 index 464fc7c65c5..00000000000 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/resources/META-INF/_specs_-azure-clientgenerator-core-clientinitialization-individuallyclient_metadata.json +++ /dev/null @@ -1 +0,0 @@ -{"flavor":"Azure","apiVersions":{},"crossLanguageDefinitions":{"_specs_.azure.clientgenerator.core.clientinitialization.individuallyclient.IndividuallyNestedWithHeaderAsyncClient":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyClient.IndividuallyNestedWithHeader","_specs_.azure.clientgenerator.core.clientinitialization.individuallyclient.IndividuallyNestedWithHeaderAsyncClient.deleteStandalone":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyClient.IndividuallyNestedWithHeader.deleteStandalone","_specs_.azure.clientgenerator.core.clientinitialization.individuallyclient.IndividuallyNestedWithHeaderAsyncClient.deleteStandaloneWithResponse":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyClient.IndividuallyNestedWithHeader.deleteStandalone","_specs_.azure.clientgenerator.core.clientinitialization.individuallyclient.IndividuallyNestedWithHeaderAsyncClient.getStandalone":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyClient.IndividuallyNestedWithHeader.getStandalone","_specs_.azure.clientgenerator.core.clientinitialization.individuallyclient.IndividuallyNestedWithHeaderAsyncClient.getStandaloneWithResponse":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyClient.IndividuallyNestedWithHeader.getStandalone","_specs_.azure.clientgenerator.core.clientinitialization.individuallyclient.IndividuallyNestedWithHeaderAsyncClient.withQuery":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyClient.IndividuallyNestedWithHeader.withQuery","_specs_.azure.clientgenerator.core.clientinitialization.individuallyclient.IndividuallyNestedWithHeaderAsyncClient.withQueryWithResponse":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyClient.IndividuallyNestedWithHeader.withQuery","_specs_.azure.clientgenerator.core.clientinitialization.individuallyclient.IndividuallyNestedWithHeaderClient":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyClient.IndividuallyNestedWithHeader","_specs_.azure.clientgenerator.core.clientinitialization.individuallyclient.IndividuallyNestedWithHeaderClient.deleteStandalone":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyClient.IndividuallyNestedWithHeader.deleteStandalone","_specs_.azure.clientgenerator.core.clientinitialization.individuallyclient.IndividuallyNestedWithHeaderClient.deleteStandaloneWithResponse":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyClient.IndividuallyNestedWithHeader.deleteStandalone","_specs_.azure.clientgenerator.core.clientinitialization.individuallyclient.IndividuallyNestedWithHeaderClient.getStandalone":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyClient.IndividuallyNestedWithHeader.getStandalone","_specs_.azure.clientgenerator.core.clientinitialization.individuallyclient.IndividuallyNestedWithHeaderClient.getStandaloneWithResponse":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyClient.IndividuallyNestedWithHeader.getStandalone","_specs_.azure.clientgenerator.core.clientinitialization.individuallyclient.IndividuallyNestedWithHeaderClient.withQuery":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyClient.IndividuallyNestedWithHeader.withQuery","_specs_.azure.clientgenerator.core.clientinitialization.individuallyclient.IndividuallyNestedWithHeaderClient.withQueryWithResponse":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyClient.IndividuallyNestedWithHeader.withQuery","_specs_.azure.clientgenerator.core.clientinitialization.individuallyclient.IndividuallyNestedWithHeaderClientBuilder":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyClient.IndividuallyNestedWithHeader","_specs_.azure.clientgenerator.core.clientinitialization.individuallyclient.IndividuallyNestedWithMixedAsyncClient":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyClient.IndividuallyNestedWithMixed","_specs_.azure.clientgenerator.core.clientinitialization.individuallyclient.IndividuallyNestedWithMixedAsyncClient.deleteStandalone":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyClient.IndividuallyNestedWithMixed.deleteStandalone","_specs_.azure.clientgenerator.core.clientinitialization.individuallyclient.IndividuallyNestedWithMixedAsyncClient.deleteStandaloneWithResponse":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyClient.IndividuallyNestedWithMixed.deleteStandalone","_specs_.azure.clientgenerator.core.clientinitialization.individuallyclient.IndividuallyNestedWithMixedAsyncClient.getStandalone":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyClient.IndividuallyNestedWithMixed.getStandalone","_specs_.azure.clientgenerator.core.clientinitialization.individuallyclient.IndividuallyNestedWithMixedAsyncClient.getStandaloneWithResponse":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyClient.IndividuallyNestedWithMixed.getStandalone","_specs_.azure.clientgenerator.core.clientinitialization.individuallyclient.IndividuallyNestedWithMixedAsyncClient.withQuery":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyClient.IndividuallyNestedWithMixed.withQuery","_specs_.azure.clientgenerator.core.clientinitialization.individuallyclient.IndividuallyNestedWithMixedAsyncClient.withQueryWithResponse":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyClient.IndividuallyNestedWithMixed.withQuery","_specs_.azure.clientgenerator.core.clientinitialization.individuallyclient.IndividuallyNestedWithMixedClient":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyClient.IndividuallyNestedWithMixed","_specs_.azure.clientgenerator.core.clientinitialization.individuallyclient.IndividuallyNestedWithMixedClient.deleteStandalone":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyClient.IndividuallyNestedWithMixed.deleteStandalone","_specs_.azure.clientgenerator.core.clientinitialization.individuallyclient.IndividuallyNestedWithMixedClient.deleteStandaloneWithResponse":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyClient.IndividuallyNestedWithMixed.deleteStandalone","_specs_.azure.clientgenerator.core.clientinitialization.individuallyclient.IndividuallyNestedWithMixedClient.getStandalone":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyClient.IndividuallyNestedWithMixed.getStandalone","_specs_.azure.clientgenerator.core.clientinitialization.individuallyclient.IndividuallyNestedWithMixedClient.getStandaloneWithResponse":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyClient.IndividuallyNestedWithMixed.getStandalone","_specs_.azure.clientgenerator.core.clientinitialization.individuallyclient.IndividuallyNestedWithMixedClient.withQuery":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyClient.IndividuallyNestedWithMixed.withQuery","_specs_.azure.clientgenerator.core.clientinitialization.individuallyclient.IndividuallyNestedWithMixedClient.withQueryWithResponse":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyClient.IndividuallyNestedWithMixed.withQuery","_specs_.azure.clientgenerator.core.clientinitialization.individuallyclient.IndividuallyNestedWithMixedClientBuilder":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyClient.IndividuallyNestedWithMixed","_specs_.azure.clientgenerator.core.clientinitialization.individuallyclient.IndividuallyNestedWithMultipleAsyncClient":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyClient.IndividuallyNestedWithMultiple","_specs_.azure.clientgenerator.core.clientinitialization.individuallyclient.IndividuallyNestedWithMultipleAsyncClient.deleteStandalone":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyClient.IndividuallyNestedWithMultiple.deleteStandalone","_specs_.azure.clientgenerator.core.clientinitialization.individuallyclient.IndividuallyNestedWithMultipleAsyncClient.deleteStandaloneWithResponse":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyClient.IndividuallyNestedWithMultiple.deleteStandalone","_specs_.azure.clientgenerator.core.clientinitialization.individuallyclient.IndividuallyNestedWithMultipleAsyncClient.getStandalone":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyClient.IndividuallyNestedWithMultiple.getStandalone","_specs_.azure.clientgenerator.core.clientinitialization.individuallyclient.IndividuallyNestedWithMultipleAsyncClient.getStandaloneWithResponse":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyClient.IndividuallyNestedWithMultiple.getStandalone","_specs_.azure.clientgenerator.core.clientinitialization.individuallyclient.IndividuallyNestedWithMultipleAsyncClient.withQuery":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyClient.IndividuallyNestedWithMultiple.withQuery","_specs_.azure.clientgenerator.core.clientinitialization.individuallyclient.IndividuallyNestedWithMultipleAsyncClient.withQueryWithResponse":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyClient.IndividuallyNestedWithMultiple.withQuery","_specs_.azure.clientgenerator.core.clientinitialization.individuallyclient.IndividuallyNestedWithMultipleClient":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyClient.IndividuallyNestedWithMultiple","_specs_.azure.clientgenerator.core.clientinitialization.individuallyclient.IndividuallyNestedWithMultipleClient.deleteStandalone":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyClient.IndividuallyNestedWithMultiple.deleteStandalone","_specs_.azure.clientgenerator.core.clientinitialization.individuallyclient.IndividuallyNestedWithMultipleClient.deleteStandaloneWithResponse":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyClient.IndividuallyNestedWithMultiple.deleteStandalone","_specs_.azure.clientgenerator.core.clientinitialization.individuallyclient.IndividuallyNestedWithMultipleClient.getStandalone":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyClient.IndividuallyNestedWithMultiple.getStandalone","_specs_.azure.clientgenerator.core.clientinitialization.individuallyclient.IndividuallyNestedWithMultipleClient.getStandaloneWithResponse":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyClient.IndividuallyNestedWithMultiple.getStandalone","_specs_.azure.clientgenerator.core.clientinitialization.individuallyclient.IndividuallyNestedWithMultipleClient.withQuery":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyClient.IndividuallyNestedWithMultiple.withQuery","_specs_.azure.clientgenerator.core.clientinitialization.individuallyclient.IndividuallyNestedWithMultipleClient.withQueryWithResponse":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyClient.IndividuallyNestedWithMultiple.withQuery","_specs_.azure.clientgenerator.core.clientinitialization.individuallyclient.IndividuallyNestedWithMultipleClientBuilder":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyClient.IndividuallyNestedWithMultiple","_specs_.azure.clientgenerator.core.clientinitialization.individuallyclient.IndividuallyNestedWithParamAliasAsyncClient":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyClient.IndividuallyNestedWithParamAlias","_specs_.azure.clientgenerator.core.clientinitialization.individuallyclient.IndividuallyNestedWithParamAliasAsyncClient.withAliasedName":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyClient.IndividuallyNestedWithParamAlias.withAliasedName","_specs_.azure.clientgenerator.core.clientinitialization.individuallyclient.IndividuallyNestedWithParamAliasAsyncClient.withAliasedNameWithResponse":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyClient.IndividuallyNestedWithParamAlias.withAliasedName","_specs_.azure.clientgenerator.core.clientinitialization.individuallyclient.IndividuallyNestedWithParamAliasAsyncClient.withOriginalName":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyClient.IndividuallyNestedWithParamAlias.withOriginalName","_specs_.azure.clientgenerator.core.clientinitialization.individuallyclient.IndividuallyNestedWithParamAliasAsyncClient.withOriginalNameWithResponse":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyClient.IndividuallyNestedWithParamAlias.withOriginalName","_specs_.azure.clientgenerator.core.clientinitialization.individuallyclient.IndividuallyNestedWithParamAliasClient":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyClient.IndividuallyNestedWithParamAlias","_specs_.azure.clientgenerator.core.clientinitialization.individuallyclient.IndividuallyNestedWithParamAliasClient.withAliasedName":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyClient.IndividuallyNestedWithParamAlias.withAliasedName","_specs_.azure.clientgenerator.core.clientinitialization.individuallyclient.IndividuallyNestedWithParamAliasClient.withAliasedNameWithResponse":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyClient.IndividuallyNestedWithParamAlias.withAliasedName","_specs_.azure.clientgenerator.core.clientinitialization.individuallyclient.IndividuallyNestedWithParamAliasClient.withOriginalName":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyClient.IndividuallyNestedWithParamAlias.withOriginalName","_specs_.azure.clientgenerator.core.clientinitialization.individuallyclient.IndividuallyNestedWithParamAliasClient.withOriginalNameWithResponse":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyClient.IndividuallyNestedWithParamAlias.withOriginalName","_specs_.azure.clientgenerator.core.clientinitialization.individuallyclient.IndividuallyNestedWithParamAliasClientBuilder":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyClient.IndividuallyNestedWithParamAlias","_specs_.azure.clientgenerator.core.clientinitialization.individuallyclient.IndividuallyNestedWithPathAsyncClient":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyClient.IndividuallyNestedWithPath","_specs_.azure.clientgenerator.core.clientinitialization.individuallyclient.IndividuallyNestedWithPathAsyncClient.deleteStandalone":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyClient.IndividuallyNestedWithPath.deleteStandalone","_specs_.azure.clientgenerator.core.clientinitialization.individuallyclient.IndividuallyNestedWithPathAsyncClient.deleteStandaloneWithResponse":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyClient.IndividuallyNestedWithPath.deleteStandalone","_specs_.azure.clientgenerator.core.clientinitialization.individuallyclient.IndividuallyNestedWithPathAsyncClient.getStandalone":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyClient.IndividuallyNestedWithPath.getStandalone","_specs_.azure.clientgenerator.core.clientinitialization.individuallyclient.IndividuallyNestedWithPathAsyncClient.getStandaloneWithResponse":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyClient.IndividuallyNestedWithPath.getStandalone","_specs_.azure.clientgenerator.core.clientinitialization.individuallyclient.IndividuallyNestedWithPathAsyncClient.withQuery":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyClient.IndividuallyNestedWithPath.withQuery","_specs_.azure.clientgenerator.core.clientinitialization.individuallyclient.IndividuallyNestedWithPathAsyncClient.withQueryWithResponse":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyClient.IndividuallyNestedWithPath.withQuery","_specs_.azure.clientgenerator.core.clientinitialization.individuallyclient.IndividuallyNestedWithPathClient":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyClient.IndividuallyNestedWithPath","_specs_.azure.clientgenerator.core.clientinitialization.individuallyclient.IndividuallyNestedWithPathClient.deleteStandalone":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyClient.IndividuallyNestedWithPath.deleteStandalone","_specs_.azure.clientgenerator.core.clientinitialization.individuallyclient.IndividuallyNestedWithPathClient.deleteStandaloneWithResponse":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyClient.IndividuallyNestedWithPath.deleteStandalone","_specs_.azure.clientgenerator.core.clientinitialization.individuallyclient.IndividuallyNestedWithPathClient.getStandalone":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyClient.IndividuallyNestedWithPath.getStandalone","_specs_.azure.clientgenerator.core.clientinitialization.individuallyclient.IndividuallyNestedWithPathClient.getStandaloneWithResponse":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyClient.IndividuallyNestedWithPath.getStandalone","_specs_.azure.clientgenerator.core.clientinitialization.individuallyclient.IndividuallyNestedWithPathClient.withQuery":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyClient.IndividuallyNestedWithPath.withQuery","_specs_.azure.clientgenerator.core.clientinitialization.individuallyclient.IndividuallyNestedWithPathClient.withQueryWithResponse":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyClient.IndividuallyNestedWithPath.withQuery","_specs_.azure.clientgenerator.core.clientinitialization.individuallyclient.IndividuallyNestedWithPathClientBuilder":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyClient.IndividuallyNestedWithPath","_specs_.azure.clientgenerator.core.clientinitialization.individuallyclient.IndividuallyNestedWithQueryAsyncClient":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyClient.IndividuallyNestedWithQuery","_specs_.azure.clientgenerator.core.clientinitialization.individuallyclient.IndividuallyNestedWithQueryAsyncClient.deleteStandalone":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyClient.IndividuallyNestedWithQuery.deleteStandalone","_specs_.azure.clientgenerator.core.clientinitialization.individuallyclient.IndividuallyNestedWithQueryAsyncClient.deleteStandaloneWithResponse":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyClient.IndividuallyNestedWithQuery.deleteStandalone","_specs_.azure.clientgenerator.core.clientinitialization.individuallyclient.IndividuallyNestedWithQueryAsyncClient.getStandalone":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyClient.IndividuallyNestedWithQuery.getStandalone","_specs_.azure.clientgenerator.core.clientinitialization.individuallyclient.IndividuallyNestedWithQueryAsyncClient.getStandaloneWithResponse":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyClient.IndividuallyNestedWithQuery.getStandalone","_specs_.azure.clientgenerator.core.clientinitialization.individuallyclient.IndividuallyNestedWithQueryAsyncClient.withQuery":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyClient.IndividuallyNestedWithQuery.withQuery","_specs_.azure.clientgenerator.core.clientinitialization.individuallyclient.IndividuallyNestedWithQueryAsyncClient.withQueryWithResponse":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyClient.IndividuallyNestedWithQuery.withQuery","_specs_.azure.clientgenerator.core.clientinitialization.individuallyclient.IndividuallyNestedWithQueryClient":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyClient.IndividuallyNestedWithQuery","_specs_.azure.clientgenerator.core.clientinitialization.individuallyclient.IndividuallyNestedWithQueryClient.deleteStandalone":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyClient.IndividuallyNestedWithQuery.deleteStandalone","_specs_.azure.clientgenerator.core.clientinitialization.individuallyclient.IndividuallyNestedWithQueryClient.deleteStandaloneWithResponse":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyClient.IndividuallyNestedWithQuery.deleteStandalone","_specs_.azure.clientgenerator.core.clientinitialization.individuallyclient.IndividuallyNestedWithQueryClient.getStandalone":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyClient.IndividuallyNestedWithQuery.getStandalone","_specs_.azure.clientgenerator.core.clientinitialization.individuallyclient.IndividuallyNestedWithQueryClient.getStandaloneWithResponse":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyClient.IndividuallyNestedWithQuery.getStandalone","_specs_.azure.clientgenerator.core.clientinitialization.individuallyclient.IndividuallyNestedWithQueryClient.withQuery":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyClient.IndividuallyNestedWithQuery.withQuery","_specs_.azure.clientgenerator.core.clientinitialization.individuallyclient.IndividuallyNestedWithQueryClient.withQueryWithResponse":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyClient.IndividuallyNestedWithQuery.withQuery","_specs_.azure.clientgenerator.core.clientinitialization.individuallyclient.IndividuallyNestedWithQueryClientBuilder":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyClient.IndividuallyNestedWithQuery","_specs_.azure.clientgenerator.core.clientinitialization.individuallyclient.models.BlobProperties":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyClient.BlobProperties"},"generatedFiles":["src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyclient/IndividuallyNestedWithHeaderAsyncClient.java","src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyclient/IndividuallyNestedWithHeaderClient.java","src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyclient/IndividuallyNestedWithHeaderClientBuilder.java","src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyclient/IndividuallyNestedWithMixedAsyncClient.java","src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyclient/IndividuallyNestedWithMixedClient.java","src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyclient/IndividuallyNestedWithMixedClientBuilder.java","src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyclient/IndividuallyNestedWithMultipleAsyncClient.java","src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyclient/IndividuallyNestedWithMultipleClient.java","src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyclient/IndividuallyNestedWithMultipleClientBuilder.java","src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyclient/IndividuallyNestedWithParamAliasAsyncClient.java","src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyclient/IndividuallyNestedWithParamAliasClient.java","src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyclient/IndividuallyNestedWithParamAliasClientBuilder.java","src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyclient/IndividuallyNestedWithPathAsyncClient.java","src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyclient/IndividuallyNestedWithPathClient.java","src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyclient/IndividuallyNestedWithPathClientBuilder.java","src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyclient/IndividuallyNestedWithQueryAsyncClient.java","src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyclient/IndividuallyNestedWithQueryClient.java","src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyclient/IndividuallyNestedWithQueryClientBuilder.java","src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyclient/implementation/IndividuallyNestedWithHeaderClientImpl.java","src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyclient/implementation/IndividuallyNestedWithMixedClientImpl.java","src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyclient/implementation/IndividuallyNestedWithMultipleClientImpl.java","src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyclient/implementation/IndividuallyNestedWithParamAliasClientImpl.java","src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyclient/implementation/IndividuallyNestedWithPathClientImpl.java","src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyclient/implementation/IndividuallyNestedWithQueryClientImpl.java","src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyclient/implementation/package-info.java","src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyclient/models/BlobProperties.java","src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyclient/models/package-info.java","src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyclient/package-info.java","src/main/java/module-info.java"]} \ No newline at end of file diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/resources/META-INF/_specs_-azure-clientgenerator-core-clientinitialization-individuallyparentclient_metadata.json b/packages/http-client-java/generator/http-client-generator-test/src/main/resources/META-INF/_specs_-azure-clientgenerator-core-clientinitialization-individuallyparentclient_metadata.json deleted file mode 100644 index a2a24589514..00000000000 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/resources/META-INF/_specs_-azure-clientgenerator-core-clientinitialization-individuallyparentclient_metadata.json +++ /dev/null @@ -1 +0,0 @@ -{"flavor":"Azure","apiVersions":{},"crossLanguageDefinitions":{"_specs_.azure.clientgenerator.core.clientinitialization.individuallyparentclient.IndividuallyParentAsyncClient":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient","_specs_.azure.clientgenerator.core.clientinitialization.individuallyparentclient.IndividuallyParentClient":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient","_specs_.azure.clientgenerator.core.clientinitialization.individuallyparentclient.IndividuallyParentClientBuilder":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient","_specs_.azure.clientgenerator.core.clientinitialization.individuallyparentclient.IndividuallyParentNestedWithHeaderAsyncClient":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithHeaderClient","_specs_.azure.clientgenerator.core.clientinitialization.individuallyparentclient.IndividuallyParentNestedWithHeaderAsyncClient.deleteStandalone":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithHeaderClient.deleteStandalone","_specs_.azure.clientgenerator.core.clientinitialization.individuallyparentclient.IndividuallyParentNestedWithHeaderAsyncClient.deleteStandaloneWithResponse":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithHeaderClient.deleteStandalone","_specs_.azure.clientgenerator.core.clientinitialization.individuallyparentclient.IndividuallyParentNestedWithHeaderAsyncClient.getStandalone":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithHeaderClient.getStandalone","_specs_.azure.clientgenerator.core.clientinitialization.individuallyparentclient.IndividuallyParentNestedWithHeaderAsyncClient.getStandaloneWithResponse":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithHeaderClient.getStandalone","_specs_.azure.clientgenerator.core.clientinitialization.individuallyparentclient.IndividuallyParentNestedWithHeaderAsyncClient.withQuery":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithHeaderClient.withQuery","_specs_.azure.clientgenerator.core.clientinitialization.individuallyparentclient.IndividuallyParentNestedWithHeaderAsyncClient.withQueryWithResponse":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithHeaderClient.withQuery","_specs_.azure.clientgenerator.core.clientinitialization.individuallyparentclient.IndividuallyParentNestedWithHeaderClient":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithHeaderClient","_specs_.azure.clientgenerator.core.clientinitialization.individuallyparentclient.IndividuallyParentNestedWithHeaderClient.deleteStandalone":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithHeaderClient.deleteStandalone","_specs_.azure.clientgenerator.core.clientinitialization.individuallyparentclient.IndividuallyParentNestedWithHeaderClient.deleteStandaloneWithResponse":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithHeaderClient.deleteStandalone","_specs_.azure.clientgenerator.core.clientinitialization.individuallyparentclient.IndividuallyParentNestedWithHeaderClient.getStandalone":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithHeaderClient.getStandalone","_specs_.azure.clientgenerator.core.clientinitialization.individuallyparentclient.IndividuallyParentNestedWithHeaderClient.getStandaloneWithResponse":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithHeaderClient.getStandalone","_specs_.azure.clientgenerator.core.clientinitialization.individuallyparentclient.IndividuallyParentNestedWithHeaderClient.withQuery":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithHeaderClient.withQuery","_specs_.azure.clientgenerator.core.clientinitialization.individuallyparentclient.IndividuallyParentNestedWithHeaderClient.withQueryWithResponse":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithHeaderClient.withQuery","_specs_.azure.clientgenerator.core.clientinitialization.individuallyparentclient.IndividuallyParentNestedWithHeaderClientBuilder":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithHeaderClient","_specs_.azure.clientgenerator.core.clientinitialization.individuallyparentclient.IndividuallyParentNestedWithMixedAsyncClient":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithMixedClient","_specs_.azure.clientgenerator.core.clientinitialization.individuallyparentclient.IndividuallyParentNestedWithMixedAsyncClient.deleteStandalone":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithMixedClient.deleteStandalone","_specs_.azure.clientgenerator.core.clientinitialization.individuallyparentclient.IndividuallyParentNestedWithMixedAsyncClient.deleteStandaloneWithResponse":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithMixedClient.deleteStandalone","_specs_.azure.clientgenerator.core.clientinitialization.individuallyparentclient.IndividuallyParentNestedWithMixedAsyncClient.getStandalone":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithMixedClient.getStandalone","_specs_.azure.clientgenerator.core.clientinitialization.individuallyparentclient.IndividuallyParentNestedWithMixedAsyncClient.getStandaloneWithResponse":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithMixedClient.getStandalone","_specs_.azure.clientgenerator.core.clientinitialization.individuallyparentclient.IndividuallyParentNestedWithMixedAsyncClient.withQuery":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithMixedClient.withQuery","_specs_.azure.clientgenerator.core.clientinitialization.individuallyparentclient.IndividuallyParentNestedWithMixedAsyncClient.withQueryWithResponse":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithMixedClient.withQuery","_specs_.azure.clientgenerator.core.clientinitialization.individuallyparentclient.IndividuallyParentNestedWithMixedClient":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithMixedClient","_specs_.azure.clientgenerator.core.clientinitialization.individuallyparentclient.IndividuallyParentNestedWithMixedClient.deleteStandalone":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithMixedClient.deleteStandalone","_specs_.azure.clientgenerator.core.clientinitialization.individuallyparentclient.IndividuallyParentNestedWithMixedClient.deleteStandaloneWithResponse":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithMixedClient.deleteStandalone","_specs_.azure.clientgenerator.core.clientinitialization.individuallyparentclient.IndividuallyParentNestedWithMixedClient.getStandalone":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithMixedClient.getStandalone","_specs_.azure.clientgenerator.core.clientinitialization.individuallyparentclient.IndividuallyParentNestedWithMixedClient.getStandaloneWithResponse":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithMixedClient.getStandalone","_specs_.azure.clientgenerator.core.clientinitialization.individuallyparentclient.IndividuallyParentNestedWithMixedClient.withQuery":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithMixedClient.withQuery","_specs_.azure.clientgenerator.core.clientinitialization.individuallyparentclient.IndividuallyParentNestedWithMixedClient.withQueryWithResponse":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithMixedClient.withQuery","_specs_.azure.clientgenerator.core.clientinitialization.individuallyparentclient.IndividuallyParentNestedWithMixedClientBuilder":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithMixedClient","_specs_.azure.clientgenerator.core.clientinitialization.individuallyparentclient.IndividuallyParentNestedWithMultipleAsyncClient":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithMultipleClient","_specs_.azure.clientgenerator.core.clientinitialization.individuallyparentclient.IndividuallyParentNestedWithMultipleAsyncClient.deleteStandalone":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithMultipleClient.deleteStandalone","_specs_.azure.clientgenerator.core.clientinitialization.individuallyparentclient.IndividuallyParentNestedWithMultipleAsyncClient.deleteStandaloneWithResponse":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithMultipleClient.deleteStandalone","_specs_.azure.clientgenerator.core.clientinitialization.individuallyparentclient.IndividuallyParentNestedWithMultipleAsyncClient.getStandalone":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithMultipleClient.getStandalone","_specs_.azure.clientgenerator.core.clientinitialization.individuallyparentclient.IndividuallyParentNestedWithMultipleAsyncClient.getStandaloneWithResponse":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithMultipleClient.getStandalone","_specs_.azure.clientgenerator.core.clientinitialization.individuallyparentclient.IndividuallyParentNestedWithMultipleAsyncClient.withQuery":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithMultipleClient.withQuery","_specs_.azure.clientgenerator.core.clientinitialization.individuallyparentclient.IndividuallyParentNestedWithMultipleAsyncClient.withQueryWithResponse":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithMultipleClient.withQuery","_specs_.azure.clientgenerator.core.clientinitialization.individuallyparentclient.IndividuallyParentNestedWithMultipleClient":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithMultipleClient","_specs_.azure.clientgenerator.core.clientinitialization.individuallyparentclient.IndividuallyParentNestedWithMultipleClient.deleteStandalone":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithMultipleClient.deleteStandalone","_specs_.azure.clientgenerator.core.clientinitialization.individuallyparentclient.IndividuallyParentNestedWithMultipleClient.deleteStandaloneWithResponse":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithMultipleClient.deleteStandalone","_specs_.azure.clientgenerator.core.clientinitialization.individuallyparentclient.IndividuallyParentNestedWithMultipleClient.getStandalone":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithMultipleClient.getStandalone","_specs_.azure.clientgenerator.core.clientinitialization.individuallyparentclient.IndividuallyParentNestedWithMultipleClient.getStandaloneWithResponse":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithMultipleClient.getStandalone","_specs_.azure.clientgenerator.core.clientinitialization.individuallyparentclient.IndividuallyParentNestedWithMultipleClient.withQuery":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithMultipleClient.withQuery","_specs_.azure.clientgenerator.core.clientinitialization.individuallyparentclient.IndividuallyParentNestedWithMultipleClient.withQueryWithResponse":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithMultipleClient.withQuery","_specs_.azure.clientgenerator.core.clientinitialization.individuallyparentclient.IndividuallyParentNestedWithMultipleClientBuilder":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithMultipleClient","_specs_.azure.clientgenerator.core.clientinitialization.individuallyparentclient.IndividuallyParentNestedWithParamAliasAsyncClient":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithParamAliasClient","_specs_.azure.clientgenerator.core.clientinitialization.individuallyparentclient.IndividuallyParentNestedWithParamAliasAsyncClient.withAliasedName":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithParamAliasClient.withAliasedName","_specs_.azure.clientgenerator.core.clientinitialization.individuallyparentclient.IndividuallyParentNestedWithParamAliasAsyncClient.withAliasedNameWithResponse":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithParamAliasClient.withAliasedName","_specs_.azure.clientgenerator.core.clientinitialization.individuallyparentclient.IndividuallyParentNestedWithParamAliasAsyncClient.withOriginalName":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithParamAliasClient.withOriginalName","_specs_.azure.clientgenerator.core.clientinitialization.individuallyparentclient.IndividuallyParentNestedWithParamAliasAsyncClient.withOriginalNameWithResponse":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithParamAliasClient.withOriginalName","_specs_.azure.clientgenerator.core.clientinitialization.individuallyparentclient.IndividuallyParentNestedWithParamAliasClient":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithParamAliasClient","_specs_.azure.clientgenerator.core.clientinitialization.individuallyparentclient.IndividuallyParentNestedWithParamAliasClient.withAliasedName":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithParamAliasClient.withAliasedName","_specs_.azure.clientgenerator.core.clientinitialization.individuallyparentclient.IndividuallyParentNestedWithParamAliasClient.withAliasedNameWithResponse":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithParamAliasClient.withAliasedName","_specs_.azure.clientgenerator.core.clientinitialization.individuallyparentclient.IndividuallyParentNestedWithParamAliasClient.withOriginalName":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithParamAliasClient.withOriginalName","_specs_.azure.clientgenerator.core.clientinitialization.individuallyparentclient.IndividuallyParentNestedWithParamAliasClient.withOriginalNameWithResponse":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithParamAliasClient.withOriginalName","_specs_.azure.clientgenerator.core.clientinitialization.individuallyparentclient.IndividuallyParentNestedWithParamAliasClientBuilder":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithParamAliasClient","_specs_.azure.clientgenerator.core.clientinitialization.individuallyparentclient.IndividuallyParentNestedWithPathAsyncClient":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithPathClient","_specs_.azure.clientgenerator.core.clientinitialization.individuallyparentclient.IndividuallyParentNestedWithPathAsyncClient.deleteStandalone":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithPathClient.deleteStandalone","_specs_.azure.clientgenerator.core.clientinitialization.individuallyparentclient.IndividuallyParentNestedWithPathAsyncClient.deleteStandaloneWithResponse":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithPathClient.deleteStandalone","_specs_.azure.clientgenerator.core.clientinitialization.individuallyparentclient.IndividuallyParentNestedWithPathAsyncClient.getStandalone":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithPathClient.getStandalone","_specs_.azure.clientgenerator.core.clientinitialization.individuallyparentclient.IndividuallyParentNestedWithPathAsyncClient.getStandaloneWithResponse":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithPathClient.getStandalone","_specs_.azure.clientgenerator.core.clientinitialization.individuallyparentclient.IndividuallyParentNestedWithPathAsyncClient.withQuery":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithPathClient.withQuery","_specs_.azure.clientgenerator.core.clientinitialization.individuallyparentclient.IndividuallyParentNestedWithPathAsyncClient.withQueryWithResponse":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithPathClient.withQuery","_specs_.azure.clientgenerator.core.clientinitialization.individuallyparentclient.IndividuallyParentNestedWithPathClient":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithPathClient","_specs_.azure.clientgenerator.core.clientinitialization.individuallyparentclient.IndividuallyParentNestedWithPathClient.deleteStandalone":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithPathClient.deleteStandalone","_specs_.azure.clientgenerator.core.clientinitialization.individuallyparentclient.IndividuallyParentNestedWithPathClient.deleteStandaloneWithResponse":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithPathClient.deleteStandalone","_specs_.azure.clientgenerator.core.clientinitialization.individuallyparentclient.IndividuallyParentNestedWithPathClient.getStandalone":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithPathClient.getStandalone","_specs_.azure.clientgenerator.core.clientinitialization.individuallyparentclient.IndividuallyParentNestedWithPathClient.getStandaloneWithResponse":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithPathClient.getStandalone","_specs_.azure.clientgenerator.core.clientinitialization.individuallyparentclient.IndividuallyParentNestedWithPathClient.withQuery":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithPathClient.withQuery","_specs_.azure.clientgenerator.core.clientinitialization.individuallyparentclient.IndividuallyParentNestedWithPathClient.withQueryWithResponse":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithPathClient.withQuery","_specs_.azure.clientgenerator.core.clientinitialization.individuallyparentclient.IndividuallyParentNestedWithPathClientBuilder":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithPathClient","_specs_.azure.clientgenerator.core.clientinitialization.individuallyparentclient.IndividuallyParentNestedWithQueryAsyncClient":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithQueryClient","_specs_.azure.clientgenerator.core.clientinitialization.individuallyparentclient.IndividuallyParentNestedWithQueryAsyncClient.deleteStandalone":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithQueryClient.deleteStandalone","_specs_.azure.clientgenerator.core.clientinitialization.individuallyparentclient.IndividuallyParentNestedWithQueryAsyncClient.deleteStandaloneWithResponse":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithQueryClient.deleteStandalone","_specs_.azure.clientgenerator.core.clientinitialization.individuallyparentclient.IndividuallyParentNestedWithQueryAsyncClient.getStandalone":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithQueryClient.getStandalone","_specs_.azure.clientgenerator.core.clientinitialization.individuallyparentclient.IndividuallyParentNestedWithQueryAsyncClient.getStandaloneWithResponse":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithQueryClient.getStandalone","_specs_.azure.clientgenerator.core.clientinitialization.individuallyparentclient.IndividuallyParentNestedWithQueryAsyncClient.withQuery":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithQueryClient.withQuery","_specs_.azure.clientgenerator.core.clientinitialization.individuallyparentclient.IndividuallyParentNestedWithQueryAsyncClient.withQueryWithResponse":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithQueryClient.withQuery","_specs_.azure.clientgenerator.core.clientinitialization.individuallyparentclient.IndividuallyParentNestedWithQueryClient":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithQueryClient","_specs_.azure.clientgenerator.core.clientinitialization.individuallyparentclient.IndividuallyParentNestedWithQueryClient.deleteStandalone":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithQueryClient.deleteStandalone","_specs_.azure.clientgenerator.core.clientinitialization.individuallyparentclient.IndividuallyParentNestedWithQueryClient.deleteStandaloneWithResponse":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithQueryClient.deleteStandalone","_specs_.azure.clientgenerator.core.clientinitialization.individuallyparentclient.IndividuallyParentNestedWithQueryClient.getStandalone":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithQueryClient.getStandalone","_specs_.azure.clientgenerator.core.clientinitialization.individuallyparentclient.IndividuallyParentNestedWithQueryClient.getStandaloneWithResponse":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithQueryClient.getStandalone","_specs_.azure.clientgenerator.core.clientinitialization.individuallyparentclient.IndividuallyParentNestedWithQueryClient.withQuery":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithQueryClient.withQuery","_specs_.azure.clientgenerator.core.clientinitialization.individuallyparentclient.IndividuallyParentNestedWithQueryClient.withQueryWithResponse":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithQueryClient.withQuery","_specs_.azure.clientgenerator.core.clientinitialization.individuallyparentclient.IndividuallyParentNestedWithQueryClientBuilder":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithQueryClient","_specs_.azure.clientgenerator.core.clientinitialization.individuallyparentclient.models.BlobProperties":"_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.BlobProperties"},"generatedFiles":["src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyparentclient/IndividuallyParentAsyncClient.java","src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyparentclient/IndividuallyParentClient.java","src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyparentclient/IndividuallyParentClientBuilder.java","src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyparentclient/IndividuallyParentNestedWithHeaderAsyncClient.java","src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyparentclient/IndividuallyParentNestedWithHeaderClient.java","src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyparentclient/IndividuallyParentNestedWithHeaderClientBuilder.java","src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyparentclient/IndividuallyParentNestedWithMixedAsyncClient.java","src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyparentclient/IndividuallyParentNestedWithMixedClient.java","src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyparentclient/IndividuallyParentNestedWithMixedClientBuilder.java","src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyparentclient/IndividuallyParentNestedWithMultipleAsyncClient.java","src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyparentclient/IndividuallyParentNestedWithMultipleClient.java","src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyparentclient/IndividuallyParentNestedWithMultipleClientBuilder.java","src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyparentclient/IndividuallyParentNestedWithParamAliasAsyncClient.java","src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyparentclient/IndividuallyParentNestedWithParamAliasClient.java","src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyparentclient/IndividuallyParentNestedWithParamAliasClientBuilder.java","src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyparentclient/IndividuallyParentNestedWithPathAsyncClient.java","src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyparentclient/IndividuallyParentNestedWithPathClient.java","src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyparentclient/IndividuallyParentNestedWithPathClientBuilder.java","src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyparentclient/IndividuallyParentNestedWithQueryAsyncClient.java","src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyparentclient/IndividuallyParentNestedWithQueryClient.java","src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyparentclient/IndividuallyParentNestedWithQueryClientBuilder.java","src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyparentclient/implementation/IndividuallyParentClientImpl.java","src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyparentclient/implementation/IndividuallyParentNestedWithHeaderClientImpl.java","src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyparentclient/implementation/IndividuallyParentNestedWithMixedClientImpl.java","src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyparentclient/implementation/IndividuallyParentNestedWithMultipleClientImpl.java","src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyparentclient/implementation/IndividuallyParentNestedWithParamAliasClientImpl.java","src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyparentclient/implementation/IndividuallyParentNestedWithPathClientImpl.java","src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyparentclient/implementation/IndividuallyParentNestedWithQueryClientImpl.java","src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyparentclient/implementation/package-info.java","src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyparentclient/models/BlobProperties.java","src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyparentclient/models/package-info.java","src/main/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyparentclient/package-info.java","src/main/java/module-info.java"]} \ No newline at end of file diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/resources/_specs_-azure-clientgenerator-core-clientinitialization-defaultclient.properties b/packages/http-client-java/generator/http-client-generator-test/src/main/resources/_specs_-azure-clientgenerator-core-clientinitialization-defaultclient.properties deleted file mode 100644 index ca812989b4f..00000000000 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/resources/_specs_-azure-clientgenerator-core-clientinitialization-defaultclient.properties +++ /dev/null @@ -1,2 +0,0 @@ -name=${project.artifactId} -version=${project.version} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/resources/_specs_-azure-clientgenerator-core-clientinitialization-individuallyclient.properties b/packages/http-client-java/generator/http-client-generator-test/src/main/resources/_specs_-azure-clientgenerator-core-clientinitialization-individuallyclient.properties deleted file mode 100644 index ca812989b4f..00000000000 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/resources/_specs_-azure-clientgenerator-core-clientinitialization-individuallyclient.properties +++ /dev/null @@ -1,2 +0,0 @@ -name=${project.artifactId} -version=${project.version} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/resources/_specs_-azure-clientgenerator-core-clientinitialization-individuallyparentclient.properties b/packages/http-client-java/generator/http-client-generator-test/src/main/resources/_specs_-azure-clientgenerator-core-clientinitialization-individuallyparentclient.properties deleted file mode 100644 index ca812989b4f..00000000000 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/resources/_specs_-azure-clientgenerator-core-clientinitialization-individuallyparentclient.properties +++ /dev/null @@ -1,2 +0,0 @@ -name=${project.artifactId} -version=${project.version} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/test/java/_specs_/azure/clientgenerator/core/clientinitialization/defaultclient/generated/HeaderParamClientTestBase.java b/packages/http-client-java/generator/http-client-generator-test/src/test/java/_specs_/azure/clientgenerator/core/clientinitialization/defaultclient/generated/HeaderParamClientTestBase.java deleted file mode 100644 index 4b0f55cce3c..00000000000 --- a/packages/http-client-java/generator/http-client-generator-test/src/test/java/_specs_/azure/clientgenerator/core/clientinitialization/defaultclient/generated/HeaderParamClientTestBase.java +++ /dev/null @@ -1,106 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package _specs_.azure.clientgenerator.core.clientinitialization.defaultclient.generated; - -// The Java test files under 'generated' package are generated for your reference. -// If you wish to modify these files, please copy them out of the 'generated' package, and modify there. -// See https://aka.ms/azsdk/dpg/java/tests for guide on adding a test. - -import _specs_.azure.clientgenerator.core.clientinitialization.defaultclient.HeaderParamClient; -import _specs_.azure.clientgenerator.core.clientinitialization.defaultclient.HeaderParamClientBuilder; -import _specs_.azure.clientgenerator.core.clientinitialization.defaultclient.MixedParamsClient; -import _specs_.azure.clientgenerator.core.clientinitialization.defaultclient.MixedParamsClientBuilder; -import _specs_.azure.clientgenerator.core.clientinitialization.defaultclient.MultipleParamsClient; -import _specs_.azure.clientgenerator.core.clientinitialization.defaultclient.MultipleParamsClientBuilder; -import _specs_.azure.clientgenerator.core.clientinitialization.defaultclient.ParamAliasClient; -import _specs_.azure.clientgenerator.core.clientinitialization.defaultclient.ParamAliasClientBuilder; -import _specs_.azure.clientgenerator.core.clientinitialization.defaultclient.PathParamClient; -import _specs_.azure.clientgenerator.core.clientinitialization.defaultclient.PathParamClientBuilder; -import _specs_.azure.clientgenerator.core.clientinitialization.defaultclient.QueryParamClient; -import _specs_.azure.clientgenerator.core.clientinitialization.defaultclient.QueryParamClientBuilder; -import com.azure.core.http.policy.HttpLogDetailLevel; -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 HeaderParamClientTestBase extends TestProxyTestBase { - protected HeaderParamClient headerParamClient; - - protected MultipleParamsClient multipleParamsClient; - - protected MixedParamsClient mixedParamsClient; - - protected PathParamClient pathParamClient; - - protected ParamAliasClient paramAliasClient; - - protected QueryParamClient queryParamClient; - - @Override - protected void beforeTest() { - HeaderParamClientBuilder headerParamClientbuilder = new HeaderParamClientBuilder() - .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) - .name(Configuration.getGlobalConfiguration().get("NAME", "name")) - .httpClient(getHttpClientOrUsePlayback(getHttpClients().findFirst().orElse(null))) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); - if (getTestMode() == TestMode.RECORD) { - headerParamClientbuilder.addPolicy(interceptorManager.getRecordPolicy()); - } - headerParamClient = headerParamClientbuilder.buildClient(); - - MultipleParamsClientBuilder multipleParamsClientbuilder = new MultipleParamsClientBuilder() - .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) - .name(Configuration.getGlobalConfiguration().get("NAME", "name")) - .region(Configuration.getGlobalConfiguration().get("REGION", "region")) - .httpClient(getHttpClientOrUsePlayback(getHttpClients().findFirst().orElse(null))) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); - if (getTestMode() == TestMode.RECORD) { - multipleParamsClientbuilder.addPolicy(interceptorManager.getRecordPolicy()); - } - multipleParamsClient = multipleParamsClientbuilder.buildClient(); - - MixedParamsClientBuilder mixedParamsClientbuilder = new MixedParamsClientBuilder() - .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) - .name(Configuration.getGlobalConfiguration().get("NAME", "name")) - .httpClient(getHttpClientOrUsePlayback(getHttpClients().findFirst().orElse(null))) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); - if (getTestMode() == TestMode.RECORD) { - mixedParamsClientbuilder.addPolicy(interceptorManager.getRecordPolicy()); - } - mixedParamsClient = mixedParamsClientbuilder.buildClient(); - - PathParamClientBuilder pathParamClientbuilder = new PathParamClientBuilder() - .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) - .blobName(Configuration.getGlobalConfiguration().get("BLOBNAME", "blobname")) - .httpClient(getHttpClientOrUsePlayback(getHttpClients().findFirst().orElse(null))) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); - if (getTestMode() == TestMode.RECORD) { - pathParamClientbuilder.addPolicy(interceptorManager.getRecordPolicy()); - } - pathParamClient = pathParamClientbuilder.buildClient(); - - ParamAliasClientBuilder paramAliasClientbuilder = new ParamAliasClientBuilder() - .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) - .blobName(Configuration.getGlobalConfiguration().get("BLOBNAME", "blobname")) - .httpClient(getHttpClientOrUsePlayback(getHttpClients().findFirst().orElse(null))) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); - if (getTestMode() == TestMode.RECORD) { - paramAliasClientbuilder.addPolicy(interceptorManager.getRecordPolicy()); - } - paramAliasClient = paramAliasClientbuilder.buildClient(); - - QueryParamClientBuilder queryParamClientbuilder = new QueryParamClientBuilder() - .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) - .blobName(Configuration.getGlobalConfiguration().get("BLOBNAME", "blobname")) - .httpClient(getHttpClientOrUsePlayback(getHttpClients().findFirst().orElse(null))) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); - if (getTestMode() == TestMode.RECORD) { - queryParamClientbuilder.addPolicy(interceptorManager.getRecordPolicy()); - } - queryParamClient = queryParamClientbuilder.buildClient(); - - } -} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/test/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyclient/generated/IndividuallyNestedWithPathClientTestBase.java b/packages/http-client-java/generator/http-client-generator-test/src/test/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyclient/generated/IndividuallyNestedWithPathClientTestBase.java deleted file mode 100644 index c5add06432f..00000000000 --- a/packages/http-client-java/generator/http-client-generator-test/src/test/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyclient/generated/IndividuallyNestedWithPathClientTestBase.java +++ /dev/null @@ -1,112 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package _specs_.azure.clientgenerator.core.clientinitialization.individuallyclient.generated; - -// The Java test files under 'generated' package are generated for your reference. -// If you wish to modify these files, please copy them out of the 'generated' package, and modify there. -// See https://aka.ms/azsdk/dpg/java/tests for guide on adding a test. - -import _specs_.azure.clientgenerator.core.clientinitialization.individuallyclient.IndividuallyNestedWithHeaderClient; -import _specs_.azure.clientgenerator.core.clientinitialization.individuallyclient.IndividuallyNestedWithHeaderClientBuilder; -import _specs_.azure.clientgenerator.core.clientinitialization.individuallyclient.IndividuallyNestedWithMixedClient; -import _specs_.azure.clientgenerator.core.clientinitialization.individuallyclient.IndividuallyNestedWithMixedClientBuilder; -import _specs_.azure.clientgenerator.core.clientinitialization.individuallyclient.IndividuallyNestedWithMultipleClient; -import _specs_.azure.clientgenerator.core.clientinitialization.individuallyclient.IndividuallyNestedWithMultipleClientBuilder; -import _specs_.azure.clientgenerator.core.clientinitialization.individuallyclient.IndividuallyNestedWithParamAliasClient; -import _specs_.azure.clientgenerator.core.clientinitialization.individuallyclient.IndividuallyNestedWithParamAliasClientBuilder; -import _specs_.azure.clientgenerator.core.clientinitialization.individuallyclient.IndividuallyNestedWithPathClient; -import _specs_.azure.clientgenerator.core.clientinitialization.individuallyclient.IndividuallyNestedWithPathClientBuilder; -import _specs_.azure.clientgenerator.core.clientinitialization.individuallyclient.IndividuallyNestedWithQueryClient; -import _specs_.azure.clientgenerator.core.clientinitialization.individuallyclient.IndividuallyNestedWithQueryClientBuilder; -import com.azure.core.http.policy.HttpLogDetailLevel; -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 IndividuallyNestedWithPathClientTestBase extends TestProxyTestBase { - protected IndividuallyNestedWithPathClient individuallyNestedWithPathClient; - - protected IndividuallyNestedWithQueryClient individuallyNestedWithQueryClient; - - protected IndividuallyNestedWithHeaderClient individuallyNestedWithHeaderClient; - - protected IndividuallyNestedWithMultipleClient individuallyNestedWithMultipleClient; - - protected IndividuallyNestedWithMixedClient individuallyNestedWithMixedClient; - - protected IndividuallyNestedWithParamAliasClient individuallyNestedWithParamAliasClient; - - @Override - protected void beforeTest() { - IndividuallyNestedWithPathClientBuilder individuallyNestedWithPathClientbuilder - = new IndividuallyNestedWithPathClientBuilder() - .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) - .blobName(Configuration.getGlobalConfiguration().get("BLOBNAME", "blobname")) - .httpClient(getHttpClientOrUsePlayback(getHttpClients().findFirst().orElse(null))) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); - if (getTestMode() == TestMode.RECORD) { - individuallyNestedWithPathClientbuilder.addPolicy(interceptorManager.getRecordPolicy()); - } - individuallyNestedWithPathClient = individuallyNestedWithPathClientbuilder.buildClient(); - - IndividuallyNestedWithQueryClientBuilder individuallyNestedWithQueryClientbuilder - = new IndividuallyNestedWithQueryClientBuilder() - .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) - .blobName(Configuration.getGlobalConfiguration().get("BLOBNAME", "blobname")) - .httpClient(getHttpClientOrUsePlayback(getHttpClients().findFirst().orElse(null))) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); - if (getTestMode() == TestMode.RECORD) { - individuallyNestedWithQueryClientbuilder.addPolicy(interceptorManager.getRecordPolicy()); - } - individuallyNestedWithQueryClient = individuallyNestedWithQueryClientbuilder.buildClient(); - - IndividuallyNestedWithHeaderClientBuilder individuallyNestedWithHeaderClientbuilder - = new IndividuallyNestedWithHeaderClientBuilder() - .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) - .name(Configuration.getGlobalConfiguration().get("NAME", "name")) - .httpClient(getHttpClientOrUsePlayback(getHttpClients().findFirst().orElse(null))) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); - if (getTestMode() == TestMode.RECORD) { - individuallyNestedWithHeaderClientbuilder.addPolicy(interceptorManager.getRecordPolicy()); - } - individuallyNestedWithHeaderClient = individuallyNestedWithHeaderClientbuilder.buildClient(); - - IndividuallyNestedWithMultipleClientBuilder individuallyNestedWithMultipleClientbuilder - = new IndividuallyNestedWithMultipleClientBuilder() - .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) - .name(Configuration.getGlobalConfiguration().get("NAME", "name")) - .region(Configuration.getGlobalConfiguration().get("REGION", "region")) - .httpClient(getHttpClientOrUsePlayback(getHttpClients().findFirst().orElse(null))) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); - if (getTestMode() == TestMode.RECORD) { - individuallyNestedWithMultipleClientbuilder.addPolicy(interceptorManager.getRecordPolicy()); - } - individuallyNestedWithMultipleClient = individuallyNestedWithMultipleClientbuilder.buildClient(); - - IndividuallyNestedWithMixedClientBuilder individuallyNestedWithMixedClientbuilder - = new IndividuallyNestedWithMixedClientBuilder() - .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) - .name(Configuration.getGlobalConfiguration().get("NAME", "name")) - .httpClient(getHttpClientOrUsePlayback(getHttpClients().findFirst().orElse(null))) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); - if (getTestMode() == TestMode.RECORD) { - individuallyNestedWithMixedClientbuilder.addPolicy(interceptorManager.getRecordPolicy()); - } - individuallyNestedWithMixedClient = individuallyNestedWithMixedClientbuilder.buildClient(); - - IndividuallyNestedWithParamAliasClientBuilder individuallyNestedWithParamAliasClientbuilder - = new IndividuallyNestedWithParamAliasClientBuilder() - .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) - .blobName(Configuration.getGlobalConfiguration().get("BLOBNAME", "blobname")) - .httpClient(getHttpClientOrUsePlayback(getHttpClients().findFirst().orElse(null))) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); - if (getTestMode() == TestMode.RECORD) { - individuallyNestedWithParamAliasClientbuilder.addPolicy(interceptorManager.getRecordPolicy()); - } - individuallyNestedWithParamAliasClient = individuallyNestedWithParamAliasClientbuilder.buildClient(); - - } -} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/test/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyparentclient/generated/IndividuallyParentNestedWithPathClientTestBase.java b/packages/http-client-java/generator/http-client-generator-test/src/test/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyparentclient/generated/IndividuallyParentNestedWithPathClientTestBase.java deleted file mode 100644 index 79eb17cdd8b..00000000000 --- a/packages/http-client-java/generator/http-client-generator-test/src/test/java/_specs_/azure/clientgenerator/core/clientinitialization/individuallyparentclient/generated/IndividuallyParentNestedWithPathClientTestBase.java +++ /dev/null @@ -1,126 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package _specs_.azure.clientgenerator.core.clientinitialization.individuallyparentclient.generated; - -// The Java test files under 'generated' package are generated for your reference. -// If you wish to modify these files, please copy them out of the 'generated' package, and modify there. -// See https://aka.ms/azsdk/dpg/java/tests for guide on adding a test. - -import _specs_.azure.clientgenerator.core.clientinitialization.individuallyparentclient.IndividuallyParentClient; -import _specs_.azure.clientgenerator.core.clientinitialization.individuallyparentclient.IndividuallyParentClientBuilder; -import _specs_.azure.clientgenerator.core.clientinitialization.individuallyparentclient.IndividuallyParentNestedWithHeaderClient; -import _specs_.azure.clientgenerator.core.clientinitialization.individuallyparentclient.IndividuallyParentNestedWithHeaderClientBuilder; -import _specs_.azure.clientgenerator.core.clientinitialization.individuallyparentclient.IndividuallyParentNestedWithMixedClient; -import _specs_.azure.clientgenerator.core.clientinitialization.individuallyparentclient.IndividuallyParentNestedWithMixedClientBuilder; -import _specs_.azure.clientgenerator.core.clientinitialization.individuallyparentclient.IndividuallyParentNestedWithMultipleClient; -import _specs_.azure.clientgenerator.core.clientinitialization.individuallyparentclient.IndividuallyParentNestedWithMultipleClientBuilder; -import _specs_.azure.clientgenerator.core.clientinitialization.individuallyparentclient.IndividuallyParentNestedWithParamAliasClient; -import _specs_.azure.clientgenerator.core.clientinitialization.individuallyparentclient.IndividuallyParentNestedWithParamAliasClientBuilder; -import _specs_.azure.clientgenerator.core.clientinitialization.individuallyparentclient.IndividuallyParentNestedWithPathClient; -import _specs_.azure.clientgenerator.core.clientinitialization.individuallyparentclient.IndividuallyParentNestedWithPathClientBuilder; -import _specs_.azure.clientgenerator.core.clientinitialization.individuallyparentclient.IndividuallyParentNestedWithQueryClient; -import _specs_.azure.clientgenerator.core.clientinitialization.individuallyparentclient.IndividuallyParentNestedWithQueryClientBuilder; -import com.azure.core.http.policy.HttpLogDetailLevel; -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 IndividuallyParentNestedWithPathClientTestBase extends TestProxyTestBase { - protected IndividuallyParentNestedWithPathClient individuallyParentNestedWithPathClient; - - protected IndividuallyParentNestedWithQueryClient individuallyParentNestedWithQueryClient; - - protected IndividuallyParentNestedWithHeaderClient individuallyParentNestedWithHeaderClient; - - protected IndividuallyParentNestedWithMultipleClient individuallyParentNestedWithMultipleClient; - - protected IndividuallyParentNestedWithMixedClient individuallyParentNestedWithMixedClient; - - protected IndividuallyParentNestedWithParamAliasClient individuallyParentNestedWithParamAliasClient; - - protected IndividuallyParentClient individuallyParentClient; - - @Override - protected void beforeTest() { - IndividuallyParentNestedWithPathClientBuilder individuallyParentNestedWithPathClientbuilder - = new IndividuallyParentNestedWithPathClientBuilder() - .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) - .blobName(Configuration.getGlobalConfiguration().get("BLOBNAME", "blobname")) - .httpClient(getHttpClientOrUsePlayback(getHttpClients().findFirst().orElse(null))) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); - if (getTestMode() == TestMode.RECORD) { - individuallyParentNestedWithPathClientbuilder.addPolicy(interceptorManager.getRecordPolicy()); - } - individuallyParentNestedWithPathClient = individuallyParentNestedWithPathClientbuilder.buildClient(); - - IndividuallyParentNestedWithQueryClientBuilder individuallyParentNestedWithQueryClientbuilder - = new IndividuallyParentNestedWithQueryClientBuilder() - .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) - .blobName(Configuration.getGlobalConfiguration().get("BLOBNAME", "blobname")) - .httpClient(getHttpClientOrUsePlayback(getHttpClients().findFirst().orElse(null))) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); - if (getTestMode() == TestMode.RECORD) { - individuallyParentNestedWithQueryClientbuilder.addPolicy(interceptorManager.getRecordPolicy()); - } - individuallyParentNestedWithQueryClient = individuallyParentNestedWithQueryClientbuilder.buildClient(); - - IndividuallyParentNestedWithHeaderClientBuilder individuallyParentNestedWithHeaderClientbuilder - = new IndividuallyParentNestedWithHeaderClientBuilder() - .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) - .name(Configuration.getGlobalConfiguration().get("NAME", "name")) - .httpClient(getHttpClientOrUsePlayback(getHttpClients().findFirst().orElse(null))) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); - if (getTestMode() == TestMode.RECORD) { - individuallyParentNestedWithHeaderClientbuilder.addPolicy(interceptorManager.getRecordPolicy()); - } - individuallyParentNestedWithHeaderClient = individuallyParentNestedWithHeaderClientbuilder.buildClient(); - - IndividuallyParentNestedWithMultipleClientBuilder individuallyParentNestedWithMultipleClientbuilder - = new IndividuallyParentNestedWithMultipleClientBuilder() - .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) - .name(Configuration.getGlobalConfiguration().get("NAME", "name")) - .region(Configuration.getGlobalConfiguration().get("REGION", "region")) - .httpClient(getHttpClientOrUsePlayback(getHttpClients().findFirst().orElse(null))) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); - if (getTestMode() == TestMode.RECORD) { - individuallyParentNestedWithMultipleClientbuilder.addPolicy(interceptorManager.getRecordPolicy()); - } - individuallyParentNestedWithMultipleClient = individuallyParentNestedWithMultipleClientbuilder.buildClient(); - - IndividuallyParentNestedWithMixedClientBuilder individuallyParentNestedWithMixedClientbuilder - = new IndividuallyParentNestedWithMixedClientBuilder() - .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) - .name(Configuration.getGlobalConfiguration().get("NAME", "name")) - .httpClient(getHttpClientOrUsePlayback(getHttpClients().findFirst().orElse(null))) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); - if (getTestMode() == TestMode.RECORD) { - individuallyParentNestedWithMixedClientbuilder.addPolicy(interceptorManager.getRecordPolicy()); - } - individuallyParentNestedWithMixedClient = individuallyParentNestedWithMixedClientbuilder.buildClient(); - - IndividuallyParentNestedWithParamAliasClientBuilder individuallyParentNestedWithParamAliasClientbuilder - = new IndividuallyParentNestedWithParamAliasClientBuilder() - .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) - .blobName(Configuration.getGlobalConfiguration().get("BLOBNAME", "blobname")) - .httpClient(getHttpClientOrUsePlayback(getHttpClients().findFirst().orElse(null))) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); - if (getTestMode() == TestMode.RECORD) { - individuallyParentNestedWithParamAliasClientbuilder.addPolicy(interceptorManager.getRecordPolicy()); - } - individuallyParentNestedWithParamAliasClient - = individuallyParentNestedWithParamAliasClientbuilder.buildClient(); - - IndividuallyParentClientBuilder individuallyParentClientbuilder = new IndividuallyParentClientBuilder() - .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) - .httpClient(getHttpClientOrUsePlayback(getHttpClients().findFirst().orElse(null))) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); - if (getTestMode() == TestMode.RECORD) { - individuallyParentClientbuilder.addPolicy(interceptorManager.getRecordPolicy()); - } - individuallyParentClient = individuallyParentClientbuilder.buildClient(); - - } -} From 3f97f319aaa4592383dad767141677ccdedb27fb Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 16 Mar 2026 22:27:19 +0000 Subject: [PATCH 8/8] chore: restore C# files to main state Remove remaining C# generator files that were accidentally changed from the original branch merge. Co-authored-by: markcowl <1054056+markcowl@users.noreply.github.com> --- .../src/Providers/ClientProvider.cs | 146 ++++++++++----- .../src/Providers/ClientSettingsProvider.cs | 10 +- .../src/ScmOutputLibrary.cs | 13 +- .../ClientProviderCustomizationTests.cs | 4 +- .../ClientProviderSubClientTests.cs | 10 +- .../ClientProviders/ClientProviderTests.cs | 104 ++++++----- ...tiServiceClient_GeneratesExpectedClient.cs | 9 +- ...thThreeServices_GeneratesExpectedClient.cs | 9 +- ...eCombinedClient_GeneratesExpectedClient.cs | 9 +- ...thThreeServices_GeneratesExpectedClient.cs | 9 +- ...yConstructor(WithDefault,False,False,0).cs | 9 +- ...ryConstructor(WithDefault,False,True,0).cs | 9 +- ...ryConstructor(WithDefault,True,False,0).cs | 9 +- ...aryConstructor(WithDefault,True,True,0).cs | 9 +- ...aryConstructor(WithDefault,True,True,1).cs | 9 +- ...Constructor(WithRequired,False,False,0).cs | 9 +- ...yConstructor(WithRequired,False,True,0).cs | 9 +- ...yConstructor(WithRequired,True,False,0).cs | 9 +- ...ryConstructor(WithRequired,True,True,0).cs | 9 +- ...ryConstructor(WithRequired,True,True,1).cs | 9 +- ...ValidateConstructorsWhenUnsupportedAuth.cs | 9 +- .../ClientProviderTests/XmlDocsAreWritten.cs | 11 +- .../Providers/ClientSettingsProviderTests.cs | 173 ++++++++++++++++++ .../test/common/InputFactory.cs | 2 +- .../Sample-TypeSpec/src/Generated/Metrics.cs | 71 ++++++- .../src/Generated/MetricsSettings.cs | 48 +++++ .../src/Generated/SampleTypeSpecClient.cs | 9 +- 27 files changed, 610 insertions(+), 126 deletions(-) create mode 100644 packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/MetricsSettings.cs diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ClientProvider.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ClientProvider.cs index c829e290267..7cb68c21967 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ClientProvider.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ClientProvider.cs @@ -106,7 +106,10 @@ public ClientProvider(InputClient inputClient) _publicCtorDescription = $"Initializes a new instance of {Name}."; ClientOptions = _inputClient.Parent is null ? ClientOptionsProvider.CreateClientOptionsProvider(_inputClient, this) : null; ClientOptionsParameter = ClientOptions != null ? ScmKnownParameters.ClientOptions(ClientOptions.Type) : null; - ClientSettings = ClientOptions != null ? new ClientSettingsProvider(_inputClient, this) : null; + bool isIndividuallyInitialized = (_inputClient.InitializedBy & InputClientInitializedBy.Individually) != 0; + ClientSettings = isIndividuallyInitialized + ? new ClientSettingsProvider(_inputClient, this) + : null; IsMultiServiceClient = _inputClient.IsMultiServiceClient; var apiKey = _inputAuth?.ApiKey; @@ -133,8 +136,7 @@ public ClientProvider(InputClient inputClient) this, initializationValue: Literal(apiKey.Prefix)) : null; - // skip auth fields for sub-clients - _apiKeyAuthFields = ClientOptions is null ? null : new(apiKeyAuthField, authorizationHeaderField, authorizationApiKeyPrefixField); + _apiKeyAuthFields = isIndividuallyInitialized ? new(apiKeyAuthField, authorizationHeaderField, authorizationApiKeyPrefixField) : null; } var tokenAuth = _inputAuth?.OAuth2; @@ -158,8 +160,7 @@ public ClientProvider(InputClient inputClient) var tokenCredentialScopesField = BuildTokenCredentialScopesField(tokenAuth, tokenCredentialType); - // skip auth fields for sub-clients - _oauth2Fields = ClientOptions is null ? null : new(tokenCredentialField, tokenCredentialScopesField); + _oauth2Fields = isIndividuallyInitialized ? new(tokenCredentialField, tokenCredentialScopesField) : null; } EndpointField = new( FieldModifiers.Private | FieldModifiers.ReadOnly, @@ -300,14 +301,8 @@ private IReadOnlyList GetSubClientInternalConstructorParamete PipelineProperty.AsParameter }; - if (_apiKeyAuthFields != null) - { - subClientParameters.Add(_apiKeyAuthFields.AuthField.AsParameter); - } - if (_oauth2Fields != null) - { - subClientParameters.Add(_oauth2Fields.AuthField.AsParameter); - } + // Auth credentials are NOT included here — the parent passes its authenticated + // pipeline, so the sub-client doesn't need separate credential parameters. subClientParameters.Add(_endpointParameter); subClientParameters.AddRange(ClientParameters); @@ -385,6 +380,12 @@ private IReadOnlyList GetClientParameters() public ClientOptionsProvider? ClientOptions { get; } public ClientSettingsProvider? ClientSettings { get; } + /// + /// Gets the effective — the client's own options for root clients, + /// or the root client's options for individually-initialized sub-clients. + /// + internal ClientOptionsProvider? EffectiveClientOptions => ClientOptions ?? GetRootClient()?.ClientOptions; + public PropertyProvider PipelineProperty { get; } public FieldProvider EndpointField { get; } @@ -647,7 +648,9 @@ void AppendPublicConstructors( foreach (var p in requiredParameters) { if (authParamName == null || p.Name != authParamName) + { initializerArgs.Add(p); + } } initializerArgs.Add(ClientOptionsParameter!); @@ -686,6 +689,14 @@ private IEnumerable BuildSettingsConstructors() yield break; } + // Only publicly constructible clients should get the Settings constructor. + // Internal clients (e.g., those made internal via custom code) cannot be + // constructed by consumers, so a public Settings constructor is not useful. + if (!DeclarationModifiers.HasFlag(TypeSignatureModifiers.Public)) + { + yield break; + } + var settingsParam = new ParameterProvider(SettingsParamName, $"The settings for {Name}.", ClientSettings.Type); var experimentalAttr = new AttributeStatement(typeof(ExperimentalAttribute), [Literal(ClientSettingsProvider.ClientSettingsDiagnosticId)]); @@ -733,64 +744,108 @@ private IEnumerable BuildSettingsConstructors() private void AppendSubClientPublicConstructors(List constructors) { // For sub-clients that can be initialized individually, we need to create public constructors - // similar to the root client constructors but adapted for sub-client needs + // with the same auth pattern as the root client. var primaryConstructors = new List(); var secondaryConstructors = new List(); - // if there is key auth + var rootClient = GetRootClient(); + var clientOptionsParameter = rootClient?.ClientOptionsParameter; + var clientOptionsProvider = rootClient?.ClientOptions; + + if (clientOptionsParameter == null || clientOptionsProvider == null) + { + return; + } + + // Add the internal AuthenticationPolicy constructor first — public constructors chain to it. + var authPolicyParam = new ParameterProvider( + "authenticationPolicy", + $"The authentication policy to use for pipeline creation.", + new CSharpType(typeof(AuthenticationPolicy), isNullable: true)); + + var requiredNonAuthParams = GetRequiredParameters(null); + ParameterProvider[] internalConstructorParameters = [authPolicyParam, _endpointParameter, .. requiredNonAuthParams, clientOptionsParameter]; + + var internalConstructor = new ConstructorProvider( + new ConstructorSignature(Type, _publicCtorDescription, MethodSignatureModifiers.Internal, internalConstructorParameters), + BuildPrimaryConstructorBody(internalConstructorParameters, null, authPolicyParam, clientOptionsProvider, clientOptionsParameter, addExplicitValidation: true), + this); + primaryConstructors.Add(internalConstructor); + + // Add public constructors with auth — same pattern as root client if (_apiKeyAuthFields != null) { AppendSubClientPublicConstructorsForAuth(_apiKeyAuthFields, primaryConstructors, secondaryConstructors); } - // if there is oauth2 auth if (_oauth2Fields != null) { AppendSubClientPublicConstructorsForAuth(_oauth2Fields, primaryConstructors, secondaryConstructors); } - // if there is no auth + bool onlyContainsUnsupportedAuth = _inputAuth != null && _apiKeyAuthFields == null && _oauth2Fields == null; if (_apiKeyAuthFields == null && _oauth2Fields == null) { - AppendSubClientPublicConstructorsForAuth(null, primaryConstructors, secondaryConstructors); + AppendSubClientPublicConstructorsForAuth(null, primaryConstructors, secondaryConstructors, onlyContainsUnsupportedAuth); } constructors.AddRange(secondaryConstructors); constructors.AddRange(primaryConstructors); + // Add Settings constructor for individually-initialized sub-clients + foreach (var settingsConstructor in BuildSettingsConstructors()) + { + constructors.Add(settingsConstructor); + } + void AppendSubClientPublicConstructorsForAuth( AuthFields? authFields, List primaryConstructors, - List secondaryConstructors) - { - // For a sub-client with individual initialization, we need: - // - endpoint parameter - // - auth parameter (if auth exists) - // - client options parameter (we need to get this from the root client) - var rootClient = GetRootClient(); - var clientOptionsParameter = rootClient?.ClientOptionsParameter; - var clientOptionsProvider = rootClient?.ClientOptions; - if (clientOptionsParameter == null || clientOptionsProvider == null) + List secondaryConstructors, + bool onlyContainsUnsupportedAuth = false) + { + // Public constructor with credential parameter — delegates to the internal constructor via this(...). + var requiredParameters = GetRequiredParameters(authFields?.AuthField); + ParameterProvider[] primaryConstructorParameters = [_endpointParameter, .. requiredParameters, clientOptionsParameter]; + var constructorModifier = onlyContainsUnsupportedAuth ? MethodSignatureModifiers.Internal : MethodSignatureModifiers.Public; + + // Build the auth policy expression for the this() initializer + ValueExpression authPolicyArg = BuildAuthPolicyArgument(authFields, requiredParameters); + var initializerArgs = new List { authPolicyArg, _endpointParameter }; + string? authParamName = authFields != null + ? (authFields.AuthField.Name != TokenProviderFieldName ? CredentialParamName : authFields.AuthField.AsParameter.Name) + : null; + foreach (var p in requiredParameters) { - // Cannot create public constructor without client options - return; + if (authParamName == null || p.Name != authParamName) + { + initializerArgs.Add(p); + } } + initializerArgs.Add(clientOptionsParameter!); - var requiredParameters = GetRequiredParameters(authFields?.AuthField); - ParameterProvider[] primaryConstructorParameters = [_endpointParameter, .. requiredParameters, clientOptionsParameter]; var primaryConstructor = new ConstructorProvider( - new ConstructorSignature(Type, _publicCtorDescription, MethodSignatureModifiers.Public, primaryConstructorParameters), - BuildPrimaryConstructorBody(primaryConstructorParameters, authFields, null, clientOptionsProvider, clientOptionsParameter), + new ConstructorSignature(Type, _publicCtorDescription, constructorModifier, primaryConstructorParameters, + initializer: new ConstructorInitializer(false, initializerArgs)), + MethodBodyStatement.Empty, this); - primaryConstructors.Add(primaryConstructor); // If the endpoint parameter contains an initialization value, it is not required. ParameterProvider[] secondaryConstructorParameters = _endpointParameter.InitializationValue is null ? [_endpointParameter, .. requiredParameters] : [.. requiredParameters]; - var secondaryConstructor = BuildSecondaryConstructor(secondaryConstructorParameters, primaryConstructorParameters, MethodSignatureModifiers.Public); + var secondaryConstructor = BuildSecondaryConstructor(secondaryConstructorParameters, primaryConstructorParameters, constructorModifier); secondaryConstructors.Add(secondaryConstructor); + + // When endpoint has a default value and there are required parameters, + // add an additional constructor that accepts required parameters + options. + if (_endpointParameter.InitializationValue is not null && requiredParameters.Count > 0) + { + ParameterProvider[] simplifiedConstructorWithOptionsParameters = [.. requiredParameters, clientOptionsParameter]; + var simplifiedConstructorWithOptions = BuildSecondaryConstructor(simplifiedConstructorWithOptionsParameters, primaryConstructorParameters, constructorModifier); + secondaryConstructors.Add(simplifiedConstructorWithOptions); + } } } @@ -917,11 +972,18 @@ private MethodBodyStatement[] BuildPrimaryConstructorBody(IReadOnlyList().Create(clientOptionsParameter, perRetryWithAuth)).Terminate(), + PipelineProperty.Assign(This.ToApi().Create(clientOptionsParameter, perRetryWithoutAuth)).Terminate())); } else { @@ -940,9 +1002,9 @@ private MethodBodyStatement[] BuildPrimaryConstructorBody(IReadOnlyList().Create(clientOptionsParameter, perRetryPolicies)).Terminate()); + body.Add(PipelineProperty.Assign(This.ToApi().Create(clientOptionsParameter, perRetryPolicies)).Terminate()); + } foreach (var f in Fields) { diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ClientSettingsProvider.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ClientSettingsProvider.cs index 046d9d0e9c6..06b3e7934c7 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ClientSettingsProvider.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ClientSettingsProvider.cs @@ -96,12 +96,13 @@ protected override PropertyProvider[] BuildProperties() this)); } - if (_clientProvider.ClientOptions != null) + var clientOptions = _clientProvider.EffectiveClientOptions; + if (clientOptions != null) { properties.Add(new PropertyProvider( null, MethodSignatureModifiers.Public, - _clientProvider.ClientOptions.Type.WithNullable(true), + clientOptions.Type.WithNullable(true), "Options", new AutoPropertyBody(true), this)); @@ -126,9 +127,10 @@ protected override MethodProvider[] BuildMethods() AppendBindingForProperty(body, sectionParam, propName, param.Name.ToVariableName(), param.Type); } - if (_clientProvider.ClientOptions != null) + var clientOptions = _clientProvider.EffectiveClientOptions; + if (clientOptions != null) { - AppendComplexObjectBinding(body, sectionParam, "Options", "options", _clientProvider.ClientOptions.Type); + AppendComplexObjectBinding(body, sectionParam, "Options", "options", clientOptions.Type); } var bindCoreMethod = new MethodProvider( diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/ScmOutputLibrary.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/ScmOutputLibrary.cs index fc1d9cd87df..13e43ad6a70 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/ScmOutputLibrary.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/ScmOutputLibrary.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using Microsoft.TypeSpec.Generator.ClientModel.Providers; using Microsoft.TypeSpec.Generator.Input; +using Microsoft.TypeSpec.Generator.Primitives; using Microsoft.TypeSpec.Generator.Providers; namespace Microsoft.TypeSpec.Generator.ClientModel @@ -41,11 +42,13 @@ private static void BuildClient(InputClient inputClient, HashSet t if (clientOptions != null) { types.Add(clientOptions); - var clientSettings = client.ClientSettings; - if (clientSettings != null) - { - types.Add(clientSettings); - } + } + + // Emit the Settings class for any publicly constructible client (root or individually-initialized sub-client). + var clientSettings = client.ClientSettings; + if (clientSettings != null && client.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Public)) + { + types.Add(clientSettings); } // We use the spec view methods so that we include collection definitions even if the user is customizing or suppressing diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/ClientProviderCustomizationTests.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/ClientProviderCustomizationTests.cs index d058de7cf6e..c7d924e8747 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/ClientProviderCustomizationTests.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/ClientProviderCustomizationTests.cs @@ -281,7 +281,7 @@ public async Task CanRenameSubClient() ]); var inputServiceMethod = InputFactory.BasicServiceMethod("test", inputOperation); var inputClient = InputFactory.Client("TestClient", methods: [inputServiceMethod]); - InputClient subClient = InputFactory.Client("custom", parent: inputClient); + InputClient subClient = InputFactory.Client("custom", parent: inputClient, initializedBy: InputClientInitializedBy.Parent); var mockGenerator = await MockHelpers.LoadMockGeneratorAsync( clients: () => [inputClient], compilation: async () => await Helpers.GetCompilationFromDirectoryAsync()); @@ -309,7 +309,7 @@ public async Task CanRemoveCachingField() ]); var inputServiceMethod = InputFactory.BasicServiceMethod("test", inputOperation); var inputClient = InputFactory.Client("TestClient", methods: [inputServiceMethod]); - InputClient subClient = InputFactory.Client("dog", methods: [], parameters: [], parent: inputClient); + InputClient subClient = InputFactory.Client("dog", methods: [], parameters: [], parent: inputClient, initializedBy: InputClientInitializedBy.Parent); var mockGenerator = await MockHelpers.LoadMockGeneratorAsync( clients: () => [inputClient], compilation: async () => await Helpers.GetCompilationFromDirectoryAsync()); diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/ClientProviderSubClientTests.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/ClientProviderSubClientTests.cs index 6de8507f420..2642f7e2798 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/ClientProviderSubClientTests.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/ClientProviderSubClientTests.cs @@ -15,11 +15,11 @@ namespace Microsoft.TypeSpec.Generator.ClientModel.Tests.Providers.ClientProvide public class ClientProviderSubClientTests { private static readonly InputClient _testClient = InputFactory.Client("TestClient"); - private static readonly InputClient _animalClient = InputFactory.Client("animal", doc: "AnimalClient description", parent: _testClient); - private static readonly InputClient _dogClient = InputFactory.Client("dog", doc: "DogClient description", parent: _animalClient); - private static readonly InputClient _catClient = InputFactory.Client("cat", doc: "CatClient description", parent: _animalClient); - private static readonly InputClient _hawkClient = InputFactory.Client("hawkClient", doc: "HawkClient description", parent: _animalClient); - private static readonly InputClient _huskyClient = InputFactory.Client("husky", doc: "HuskyClient description", parent: _dogClient); + private static readonly InputClient _animalClient = InputFactory.Client("animal", doc: "AnimalClient description", parent: _testClient, initializedBy: InputClientInitializedBy.Parent); + private static readonly InputClient _dogClient = InputFactory.Client("dog", doc: "DogClient description", parent: _animalClient, initializedBy: InputClientInitializedBy.Parent); + private static readonly InputClient _catClient = InputFactory.Client("cat", doc: "CatClient description", parent: _animalClient, initializedBy: InputClientInitializedBy.Parent); + private static readonly InputClient _hawkClient = InputFactory.Client("hawkClient", doc: "HawkClient description", parent: _animalClient, initializedBy: InputClientInitializedBy.Parent); + private static readonly InputClient _huskyClient = InputFactory.Client("husky", doc: "HuskyClient description", parent: _dogClient, initializedBy: InputClientInitializedBy.Parent); [SetUp] public void SetUp() diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/ClientProviderTests.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/ClientProviderTests.cs index f90957cdb1e..566fbb0fb65 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/ClientProviderTests.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/ClientProviderTests.cs @@ -48,9 +48,9 @@ public bool ValidateIsLastNamespaceSegmentTheSame(string left, string right) private const string OnlyUnsupportedAuthCategory = "WithOnlyUnsupportedAuth"; private const string TestClientName = "TestClient"; private static readonly InputClient _testClient = InputFactory.Client(TestClientName); - private static readonly InputClient _animalClient = InputFactory.Client("animal", doc: "AnimalClient description", parent: _testClient); - private static readonly InputClient _dogClient = InputFactory.Client("dog", doc: "DogClient description", parent: _animalClient); - private static readonly InputClient _huskyClient = InputFactory.Client("husky", doc: "HuskyClient description", parent: _dogClient); + private static readonly InputClient _animalClient = InputFactory.Client("animal", doc: "AnimalClient description", parent: _testClient, initializedBy: InputClientInitializedBy.Parent); + private static readonly InputClient _dogClient = InputFactory.Client("dog", doc: "DogClient description", parent: _animalClient, initializedBy: InputClientInitializedBy.Parent); + private static readonly InputClient _huskyClient = InputFactory.Client("husky", doc: "HuskyClient description", parent: _dogClient, initializedBy: InputClientInitializedBy.Parent); private static readonly InputModelType _spreadModel = InputFactory.Model( "spreadModel", usage: InputModelTypeUsage.Spread, @@ -755,10 +755,17 @@ public void TestBuildConstructors_DeduplicatesConstructorParametersBySerializedN [Test] public void TestBuildConstructors_ForSubClient_InitializedByIndividually_HasPublicConstructors() { - var parentClient = InputFactory.Client("ParentClient"); + var endpointParameter = InputFactory.EndpointParameter( + KnownParameters.Endpoint.Name, + InputPrimitiveType.String, + defaultValue: InputFactory.Constant.String("https://default.endpoint.io"), + scope: InputParameterScope.Client, + isEndpoint: true); + var parentClient = InputFactory.Client("ParentClient", parameters: [endpointParameter]); var subClient = InputFactory.Client( "SubClient", parent: parentClient, + parameters: [endpointParameter], initializedBy: InputClientInitializedBy.Individually); MockHelpers.LoadMockGenerator( @@ -776,23 +783,28 @@ public void TestBuildConstructors_ForSubClient_InitializedByIndividually_HasPubl c => c.Signature?.Modifiers == MethodSignatureModifiers.Public).ToList(); Assert.IsTrue(publicConstructors.Count > 0, "SubClient with InitializedBy.Individually should have public constructors"); - // primary constructor should set the pipeline, options, and endpoint + // Primary public constructor should have auth credential param and chain to internal via this(...) var primaryConstructor = publicConstructors.FirstOrDefault( - c => c.Signature?.Initializer == null); - Assert.IsNotNull(primaryConstructor, "SubClient with InitializedBy.Individually should have primary public constructor"); - StringAssert.Contains( - "options ??= new global::Sample.ParentClientOptions();", - primaryConstructor!.BodyStatements!.ToDisplayString(), - "Primary constructor should null coalesce options parameter"); - StringAssert.Contains( - "Pipeline = global::System.ClientModel.Primitives.ClientPipeline.Create(options, Array.Empty(), new global::System.ClientModel.Primitives.PipelinePolicy[] { new global::System.ClientModel.Primitives.UserAgentPolicy(typeof(global::Sample.SubClient).Assembly) }, Array.Empty());", - primaryConstructor.BodyStatements!.ToDisplayString(), - "Primary constructor should set the Pipeline property"); - - // Should NOT have internal constructor since InitializedBy does not include Parent - var internalConstructor = constructors.FirstOrDefault( - c => c.Signature?.Modifiers == MethodSignatureModifiers.Internal); - Assert.IsNull(internalConstructor, "SubClient with InitializedBy.Individually (without Parent) should not have internal constructor"); + c => c.Signature?.Parameters.Any(p => p.Name == "options") == true && c.Signature?.Initializer != null); + Assert.IsNotNull(primaryConstructor, "SubClient with InitializedBy.Individually should have primary public constructor with initializer"); + + // Should have a credential parameter (from the mock api key auth) + Assert.IsTrue(primaryConstructor!.Signature.Parameters.Any(p => p.Name == "credential"), + "SubClient with InitializedBy.Individually should have credential parameter in public constructor"); + + // Should have internal AuthenticationPolicy constructor + var internalConstructors = constructors.Where( + c => c.Signature?.Modifiers == MethodSignatureModifiers.Internal).ToList(); + Assert.IsTrue(internalConstructors.Count > 0, "SubClient with InitializedBy.Individually should have internal constructor"); + var authPolicyConstructor = internalConstructors.FirstOrDefault( + c => c.Signature?.Parameters.Any(p => p.Type.Name == nameof(AuthenticationPolicy)) == true); + Assert.IsNotNull(authPolicyConstructor, "SubClient with InitializedBy.Individually should have internal AuthenticationPolicy constructor"); + + // Should have a Settings constructor + Assert.IsNotNull(clientProvider.ClientSettings, "SubClient with InitializedBy.Individually should have ClientSettings"); + var settingsConstructor = publicConstructors.FirstOrDefault( + c => c.Signature?.Parameters.Count == 1 && c.Signature.Parameters[0].Name == "settings"); + Assert.IsNotNull(settingsConstructor, "SubClient with InitializedBy.Individually should have Settings constructor"); var mockingConstructor = constructors.FirstOrDefault( c => c.Signature?.Modifiers == MethodSignatureModifiers.Protected); @@ -835,10 +847,17 @@ public void TestBuildConstructors_ForSubClient_InitializedByParentOnly_HasOnlyIn [Test] public void TestBuildConstructors_ForSubClient_InitializedByBoth_HasBothConstructors() { - var parentClient = InputFactory.Client("ParentClient"); + var endpointParameter = InputFactory.EndpointParameter( + KnownParameters.Endpoint.Name, + InputPrimitiveType.String, + defaultValue: InputFactory.Constant.String("https://default.endpoint.io"), + scope: InputParameterScope.Client, + isEndpoint: true); + var parentClient = InputFactory.Client("ParentClient", parameters: [endpointParameter]); var subClient = InputFactory.Client( "SubClient", parent: parentClient, + parameters: [endpointParameter], initializedBy: InputClientInitializedBy.Individually | InputClientInitializedBy.Parent); MockHelpers.LoadMockGenerator( @@ -856,23 +875,21 @@ public void TestBuildConstructors_ForSubClient_InitializedByBoth_HasBothConstruc c => c.Signature?.Modifiers == MethodSignatureModifiers.Public).ToList(); Assert.IsTrue(publicConstructors.Count > 0, "SubClient with InitializedBy.Individually | Parent should have public constructors"); - // primary constructor should set the pipeline, options, and endpoint + // Primary public constructor should have auth credential param and chain to internal via this(...) var primaryConstructor = publicConstructors.FirstOrDefault( - c => c.Signature?.Initializer == null); - Assert.IsNotNull(primaryConstructor, "SubClient with InitializedBy.Individually should have primary public constructor"); - StringAssert.Contains( - "options ??= new global::Sample.ParentClientOptions();", - primaryConstructor!.BodyStatements!.ToDisplayString(), - "Primary constructor should null coalesce options parameter"); - StringAssert.Contains( - "Pipeline = global::System.ClientModel.Primitives.ClientPipeline.Create(options, Array.Empty(), new global::System.ClientModel.Primitives.PipelinePolicy[] { new global::System.ClientModel.Primitives.UserAgentPolicy(typeof(global::Sample.SubClient).Assembly) }, Array.Empty());", - primaryConstructor.BodyStatements!.ToDisplayString(), - "Primary constructor should set the Pipeline property"); - - // Should also have internal constructor - var internalConstructor = constructors.FirstOrDefault( - c => c.Signature?.Modifiers == MethodSignatureModifiers.Internal); - Assert.IsNotNull(internalConstructor, "SubClient with InitializedBy.Individually | Parent should have internal constructor"); + c => c.Signature?.Parameters.Any(p => p.Name == "options") == true && c.Signature?.Initializer != null); + Assert.IsNotNull(primaryConstructor, "SubClient with InitializedBy.Individually should have primary public constructor with initializer"); + + // Should also have internal constructors (sub-client internal + AuthenticationPolicy internal) + var internalConstructors = constructors.Where( + c => c.Signature?.Modifiers == MethodSignatureModifiers.Internal).ToList(); + Assert.IsTrue(internalConstructors.Count > 0, "SubClient with InitializedBy.Individually | Parent should have internal constructor"); + + // Should have a Settings constructor + Assert.IsNotNull(clientProvider.ClientSettings, "SubClient with InitializedBy.Individually | Parent should have ClientSettings"); + var settingsConstructor = publicConstructors.FirstOrDefault( + c => c.Signature?.Parameters.Count == 1 && c.Signature.Parameters[0].Name == "settings"); + Assert.IsNotNull(settingsConstructor, "SubClient with InitializedBy.Individually | Parent should have Settings constructor"); var mockingConstructor = constructors.FirstOrDefault( c => c.Signature?.Modifiers == MethodSignatureModifiers.Protected); @@ -1219,7 +1236,7 @@ public void TestGetClientOptions(bool isSubClient) parentClient = InputFactory.Client("parent"); } - var client = InputFactory.Client(TestClientName, parent: parentClient); + var client = InputFactory.Client(TestClientName, parent: parentClient, initializedBy: isSubClient ? InputClientInitializedBy.Parent : InputClientInitializedBy.Individually); var clientProvider = new ClientProvider(client); Assert.IsNotNull(clientProvider); @@ -1572,6 +1589,7 @@ public void ApiVersionFieldIsStoredOnRootClient() var subClient = InputFactory.Client( "SubClient", parent: rootClient, + initializedBy: InputClientInitializedBy.Parent, parameters: [ InputFactory.PathParameter("apiVersion", InputPrimitiveType.String, isRequired: true, scope: InputParameterScope.Client, isApiVersion: true), @@ -3327,8 +3345,8 @@ public void MultiServiceClient_GeneratesExpectedClient() scope: InputParameterScope.Client); var client = InputFactory.Client(TestClientName, parameters: [subscriptionIdParameter, apiVersionParameter], isMultiServiceClient: true); - var serviceAClient = InputFactory.Client("ServiceA", clientNamespace: "Sample.ServiceA", parent: client, parameters: [apiVersionParameter, subscriptionIdParameter]); - var serviceBClient = InputFactory.Client("ServiceB", clientNamespace: "Sample.ServiceB", parent: client, parameters: [apiVersionParameter, subscriptionIdParameter]); + var serviceAClient = InputFactory.Client("ServiceA", clientNamespace: "Sample.ServiceA", parent: client, initializedBy: InputClientInitializedBy.Parent, parameters: [apiVersionParameter, subscriptionIdParameter]); + var serviceBClient = InputFactory.Client("ServiceB", clientNamespace: "Sample.ServiceB", parent: client, initializedBy: InputClientInitializedBy.Parent, parameters: [apiVersionParameter, subscriptionIdParameter]); MockHelpers.LoadMockGenerator( apiVersions: () => [.. serviceAVersions, .. serviceBVersions], @@ -3387,9 +3405,9 @@ public void MultiServiceClient_WithThreeServices_GeneratesExpectedClient() scope: InputParameterScope.Client); var client = InputFactory.Client(TestClientName, parameters: [subscriptionIdParameter, apiVersionParameter], isMultiServiceClient: true); - var keyVaultClient = InputFactory.Client("KeyVault", clientNamespace: "Sample.KeyVault", parent: client, parameters: [apiVersionParameter, subscriptionIdParameter]); - var storageClient = InputFactory.Client("Storage", clientNamespace: "Sample.Storage", parent: client, parameters: [apiVersionParameter, subscriptionIdParameter]); - var computeClient = InputFactory.Client("Compute", clientNamespace: "Sample.Compute", parent: client, parameters: [apiVersionParameter, subscriptionIdParameter]); + var keyVaultClient = InputFactory.Client("KeyVault", clientNamespace: "Sample.KeyVault", parent: client, initializedBy: InputClientInitializedBy.Parent, parameters: [apiVersionParameter, subscriptionIdParameter]); + var storageClient = InputFactory.Client("Storage", clientNamespace: "Sample.Storage", parent: client, initializedBy: InputClientInitializedBy.Parent, parameters: [apiVersionParameter, subscriptionIdParameter]); + var computeClient = InputFactory.Client("Compute", clientNamespace: "Sample.Compute", parent: client, initializedBy: InputClientInitializedBy.Parent, parameters: [apiVersionParameter, subscriptionIdParameter]); MockHelpers.LoadMockGenerator( apiVersions: () => [.. keyVaultVersions, .. storageVersions, .. computeVersions], diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/MultiServiceClient_GeneratesExpectedClient.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/MultiServiceClient_GeneratesExpectedClient.cs index 3e82b811e69..7aa404c1406 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/MultiServiceClient_GeneratesExpectedClient.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/MultiServiceClient_GeneratesExpectedClient.cs @@ -36,7 +36,14 @@ internal TestClient(global::System.ClientModel.Primitives.AuthenticationPolicy a _endpoint = endpoint; _subscriptionId = subscriptionId; - Pipeline = global::System.ClientModel.Primitives.ClientPipeline.Create(options, Array.Empty(), new global::System.ClientModel.Primitives.PipelinePolicy[] { new global::System.ClientModel.Primitives.UserAgentPolicy(typeof(global::Sample.TestClient).Assembly) }, Array.Empty()); + if ((authenticationPolicy != null)) + { + Pipeline = global::System.ClientModel.Primitives.ClientPipeline.Create(options, Array.Empty(), new global::System.ClientModel.Primitives.PipelinePolicy[] { new global::System.ClientModel.Primitives.UserAgentPolicy(typeof(global::Sample.TestClient).Assembly), authenticationPolicy }, Array.Empty()); + } + else + { + Pipeline = global::System.ClientModel.Primitives.ClientPipeline.Create(options, Array.Empty(), new global::System.ClientModel.Primitives.PipelinePolicy[] { new global::System.ClientModel.Primitives.UserAgentPolicy(typeof(global::Sample.TestClient).Assembly) }, Array.Empty()); + } _serviceAApiVersion = options.ServiceAApiVersion; _serviceBApiVersion = options.ServiceBApiVersion; } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/MultiServiceClient_WithThreeServices_GeneratesExpectedClient.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/MultiServiceClient_WithThreeServices_GeneratesExpectedClient.cs index 54206fc6ffb..def2e6d7a73 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/MultiServiceClient_WithThreeServices_GeneratesExpectedClient.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/MultiServiceClient_WithThreeServices_GeneratesExpectedClient.cs @@ -39,7 +39,14 @@ internal TestClient(global::System.ClientModel.Primitives.AuthenticationPolicy a _endpoint = endpoint; _subscriptionId = subscriptionId; - Pipeline = global::System.ClientModel.Primitives.ClientPipeline.Create(options, Array.Empty(), new global::System.ClientModel.Primitives.PipelinePolicy[] { new global::System.ClientModel.Primitives.UserAgentPolicy(typeof(global::Sample.TestClient).Assembly) }, Array.Empty()); + if ((authenticationPolicy != null)) + { + Pipeline = global::System.ClientModel.Primitives.ClientPipeline.Create(options, Array.Empty(), new global::System.ClientModel.Primitives.PipelinePolicy[] { new global::System.ClientModel.Primitives.UserAgentPolicy(typeof(global::Sample.TestClient).Assembly), authenticationPolicy }, Array.Empty()); + } + else + { + Pipeline = global::System.ClientModel.Primitives.ClientPipeline.Create(options, Array.Empty(), new global::System.ClientModel.Primitives.PipelinePolicy[] { new global::System.ClientModel.Primitives.UserAgentPolicy(typeof(global::Sample.TestClient).Assembly) }, Array.Empty()); + } _serviceComputeApiVersion = options.ServiceComputeApiVersion; _serviceKeyVaultApiVersion = options.ServiceKeyVaultApiVersion; _serviceStorageApiVersion = options.ServiceStorageApiVersion; diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/MultiServiceCombinedClient_GeneratesExpectedClient.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/MultiServiceCombinedClient_GeneratesExpectedClient.cs index 1bd204e71e8..56c1c6cf460 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/MultiServiceCombinedClient_GeneratesExpectedClient.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/MultiServiceCombinedClient_GeneratesExpectedClient.cs @@ -31,7 +31,14 @@ internal TestClient(global::System.ClientModel.Primitives.AuthenticationPolicy a options ??= new global::Sample.TestClientOptions(); _endpoint = endpoint; - Pipeline = global::System.ClientModel.Primitives.ClientPipeline.Create(options, Array.Empty(), new global::System.ClientModel.Primitives.PipelinePolicy[] { new global::System.ClientModel.Primitives.UserAgentPolicy(typeof(global::Sample.TestClient).Assembly) }, Array.Empty()); + if ((authenticationPolicy != null)) + { + Pipeline = global::System.ClientModel.Primitives.ClientPipeline.Create(options, Array.Empty(), new global::System.ClientModel.Primitives.PipelinePolicy[] { new global::System.ClientModel.Primitives.UserAgentPolicy(typeof(global::Sample.TestClient).Assembly), authenticationPolicy }, Array.Empty()); + } + else + { + Pipeline = global::System.ClientModel.Primitives.ClientPipeline.Create(options, Array.Empty(), new global::System.ClientModel.Primitives.PipelinePolicy[] { new global::System.ClientModel.Primitives.UserAgentPolicy(typeof(global::Sample.TestClient).Assembly) }, Array.Empty()); + } _serviceAApiVersion = options.ServiceAApiVersion; _serviceBApiVersion = options.ServiceBApiVersion; } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/MultiServiceCombinedClient_WithThreeServices_GeneratesExpectedClient.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/MultiServiceCombinedClient_WithThreeServices_GeneratesExpectedClient.cs index a5520eb71c1..4096b627bc1 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/MultiServiceCombinedClient_WithThreeServices_GeneratesExpectedClient.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/MultiServiceCombinedClient_WithThreeServices_GeneratesExpectedClient.cs @@ -32,7 +32,14 @@ internal TestClient(global::System.ClientModel.Primitives.AuthenticationPolicy a options ??= new global::Sample.TestClientOptions(); _endpoint = endpoint; - Pipeline = global::System.ClientModel.Primitives.ClientPipeline.Create(options, Array.Empty(), new global::System.ClientModel.Primitives.PipelinePolicy[] { new global::System.ClientModel.Primitives.UserAgentPolicy(typeof(global::Sample.TestClient).Assembly) }, Array.Empty()); + if ((authenticationPolicy != null)) + { + Pipeline = global::System.ClientModel.Primitives.ClientPipeline.Create(options, Array.Empty(), new global::System.ClientModel.Primitives.PipelinePolicy[] { new global::System.ClientModel.Primitives.UserAgentPolicy(typeof(global::Sample.TestClient).Assembly), authenticationPolicy }, Array.Empty()); + } + else + { + Pipeline = global::System.ClientModel.Primitives.ClientPipeline.Create(options, Array.Empty(), new global::System.ClientModel.Primitives.PipelinePolicy[] { new global::System.ClientModel.Primitives.UserAgentPolicy(typeof(global::Sample.TestClient).Assembly) }, Array.Empty()); + } _serviceComputeApiVersion = options.ServiceComputeApiVersion; _serviceKeyVaultApiVersion = options.ServiceKeyVaultApiVersion; _serviceStorageApiVersion = options.ServiceStorageApiVersion; diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/TestBuildConstructors_PrimaryConstructor(WithDefault,False,False,0).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/TestBuildConstructors_PrimaryConstructor(WithDefault,False,False,0).cs index bc5bbc28eac..395de44a9d8 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/TestBuildConstructors_PrimaryConstructor(WithDefault,False,False,0).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/TestBuildConstructors_PrimaryConstructor(WithDefault,False,False,0).cs @@ -3,4 +3,11 @@ options ??= new global::Sample.TestClientOptions(); _endpoint = endpoint; -Pipeline = global::System.ClientModel.Primitives.ClientPipeline.Create(options, Array.Empty(), new global::System.ClientModel.Primitives.PipelinePolicy[] { new global::System.ClientModel.Primitives.UserAgentPolicy(typeof(global::Sample.TestClient).Assembly) }, Array.Empty()); +if ((authenticationPolicy != null)) +{ + Pipeline = global::System.ClientModel.Primitives.ClientPipeline.Create(options, Array.Empty(), new global::System.ClientModel.Primitives.PipelinePolicy[] { new global::System.ClientModel.Primitives.UserAgentPolicy(typeof(global::Sample.TestClient).Assembly), authenticationPolicy }, Array.Empty()); +} +else +{ + Pipeline = global::System.ClientModel.Primitives.ClientPipeline.Create(options, Array.Empty(), new global::System.ClientModel.Primitives.PipelinePolicy[] { new global::System.ClientModel.Primitives.UserAgentPolicy(typeof(global::Sample.TestClient).Assembly) }, Array.Empty()); +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/TestBuildConstructors_PrimaryConstructor(WithDefault,False,True,0).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/TestBuildConstructors_PrimaryConstructor(WithDefault,False,True,0).cs index 579690c23a0..395de44a9d8 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/TestBuildConstructors_PrimaryConstructor(WithDefault,False,True,0).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/TestBuildConstructors_PrimaryConstructor(WithDefault,False,True,0).cs @@ -3,4 +3,11 @@ options ??= new global::Sample.TestClientOptions(); _endpoint = endpoint; -Pipeline = global::System.ClientModel.Primitives.ClientPipeline.Create(options, Array.Empty(), new global::System.ClientModel.Primitives.PipelinePolicy[] { new global::System.ClientModel.Primitives.UserAgentPolicy(typeof(global::Sample.TestClient).Assembly), authenticationPolicy }, Array.Empty()); +if ((authenticationPolicy != null)) +{ + Pipeline = global::System.ClientModel.Primitives.ClientPipeline.Create(options, Array.Empty(), new global::System.ClientModel.Primitives.PipelinePolicy[] { new global::System.ClientModel.Primitives.UserAgentPolicy(typeof(global::Sample.TestClient).Assembly), authenticationPolicy }, Array.Empty()); +} +else +{ + Pipeline = global::System.ClientModel.Primitives.ClientPipeline.Create(options, Array.Empty(), new global::System.ClientModel.Primitives.PipelinePolicy[] { new global::System.ClientModel.Primitives.UserAgentPolicy(typeof(global::Sample.TestClient).Assembly) }, Array.Empty()); +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/TestBuildConstructors_PrimaryConstructor(WithDefault,True,False,0).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/TestBuildConstructors_PrimaryConstructor(WithDefault,True,False,0).cs index 579690c23a0..395de44a9d8 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/TestBuildConstructors_PrimaryConstructor(WithDefault,True,False,0).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/TestBuildConstructors_PrimaryConstructor(WithDefault,True,False,0).cs @@ -3,4 +3,11 @@ options ??= new global::Sample.TestClientOptions(); _endpoint = endpoint; -Pipeline = global::System.ClientModel.Primitives.ClientPipeline.Create(options, Array.Empty(), new global::System.ClientModel.Primitives.PipelinePolicy[] { new global::System.ClientModel.Primitives.UserAgentPolicy(typeof(global::Sample.TestClient).Assembly), authenticationPolicy }, Array.Empty()); +if ((authenticationPolicy != null)) +{ + Pipeline = global::System.ClientModel.Primitives.ClientPipeline.Create(options, Array.Empty(), new global::System.ClientModel.Primitives.PipelinePolicy[] { new global::System.ClientModel.Primitives.UserAgentPolicy(typeof(global::Sample.TestClient).Assembly), authenticationPolicy }, Array.Empty()); +} +else +{ + Pipeline = global::System.ClientModel.Primitives.ClientPipeline.Create(options, Array.Empty(), new global::System.ClientModel.Primitives.PipelinePolicy[] { new global::System.ClientModel.Primitives.UserAgentPolicy(typeof(global::Sample.TestClient).Assembly) }, Array.Empty()); +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/TestBuildConstructors_PrimaryConstructor(WithDefault,True,True,0).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/TestBuildConstructors_PrimaryConstructor(WithDefault,True,True,0).cs index 579690c23a0..395de44a9d8 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/TestBuildConstructors_PrimaryConstructor(WithDefault,True,True,0).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/TestBuildConstructors_PrimaryConstructor(WithDefault,True,True,0).cs @@ -3,4 +3,11 @@ options ??= new global::Sample.TestClientOptions(); _endpoint = endpoint; -Pipeline = global::System.ClientModel.Primitives.ClientPipeline.Create(options, Array.Empty(), new global::System.ClientModel.Primitives.PipelinePolicy[] { new global::System.ClientModel.Primitives.UserAgentPolicy(typeof(global::Sample.TestClient).Assembly), authenticationPolicy }, Array.Empty()); +if ((authenticationPolicy != null)) +{ + Pipeline = global::System.ClientModel.Primitives.ClientPipeline.Create(options, Array.Empty(), new global::System.ClientModel.Primitives.PipelinePolicy[] { new global::System.ClientModel.Primitives.UserAgentPolicy(typeof(global::Sample.TestClient).Assembly), authenticationPolicy }, Array.Empty()); +} +else +{ + Pipeline = global::System.ClientModel.Primitives.ClientPipeline.Create(options, Array.Empty(), new global::System.ClientModel.Primitives.PipelinePolicy[] { new global::System.ClientModel.Primitives.UserAgentPolicy(typeof(global::Sample.TestClient).Assembly) }, Array.Empty()); +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/TestBuildConstructors_PrimaryConstructor(WithDefault,True,True,1).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/TestBuildConstructors_PrimaryConstructor(WithDefault,True,True,1).cs index 579690c23a0..395de44a9d8 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/TestBuildConstructors_PrimaryConstructor(WithDefault,True,True,1).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/TestBuildConstructors_PrimaryConstructor(WithDefault,True,True,1).cs @@ -3,4 +3,11 @@ options ??= new global::Sample.TestClientOptions(); _endpoint = endpoint; -Pipeline = global::System.ClientModel.Primitives.ClientPipeline.Create(options, Array.Empty(), new global::System.ClientModel.Primitives.PipelinePolicy[] { new global::System.ClientModel.Primitives.UserAgentPolicy(typeof(global::Sample.TestClient).Assembly), authenticationPolicy }, Array.Empty()); +if ((authenticationPolicy != null)) +{ + Pipeline = global::System.ClientModel.Primitives.ClientPipeline.Create(options, Array.Empty(), new global::System.ClientModel.Primitives.PipelinePolicy[] { new global::System.ClientModel.Primitives.UserAgentPolicy(typeof(global::Sample.TestClient).Assembly), authenticationPolicy }, Array.Empty()); +} +else +{ + Pipeline = global::System.ClientModel.Primitives.ClientPipeline.Create(options, Array.Empty(), new global::System.ClientModel.Primitives.PipelinePolicy[] { new global::System.ClientModel.Primitives.UserAgentPolicy(typeof(global::Sample.TestClient).Assembly) }, Array.Empty()); +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/TestBuildConstructors_PrimaryConstructor(WithRequired,False,False,0).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/TestBuildConstructors_PrimaryConstructor(WithRequired,False,False,0).cs index bc5bbc28eac..395de44a9d8 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/TestBuildConstructors_PrimaryConstructor(WithRequired,False,False,0).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/TestBuildConstructors_PrimaryConstructor(WithRequired,False,False,0).cs @@ -3,4 +3,11 @@ options ??= new global::Sample.TestClientOptions(); _endpoint = endpoint; -Pipeline = global::System.ClientModel.Primitives.ClientPipeline.Create(options, Array.Empty(), new global::System.ClientModel.Primitives.PipelinePolicy[] { new global::System.ClientModel.Primitives.UserAgentPolicy(typeof(global::Sample.TestClient).Assembly) }, Array.Empty()); +if ((authenticationPolicy != null)) +{ + Pipeline = global::System.ClientModel.Primitives.ClientPipeline.Create(options, Array.Empty(), new global::System.ClientModel.Primitives.PipelinePolicy[] { new global::System.ClientModel.Primitives.UserAgentPolicy(typeof(global::Sample.TestClient).Assembly), authenticationPolicy }, Array.Empty()); +} +else +{ + Pipeline = global::System.ClientModel.Primitives.ClientPipeline.Create(options, Array.Empty(), new global::System.ClientModel.Primitives.PipelinePolicy[] { new global::System.ClientModel.Primitives.UserAgentPolicy(typeof(global::Sample.TestClient).Assembly) }, Array.Empty()); +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/TestBuildConstructors_PrimaryConstructor(WithRequired,False,True,0).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/TestBuildConstructors_PrimaryConstructor(WithRequired,False,True,0).cs index 579690c23a0..395de44a9d8 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/TestBuildConstructors_PrimaryConstructor(WithRequired,False,True,0).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/TestBuildConstructors_PrimaryConstructor(WithRequired,False,True,0).cs @@ -3,4 +3,11 @@ options ??= new global::Sample.TestClientOptions(); _endpoint = endpoint; -Pipeline = global::System.ClientModel.Primitives.ClientPipeline.Create(options, Array.Empty(), new global::System.ClientModel.Primitives.PipelinePolicy[] { new global::System.ClientModel.Primitives.UserAgentPolicy(typeof(global::Sample.TestClient).Assembly), authenticationPolicy }, Array.Empty()); +if ((authenticationPolicy != null)) +{ + Pipeline = global::System.ClientModel.Primitives.ClientPipeline.Create(options, Array.Empty(), new global::System.ClientModel.Primitives.PipelinePolicy[] { new global::System.ClientModel.Primitives.UserAgentPolicy(typeof(global::Sample.TestClient).Assembly), authenticationPolicy }, Array.Empty()); +} +else +{ + Pipeline = global::System.ClientModel.Primitives.ClientPipeline.Create(options, Array.Empty(), new global::System.ClientModel.Primitives.PipelinePolicy[] { new global::System.ClientModel.Primitives.UserAgentPolicy(typeof(global::Sample.TestClient).Assembly) }, Array.Empty()); +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/TestBuildConstructors_PrimaryConstructor(WithRequired,True,False,0).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/TestBuildConstructors_PrimaryConstructor(WithRequired,True,False,0).cs index 579690c23a0..395de44a9d8 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/TestBuildConstructors_PrimaryConstructor(WithRequired,True,False,0).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/TestBuildConstructors_PrimaryConstructor(WithRequired,True,False,0).cs @@ -3,4 +3,11 @@ options ??= new global::Sample.TestClientOptions(); _endpoint = endpoint; -Pipeline = global::System.ClientModel.Primitives.ClientPipeline.Create(options, Array.Empty(), new global::System.ClientModel.Primitives.PipelinePolicy[] { new global::System.ClientModel.Primitives.UserAgentPolicy(typeof(global::Sample.TestClient).Assembly), authenticationPolicy }, Array.Empty()); +if ((authenticationPolicy != null)) +{ + Pipeline = global::System.ClientModel.Primitives.ClientPipeline.Create(options, Array.Empty(), new global::System.ClientModel.Primitives.PipelinePolicy[] { new global::System.ClientModel.Primitives.UserAgentPolicy(typeof(global::Sample.TestClient).Assembly), authenticationPolicy }, Array.Empty()); +} +else +{ + Pipeline = global::System.ClientModel.Primitives.ClientPipeline.Create(options, Array.Empty(), new global::System.ClientModel.Primitives.PipelinePolicy[] { new global::System.ClientModel.Primitives.UserAgentPolicy(typeof(global::Sample.TestClient).Assembly) }, Array.Empty()); +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/TestBuildConstructors_PrimaryConstructor(WithRequired,True,True,0).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/TestBuildConstructors_PrimaryConstructor(WithRequired,True,True,0).cs index 579690c23a0..395de44a9d8 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/TestBuildConstructors_PrimaryConstructor(WithRequired,True,True,0).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/TestBuildConstructors_PrimaryConstructor(WithRequired,True,True,0).cs @@ -3,4 +3,11 @@ options ??= new global::Sample.TestClientOptions(); _endpoint = endpoint; -Pipeline = global::System.ClientModel.Primitives.ClientPipeline.Create(options, Array.Empty(), new global::System.ClientModel.Primitives.PipelinePolicy[] { new global::System.ClientModel.Primitives.UserAgentPolicy(typeof(global::Sample.TestClient).Assembly), authenticationPolicy }, Array.Empty()); +if ((authenticationPolicy != null)) +{ + Pipeline = global::System.ClientModel.Primitives.ClientPipeline.Create(options, Array.Empty(), new global::System.ClientModel.Primitives.PipelinePolicy[] { new global::System.ClientModel.Primitives.UserAgentPolicy(typeof(global::Sample.TestClient).Assembly), authenticationPolicy }, Array.Empty()); +} +else +{ + Pipeline = global::System.ClientModel.Primitives.ClientPipeline.Create(options, Array.Empty(), new global::System.ClientModel.Primitives.PipelinePolicy[] { new global::System.ClientModel.Primitives.UserAgentPolicy(typeof(global::Sample.TestClient).Assembly) }, Array.Empty()); +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/TestBuildConstructors_PrimaryConstructor(WithRequired,True,True,1).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/TestBuildConstructors_PrimaryConstructor(WithRequired,True,True,1).cs index 579690c23a0..395de44a9d8 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/TestBuildConstructors_PrimaryConstructor(WithRequired,True,True,1).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/TestBuildConstructors_PrimaryConstructor(WithRequired,True,True,1).cs @@ -3,4 +3,11 @@ options ??= new global::Sample.TestClientOptions(); _endpoint = endpoint; -Pipeline = global::System.ClientModel.Primitives.ClientPipeline.Create(options, Array.Empty(), new global::System.ClientModel.Primitives.PipelinePolicy[] { new global::System.ClientModel.Primitives.UserAgentPolicy(typeof(global::Sample.TestClient).Assembly), authenticationPolicy }, Array.Empty()); +if ((authenticationPolicy != null)) +{ + Pipeline = global::System.ClientModel.Primitives.ClientPipeline.Create(options, Array.Empty(), new global::System.ClientModel.Primitives.PipelinePolicy[] { new global::System.ClientModel.Primitives.UserAgentPolicy(typeof(global::Sample.TestClient).Assembly), authenticationPolicy }, Array.Empty()); +} +else +{ + Pipeline = global::System.ClientModel.Primitives.ClientPipeline.Create(options, Array.Empty(), new global::System.ClientModel.Primitives.PipelinePolicy[] { new global::System.ClientModel.Primitives.UserAgentPolicy(typeof(global::Sample.TestClient).Assembly) }, Array.Empty()); +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/ValidateConstructorsWhenUnsupportedAuth.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/ValidateConstructorsWhenUnsupportedAuth.cs index 60e6d68058d..89829df5a76 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/ValidateConstructorsWhenUnsupportedAuth.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/ValidateConstructorsWhenUnsupportedAuth.cs @@ -20,7 +20,14 @@ internal TestClient(global::System.ClientModel.Primitives.AuthenticationPolicy a options ??= new global::Sample.TestClientOptions(); _endpoint = endpoint; - Pipeline = global::System.ClientModel.Primitives.ClientPipeline.Create(options, Array.Empty(), new global::System.ClientModel.Primitives.PipelinePolicy[] { new global::System.ClientModel.Primitives.UserAgentPolicy(typeof(global::Sample.TestClient).Assembly) }, Array.Empty()); + if ((authenticationPolicy != null)) + { + Pipeline = global::System.ClientModel.Primitives.ClientPipeline.Create(options, Array.Empty(), new global::System.ClientModel.Primitives.PipelinePolicy[] { new global::System.ClientModel.Primitives.UserAgentPolicy(typeof(global::Sample.TestClient).Assembly), authenticationPolicy }, Array.Empty()); + } + else + { + Pipeline = global::System.ClientModel.Primitives.ClientPipeline.Create(options, Array.Empty(), new global::System.ClientModel.Primitives.PipelinePolicy[] { new global::System.ClientModel.Primitives.UserAgentPolicy(typeof(global::Sample.TestClient).Assembly) }, Array.Empty()); + } } internal TestClient(global::System.Uri endpoint, global::Sample.TestClientOptions options) : this(null, endpoint, options) diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/XmlDocsAreWritten.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/XmlDocsAreWritten.cs index 5e455f24f4c..7166e071f8c 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/XmlDocsAreWritten.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/XmlDocsAreWritten.cs @@ -1,4 +1,4 @@ -// +// #nullable disable @@ -44,7 +44,14 @@ internal TestClient(global::System.ClientModel.Primitives.AuthenticationPolicy a _endpoint = endpoint; _queryParam = queryParam; - Pipeline = global::System.ClientModel.Primitives.ClientPipeline.Create(options, Array.Empty(), new global::System.ClientModel.Primitives.PipelinePolicy[] { new global::System.ClientModel.Primitives.UserAgentPolicy(typeof(global::Sample.TestClient).Assembly) }, Array.Empty()); + if ((authenticationPolicy != null)) + { + Pipeline = global::System.ClientModel.Primitives.ClientPipeline.Create(options, Array.Empty(), new global::System.ClientModel.Primitives.PipelinePolicy[] { new global::System.ClientModel.Primitives.UserAgentPolicy(typeof(global::Sample.TestClient).Assembly), authenticationPolicy }, Array.Empty()); + } + else + { + Pipeline = global::System.ClientModel.Primitives.ClientPipeline.Create(options, Array.Empty(), new global::System.ClientModel.Primitives.PipelinePolicy[] { new global::System.ClientModel.Primitives.UserAgentPolicy(typeof(global::Sample.TestClient).Assembly) }, Array.Empty()); + } } /// Initializes a new instance of TestClient. diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientSettingsProviderTests.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientSettingsProviderTests.cs index 9c9fc994075..c4f31a8a1a0 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientSettingsProviderTests.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientSettingsProviderTests.cs @@ -617,5 +617,178 @@ public void TestNamespace() Assert.IsNotNull(settingsProvider); Assert.AreEqual(clientProvider.Type.Namespace, settingsProvider!.Type.Namespace); } + + // Sub-client settings tests + + [Test] + public void TestSubClient_IndividuallyInitialized_HasSettings() + { + var endpointParam = InputFactory.EndpointParameter( + "endpoint", + InputPrimitiveType.String, + defaultValue: InputFactory.Constant.String("https://default.endpoint.io"), + scope: InputParameterScope.Client, + isEndpoint: true); + var parentClient = InputFactory.Client("ParentClient", parameters: [endpointParam]); + var subClient = InputFactory.Client( + "SubClient", + parent: parentClient, + parameters: [endpointParam], + initializedBy: InputClientInitializedBy.Individually); + + MockHelpers.LoadMockGenerator( + auth: () => new(new InputApiKeyAuth("mock", null), null), + clients: () => [parentClient]); + + var clientProvider = new ClientProvider(subClient); + var settingsProvider = clientProvider.ClientSettings; + + Assert.IsNotNull(settingsProvider, "Individually-initialized sub-client should have ClientSettings"); + Assert.AreEqual("SubClientSettings", settingsProvider!.Name); + } + + [Test] + public void TestSubClient_ParentOnly_NoSettings() + { + var parentClient = InputFactory.Client("ParentClient"); + var subClient = InputFactory.Client( + "SubClient", + parent: parentClient, + initializedBy: InputClientInitializedBy.Parent); + + MockHelpers.LoadMockGenerator( + auth: () => new(new InputApiKeyAuth("mock", null), null), + clients: () => [parentClient]); + + var clientProvider = new ClientProvider(subClient); + + Assert.IsNull(clientProvider.ClientSettings, "Parent-only sub-client should not have ClientSettings"); + } + + [Test] + public void TestSubClient_IndividuallyInitialized_HasEndpointProperty() + { + var endpointParam = InputFactory.EndpointParameter( + "endpoint", + InputPrimitiveType.String, + defaultValue: InputFactory.Constant.String("https://default.endpoint.io"), + scope: InputParameterScope.Client, + isEndpoint: true); + var parentClient = InputFactory.Client("ParentClient", parameters: [endpointParam]); + var subClient = InputFactory.Client( + "SubClient", + parent: parentClient, + parameters: [endpointParam], + initializedBy: InputClientInitializedBy.Individually); + + MockHelpers.LoadMockGenerator( + auth: () => new(new InputApiKeyAuth("mock", null), null), + clients: () => [parentClient]); + + var clientProvider = new ClientProvider(subClient); + var settingsProvider = clientProvider.ClientSettings; + + Assert.IsNotNull(settingsProvider); + var endpointProp = settingsProvider!.Properties.FirstOrDefault( + p => p.Name == "Endpoint" && p.Type.Equals(new CSharpType(typeof(Uri), isNullable: true))); + Assert.IsNotNull(endpointProp, "Sub-client settings should have an Endpoint property"); + } + + [Test] + public void TestSubClient_IndividuallyInitialized_HasOptionsFromRootClient() + { + var endpointParam = InputFactory.EndpointParameter( + "endpoint", + InputPrimitiveType.String, + defaultValue: InputFactory.Constant.String("https://default.endpoint.io"), + scope: InputParameterScope.Client, + isEndpoint: true); + var parentClient = InputFactory.Client("ParentClient", parameters: [endpointParam]); + var subClient = InputFactory.Client( + "SubClient", + parent: parentClient, + parameters: [endpointParam], + initializedBy: InputClientInitializedBy.Individually); + + MockHelpers.LoadMockGenerator( + auth: () => new(new InputApiKeyAuth("mock", null), null), + clients: () => [parentClient]); + + var clientProvider = new ClientProvider(subClient); + var settingsProvider = clientProvider.ClientSettings; + + Assert.IsNotNull(settingsProvider); + var optionsProp = settingsProvider!.Properties.FirstOrDefault(p => p.Name == "Options"); + Assert.IsNotNull(optionsProp, "Sub-client settings should have Options property from root client"); + + // The Options type should be the parent's ClientOptions type + var parentProvider = new ClientProvider(parentClient); + Assert.IsNotNull(parentProvider.ClientOptions); + Assert.AreEqual( + parentProvider.ClientOptions!.Type.WithNullable(true), + optionsProp!.Type, + "Sub-client settings Options type should match root client's ClientOptions type"); + } + + [Test] + public void TestSubClient_IndividuallyInitialized_BindCoreHasEndpointAndOptions() + { + var endpointParam = InputFactory.EndpointParameter( + "endpoint", + InputPrimitiveType.String, + defaultValue: InputFactory.Constant.String("https://default.endpoint.io"), + scope: InputParameterScope.Client, + isEndpoint: true); + var parentClient = InputFactory.Client("ParentClient", parameters: [endpointParam]); + var subClient = InputFactory.Client( + "SubClient", + parent: parentClient, + parameters: [endpointParam], + initializedBy: InputClientInitializedBy.Individually); + + MockHelpers.LoadMockGenerator( + auth: () => new(new InputApiKeyAuth("mock", null), null), + clients: () => [parentClient]); + + var clientProvider = new ClientProvider(subClient); + var settingsProvider = clientProvider.ClientSettings; + + Assert.IsNotNull(settingsProvider); + var bindCoreMethod = settingsProvider!.Methods.FirstOrDefault(m => m.Signature.Name == "BindCore"); + Assert.IsNotNull(bindCoreMethod, "Sub-client settings should have BindCore method"); + + var bodyString = bindCoreMethod!.BodyStatements!.ToDisplayString(); + Assert.IsTrue(bodyString.Contains("TryCreate"), "BindCore should bind the Endpoint via Uri.TryCreate"); + Assert.IsTrue(bodyString.Contains("GetSection") && bodyString.Contains("Options"), + "BindCore should bind the Options section"); + } + + [Test] + public void TestSubClient_IndividuallyInitialized_SettingsBaseType() + { + var endpointParam = InputFactory.EndpointParameter( + "endpoint", + InputPrimitiveType.String, + defaultValue: InputFactory.Constant.String("https://default.endpoint.io"), + scope: InputParameterScope.Client, + isEndpoint: true); + var parentClient = InputFactory.Client("ParentClient", parameters: [endpointParam]); + var subClient = InputFactory.Client( + "SubClient", + parent: parentClient, + parameters: [endpointParam], + initializedBy: InputClientInitializedBy.Individually); + + MockHelpers.LoadMockGenerator( + auth: () => new(new InputApiKeyAuth("mock", null), null), + clients: () => [parentClient]); + + var clientProvider = new ClientProvider(subClient); + var settingsProvider = clientProvider.ClientSettings; + + Assert.IsNotNull(settingsProvider); + Assert.AreEqual(ClientSettingsProvider.ClientSettingsType, settingsProvider!.Type.BaseType, + "Sub-client settings should inherit from ClientSettings"); + } } } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/common/InputFactory.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/common/InputFactory.cs index 85632b4ee25..f23286ac277 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/common/InputFactory.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/common/InputFactory.cs @@ -709,7 +709,7 @@ public static InputServiceMethodResponse ServiceMethodResponse(InputType? type, private static readonly Dictionary> _childClientsCache = new(); - public static InputClient Client(string name, string clientNamespace = "Sample", string? doc = null, IEnumerable? methods = null, IEnumerable? parameters = null, InputClient? parent = null, string? crossLanguageDefinitionId = null, IEnumerable? apiVersions = null, InputClientInitializedBy initializedBy = InputClientInitializedBy.Default, bool? isMultiServiceClient = false) + public static InputClient Client(string name, string clientNamespace = "Sample", string? doc = null, IEnumerable? methods = null, IEnumerable? parameters = null, InputClient? parent = null, string? crossLanguageDefinitionId = null, IEnumerable? apiVersions = null, InputClientInitializedBy initializedBy = InputClientInitializedBy.Individually, bool? isMultiServiceClient = false) { // when this client has parent, we add the constructed client into the `children` list of the parent var clientChildren = new List(); diff --git a/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/Metrics.cs b/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/Metrics.cs index 8e55488af08..dab61b07de2 100644 --- a/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/Metrics.cs +++ b/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/Metrics.cs @@ -8,6 +8,8 @@ using System; using System.ClientModel; using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; using System.Threading; using System.Threading.Tasks; @@ -17,6 +19,17 @@ namespace SampleTypeSpec public partial class Metrics { private readonly Uri _endpoint; + private const string AuthorizationHeader = "my-api-key"; + /// The OAuth2 flows supported by the service. + private static readonly Dictionary[] _flows = new Dictionary[] + { + new Dictionary + { + { GetTokenOptions.ScopesPropertyName, new string[] { "read" } }, + { GetTokenOptions.AuthorizationUrlPropertyName, "https://api.example.com/oauth2/authorize" }, + { GetTokenOptions.RefreshUrlPropertyName, "https://api.example.com/oauth2/refresh" } + } + }; private readonly string _metricsNamespace; /// Initializes a new instance of Metrics for mocking. @@ -38,19 +51,29 @@ internal Metrics(ClientPipeline pipeline, Uri endpoint, string metricsNamespace) /// Initializes a new instance of Metrics. /// Service endpoint. /// - /// or is null. + /// A credential used to authenticate to the service. + /// , or is null. /// is an empty string, and was expected to be non-empty. - public Metrics(Uri endpoint, string metricsNamespace) : this(endpoint, metricsNamespace, new SampleTypeSpecClientOptions()) + public Metrics(Uri endpoint, string metricsNamespace, ApiKeyCredential credential) : this(endpoint, metricsNamespace, credential, new SampleTypeSpecClientOptions()) { } /// Initializes a new instance of Metrics. /// Service endpoint. /// - /// The options for configuring the client. - /// or is null. + /// A credential provider used to authenticate to the service. + /// , or is null. /// is an empty string, and was expected to be non-empty. - public Metrics(Uri endpoint, string metricsNamespace, SampleTypeSpecClientOptions options) + public Metrics(Uri endpoint, string metricsNamespace, AuthenticationTokenProvider tokenProvider) : this(endpoint, metricsNamespace, tokenProvider, new SampleTypeSpecClientOptions()) + { + } + + /// Initializes a new instance of Metrics. + /// The authentication policy to use for pipeline creation. + /// Service endpoint. + /// + /// The options for configuring the client. + internal Metrics(AuthenticationPolicy authenticationPolicy, Uri endpoint, string metricsNamespace, SampleTypeSpecClientOptions options) { Argument.AssertNotNull(endpoint, nameof(endpoint)); Argument.AssertNotNullOrEmpty(metricsNamespace, nameof(metricsNamespace)); @@ -59,7 +82,43 @@ public Metrics(Uri endpoint, string metricsNamespace, SampleTypeSpecClientOption _endpoint = endpoint; _metricsNamespace = metricsNamespace; - Pipeline = ClientPipeline.Create(options, Array.Empty(), new PipelinePolicy[] { new UserAgentPolicy(typeof(Metrics).Assembly) }, Array.Empty()); + if (authenticationPolicy != null) + { + Pipeline = ClientPipeline.Create(options, Array.Empty(), new PipelinePolicy[] { new UserAgentPolicy(typeof(Metrics).Assembly), authenticationPolicy }, Array.Empty()); + } + else + { + Pipeline = ClientPipeline.Create(options, Array.Empty(), new PipelinePolicy[] { new UserAgentPolicy(typeof(Metrics).Assembly) }, Array.Empty()); + } + } + + /// Initializes a new instance of Metrics. + /// Service endpoint. + /// + /// A credential used to authenticate to the service. + /// The options for configuring the client. + /// , or is null. + /// is an empty string, and was expected to be non-empty. + public Metrics(Uri endpoint, string metricsNamespace, ApiKeyCredential credential, SampleTypeSpecClientOptions options) : this(ApiKeyAuthenticationPolicy.CreateHeaderApiKeyPolicy(credential, AuthorizationHeader), endpoint, metricsNamespace, options) + { + } + + /// Initializes a new instance of Metrics. + /// Service endpoint. + /// + /// A credential provider used to authenticate to the service. + /// The options for configuring the client. + /// , or is null. + /// is an empty string, and was expected to be non-empty. + public Metrics(Uri endpoint, string metricsNamespace, AuthenticationTokenProvider tokenProvider, SampleTypeSpecClientOptions options) : this(new BearerTokenPolicy(tokenProvider, _flows), endpoint, metricsNamespace, options) + { + } + + /// Initializes a new instance of Metrics from a . + /// The settings for Metrics. + [Experimental("SCME0002")] + public Metrics(MetricsSettings settings) : this(AuthenticationPolicy.Create(settings), settings?.SampleTypeSpecUrl, settings?.MetricsNamespace, settings?.Options) + { } /// The HTTP pipeline for sending and receiving REST requests and responses. diff --git a/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/MetricsSettings.cs b/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/MetricsSettings.cs new file mode 100644 index 00000000000..ef92878a0d4 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/MetricsSettings.cs @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; +using Microsoft.Extensions.Configuration; + +namespace SampleTypeSpec +{ + /// Represents the settings used to configure a that can be loaded from an . + [Experimental("SCME0002")] + public partial class MetricsSettings : ClientSettings + { + /// Gets or sets the SampleTypeSpecUrl. + public Uri SampleTypeSpecUrl { get; set; } + + /// Gets or sets the MetricsNamespace. + public string MetricsNamespace { get; set; } + + /// Gets or sets the Options. + public SampleTypeSpecClientOptions Options { get; set; } + + /// Binds configuration values from the given section. + /// The configuration section. + protected override void BindCore(IConfigurationSection section) + { + if (Uri.TryCreate(section["SampleTypeSpecUrl"], UriKind.Absolute, out Uri sampleTypeSpecUrl)) + { + SampleTypeSpecUrl = sampleTypeSpecUrl; + } + string metricsNamespace = section["MetricsNamespace"]; + if (!string.IsNullOrEmpty(metricsNamespace)) + { + MetricsNamespace = metricsNamespace; + } + IConfigurationSection optionsSection = section.GetSection("Options"); + if (optionsSection.Exists()) + { + Options = new SampleTypeSpecClientOptions(optionsSection); + } + } + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/SampleTypeSpecClient.cs b/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/SampleTypeSpecClient.cs index 78cb15103f5..a97f4d223f0 100644 --- a/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/SampleTypeSpecClient.cs +++ b/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/SampleTypeSpecClient.cs @@ -62,7 +62,14 @@ internal SampleTypeSpecClient(AuthenticationPolicy authenticationPolicy, Uri end options ??= new SampleTypeSpecClientOptions(); _endpoint = endpoint; - Pipeline = ClientPipeline.Create(options, Array.Empty(), new PipelinePolicy[] { new UserAgentPolicy(typeof(SampleTypeSpecClient).Assembly), authenticationPolicy }, Array.Empty()); + if (authenticationPolicy != null) + { + Pipeline = ClientPipeline.Create(options, Array.Empty(), new PipelinePolicy[] { new UserAgentPolicy(typeof(SampleTypeSpecClient).Assembly), authenticationPolicy }, Array.Empty()); + } + else + { + Pipeline = ClientPipeline.Create(options, Array.Empty(), new PipelinePolicy[] { new UserAgentPolicy(typeof(SampleTypeSpecClient).Assembly) }, Array.Empty()); + } _apiVersion = options.Version; }