From 1389cb604b7084ab46165efbc3e2feef109b6d89 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 4 Mar 2026 19:56:00 +0000 Subject: [PATCH 01/13] Initial plan From 624a489450d503386e98d59dd8aae3b3895b9589 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 4 Mar 2026 20:29:13 +0000 Subject: [PATCH 02/13] fix(http-client-js): include subclient parameters in accessor methods Co-authored-by: JoshLove-msft <54595583+JoshLove-msft@users.noreply.github.com> --- ...subclient-accessors-2026-03-04-20-00-00.md | 7 + packages/http-client-js/CHANGELOG.md | 7 - .../http-client-js/src/components/client.tsx | 173 +++++++++++++++++- .../scenarios/auth/sub_client_override.md | 7 +- 4 files changed, 184 insertions(+), 10 deletions(-) create mode 100644 .chronus/changes/http-client-js-subclient-accessors-2026-03-04-20-00-00.md diff --git a/.chronus/changes/http-client-js-subclient-accessors-2026-03-04-20-00-00.md b/.chronus/changes/http-client-js-subclient-accessors-2026-03-04-20-00-00.md new file mode 100644 index 00000000000..3b94eea33ab --- /dev/null +++ b/.chronus/changes/http-client-js-subclient-accessors-2026-03-04-20-00-00.md @@ -0,0 +1,7 @@ +--- +changeKind: fix +packages: + - "@typespec/http-client-js" +--- + +Subclient parameters are now included in accessor methods. When a subclient has different constructor parameters from its parent, the parent client now generates an accessor method (instead of no accessor) that accepts the subclient's unique parameters and uses stored shared parameters to create the subclient. diff --git a/packages/http-client-js/CHANGELOG.md b/packages/http-client-js/CHANGELOG.md index ae31429629c..02e0fd151ad 100644 --- a/packages/http-client-js/CHANGELOG.md +++ b/packages/http-client-js/CHANGELOG.md @@ -6,7 +6,6 @@ - [#9446](https://github.com/microsoft/typespec/pull/9446) Upgrade dependencies - ## 0.13.0 ### Bump dependencies @@ -14,28 +13,24 @@ - [#9202](https://github.com/microsoft/typespec/pull/9202) Update to alloy 0.22 - [#9223](https://github.com/microsoft/typespec/pull/9223) Upgrade dependencies - ## 0.12.0 ### Bump dependencies - [#9046](https://github.com/microsoft/typespec/pull/9046) Upgrade dependencies - ## 0.11.0 ### Bump dependencies - [#8823](https://github.com/microsoft/typespec/pull/8823) Upgrade dependencies - ## 0.10.0 ### Bug Fixes - [#8613](https://github.com/microsoft/typespec/pull/8613) Remove warning when no explicit content type is provided to a multipart part - ## 0.9.0 ### Features @@ -50,7 +45,6 @@ - [#8362](https://github.com/microsoft/typespec/pull/8362) Upgrade alloy to 0.20 - ## 0.8.0 ### Bump dependencies @@ -62,7 +56,6 @@ - [#8056](https://github.com/microsoft/typespec/pull/8056) Fix the missing `main` field issue in package.json - ## 0.7.0 ### Bump dependencies diff --git a/packages/http-client-js/src/components/client.tsx b/packages/http-client-js/src/components/client.tsx index 3c3beceee37..cdc1f260ffd 100644 --- a/packages/http-client-js/src/components/client.tsx +++ b/packages/http-client-js/src/components/client.tsx @@ -1,5 +1,6 @@ import { For, List, Refkey, refkey } from "@alloy-js/core"; import * as ts from "@alloy-js/typescript"; +import { type Typekit } from "@typespec/compiler/typekit"; import { useTsp } from "@typespec/emitter-framework"; import { ClassMethod } from "@typespec/emitter-framework/typescript"; import * as cl from "@typespec/http-client"; @@ -45,6 +46,44 @@ export function getClientClassRef(client: cl.Client) { function getClientContextFieldRef(client: cl.Client) { return refkey(client.type, "client-context"); } + +/** + * Returns a stable refkey for a private stored-parameter field on the parent client. + * These stored fields are used by subclient accessor methods to pass shared parameters. + */ +function getStoredParamFieldRef(parentClient: cl.Client, paramName: string): Refkey { + return refkey(parentClient.type, `stored-${paramName}`); +} + +/** + * Returns the set of parameter names that are shared between a parent client and a subclient, + * where "shared" means the parameter has the same name AND the same TypeSpec type in both clients. + * Options parameters are excluded. + */ +function getCompatibleSharedParamNames( + tk: Typekit, + parentClient: cl.Client, + subClient: cl.Client, +): Set { + const parentConstructor = tk.client.getConstructor(parentClient); + const parentParams = tk.operation.getClientSignature(parentClient, parentConstructor); + const parentParamsByName = new Map(parentParams.map((p) => [p.name, p])); + + const subClientConstructor = tk.client.getConstructor(subClient); + const subClientParams = tk.operation.getClientSignature(subClient, subClientConstructor); + + const shared = new Set(); + for (const sp of subClientParams) { + if (sp.name === "options") continue; + const pp = parentParamsByName.get(sp.name); + // Only treat as shared if the TypeSpec type is the same object (identity check) + if (pp && pp.type === sp.type) { + shared.add(sp.name); + } + } + return shared; +} + export function ClientClass(props: ClientClassProps) { const { $ } = useTsp(); const namePolicy = ts.useTSNamePolicy(); @@ -54,6 +93,12 @@ export function ClientClass(props: ClientClassProps) { const clientClassRef = getClientClassRef(props.client); const subClients = props.client.subClients; const operations = props.client.operations; + + // Subclients with different constructors need accessor methods instead of fields + const diffConstrSubClients = subClients.filter( + (sc) => !$.client.haveSameConstructor(sc, props.client), + ); + return ( @@ -63,6 +108,8 @@ export function ClientClass(props: ClientClassProps) { refkey={contextMemberRef} type={contextDeclarationRef} /> + {/* Private stored-parameter fields used by subclient accessor methods */} + {(subClient) => } @@ -91,11 +138,61 @@ export function ClientClass(props: ClientClassProps) { ); }} + {/* Accessor methods for subclients with different constructor parameters */} + + {(subClient) => ( + + )} + ); } +interface StoredParamFieldsProps { + client: cl.Client; + diffConstrSubClients: cl.Client[]; +} + +/** + * Renders private class fields for each constructor parameter that is shared between the parent + * client and any of its different-constructor subclients. These stored fields are referenced by + * the subclient accessor methods. + */ +function StoredParamFields(props: StoredParamFieldsProps) { + const { $ } = useTsp(); + const parentParams = buildClientParameters(props.client, refkey()); + + // Collect unique shared param names/types across all different-constructor subclients + const storedParamMap = new Map(); + for (const subClient of props.diffConstrSubClients) { + const sharedNames = getCompatibleSharedParamNames($, props.client, subClient); + for (const name of sharedNames) { + if (!storedParamMap.has(name)) { + const parentParam = parentParams.find((pp) => String(pp.name) === name); + if (parentParam) { + storedParamMap.set(name, parentParam); + } + } + } + } + + const storedParams = [...storedParamMap.values()]; + + return ( + + {(param) => ( + + )} + + ); +} + interface SubClientClassFieldProps { client: cl.Client; } @@ -107,8 +204,7 @@ function getSubClientClassFieldRef(client: cl.Client) { function SubClientClassField(props: SubClientClassFieldProps) { const { $ } = useTsp(); const parent = props.client.parent; - // If sub client has different parameters than client, don't add it as a subclass field - // Todo: We need to detect the extra parameters and make this field a factory for the subclient + // Subclients with different constructor parameters are exposed as accessor methods instead if (parent && !$.client.haveSameConstructor(props.client, parent)) { return null; } @@ -129,15 +225,42 @@ function ClientConstructor(props: ClientConstructorProps) { const subClients = props.client.subClients.filter((sc) => $.client.haveSameConstructor(sc, props.client), ); + const diffConstrSubClients = props.client.subClients.filter( + (sc) => !$.client.haveSameConstructor(sc, props.client), + ); const clientContextFieldRef = getClientContextFieldRef(props.client); const clientContextFactoryRef = getClientContextFactoryRef(props.client); const constructorParameters = buildClientParameters(props.client, refkey()); const args = Object.values(constructorParameters).map((p) => p.refkey); + // Compute the stored params needed for different-constructor subclient accessor methods + const storedParamNames = new Set(); + for (const subClient of diffConstrSubClients) { + const sharedNames = getCompatibleSharedParamNames($, props.client, subClient); + for (const name of sharedNames) { + storedParamNames.add(name); + } + } + const storedParamAssignments = [...storedParamNames].map((name) => { + const parentParam = constructorParameters.find((p) => String(p.name) === name)!; + return { + name, + storedRef: getStoredParamFieldRef(props.client, name), + paramRef: parentParam.refkey, + }; + }); + return ( {clientContextFieldRef} ={" "} ;
+ + {(assignment) => ( + <> + {assignment.storedRef} = {assignment.paramRef}; + + )} + {(subClient) => { const subClientFieldRef = getSubClientClassFieldRef(subClient); @@ -153,6 +276,52 @@ function ClientConstructor(props: ClientConstructorProps) { ); } +interface SubClientAccessorMethodProps { + subClient: cl.Client; + parentClient: cl.Client; +} + +/** + * Renders an accessor method for a subclient whose constructor parameters differ from the parent. + * The method takes the subclient's extra parameters (those not shared with the parent) and uses + * the parent's stored shared parameters to construct and return the subclient. + */ +function SubClientAccessorMethod(props: SubClientAccessorMethodProps) { + const { $ } = useTsp(); + const namePolicy = ts.useTSNamePolicy(); + + const accessorSuffixRefkey = refkey(); + const subClientParams = buildClientParameters(props.subClient, accessorSuffixRefkey); + + // Shared params: same name AND same TypeSpec type in both parent and subclient + const sharedParamNames = getCompatibleSharedParamNames($, props.parentClient, props.subClient); + + // Extra params (only in subclient or different type) and the options param → accessor method parameters + const accessorMethodParams = subClientParams.filter((p) => !sharedParamNames.has(String(p.name))); + + // Build the argument list for `new SubClient(...)` following the subclient's constructor order + const subClientConstructorArgs: Refkey[] = subClientParams.flatMap((p) => { + const paramName = String(p.name); + if (paramName === "options") { + const optionsParam = accessorMethodParams.find((ap) => String(ap.name) === "options"); + return optionsParam?.refkey ? optionsParam.refkey : []; + } else if (sharedParamNames.has(paramName)) { + return [getStoredParamFieldRef(props.parentClient, paramName)]; + } else { + const methodParam = accessorMethodParams.find((ap) => String(ap.name) === paramName); + return methodParam?.refkey ? methodParam.refkey : []; + } + }); + + const methodName = namePolicy.getName($.client.getName(props.subClient), "class"); + + return ( + + return ; + + ); +} + function calculateSubClientArgs(subClient: cl.Client, parentParams: ts.ParameterDescriptor[]) { const subClientParams = buildClientParameters(subClient, refkey()).map((p) => p.name); return parentParams diff --git a/packages/http-client-js/test/scenarios/auth/sub_client_override.md b/packages/http-client-js/test/scenarios/auth/sub_client_override.md index 52aba4b8632..8f3bb6b7afe 100644 --- a/packages/http-client-js/test/scenarios/auth/sub_client_override.md +++ b/packages/http-client-js/test/scenarios/auth/sub_client_override.md @@ -29,17 +29,22 @@ namespace Sub { The client signature should include a positional parameter for credential of type KeyCredential. A basic auth token is a key credential that gets put into the Authorization header/ -The subclient is not a child of the TestClient because they have different parameter. +The subclient is accessible from the TestClient via an accessor method since they have different constructor parameters. The accessor method takes only the subclient's unique parameters. ```ts src/testClient.ts class TestClient export class TestClient { #context: TestClientContext; + #endpoint: string; constructor(endpoint: string, credential: BasicCredential, options?: TestClientOptions) { this.#context = createTestClientContext(endpoint, credential, options); + this.#endpoint = endpoint; } async valid(options?: ValidOptions) { return valid(this.#context, options); } + subClient(options?: SubClientOptions) { + return new SubClient(this.#endpoint, options); + } } ``` From 533c12beedce249b3bb5114a473563b34e28b705 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 4 Mar 2026 20:58:47 +0000 Subject: [PATCH 03/13] fix(http-client-csharp): include subclient parameters in accessor methods Reverts incorrect JS emitter changes and implements the fix in the C# emitter (ClientProvider.cs) where the issue actually belongs. When a subclient has parameters not present on the parent client, the parent's accessor method now accepts those extra parameters and passes them to the subclient constructor. Caching is bypassed for parameterized accessors since different parameter values may produce different client instances. Co-authored-by: JoshLove-msft <54595583+JoshLove-msft@users.noreply.github.com> --- ...ent-accessor-params-2026-03-04-20-30-00.md | 7 + ...subclient-accessors-2026-03-04-20-00-00.md | 7 - .../src/Providers/ClientProvider.cs | 105 ++++++++--- .../ClientProviders/ClientProviderTests.cs | 56 ++++++ .../http-client-js/src/components/client.tsx | 173 +----------------- .../scenarios/auth/sub_client_override.md | 7 +- 6 files changed, 150 insertions(+), 205 deletions(-) create mode 100644 .chronus/changes/http-client-csharp-subclient-accessor-params-2026-03-04-20-30-00.md delete mode 100644 .chronus/changes/http-client-js-subclient-accessors-2026-03-04-20-00-00.md diff --git a/.chronus/changes/http-client-csharp-subclient-accessor-params-2026-03-04-20-30-00.md b/.chronus/changes/http-client-csharp-subclient-accessor-params-2026-03-04-20-30-00.md new file mode 100644 index 00000000000..5acb5e05500 --- /dev/null +++ b/.chronus/changes/http-client-csharp-subclient-accessor-params-2026-03-04-20-30-00.md @@ -0,0 +1,7 @@ +--- +changeKind: fix +packages: + - "@typespec/http-client-csharp" +--- + +Subclient parameters are now included in accessor methods. When a subclient has parameters not present on the parent client (e.g., a resource ID for a scoped subclient that can also be created individually), the parent's accessor method now accepts those extra parameters and passes them to the subclient constructor. Caching is bypassed for parameterized accessors since different parameter values may produce different client instances. diff --git a/.chronus/changes/http-client-js-subclient-accessors-2026-03-04-20-00-00.md b/.chronus/changes/http-client-js-subclient-accessors-2026-03-04-20-00-00.md deleted file mode 100644 index 3b94eea33ab..00000000000 --- a/.chronus/changes/http-client-js-subclient-accessors-2026-03-04-20-00-00.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -changeKind: fix -packages: - - "@typespec/http-client-js" ---- - -Subclient parameters are now included in accessor methods. When a subclient has different constructor parameters from its parent, the parent client now generates an accessor method (instead of no accessor) that accepts the subclient's unique parameters and uses stored shared parameters to create the subclient. 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 606a888af4c..c330b05a002 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 @@ -309,6 +309,24 @@ private IReadOnlyList GetSubClientInternalConstructorParamete return subClientParameters; } + /// + /// Determines whether this subclient has non-infrastructure parameters (i.e. parameters that + /// are not API versions and not the endpoint parameter) that are absent from the given parent + /// client and therefore need to be included as parameters in the parent's accessor method. + /// Uses the raw to avoid circular lazy-initialization dependencies. + /// + internal bool HasAccessorOnlyParameters(InputClient parentInputClient) + { + var parentParamNames = parentInputClient.Parameters + .Select(p => p.Name) + .ToHashSet(StringComparer.OrdinalIgnoreCase); + + return _inputClient.Parameters + .Any(p => !p.IsApiVersion && + !(p is InputEndpointParameter ep && ep.IsEndpoint) && + !parentParamNames.Contains(p.Name)); + } + private Lazy> _clientParameters; internal IReadOnlyList ClientParameters => _clientParameters.Value; private IReadOnlyList GetClientParameters() @@ -397,7 +415,10 @@ protected override FieldProvider[] BuildFields() // add sub-client caching fields foreach (var subClient in _subClients.Value) { - if (subClient._clientCachingField != null) + // Only add caching field when the accessor does not require additional parameters. + // If the subclient has parameters that are not on the parent, each accessor call may + // produce a different client instance, so caching is not appropriate. + if (subClient._clientCachingField != null && !subClient.HasAccessorOnlyParameters(_inputClient)) { fields.Add(subClient._clientCachingField); } @@ -899,8 +920,21 @@ protected override ScmMethodProvider[] BuildMethods() var cachedClientFieldVar = new VariableExpression(subClient.Type, subClient._clientCachingField.Declaration, IsRef: true); List subClientConstructorArgs = new(3); - - // Populate constructor arguments + List accessorMethodParams = []; + + // Determine which subclient parameters are "extra" — present in the subclient's + // InputClient.Parameters but not in the parent's InputClient.Parameters. + // Only these should be exposed as accessor method parameters. + var parentInputParamNames = _inputClient.Parameters + .Select(p => p.Name) + .ToHashSet(StringComparer.OrdinalIgnoreCase); + var subClientExtraInputParamNames = subClient._inputClient.Parameters + .Where(p => !p.IsApiVersion && !(p is InputEndpointParameter ep && ep.IsEndpoint)) + .Where(p => !parentInputParamNames.Contains(p.Name)) + .Select(p => p.Name) + .ToHashSet(StringComparer.OrdinalIgnoreCase); + + // Populate constructor arguments, collecting extra params for the accessor method signature foreach (var param in subClient._subClientInternalConstructorParams.Value) { if (parentClientProperties.TryGetValue(param.Name, out var parentProperty)) @@ -920,30 +954,59 @@ protected override ScmMethodProvider[] BuildMethods() subClientConstructorArgs.Add(correspondingApiVersionField.Field); } } + else if (subClientExtraInputParamNames.Contains(param.Name)) + { + // This parameter is subclient-specific and not available on the parent -- + // expose it as an accessor method parameter. + accessorMethodParams.Add(param); + subClientConstructorArgs.Add(param); + } + // else: infra param (pipeline, auth, endpoint) not found in parent mock — silently skip } - // Create the interlocked compare exchange expression for the body - var interlockedCompareExchange = Static(typeof(Interlocked)).Invoke( - nameof(Interlocked.CompareExchange), - [cachedClientFieldVar, New.Instance(subClient.Type, subClientConstructorArgs), Null]); var factoryMethodName = subClient.Name.EndsWith(ClientSuffix, StringComparison.OrdinalIgnoreCase) ? $"Get{subClient.Name}" : $"Get{subClient.Name}{ClientSuffix}"; - var factoryMethod = new ScmMethodProvider( - new( - factoryMethodName, - $"Initializes a new instance of {subClient.Type.Name}", - MethodSignatureModifiers.Public | MethodSignatureModifiers.Virtual, - subClient.Type, - null, - []), - // return Volatile.Read(ref _cachedClient) ?? Interlocked.CompareExchange(ref _cachedClient, new Client(_pipeline, _keyCredential, _endpoint), null) ?? _cachedClient; - Return( - Static(typeof(Volatile)).Invoke(nameof(Volatile.Read), cachedClientFieldVar) - .NullCoalesce(interlockedCompareExchange.NullCoalesce(subClient._clientCachingField))), - this, - ScmMethodKind.Convenience); + ScmMethodProvider factoryMethod; + if (accessorMethodParams.Count > 0) + { + // When the accessor requires extra parameters, caching is not appropriate + // (different parameter values may produce different client instances). + // Return a new instance directly. + factoryMethod = new ScmMethodProvider( + new( + factoryMethodName, + $"Initializes a new instance of {subClient.Type.Name}", + MethodSignatureModifiers.Public | MethodSignatureModifiers.Virtual, + subClient.Type, + null, + [.. accessorMethodParams]), + Return(New.Instance(subClient.Type, subClientConstructorArgs)), + this, + ScmMethodKind.Convenience); + } + else + { + // No extra params - use the existing caching pattern + var interlockedCompareExchange = Static(typeof(Interlocked)).Invoke( + nameof(Interlocked.CompareExchange), + [cachedClientFieldVar, New.Instance(subClient.Type, subClientConstructorArgs), Null]); + factoryMethod = new ScmMethodProvider( + new( + factoryMethodName, + $"Initializes a new instance of {subClient.Type.Name}", + MethodSignatureModifiers.Public | MethodSignatureModifiers.Virtual, + subClient.Type, + null, + []), + // return Volatile.Read(ref _cachedClient) ?? Interlocked.CompareExchange(ref _cachedClient, new Client(_pipeline, _keyCredential, _endpoint), null) ?? _cachedClient; + Return( + Static(typeof(Volatile)).Invoke(nameof(Volatile.Read), cachedClientFieldVar) + .NullCoalesce(interlockedCompareExchange.NullCoalesce(subClient._clientCachingField))), + this, + ScmMethodKind.Convenience); + } methods.Add(factoryMethod); } 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 9d1a8bbacdf..a0cd8c5a4da 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 @@ -899,6 +899,62 @@ public void TestBuildMethods_ForParent_InitializedByBoth_HasSubClientAccessor() Assert.IsNotNull(cachingField, "Parent should have caching field for subclient with InitializedBy.Individually | Parent"); } + [Test] + public void TestBuildMethods_ForParent_InitializedByBoth_WithSubClientParams_HasParameterizedAccessor() + { + var parentClient = InputFactory.Client("ParentClient"); + var subClientParam = InputFactory.PathParameter("resourceId", InputPrimitiveType.String, scope: InputParameterScope.Client); + var subClient = InputFactory.Client( + "SubClient", + parent: parentClient, + parameters: [subClientParam], + initializedBy: InputClientInitializedBy.Individually | InputClientInitializedBy.Parent); + + MockHelpers.LoadMockGenerator( + clients: () => [parentClient]); + + var parentProvider = new ClientProvider(parentClient); + + Assert.IsNotNull(parentProvider); + + // The parent should have a factory method for the subclient + var factoryMethod = parentProvider.Methods.FirstOrDefault( + m => m.Signature?.Name == "GetSubClient" || m.Signature?.Name == "GetSubClientClient"); + Assert.IsNotNull(factoryMethod, "Parent should have factory method for subclient with parameters"); + + // The accessor method should include the subclient's extra parameters + Assert.IsNotNull(factoryMethod!.Signature, "Factory method should have a signature"); + Assert.AreEqual(1, factoryMethod.Signature!.Parameters.Count, + "Accessor method should include subclient parameters not present on parent"); + Assert.AreEqual("resourceId", factoryMethod.Signature.Parameters[0].Name, + "Accessor method parameter should be the subclient's extra parameter"); + } + + [Test] + public void TestBuildFields_ForParent_InitializedByBoth_WithSubClientParams_NoCachingField() + { + var parentClient = InputFactory.Client("ParentClient"); + var subClientParam = InputFactory.PathParameter("resourceId", InputPrimitiveType.String, scope: InputParameterScope.Client); + var subClient = InputFactory.Client( + "SubClient", + parent: parentClient, + parameters: [subClientParam], + initializedBy: InputClientInitializedBy.Individually | InputClientInitializedBy.Parent); + + MockHelpers.LoadMockGenerator( + clients: () => [parentClient]); + + var parentProvider = new ClientProvider(parentClient); + + Assert.IsNotNull(parentProvider); + + // The parent should NOT have a caching field for the subclient when the accessor requires parameters, + // since caching is not appropriate when different parameter values produce different client instances. + var cachingField = parentProvider.Fields.FirstOrDefault(f => f.Name == "_cachedSubClient"); + Assert.IsNull(cachingField, "Parent should not have caching field for subclient that has subclient-specific parameters in its accessor"); + } + + private void ValidatePrimaryConstructor( ConstructorProvider primaryPublicConstructor, List inputParameters, diff --git a/packages/http-client-js/src/components/client.tsx b/packages/http-client-js/src/components/client.tsx index cdc1f260ffd..3c3beceee37 100644 --- a/packages/http-client-js/src/components/client.tsx +++ b/packages/http-client-js/src/components/client.tsx @@ -1,6 +1,5 @@ import { For, List, Refkey, refkey } from "@alloy-js/core"; import * as ts from "@alloy-js/typescript"; -import { type Typekit } from "@typespec/compiler/typekit"; import { useTsp } from "@typespec/emitter-framework"; import { ClassMethod } from "@typespec/emitter-framework/typescript"; import * as cl from "@typespec/http-client"; @@ -46,44 +45,6 @@ export function getClientClassRef(client: cl.Client) { function getClientContextFieldRef(client: cl.Client) { return refkey(client.type, "client-context"); } - -/** - * Returns a stable refkey for a private stored-parameter field on the parent client. - * These stored fields are used by subclient accessor methods to pass shared parameters. - */ -function getStoredParamFieldRef(parentClient: cl.Client, paramName: string): Refkey { - return refkey(parentClient.type, `stored-${paramName}`); -} - -/** - * Returns the set of parameter names that are shared between a parent client and a subclient, - * where "shared" means the parameter has the same name AND the same TypeSpec type in both clients. - * Options parameters are excluded. - */ -function getCompatibleSharedParamNames( - tk: Typekit, - parentClient: cl.Client, - subClient: cl.Client, -): Set { - const parentConstructor = tk.client.getConstructor(parentClient); - const parentParams = tk.operation.getClientSignature(parentClient, parentConstructor); - const parentParamsByName = new Map(parentParams.map((p) => [p.name, p])); - - const subClientConstructor = tk.client.getConstructor(subClient); - const subClientParams = tk.operation.getClientSignature(subClient, subClientConstructor); - - const shared = new Set(); - for (const sp of subClientParams) { - if (sp.name === "options") continue; - const pp = parentParamsByName.get(sp.name); - // Only treat as shared if the TypeSpec type is the same object (identity check) - if (pp && pp.type === sp.type) { - shared.add(sp.name); - } - } - return shared; -} - export function ClientClass(props: ClientClassProps) { const { $ } = useTsp(); const namePolicy = ts.useTSNamePolicy(); @@ -93,12 +54,6 @@ export function ClientClass(props: ClientClassProps) { const clientClassRef = getClientClassRef(props.client); const subClients = props.client.subClients; const operations = props.client.operations; - - // Subclients with different constructors need accessor methods instead of fields - const diffConstrSubClients = subClients.filter( - (sc) => !$.client.haveSameConstructor(sc, props.client), - ); - return ( @@ -108,8 +63,6 @@ export function ClientClass(props: ClientClassProps) { refkey={contextMemberRef} type={contextDeclarationRef} /> - {/* Private stored-parameter fields used by subclient accessor methods */} - {(subClient) => } @@ -138,61 +91,11 @@ export function ClientClass(props: ClientClassProps) { ); }} - {/* Accessor methods for subclients with different constructor parameters */} - - {(subClient) => ( - - )} - ); } -interface StoredParamFieldsProps { - client: cl.Client; - diffConstrSubClients: cl.Client[]; -} - -/** - * Renders private class fields for each constructor parameter that is shared between the parent - * client and any of its different-constructor subclients. These stored fields are referenced by - * the subclient accessor methods. - */ -function StoredParamFields(props: StoredParamFieldsProps) { - const { $ } = useTsp(); - const parentParams = buildClientParameters(props.client, refkey()); - - // Collect unique shared param names/types across all different-constructor subclients - const storedParamMap = new Map(); - for (const subClient of props.diffConstrSubClients) { - const sharedNames = getCompatibleSharedParamNames($, props.client, subClient); - for (const name of sharedNames) { - if (!storedParamMap.has(name)) { - const parentParam = parentParams.find((pp) => String(pp.name) === name); - if (parentParam) { - storedParamMap.set(name, parentParam); - } - } - } - } - - const storedParams = [...storedParamMap.values()]; - - return ( - - {(param) => ( - - )} - - ); -} - interface SubClientClassFieldProps { client: cl.Client; } @@ -204,7 +107,8 @@ function getSubClientClassFieldRef(client: cl.Client) { function SubClientClassField(props: SubClientClassFieldProps) { const { $ } = useTsp(); const parent = props.client.parent; - // Subclients with different constructor parameters are exposed as accessor methods instead + // If sub client has different parameters than client, don't add it as a subclass field + // Todo: We need to detect the extra parameters and make this field a factory for the subclient if (parent && !$.client.haveSameConstructor(props.client, parent)) { return null; } @@ -225,42 +129,15 @@ function ClientConstructor(props: ClientConstructorProps) { const subClients = props.client.subClients.filter((sc) => $.client.haveSameConstructor(sc, props.client), ); - const diffConstrSubClients = props.client.subClients.filter( - (sc) => !$.client.haveSameConstructor(sc, props.client), - ); const clientContextFieldRef = getClientContextFieldRef(props.client); const clientContextFactoryRef = getClientContextFactoryRef(props.client); const constructorParameters = buildClientParameters(props.client, refkey()); const args = Object.values(constructorParameters).map((p) => p.refkey); - // Compute the stored params needed for different-constructor subclient accessor methods - const storedParamNames = new Set(); - for (const subClient of diffConstrSubClients) { - const sharedNames = getCompatibleSharedParamNames($, props.client, subClient); - for (const name of sharedNames) { - storedParamNames.add(name); - } - } - const storedParamAssignments = [...storedParamNames].map((name) => { - const parentParam = constructorParameters.find((p) => String(p.name) === name)!; - return { - name, - storedRef: getStoredParamFieldRef(props.client, name), - paramRef: parentParam.refkey, - }; - }); - return ( {clientContextFieldRef} ={" "} ;
- - {(assignment) => ( - <> - {assignment.storedRef} = {assignment.paramRef}; - - )} - {(subClient) => { const subClientFieldRef = getSubClientClassFieldRef(subClient); @@ -276,52 +153,6 @@ function ClientConstructor(props: ClientConstructorProps) { ); } -interface SubClientAccessorMethodProps { - subClient: cl.Client; - parentClient: cl.Client; -} - -/** - * Renders an accessor method for a subclient whose constructor parameters differ from the parent. - * The method takes the subclient's extra parameters (those not shared with the parent) and uses - * the parent's stored shared parameters to construct and return the subclient. - */ -function SubClientAccessorMethod(props: SubClientAccessorMethodProps) { - const { $ } = useTsp(); - const namePolicy = ts.useTSNamePolicy(); - - const accessorSuffixRefkey = refkey(); - const subClientParams = buildClientParameters(props.subClient, accessorSuffixRefkey); - - // Shared params: same name AND same TypeSpec type in both parent and subclient - const sharedParamNames = getCompatibleSharedParamNames($, props.parentClient, props.subClient); - - // Extra params (only in subclient or different type) and the options param → accessor method parameters - const accessorMethodParams = subClientParams.filter((p) => !sharedParamNames.has(String(p.name))); - - // Build the argument list for `new SubClient(...)` following the subclient's constructor order - const subClientConstructorArgs: Refkey[] = subClientParams.flatMap((p) => { - const paramName = String(p.name); - if (paramName === "options") { - const optionsParam = accessorMethodParams.find((ap) => String(ap.name) === "options"); - return optionsParam?.refkey ? optionsParam.refkey : []; - } else if (sharedParamNames.has(paramName)) { - return [getStoredParamFieldRef(props.parentClient, paramName)]; - } else { - const methodParam = accessorMethodParams.find((ap) => String(ap.name) === paramName); - return methodParam?.refkey ? methodParam.refkey : []; - } - }); - - const methodName = namePolicy.getName($.client.getName(props.subClient), "class"); - - return ( - - return ; - - ); -} - function calculateSubClientArgs(subClient: cl.Client, parentParams: ts.ParameterDescriptor[]) { const subClientParams = buildClientParameters(subClient, refkey()).map((p) => p.name); return parentParams diff --git a/packages/http-client-js/test/scenarios/auth/sub_client_override.md b/packages/http-client-js/test/scenarios/auth/sub_client_override.md index 8f3bb6b7afe..52aba4b8632 100644 --- a/packages/http-client-js/test/scenarios/auth/sub_client_override.md +++ b/packages/http-client-js/test/scenarios/auth/sub_client_override.md @@ -29,22 +29,17 @@ namespace Sub { The client signature should include a positional parameter for credential of type KeyCredential. A basic auth token is a key credential that gets put into the Authorization header/ -The subclient is accessible from the TestClient via an accessor method since they have different constructor parameters. The accessor method takes only the subclient's unique parameters. +The subclient is not a child of the TestClient because they have different parameter. ```ts src/testClient.ts class TestClient export class TestClient { #context: TestClientContext; - #endpoint: string; constructor(endpoint: string, credential: BasicCredential, options?: TestClientOptions) { this.#context = createTestClientContext(endpoint, credential, options); - this.#endpoint = endpoint; } async valid(options?: ValidOptions) { return valid(this.#context, options); } - subClient(options?: SubClientOptions) { - return new SubClient(this.#endpoint, options); - } } ``` From 8c982c7c81f8d8199b0e643ae7ae0dcdec6bf830 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 4 Mar 2026 21:51:38 +0000 Subject: [PATCH 04/13] revert: restore http-client-js/CHANGELOG.md to original state Co-authored-by: JoshLove-msft <54595583+JoshLove-msft@users.noreply.github.com> --- packages/http-client-js/CHANGELOG.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/packages/http-client-js/CHANGELOG.md b/packages/http-client-js/CHANGELOG.md index 02e0fd151ad..ae31429629c 100644 --- a/packages/http-client-js/CHANGELOG.md +++ b/packages/http-client-js/CHANGELOG.md @@ -6,6 +6,7 @@ - [#9446](https://github.com/microsoft/typespec/pull/9446) Upgrade dependencies + ## 0.13.0 ### Bump dependencies @@ -13,24 +14,28 @@ - [#9202](https://github.com/microsoft/typespec/pull/9202) Update to alloy 0.22 - [#9223](https://github.com/microsoft/typespec/pull/9223) Upgrade dependencies + ## 0.12.0 ### Bump dependencies - [#9046](https://github.com/microsoft/typespec/pull/9046) Upgrade dependencies + ## 0.11.0 ### Bump dependencies - [#8823](https://github.com/microsoft/typespec/pull/8823) Upgrade dependencies + ## 0.10.0 ### Bug Fixes - [#8613](https://github.com/microsoft/typespec/pull/8613) Remove warning when no explicit content type is provided to a multipart part + ## 0.9.0 ### Features @@ -45,6 +50,7 @@ - [#8362](https://github.com/microsoft/typespec/pull/8362) Upgrade alloy to 0.20 + ## 0.8.0 ### Bump dependencies @@ -56,6 +62,7 @@ - [#8056](https://github.com/microsoft/typespec/pull/8056) Fix the missing `main` field issue in package.json + ## 0.7.0 ### Bump dependencies From 08eb7b2692c3a8acec49f9ff17d8b7a827e60974 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 4 Mar 2026 21:53:05 +0000 Subject: [PATCH 05/13] chore: delete stale http-client-csharp changeset file Co-authored-by: JoshLove-msft <54595583+JoshLove-msft@users.noreply.github.com> --- ...csharp-subclient-accessor-params-2026-03-04-20-30-00.md | 7 ------- 1 file changed, 7 deletions(-) delete mode 100644 .chronus/changes/http-client-csharp-subclient-accessor-params-2026-03-04-20-30-00.md diff --git a/.chronus/changes/http-client-csharp-subclient-accessor-params-2026-03-04-20-30-00.md b/.chronus/changes/http-client-csharp-subclient-accessor-params-2026-03-04-20-30-00.md deleted file mode 100644 index 5acb5e05500..00000000000 --- a/.chronus/changes/http-client-csharp-subclient-accessor-params-2026-03-04-20-30-00.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -changeKind: fix -packages: - - "@typespec/http-client-csharp" ---- - -Subclient parameters are now included in accessor methods. When a subclient has parameters not present on the parent client (e.g., a resource ID for a scoped subclient that can also be created individually), the parent's accessor method now accepts those extra parameters and passes them to the subclient constructor. Caching is bypassed for parameterized accessors since different parameter values may produce different client instances. From afdc1da84b03a94a18667f53ac9d78f3aa5b928b Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 4 Mar 2026 23:06:09 +0000 Subject: [PATCH 06/13] fix: parameterized accessor for IndividuallyParent subclients with accessor-only parameters - Add HasAccessorOnlyParameters() to ClientProvider to detect subclient-specific params - BuildFields(): skip caching field when subclient has accessor-only params - BuildMethods(): generate parameterized accessor (no caching) when accessorMethodParams > 0 - Add unit tests for Parent-only subclients with accessor-only parameters - Add MetricsClientParams to SampleService/main.tsp giving Metrics a metricsNamespace param - Regenerate Sample-TypeSpec (SampleTypeSpecClient.GetMetricsClient now takes metricsNamespace) - Add individuallyParent Spector test project from azure-http-specs showing all 6 subclient accessors correctly parameterized (e.g. GetIndividuallyParentNestedWithQueryClient(string blobName)) Co-authored-by: JoshLove-msft <54595583+JoshLove-msft@users.noreply.github.com> --- .../client/csharp/SampleService/main.tsp | 12 +- .../ClientProviders/ClientProviderTests.cs | 54 + .../src/Generated/Metrics.RestClient.cs | 4 +- .../Sample-TypeSpec/src/Generated/Metrics.cs | 19 +- .../src/Generated/SampleTypeSpecClient.cs | 9 +- .../Local/Sample-TypeSpec/tspCodeModel.json | 65 +- .../individuallyParent/Configuration.json | 3 + ...nitialization.IndividuallyParentClient.sln | 48 + .../src/Generated/IndividuallyParentClient.cs | 30 + .../IndividuallyParentClientOptions.cs | 12 + ...ndividuallyParentNestedWithHeaderClient.cs | 47 + ...IndividuallyParentNestedWithMixedClient.cs | 47 + ...ividuallyParentNestedWithMultipleClient.cs | 47 + ...iduallyParentNestedWithParamAliasClient.cs | 39 + .../IndividuallyParentNestedWithPathClient.cs | 47 + ...IndividuallyParentNestedWithQueryClient.cs | 47 + .../Models/BlobProperties.Serialization.cs | 36 + .../src/Generated/Models/BlobProperties.cs | 19 + ...ization_IndividuallyParentClientContext.cs | 13 + ...ionIndividuallyParentClientModelFactory.cs | 13 + ...ialization.IndividuallyParentClient.csproj | 15 + .../individuallyParent/tspCodeModel.json | 2314 +++++++++++++++++ 22 files changed, 2921 insertions(+), 19 deletions(-) create mode 100644 packages/http-client-csharp/generator/TestProjects/Spector/http/azure/client-generator-core/client-initialization/individuallyParent/Configuration.json create mode 100644 packages/http-client-csharp/generator/TestProjects/Spector/http/azure/client-generator-core/client-initialization/individuallyParent/_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.sln create mode 100644 packages/http-client-csharp/generator/TestProjects/Spector/http/azure/client-generator-core/client-initialization/individuallyParent/src/Generated/IndividuallyParentClient.cs create mode 100644 packages/http-client-csharp/generator/TestProjects/Spector/http/azure/client-generator-core/client-initialization/individuallyParent/src/Generated/IndividuallyParentClientOptions.cs create mode 100644 packages/http-client-csharp/generator/TestProjects/Spector/http/azure/client-generator-core/client-initialization/individuallyParent/src/Generated/IndividuallyParentNestedWithHeaderClient.cs create mode 100644 packages/http-client-csharp/generator/TestProjects/Spector/http/azure/client-generator-core/client-initialization/individuallyParent/src/Generated/IndividuallyParentNestedWithMixedClient.cs create mode 100644 packages/http-client-csharp/generator/TestProjects/Spector/http/azure/client-generator-core/client-initialization/individuallyParent/src/Generated/IndividuallyParentNestedWithMultipleClient.cs create mode 100644 packages/http-client-csharp/generator/TestProjects/Spector/http/azure/client-generator-core/client-initialization/individuallyParent/src/Generated/IndividuallyParentNestedWithParamAliasClient.cs create mode 100644 packages/http-client-csharp/generator/TestProjects/Spector/http/azure/client-generator-core/client-initialization/individuallyParent/src/Generated/IndividuallyParentNestedWithPathClient.cs create mode 100644 packages/http-client-csharp/generator/TestProjects/Spector/http/azure/client-generator-core/client-initialization/individuallyParent/src/Generated/IndividuallyParentNestedWithQueryClient.cs create mode 100644 packages/http-client-csharp/generator/TestProjects/Spector/http/azure/client-generator-core/client-initialization/individuallyParent/src/Generated/Models/BlobProperties.Serialization.cs create mode 100644 packages/http-client-csharp/generator/TestProjects/Spector/http/azure/client-generator-core/client-initialization/individuallyParent/src/Generated/Models/BlobProperties.cs create mode 100644 packages/http-client-csharp/generator/TestProjects/Spector/http/azure/client-generator-core/client-initialization/individuallyParent/src/Generated/Models/SpecsAzureClientGeneratorCoreClientInitialization_IndividuallyParentClientContext.cs create mode 100644 packages/http-client-csharp/generator/TestProjects/Spector/http/azure/client-generator-core/client-initialization/individuallyParent/src/Generated/_Specs_AzureClientGeneratorCoreClientInitializationIndividuallyParentClientModelFactory.cs create mode 100644 packages/http-client-csharp/generator/TestProjects/Spector/http/azure/client-generator-core/client-initialization/individuallyParent/src/_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.csproj create mode 100644 packages/http-client-csharp/generator/TestProjects/Spector/http/azure/client-generator-core/client-initialization/individuallyParent/tspCodeModel.json diff --git a/docs/samples/client/csharp/SampleService/main.tsp b/docs/samples/client/csharp/SampleService/main.tsp index 2722adc9c6f..dcc8d2ff208 100644 --- a/docs/samples/client/csharp/SampleService/main.tsp +++ b/docs/samples/client/csharp/SampleService/main.tsp @@ -833,14 +833,22 @@ interface PlantOperations { }; } +model MetricsClientParams { + metricsNamespace: string; +} + @clientInitialization({ initializedBy: InitializedBy.individually | InitializedBy.parent, + parameters: MetricsClientParams, }) interface Metrics { @doc("Get Widget metrics for given day of week") @get - @route("/metrics/widgets/daysOfWeek") - getWidgetMetrics(@path day: DaysOfWeekExtensibleEnum): { + @route("/metrics/{metricsNamespace}/widgets/daysOfWeek") + getWidgetMetrics( + @path metricsNamespace: string, + @path day: DaysOfWeekExtensibleEnum, + ): { numSold: int32; averagePrice: float32; }; 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 a0cd8c5a4da..48554a37f83 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 @@ -954,6 +954,60 @@ public void TestBuildFields_ForParent_InitializedByBoth_WithSubClientParams_NoCa Assert.IsNull(cachingField, "Parent should not have caching field for subclient that has subclient-specific parameters in its accessor"); } + [Test] + public void TestBuildMethods_ForParent_InitializedByParentOnly_WithSubClientParams_HasParameterizedAccessor() + { + var parentClient = InputFactory.Client("ParentClient"); + var subClientParam = InputFactory.PathParameter("resourceId", InputPrimitiveType.String, scope: InputParameterScope.Client); + var subClient = InputFactory.Client( + "SubClient", + parent: parentClient, + parameters: [subClientParam], + initializedBy: InputClientInitializedBy.Parent); + + MockHelpers.LoadMockGenerator( + clients: () => [parentClient]); + + var parentProvider = new ClientProvider(parentClient); + + Assert.IsNotNull(parentProvider); + + // The parent should have a factory method for the subclient + var factoryMethod = parentProvider.Methods.FirstOrDefault( + m => m.Signature?.Name == "GetSubClient" || m.Signature?.Name == "GetSubClientClient"); + Assert.IsNotNull(factoryMethod, "Parent should have factory method for subclient with parameters"); + + // The accessor method should include the subclient's extra parameters + Assert.IsNotNull(factoryMethod!.Signature, "Factory method should have a signature"); + Assert.AreEqual(1, factoryMethod.Signature!.Parameters.Count, + "Accessor method should include subclient parameters not present on parent"); + Assert.AreEqual("resourceId", factoryMethod.Signature.Parameters[0].Name, + "Accessor method parameter should be the subclient's extra parameter"); + } + + [Test] + public void TestBuildFields_ForParent_InitializedByParentOnly_WithSubClientParams_NoCachingField() + { + var parentClient = InputFactory.Client("ParentClient"); + var subClientParam = InputFactory.PathParameter("resourceId", InputPrimitiveType.String, scope: InputParameterScope.Client); + var subClient = InputFactory.Client( + "SubClient", + parent: parentClient, + parameters: [subClientParam], + initializedBy: InputClientInitializedBy.Parent); + + MockHelpers.LoadMockGenerator( + clients: () => [parentClient]); + + var parentProvider = new ClientProvider(parentClient); + + Assert.IsNotNull(parentProvider); + + // The parent should NOT have a caching field for the subclient when the accessor requires parameters, + // since caching is not appropriate when different parameter values produce different client instances. + var cachingField = parentProvider.Fields.FirstOrDefault(f => f.Name == "_cachedSubClient"); + Assert.IsNull(cachingField, "Parent should not have caching field for subclient that has subclient-specific parameters in its accessor"); + } private void ValidatePrimaryConstructor( ConstructorProvider primaryPublicConstructor, diff --git a/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/Metrics.RestClient.cs b/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/Metrics.RestClient.cs index a724f1907ef..697b9766d36 100644 --- a/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/Metrics.RestClient.cs +++ b/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/Metrics.RestClient.cs @@ -20,7 +20,9 @@ internal PipelineMessage CreateGetWidgetMetricsRequest(string day, RequestOption { ClientUriBuilder uri = new ClientUriBuilder(); uri.Reset(_endpoint); - uri.AppendPath("/metrics/widgets/daysOfWeek/", false); + uri.AppendPath("/metrics/", false); + uri.AppendPath(_metricsNamespace, true); + uri.AppendPath("/widgets/daysOfWeek/", false); uri.AppendPath(day, true); PipelineMessage message = Pipeline.CreateMessage(uri.ToUri(), "GET", PipelineMessageClassifier200); PipelineRequest request = message.Request; 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 8f9c0ffffb6..8e55488af08 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 @@ -17,6 +17,7 @@ namespace SampleTypeSpec public partial class Metrics { private readonly Uri _endpoint; + private readonly string _metricsNamespace; /// Initializes a new instance of Metrics for mocking. protected Metrics() @@ -26,30 +27,38 @@ protected Metrics() /// Initializes a new instance of Metrics. /// The HTTP pipeline for sending and receiving REST requests and responses. /// Service endpoint. - internal Metrics(ClientPipeline pipeline, Uri endpoint) + /// + internal Metrics(ClientPipeline pipeline, Uri endpoint, string metricsNamespace) { _endpoint = endpoint; Pipeline = pipeline; + _metricsNamespace = metricsNamespace; } /// Initializes a new instance of Metrics. /// Service endpoint. - /// is null. - public Metrics(Uri endpoint) : this(endpoint, new SampleTypeSpecClientOptions()) + /// + /// 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()) { } /// Initializes a new instance of Metrics. /// Service endpoint. + /// /// The options for configuring the client. - /// is null. - public Metrics(Uri endpoint, SampleTypeSpecClientOptions options) + /// or is null. + /// is an empty string, and was expected to be non-empty. + public Metrics(Uri endpoint, string metricsNamespace, SampleTypeSpecClientOptions options) { Argument.AssertNotNull(endpoint, nameof(endpoint)); + Argument.AssertNotNullOrEmpty(metricsNamespace, nameof(metricsNamespace)); options ??= new SampleTypeSpecClientOptions(); _endpoint = endpoint; + _metricsNamespace = metricsNamespace; Pipeline = ClientPipeline.Create(options, Array.Empty(), new PipelinePolicy[] { new UserAgentPolicy(typeof(Metrics).Assembly) }, Array.Empty()); } 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 f2e56c36cb0..cc40aaedfa9 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 @@ -40,7 +40,6 @@ public partial class SampleTypeSpecClient private PetOperations _cachedPetOperations; private DogOperations _cachedDogOperations; private PlantOperations _cachedPlantOperations; - private Metrics _cachedMetrics; /// Initializes a new instance of SampleTypeSpecClient for mocking. protected SampleTypeSpecClient() @@ -1907,9 +1906,13 @@ public virtual PlantOperations GetPlantOperationsClient() } /// Initializes a new instance of Metrics. - public virtual Metrics GetMetricsClient() + /// + /// is null. + public virtual Metrics GetMetricsClient(string metricsNamespace) { - return Volatile.Read(ref _cachedMetrics) ?? Interlocked.CompareExchange(ref _cachedMetrics, new Metrics(Pipeline, _endpoint), null) ?? _cachedMetrics; + Argument.AssertNotNull(metricsNamespace, nameof(metricsNamespace)); + + return new Metrics(Pipeline, _endpoint, metricsNamespace); } } } diff --git a/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/tspCodeModel.json b/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/tspCodeModel.json index 2fd876c5106..459ab161e6f 100644 --- a/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/tspCodeModel.json +++ b/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/tspCodeModel.json @@ -13044,6 +13044,52 @@ { "$id": "866", "kind": "path", + "name": "metricsNamespace", + "serializedName": "metricsNamespace", + "type": { + "$id": "867", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "isApiVersion": false, + "explode": false, + "style": "simple", + "allowReserved": false, + "skipUrlEncoding": false, + "optional": false, + "scope": "Client", + "decorators": [], + "readOnly": false, + "crossLanguageDefinitionId": "SampleTypeSpec.Metrics.getWidgetMetrics.metricsNamespace", + "methodParameterSegments": [ + { + "$id": "868", + "kind": "method", + "name": "metricsNamespace", + "serializedName": "metricsNamespace", + "type": { + "$id": "869", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "", + "isApiVersion": false, + "optional": false, + "scope": "Method", + "crossLanguageDefinitionId": "SampleTypeSpec.MetricsClientParams.metricsNamespace", + "readOnly": false, + "access": "public", + "decorators": [] + } + ] + }, + { + "$id": "870", + "kind": "path", "name": "day", "serializedName": "day", "type": { @@ -13061,7 +13107,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.Metrics.getWidgetMetrics.day", "methodParameterSegments": [ { - "$id": "867", + "$id": "871", "kind": "method", "name": "day", "serializedName": "day", @@ -13080,7 +13126,7 @@ ] }, { - "$id": "868", + "$id": "872", "kind": "header", "name": "accept", "serializedName": "Accept", @@ -13096,7 +13142,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.Metrics.getWidgetMetrics.accept", "methodParameterSegments": [ { - "$id": "869", + "$id": "873", "kind": "method", "name": "accept", "serializedName": "Accept", @@ -13132,7 +13178,7 @@ ], "httpMethod": "GET", "uri": "{sampleTypeSpecUrl}", - "path": "/metrics/widgets/daysOfWeek/{day}", + "path": "/metrics/{metricsNamespace}/widgets/daysOfWeek/{day}", "bufferResponse": true, "generateProtocolMethod": true, "generateConvenienceMethod": true, @@ -13142,10 +13188,10 @@ }, "parameters": [ { - "$ref": "867" + "$ref": "871" }, { - "$ref": "869" + "$ref": "873" } ], "response": { @@ -13161,12 +13207,12 @@ ], "parameters": [ { - "$id": "870", + "$id": "874", "kind": "endpoint", "name": "sampleTypeSpecUrl", "serializedName": "sampleTypeSpecUrl", "type": { - "$id": "871", + "$id": "875", "kind": "url", "name": "endpoint", "crossLanguageDefinitionId": "TypeSpec.url" @@ -13179,6 +13225,9 @@ "skipUrlEncoding": false, "readOnly": false, "crossLanguageDefinitionId": "SampleTypeSpec.Metrics.sampleTypeSpecUrl" + }, + { + "$ref": "868" } ], "initializedBy": 3, diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/azure/client-generator-core/client-initialization/individuallyParent/Configuration.json b/packages/http-client-csharp/generator/TestProjects/Spector/http/azure/client-generator-core/client-initialization/individuallyParent/Configuration.json new file mode 100644 index 00000000000..71ed1b5b5e7 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/azure/client-generator-core/client-initialization/individuallyParent/Configuration.json @@ -0,0 +1,3 @@ +{ + "package-name": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient" +} diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/azure/client-generator-core/client-initialization/individuallyParent/_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.sln b/packages/http-client-csharp/generator/TestProjects/Spector/http/azure/client-generator-core/client-initialization/individuallyParent/_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.sln new file mode 100644 index 00000000000..0be7d3a3e3f --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/azure/client-generator-core/client-initialization/individuallyParent/_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.sln @@ -0,0 +1,48 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.0.31903.59 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient", "src\_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.csproj", "{28FF4005-4467-4E36-92E7-DEA27DEB1519}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Release|Any CPU.Build.0 = Release|Any CPU + {8E9A77AC-792A-4432-8320-ACFD46730401}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8E9A77AC-792A-4432-8320-ACFD46730401}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8E9A77AC-792A-4432-8320-ACFD46730401}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8E9A77AC-792A-4432-8320-ACFD46730401}.Release|Any CPU.Build.0 = Release|Any CPU + {A4241C1F-A53D-474C-9E4E-075054407E74}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A4241C1F-A53D-474C-9E4E-075054407E74}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A4241C1F-A53D-474C-9E4E-075054407E74}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A4241C1F-A53D-474C-9E4E-075054407E74}.Release|Any CPU.Build.0 = Release|Any CPU + {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Release|Any CPU.Build.0 = Release|Any CPU + {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Debug|Any CPU.Build.0 = Debug|Any CPU + {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Release|Any CPU.ActiveCfg = Release|Any CPU + {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Release|Any CPU.Build.0 = Release|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.Build.0 = Debug|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.ActiveCfg = Release|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.Build.0 = Release|Any CPU + {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {A97F4B90-2591-4689-B1F8-5F21FE6D6CAE} + EndGlobalSection +EndGlobal diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/azure/client-generator-core/client-initialization/individuallyParent/src/Generated/IndividuallyParentClient.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/azure/client-generator-core/client-initialization/individuallyParent/src/Generated/IndividuallyParentClient.cs new file mode 100644 index 00000000000..bde53255c10 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/azure/client-generator-core/client-initialization/individuallyParent/src/Generated/IndividuallyParentClient.cs @@ -0,0 +1,30 @@ +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; + +namespace Specs.Azure.ClientGenerator.Core.ClientInitialization._IndividuallyParentClient +{ + public partial class IndividuallyParentClient + { + public IndividuallyParentClient() : this(new Uri("http://localhost:3000"), new IndividuallyParentClientOptions()) => throw null; + + public IndividuallyParentClient(Uri endpoint, IndividuallyParentClientOptions options) => throw null; + + public ClientPipeline Pipeline => throw null; + + public virtual IndividuallyParentNestedWithPathClient GetIndividuallyParentNestedWithPathClient(string blobName) => throw null; + + public virtual IndividuallyParentNestedWithQueryClient GetIndividuallyParentNestedWithQueryClient(string blobName) => throw null; + + public virtual IndividuallyParentNestedWithHeaderClient GetIndividuallyParentNestedWithHeaderClient(string name) => throw null; + + public virtual IndividuallyParentNestedWithMultipleClient GetIndividuallyParentNestedWithMultipleClient(string name, string region) => throw null; + + public virtual IndividuallyParentNestedWithMixedClient GetIndividuallyParentNestedWithMixedClient(string name) => throw null; + + public virtual IndividuallyParentNestedWithParamAliasClient GetIndividuallyParentNestedWithParamAliasClient(string blobName) => throw null; + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/azure/client-generator-core/client-initialization/individuallyParent/src/Generated/IndividuallyParentClientOptions.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/azure/client-generator-core/client-initialization/individuallyParent/src/Generated/IndividuallyParentClientOptions.cs new file mode 100644 index 00000000000..315a291c34d --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/azure/client-generator-core/client-initialization/individuallyParent/src/Generated/IndividuallyParentClientOptions.cs @@ -0,0 +1,12 @@ +// + +#nullable disable + +using System.ClientModel.Primitives; + +namespace Specs.Azure.ClientGenerator.Core.ClientInitialization._IndividuallyParentClient +{ + public partial class IndividuallyParentClientOptions : ClientPipelineOptions + { + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/azure/client-generator-core/client-initialization/individuallyParent/src/Generated/IndividuallyParentNestedWithHeaderClient.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/azure/client-generator-core/client-initialization/individuallyParent/src/Generated/IndividuallyParentNestedWithHeaderClient.cs new file mode 100644 index 00000000000..f6a9ed03e34 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/azure/client-generator-core/client-initialization/individuallyParent/src/Generated/IndividuallyParentNestedWithHeaderClient.cs @@ -0,0 +1,47 @@ +// + +#nullable disable + +using System; +using System.ClientModel; +using System.ClientModel.Primitives; +using System.Threading; +using System.Threading.Tasks; + +namespace Specs.Azure.ClientGenerator.Core.ClientInitialization._IndividuallyParentClient +{ + public partial class IndividuallyParentNestedWithHeaderClient + { + protected IndividuallyParentNestedWithHeaderClient() => throw null; + + public IndividuallyParentNestedWithHeaderClient(string name) : this(new Uri("http://localhost:3000"), name, new IndividuallyParentClientOptions()) => throw null; + + public IndividuallyParentNestedWithHeaderClient(Uri endpoint, string name, IndividuallyParentClientOptions options) => throw null; + + public ClientPipeline Pipeline => throw null; + + public virtual ClientResult WithQuery(string format, RequestOptions options) => throw null; + + public virtual Task WithQueryAsync(string format, RequestOptions options) => throw null; + + public virtual ClientResult WithQuery(string format = default, CancellationToken cancellationToken = default) => throw null; + + public virtual Task WithQueryAsync(string format = default, CancellationToken cancellationToken = default) => throw null; + + public virtual ClientResult GetStandalone(RequestOptions options) => throw null; + + public virtual Task GetStandaloneAsync(RequestOptions options) => throw null; + + public virtual ClientResult GetStandalone(CancellationToken cancellationToken = default) => throw null; + + public virtual Task GetStandaloneAsync(CancellationToken cancellationToken = default) => throw null; + + public virtual ClientResult DeleteStandalone(RequestOptions options) => throw null; + + public virtual Task DeleteStandaloneAsync(RequestOptions options) => throw null; + + public virtual ClientResult DeleteStandalone(CancellationToken cancellationToken = default) => throw null; + + public virtual Task DeleteStandaloneAsync(CancellationToken cancellationToken = default) => throw null; + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/azure/client-generator-core/client-initialization/individuallyParent/src/Generated/IndividuallyParentNestedWithMixedClient.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/azure/client-generator-core/client-initialization/individuallyParent/src/Generated/IndividuallyParentNestedWithMixedClient.cs new file mode 100644 index 00000000000..b812efea70b --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/azure/client-generator-core/client-initialization/individuallyParent/src/Generated/IndividuallyParentNestedWithMixedClient.cs @@ -0,0 +1,47 @@ +// + +#nullable disable + +using System; +using System.ClientModel; +using System.ClientModel.Primitives; +using System.Threading; +using System.Threading.Tasks; + +namespace Specs.Azure.ClientGenerator.Core.ClientInitialization._IndividuallyParentClient +{ + public partial class IndividuallyParentNestedWithMixedClient + { + protected IndividuallyParentNestedWithMixedClient() => throw null; + + public IndividuallyParentNestedWithMixedClient(string name) : this(new Uri("http://localhost:3000"), name, new IndividuallyParentClientOptions()) => throw null; + + public IndividuallyParentNestedWithMixedClient(Uri endpoint, string name, IndividuallyParentClientOptions options) => throw null; + + public ClientPipeline Pipeline => throw null; + + public virtual ClientResult WithQuery(string region, string format, RequestOptions options) => throw null; + + public virtual Task WithQueryAsync(string region, string format, RequestOptions options) => throw null; + + public virtual ClientResult WithQuery(string region, string format = default, CancellationToken cancellationToken = default) => throw null; + + public virtual Task WithQueryAsync(string region, string format = default, CancellationToken cancellationToken = default) => throw null; + + public virtual ClientResult GetStandalone(string region, RequestOptions options) => throw null; + + public virtual Task GetStandaloneAsync(string region, RequestOptions options) => throw null; + + public virtual ClientResult GetStandalone(string region, CancellationToken cancellationToken = default) => throw null; + + public virtual Task GetStandaloneAsync(string region, CancellationToken cancellationToken = default) => throw null; + + public virtual ClientResult DeleteStandalone(string region, RequestOptions options) => throw null; + + public virtual Task DeleteStandaloneAsync(string region, RequestOptions options) => throw null; + + public virtual ClientResult DeleteStandalone(string region, CancellationToken cancellationToken = default) => throw null; + + public virtual Task DeleteStandaloneAsync(string region, CancellationToken cancellationToken = default) => throw null; + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/azure/client-generator-core/client-initialization/individuallyParent/src/Generated/IndividuallyParentNestedWithMultipleClient.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/azure/client-generator-core/client-initialization/individuallyParent/src/Generated/IndividuallyParentNestedWithMultipleClient.cs new file mode 100644 index 00000000000..43cb431c2c2 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/azure/client-generator-core/client-initialization/individuallyParent/src/Generated/IndividuallyParentNestedWithMultipleClient.cs @@ -0,0 +1,47 @@ +// + +#nullable disable + +using System; +using System.ClientModel; +using System.ClientModel.Primitives; +using System.Threading; +using System.Threading.Tasks; + +namespace Specs.Azure.ClientGenerator.Core.ClientInitialization._IndividuallyParentClient +{ + public partial class IndividuallyParentNestedWithMultipleClient + { + protected IndividuallyParentNestedWithMultipleClient() => throw null; + + public IndividuallyParentNestedWithMultipleClient(string name, string region) : this(new Uri("http://localhost:3000"), name, region, new IndividuallyParentClientOptions()) => throw null; + + public IndividuallyParentNestedWithMultipleClient(Uri endpoint, string name, string region, IndividuallyParentClientOptions options) => throw null; + + public ClientPipeline Pipeline => throw null; + + public virtual ClientResult WithQuery(string format, RequestOptions options) => throw null; + + public virtual Task WithQueryAsync(string format, RequestOptions options) => throw null; + + public virtual ClientResult WithQuery(string format = default, CancellationToken cancellationToken = default) => throw null; + + public virtual Task WithQueryAsync(string format = default, CancellationToken cancellationToken = default) => throw null; + + public virtual ClientResult GetStandalone(RequestOptions options) => throw null; + + public virtual Task GetStandaloneAsync(RequestOptions options) => throw null; + + public virtual ClientResult GetStandalone(CancellationToken cancellationToken = default) => throw null; + + public virtual Task GetStandaloneAsync(CancellationToken cancellationToken = default) => throw null; + + public virtual ClientResult DeleteStandalone(RequestOptions options) => throw null; + + public virtual Task DeleteStandaloneAsync(RequestOptions options) => throw null; + + public virtual ClientResult DeleteStandalone(CancellationToken cancellationToken = default) => throw null; + + public virtual Task DeleteStandaloneAsync(CancellationToken cancellationToken = default) => throw null; + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/azure/client-generator-core/client-initialization/individuallyParent/src/Generated/IndividuallyParentNestedWithParamAliasClient.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/azure/client-generator-core/client-initialization/individuallyParent/src/Generated/IndividuallyParentNestedWithParamAliasClient.cs new file mode 100644 index 00000000000..2c3ba10796e --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/azure/client-generator-core/client-initialization/individuallyParent/src/Generated/IndividuallyParentNestedWithParamAliasClient.cs @@ -0,0 +1,39 @@ +// + +#nullable disable + +using System; +using System.ClientModel; +using System.ClientModel.Primitives; +using System.Threading; +using System.Threading.Tasks; + +namespace Specs.Azure.ClientGenerator.Core.ClientInitialization._IndividuallyParentClient +{ + public partial class IndividuallyParentNestedWithParamAliasClient + { + protected IndividuallyParentNestedWithParamAliasClient() => throw null; + + public IndividuallyParentNestedWithParamAliasClient(string blobName, string blob) : this(new Uri("http://localhost:3000"), blobName, blob, new IndividuallyParentClientOptions()) => throw null; + + public IndividuallyParentNestedWithParamAliasClient(Uri endpoint, string blobName, string blob, IndividuallyParentClientOptions options) => throw null; + + public ClientPipeline Pipeline => throw null; + + public virtual ClientResult WithAliasedName(RequestOptions options) => throw null; + + public virtual Task WithAliasedNameAsync(RequestOptions options) => throw null; + + public virtual ClientResult WithAliasedName(CancellationToken cancellationToken = default) => throw null; + + public virtual Task WithAliasedNameAsync(CancellationToken cancellationToken = default) => throw null; + + public virtual ClientResult WithOriginalName(RequestOptions options) => throw null; + + public virtual Task WithOriginalNameAsync(RequestOptions options) => throw null; + + public virtual ClientResult WithOriginalName(CancellationToken cancellationToken = default) => throw null; + + public virtual Task WithOriginalNameAsync(CancellationToken cancellationToken = default) => throw null; + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/azure/client-generator-core/client-initialization/individuallyParent/src/Generated/IndividuallyParentNestedWithPathClient.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/azure/client-generator-core/client-initialization/individuallyParent/src/Generated/IndividuallyParentNestedWithPathClient.cs new file mode 100644 index 00000000000..e1c27d7b08a --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/azure/client-generator-core/client-initialization/individuallyParent/src/Generated/IndividuallyParentNestedWithPathClient.cs @@ -0,0 +1,47 @@ +// + +#nullable disable + +using System; +using System.ClientModel; +using System.ClientModel.Primitives; +using System.Threading; +using System.Threading.Tasks; + +namespace Specs.Azure.ClientGenerator.Core.ClientInitialization._IndividuallyParentClient +{ + public partial class IndividuallyParentNestedWithPathClient + { + protected IndividuallyParentNestedWithPathClient() => throw null; + + public IndividuallyParentNestedWithPathClient(string blobName) : this(new Uri("http://localhost:3000"), blobName, new IndividuallyParentClientOptions()) => throw null; + + public IndividuallyParentNestedWithPathClient(Uri endpoint, string blobName, IndividuallyParentClientOptions options) => throw null; + + public ClientPipeline Pipeline => throw null; + + public virtual ClientResult WithQuery(string format, RequestOptions options) => throw null; + + public virtual Task WithQueryAsync(string format, RequestOptions options) => throw null; + + public virtual ClientResult WithQuery(string format = default, CancellationToken cancellationToken = default) => throw null; + + public virtual Task WithQueryAsync(string format = default, CancellationToken cancellationToken = default) => throw null; + + public virtual ClientResult GetStandalone(RequestOptions options) => throw null; + + public virtual Task GetStandaloneAsync(RequestOptions options) => throw null; + + public virtual ClientResult GetStandalone(CancellationToken cancellationToken = default) => throw null; + + public virtual Task> GetStandaloneAsync(CancellationToken cancellationToken = default) => throw null; + + public virtual ClientResult DeleteStandalone(RequestOptions options) => throw null; + + public virtual Task DeleteStandaloneAsync(RequestOptions options) => throw null; + + public virtual ClientResult DeleteStandalone(CancellationToken cancellationToken = default) => throw null; + + public virtual Task DeleteStandaloneAsync(CancellationToken cancellationToken = default) => throw null; + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/azure/client-generator-core/client-initialization/individuallyParent/src/Generated/IndividuallyParentNestedWithQueryClient.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/azure/client-generator-core/client-initialization/individuallyParent/src/Generated/IndividuallyParentNestedWithQueryClient.cs new file mode 100644 index 00000000000..1dac6cc2f87 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/azure/client-generator-core/client-initialization/individuallyParent/src/Generated/IndividuallyParentNestedWithQueryClient.cs @@ -0,0 +1,47 @@ +// + +#nullable disable + +using System; +using System.ClientModel; +using System.ClientModel.Primitives; +using System.Threading; +using System.Threading.Tasks; + +namespace Specs.Azure.ClientGenerator.Core.ClientInitialization._IndividuallyParentClient +{ + public partial class IndividuallyParentNestedWithQueryClient + { + protected IndividuallyParentNestedWithQueryClient() => throw null; + + public IndividuallyParentNestedWithQueryClient(string blobName) : this(new Uri("http://localhost:3000"), blobName, new IndividuallyParentClientOptions()) => throw null; + + public IndividuallyParentNestedWithQueryClient(Uri endpoint, string blobName, IndividuallyParentClientOptions options) => throw null; + + public ClientPipeline Pipeline => throw null; + + public virtual ClientResult WithQuery(string format, RequestOptions options) => throw null; + + public virtual Task WithQueryAsync(string format, RequestOptions options) => throw null; + + public virtual ClientResult WithQuery(string format = default, CancellationToken cancellationToken = default) => throw null; + + public virtual Task WithQueryAsync(string format = default, CancellationToken cancellationToken = default) => throw null; + + public virtual ClientResult GetStandalone(RequestOptions options) => throw null; + + public virtual Task GetStandaloneAsync(RequestOptions options) => throw null; + + public virtual ClientResult GetStandalone(CancellationToken cancellationToken = default) => throw null; + + public virtual Task> GetStandaloneAsync(CancellationToken cancellationToken = default) => throw null; + + public virtual ClientResult DeleteStandalone(RequestOptions options) => throw null; + + public virtual Task DeleteStandaloneAsync(RequestOptions options) => throw null; + + public virtual ClientResult DeleteStandalone(CancellationToken cancellationToken = default) => throw null; + + public virtual Task DeleteStandaloneAsync(CancellationToken cancellationToken = default) => throw null; + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/azure/client-generator-core/client-initialization/individuallyParent/src/Generated/Models/BlobProperties.Serialization.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/azure/client-generator-core/client-initialization/individuallyParent/src/Generated/Models/BlobProperties.Serialization.cs new file mode 100644 index 00000000000..79ae2623893 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/azure/client-generator-core/client-initialization/individuallyParent/src/Generated/Models/BlobProperties.Serialization.cs @@ -0,0 +1,36 @@ +// + +#nullable disable + +using System; +using System.ClientModel; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Specs.Azure.ClientGenerator.Core.ClientInitialization._IndividuallyParentClient +{ + public partial class BlobProperties : IJsonModel + { + internal BlobProperties() => throw null; + + protected virtual BlobProperties PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) => throw null; + + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) => throw null; + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => throw null; + + BlobProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => throw null; + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => throw null; + + public static explicit operator BlobProperties(ClientResult result) => throw null; + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + BlobProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + protected virtual BlobProperties JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/azure/client-generator-core/client-initialization/individuallyParent/src/Generated/Models/BlobProperties.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/azure/client-generator-core/client-initialization/individuallyParent/src/Generated/Models/BlobProperties.cs new file mode 100644 index 00000000000..0ca309a6b95 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/azure/client-generator-core/client-initialization/individuallyParent/src/Generated/Models/BlobProperties.cs @@ -0,0 +1,19 @@ +// + +#nullable disable + +using System; + +namespace Specs.Azure.ClientGenerator.Core.ClientInitialization._IndividuallyParentClient +{ + public partial class BlobProperties + { + public string Name => throw null; + + public long Size => throw null; + + public string ContentType => throw null; + + public DateTimeOffset CreatedOn => throw null; + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/azure/client-generator-core/client-initialization/individuallyParent/src/Generated/Models/SpecsAzureClientGeneratorCoreClientInitialization_IndividuallyParentClientContext.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/azure/client-generator-core/client-initialization/individuallyParent/src/Generated/Models/SpecsAzureClientGeneratorCoreClientInitialization_IndividuallyParentClientContext.cs new file mode 100644 index 00000000000..e8dcaa57667 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/azure/client-generator-core/client-initialization/individuallyParent/src/Generated/Models/SpecsAzureClientGeneratorCoreClientInitialization_IndividuallyParentClientContext.cs @@ -0,0 +1,13 @@ +// + +#nullable disable + +using System.ClientModel.Primitives; + +namespace Specs.Azure.ClientGenerator.Core.ClientInitialization._IndividuallyParentClient +{ + [ModelReaderWriterBuildable(typeof(BlobProperties))] + public partial class SpecsAzureClientGeneratorCoreClientInitialization_IndividuallyParentClientContext : ModelReaderWriterContext + { + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/azure/client-generator-core/client-initialization/individuallyParent/src/Generated/_Specs_AzureClientGeneratorCoreClientInitializationIndividuallyParentClientModelFactory.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/azure/client-generator-core/client-initialization/individuallyParent/src/Generated/_Specs_AzureClientGeneratorCoreClientInitializationIndividuallyParentClientModelFactory.cs new file mode 100644 index 00000000000..d087a646e7b --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/azure/client-generator-core/client-initialization/individuallyParent/src/Generated/_Specs_AzureClientGeneratorCoreClientInitializationIndividuallyParentClientModelFactory.cs @@ -0,0 +1,13 @@ +// + +#nullable disable + +using System; + +namespace Specs.Azure.ClientGenerator.Core.ClientInitialization._IndividuallyParentClient +{ + public static partial class _Specs_AzureClientGeneratorCoreClientInitializationIndividuallyParentClientModelFactory + { + public static BlobProperties BlobProperties(string name = default, long size = default, string contentType = default, DateTimeOffset createdOn = default) => throw null; + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/azure/client-generator-core/client-initialization/individuallyParent/src/_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.csproj b/packages/http-client-csharp/generator/TestProjects/Spector/http/azure/client-generator-core/client-initialization/individuallyParent/src/_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.csproj new file mode 100644 index 00000000000..96025087533 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/azure/client-generator-core/client-initialization/individuallyParent/src/_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.csproj @@ -0,0 +1,15 @@ + + + This is the _Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient client library for developing .NET applications with rich experience. + SDK Code Generation _Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient + 1.0.0-beta.1 + _Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient + netstandard2.0;net8.0 + latest + true + + + + + + diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/azure/client-generator-core/client-initialization/individuallyParent/tspCodeModel.json b/packages/http-client-csharp/generator/TestProjects/Spector/http/azure/client-generator-core/client-initialization/individuallyParent/tspCodeModel.json new file mode 100644 index 00000000000..a33d4361aea --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/azure/client-generator-core/client-initialization/individuallyParent/tspCodeModel.json @@ -0,0 +1,2314 @@ +{ + "name": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient", + "apiVersions": [], + "enums": [], + "constants": [ + { + "$id": "1", + "kind": "constant", + "name": "getStandaloneContentType", + "namespace": "", + "usage": "None", + "valueType": { + "$id": "2", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + { + "$id": "3", + "kind": "constant", + "name": "getStandaloneContentType1", + "namespace": "", + "usage": "None", + "valueType": { + "$id": "4", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + } + ], + "models": [ + { + "$id": "5", + "kind": "model", + "name": "BlobProperties", + "namespace": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient", + "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.BlobProperties", + "usage": "Output,Json", + "doc": "Properties of a blob", + "decorators": [], + "serializationOptions": { + "json": { + "name": "BlobProperties" + } + }, + "properties": [ + { + "$id": "6", + "kind": "property", + "name": "name", + "serializedName": "name", + "type": { + "$id": "7", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.BlobProperties.name", + "serializationOptions": { + "json": { + "name": "name" + } + }, + "isHttpMetadata": false + }, + { + "$id": "8", + "kind": "property", + "name": "size", + "serializedName": "size", + "type": { + "$id": "9", + "kind": "int64", + "name": "int64", + "crossLanguageDefinitionId": "TypeSpec.int64", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.BlobProperties.size", + "serializationOptions": { + "json": { + "name": "size" + } + }, + "isHttpMetadata": false + }, + { + "$id": "10", + "kind": "property", + "name": "contentType", + "serializedName": "contentType", + "type": { + "$id": "11", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.BlobProperties.contentType", + "serializationOptions": { + "json": { + "name": "contentType" + } + }, + "isHttpMetadata": false + }, + { + "$id": "12", + "kind": "property", + "name": "createdOn", + "serializedName": "createdOn", + "type": { + "$id": "13", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "rfc3339", + "wireType": { + "$id": "14", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.utcDateTime", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.BlobProperties.createdOn", + "serializationOptions": { + "json": { + "name": "createdOn" + } + }, + "isHttpMetadata": false + } + ] + } + ], + "clients": [ + { + "$id": "15", + "kind": "client", + "name": "IndividuallyParentClient", + "namespace": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient", + "doc": "Test for client initialization decorator - moving parameters from method to client level", + "methods": [], + "parameters": [ + { + "$id": "16", + "kind": "endpoint", + "name": "endpoint", + "serializedName": "endpoint", + "doc": "Service host", + "type": { + "$id": "17", + "kind": "url", + "name": "endpoint", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "isApiVersion": false, + "optional": false, + "scope": "Client", + "isEndpoint": true, + "defaultValue": { + "type": { + "$id": "18", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "http://localhost:3000" + }, + "serverUrlTemplate": "{endpoint}", + "skipUrlEncoding": false, + "readOnly": false, + "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.endpoint" + } + ], + "initializedBy": 1, + "decorators": [], + "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient", + "apiVersions": [], + "children": [ + { + "$id": "19", + "kind": "client", + "name": "IndividuallyParentNestedWithPathClient", + "namespace": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient", + "doc": "Operations for nested default -> individually and parent", + "methods": [ + { + "$id": "20", + "kind": "basic", + "name": "withQuery", + "accessibility": "public", + "apiVersions": [], + "operation": { + "$id": "21", + "name": "withQuery", + "resourceName": "IndividuallyParentNestedWithPathClient", + "accessibility": "public", + "parameters": [ + { + "$id": "22", + "kind": "path", + "name": "blobName", + "serializedName": "blobName", + "type": { + "$id": "23", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "isApiVersion": false, + "explode": false, + "style": "simple", + "allowReserved": false, + "skipUrlEncoding": false, + "optional": false, + "scope": "Client", + "decorators": [], + "readOnly": false, + "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithPathClient.withQuery.blobName", + "methodParameterSegments": [ + { + "$id": "24", + "kind": "method", + "name": "blobName", + "serializedName": "blobName", + "doc": "The blob name to use for operations", + "type": { + "$id": "25", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "", + "isApiVersion": false, + "optional": false, + "scope": "Method", + "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.PathParamClientOptions.blobName", + "readOnly": false, + "access": "public", + "decorators": [] + } + ] + }, + { + "$id": "26", + "kind": "query", + "name": "format", + "serializedName": "format", + "type": { + "$id": "27", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "isApiVersion": false, + "explode": false, + "optional": true, + "scope": "Method", + "decorators": [], + "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithPathClient.withQuery.format", + "readOnly": false, + "methodParameterSegments": [ + { + "$id": "28", + "kind": "method", + "name": "format", + "serializedName": "format", + "type": { + "$id": "29", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": false, + "optional": true, + "scope": "Method", + "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithPathClient.withQuery.format", + "readOnly": false, + "access": "public", + "decorators": [] + } + ] + } + ], + "responses": [ + { + "statusCodes": [ + 204 + ], + "headers": [], + "isErrorResponse": false + } + ], + "httpMethod": "GET", + "uri": "{endpoint}", + "path": "/azure/client-generator-core/client-initialization/individually-parent/nested-default-individually-parent/{blobName}/with-query", + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithPathClient.withQuery", + "decorators": [], + "namespace": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient" + }, + "parameters": [ + { + "$ref": "28" + } + ], + "response": {}, + "isOverride": false, + "generateConvenient": true, + "generateProtocol": true, + "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithPathClient.withQuery" + }, + { + "$id": "30", + "kind": "basic", + "name": "getStandalone", + "accessibility": "public", + "apiVersions": [], + "operation": { + "$id": "31", + "name": "getStandalone", + "resourceName": "IndividuallyParentNestedWithPathClient", + "accessibility": "public", + "parameters": [ + { + "$id": "32", + "kind": "path", + "name": "blobName", + "serializedName": "blobName", + "type": { + "$id": "33", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "isApiVersion": false, + "explode": false, + "style": "simple", + "allowReserved": false, + "skipUrlEncoding": false, + "optional": false, + "scope": "Client", + "decorators": [], + "readOnly": false, + "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithPathClient.getStandalone.blobName", + "methodParameterSegments": [ + { + "$ref": "24" + } + ] + }, + { + "$id": "34", + "kind": "header", + "name": "accept", + "serializedName": "Accept", + "type": { + "$ref": "1" + }, + "isApiVersion": false, + "optional": false, + "isContentType": false, + "scope": "Constant", + "readOnly": false, + "decorators": [], + "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithPathClient.getStandalone.accept", + "methodParameterSegments": [ + { + "$id": "35", + "kind": "method", + "name": "accept", + "serializedName": "Accept", + "type": { + "$ref": "1" + }, + "location": "Header", + "isApiVersion": false, + "optional": false, + "scope": "Constant", + "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithPathClient.getStandalone.accept", + "readOnly": false, + "access": "public", + "decorators": [] + } + ] + } + ], + "responses": [ + { + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "5" + }, + "headers": [], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ] + } + ], + "httpMethod": "GET", + "uri": "{endpoint}", + "path": "/azure/client-generator-core/client-initialization/individually-parent/nested-default-individually-parent/{blobName}/get-standalone", + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithPathClient.getStandalone", + "decorators": [], + "namespace": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient" + }, + "parameters": [ + { + "$ref": "35" + } + ], + "response": { + "type": { + "$ref": "5" + } + }, + "isOverride": false, + "generateConvenient": true, + "generateProtocol": true, + "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithPathClient.getStandalone" + }, + { + "$id": "36", + "kind": "basic", + "name": "deleteStandalone", + "accessibility": "public", + "apiVersions": [], + "operation": { + "$id": "37", + "name": "deleteStandalone", + "resourceName": "IndividuallyParentNestedWithPathClient", + "accessibility": "public", + "parameters": [ + { + "$id": "38", + "kind": "path", + "name": "blobName", + "serializedName": "blobName", + "type": { + "$id": "39", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "isApiVersion": false, + "explode": false, + "style": "simple", + "allowReserved": false, + "skipUrlEncoding": false, + "optional": false, + "scope": "Client", + "decorators": [], + "readOnly": false, + "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithPathClient.deleteStandalone.blobName", + "methodParameterSegments": [ + { + "$ref": "24" + } + ] + } + ], + "responses": [ + { + "statusCodes": [ + 204 + ], + "headers": [], + "isErrorResponse": false + } + ], + "httpMethod": "DELETE", + "uri": "{endpoint}", + "path": "/azure/client-generator-core/client-initialization/individually-parent/nested-default-individually-parent/{blobName}", + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithPathClient.deleteStandalone", + "decorators": [], + "namespace": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient" + }, + "parameters": [], + "response": {}, + "isOverride": false, + "generateConvenient": true, + "generateProtocol": true, + "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithPathClient.deleteStandalone" + } + ], + "parameters": [ + { + "$id": "40", + "kind": "endpoint", + "name": "endpoint", + "serializedName": "endpoint", + "doc": "Service host", + "type": { + "$id": "41", + "kind": "url", + "name": "endpoint", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "isApiVersion": false, + "optional": false, + "scope": "Client", + "isEndpoint": true, + "defaultValue": { + "type": { + "$id": "42", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "http://localhost:3000" + }, + "serverUrlTemplate": "{endpoint}", + "skipUrlEncoding": false, + "readOnly": false, + "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithPathClient.endpoint" + }, + { + "$ref": "24" + } + ], + "initializedBy": 3, + "decorators": [], + "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithPathClient", + "apiVersions": [], + "parent": { + "$ref": "15" + }, + "isMultiServiceClient": false + }, + { + "$id": "43", + "kind": "client", + "name": "IndividuallyParentNestedWithQueryClient", + "namespace": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient", + "doc": "Operations for nested default -> individually and parent with query parameters", + "methods": [ + { + "$id": "44", + "kind": "basic", + "name": "withQuery", + "accessibility": "public", + "apiVersions": [], + "operation": { + "$id": "45", + "name": "withQuery", + "resourceName": "IndividuallyParentNestedWithQueryClient", + "accessibility": "public", + "parameters": [ + { + "$id": "46", + "kind": "query", + "name": "blobName", + "serializedName": "blobName", + "type": { + "$id": "47", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "isApiVersion": false, + "explode": false, + "optional": false, + "scope": "Client", + "decorators": [], + "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithQueryClient.withQuery.blobName", + "readOnly": false, + "methodParameterSegments": [ + { + "$id": "48", + "kind": "method", + "name": "blobName", + "serializedName": "blobName", + "doc": "The blob name to use for operations", + "type": { + "$id": "49", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "", + "isApiVersion": false, + "optional": false, + "scope": "Method", + "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.BlobQueryParamClientOptions.blobName", + "readOnly": false, + "access": "public", + "decorators": [] + } + ] + }, + { + "$id": "50", + "kind": "query", + "name": "format", + "serializedName": "format", + "type": { + "$id": "51", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "isApiVersion": false, + "explode": false, + "optional": true, + "scope": "Method", + "decorators": [], + "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithQueryClient.withQuery.format", + "readOnly": false, + "methodParameterSegments": [ + { + "$id": "52", + "kind": "method", + "name": "format", + "serializedName": "format", + "type": { + "$id": "53", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": false, + "optional": true, + "scope": "Method", + "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithQueryClient.withQuery.format", + "readOnly": false, + "access": "public", + "decorators": [] + } + ] + } + ], + "responses": [ + { + "statusCodes": [ + 204 + ], + "headers": [], + "isErrorResponse": false + } + ], + "httpMethod": "GET", + "uri": "{endpoint}", + "path": "/azure/client-generator-core/client-initialization/individually-parent/nested-default-individually-parent-query/with-query", + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithQueryClient.withQuery", + "decorators": [], + "namespace": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient" + }, + "parameters": [ + { + "$ref": "52" + } + ], + "response": {}, + "isOverride": false, + "generateConvenient": true, + "generateProtocol": true, + "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithQueryClient.withQuery" + }, + { + "$id": "54", + "kind": "basic", + "name": "getStandalone", + "accessibility": "public", + "apiVersions": [], + "operation": { + "$id": "55", + "name": "getStandalone", + "resourceName": "IndividuallyParentNestedWithQueryClient", + "accessibility": "public", + "parameters": [ + { + "$id": "56", + "kind": "query", + "name": "blobName", + "serializedName": "blobName", + "type": { + "$id": "57", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "isApiVersion": false, + "explode": false, + "optional": false, + "scope": "Client", + "decorators": [], + "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithQueryClient.getStandalone.blobName", + "readOnly": false, + "methodParameterSegments": [ + { + "$ref": "48" + } + ] + }, + { + "$id": "58", + "kind": "header", + "name": "accept", + "serializedName": "Accept", + "type": { + "$ref": "3" + }, + "isApiVersion": false, + "optional": false, + "isContentType": false, + "scope": "Constant", + "readOnly": false, + "decorators": [], + "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithQueryClient.getStandalone.accept", + "methodParameterSegments": [ + { + "$id": "59", + "kind": "method", + "name": "accept", + "serializedName": "Accept", + "type": { + "$ref": "3" + }, + "location": "Header", + "isApiVersion": false, + "optional": false, + "scope": "Constant", + "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithQueryClient.getStandalone.accept", + "readOnly": false, + "access": "public", + "decorators": [] + } + ] + } + ], + "responses": [ + { + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "5" + }, + "headers": [], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ] + } + ], + "httpMethod": "GET", + "uri": "{endpoint}", + "path": "/azure/client-generator-core/client-initialization/individually-parent/nested-default-individually-parent-query/get-standalone", + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithQueryClient.getStandalone", + "decorators": [], + "namespace": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient" + }, + "parameters": [ + { + "$ref": "59" + } + ], + "response": { + "type": { + "$ref": "5" + } + }, + "isOverride": false, + "generateConvenient": true, + "generateProtocol": true, + "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithQueryClient.getStandalone" + }, + { + "$id": "60", + "kind": "basic", + "name": "deleteStandalone", + "accessibility": "public", + "apiVersions": [], + "operation": { + "$id": "61", + "name": "deleteStandalone", + "resourceName": "IndividuallyParentNestedWithQueryClient", + "accessibility": "public", + "parameters": [ + { + "$id": "62", + "kind": "query", + "name": "blobName", + "serializedName": "blobName", + "type": { + "$id": "63", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "isApiVersion": false, + "explode": false, + "optional": false, + "scope": "Client", + "decorators": [], + "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithQueryClient.deleteStandalone.blobName", + "readOnly": false, + "methodParameterSegments": [ + { + "$ref": "48" + } + ] + } + ], + "responses": [ + { + "statusCodes": [ + 204 + ], + "headers": [], + "isErrorResponse": false + } + ], + "httpMethod": "DELETE", + "uri": "{endpoint}", + "path": "/azure/client-generator-core/client-initialization/individually-parent/nested-default-individually-parent-query/delete-resource", + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithQueryClient.deleteStandalone", + "decorators": [], + "namespace": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient" + }, + "parameters": [], + "response": {}, + "isOverride": false, + "generateConvenient": true, + "generateProtocol": true, + "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithQueryClient.deleteStandalone" + } + ], + "parameters": [ + { + "$id": "64", + "kind": "endpoint", + "name": "endpoint", + "serializedName": "endpoint", + "doc": "Service host", + "type": { + "$id": "65", + "kind": "url", + "name": "endpoint", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "isApiVersion": false, + "optional": false, + "scope": "Client", + "isEndpoint": true, + "defaultValue": { + "type": { + "$id": "66", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "http://localhost:3000" + }, + "serverUrlTemplate": "{endpoint}", + "skipUrlEncoding": false, + "readOnly": false, + "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithQueryClient.endpoint" + }, + { + "$ref": "48" + } + ], + "initializedBy": 3, + "decorators": [], + "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithQueryClient", + "apiVersions": [], + "parent": { + "$ref": "15" + }, + "isMultiServiceClient": false + }, + { + "$id": "67", + "kind": "client", + "name": "IndividuallyParentNestedWithHeaderClient", + "namespace": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient", + "doc": "Operations for nested default -> individually and parent header parameters", + "methods": [ + { + "$id": "68", + "kind": "basic", + "name": "withQuery", + "accessibility": "public", + "apiVersions": [], + "operation": { + "$id": "69", + "name": "withQuery", + "resourceName": "IndividuallyParentNestedWithHeaderClient", + "accessibility": "public", + "parameters": [ + { + "$id": "70", + "kind": "header", + "name": "name", + "serializedName": "name", + "type": { + "$id": "71", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "isApiVersion": false, + "optional": false, + "isContentType": false, + "scope": "Client", + "readOnly": false, + "decorators": [], + "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithHeaderClient.withQuery.name", + "methodParameterSegments": [ + { + "$id": "72", + "kind": "method", + "name": "name", + "serializedName": "name", + "doc": "The name to use for operations", + "type": { + "$id": "73", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "", + "isApiVersion": false, + "optional": false, + "scope": "Method", + "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.HeaderParamClientOptions.name", + "readOnly": false, + "access": "public", + "decorators": [] + } + ] + }, + { + "$id": "74", + "kind": "query", + "name": "format", + "serializedName": "format", + "type": { + "$id": "75", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "isApiVersion": false, + "explode": false, + "optional": true, + "scope": "Method", + "decorators": [], + "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithHeaderClient.withQuery.format", + "readOnly": false, + "methodParameterSegments": [ + { + "$id": "76", + "kind": "method", + "name": "format", + "serializedName": "format", + "type": { + "$id": "77", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": false, + "optional": true, + "scope": "Method", + "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithHeaderClient.withQuery.format", + "readOnly": false, + "access": "public", + "decorators": [] + } + ] + } + ], + "responses": [ + { + "statusCodes": [ + 204 + ], + "headers": [], + "isErrorResponse": false + } + ], + "httpMethod": "GET", + "uri": "{endpoint}", + "path": "/azure/client-generator-core/client-initialization/individually-parent/nested-default-individually-parent-header/with-query", + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithHeaderClient.withQuery", + "decorators": [], + "namespace": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient" + }, + "parameters": [ + { + "$ref": "76" + } + ], + "response": {}, + "isOverride": false, + "generateConvenient": true, + "generateProtocol": true, + "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithHeaderClient.withQuery" + }, + { + "$id": "78", + "kind": "basic", + "name": "getStandalone", + "accessibility": "public", + "apiVersions": [], + "operation": { + "$id": "79", + "name": "getStandalone", + "resourceName": "IndividuallyParentNestedWithHeaderClient", + "accessibility": "public", + "parameters": [ + { + "$id": "80", + "kind": "header", + "name": "name", + "serializedName": "name", + "type": { + "$id": "81", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "isApiVersion": false, + "optional": false, + "isContentType": false, + "scope": "Client", + "readOnly": false, + "decorators": [], + "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithHeaderClient.getStandalone.name", + "methodParameterSegments": [ + { + "$ref": "72" + } + ] + } + ], + "responses": [ + { + "statusCodes": [ + 204 + ], + "headers": [], + "isErrorResponse": false + } + ], + "httpMethod": "GET", + "uri": "{endpoint}", + "path": "/azure/client-generator-core/client-initialization/individually-parent/nested-default-individually-parent-header/get-standalone", + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithHeaderClient.getStandalone", + "decorators": [], + "namespace": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient" + }, + "parameters": [], + "response": {}, + "isOverride": false, + "generateConvenient": true, + "generateProtocol": true, + "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithHeaderClient.getStandalone" + }, + { + "$id": "82", + "kind": "basic", + "name": "deleteStandalone", + "accessibility": "public", + "apiVersions": [], + "operation": { + "$id": "83", + "name": "deleteStandalone", + "resourceName": "IndividuallyParentNestedWithHeaderClient", + "accessibility": "public", + "parameters": [ + { + "$id": "84", + "kind": "header", + "name": "name", + "serializedName": "name", + "type": { + "$id": "85", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "isApiVersion": false, + "optional": false, + "isContentType": false, + "scope": "Client", + "readOnly": false, + "decorators": [], + "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithHeaderClient.deleteStandalone.name", + "methodParameterSegments": [ + { + "$ref": "72" + } + ] + } + ], + "responses": [ + { + "statusCodes": [ + 204 + ], + "headers": [], + "isErrorResponse": false + } + ], + "httpMethod": "DELETE", + "uri": "{endpoint}", + "path": "/azure/client-generator-core/client-initialization/individually-parent/nested-default-individually-parent-header/delete-standalone", + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithHeaderClient.deleteStandalone", + "decorators": [], + "namespace": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient" + }, + "parameters": [], + "response": {}, + "isOverride": false, + "generateConvenient": true, + "generateProtocol": true, + "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithHeaderClient.deleteStandalone" + } + ], + "parameters": [ + { + "$id": "86", + "kind": "endpoint", + "name": "endpoint", + "serializedName": "endpoint", + "doc": "Service host", + "type": { + "$id": "87", + "kind": "url", + "name": "endpoint", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "isApiVersion": false, + "optional": false, + "scope": "Client", + "isEndpoint": true, + "defaultValue": { + "type": { + "$id": "88", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "http://localhost:3000" + }, + "serverUrlTemplate": "{endpoint}", + "skipUrlEncoding": false, + "readOnly": false, + "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithHeaderClient.endpoint" + }, + { + "$ref": "72" + } + ], + "initializedBy": 3, + "decorators": [], + "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithHeaderClient", + "apiVersions": [], + "parent": { + "$ref": "15" + }, + "isMultiServiceClient": false + }, + { + "$id": "89", + "kind": "client", + "name": "IndividuallyParentNestedWithMultipleClient", + "namespace": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient", + "doc": "Operations for nested default -> individually and parent multiple parameters", + "methods": [ + { + "$id": "90", + "kind": "basic", + "name": "withQuery", + "accessibility": "public", + "apiVersions": [], + "operation": { + "$id": "91", + "name": "withQuery", + "resourceName": "IndividuallyParentNestedWithMultipleClient", + "accessibility": "public", + "parameters": [ + { + "$id": "92", + "kind": "header", + "name": "name", + "serializedName": "name", + "type": { + "$id": "93", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "isApiVersion": false, + "optional": false, + "isContentType": false, + "scope": "Client", + "readOnly": false, + "decorators": [], + "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithMultipleClient.withQuery.name", + "methodParameterSegments": [ + { + "$id": "94", + "kind": "method", + "name": "name", + "serializedName": "name", + "doc": "The name to use for operations", + "type": { + "$id": "95", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "", + "isApiVersion": false, + "optional": false, + "scope": "Method", + "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.MultipleParamsClientOptions.name", + "readOnly": false, + "access": "public", + "decorators": [] + } + ] + }, + { + "$id": "96", + "kind": "query", + "name": "region", + "serializedName": "region", + "type": { + "$id": "97", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "isApiVersion": false, + "explode": false, + "optional": false, + "scope": "Client", + "decorators": [], + "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithMultipleClient.withQuery.region", + "readOnly": false, + "methodParameterSegments": [ + { + "$id": "98", + "kind": "method", + "name": "region", + "serializedName": "region", + "doc": "The region to use for operations", + "type": { + "$id": "99", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "", + "isApiVersion": false, + "optional": false, + "scope": "Method", + "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.MultipleParamsClientOptions.region", + "readOnly": false, + "access": "public", + "decorators": [] + } + ] + }, + { + "$id": "100", + "kind": "query", + "name": "format", + "serializedName": "format", + "type": { + "$id": "101", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "isApiVersion": false, + "explode": false, + "optional": true, + "scope": "Method", + "decorators": [], + "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithMultipleClient.withQuery.format", + "readOnly": false, + "methodParameterSegments": [ + { + "$id": "102", + "kind": "method", + "name": "format", + "serializedName": "format", + "type": { + "$id": "103", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": false, + "optional": true, + "scope": "Method", + "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithMultipleClient.withQuery.format", + "readOnly": false, + "access": "public", + "decorators": [] + } + ] + } + ], + "responses": [ + { + "statusCodes": [ + 204 + ], + "headers": [], + "isErrorResponse": false + } + ], + "httpMethod": "GET", + "uri": "{endpoint}", + "path": "/azure/client-generator-core/client-initialization/individually-parent/nested-default-individually-parent-multiple/with-query", + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithMultipleClient.withQuery", + "decorators": [], + "namespace": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient" + }, + "parameters": [ + { + "$ref": "102" + } + ], + "response": {}, + "isOverride": false, + "generateConvenient": true, + "generateProtocol": true, + "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithMultipleClient.withQuery" + }, + { + "$id": "104", + "kind": "basic", + "name": "getStandalone", + "accessibility": "public", + "apiVersions": [], + "operation": { + "$id": "105", + "name": "getStandalone", + "resourceName": "IndividuallyParentNestedWithMultipleClient", + "accessibility": "public", + "parameters": [ + { + "$id": "106", + "kind": "header", + "name": "name", + "serializedName": "name", + "type": { + "$id": "107", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "isApiVersion": false, + "optional": false, + "isContentType": false, + "scope": "Client", + "readOnly": false, + "decorators": [], + "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithMultipleClient.getStandalone.name", + "methodParameterSegments": [ + { + "$ref": "94" + } + ] + }, + { + "$id": "108", + "kind": "query", + "name": "region", + "serializedName": "region", + "type": { + "$id": "109", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "isApiVersion": false, + "explode": false, + "optional": false, + "scope": "Client", + "decorators": [], + "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithMultipleClient.getStandalone.region", + "readOnly": false, + "methodParameterSegments": [ + { + "$ref": "98" + } + ] + } + ], + "responses": [ + { + "statusCodes": [ + 204 + ], + "headers": [], + "isErrorResponse": false + } + ], + "httpMethod": "GET", + "uri": "{endpoint}", + "path": "/azure/client-generator-core/client-initialization/individually-parent/nested-default-individually-parent-multiple/get-standalone", + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithMultipleClient.getStandalone", + "decorators": [], + "namespace": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient" + }, + "parameters": [], + "response": {}, + "isOverride": false, + "generateConvenient": true, + "generateProtocol": true, + "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithMultipleClient.getStandalone" + }, + { + "$id": "110", + "kind": "basic", + "name": "deleteStandalone", + "accessibility": "public", + "apiVersions": [], + "operation": { + "$id": "111", + "name": "deleteStandalone", + "resourceName": "IndividuallyParentNestedWithMultipleClient", + "accessibility": "public", + "parameters": [ + { + "$id": "112", + "kind": "header", + "name": "name", + "serializedName": "name", + "type": { + "$id": "113", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "isApiVersion": false, + "optional": false, + "isContentType": false, + "scope": "Client", + "readOnly": false, + "decorators": [], + "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithMultipleClient.deleteStandalone.name", + "methodParameterSegments": [ + { + "$ref": "94" + } + ] + }, + { + "$id": "114", + "kind": "query", + "name": "region", + "serializedName": "region", + "type": { + "$id": "115", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "isApiVersion": false, + "explode": false, + "optional": false, + "scope": "Client", + "decorators": [], + "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithMultipleClient.deleteStandalone.region", + "readOnly": false, + "methodParameterSegments": [ + { + "$ref": "98" + } + ] + } + ], + "responses": [ + { + "statusCodes": [ + 204 + ], + "headers": [], + "isErrorResponse": false + } + ], + "httpMethod": "DELETE", + "uri": "{endpoint}", + "path": "/azure/client-generator-core/client-initialization/individually-parent/nested-default-individually-parent-multiple/delete-standalone", + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithMultipleClient.deleteStandalone", + "decorators": [], + "namespace": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient" + }, + "parameters": [], + "response": {}, + "isOverride": false, + "generateConvenient": true, + "generateProtocol": true, + "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithMultipleClient.deleteStandalone" + } + ], + "parameters": [ + { + "$id": "116", + "kind": "endpoint", + "name": "endpoint", + "serializedName": "endpoint", + "doc": "Service host", + "type": { + "$id": "117", + "kind": "url", + "name": "endpoint", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "isApiVersion": false, + "optional": false, + "scope": "Client", + "isEndpoint": true, + "defaultValue": { + "type": { + "$id": "118", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "http://localhost:3000" + }, + "serverUrlTemplate": "{endpoint}", + "skipUrlEncoding": false, + "readOnly": false, + "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithMultipleClient.endpoint" + }, + { + "$ref": "94" + }, + { + "$ref": "98" + } + ], + "initializedBy": 3, + "decorators": [], + "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithMultipleClient", + "apiVersions": [], + "parent": { + "$ref": "15" + }, + "isMultiServiceClient": false + }, + { + "$id": "119", + "kind": "client", + "name": "IndividuallyParentNestedWithMixedClient", + "namespace": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient", + "doc": "Operations for nested default -> individually and parent mixed parameters", + "methods": [ + { + "$id": "120", + "kind": "basic", + "name": "withQuery", + "accessibility": "public", + "apiVersions": [], + "operation": { + "$id": "121", + "name": "withQuery", + "resourceName": "IndividuallyParentNestedWithMixedClient", + "accessibility": "public", + "parameters": [ + { + "$id": "122", + "kind": "header", + "name": "name", + "serializedName": "name", + "type": { + "$id": "123", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "isApiVersion": false, + "optional": false, + "isContentType": false, + "scope": "Client", + "readOnly": false, + "decorators": [], + "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithMixedClient.withQuery.name", + "methodParameterSegments": [ + { + "$id": "124", + "kind": "method", + "name": "name", + "serializedName": "name", + "doc": "The name to use for operations", + "type": { + "$id": "125", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "", + "isApiVersion": false, + "optional": false, + "scope": "Method", + "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.MixedParamsClientOptions.name", + "readOnly": false, + "access": "public", + "decorators": [] + } + ] + }, + { + "$id": "126", + "kind": "query", + "name": "region", + "serializedName": "region", + "type": { + "$id": "127", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "isApiVersion": false, + "explode": false, + "optional": false, + "scope": "Method", + "decorators": [], + "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithMixedClient.withQuery.region", + "readOnly": false, + "methodParameterSegments": [ + { + "$id": "128", + "kind": "method", + "name": "region", + "serializedName": "region", + "type": { + "$id": "129", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": false, + "optional": false, + "scope": "Method", + "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithMixedClient.withQuery.region", + "readOnly": false, + "access": "public", + "decorators": [] + } + ] + }, + { + "$id": "130", + "kind": "query", + "name": "format", + "serializedName": "format", + "type": { + "$id": "131", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "isApiVersion": false, + "explode": false, + "optional": true, + "scope": "Method", + "decorators": [], + "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithMixedClient.withQuery.format", + "readOnly": false, + "methodParameterSegments": [ + { + "$id": "132", + "kind": "method", + "name": "format", + "serializedName": "format", + "type": { + "$id": "133", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": false, + "optional": true, + "scope": "Method", + "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithMixedClient.withQuery.format", + "readOnly": false, + "access": "public", + "decorators": [] + } + ] + } + ], + "responses": [ + { + "statusCodes": [ + 204 + ], + "headers": [], + "isErrorResponse": false + } + ], + "httpMethod": "GET", + "uri": "{endpoint}", + "path": "/azure/client-generator-core/client-initialization/individually-parent/nested-default-individually-parent-mixed/with-query", + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithMixedClient.withQuery", + "decorators": [], + "namespace": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient" + }, + "parameters": [ + { + "$ref": "128" + }, + { + "$ref": "132" + } + ], + "response": {}, + "isOverride": false, + "generateConvenient": true, + "generateProtocol": true, + "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithMixedClient.withQuery" + }, + { + "$id": "134", + "kind": "basic", + "name": "getStandalone", + "accessibility": "public", + "apiVersions": [], + "operation": { + "$id": "135", + "name": "getStandalone", + "resourceName": "IndividuallyParentNestedWithMixedClient", + "accessibility": "public", + "parameters": [ + { + "$id": "136", + "kind": "header", + "name": "name", + "serializedName": "name", + "type": { + "$id": "137", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "isApiVersion": false, + "optional": false, + "isContentType": false, + "scope": "Client", + "readOnly": false, + "decorators": [], + "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithMixedClient.getStandalone.name", + "methodParameterSegments": [ + { + "$ref": "124" + } + ] + }, + { + "$id": "138", + "kind": "query", + "name": "region", + "serializedName": "region", + "type": { + "$id": "139", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "isApiVersion": false, + "explode": false, + "optional": false, + "scope": "Method", + "decorators": [], + "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithMixedClient.getStandalone.region", + "readOnly": false, + "methodParameterSegments": [ + { + "$id": "140", + "kind": "method", + "name": "region", + "serializedName": "region", + "type": { + "$id": "141", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": false, + "optional": false, + "scope": "Method", + "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithMixedClient.getStandalone.region", + "readOnly": false, + "access": "public", + "decorators": [] + } + ] + } + ], + "responses": [ + { + "statusCodes": [ + 204 + ], + "headers": [], + "isErrorResponse": false + } + ], + "httpMethod": "GET", + "uri": "{endpoint}", + "path": "/azure/client-generator-core/client-initialization/individually-parent/nested-default-individually-parent-mixed/get-standalone", + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithMixedClient.getStandalone", + "decorators": [], + "namespace": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient" + }, + "parameters": [ + { + "$ref": "140" + } + ], + "response": {}, + "isOverride": false, + "generateConvenient": true, + "generateProtocol": true, + "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithMixedClient.getStandalone" + }, + { + "$id": "142", + "kind": "basic", + "name": "deleteStandalone", + "accessibility": "public", + "apiVersions": [], + "operation": { + "$id": "143", + "name": "deleteStandalone", + "resourceName": "IndividuallyParentNestedWithMixedClient", + "accessibility": "public", + "parameters": [ + { + "$id": "144", + "kind": "header", + "name": "name", + "serializedName": "name", + "type": { + "$id": "145", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "isApiVersion": false, + "optional": false, + "isContentType": false, + "scope": "Client", + "readOnly": false, + "decorators": [], + "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithMixedClient.deleteStandalone.name", + "methodParameterSegments": [ + { + "$ref": "124" + } + ] + }, + { + "$id": "146", + "kind": "query", + "name": "region", + "serializedName": "region", + "type": { + "$id": "147", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "isApiVersion": false, + "explode": false, + "optional": false, + "scope": "Method", + "decorators": [], + "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithMixedClient.deleteStandalone.region", + "readOnly": false, + "methodParameterSegments": [ + { + "$id": "148", + "kind": "method", + "name": "region", + "serializedName": "region", + "type": { + "$id": "149", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": false, + "optional": false, + "scope": "Method", + "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithMixedClient.deleteStandalone.region", + "readOnly": false, + "access": "public", + "decorators": [] + } + ] + } + ], + "responses": [ + { + "statusCodes": [ + 204 + ], + "headers": [], + "isErrorResponse": false + } + ], + "httpMethod": "DELETE", + "uri": "{endpoint}", + "path": "/azure/client-generator-core/client-initialization/individually-parent/nested-default-individually-parent-mixed/delete-standalone", + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithMixedClient.deleteStandalone", + "decorators": [], + "namespace": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient" + }, + "parameters": [ + { + "$ref": "148" + } + ], + "response": {}, + "isOverride": false, + "generateConvenient": true, + "generateProtocol": true, + "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithMixedClient.deleteStandalone" + } + ], + "parameters": [ + { + "$id": "150", + "kind": "endpoint", + "name": "endpoint", + "serializedName": "endpoint", + "doc": "Service host", + "type": { + "$id": "151", + "kind": "url", + "name": "endpoint", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "isApiVersion": false, + "optional": false, + "scope": "Client", + "isEndpoint": true, + "defaultValue": { + "type": { + "$id": "152", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "http://localhost:3000" + }, + "serverUrlTemplate": "{endpoint}", + "skipUrlEncoding": false, + "readOnly": false, + "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithMixedClient.endpoint" + }, + { + "$ref": "124" + } + ], + "initializedBy": 3, + "decorators": [], + "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithMixedClient", + "apiVersions": [], + "parent": { + "$ref": "15" + }, + "isMultiServiceClient": false + }, + { + "$id": "153", + "kind": "client", + "name": "IndividuallyParentNestedWithParamAliasClient", + "namespace": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient", + "doc": "Operations for nested default -> individually and parent param alias", + "methods": [ + { + "$id": "154", + "kind": "basic", + "name": "withAliasedName", + "accessibility": "public", + "apiVersions": [], + "operation": { + "$id": "155", + "name": "withAliasedName", + "resourceName": "IndividuallyParentNestedWithParamAliasClient", + "accessibility": "public", + "parameters": [ + { + "$id": "156", + "kind": "path", + "name": "blob", + "serializedName": "blob", + "type": { + "$id": "157", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "isApiVersion": false, + "explode": false, + "style": "simple", + "allowReserved": false, + "skipUrlEncoding": false, + "optional": false, + "scope": "Client", + "decorators": [], + "readOnly": false, + "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithParamAliasClient.withAliasedName.blob", + "methodParameterSegments": [ + { + "$id": "158", + "kind": "method", + "name": "blobName", + "serializedName": "blobName", + "doc": "Blob name for the client.", + "type": { + "$id": "159", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "", + "isApiVersion": false, + "optional": false, + "scope": "Method", + "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.ParamAliasClientOptions.blobName", + "readOnly": false, + "access": "public", + "decorators": [] + } + ] + } + ], + "responses": [ + { + "statusCodes": [ + 204 + ], + "headers": [], + "isErrorResponse": false + } + ], + "httpMethod": "GET", + "uri": "{endpoint}", + "path": "/azure/client-generator-core/client-initialization/individually-parent/nested-default-individually-parent-param-alias/{blob}/with-aliased-name", + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithParamAliasClient.withAliasedName", + "decorators": [], + "namespace": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient" + }, + "parameters": [], + "response": {}, + "isOverride": false, + "generateConvenient": true, + "generateProtocol": true, + "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithParamAliasClient.withAliasedName" + }, + { + "$id": "160", + "kind": "basic", + "name": "withOriginalName", + "accessibility": "public", + "apiVersions": [], + "operation": { + "$id": "161", + "name": "withOriginalName", + "resourceName": "IndividuallyParentNestedWithParamAliasClient", + "accessibility": "public", + "parameters": [ + { + "$id": "162", + "kind": "path", + "name": "blobName", + "serializedName": "blobName", + "type": { + "$id": "163", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "isApiVersion": false, + "explode": false, + "style": "simple", + "allowReserved": false, + "skipUrlEncoding": false, + "optional": false, + "scope": "Client", + "decorators": [], + "readOnly": false, + "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithParamAliasClient.withOriginalName.blobName", + "methodParameterSegments": [ + { + "$ref": "158" + } + ] + } + ], + "responses": [ + { + "statusCodes": [ + 204 + ], + "headers": [], + "isErrorResponse": false + } + ], + "httpMethod": "GET", + "uri": "{endpoint}", + "path": "/azure/client-generator-core/client-initialization/individually-parent/nested-default-individually-parent-param-alias/{blobName}/with-original-name", + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithParamAliasClient.withOriginalName", + "decorators": [], + "namespace": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient" + }, + "parameters": [], + "response": {}, + "isOverride": false, + "generateConvenient": true, + "generateProtocol": true, + "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithParamAliasClient.withOriginalName" + } + ], + "parameters": [ + { + "$id": "164", + "kind": "endpoint", + "name": "endpoint", + "serializedName": "endpoint", + "doc": "Service host", + "type": { + "$id": "165", + "kind": "url", + "name": "endpoint", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "isApiVersion": false, + "optional": false, + "scope": "Client", + "isEndpoint": true, + "defaultValue": { + "type": { + "$id": "166", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "http://localhost:3000" + }, + "serverUrlTemplate": "{endpoint}", + "skipUrlEncoding": false, + "readOnly": false, + "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithParamAliasClient.endpoint" + }, + { + "$ref": "158" + } + ], + "initializedBy": 3, + "decorators": [], + "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithParamAliasClient", + "apiVersions": [], + "parent": { + "$ref": "15" + }, + "isMultiServiceClient": false + } + ], + "isMultiServiceClient": false + } + ] +} From d716f43feb25cf2bdf933f9b2bcd967ae2ae0c87 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 4 Mar 2026 23:11:03 +0000 Subject: [PATCH 07/13] revert: remove Spector azure test project per review feedback Co-authored-by: JoshLove-msft <54595583+JoshLove-msft@users.noreply.github.com> --- .../individuallyParent/Configuration.json | 3 - ...nitialization.IndividuallyParentClient.sln | 48 - .../src/Generated/IndividuallyParentClient.cs | 30 - .../IndividuallyParentClientOptions.cs | 12 - ...ndividuallyParentNestedWithHeaderClient.cs | 47 - ...IndividuallyParentNestedWithMixedClient.cs | 47 - ...ividuallyParentNestedWithMultipleClient.cs | 47 - ...iduallyParentNestedWithParamAliasClient.cs | 39 - .../IndividuallyParentNestedWithPathClient.cs | 47 - ...IndividuallyParentNestedWithQueryClient.cs | 47 - .../Models/BlobProperties.Serialization.cs | 36 - .../src/Generated/Models/BlobProperties.cs | 19 - ...ization_IndividuallyParentClientContext.cs | 13 - ...ionIndividuallyParentClientModelFactory.cs | 13 - ...ialization.IndividuallyParentClient.csproj | 15 - .../individuallyParent/tspCodeModel.json | 2314 ----------------- 16 files changed, 2777 deletions(-) delete mode 100644 packages/http-client-csharp/generator/TestProjects/Spector/http/azure/client-generator-core/client-initialization/individuallyParent/Configuration.json delete mode 100644 packages/http-client-csharp/generator/TestProjects/Spector/http/azure/client-generator-core/client-initialization/individuallyParent/_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.sln delete mode 100644 packages/http-client-csharp/generator/TestProjects/Spector/http/azure/client-generator-core/client-initialization/individuallyParent/src/Generated/IndividuallyParentClient.cs delete mode 100644 packages/http-client-csharp/generator/TestProjects/Spector/http/azure/client-generator-core/client-initialization/individuallyParent/src/Generated/IndividuallyParentClientOptions.cs delete mode 100644 packages/http-client-csharp/generator/TestProjects/Spector/http/azure/client-generator-core/client-initialization/individuallyParent/src/Generated/IndividuallyParentNestedWithHeaderClient.cs delete mode 100644 packages/http-client-csharp/generator/TestProjects/Spector/http/azure/client-generator-core/client-initialization/individuallyParent/src/Generated/IndividuallyParentNestedWithMixedClient.cs delete mode 100644 packages/http-client-csharp/generator/TestProjects/Spector/http/azure/client-generator-core/client-initialization/individuallyParent/src/Generated/IndividuallyParentNestedWithMultipleClient.cs delete mode 100644 packages/http-client-csharp/generator/TestProjects/Spector/http/azure/client-generator-core/client-initialization/individuallyParent/src/Generated/IndividuallyParentNestedWithParamAliasClient.cs delete mode 100644 packages/http-client-csharp/generator/TestProjects/Spector/http/azure/client-generator-core/client-initialization/individuallyParent/src/Generated/IndividuallyParentNestedWithPathClient.cs delete mode 100644 packages/http-client-csharp/generator/TestProjects/Spector/http/azure/client-generator-core/client-initialization/individuallyParent/src/Generated/IndividuallyParentNestedWithQueryClient.cs delete mode 100644 packages/http-client-csharp/generator/TestProjects/Spector/http/azure/client-generator-core/client-initialization/individuallyParent/src/Generated/Models/BlobProperties.Serialization.cs delete mode 100644 packages/http-client-csharp/generator/TestProjects/Spector/http/azure/client-generator-core/client-initialization/individuallyParent/src/Generated/Models/BlobProperties.cs delete mode 100644 packages/http-client-csharp/generator/TestProjects/Spector/http/azure/client-generator-core/client-initialization/individuallyParent/src/Generated/Models/SpecsAzureClientGeneratorCoreClientInitialization_IndividuallyParentClientContext.cs delete mode 100644 packages/http-client-csharp/generator/TestProjects/Spector/http/azure/client-generator-core/client-initialization/individuallyParent/src/Generated/_Specs_AzureClientGeneratorCoreClientInitializationIndividuallyParentClientModelFactory.cs delete mode 100644 packages/http-client-csharp/generator/TestProjects/Spector/http/azure/client-generator-core/client-initialization/individuallyParent/src/_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.csproj delete mode 100644 packages/http-client-csharp/generator/TestProjects/Spector/http/azure/client-generator-core/client-initialization/individuallyParent/tspCodeModel.json diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/azure/client-generator-core/client-initialization/individuallyParent/Configuration.json b/packages/http-client-csharp/generator/TestProjects/Spector/http/azure/client-generator-core/client-initialization/individuallyParent/Configuration.json deleted file mode 100644 index 71ed1b5b5e7..00000000000 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/azure/client-generator-core/client-initialization/individuallyParent/Configuration.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "package-name": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient" -} diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/azure/client-generator-core/client-initialization/individuallyParent/_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.sln b/packages/http-client-csharp/generator/TestProjects/Spector/http/azure/client-generator-core/client-initialization/individuallyParent/_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.sln deleted file mode 100644 index 0be7d3a3e3f..00000000000 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/azure/client-generator-core/client-initialization/individuallyParent/_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.sln +++ /dev/null @@ -1,48 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 17 -VisualStudioVersion = 17.0.31903.59 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient", "src\_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.csproj", "{28FF4005-4467-4E36-92E7-DEA27DEB1519}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Debug|Any CPU.Build.0 = Debug|Any CPU - {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Release|Any CPU.ActiveCfg = Release|Any CPU - {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Release|Any CPU.Build.0 = Release|Any CPU - {8E9A77AC-792A-4432-8320-ACFD46730401}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {8E9A77AC-792A-4432-8320-ACFD46730401}.Debug|Any CPU.Build.0 = Debug|Any CPU - {8E9A77AC-792A-4432-8320-ACFD46730401}.Release|Any CPU.ActiveCfg = Release|Any CPU - {8E9A77AC-792A-4432-8320-ACFD46730401}.Release|Any CPU.Build.0 = Release|Any CPU - {A4241C1F-A53D-474C-9E4E-075054407E74}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {A4241C1F-A53D-474C-9E4E-075054407E74}.Debug|Any CPU.Build.0 = Debug|Any CPU - {A4241C1F-A53D-474C-9E4E-075054407E74}.Release|Any CPU.ActiveCfg = Release|Any CPU - {A4241C1F-A53D-474C-9E4E-075054407E74}.Release|Any CPU.Build.0 = Release|Any CPU - {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Debug|Any CPU.Build.0 = Debug|Any CPU - {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Release|Any CPU.ActiveCfg = Release|Any CPU - {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Release|Any CPU.Build.0 = Release|Any CPU - {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Debug|Any CPU.Build.0 = Debug|Any CPU - {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Release|Any CPU.ActiveCfg = Release|Any CPU - {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Release|Any CPU.Build.0 = Release|Any CPU - {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.Build.0 = Debug|Any CPU - {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.ActiveCfg = Release|Any CPU - {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.Build.0 = Release|Any CPU - {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Debug|Any CPU.Build.0 = Debug|Any CPU - {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Release|Any CPU.ActiveCfg = Release|Any CPU - {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {A97F4B90-2591-4689-B1F8-5F21FE6D6CAE} - EndGlobalSection -EndGlobal diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/azure/client-generator-core/client-initialization/individuallyParent/src/Generated/IndividuallyParentClient.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/azure/client-generator-core/client-initialization/individuallyParent/src/Generated/IndividuallyParentClient.cs deleted file mode 100644 index bde53255c10..00000000000 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/azure/client-generator-core/client-initialization/individuallyParent/src/Generated/IndividuallyParentClient.cs +++ /dev/null @@ -1,30 +0,0 @@ -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; - -namespace Specs.Azure.ClientGenerator.Core.ClientInitialization._IndividuallyParentClient -{ - public partial class IndividuallyParentClient - { - public IndividuallyParentClient() : this(new Uri("http://localhost:3000"), new IndividuallyParentClientOptions()) => throw null; - - public IndividuallyParentClient(Uri endpoint, IndividuallyParentClientOptions options) => throw null; - - public ClientPipeline Pipeline => throw null; - - public virtual IndividuallyParentNestedWithPathClient GetIndividuallyParentNestedWithPathClient(string blobName) => throw null; - - public virtual IndividuallyParentNestedWithQueryClient GetIndividuallyParentNestedWithQueryClient(string blobName) => throw null; - - public virtual IndividuallyParentNestedWithHeaderClient GetIndividuallyParentNestedWithHeaderClient(string name) => throw null; - - public virtual IndividuallyParentNestedWithMultipleClient GetIndividuallyParentNestedWithMultipleClient(string name, string region) => throw null; - - public virtual IndividuallyParentNestedWithMixedClient GetIndividuallyParentNestedWithMixedClient(string name) => throw null; - - public virtual IndividuallyParentNestedWithParamAliasClient GetIndividuallyParentNestedWithParamAliasClient(string blobName) => throw null; - } -} diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/azure/client-generator-core/client-initialization/individuallyParent/src/Generated/IndividuallyParentClientOptions.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/azure/client-generator-core/client-initialization/individuallyParent/src/Generated/IndividuallyParentClientOptions.cs deleted file mode 100644 index 315a291c34d..00000000000 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/azure/client-generator-core/client-initialization/individuallyParent/src/Generated/IndividuallyParentClientOptions.cs +++ /dev/null @@ -1,12 +0,0 @@ -// - -#nullable disable - -using System.ClientModel.Primitives; - -namespace Specs.Azure.ClientGenerator.Core.ClientInitialization._IndividuallyParentClient -{ - public partial class IndividuallyParentClientOptions : ClientPipelineOptions - { - } -} diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/azure/client-generator-core/client-initialization/individuallyParent/src/Generated/IndividuallyParentNestedWithHeaderClient.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/azure/client-generator-core/client-initialization/individuallyParent/src/Generated/IndividuallyParentNestedWithHeaderClient.cs deleted file mode 100644 index f6a9ed03e34..00000000000 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/azure/client-generator-core/client-initialization/individuallyParent/src/Generated/IndividuallyParentNestedWithHeaderClient.cs +++ /dev/null @@ -1,47 +0,0 @@ -// - -#nullable disable - -using System; -using System.ClientModel; -using System.ClientModel.Primitives; -using System.Threading; -using System.Threading.Tasks; - -namespace Specs.Azure.ClientGenerator.Core.ClientInitialization._IndividuallyParentClient -{ - public partial class IndividuallyParentNestedWithHeaderClient - { - protected IndividuallyParentNestedWithHeaderClient() => throw null; - - public IndividuallyParentNestedWithHeaderClient(string name) : this(new Uri("http://localhost:3000"), name, new IndividuallyParentClientOptions()) => throw null; - - public IndividuallyParentNestedWithHeaderClient(Uri endpoint, string name, IndividuallyParentClientOptions options) => throw null; - - public ClientPipeline Pipeline => throw null; - - public virtual ClientResult WithQuery(string format, RequestOptions options) => throw null; - - public virtual Task WithQueryAsync(string format, RequestOptions options) => throw null; - - public virtual ClientResult WithQuery(string format = default, CancellationToken cancellationToken = default) => throw null; - - public virtual Task WithQueryAsync(string format = default, CancellationToken cancellationToken = default) => throw null; - - public virtual ClientResult GetStandalone(RequestOptions options) => throw null; - - public virtual Task GetStandaloneAsync(RequestOptions options) => throw null; - - public virtual ClientResult GetStandalone(CancellationToken cancellationToken = default) => throw null; - - public virtual Task GetStandaloneAsync(CancellationToken cancellationToken = default) => throw null; - - public virtual ClientResult DeleteStandalone(RequestOptions options) => throw null; - - public virtual Task DeleteStandaloneAsync(RequestOptions options) => throw null; - - public virtual ClientResult DeleteStandalone(CancellationToken cancellationToken = default) => throw null; - - public virtual Task DeleteStandaloneAsync(CancellationToken cancellationToken = default) => throw null; - } -} diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/azure/client-generator-core/client-initialization/individuallyParent/src/Generated/IndividuallyParentNestedWithMixedClient.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/azure/client-generator-core/client-initialization/individuallyParent/src/Generated/IndividuallyParentNestedWithMixedClient.cs deleted file mode 100644 index b812efea70b..00000000000 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/azure/client-generator-core/client-initialization/individuallyParent/src/Generated/IndividuallyParentNestedWithMixedClient.cs +++ /dev/null @@ -1,47 +0,0 @@ -// - -#nullable disable - -using System; -using System.ClientModel; -using System.ClientModel.Primitives; -using System.Threading; -using System.Threading.Tasks; - -namespace Specs.Azure.ClientGenerator.Core.ClientInitialization._IndividuallyParentClient -{ - public partial class IndividuallyParentNestedWithMixedClient - { - protected IndividuallyParentNestedWithMixedClient() => throw null; - - public IndividuallyParentNestedWithMixedClient(string name) : this(new Uri("http://localhost:3000"), name, new IndividuallyParentClientOptions()) => throw null; - - public IndividuallyParentNestedWithMixedClient(Uri endpoint, string name, IndividuallyParentClientOptions options) => throw null; - - public ClientPipeline Pipeline => throw null; - - public virtual ClientResult WithQuery(string region, string format, RequestOptions options) => throw null; - - public virtual Task WithQueryAsync(string region, string format, RequestOptions options) => throw null; - - public virtual ClientResult WithQuery(string region, string format = default, CancellationToken cancellationToken = default) => throw null; - - public virtual Task WithQueryAsync(string region, string format = default, CancellationToken cancellationToken = default) => throw null; - - public virtual ClientResult GetStandalone(string region, RequestOptions options) => throw null; - - public virtual Task GetStandaloneAsync(string region, RequestOptions options) => throw null; - - public virtual ClientResult GetStandalone(string region, CancellationToken cancellationToken = default) => throw null; - - public virtual Task GetStandaloneAsync(string region, CancellationToken cancellationToken = default) => throw null; - - public virtual ClientResult DeleteStandalone(string region, RequestOptions options) => throw null; - - public virtual Task DeleteStandaloneAsync(string region, RequestOptions options) => throw null; - - public virtual ClientResult DeleteStandalone(string region, CancellationToken cancellationToken = default) => throw null; - - public virtual Task DeleteStandaloneAsync(string region, CancellationToken cancellationToken = default) => throw null; - } -} diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/azure/client-generator-core/client-initialization/individuallyParent/src/Generated/IndividuallyParentNestedWithMultipleClient.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/azure/client-generator-core/client-initialization/individuallyParent/src/Generated/IndividuallyParentNestedWithMultipleClient.cs deleted file mode 100644 index 43cb431c2c2..00000000000 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/azure/client-generator-core/client-initialization/individuallyParent/src/Generated/IndividuallyParentNestedWithMultipleClient.cs +++ /dev/null @@ -1,47 +0,0 @@ -// - -#nullable disable - -using System; -using System.ClientModel; -using System.ClientModel.Primitives; -using System.Threading; -using System.Threading.Tasks; - -namespace Specs.Azure.ClientGenerator.Core.ClientInitialization._IndividuallyParentClient -{ - public partial class IndividuallyParentNestedWithMultipleClient - { - protected IndividuallyParentNestedWithMultipleClient() => throw null; - - public IndividuallyParentNestedWithMultipleClient(string name, string region) : this(new Uri("http://localhost:3000"), name, region, new IndividuallyParentClientOptions()) => throw null; - - public IndividuallyParentNestedWithMultipleClient(Uri endpoint, string name, string region, IndividuallyParentClientOptions options) => throw null; - - public ClientPipeline Pipeline => throw null; - - public virtual ClientResult WithQuery(string format, RequestOptions options) => throw null; - - public virtual Task WithQueryAsync(string format, RequestOptions options) => throw null; - - public virtual ClientResult WithQuery(string format = default, CancellationToken cancellationToken = default) => throw null; - - public virtual Task WithQueryAsync(string format = default, CancellationToken cancellationToken = default) => throw null; - - public virtual ClientResult GetStandalone(RequestOptions options) => throw null; - - public virtual Task GetStandaloneAsync(RequestOptions options) => throw null; - - public virtual ClientResult GetStandalone(CancellationToken cancellationToken = default) => throw null; - - public virtual Task GetStandaloneAsync(CancellationToken cancellationToken = default) => throw null; - - public virtual ClientResult DeleteStandalone(RequestOptions options) => throw null; - - public virtual Task DeleteStandaloneAsync(RequestOptions options) => throw null; - - public virtual ClientResult DeleteStandalone(CancellationToken cancellationToken = default) => throw null; - - public virtual Task DeleteStandaloneAsync(CancellationToken cancellationToken = default) => throw null; - } -} diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/azure/client-generator-core/client-initialization/individuallyParent/src/Generated/IndividuallyParentNestedWithParamAliasClient.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/azure/client-generator-core/client-initialization/individuallyParent/src/Generated/IndividuallyParentNestedWithParamAliasClient.cs deleted file mode 100644 index 2c3ba10796e..00000000000 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/azure/client-generator-core/client-initialization/individuallyParent/src/Generated/IndividuallyParentNestedWithParamAliasClient.cs +++ /dev/null @@ -1,39 +0,0 @@ -// - -#nullable disable - -using System; -using System.ClientModel; -using System.ClientModel.Primitives; -using System.Threading; -using System.Threading.Tasks; - -namespace Specs.Azure.ClientGenerator.Core.ClientInitialization._IndividuallyParentClient -{ - public partial class IndividuallyParentNestedWithParamAliasClient - { - protected IndividuallyParentNestedWithParamAliasClient() => throw null; - - public IndividuallyParentNestedWithParamAliasClient(string blobName, string blob) : this(new Uri("http://localhost:3000"), blobName, blob, new IndividuallyParentClientOptions()) => throw null; - - public IndividuallyParentNestedWithParamAliasClient(Uri endpoint, string blobName, string blob, IndividuallyParentClientOptions options) => throw null; - - public ClientPipeline Pipeline => throw null; - - public virtual ClientResult WithAliasedName(RequestOptions options) => throw null; - - public virtual Task WithAliasedNameAsync(RequestOptions options) => throw null; - - public virtual ClientResult WithAliasedName(CancellationToken cancellationToken = default) => throw null; - - public virtual Task WithAliasedNameAsync(CancellationToken cancellationToken = default) => throw null; - - public virtual ClientResult WithOriginalName(RequestOptions options) => throw null; - - public virtual Task WithOriginalNameAsync(RequestOptions options) => throw null; - - public virtual ClientResult WithOriginalName(CancellationToken cancellationToken = default) => throw null; - - public virtual Task WithOriginalNameAsync(CancellationToken cancellationToken = default) => throw null; - } -} diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/azure/client-generator-core/client-initialization/individuallyParent/src/Generated/IndividuallyParentNestedWithPathClient.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/azure/client-generator-core/client-initialization/individuallyParent/src/Generated/IndividuallyParentNestedWithPathClient.cs deleted file mode 100644 index e1c27d7b08a..00000000000 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/azure/client-generator-core/client-initialization/individuallyParent/src/Generated/IndividuallyParentNestedWithPathClient.cs +++ /dev/null @@ -1,47 +0,0 @@ -// - -#nullable disable - -using System; -using System.ClientModel; -using System.ClientModel.Primitives; -using System.Threading; -using System.Threading.Tasks; - -namespace Specs.Azure.ClientGenerator.Core.ClientInitialization._IndividuallyParentClient -{ - public partial class IndividuallyParentNestedWithPathClient - { - protected IndividuallyParentNestedWithPathClient() => throw null; - - public IndividuallyParentNestedWithPathClient(string blobName) : this(new Uri("http://localhost:3000"), blobName, new IndividuallyParentClientOptions()) => throw null; - - public IndividuallyParentNestedWithPathClient(Uri endpoint, string blobName, IndividuallyParentClientOptions options) => throw null; - - public ClientPipeline Pipeline => throw null; - - public virtual ClientResult WithQuery(string format, RequestOptions options) => throw null; - - public virtual Task WithQueryAsync(string format, RequestOptions options) => throw null; - - public virtual ClientResult WithQuery(string format = default, CancellationToken cancellationToken = default) => throw null; - - public virtual Task WithQueryAsync(string format = default, CancellationToken cancellationToken = default) => throw null; - - public virtual ClientResult GetStandalone(RequestOptions options) => throw null; - - public virtual Task GetStandaloneAsync(RequestOptions options) => throw null; - - public virtual ClientResult GetStandalone(CancellationToken cancellationToken = default) => throw null; - - public virtual Task> GetStandaloneAsync(CancellationToken cancellationToken = default) => throw null; - - public virtual ClientResult DeleteStandalone(RequestOptions options) => throw null; - - public virtual Task DeleteStandaloneAsync(RequestOptions options) => throw null; - - public virtual ClientResult DeleteStandalone(CancellationToken cancellationToken = default) => throw null; - - public virtual Task DeleteStandaloneAsync(CancellationToken cancellationToken = default) => throw null; - } -} diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/azure/client-generator-core/client-initialization/individuallyParent/src/Generated/IndividuallyParentNestedWithQueryClient.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/azure/client-generator-core/client-initialization/individuallyParent/src/Generated/IndividuallyParentNestedWithQueryClient.cs deleted file mode 100644 index 1dac6cc2f87..00000000000 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/azure/client-generator-core/client-initialization/individuallyParent/src/Generated/IndividuallyParentNestedWithQueryClient.cs +++ /dev/null @@ -1,47 +0,0 @@ -// - -#nullable disable - -using System; -using System.ClientModel; -using System.ClientModel.Primitives; -using System.Threading; -using System.Threading.Tasks; - -namespace Specs.Azure.ClientGenerator.Core.ClientInitialization._IndividuallyParentClient -{ - public partial class IndividuallyParentNestedWithQueryClient - { - protected IndividuallyParentNestedWithQueryClient() => throw null; - - public IndividuallyParentNestedWithQueryClient(string blobName) : this(new Uri("http://localhost:3000"), blobName, new IndividuallyParentClientOptions()) => throw null; - - public IndividuallyParentNestedWithQueryClient(Uri endpoint, string blobName, IndividuallyParentClientOptions options) => throw null; - - public ClientPipeline Pipeline => throw null; - - public virtual ClientResult WithQuery(string format, RequestOptions options) => throw null; - - public virtual Task WithQueryAsync(string format, RequestOptions options) => throw null; - - public virtual ClientResult WithQuery(string format = default, CancellationToken cancellationToken = default) => throw null; - - public virtual Task WithQueryAsync(string format = default, CancellationToken cancellationToken = default) => throw null; - - public virtual ClientResult GetStandalone(RequestOptions options) => throw null; - - public virtual Task GetStandaloneAsync(RequestOptions options) => throw null; - - public virtual ClientResult GetStandalone(CancellationToken cancellationToken = default) => throw null; - - public virtual Task> GetStandaloneAsync(CancellationToken cancellationToken = default) => throw null; - - public virtual ClientResult DeleteStandalone(RequestOptions options) => throw null; - - public virtual Task DeleteStandaloneAsync(RequestOptions options) => throw null; - - public virtual ClientResult DeleteStandalone(CancellationToken cancellationToken = default) => throw null; - - public virtual Task DeleteStandaloneAsync(CancellationToken cancellationToken = default) => throw null; - } -} diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/azure/client-generator-core/client-initialization/individuallyParent/src/Generated/Models/BlobProperties.Serialization.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/azure/client-generator-core/client-initialization/individuallyParent/src/Generated/Models/BlobProperties.Serialization.cs deleted file mode 100644 index 79ae2623893..00000000000 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/azure/client-generator-core/client-initialization/individuallyParent/src/Generated/Models/BlobProperties.Serialization.cs +++ /dev/null @@ -1,36 +0,0 @@ -// - -#nullable disable - -using System; -using System.ClientModel; -using System.ClientModel.Primitives; -using System.Text.Json; - -namespace Specs.Azure.ClientGenerator.Core.ClientInitialization._IndividuallyParentClient -{ - public partial class BlobProperties : IJsonModel - { - internal BlobProperties() => throw null; - - protected virtual BlobProperties PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) => throw null; - - protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) => throw null; - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => throw null; - - BlobProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => throw null; - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => throw null; - - public static explicit operator BlobProperties(ClientResult result) => throw null; - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; - - protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; - - BlobProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; - - protected virtual BlobProperties JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; - } -} diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/azure/client-generator-core/client-initialization/individuallyParent/src/Generated/Models/BlobProperties.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/azure/client-generator-core/client-initialization/individuallyParent/src/Generated/Models/BlobProperties.cs deleted file mode 100644 index 0ca309a6b95..00000000000 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/azure/client-generator-core/client-initialization/individuallyParent/src/Generated/Models/BlobProperties.cs +++ /dev/null @@ -1,19 +0,0 @@ -// - -#nullable disable - -using System; - -namespace Specs.Azure.ClientGenerator.Core.ClientInitialization._IndividuallyParentClient -{ - public partial class BlobProperties - { - public string Name => throw null; - - public long Size => throw null; - - public string ContentType => throw null; - - public DateTimeOffset CreatedOn => throw null; - } -} diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/azure/client-generator-core/client-initialization/individuallyParent/src/Generated/Models/SpecsAzureClientGeneratorCoreClientInitialization_IndividuallyParentClientContext.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/azure/client-generator-core/client-initialization/individuallyParent/src/Generated/Models/SpecsAzureClientGeneratorCoreClientInitialization_IndividuallyParentClientContext.cs deleted file mode 100644 index e8dcaa57667..00000000000 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/azure/client-generator-core/client-initialization/individuallyParent/src/Generated/Models/SpecsAzureClientGeneratorCoreClientInitialization_IndividuallyParentClientContext.cs +++ /dev/null @@ -1,13 +0,0 @@ -// - -#nullable disable - -using System.ClientModel.Primitives; - -namespace Specs.Azure.ClientGenerator.Core.ClientInitialization._IndividuallyParentClient -{ - [ModelReaderWriterBuildable(typeof(BlobProperties))] - public partial class SpecsAzureClientGeneratorCoreClientInitialization_IndividuallyParentClientContext : ModelReaderWriterContext - { - } -} diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/azure/client-generator-core/client-initialization/individuallyParent/src/Generated/_Specs_AzureClientGeneratorCoreClientInitializationIndividuallyParentClientModelFactory.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/azure/client-generator-core/client-initialization/individuallyParent/src/Generated/_Specs_AzureClientGeneratorCoreClientInitializationIndividuallyParentClientModelFactory.cs deleted file mode 100644 index d087a646e7b..00000000000 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/azure/client-generator-core/client-initialization/individuallyParent/src/Generated/_Specs_AzureClientGeneratorCoreClientInitializationIndividuallyParentClientModelFactory.cs +++ /dev/null @@ -1,13 +0,0 @@ -// - -#nullable disable - -using System; - -namespace Specs.Azure.ClientGenerator.Core.ClientInitialization._IndividuallyParentClient -{ - public static partial class _Specs_AzureClientGeneratorCoreClientInitializationIndividuallyParentClientModelFactory - { - public static BlobProperties BlobProperties(string name = default, long size = default, string contentType = default, DateTimeOffset createdOn = default) => throw null; - } -} diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/azure/client-generator-core/client-initialization/individuallyParent/src/_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.csproj b/packages/http-client-csharp/generator/TestProjects/Spector/http/azure/client-generator-core/client-initialization/individuallyParent/src/_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.csproj deleted file mode 100644 index 96025087533..00000000000 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/azure/client-generator-core/client-initialization/individuallyParent/src/_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.csproj +++ /dev/null @@ -1,15 +0,0 @@ - - - This is the _Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient client library for developing .NET applications with rich experience. - SDK Code Generation _Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient - 1.0.0-beta.1 - _Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient - netstandard2.0;net8.0 - latest - true - - - - - - diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/azure/client-generator-core/client-initialization/individuallyParent/tspCodeModel.json b/packages/http-client-csharp/generator/TestProjects/Spector/http/azure/client-generator-core/client-initialization/individuallyParent/tspCodeModel.json deleted file mode 100644 index a33d4361aea..00000000000 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/azure/client-generator-core/client-initialization/individuallyParent/tspCodeModel.json +++ /dev/null @@ -1,2314 +0,0 @@ -{ - "name": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient", - "apiVersions": [], - "enums": [], - "constants": [ - { - "$id": "1", - "kind": "constant", - "name": "getStandaloneContentType", - "namespace": "", - "usage": "None", - "valueType": { - "$id": "2", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "value": "application/json", - "decorators": [] - }, - { - "$id": "3", - "kind": "constant", - "name": "getStandaloneContentType1", - "namespace": "", - "usage": "None", - "valueType": { - "$id": "4", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "value": "application/json", - "decorators": [] - } - ], - "models": [ - { - "$id": "5", - "kind": "model", - "name": "BlobProperties", - "namespace": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient", - "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.BlobProperties", - "usage": "Output,Json", - "doc": "Properties of a blob", - "decorators": [], - "serializationOptions": { - "json": { - "name": "BlobProperties" - } - }, - "properties": [ - { - "$id": "6", - "kind": "property", - "name": "name", - "serializedName": "name", - "type": { - "$id": "7", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.BlobProperties.name", - "serializationOptions": { - "json": { - "name": "name" - } - }, - "isHttpMetadata": false - }, - { - "$id": "8", - "kind": "property", - "name": "size", - "serializedName": "size", - "type": { - "$id": "9", - "kind": "int64", - "name": "int64", - "crossLanguageDefinitionId": "TypeSpec.int64", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.BlobProperties.size", - "serializationOptions": { - "json": { - "name": "size" - } - }, - "isHttpMetadata": false - }, - { - "$id": "10", - "kind": "property", - "name": "contentType", - "serializedName": "contentType", - "type": { - "$id": "11", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.BlobProperties.contentType", - "serializationOptions": { - "json": { - "name": "contentType" - } - }, - "isHttpMetadata": false - }, - { - "$id": "12", - "kind": "property", - "name": "createdOn", - "serializedName": "createdOn", - "type": { - "$id": "13", - "kind": "utcDateTime", - "name": "utcDateTime", - "encode": "rfc3339", - "wireType": { - "$id": "14", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "crossLanguageDefinitionId": "TypeSpec.utcDateTime", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.BlobProperties.createdOn", - "serializationOptions": { - "json": { - "name": "createdOn" - } - }, - "isHttpMetadata": false - } - ] - } - ], - "clients": [ - { - "$id": "15", - "kind": "client", - "name": "IndividuallyParentClient", - "namespace": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient", - "doc": "Test for client initialization decorator - moving parameters from method to client level", - "methods": [], - "parameters": [ - { - "$id": "16", - "kind": "endpoint", - "name": "endpoint", - "serializedName": "endpoint", - "doc": "Service host", - "type": { - "$id": "17", - "kind": "url", - "name": "endpoint", - "crossLanguageDefinitionId": "TypeSpec.url" - }, - "isApiVersion": false, - "optional": false, - "scope": "Client", - "isEndpoint": true, - "defaultValue": { - "type": { - "$id": "18", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string" - }, - "value": "http://localhost:3000" - }, - "serverUrlTemplate": "{endpoint}", - "skipUrlEncoding": false, - "readOnly": false, - "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.endpoint" - } - ], - "initializedBy": 1, - "decorators": [], - "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient", - "apiVersions": [], - "children": [ - { - "$id": "19", - "kind": "client", - "name": "IndividuallyParentNestedWithPathClient", - "namespace": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient", - "doc": "Operations for nested default -> individually and parent", - "methods": [ - { - "$id": "20", - "kind": "basic", - "name": "withQuery", - "accessibility": "public", - "apiVersions": [], - "operation": { - "$id": "21", - "name": "withQuery", - "resourceName": "IndividuallyParentNestedWithPathClient", - "accessibility": "public", - "parameters": [ - { - "$id": "22", - "kind": "path", - "name": "blobName", - "serializedName": "blobName", - "type": { - "$id": "23", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "isApiVersion": false, - "explode": false, - "style": "simple", - "allowReserved": false, - "skipUrlEncoding": false, - "optional": false, - "scope": "Client", - "decorators": [], - "readOnly": false, - "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithPathClient.withQuery.blobName", - "methodParameterSegments": [ - { - "$id": "24", - "kind": "method", - "name": "blobName", - "serializedName": "blobName", - "doc": "The blob name to use for operations", - "type": { - "$id": "25", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "location": "", - "isApiVersion": false, - "optional": false, - "scope": "Method", - "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.PathParamClientOptions.blobName", - "readOnly": false, - "access": "public", - "decorators": [] - } - ] - }, - { - "$id": "26", - "kind": "query", - "name": "format", - "serializedName": "format", - "type": { - "$id": "27", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "isApiVersion": false, - "explode": false, - "optional": true, - "scope": "Method", - "decorators": [], - "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithPathClient.withQuery.format", - "readOnly": false, - "methodParameterSegments": [ - { - "$id": "28", - "kind": "method", - "name": "format", - "serializedName": "format", - "type": { - "$id": "29", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "location": "Query", - "isApiVersion": false, - "optional": true, - "scope": "Method", - "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithPathClient.withQuery.format", - "readOnly": false, - "access": "public", - "decorators": [] - } - ] - } - ], - "responses": [ - { - "statusCodes": [ - 204 - ], - "headers": [], - "isErrorResponse": false - } - ], - "httpMethod": "GET", - "uri": "{endpoint}", - "path": "/azure/client-generator-core/client-initialization/individually-parent/nested-default-individually-parent/{blobName}/with-query", - "bufferResponse": true, - "generateProtocolMethod": true, - "generateConvenienceMethod": true, - "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithPathClient.withQuery", - "decorators": [], - "namespace": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient" - }, - "parameters": [ - { - "$ref": "28" - } - ], - "response": {}, - "isOverride": false, - "generateConvenient": true, - "generateProtocol": true, - "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithPathClient.withQuery" - }, - { - "$id": "30", - "kind": "basic", - "name": "getStandalone", - "accessibility": "public", - "apiVersions": [], - "operation": { - "$id": "31", - "name": "getStandalone", - "resourceName": "IndividuallyParentNestedWithPathClient", - "accessibility": "public", - "parameters": [ - { - "$id": "32", - "kind": "path", - "name": "blobName", - "serializedName": "blobName", - "type": { - "$id": "33", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "isApiVersion": false, - "explode": false, - "style": "simple", - "allowReserved": false, - "skipUrlEncoding": false, - "optional": false, - "scope": "Client", - "decorators": [], - "readOnly": false, - "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithPathClient.getStandalone.blobName", - "methodParameterSegments": [ - { - "$ref": "24" - } - ] - }, - { - "$id": "34", - "kind": "header", - "name": "accept", - "serializedName": "Accept", - "type": { - "$ref": "1" - }, - "isApiVersion": false, - "optional": false, - "isContentType": false, - "scope": "Constant", - "readOnly": false, - "decorators": [], - "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithPathClient.getStandalone.accept", - "methodParameterSegments": [ - { - "$id": "35", - "kind": "method", - "name": "accept", - "serializedName": "Accept", - "type": { - "$ref": "1" - }, - "location": "Header", - "isApiVersion": false, - "optional": false, - "scope": "Constant", - "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithPathClient.getStandalone.accept", - "readOnly": false, - "access": "public", - "decorators": [] - } - ] - } - ], - "responses": [ - { - "statusCodes": [ - 200 - ], - "bodyType": { - "$ref": "5" - }, - "headers": [], - "isErrorResponse": false, - "contentTypes": [ - "application/json" - ] - } - ], - "httpMethod": "GET", - "uri": "{endpoint}", - "path": "/azure/client-generator-core/client-initialization/individually-parent/nested-default-individually-parent/{blobName}/get-standalone", - "bufferResponse": true, - "generateProtocolMethod": true, - "generateConvenienceMethod": true, - "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithPathClient.getStandalone", - "decorators": [], - "namespace": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient" - }, - "parameters": [ - { - "$ref": "35" - } - ], - "response": { - "type": { - "$ref": "5" - } - }, - "isOverride": false, - "generateConvenient": true, - "generateProtocol": true, - "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithPathClient.getStandalone" - }, - { - "$id": "36", - "kind": "basic", - "name": "deleteStandalone", - "accessibility": "public", - "apiVersions": [], - "operation": { - "$id": "37", - "name": "deleteStandalone", - "resourceName": "IndividuallyParentNestedWithPathClient", - "accessibility": "public", - "parameters": [ - { - "$id": "38", - "kind": "path", - "name": "blobName", - "serializedName": "blobName", - "type": { - "$id": "39", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "isApiVersion": false, - "explode": false, - "style": "simple", - "allowReserved": false, - "skipUrlEncoding": false, - "optional": false, - "scope": "Client", - "decorators": [], - "readOnly": false, - "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithPathClient.deleteStandalone.blobName", - "methodParameterSegments": [ - { - "$ref": "24" - } - ] - } - ], - "responses": [ - { - "statusCodes": [ - 204 - ], - "headers": [], - "isErrorResponse": false - } - ], - "httpMethod": "DELETE", - "uri": "{endpoint}", - "path": "/azure/client-generator-core/client-initialization/individually-parent/nested-default-individually-parent/{blobName}", - "bufferResponse": true, - "generateProtocolMethod": true, - "generateConvenienceMethod": true, - "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithPathClient.deleteStandalone", - "decorators": [], - "namespace": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient" - }, - "parameters": [], - "response": {}, - "isOverride": false, - "generateConvenient": true, - "generateProtocol": true, - "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithPathClient.deleteStandalone" - } - ], - "parameters": [ - { - "$id": "40", - "kind": "endpoint", - "name": "endpoint", - "serializedName": "endpoint", - "doc": "Service host", - "type": { - "$id": "41", - "kind": "url", - "name": "endpoint", - "crossLanguageDefinitionId": "TypeSpec.url" - }, - "isApiVersion": false, - "optional": false, - "scope": "Client", - "isEndpoint": true, - "defaultValue": { - "type": { - "$id": "42", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string" - }, - "value": "http://localhost:3000" - }, - "serverUrlTemplate": "{endpoint}", - "skipUrlEncoding": false, - "readOnly": false, - "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithPathClient.endpoint" - }, - { - "$ref": "24" - } - ], - "initializedBy": 3, - "decorators": [], - "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithPathClient", - "apiVersions": [], - "parent": { - "$ref": "15" - }, - "isMultiServiceClient": false - }, - { - "$id": "43", - "kind": "client", - "name": "IndividuallyParentNestedWithQueryClient", - "namespace": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient", - "doc": "Operations for nested default -> individually and parent with query parameters", - "methods": [ - { - "$id": "44", - "kind": "basic", - "name": "withQuery", - "accessibility": "public", - "apiVersions": [], - "operation": { - "$id": "45", - "name": "withQuery", - "resourceName": "IndividuallyParentNestedWithQueryClient", - "accessibility": "public", - "parameters": [ - { - "$id": "46", - "kind": "query", - "name": "blobName", - "serializedName": "blobName", - "type": { - "$id": "47", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "isApiVersion": false, - "explode": false, - "optional": false, - "scope": "Client", - "decorators": [], - "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithQueryClient.withQuery.blobName", - "readOnly": false, - "methodParameterSegments": [ - { - "$id": "48", - "kind": "method", - "name": "blobName", - "serializedName": "blobName", - "doc": "The blob name to use for operations", - "type": { - "$id": "49", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "location": "", - "isApiVersion": false, - "optional": false, - "scope": "Method", - "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.BlobQueryParamClientOptions.blobName", - "readOnly": false, - "access": "public", - "decorators": [] - } - ] - }, - { - "$id": "50", - "kind": "query", - "name": "format", - "serializedName": "format", - "type": { - "$id": "51", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "isApiVersion": false, - "explode": false, - "optional": true, - "scope": "Method", - "decorators": [], - "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithQueryClient.withQuery.format", - "readOnly": false, - "methodParameterSegments": [ - { - "$id": "52", - "kind": "method", - "name": "format", - "serializedName": "format", - "type": { - "$id": "53", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "location": "Query", - "isApiVersion": false, - "optional": true, - "scope": "Method", - "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithQueryClient.withQuery.format", - "readOnly": false, - "access": "public", - "decorators": [] - } - ] - } - ], - "responses": [ - { - "statusCodes": [ - 204 - ], - "headers": [], - "isErrorResponse": false - } - ], - "httpMethod": "GET", - "uri": "{endpoint}", - "path": "/azure/client-generator-core/client-initialization/individually-parent/nested-default-individually-parent-query/with-query", - "bufferResponse": true, - "generateProtocolMethod": true, - "generateConvenienceMethod": true, - "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithQueryClient.withQuery", - "decorators": [], - "namespace": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient" - }, - "parameters": [ - { - "$ref": "52" - } - ], - "response": {}, - "isOverride": false, - "generateConvenient": true, - "generateProtocol": true, - "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithQueryClient.withQuery" - }, - { - "$id": "54", - "kind": "basic", - "name": "getStandalone", - "accessibility": "public", - "apiVersions": [], - "operation": { - "$id": "55", - "name": "getStandalone", - "resourceName": "IndividuallyParentNestedWithQueryClient", - "accessibility": "public", - "parameters": [ - { - "$id": "56", - "kind": "query", - "name": "blobName", - "serializedName": "blobName", - "type": { - "$id": "57", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "isApiVersion": false, - "explode": false, - "optional": false, - "scope": "Client", - "decorators": [], - "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithQueryClient.getStandalone.blobName", - "readOnly": false, - "methodParameterSegments": [ - { - "$ref": "48" - } - ] - }, - { - "$id": "58", - "kind": "header", - "name": "accept", - "serializedName": "Accept", - "type": { - "$ref": "3" - }, - "isApiVersion": false, - "optional": false, - "isContentType": false, - "scope": "Constant", - "readOnly": false, - "decorators": [], - "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithQueryClient.getStandalone.accept", - "methodParameterSegments": [ - { - "$id": "59", - "kind": "method", - "name": "accept", - "serializedName": "Accept", - "type": { - "$ref": "3" - }, - "location": "Header", - "isApiVersion": false, - "optional": false, - "scope": "Constant", - "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithQueryClient.getStandalone.accept", - "readOnly": false, - "access": "public", - "decorators": [] - } - ] - } - ], - "responses": [ - { - "statusCodes": [ - 200 - ], - "bodyType": { - "$ref": "5" - }, - "headers": [], - "isErrorResponse": false, - "contentTypes": [ - "application/json" - ] - } - ], - "httpMethod": "GET", - "uri": "{endpoint}", - "path": "/azure/client-generator-core/client-initialization/individually-parent/nested-default-individually-parent-query/get-standalone", - "bufferResponse": true, - "generateProtocolMethod": true, - "generateConvenienceMethod": true, - "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithQueryClient.getStandalone", - "decorators": [], - "namespace": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient" - }, - "parameters": [ - { - "$ref": "59" - } - ], - "response": { - "type": { - "$ref": "5" - } - }, - "isOverride": false, - "generateConvenient": true, - "generateProtocol": true, - "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithQueryClient.getStandalone" - }, - { - "$id": "60", - "kind": "basic", - "name": "deleteStandalone", - "accessibility": "public", - "apiVersions": [], - "operation": { - "$id": "61", - "name": "deleteStandalone", - "resourceName": "IndividuallyParentNestedWithQueryClient", - "accessibility": "public", - "parameters": [ - { - "$id": "62", - "kind": "query", - "name": "blobName", - "serializedName": "blobName", - "type": { - "$id": "63", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "isApiVersion": false, - "explode": false, - "optional": false, - "scope": "Client", - "decorators": [], - "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithQueryClient.deleteStandalone.blobName", - "readOnly": false, - "methodParameterSegments": [ - { - "$ref": "48" - } - ] - } - ], - "responses": [ - { - "statusCodes": [ - 204 - ], - "headers": [], - "isErrorResponse": false - } - ], - "httpMethod": "DELETE", - "uri": "{endpoint}", - "path": "/azure/client-generator-core/client-initialization/individually-parent/nested-default-individually-parent-query/delete-resource", - "bufferResponse": true, - "generateProtocolMethod": true, - "generateConvenienceMethod": true, - "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithQueryClient.deleteStandalone", - "decorators": [], - "namespace": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient" - }, - "parameters": [], - "response": {}, - "isOverride": false, - "generateConvenient": true, - "generateProtocol": true, - "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithQueryClient.deleteStandalone" - } - ], - "parameters": [ - { - "$id": "64", - "kind": "endpoint", - "name": "endpoint", - "serializedName": "endpoint", - "doc": "Service host", - "type": { - "$id": "65", - "kind": "url", - "name": "endpoint", - "crossLanguageDefinitionId": "TypeSpec.url" - }, - "isApiVersion": false, - "optional": false, - "scope": "Client", - "isEndpoint": true, - "defaultValue": { - "type": { - "$id": "66", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string" - }, - "value": "http://localhost:3000" - }, - "serverUrlTemplate": "{endpoint}", - "skipUrlEncoding": false, - "readOnly": false, - "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithQueryClient.endpoint" - }, - { - "$ref": "48" - } - ], - "initializedBy": 3, - "decorators": [], - "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithQueryClient", - "apiVersions": [], - "parent": { - "$ref": "15" - }, - "isMultiServiceClient": false - }, - { - "$id": "67", - "kind": "client", - "name": "IndividuallyParentNestedWithHeaderClient", - "namespace": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient", - "doc": "Operations for nested default -> individually and parent header parameters", - "methods": [ - { - "$id": "68", - "kind": "basic", - "name": "withQuery", - "accessibility": "public", - "apiVersions": [], - "operation": { - "$id": "69", - "name": "withQuery", - "resourceName": "IndividuallyParentNestedWithHeaderClient", - "accessibility": "public", - "parameters": [ - { - "$id": "70", - "kind": "header", - "name": "name", - "serializedName": "name", - "type": { - "$id": "71", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "isApiVersion": false, - "optional": false, - "isContentType": false, - "scope": "Client", - "readOnly": false, - "decorators": [], - "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithHeaderClient.withQuery.name", - "methodParameterSegments": [ - { - "$id": "72", - "kind": "method", - "name": "name", - "serializedName": "name", - "doc": "The name to use for operations", - "type": { - "$id": "73", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "location": "", - "isApiVersion": false, - "optional": false, - "scope": "Method", - "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.HeaderParamClientOptions.name", - "readOnly": false, - "access": "public", - "decorators": [] - } - ] - }, - { - "$id": "74", - "kind": "query", - "name": "format", - "serializedName": "format", - "type": { - "$id": "75", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "isApiVersion": false, - "explode": false, - "optional": true, - "scope": "Method", - "decorators": [], - "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithHeaderClient.withQuery.format", - "readOnly": false, - "methodParameterSegments": [ - { - "$id": "76", - "kind": "method", - "name": "format", - "serializedName": "format", - "type": { - "$id": "77", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "location": "Query", - "isApiVersion": false, - "optional": true, - "scope": "Method", - "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithHeaderClient.withQuery.format", - "readOnly": false, - "access": "public", - "decorators": [] - } - ] - } - ], - "responses": [ - { - "statusCodes": [ - 204 - ], - "headers": [], - "isErrorResponse": false - } - ], - "httpMethod": "GET", - "uri": "{endpoint}", - "path": "/azure/client-generator-core/client-initialization/individually-parent/nested-default-individually-parent-header/with-query", - "bufferResponse": true, - "generateProtocolMethod": true, - "generateConvenienceMethod": true, - "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithHeaderClient.withQuery", - "decorators": [], - "namespace": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient" - }, - "parameters": [ - { - "$ref": "76" - } - ], - "response": {}, - "isOverride": false, - "generateConvenient": true, - "generateProtocol": true, - "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithHeaderClient.withQuery" - }, - { - "$id": "78", - "kind": "basic", - "name": "getStandalone", - "accessibility": "public", - "apiVersions": [], - "operation": { - "$id": "79", - "name": "getStandalone", - "resourceName": "IndividuallyParentNestedWithHeaderClient", - "accessibility": "public", - "parameters": [ - { - "$id": "80", - "kind": "header", - "name": "name", - "serializedName": "name", - "type": { - "$id": "81", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "isApiVersion": false, - "optional": false, - "isContentType": false, - "scope": "Client", - "readOnly": false, - "decorators": [], - "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithHeaderClient.getStandalone.name", - "methodParameterSegments": [ - { - "$ref": "72" - } - ] - } - ], - "responses": [ - { - "statusCodes": [ - 204 - ], - "headers": [], - "isErrorResponse": false - } - ], - "httpMethod": "GET", - "uri": "{endpoint}", - "path": "/azure/client-generator-core/client-initialization/individually-parent/nested-default-individually-parent-header/get-standalone", - "bufferResponse": true, - "generateProtocolMethod": true, - "generateConvenienceMethod": true, - "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithHeaderClient.getStandalone", - "decorators": [], - "namespace": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient" - }, - "parameters": [], - "response": {}, - "isOverride": false, - "generateConvenient": true, - "generateProtocol": true, - "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithHeaderClient.getStandalone" - }, - { - "$id": "82", - "kind": "basic", - "name": "deleteStandalone", - "accessibility": "public", - "apiVersions": [], - "operation": { - "$id": "83", - "name": "deleteStandalone", - "resourceName": "IndividuallyParentNestedWithHeaderClient", - "accessibility": "public", - "parameters": [ - { - "$id": "84", - "kind": "header", - "name": "name", - "serializedName": "name", - "type": { - "$id": "85", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "isApiVersion": false, - "optional": false, - "isContentType": false, - "scope": "Client", - "readOnly": false, - "decorators": [], - "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithHeaderClient.deleteStandalone.name", - "methodParameterSegments": [ - { - "$ref": "72" - } - ] - } - ], - "responses": [ - { - "statusCodes": [ - 204 - ], - "headers": [], - "isErrorResponse": false - } - ], - "httpMethod": "DELETE", - "uri": "{endpoint}", - "path": "/azure/client-generator-core/client-initialization/individually-parent/nested-default-individually-parent-header/delete-standalone", - "bufferResponse": true, - "generateProtocolMethod": true, - "generateConvenienceMethod": true, - "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithHeaderClient.deleteStandalone", - "decorators": [], - "namespace": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient" - }, - "parameters": [], - "response": {}, - "isOverride": false, - "generateConvenient": true, - "generateProtocol": true, - "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithHeaderClient.deleteStandalone" - } - ], - "parameters": [ - { - "$id": "86", - "kind": "endpoint", - "name": "endpoint", - "serializedName": "endpoint", - "doc": "Service host", - "type": { - "$id": "87", - "kind": "url", - "name": "endpoint", - "crossLanguageDefinitionId": "TypeSpec.url" - }, - "isApiVersion": false, - "optional": false, - "scope": "Client", - "isEndpoint": true, - "defaultValue": { - "type": { - "$id": "88", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string" - }, - "value": "http://localhost:3000" - }, - "serverUrlTemplate": "{endpoint}", - "skipUrlEncoding": false, - "readOnly": false, - "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithHeaderClient.endpoint" - }, - { - "$ref": "72" - } - ], - "initializedBy": 3, - "decorators": [], - "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithHeaderClient", - "apiVersions": [], - "parent": { - "$ref": "15" - }, - "isMultiServiceClient": false - }, - { - "$id": "89", - "kind": "client", - "name": "IndividuallyParentNestedWithMultipleClient", - "namespace": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient", - "doc": "Operations for nested default -> individually and parent multiple parameters", - "methods": [ - { - "$id": "90", - "kind": "basic", - "name": "withQuery", - "accessibility": "public", - "apiVersions": [], - "operation": { - "$id": "91", - "name": "withQuery", - "resourceName": "IndividuallyParentNestedWithMultipleClient", - "accessibility": "public", - "parameters": [ - { - "$id": "92", - "kind": "header", - "name": "name", - "serializedName": "name", - "type": { - "$id": "93", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "isApiVersion": false, - "optional": false, - "isContentType": false, - "scope": "Client", - "readOnly": false, - "decorators": [], - "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithMultipleClient.withQuery.name", - "methodParameterSegments": [ - { - "$id": "94", - "kind": "method", - "name": "name", - "serializedName": "name", - "doc": "The name to use for operations", - "type": { - "$id": "95", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "location": "", - "isApiVersion": false, - "optional": false, - "scope": "Method", - "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.MultipleParamsClientOptions.name", - "readOnly": false, - "access": "public", - "decorators": [] - } - ] - }, - { - "$id": "96", - "kind": "query", - "name": "region", - "serializedName": "region", - "type": { - "$id": "97", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "isApiVersion": false, - "explode": false, - "optional": false, - "scope": "Client", - "decorators": [], - "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithMultipleClient.withQuery.region", - "readOnly": false, - "methodParameterSegments": [ - { - "$id": "98", - "kind": "method", - "name": "region", - "serializedName": "region", - "doc": "The region to use for operations", - "type": { - "$id": "99", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "location": "", - "isApiVersion": false, - "optional": false, - "scope": "Method", - "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.MultipleParamsClientOptions.region", - "readOnly": false, - "access": "public", - "decorators": [] - } - ] - }, - { - "$id": "100", - "kind": "query", - "name": "format", - "serializedName": "format", - "type": { - "$id": "101", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "isApiVersion": false, - "explode": false, - "optional": true, - "scope": "Method", - "decorators": [], - "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithMultipleClient.withQuery.format", - "readOnly": false, - "methodParameterSegments": [ - { - "$id": "102", - "kind": "method", - "name": "format", - "serializedName": "format", - "type": { - "$id": "103", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "location": "Query", - "isApiVersion": false, - "optional": true, - "scope": "Method", - "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithMultipleClient.withQuery.format", - "readOnly": false, - "access": "public", - "decorators": [] - } - ] - } - ], - "responses": [ - { - "statusCodes": [ - 204 - ], - "headers": [], - "isErrorResponse": false - } - ], - "httpMethod": "GET", - "uri": "{endpoint}", - "path": "/azure/client-generator-core/client-initialization/individually-parent/nested-default-individually-parent-multiple/with-query", - "bufferResponse": true, - "generateProtocolMethod": true, - "generateConvenienceMethod": true, - "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithMultipleClient.withQuery", - "decorators": [], - "namespace": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient" - }, - "parameters": [ - { - "$ref": "102" - } - ], - "response": {}, - "isOverride": false, - "generateConvenient": true, - "generateProtocol": true, - "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithMultipleClient.withQuery" - }, - { - "$id": "104", - "kind": "basic", - "name": "getStandalone", - "accessibility": "public", - "apiVersions": [], - "operation": { - "$id": "105", - "name": "getStandalone", - "resourceName": "IndividuallyParentNestedWithMultipleClient", - "accessibility": "public", - "parameters": [ - { - "$id": "106", - "kind": "header", - "name": "name", - "serializedName": "name", - "type": { - "$id": "107", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "isApiVersion": false, - "optional": false, - "isContentType": false, - "scope": "Client", - "readOnly": false, - "decorators": [], - "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithMultipleClient.getStandalone.name", - "methodParameterSegments": [ - { - "$ref": "94" - } - ] - }, - { - "$id": "108", - "kind": "query", - "name": "region", - "serializedName": "region", - "type": { - "$id": "109", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "isApiVersion": false, - "explode": false, - "optional": false, - "scope": "Client", - "decorators": [], - "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithMultipleClient.getStandalone.region", - "readOnly": false, - "methodParameterSegments": [ - { - "$ref": "98" - } - ] - } - ], - "responses": [ - { - "statusCodes": [ - 204 - ], - "headers": [], - "isErrorResponse": false - } - ], - "httpMethod": "GET", - "uri": "{endpoint}", - "path": "/azure/client-generator-core/client-initialization/individually-parent/nested-default-individually-parent-multiple/get-standalone", - "bufferResponse": true, - "generateProtocolMethod": true, - "generateConvenienceMethod": true, - "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithMultipleClient.getStandalone", - "decorators": [], - "namespace": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient" - }, - "parameters": [], - "response": {}, - "isOverride": false, - "generateConvenient": true, - "generateProtocol": true, - "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithMultipleClient.getStandalone" - }, - { - "$id": "110", - "kind": "basic", - "name": "deleteStandalone", - "accessibility": "public", - "apiVersions": [], - "operation": { - "$id": "111", - "name": "deleteStandalone", - "resourceName": "IndividuallyParentNestedWithMultipleClient", - "accessibility": "public", - "parameters": [ - { - "$id": "112", - "kind": "header", - "name": "name", - "serializedName": "name", - "type": { - "$id": "113", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "isApiVersion": false, - "optional": false, - "isContentType": false, - "scope": "Client", - "readOnly": false, - "decorators": [], - "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithMultipleClient.deleteStandalone.name", - "methodParameterSegments": [ - { - "$ref": "94" - } - ] - }, - { - "$id": "114", - "kind": "query", - "name": "region", - "serializedName": "region", - "type": { - "$id": "115", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "isApiVersion": false, - "explode": false, - "optional": false, - "scope": "Client", - "decorators": [], - "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithMultipleClient.deleteStandalone.region", - "readOnly": false, - "methodParameterSegments": [ - { - "$ref": "98" - } - ] - } - ], - "responses": [ - { - "statusCodes": [ - 204 - ], - "headers": [], - "isErrorResponse": false - } - ], - "httpMethod": "DELETE", - "uri": "{endpoint}", - "path": "/azure/client-generator-core/client-initialization/individually-parent/nested-default-individually-parent-multiple/delete-standalone", - "bufferResponse": true, - "generateProtocolMethod": true, - "generateConvenienceMethod": true, - "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithMultipleClient.deleteStandalone", - "decorators": [], - "namespace": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient" - }, - "parameters": [], - "response": {}, - "isOverride": false, - "generateConvenient": true, - "generateProtocol": true, - "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithMultipleClient.deleteStandalone" - } - ], - "parameters": [ - { - "$id": "116", - "kind": "endpoint", - "name": "endpoint", - "serializedName": "endpoint", - "doc": "Service host", - "type": { - "$id": "117", - "kind": "url", - "name": "endpoint", - "crossLanguageDefinitionId": "TypeSpec.url" - }, - "isApiVersion": false, - "optional": false, - "scope": "Client", - "isEndpoint": true, - "defaultValue": { - "type": { - "$id": "118", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string" - }, - "value": "http://localhost:3000" - }, - "serverUrlTemplate": "{endpoint}", - "skipUrlEncoding": false, - "readOnly": false, - "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithMultipleClient.endpoint" - }, - { - "$ref": "94" - }, - { - "$ref": "98" - } - ], - "initializedBy": 3, - "decorators": [], - "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithMultipleClient", - "apiVersions": [], - "parent": { - "$ref": "15" - }, - "isMultiServiceClient": false - }, - { - "$id": "119", - "kind": "client", - "name": "IndividuallyParentNestedWithMixedClient", - "namespace": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient", - "doc": "Operations for nested default -> individually and parent mixed parameters", - "methods": [ - { - "$id": "120", - "kind": "basic", - "name": "withQuery", - "accessibility": "public", - "apiVersions": [], - "operation": { - "$id": "121", - "name": "withQuery", - "resourceName": "IndividuallyParentNestedWithMixedClient", - "accessibility": "public", - "parameters": [ - { - "$id": "122", - "kind": "header", - "name": "name", - "serializedName": "name", - "type": { - "$id": "123", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "isApiVersion": false, - "optional": false, - "isContentType": false, - "scope": "Client", - "readOnly": false, - "decorators": [], - "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithMixedClient.withQuery.name", - "methodParameterSegments": [ - { - "$id": "124", - "kind": "method", - "name": "name", - "serializedName": "name", - "doc": "The name to use for operations", - "type": { - "$id": "125", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "location": "", - "isApiVersion": false, - "optional": false, - "scope": "Method", - "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.MixedParamsClientOptions.name", - "readOnly": false, - "access": "public", - "decorators": [] - } - ] - }, - { - "$id": "126", - "kind": "query", - "name": "region", - "serializedName": "region", - "type": { - "$id": "127", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "isApiVersion": false, - "explode": false, - "optional": false, - "scope": "Method", - "decorators": [], - "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithMixedClient.withQuery.region", - "readOnly": false, - "methodParameterSegments": [ - { - "$id": "128", - "kind": "method", - "name": "region", - "serializedName": "region", - "type": { - "$id": "129", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "location": "Query", - "isApiVersion": false, - "optional": false, - "scope": "Method", - "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithMixedClient.withQuery.region", - "readOnly": false, - "access": "public", - "decorators": [] - } - ] - }, - { - "$id": "130", - "kind": "query", - "name": "format", - "serializedName": "format", - "type": { - "$id": "131", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "isApiVersion": false, - "explode": false, - "optional": true, - "scope": "Method", - "decorators": [], - "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithMixedClient.withQuery.format", - "readOnly": false, - "methodParameterSegments": [ - { - "$id": "132", - "kind": "method", - "name": "format", - "serializedName": "format", - "type": { - "$id": "133", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "location": "Query", - "isApiVersion": false, - "optional": true, - "scope": "Method", - "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithMixedClient.withQuery.format", - "readOnly": false, - "access": "public", - "decorators": [] - } - ] - } - ], - "responses": [ - { - "statusCodes": [ - 204 - ], - "headers": [], - "isErrorResponse": false - } - ], - "httpMethod": "GET", - "uri": "{endpoint}", - "path": "/azure/client-generator-core/client-initialization/individually-parent/nested-default-individually-parent-mixed/with-query", - "bufferResponse": true, - "generateProtocolMethod": true, - "generateConvenienceMethod": true, - "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithMixedClient.withQuery", - "decorators": [], - "namespace": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient" - }, - "parameters": [ - { - "$ref": "128" - }, - { - "$ref": "132" - } - ], - "response": {}, - "isOverride": false, - "generateConvenient": true, - "generateProtocol": true, - "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithMixedClient.withQuery" - }, - { - "$id": "134", - "kind": "basic", - "name": "getStandalone", - "accessibility": "public", - "apiVersions": [], - "operation": { - "$id": "135", - "name": "getStandalone", - "resourceName": "IndividuallyParentNestedWithMixedClient", - "accessibility": "public", - "parameters": [ - { - "$id": "136", - "kind": "header", - "name": "name", - "serializedName": "name", - "type": { - "$id": "137", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "isApiVersion": false, - "optional": false, - "isContentType": false, - "scope": "Client", - "readOnly": false, - "decorators": [], - "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithMixedClient.getStandalone.name", - "methodParameterSegments": [ - { - "$ref": "124" - } - ] - }, - { - "$id": "138", - "kind": "query", - "name": "region", - "serializedName": "region", - "type": { - "$id": "139", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "isApiVersion": false, - "explode": false, - "optional": false, - "scope": "Method", - "decorators": [], - "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithMixedClient.getStandalone.region", - "readOnly": false, - "methodParameterSegments": [ - { - "$id": "140", - "kind": "method", - "name": "region", - "serializedName": "region", - "type": { - "$id": "141", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "location": "Query", - "isApiVersion": false, - "optional": false, - "scope": "Method", - "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithMixedClient.getStandalone.region", - "readOnly": false, - "access": "public", - "decorators": [] - } - ] - } - ], - "responses": [ - { - "statusCodes": [ - 204 - ], - "headers": [], - "isErrorResponse": false - } - ], - "httpMethod": "GET", - "uri": "{endpoint}", - "path": "/azure/client-generator-core/client-initialization/individually-parent/nested-default-individually-parent-mixed/get-standalone", - "bufferResponse": true, - "generateProtocolMethod": true, - "generateConvenienceMethod": true, - "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithMixedClient.getStandalone", - "decorators": [], - "namespace": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient" - }, - "parameters": [ - { - "$ref": "140" - } - ], - "response": {}, - "isOverride": false, - "generateConvenient": true, - "generateProtocol": true, - "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithMixedClient.getStandalone" - }, - { - "$id": "142", - "kind": "basic", - "name": "deleteStandalone", - "accessibility": "public", - "apiVersions": [], - "operation": { - "$id": "143", - "name": "deleteStandalone", - "resourceName": "IndividuallyParentNestedWithMixedClient", - "accessibility": "public", - "parameters": [ - { - "$id": "144", - "kind": "header", - "name": "name", - "serializedName": "name", - "type": { - "$id": "145", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "isApiVersion": false, - "optional": false, - "isContentType": false, - "scope": "Client", - "readOnly": false, - "decorators": [], - "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithMixedClient.deleteStandalone.name", - "methodParameterSegments": [ - { - "$ref": "124" - } - ] - }, - { - "$id": "146", - "kind": "query", - "name": "region", - "serializedName": "region", - "type": { - "$id": "147", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "isApiVersion": false, - "explode": false, - "optional": false, - "scope": "Method", - "decorators": [], - "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithMixedClient.deleteStandalone.region", - "readOnly": false, - "methodParameterSegments": [ - { - "$id": "148", - "kind": "method", - "name": "region", - "serializedName": "region", - "type": { - "$id": "149", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "location": "Query", - "isApiVersion": false, - "optional": false, - "scope": "Method", - "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithMixedClient.deleteStandalone.region", - "readOnly": false, - "access": "public", - "decorators": [] - } - ] - } - ], - "responses": [ - { - "statusCodes": [ - 204 - ], - "headers": [], - "isErrorResponse": false - } - ], - "httpMethod": "DELETE", - "uri": "{endpoint}", - "path": "/azure/client-generator-core/client-initialization/individually-parent/nested-default-individually-parent-mixed/delete-standalone", - "bufferResponse": true, - "generateProtocolMethod": true, - "generateConvenienceMethod": true, - "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithMixedClient.deleteStandalone", - "decorators": [], - "namespace": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient" - }, - "parameters": [ - { - "$ref": "148" - } - ], - "response": {}, - "isOverride": false, - "generateConvenient": true, - "generateProtocol": true, - "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithMixedClient.deleteStandalone" - } - ], - "parameters": [ - { - "$id": "150", - "kind": "endpoint", - "name": "endpoint", - "serializedName": "endpoint", - "doc": "Service host", - "type": { - "$id": "151", - "kind": "url", - "name": "endpoint", - "crossLanguageDefinitionId": "TypeSpec.url" - }, - "isApiVersion": false, - "optional": false, - "scope": "Client", - "isEndpoint": true, - "defaultValue": { - "type": { - "$id": "152", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string" - }, - "value": "http://localhost:3000" - }, - "serverUrlTemplate": "{endpoint}", - "skipUrlEncoding": false, - "readOnly": false, - "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithMixedClient.endpoint" - }, - { - "$ref": "124" - } - ], - "initializedBy": 3, - "decorators": [], - "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithMixedClient", - "apiVersions": [], - "parent": { - "$ref": "15" - }, - "isMultiServiceClient": false - }, - { - "$id": "153", - "kind": "client", - "name": "IndividuallyParentNestedWithParamAliasClient", - "namespace": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient", - "doc": "Operations for nested default -> individually and parent param alias", - "methods": [ - { - "$id": "154", - "kind": "basic", - "name": "withAliasedName", - "accessibility": "public", - "apiVersions": [], - "operation": { - "$id": "155", - "name": "withAliasedName", - "resourceName": "IndividuallyParentNestedWithParamAliasClient", - "accessibility": "public", - "parameters": [ - { - "$id": "156", - "kind": "path", - "name": "blob", - "serializedName": "blob", - "type": { - "$id": "157", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "isApiVersion": false, - "explode": false, - "style": "simple", - "allowReserved": false, - "skipUrlEncoding": false, - "optional": false, - "scope": "Client", - "decorators": [], - "readOnly": false, - "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithParamAliasClient.withAliasedName.blob", - "methodParameterSegments": [ - { - "$id": "158", - "kind": "method", - "name": "blobName", - "serializedName": "blobName", - "doc": "Blob name for the client.", - "type": { - "$id": "159", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "location": "", - "isApiVersion": false, - "optional": false, - "scope": "Method", - "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.ParamAliasClientOptions.blobName", - "readOnly": false, - "access": "public", - "decorators": [] - } - ] - } - ], - "responses": [ - { - "statusCodes": [ - 204 - ], - "headers": [], - "isErrorResponse": false - } - ], - "httpMethod": "GET", - "uri": "{endpoint}", - "path": "/azure/client-generator-core/client-initialization/individually-parent/nested-default-individually-parent-param-alias/{blob}/with-aliased-name", - "bufferResponse": true, - "generateProtocolMethod": true, - "generateConvenienceMethod": true, - "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithParamAliasClient.withAliasedName", - "decorators": [], - "namespace": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient" - }, - "parameters": [], - "response": {}, - "isOverride": false, - "generateConvenient": true, - "generateProtocol": true, - "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithParamAliasClient.withAliasedName" - }, - { - "$id": "160", - "kind": "basic", - "name": "withOriginalName", - "accessibility": "public", - "apiVersions": [], - "operation": { - "$id": "161", - "name": "withOriginalName", - "resourceName": "IndividuallyParentNestedWithParamAliasClient", - "accessibility": "public", - "parameters": [ - { - "$id": "162", - "kind": "path", - "name": "blobName", - "serializedName": "blobName", - "type": { - "$id": "163", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "isApiVersion": false, - "explode": false, - "style": "simple", - "allowReserved": false, - "skipUrlEncoding": false, - "optional": false, - "scope": "Client", - "decorators": [], - "readOnly": false, - "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithParamAliasClient.withOriginalName.blobName", - "methodParameterSegments": [ - { - "$ref": "158" - } - ] - } - ], - "responses": [ - { - "statusCodes": [ - 204 - ], - "headers": [], - "isErrorResponse": false - } - ], - "httpMethod": "GET", - "uri": "{endpoint}", - "path": "/azure/client-generator-core/client-initialization/individually-parent/nested-default-individually-parent-param-alias/{blobName}/with-original-name", - "bufferResponse": true, - "generateProtocolMethod": true, - "generateConvenienceMethod": true, - "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithParamAliasClient.withOriginalName", - "decorators": [], - "namespace": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient" - }, - "parameters": [], - "response": {}, - "isOverride": false, - "generateConvenient": true, - "generateProtocol": true, - "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithParamAliasClient.withOriginalName" - } - ], - "parameters": [ - { - "$id": "164", - "kind": "endpoint", - "name": "endpoint", - "serializedName": "endpoint", - "doc": "Service host", - "type": { - "$id": "165", - "kind": "url", - "name": "endpoint", - "crossLanguageDefinitionId": "TypeSpec.url" - }, - "isApiVersion": false, - "optional": false, - "scope": "Client", - "isEndpoint": true, - "defaultValue": { - "type": { - "$id": "166", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string" - }, - "value": "http://localhost:3000" - }, - "serverUrlTemplate": "{endpoint}", - "skipUrlEncoding": false, - "readOnly": false, - "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithParamAliasClient.endpoint" - }, - { - "$ref": "158" - } - ], - "initializedBy": 3, - "decorators": [], - "crossLanguageDefinitionId": "_Specs_.Azure.ClientGenerator.Core.ClientInitialization.IndividuallyParentClient.IndividuallyParentNestedWithParamAliasClient", - "apiVersions": [], - "parent": { - "$ref": "15" - }, - "isMultiServiceClient": false - } - ], - "isMultiServiceClient": false - } - ] -} From dd06669411d6433a1cfb6a7843d6cb7dd3c5fc3c Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 4 Mar 2026 23:36:46 +0000 Subject: [PATCH 08/13] style: run prettier on SampleService/main.tsp Co-authored-by: JoshLove-msft <54595583+JoshLove-msft@users.noreply.github.com> --- docs/samples/client/csharp/SampleService/main.tsp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/docs/samples/client/csharp/SampleService/main.tsp b/docs/samples/client/csharp/SampleService/main.tsp index dcc8d2ff208..d63bf43a53a 100644 --- a/docs/samples/client/csharp/SampleService/main.tsp +++ b/docs/samples/client/csharp/SampleService/main.tsp @@ -845,10 +845,7 @@ interface Metrics { @doc("Get Widget metrics for given day of week") @get @route("/metrics/{metricsNamespace}/widgets/daysOfWeek") - getWidgetMetrics( - @path metricsNamespace: string, - @path day: DaysOfWeekExtensibleEnum, - ): { + getWidgetMetrics(@path metricsNamespace: string, @path day: DaysOfWeekExtensibleEnum): { numSold: int32; averagePrice: float32; }; From cb0f23298ef58a496438489f8dbe986847bb3ba0 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 5 Mar 2026 00:54:26 +0000 Subject: [PATCH 09/13] chore: regenerate Sample-TypeSpec after Generate.ps1 Co-authored-by: JoshLove-msft <54595583+JoshLove-msft@users.noreply.github.com> --- .../src/Generated/Metrics.RestClient.cs | 4 ++- .../SampleClient/src/Generated/Metrics.cs | 19 +++++++++--- .../src/Generated/SampleTypeSpecClient.cs | 31 +++++++++++++------ 3 files changed, 39 insertions(+), 15 deletions(-) diff --git a/docs/samples/client/csharp/SampleService/SampleClient/src/Generated/Metrics.RestClient.cs b/docs/samples/client/csharp/SampleService/SampleClient/src/Generated/Metrics.RestClient.cs index 31dd56da2b8..371d027f6b7 100644 --- a/docs/samples/client/csharp/SampleService/SampleClient/src/Generated/Metrics.RestClient.cs +++ b/docs/samples/client/csharp/SampleService/SampleClient/src/Generated/Metrics.RestClient.cs @@ -17,7 +17,9 @@ internal PipelineMessage CreateGetWidgetMetricsRequest(string day, RequestOption { ClientUriBuilder uri = new ClientUriBuilder(); uri.Reset(_endpoint); - uri.AppendPath("/metrics/widgets/daysOfWeek/", false); + uri.AppendPath("/metrics/", false); + uri.AppendPath(_metricsNamespace, true); + uri.AppendPath("/widgets/daysOfWeek/", false); uri.AppendPath(day, true); PipelineMessage message = Pipeline.CreateMessage(uri.ToUri(), "GET", PipelineMessageClassifier200); PipelineRequest request = message.Request; diff --git a/docs/samples/client/csharp/SampleService/SampleClient/src/Generated/Metrics.cs b/docs/samples/client/csharp/SampleService/SampleClient/src/Generated/Metrics.cs index 30284cdba24..65e1ea56883 100644 --- a/docs/samples/client/csharp/SampleService/SampleClient/src/Generated/Metrics.cs +++ b/docs/samples/client/csharp/SampleService/SampleClient/src/Generated/Metrics.cs @@ -14,6 +14,7 @@ namespace SampleTypeSpec public partial class Metrics { private readonly Uri _endpoint; + private readonly string _metricsNamespace; /// Initializes a new instance of Metrics for mocking. protected Metrics() @@ -23,30 +24,38 @@ protected Metrics() /// Initializes a new instance of Metrics. /// The HTTP pipeline for sending and receiving REST requests and responses. /// Service endpoint. - internal Metrics(ClientPipeline pipeline, Uri endpoint) + /// + internal Metrics(ClientPipeline pipeline, Uri endpoint, string metricsNamespace) { _endpoint = endpoint; Pipeline = pipeline; + _metricsNamespace = metricsNamespace; } /// Initializes a new instance of Metrics. /// Service endpoint. - /// is null. - public Metrics(Uri endpoint) : this(endpoint, new SampleTypeSpecClientOptions()) + /// + /// 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()) { } /// Initializes a new instance of Metrics. /// Service endpoint. + /// /// The options for configuring the client. - /// is null. - public Metrics(Uri endpoint, SampleTypeSpecClientOptions options) + /// or is null. + /// is an empty string, and was expected to be non-empty. + public Metrics(Uri endpoint, string metricsNamespace, SampleTypeSpecClientOptions options) { Argument.AssertNotNull(endpoint, nameof(endpoint)); + Argument.AssertNotNullOrEmpty(metricsNamespace, nameof(metricsNamespace)); options ??= new SampleTypeSpecClientOptions(); _endpoint = endpoint; + _metricsNamespace = metricsNamespace; Pipeline = ClientPipeline.Create(options, Array.Empty(), new PipelinePolicy[] { new UserAgentPolicy(typeof(Metrics).Assembly) }, Array.Empty()); } diff --git a/docs/samples/client/csharp/SampleService/SampleClient/src/Generated/SampleTypeSpecClient.cs b/docs/samples/client/csharp/SampleService/SampleClient/src/Generated/SampleTypeSpecClient.cs index 016ab1d0d2e..291d40887ea 100644 --- a/docs/samples/client/csharp/SampleService/SampleClient/src/Generated/SampleTypeSpecClient.cs +++ b/docs/samples/client/csharp/SampleService/SampleClient/src/Generated/SampleTypeSpecClient.cs @@ -32,6 +32,7 @@ public partial class SampleTypeSpecClient } }; private readonly string _apiVersion; + private readonly string _metricsNamespace; private AnimalOperations _cachedAnimalOperations; private PetOperations _cachedPetOperations; private DogOperations _cachedDogOperations; @@ -45,33 +46,41 @@ protected SampleTypeSpecClient() /// Initializes a new instance of SampleTypeSpecClient. /// Service endpoint. + /// /// A credential used to authenticate to the service. - /// or is null. - public SampleTypeSpecClient(Uri endpoint, ApiKeyCredential credential) : this(endpoint, credential, new SampleTypeSpecClientOptions()) + /// , or is null. + /// is an empty string, and was expected to be non-empty. + public SampleTypeSpecClient(Uri endpoint, string metricsNamespace, ApiKeyCredential credential) : this(endpoint, metricsNamespace, credential, new SampleTypeSpecClientOptions()) { } /// Initializes a new instance of SampleTypeSpecClient. /// Service endpoint. + /// /// A credential provider used to authenticate to the service. - /// or is null. - public SampleTypeSpecClient(Uri endpoint, AuthenticationTokenProvider tokenProvider) : this(endpoint, tokenProvider, new SampleTypeSpecClientOptions()) + /// , or is null. + /// is an empty string, and was expected to be non-empty. + public SampleTypeSpecClient(Uri endpoint, string metricsNamespace, AuthenticationTokenProvider tokenProvider) : this(endpoint, metricsNamespace, tokenProvider, new SampleTypeSpecClientOptions()) { } /// Initializes a new instance of SampleTypeSpecClient. /// Service endpoint. + /// /// A credential used to authenticate to the service. /// The options for configuring the client. - /// or is null. - public SampleTypeSpecClient(Uri endpoint, ApiKeyCredential credential, SampleTypeSpecClientOptions options) + /// , or is null. + /// is an empty string, and was expected to be non-empty. + public SampleTypeSpecClient(Uri endpoint, string metricsNamespace, ApiKeyCredential credential, SampleTypeSpecClientOptions options) { Argument.AssertNotNull(endpoint, nameof(endpoint)); + Argument.AssertNotNullOrEmpty(metricsNamespace, nameof(metricsNamespace)); Argument.AssertNotNull(credential, nameof(credential)); options ??= new SampleTypeSpecClientOptions(); _endpoint = endpoint; + _metricsNamespace = metricsNamespace; _keyCredential = credential; Pipeline = ClientPipeline.Create(options, Array.Empty(), new PipelinePolicy[] { new UserAgentPolicy(typeof(SampleTypeSpecClient).Assembly), ApiKeyAuthenticationPolicy.CreateHeaderApiKeyPolicy(_keyCredential, AuthorizationHeader) }, Array.Empty()); _apiVersion = options.Version; @@ -79,17 +88,21 @@ public SampleTypeSpecClient(Uri endpoint, ApiKeyCredential credential, SampleTyp /// Initializes a new instance of SampleTypeSpecClient. /// Service endpoint. + /// /// A credential provider used to authenticate to the service. /// The options for configuring the client. - /// or is null. - public SampleTypeSpecClient(Uri endpoint, AuthenticationTokenProvider tokenProvider, SampleTypeSpecClientOptions options) + /// , or is null. + /// is an empty string, and was expected to be non-empty. + public SampleTypeSpecClient(Uri endpoint, string metricsNamespace, AuthenticationTokenProvider tokenProvider, SampleTypeSpecClientOptions options) { Argument.AssertNotNull(endpoint, nameof(endpoint)); + Argument.AssertNotNullOrEmpty(metricsNamespace, nameof(metricsNamespace)); Argument.AssertNotNull(tokenProvider, nameof(tokenProvider)); options ??= new SampleTypeSpecClientOptions(); _endpoint = endpoint; + _metricsNamespace = metricsNamespace; _tokenProvider = tokenProvider; Pipeline = ClientPipeline.Create(options, Array.Empty(), new PipelinePolicy[] { new UserAgentPolicy(typeof(SampleTypeSpecClient).Assembly), new BearerTokenPolicy(_tokenProvider, _flows) }, Array.Empty()); _apiVersion = options.Version; @@ -3317,7 +3330,7 @@ public virtual PlantOperations GetPlantOperationsClient() /// Initializes a new instance of Metrics. public virtual Metrics GetMetricsClient() { - return Volatile.Read(ref _cachedMetrics) ?? Interlocked.CompareExchange(ref _cachedMetrics, new Metrics(Pipeline, _endpoint), null) ?? _cachedMetrics; + return Volatile.Read(ref _cachedMetrics) ?? Interlocked.CompareExchange(ref _cachedMetrics, new Metrics(Pipeline, _endpoint, _metricsNamespace), null) ?? _cachedMetrics; } } } From 5166912e1fbfadc22eba976b6e08fc63b5ca5f5b Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 5 Mar 2026 02:52:53 +0000 Subject: [PATCH 10/13] Changes before error encountered Co-authored-by: JoshLove-msft <54595583+JoshLove-msft@users.noreply.github.com> --- .../src/Providers/ClientProvider.cs | 144 ++++++++++++++++-- 1 file changed, 132 insertions(+), 12 deletions(-) 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 c330b05a002..e24aca46233 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 @@ -310,21 +310,73 @@ private IReadOnlyList GetSubClientInternalConstructorParamete } /// - /// Determines whether this subclient has non-infrastructure parameters (i.e. parameters that - /// are not API versions and not the endpoint parameter) that are absent from the given parent - /// client and therefore need to be included as parameters in the parent's accessor method. + /// Determines whether this subclient has non-infrastructure parameters that need to be + /// included as parameters in the parent's accessor method rather than stored on the parent. + /// A subclient has accessor-only parameters if it has non-infrastructure parameters + /// (not API versions, not endpoint) that are: + /// + /// Not present on the parent's InputClient.Parameters at all, OR + /// Present on the parent but "subclient-specific": not shared across all siblings + /// or not used in the parent's own operations. + /// /// Uses the raw to avoid circular lazy-initialization dependencies. /// internal bool HasAccessorOnlyParameters(InputClient parentInputClient) { + var subClientNonInfraParams = _inputClient.Parameters + .Where(p => !p.IsApiVersion && !(p is InputEndpointParameter ep && ep.IsEndpoint)) + .ToArray(); + + if (subClientNonInfraParams.Length == 0) + { + return false; + } + var parentParamNames = parentInputClient.Parameters .Select(p => p.Name) .ToHashSet(StringComparer.OrdinalIgnoreCase); - return _inputClient.Parameters - .Any(p => !p.IsApiVersion && - !(p is InputEndpointParameter ep && ep.IsEndpoint) && - !parentParamNames.Contains(p.Name)); + // Collect non-infrastructure parameter names for each sibling (including this subclient) + var siblings = parentInputClient.Children; + var siblingParamSets = new List>(siblings.Count); + foreach (var sibling in siblings) + { + var siblingParams = new HashSet(StringComparer.OrdinalIgnoreCase); + foreach (var param in sibling.Parameters) + { + if (!param.IsApiVersion && !(param is InputEndpointParameter epp && epp.IsEndpoint)) + { + siblingParams.Add(param.Name); + } + } + siblingParamSets.Add(siblingParams); + } + + // Check parent's own operations + var parentOperationParamNames = new HashSet( + parentInputClient.Methods.SelectMany(m => m.Operation.Parameters).Select(p => p.Name), + StringComparer.OrdinalIgnoreCase); + bool parentHasOperations = parentInputClient.Methods.Count > 0; + + foreach (var param in subClientNonInfraParams) + { + // Case 1: param is not on the parent at all → accessor-only + if (!parentParamNames.Contains(param.Name)) + { + return true; + } + + // Case 2: param is on the parent but was propagated from a subclient + bool onAllSiblings = siblingParamSets.All(s => s.Contains(param.Name)); + bool unusedByParent = parentHasOperations && !parentOperationParamNames.Contains(param.Name); + + if (!onAllSiblings || unusedByParent) + { + return true; + } + } + + return false; } private Lazy> _clientParameters; @@ -922,15 +974,16 @@ protected override ScmMethodProvider[] BuildMethods() List subClientConstructorArgs = new(3); List accessorMethodParams = []; - // Determine which subclient parameters are "extra" — present in the subclient's - // InputClient.Parameters but not in the parent's InputClient.Parameters. - // Only these should be exposed as accessor method parameters. - var parentInputParamNames = _inputClient.Parameters + // Determine which subclient parameters should be on the accessor method. + // This includes parameters that are either not on the parent at all, + // or were propagated from the subclient (not used in parent's own operations). + var propagatedParamNames = GetPropagatedSubClientParameterNames(); + var parentEffectiveParamNames = _allClientParameters .Select(p => p.Name) .ToHashSet(StringComparer.OrdinalIgnoreCase); var subClientExtraInputParamNames = subClient._inputClient.Parameters .Where(p => !p.IsApiVersion && !(p is InputEndpointParameter ep && ep.IsEndpoint)) - .Where(p => !parentInputParamNames.Contains(p.Name)) + .Where(p => !parentEffectiveParamNames.Contains(p.Name) || propagatedParamNames.Contains(p.Name)) .Select(p => p.Name) .ToHashSet(StringComparer.OrdinalIgnoreCase); @@ -1287,6 +1340,15 @@ private IReadOnlyList GetAllClientParameters() _inputClient.Methods.SelectMany(m => m.Operation.Parameters) .Where(p => p.Scope == InputParameterScope.Client)).DistinctBy(p => p.SerializedName ?? p.Name).ToArray(); + // Exclude parameters that were propagated from child subclients. + // Subclient-specific parameters should appear on the subclient accessor method, + // not on the parent's constructor. + var propagatedParamNames = GetPropagatedSubClientParameterNames(); + if (propagatedParamNames.Count > 0) + { + parameters = parameters.Where(p => !propagatedParamNames.Contains(p.Name)).ToArray(); + } + foreach (var subClient in _subClients.Value) { // Only hoist ApiVersion parameters from sub-clients; other sub-client parameters should remain on the sub-client. @@ -1297,6 +1359,64 @@ private IReadOnlyList GetAllClientParameters() return parameters; } + /// + /// Identifies parameter names on the parent that were propagated from child subclients. + /// These parameters should be on the subclient accessor method rather than the parent constructor. + /// A non-infrastructure parameter is considered "subclient-specific" (propagated) if: + /// + /// It is NOT present on ALL children (specific to some subclients), OR + /// The parent has its own operations and the parameter is not used in any of them. + /// + /// + private HashSet GetPropagatedSubClientParameterNames() + { + var propagated = new HashSet(StringComparer.OrdinalIgnoreCase); + var children = _inputClient.Children; + + if (children.Count == 0) + { + return propagated; + } + + // Collect non-infrastructure parameter names for each child + var childParamSets = new List>(children.Count); + foreach (var child in children) + { + var childParams = new HashSet(StringComparer.OrdinalIgnoreCase); + foreach (var param in child.Parameters) + { + if (!param.IsApiVersion && !(param is InputEndpointParameter ep && ep.IsEndpoint)) + { + childParams.Add(param.Name); + } + } + childParamSets.Add(childParams); + } + + // Collect parameter names used in the parent's own operations + var parentOperationParamNames = new HashSet( + _inputClient.Methods.SelectMany(m => m.Operation.Parameters).Select(p => p.Name), + StringComparer.OrdinalIgnoreCase); + bool parentHasOperations = _inputClient.Methods.Count > 0; + + // Check each child parameter + var allChildParamNames = childParamSets.SelectMany(s => s).Distinct(StringComparer.OrdinalIgnoreCase); + foreach (var paramName in allChildParamNames) + { + bool onAllChildren = childParamSets.All(s => s.Contains(paramName)); + bool unusedByParent = parentHasOperations && !parentOperationParamNames.Contains(paramName); + + // A parameter is subclient-specific (should go on accessor) if it's not shared + // across all children, or if the parent has its own operations that don't use it. + if (!onAllChildren || unusedByParent) + { + propagated.Add(paramName); + } + } + + return propagated; + } + private FieldProvider BuildTokenCredentialScopesField(InputOAuth2Auth oauth2Auth, CSharpType tokenCredentialType) { return tokenCredentialType.Equals(ClientPipelineProvider.Instance.TokenCredentialType) From 8d161f22f829a20de128ecbc3dbc722ea702b392 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 5 Mar 2026 17:59:49 +0000 Subject: [PATCH 11/13] refactor: simplify subclient accessor params - remove propagation detection per TCGC behavior Co-authored-by: JoshLove-msft <54595583+JoshLove-msft@users.noreply.github.com> --- .../src/Generated/Metrics.RestClient.cs | 4 +- .../SampleClient/src/Generated/Metrics.cs | 19 +-- .../src/Generated/SampleTypeSpecClient.cs | 31 ++-- .../client/csharp/SampleService/main.tsp | 9 +- .../src/Providers/ClientProvider.cs | 133 +----------------- .../src/Generated/Metrics.RestClient.cs | 4 +- .../Sample-TypeSpec/src/Generated/Metrics.cs | 19 +-- .../src/Generated/SampleTypeSpecClient.cs | 9 +- .../Local/Sample-TypeSpec/tspCodeModel.json | 65 ++------- 9 files changed, 40 insertions(+), 253 deletions(-) diff --git a/docs/samples/client/csharp/SampleService/SampleClient/src/Generated/Metrics.RestClient.cs b/docs/samples/client/csharp/SampleService/SampleClient/src/Generated/Metrics.RestClient.cs index 371d027f6b7..31dd56da2b8 100644 --- a/docs/samples/client/csharp/SampleService/SampleClient/src/Generated/Metrics.RestClient.cs +++ b/docs/samples/client/csharp/SampleService/SampleClient/src/Generated/Metrics.RestClient.cs @@ -17,9 +17,7 @@ internal PipelineMessage CreateGetWidgetMetricsRequest(string day, RequestOption { ClientUriBuilder uri = new ClientUriBuilder(); uri.Reset(_endpoint); - uri.AppendPath("/metrics/", false); - uri.AppendPath(_metricsNamespace, true); - uri.AppendPath("/widgets/daysOfWeek/", false); + uri.AppendPath("/metrics/widgets/daysOfWeek/", false); uri.AppendPath(day, true); PipelineMessage message = Pipeline.CreateMessage(uri.ToUri(), "GET", PipelineMessageClassifier200); PipelineRequest request = message.Request; diff --git a/docs/samples/client/csharp/SampleService/SampleClient/src/Generated/Metrics.cs b/docs/samples/client/csharp/SampleService/SampleClient/src/Generated/Metrics.cs index 65e1ea56883..30284cdba24 100644 --- a/docs/samples/client/csharp/SampleService/SampleClient/src/Generated/Metrics.cs +++ b/docs/samples/client/csharp/SampleService/SampleClient/src/Generated/Metrics.cs @@ -14,7 +14,6 @@ namespace SampleTypeSpec public partial class Metrics { private readonly Uri _endpoint; - private readonly string _metricsNamespace; /// Initializes a new instance of Metrics for mocking. protected Metrics() @@ -24,38 +23,30 @@ protected Metrics() /// Initializes a new instance of Metrics. /// The HTTP pipeline for sending and receiving REST requests and responses. /// Service endpoint. - /// - internal Metrics(ClientPipeline pipeline, Uri endpoint, string metricsNamespace) + internal Metrics(ClientPipeline pipeline, Uri endpoint) { _endpoint = endpoint; Pipeline = pipeline; - _metricsNamespace = metricsNamespace; } /// Initializes a new instance of Metrics. /// Service endpoint. - /// - /// 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()) + /// is null. + public Metrics(Uri endpoint) : this(endpoint, new SampleTypeSpecClientOptions()) { } /// Initializes a new instance of Metrics. /// Service endpoint. - /// /// 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, SampleTypeSpecClientOptions options) + /// is null. + public Metrics(Uri endpoint, SampleTypeSpecClientOptions options) { Argument.AssertNotNull(endpoint, nameof(endpoint)); - Argument.AssertNotNullOrEmpty(metricsNamespace, nameof(metricsNamespace)); options ??= new SampleTypeSpecClientOptions(); _endpoint = endpoint; - _metricsNamespace = metricsNamespace; Pipeline = ClientPipeline.Create(options, Array.Empty(), new PipelinePolicy[] { new UserAgentPolicy(typeof(Metrics).Assembly) }, Array.Empty()); } diff --git a/docs/samples/client/csharp/SampleService/SampleClient/src/Generated/SampleTypeSpecClient.cs b/docs/samples/client/csharp/SampleService/SampleClient/src/Generated/SampleTypeSpecClient.cs index 291d40887ea..016ab1d0d2e 100644 --- a/docs/samples/client/csharp/SampleService/SampleClient/src/Generated/SampleTypeSpecClient.cs +++ b/docs/samples/client/csharp/SampleService/SampleClient/src/Generated/SampleTypeSpecClient.cs @@ -32,7 +32,6 @@ public partial class SampleTypeSpecClient } }; private readonly string _apiVersion; - private readonly string _metricsNamespace; private AnimalOperations _cachedAnimalOperations; private PetOperations _cachedPetOperations; private DogOperations _cachedDogOperations; @@ -46,41 +45,33 @@ protected SampleTypeSpecClient() /// Initializes a new instance of SampleTypeSpecClient. /// Service endpoint. - /// /// A credential used to authenticate to the service. - /// , or is null. - /// is an empty string, and was expected to be non-empty. - public SampleTypeSpecClient(Uri endpoint, string metricsNamespace, ApiKeyCredential credential) : this(endpoint, metricsNamespace, credential, new SampleTypeSpecClientOptions()) + /// or is null. + public SampleTypeSpecClient(Uri endpoint, ApiKeyCredential credential) : this(endpoint, credential, new SampleTypeSpecClientOptions()) { } /// Initializes a new instance of SampleTypeSpecClient. /// Service endpoint. - /// /// A credential provider used to authenticate to the service. - /// , or is null. - /// is an empty string, and was expected to be non-empty. - public SampleTypeSpecClient(Uri endpoint, string metricsNamespace, AuthenticationTokenProvider tokenProvider) : this(endpoint, metricsNamespace, tokenProvider, new SampleTypeSpecClientOptions()) + /// or is null. + public SampleTypeSpecClient(Uri endpoint, AuthenticationTokenProvider tokenProvider) : this(endpoint, tokenProvider, new SampleTypeSpecClientOptions()) { } /// Initializes a new instance of SampleTypeSpecClient. /// 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 SampleTypeSpecClient(Uri endpoint, string metricsNamespace, ApiKeyCredential credential, SampleTypeSpecClientOptions options) + /// or is null. + public SampleTypeSpecClient(Uri endpoint, ApiKeyCredential credential, SampleTypeSpecClientOptions options) { Argument.AssertNotNull(endpoint, nameof(endpoint)); - Argument.AssertNotNullOrEmpty(metricsNamespace, nameof(metricsNamespace)); Argument.AssertNotNull(credential, nameof(credential)); options ??= new SampleTypeSpecClientOptions(); _endpoint = endpoint; - _metricsNamespace = metricsNamespace; _keyCredential = credential; Pipeline = ClientPipeline.Create(options, Array.Empty(), new PipelinePolicy[] { new UserAgentPolicy(typeof(SampleTypeSpecClient).Assembly), ApiKeyAuthenticationPolicy.CreateHeaderApiKeyPolicy(_keyCredential, AuthorizationHeader) }, Array.Empty()); _apiVersion = options.Version; @@ -88,21 +79,17 @@ public SampleTypeSpecClient(Uri endpoint, string metricsNamespace, ApiKeyCredent /// Initializes a new instance of SampleTypeSpecClient. /// 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 SampleTypeSpecClient(Uri endpoint, string metricsNamespace, AuthenticationTokenProvider tokenProvider, SampleTypeSpecClientOptions options) + /// or is null. + public SampleTypeSpecClient(Uri endpoint, AuthenticationTokenProvider tokenProvider, SampleTypeSpecClientOptions options) { Argument.AssertNotNull(endpoint, nameof(endpoint)); - Argument.AssertNotNullOrEmpty(metricsNamespace, nameof(metricsNamespace)); Argument.AssertNotNull(tokenProvider, nameof(tokenProvider)); options ??= new SampleTypeSpecClientOptions(); _endpoint = endpoint; - _metricsNamespace = metricsNamespace; _tokenProvider = tokenProvider; Pipeline = ClientPipeline.Create(options, Array.Empty(), new PipelinePolicy[] { new UserAgentPolicy(typeof(SampleTypeSpecClient).Assembly), new BearerTokenPolicy(_tokenProvider, _flows) }, Array.Empty()); _apiVersion = options.Version; @@ -3330,7 +3317,7 @@ public virtual PlantOperations GetPlantOperationsClient() /// Initializes a new instance of Metrics. public virtual Metrics GetMetricsClient() { - return Volatile.Read(ref _cachedMetrics) ?? Interlocked.CompareExchange(ref _cachedMetrics, new Metrics(Pipeline, _endpoint, _metricsNamespace), null) ?? _cachedMetrics; + return Volatile.Read(ref _cachedMetrics) ?? Interlocked.CompareExchange(ref _cachedMetrics, new Metrics(Pipeline, _endpoint), null) ?? _cachedMetrics; } } } diff --git a/docs/samples/client/csharp/SampleService/main.tsp b/docs/samples/client/csharp/SampleService/main.tsp index d63bf43a53a..2722adc9c6f 100644 --- a/docs/samples/client/csharp/SampleService/main.tsp +++ b/docs/samples/client/csharp/SampleService/main.tsp @@ -833,19 +833,14 @@ interface PlantOperations { }; } -model MetricsClientParams { - metricsNamespace: string; -} - @clientInitialization({ initializedBy: InitializedBy.individually | InitializedBy.parent, - parameters: MetricsClientParams, }) interface Metrics { @doc("Get Widget metrics for given day of week") @get - @route("/metrics/{metricsNamespace}/widgets/daysOfWeek") - getWidgetMetrics(@path metricsNamespace: string, @path day: DaysOfWeekExtensibleEnum): { + @route("/metrics/widgets/daysOfWeek") + getWidgetMetrics(@path day: DaysOfWeekExtensibleEnum): { numSold: int32; averagePrice: float32; }; 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 e24aca46233..8678dbc6f9c 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 @@ -313,70 +313,18 @@ private IReadOnlyList GetSubClientInternalConstructorParamete /// Determines whether this subclient has non-infrastructure parameters that need to be /// included as parameters in the parent's accessor method rather than stored on the parent. /// A subclient has accessor-only parameters if it has non-infrastructure parameters - /// (not API versions, not endpoint) that are: - /// - /// Not present on the parent's InputClient.Parameters at all, OR - /// Present on the parent but "subclient-specific": not shared across all siblings - /// or not used in the parent's own operations. - /// + /// (not API versions, not endpoint) that are not present on the parent's InputClient.Parameters. /// Uses the raw to avoid circular lazy-initialization dependencies. /// internal bool HasAccessorOnlyParameters(InputClient parentInputClient) { - var subClientNonInfraParams = _inputClient.Parameters - .Where(p => !p.IsApiVersion && !(p is InputEndpointParameter ep && ep.IsEndpoint)) - .ToArray(); - - if (subClientNonInfraParams.Length == 0) - { - return false; - } - var parentParamNames = parentInputClient.Parameters .Select(p => p.Name) .ToHashSet(StringComparer.OrdinalIgnoreCase); - // Collect non-infrastructure parameter names for each sibling (including this subclient) - var siblings = parentInputClient.Children; - var siblingParamSets = new List>(siblings.Count); - foreach (var sibling in siblings) - { - var siblingParams = new HashSet(StringComparer.OrdinalIgnoreCase); - foreach (var param in sibling.Parameters) - { - if (!param.IsApiVersion && !(param is InputEndpointParameter epp && epp.IsEndpoint)) - { - siblingParams.Add(param.Name); - } - } - siblingParamSets.Add(siblingParams); - } - - // Check parent's own operations - var parentOperationParamNames = new HashSet( - parentInputClient.Methods.SelectMany(m => m.Operation.Parameters).Select(p => p.Name), - StringComparer.OrdinalIgnoreCase); - bool parentHasOperations = parentInputClient.Methods.Count > 0; - - foreach (var param in subClientNonInfraParams) - { - // Case 1: param is not on the parent at all → accessor-only - if (!parentParamNames.Contains(param.Name)) - { - return true; - } - - // Case 2: param is on the parent but was propagated from a subclient - bool onAllSiblings = siblingParamSets.All(s => s.Contains(param.Name)); - bool unusedByParent = parentHasOperations && !parentOperationParamNames.Contains(param.Name); - - if (!onAllSiblings || unusedByParent) - { - return true; - } - } - - return false; + return _inputClient.Parameters + .Where(p => !p.IsApiVersion && !(p is InputEndpointParameter ep && ep.IsEndpoint)) + .Any(p => !parentParamNames.Contains(p.Name)); } private Lazy> _clientParameters; @@ -975,15 +923,13 @@ protected override ScmMethodProvider[] BuildMethods() List accessorMethodParams = []; // Determine which subclient parameters should be on the accessor method. - // This includes parameters that are either not on the parent at all, - // or were propagated from the subclient (not used in parent's own operations). - var propagatedParamNames = GetPropagatedSubClientParameterNames(); + // Subclient-specific parameters (not on the parent) need to be passed via the accessor. var parentEffectiveParamNames = _allClientParameters .Select(p => p.Name) .ToHashSet(StringComparer.OrdinalIgnoreCase); var subClientExtraInputParamNames = subClient._inputClient.Parameters .Where(p => !p.IsApiVersion && !(p is InputEndpointParameter ep && ep.IsEndpoint)) - .Where(p => !parentEffectiveParamNames.Contains(p.Name) || propagatedParamNames.Contains(p.Name)) + .Where(p => !parentEffectiveParamNames.Contains(p.Name)) .Select(p => p.Name) .ToHashSet(StringComparer.OrdinalIgnoreCase); @@ -1340,15 +1286,6 @@ private IReadOnlyList GetAllClientParameters() _inputClient.Methods.SelectMany(m => m.Operation.Parameters) .Where(p => p.Scope == InputParameterScope.Client)).DistinctBy(p => p.SerializedName ?? p.Name).ToArray(); - // Exclude parameters that were propagated from child subclients. - // Subclient-specific parameters should appear on the subclient accessor method, - // not on the parent's constructor. - var propagatedParamNames = GetPropagatedSubClientParameterNames(); - if (propagatedParamNames.Count > 0) - { - parameters = parameters.Where(p => !propagatedParamNames.Contains(p.Name)).ToArray(); - } - foreach (var subClient in _subClients.Value) { // Only hoist ApiVersion parameters from sub-clients; other sub-client parameters should remain on the sub-client. @@ -1359,64 +1296,6 @@ private IReadOnlyList GetAllClientParameters() return parameters; } - /// - /// Identifies parameter names on the parent that were propagated from child subclients. - /// These parameters should be on the subclient accessor method rather than the parent constructor. - /// A non-infrastructure parameter is considered "subclient-specific" (propagated) if: - /// - /// It is NOT present on ALL children (specific to some subclients), OR - /// The parent has its own operations and the parameter is not used in any of them. - /// - /// - private HashSet GetPropagatedSubClientParameterNames() - { - var propagated = new HashSet(StringComparer.OrdinalIgnoreCase); - var children = _inputClient.Children; - - if (children.Count == 0) - { - return propagated; - } - - // Collect non-infrastructure parameter names for each child - var childParamSets = new List>(children.Count); - foreach (var child in children) - { - var childParams = new HashSet(StringComparer.OrdinalIgnoreCase); - foreach (var param in child.Parameters) - { - if (!param.IsApiVersion && !(param is InputEndpointParameter ep && ep.IsEndpoint)) - { - childParams.Add(param.Name); - } - } - childParamSets.Add(childParams); - } - - // Collect parameter names used in the parent's own operations - var parentOperationParamNames = new HashSet( - _inputClient.Methods.SelectMany(m => m.Operation.Parameters).Select(p => p.Name), - StringComparer.OrdinalIgnoreCase); - bool parentHasOperations = _inputClient.Methods.Count > 0; - - // Check each child parameter - var allChildParamNames = childParamSets.SelectMany(s => s).Distinct(StringComparer.OrdinalIgnoreCase); - foreach (var paramName in allChildParamNames) - { - bool onAllChildren = childParamSets.All(s => s.Contains(paramName)); - bool unusedByParent = parentHasOperations && !parentOperationParamNames.Contains(paramName); - - // A parameter is subclient-specific (should go on accessor) if it's not shared - // across all children, or if the parent has its own operations that don't use it. - if (!onAllChildren || unusedByParent) - { - propagated.Add(paramName); - } - } - - return propagated; - } - private FieldProvider BuildTokenCredentialScopesField(InputOAuth2Auth oauth2Auth, CSharpType tokenCredentialType) { return tokenCredentialType.Equals(ClientPipelineProvider.Instance.TokenCredentialType) diff --git a/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/Metrics.RestClient.cs b/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/Metrics.RestClient.cs index 697b9766d36..a724f1907ef 100644 --- a/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/Metrics.RestClient.cs +++ b/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/Metrics.RestClient.cs @@ -20,9 +20,7 @@ internal PipelineMessage CreateGetWidgetMetricsRequest(string day, RequestOption { ClientUriBuilder uri = new ClientUriBuilder(); uri.Reset(_endpoint); - uri.AppendPath("/metrics/", false); - uri.AppendPath(_metricsNamespace, true); - uri.AppendPath("/widgets/daysOfWeek/", false); + uri.AppendPath("/metrics/widgets/daysOfWeek/", false); uri.AppendPath(day, true); PipelineMessage message = Pipeline.CreateMessage(uri.ToUri(), "GET", PipelineMessageClassifier200); PipelineRequest request = message.Request; 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..8f9c0ffffb6 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 @@ -17,7 +17,6 @@ namespace SampleTypeSpec public partial class Metrics { private readonly Uri _endpoint; - private readonly string _metricsNamespace; /// Initializes a new instance of Metrics for mocking. protected Metrics() @@ -27,38 +26,30 @@ protected Metrics() /// Initializes a new instance of Metrics. /// The HTTP pipeline for sending and receiving REST requests and responses. /// Service endpoint. - /// - internal Metrics(ClientPipeline pipeline, Uri endpoint, string metricsNamespace) + internal Metrics(ClientPipeline pipeline, Uri endpoint) { _endpoint = endpoint; Pipeline = pipeline; - _metricsNamespace = metricsNamespace; } /// Initializes a new instance of Metrics. /// Service endpoint. - /// - /// 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()) + /// is null. + public Metrics(Uri endpoint) : this(endpoint, new SampleTypeSpecClientOptions()) { } /// Initializes a new instance of Metrics. /// Service endpoint. - /// /// 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, SampleTypeSpecClientOptions options) + /// is null. + public Metrics(Uri endpoint, SampleTypeSpecClientOptions options) { Argument.AssertNotNull(endpoint, nameof(endpoint)); - Argument.AssertNotNullOrEmpty(metricsNamespace, nameof(metricsNamespace)); options ??= new SampleTypeSpecClientOptions(); _endpoint = endpoint; - _metricsNamespace = metricsNamespace; Pipeline = ClientPipeline.Create(options, Array.Empty(), new PipelinePolicy[] { new UserAgentPolicy(typeof(Metrics).Assembly) }, Array.Empty()); } 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 cc40aaedfa9..f2e56c36cb0 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 @@ -40,6 +40,7 @@ public partial class SampleTypeSpecClient private PetOperations _cachedPetOperations; private DogOperations _cachedDogOperations; private PlantOperations _cachedPlantOperations; + private Metrics _cachedMetrics; /// Initializes a new instance of SampleTypeSpecClient for mocking. protected SampleTypeSpecClient() @@ -1906,13 +1907,9 @@ public virtual PlantOperations GetPlantOperationsClient() } /// Initializes a new instance of Metrics. - /// - /// is null. - public virtual Metrics GetMetricsClient(string metricsNamespace) + public virtual Metrics GetMetricsClient() { - Argument.AssertNotNull(metricsNamespace, nameof(metricsNamespace)); - - return new Metrics(Pipeline, _endpoint, metricsNamespace); + return Volatile.Read(ref _cachedMetrics) ?? Interlocked.CompareExchange(ref _cachedMetrics, new Metrics(Pipeline, _endpoint), null) ?? _cachedMetrics; } } } diff --git a/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/tspCodeModel.json b/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/tspCodeModel.json index 459ab161e6f..2fd876c5106 100644 --- a/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/tspCodeModel.json +++ b/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/tspCodeModel.json @@ -13044,52 +13044,6 @@ { "$id": "866", "kind": "path", - "name": "metricsNamespace", - "serializedName": "metricsNamespace", - "type": { - "$id": "867", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "isApiVersion": false, - "explode": false, - "style": "simple", - "allowReserved": false, - "skipUrlEncoding": false, - "optional": false, - "scope": "Client", - "decorators": [], - "readOnly": false, - "crossLanguageDefinitionId": "SampleTypeSpec.Metrics.getWidgetMetrics.metricsNamespace", - "methodParameterSegments": [ - { - "$id": "868", - "kind": "method", - "name": "metricsNamespace", - "serializedName": "metricsNamespace", - "type": { - "$id": "869", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "location": "", - "isApiVersion": false, - "optional": false, - "scope": "Method", - "crossLanguageDefinitionId": "SampleTypeSpec.MetricsClientParams.metricsNamespace", - "readOnly": false, - "access": "public", - "decorators": [] - } - ] - }, - { - "$id": "870", - "kind": "path", "name": "day", "serializedName": "day", "type": { @@ -13107,7 +13061,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.Metrics.getWidgetMetrics.day", "methodParameterSegments": [ { - "$id": "871", + "$id": "867", "kind": "method", "name": "day", "serializedName": "day", @@ -13126,7 +13080,7 @@ ] }, { - "$id": "872", + "$id": "868", "kind": "header", "name": "accept", "serializedName": "Accept", @@ -13142,7 +13096,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.Metrics.getWidgetMetrics.accept", "methodParameterSegments": [ { - "$id": "873", + "$id": "869", "kind": "method", "name": "accept", "serializedName": "Accept", @@ -13178,7 +13132,7 @@ ], "httpMethod": "GET", "uri": "{sampleTypeSpecUrl}", - "path": "/metrics/{metricsNamespace}/widgets/daysOfWeek/{day}", + "path": "/metrics/widgets/daysOfWeek/{day}", "bufferResponse": true, "generateProtocolMethod": true, "generateConvenienceMethod": true, @@ -13188,10 +13142,10 @@ }, "parameters": [ { - "$ref": "871" + "$ref": "867" }, { - "$ref": "873" + "$ref": "869" } ], "response": { @@ -13207,12 +13161,12 @@ ], "parameters": [ { - "$id": "874", + "$id": "870", "kind": "endpoint", "name": "sampleTypeSpecUrl", "serializedName": "sampleTypeSpecUrl", "type": { - "$id": "875", + "$id": "871", "kind": "url", "name": "endpoint", "crossLanguageDefinitionId": "TypeSpec.url" @@ -13225,9 +13179,6 @@ "skipUrlEncoding": false, "readOnly": false, "crossLanguageDefinitionId": "SampleTypeSpec.Metrics.sampleTypeSpecUrl" - }, - { - "$ref": "868" } ], "initializedBy": 3, From 4cbd977f4012a9781707d01155ffedd0f3614f8f Mon Sep 17 00:00:00 2001 From: jolov Date: Thu, 5 Mar 2026 19:06:10 -0800 Subject: [PATCH 12/13] fix: add MetricsClientParams back to main.tsp and regenerate samples Restores the MetricsClientParams model and @clientInitialization parameters on the Metrics interface. Regenerated all generated libraries to validate the parameterized accessor behavior. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../src/Generated/Metrics.RestClient.cs | 4 +- .../SampleClient/src/Generated/Metrics.cs | 19 ++++-- .../src/Generated/SampleTypeSpecClient.cs | 31 ++++++--- .../client/csharp/SampleService/main.tsp | 9 ++- .../src/Generated/Metrics.RestClient.cs | 4 +- .../Sample-TypeSpec/src/Generated/Metrics.cs | 19 ++++-- .../src/Generated/SampleTypeSpecClient.cs | 9 ++- .../Local/Sample-TypeSpec/tspCodeModel.json | 65 ++++++++++++++++--- 8 files changed, 126 insertions(+), 34 deletions(-) diff --git a/docs/samples/client/csharp/SampleService/SampleClient/src/Generated/Metrics.RestClient.cs b/docs/samples/client/csharp/SampleService/SampleClient/src/Generated/Metrics.RestClient.cs index 31dd56da2b8..371d027f6b7 100644 --- a/docs/samples/client/csharp/SampleService/SampleClient/src/Generated/Metrics.RestClient.cs +++ b/docs/samples/client/csharp/SampleService/SampleClient/src/Generated/Metrics.RestClient.cs @@ -17,7 +17,9 @@ internal PipelineMessage CreateGetWidgetMetricsRequest(string day, RequestOption { ClientUriBuilder uri = new ClientUriBuilder(); uri.Reset(_endpoint); - uri.AppendPath("/metrics/widgets/daysOfWeek/", false); + uri.AppendPath("/metrics/", false); + uri.AppendPath(_metricsNamespace, true); + uri.AppendPath("/widgets/daysOfWeek/", false); uri.AppendPath(day, true); PipelineMessage message = Pipeline.CreateMessage(uri.ToUri(), "GET", PipelineMessageClassifier200); PipelineRequest request = message.Request; diff --git a/docs/samples/client/csharp/SampleService/SampleClient/src/Generated/Metrics.cs b/docs/samples/client/csharp/SampleService/SampleClient/src/Generated/Metrics.cs index 30284cdba24..65e1ea56883 100644 --- a/docs/samples/client/csharp/SampleService/SampleClient/src/Generated/Metrics.cs +++ b/docs/samples/client/csharp/SampleService/SampleClient/src/Generated/Metrics.cs @@ -14,6 +14,7 @@ namespace SampleTypeSpec public partial class Metrics { private readonly Uri _endpoint; + private readonly string _metricsNamespace; /// Initializes a new instance of Metrics for mocking. protected Metrics() @@ -23,30 +24,38 @@ protected Metrics() /// Initializes a new instance of Metrics. /// The HTTP pipeline for sending and receiving REST requests and responses. /// Service endpoint. - internal Metrics(ClientPipeline pipeline, Uri endpoint) + /// + internal Metrics(ClientPipeline pipeline, Uri endpoint, string metricsNamespace) { _endpoint = endpoint; Pipeline = pipeline; + _metricsNamespace = metricsNamespace; } /// Initializes a new instance of Metrics. /// Service endpoint. - /// is null. - public Metrics(Uri endpoint) : this(endpoint, new SampleTypeSpecClientOptions()) + /// + /// 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()) { } /// Initializes a new instance of Metrics. /// Service endpoint. + /// /// The options for configuring the client. - /// is null. - public Metrics(Uri endpoint, SampleTypeSpecClientOptions options) + /// or is null. + /// is an empty string, and was expected to be non-empty. + public Metrics(Uri endpoint, string metricsNamespace, SampleTypeSpecClientOptions options) { Argument.AssertNotNull(endpoint, nameof(endpoint)); + Argument.AssertNotNullOrEmpty(metricsNamespace, nameof(metricsNamespace)); options ??= new SampleTypeSpecClientOptions(); _endpoint = endpoint; + _metricsNamespace = metricsNamespace; Pipeline = ClientPipeline.Create(options, Array.Empty(), new PipelinePolicy[] { new UserAgentPolicy(typeof(Metrics).Assembly) }, Array.Empty()); } diff --git a/docs/samples/client/csharp/SampleService/SampleClient/src/Generated/SampleTypeSpecClient.cs b/docs/samples/client/csharp/SampleService/SampleClient/src/Generated/SampleTypeSpecClient.cs index 016ab1d0d2e..291d40887ea 100644 --- a/docs/samples/client/csharp/SampleService/SampleClient/src/Generated/SampleTypeSpecClient.cs +++ b/docs/samples/client/csharp/SampleService/SampleClient/src/Generated/SampleTypeSpecClient.cs @@ -32,6 +32,7 @@ public partial class SampleTypeSpecClient } }; private readonly string _apiVersion; + private readonly string _metricsNamespace; private AnimalOperations _cachedAnimalOperations; private PetOperations _cachedPetOperations; private DogOperations _cachedDogOperations; @@ -45,33 +46,41 @@ protected SampleTypeSpecClient() /// Initializes a new instance of SampleTypeSpecClient. /// Service endpoint. + /// /// A credential used to authenticate to the service. - /// or is null. - public SampleTypeSpecClient(Uri endpoint, ApiKeyCredential credential) : this(endpoint, credential, new SampleTypeSpecClientOptions()) + /// , or is null. + /// is an empty string, and was expected to be non-empty. + public SampleTypeSpecClient(Uri endpoint, string metricsNamespace, ApiKeyCredential credential) : this(endpoint, metricsNamespace, credential, new SampleTypeSpecClientOptions()) { } /// Initializes a new instance of SampleTypeSpecClient. /// Service endpoint. + /// /// A credential provider used to authenticate to the service. - /// or is null. - public SampleTypeSpecClient(Uri endpoint, AuthenticationTokenProvider tokenProvider) : this(endpoint, tokenProvider, new SampleTypeSpecClientOptions()) + /// , or is null. + /// is an empty string, and was expected to be non-empty. + public SampleTypeSpecClient(Uri endpoint, string metricsNamespace, AuthenticationTokenProvider tokenProvider) : this(endpoint, metricsNamespace, tokenProvider, new SampleTypeSpecClientOptions()) { } /// Initializes a new instance of SampleTypeSpecClient. /// Service endpoint. + /// /// A credential used to authenticate to the service. /// The options for configuring the client. - /// or is null. - public SampleTypeSpecClient(Uri endpoint, ApiKeyCredential credential, SampleTypeSpecClientOptions options) + /// , or is null. + /// is an empty string, and was expected to be non-empty. + public SampleTypeSpecClient(Uri endpoint, string metricsNamespace, ApiKeyCredential credential, SampleTypeSpecClientOptions options) { Argument.AssertNotNull(endpoint, nameof(endpoint)); + Argument.AssertNotNullOrEmpty(metricsNamespace, nameof(metricsNamespace)); Argument.AssertNotNull(credential, nameof(credential)); options ??= new SampleTypeSpecClientOptions(); _endpoint = endpoint; + _metricsNamespace = metricsNamespace; _keyCredential = credential; Pipeline = ClientPipeline.Create(options, Array.Empty(), new PipelinePolicy[] { new UserAgentPolicy(typeof(SampleTypeSpecClient).Assembly), ApiKeyAuthenticationPolicy.CreateHeaderApiKeyPolicy(_keyCredential, AuthorizationHeader) }, Array.Empty()); _apiVersion = options.Version; @@ -79,17 +88,21 @@ public SampleTypeSpecClient(Uri endpoint, ApiKeyCredential credential, SampleTyp /// Initializes a new instance of SampleTypeSpecClient. /// Service endpoint. + /// /// A credential provider used to authenticate to the service. /// The options for configuring the client. - /// or is null. - public SampleTypeSpecClient(Uri endpoint, AuthenticationTokenProvider tokenProvider, SampleTypeSpecClientOptions options) + /// , or is null. + /// is an empty string, and was expected to be non-empty. + public SampleTypeSpecClient(Uri endpoint, string metricsNamespace, AuthenticationTokenProvider tokenProvider, SampleTypeSpecClientOptions options) { Argument.AssertNotNull(endpoint, nameof(endpoint)); + Argument.AssertNotNullOrEmpty(metricsNamespace, nameof(metricsNamespace)); Argument.AssertNotNull(tokenProvider, nameof(tokenProvider)); options ??= new SampleTypeSpecClientOptions(); _endpoint = endpoint; + _metricsNamespace = metricsNamespace; _tokenProvider = tokenProvider; Pipeline = ClientPipeline.Create(options, Array.Empty(), new PipelinePolicy[] { new UserAgentPolicy(typeof(SampleTypeSpecClient).Assembly), new BearerTokenPolicy(_tokenProvider, _flows) }, Array.Empty()); _apiVersion = options.Version; @@ -3317,7 +3330,7 @@ public virtual PlantOperations GetPlantOperationsClient() /// Initializes a new instance of Metrics. public virtual Metrics GetMetricsClient() { - return Volatile.Read(ref _cachedMetrics) ?? Interlocked.CompareExchange(ref _cachedMetrics, new Metrics(Pipeline, _endpoint), null) ?? _cachedMetrics; + return Volatile.Read(ref _cachedMetrics) ?? Interlocked.CompareExchange(ref _cachedMetrics, new Metrics(Pipeline, _endpoint, _metricsNamespace), null) ?? _cachedMetrics; } } } diff --git a/docs/samples/client/csharp/SampleService/main.tsp b/docs/samples/client/csharp/SampleService/main.tsp index 2722adc9c6f..d63bf43a53a 100644 --- a/docs/samples/client/csharp/SampleService/main.tsp +++ b/docs/samples/client/csharp/SampleService/main.tsp @@ -833,14 +833,19 @@ interface PlantOperations { }; } +model MetricsClientParams { + metricsNamespace: string; +} + @clientInitialization({ initializedBy: InitializedBy.individually | InitializedBy.parent, + parameters: MetricsClientParams, }) interface Metrics { @doc("Get Widget metrics for given day of week") @get - @route("/metrics/widgets/daysOfWeek") - getWidgetMetrics(@path day: DaysOfWeekExtensibleEnum): { + @route("/metrics/{metricsNamespace}/widgets/daysOfWeek") + getWidgetMetrics(@path metricsNamespace: string, @path day: DaysOfWeekExtensibleEnum): { numSold: int32; averagePrice: float32; }; diff --git a/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/Metrics.RestClient.cs b/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/Metrics.RestClient.cs index a724f1907ef..697b9766d36 100644 --- a/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/Metrics.RestClient.cs +++ b/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/Metrics.RestClient.cs @@ -20,7 +20,9 @@ internal PipelineMessage CreateGetWidgetMetricsRequest(string day, RequestOption { ClientUriBuilder uri = new ClientUriBuilder(); uri.Reset(_endpoint); - uri.AppendPath("/metrics/widgets/daysOfWeek/", false); + uri.AppendPath("/metrics/", false); + uri.AppendPath(_metricsNamespace, true); + uri.AppendPath("/widgets/daysOfWeek/", false); uri.AppendPath(day, true); PipelineMessage message = Pipeline.CreateMessage(uri.ToUri(), "GET", PipelineMessageClassifier200); PipelineRequest request = message.Request; 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 8f9c0ffffb6..8e55488af08 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 @@ -17,6 +17,7 @@ namespace SampleTypeSpec public partial class Metrics { private readonly Uri _endpoint; + private readonly string _metricsNamespace; /// Initializes a new instance of Metrics for mocking. protected Metrics() @@ -26,30 +27,38 @@ protected Metrics() /// Initializes a new instance of Metrics. /// The HTTP pipeline for sending and receiving REST requests and responses. /// Service endpoint. - internal Metrics(ClientPipeline pipeline, Uri endpoint) + /// + internal Metrics(ClientPipeline pipeline, Uri endpoint, string metricsNamespace) { _endpoint = endpoint; Pipeline = pipeline; + _metricsNamespace = metricsNamespace; } /// Initializes a new instance of Metrics. /// Service endpoint. - /// is null. - public Metrics(Uri endpoint) : this(endpoint, new SampleTypeSpecClientOptions()) + /// + /// 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()) { } /// Initializes a new instance of Metrics. /// Service endpoint. + /// /// The options for configuring the client. - /// is null. - public Metrics(Uri endpoint, SampleTypeSpecClientOptions options) + /// or is null. + /// is an empty string, and was expected to be non-empty. + public Metrics(Uri endpoint, string metricsNamespace, SampleTypeSpecClientOptions options) { Argument.AssertNotNull(endpoint, nameof(endpoint)); + Argument.AssertNotNullOrEmpty(metricsNamespace, nameof(metricsNamespace)); options ??= new SampleTypeSpecClientOptions(); _endpoint = endpoint; + _metricsNamespace = metricsNamespace; Pipeline = ClientPipeline.Create(options, Array.Empty(), new PipelinePolicy[] { new UserAgentPolicy(typeof(Metrics).Assembly) }, Array.Empty()); } 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 f2e56c36cb0..cc40aaedfa9 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 @@ -40,7 +40,6 @@ public partial class SampleTypeSpecClient private PetOperations _cachedPetOperations; private DogOperations _cachedDogOperations; private PlantOperations _cachedPlantOperations; - private Metrics _cachedMetrics; /// Initializes a new instance of SampleTypeSpecClient for mocking. protected SampleTypeSpecClient() @@ -1907,9 +1906,13 @@ public virtual PlantOperations GetPlantOperationsClient() } /// Initializes a new instance of Metrics. - public virtual Metrics GetMetricsClient() + /// + /// is null. + public virtual Metrics GetMetricsClient(string metricsNamespace) { - return Volatile.Read(ref _cachedMetrics) ?? Interlocked.CompareExchange(ref _cachedMetrics, new Metrics(Pipeline, _endpoint), null) ?? _cachedMetrics; + Argument.AssertNotNull(metricsNamespace, nameof(metricsNamespace)); + + return new Metrics(Pipeline, _endpoint, metricsNamespace); } } } diff --git a/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/tspCodeModel.json b/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/tspCodeModel.json index 2fd876c5106..459ab161e6f 100644 --- a/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/tspCodeModel.json +++ b/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/tspCodeModel.json @@ -13044,6 +13044,52 @@ { "$id": "866", "kind": "path", + "name": "metricsNamespace", + "serializedName": "metricsNamespace", + "type": { + "$id": "867", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "isApiVersion": false, + "explode": false, + "style": "simple", + "allowReserved": false, + "skipUrlEncoding": false, + "optional": false, + "scope": "Client", + "decorators": [], + "readOnly": false, + "crossLanguageDefinitionId": "SampleTypeSpec.Metrics.getWidgetMetrics.metricsNamespace", + "methodParameterSegments": [ + { + "$id": "868", + "kind": "method", + "name": "metricsNamespace", + "serializedName": "metricsNamespace", + "type": { + "$id": "869", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "", + "isApiVersion": false, + "optional": false, + "scope": "Method", + "crossLanguageDefinitionId": "SampleTypeSpec.MetricsClientParams.metricsNamespace", + "readOnly": false, + "access": "public", + "decorators": [] + } + ] + }, + { + "$id": "870", + "kind": "path", "name": "day", "serializedName": "day", "type": { @@ -13061,7 +13107,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.Metrics.getWidgetMetrics.day", "methodParameterSegments": [ { - "$id": "867", + "$id": "871", "kind": "method", "name": "day", "serializedName": "day", @@ -13080,7 +13126,7 @@ ] }, { - "$id": "868", + "$id": "872", "kind": "header", "name": "accept", "serializedName": "Accept", @@ -13096,7 +13142,7 @@ "crossLanguageDefinitionId": "SampleTypeSpec.Metrics.getWidgetMetrics.accept", "methodParameterSegments": [ { - "$id": "869", + "$id": "873", "kind": "method", "name": "accept", "serializedName": "Accept", @@ -13132,7 +13178,7 @@ ], "httpMethod": "GET", "uri": "{sampleTypeSpecUrl}", - "path": "/metrics/widgets/daysOfWeek/{day}", + "path": "/metrics/{metricsNamespace}/widgets/daysOfWeek/{day}", "bufferResponse": true, "generateProtocolMethod": true, "generateConvenienceMethod": true, @@ -13142,10 +13188,10 @@ }, "parameters": [ { - "$ref": "867" + "$ref": "871" }, { - "$ref": "869" + "$ref": "873" } ], "response": { @@ -13161,12 +13207,12 @@ ], "parameters": [ { - "$id": "870", + "$id": "874", "kind": "endpoint", "name": "sampleTypeSpecUrl", "serializedName": "sampleTypeSpecUrl", "type": { - "$id": "871", + "$id": "875", "kind": "url", "name": "endpoint", "crossLanguageDefinitionId": "TypeSpec.url" @@ -13179,6 +13225,9 @@ "skipUrlEncoding": false, "readOnly": false, "crossLanguageDefinitionId": "SampleTypeSpec.Metrics.sampleTypeSpecUrl" + }, + { + "$ref": "868" } ], "initializedBy": 3, From 4a4e7a87d019813db59caad3bbc4a954e800258a Mon Sep 17 00:00:00 2001 From: jolov Date: Fri, 6 Mar 2026 07:26:50 -0800 Subject: [PATCH 13/13] refactor: simplify subclient parameter comparison logic in accessor generation Remove redundant IsApiVersion/IsEndpoint filters in accessor loop (already handled by earlier branches). Use _inputClient.Parameters instead of _allClientParameters for parent comparison. Retain parent comparison for correctness in MultiServiceClient scenarios where params are shared. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../src/Providers/ClientProvider.cs | 23 ++++++++----------- 1 file changed, 9 insertions(+), 14 deletions(-) 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 8678dbc6f9c..c58ae32a555 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 @@ -310,9 +310,7 @@ private IReadOnlyList GetSubClientInternalConstructorParamete } /// - /// Determines whether this subclient has non-infrastructure parameters that need to be - /// included as parameters in the parent's accessor method rather than stored on the parent. - /// A subclient has accessor-only parameters if it has non-infrastructure parameters + /// Determines whether this subclient has non-infrastructure parameters /// (not API versions, not endpoint) that are not present on the parent's InputClient.Parameters. /// Uses the raw to avoid circular lazy-initialization dependencies. /// @@ -922,18 +920,17 @@ protected override ScmMethodProvider[] BuildMethods() List subClientConstructorArgs = new(3); List accessorMethodParams = []; - // Determine which subclient parameters should be on the accessor method. - // Subclient-specific parameters (not on the parent) need to be passed via the accessor. - var parentEffectiveParamNames = _allClientParameters + // Identify subclient-specific parameters by comparing with the parent's input parameters. + // Parameters present on both parent and subclient are shared (sourced from parent fields/properties). + var parentInputParamNames = _inputClient.Parameters .Select(p => p.Name) .ToHashSet(StringComparer.OrdinalIgnoreCase); - var subClientExtraInputParamNames = subClient._inputClient.Parameters - .Where(p => !p.IsApiVersion && !(p is InputEndpointParameter ep && ep.IsEndpoint)) - .Where(p => !parentEffectiveParamNames.Contains(p.Name)) + var subClientSpecificParamNames = subClient._inputClient.Parameters + .Where(p => !parentInputParamNames.Contains(p.Name)) .Select(p => p.Name) .ToHashSet(StringComparer.OrdinalIgnoreCase); - // Populate constructor arguments, collecting extra params for the accessor method signature + // Populate constructor arguments, collecting subclient-specific params for the accessor method signature foreach (var param in subClient._subClientInternalConstructorParams.Value) { if (parentClientProperties.TryGetValue(param.Name, out var parentProperty)) @@ -953,14 +950,12 @@ protected override ScmMethodProvider[] BuildMethods() subClientConstructorArgs.Add(correspondingApiVersionField.Field); } } - else if (subClientExtraInputParamNames.Contains(param.Name)) + else if (subClientSpecificParamNames.Contains(param.Name)) { - // This parameter is subclient-specific and not available on the parent -- - // expose it as an accessor method parameter. + // This parameter is subclient-specific — expose it as an accessor method parameter. accessorMethodParams.Add(param); subClientConstructorArgs.Add(param); } - // else: infra param (pipeline, auth, endpoint) not found in parent mock — silently skip } var factoryMethodName = subClient.Name.EndsWith(ClientSuffix, StringComparison.OrdinalIgnoreCase)