diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel.StubLibrary/src/StubLibraryVisitor.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel.StubLibrary/src/StubLibraryVisitor.cs index c3ea6a82987..a24a1b21c42 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel.StubLibrary/src/StubLibraryVisitor.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel.StubLibrary/src/StubLibraryVisitor.cs @@ -46,6 +46,7 @@ internal class StubLibraryVisitor : ScmLibraryVisitor if (!IsCallingBaseCtor(constructor) && !IsEffectivelyPublic(constructor.Signature.Modifiers) && !IsParameterlessInternalCtorOnMrwSerializationType(constructor) && + !IsInternalClientConstructor(constructor) && (constructor.EnclosingType is not ModelProvider model || model.DerivedModels.Count == 0)) return null; @@ -57,6 +58,14 @@ internal class StubLibraryVisitor : ScmLibraryVisitor return constructor; } + private static bool IsInternalClientConstructor(ConstructorProvider constructor) + { + if (!constructor.Signature.Modifiers.HasFlag(MethodSignatureModifiers.Internal)) + return false; + + return constructor.EnclosingType is ClientProvider; + } + private static bool IsParameterlessInternalCtorOnMrwSerializationType(ConstructorProvider constructor) { if (constructor.Signature.Parameters.Count != 0) @@ -78,7 +87,13 @@ private static bool IsCallingBaseCtor(ConstructorProvider constructor) protected override FieldProvider? VisitField(FieldProvider field) { // For ClientOptions, keep the non-public field as this currently represents the latest service version for a client. - return (field.Modifiers.HasFlag(FieldModifiers.Public) || field.EnclosingType.BaseType?.Equals(typeof(ClientPipelineOptions)) == true) + // For ClientProvider, keep const and static fields as they are referenced by stub constructor initializers + // (e.g. AuthorizationHeader const used in this() API key ctor, _flows static used in this() OAuth2 ctor). + return (field.Modifiers.HasFlag(FieldModifiers.Public) + || field.EnclosingType.BaseType?.Equals(typeof(ClientPipelineOptions)) == true + || (field.EnclosingType is ClientProvider + && (field.Modifiers.HasFlag(FieldModifiers.Const) + || field.Modifiers.HasFlag(FieldModifiers.Static)))) ? field : null; } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Microsoft.TypeSpec.Generator.ClientModel.csproj b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Microsoft.TypeSpec.Generator.ClientModel.csproj index a14cd844c1c..3179721bdfb 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Microsoft.TypeSpec.Generator.ClientModel.csproj +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Microsoft.TypeSpec.Generator.ClientModel.csproj @@ -9,6 +9,7 @@ + diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/BinaryContentProvider.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/BinaryContentProvider.cs index d7e452714fd..6b0d2fbcfcf 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/BinaryContentProvider.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/BinaryContentProvider.cs @@ -3,10 +3,10 @@ using System.ClientModel; using Microsoft.TypeSpec.Generator.ClientModel.Snippets; -using static Microsoft.TypeSpec.Generator.Snippets.Snippet; using Microsoft.TypeSpec.Generator.Expressions; -using Microsoft.TypeSpec.Generator.Statements; using Microsoft.TypeSpec.Generator.Primitives; +using Microsoft.TypeSpec.Generator.Statements; +using static Microsoft.TypeSpec.Generator.Snippets.Snippet; namespace Microsoft.TypeSpec.Generator.ClientModel.Providers { diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ClientOptionsProvider.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ClientOptionsProvider.cs index 7001641f55e..3f2a1aed342 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ClientOptionsProvider.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ClientOptionsProvider.cs @@ -11,6 +11,7 @@ using Microsoft.TypeSpec.Generator.Primitives; using Microsoft.TypeSpec.Generator.Providers; using Microsoft.TypeSpec.Generator.Shared; +using Microsoft.TypeSpec.Generator.Snippets; using Microsoft.TypeSpec.Generator.Statements; using Microsoft.TypeSpec.Generator.Utilities; using static Microsoft.TypeSpec.Generator.Snippets.Snippet; @@ -230,9 +231,15 @@ protected override TypeProvider[] BuildNestedTypes() protected override ConstructorProvider[] BuildConstructors() { + var configSectionCtor = BuildConfigurationSectionConstructor(); + if (LatestVersionsFields is null) { - return []; + var defaultCtor = new ConstructorProvider( + new ConstructorSignature(Type, $"Initializes a new instance of {_clientProvider.Name}Options.", MethodSignatureModifiers.Public, []), + MethodBodyStatement.Empty, + this); + return [defaultCtor, configSectionCtor]; } var constructorBody = new List(); @@ -281,7 +288,85 @@ protected override ConstructorProvider[] BuildConstructors() new ConstructorSignature(Type, $"Initializes a new instance of {_clientProvider.Name}Options.", MethodSignatureModifiers.Public, constructorParameters), constructorBody, this); - return [constructor]; + return [constructor, configSectionCtor]; + } + + private ConstructorProvider BuildConfigurationSectionConstructor() + { + var sectionParam = new ParameterProvider( + "section", + $"The configuration section.", + ClientSettingsProvider.IConfigurationSectionType); + + var experimentalAttr = new AttributeStatement( + typeof(System.Diagnostics.CodeAnalysis.ExperimentalAttribute), + [Literal(ClientSettingsProvider.ClientSettingsDiagnosticId)]); + + // Set version to latest version before the guard so it is always initialized + var body = new List(); + if (LatestVersionsFields != null && VersionProperties != null) + { + foreach (var (_, serviceVersionEnum) in LatestVersionsFields.OrderBy(kvp => kvp.Key.Name)) + { + if (VersionProperties.TryGetValue(serviceVersionEnum, out var versionProperty)) + { + var latestVersion = serviceVersionEnum.EnumValues[^1]; + body.Add(versionProperty.Assign(Literal(latestVersion.Value)).Terminate()); + } + } + } + + // if (section is null || !section.Exists()) { return; } + var guardCondition = sectionParam.Is(Null).Or(Not(sectionParam.Invoke("Exists"))); + var guardStatement = new IfStatement(guardCondition) { Return() }; + + body.Add(guardStatement); + + // Bind version properties from configuration (after guard, default already set before guard) + if (LatestVersionsFields != null && VersionProperties != null) + { + foreach (var (_, serviceVersionEnum) in LatestVersionsFields.OrderBy(kvp => kvp.Key.Name)) + { + if (VersionProperties.TryGetValue(serviceVersionEnum, out var versionProperty)) + { + // if (section["VersionPropertyName"] is string version) { Version = version; } + var versionVarDecl = Declare(versionProperty.Name.ToVariableName(), new CSharpType(typeof(string)), out var versionVar); + var ifVersionStatement = new IfStatement(new IndexerExpression(sectionParam, Literal(versionProperty.Name)).Is(versionVarDecl)); + ifVersionStatement.Add(This.Property(versionProperty.Name).Assign(versionVar).Terminate()); + body.Add(ifVersionStatement); + } + } + } + + // Build a set of version property names for O(1) lookup + var versionPropertyNames = VersionProperties?.Values.Select(vp => vp.Name).ToHashSet(); + + // Bind non-version properties from configuration using type-aware binding + foreach (var property in Properties) + { + if (versionPropertyNames?.Contains(property.Name) == true) + { + continue; + } + + ClientSettingsProvider.AppendBindingForProperty( + body, + sectionParam, + property.Name, + property.Name.ToVariableName(), + property.Type); + } + + return new ConstructorProvider( + new ConstructorSignature( + Type, + $"Initializes a new instance of {_clientProvider.Name}Options from configuration.", + MethodSignatureModifiers.Internal, + [sectionParam], + attributes: [experimentalAttr], + initializer: new ConstructorInitializer(true, [sectionParam])), + new MethodBodyStatements([.. body]), + this); } protected override PropertyProvider[] BuildProperties() 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 c58ae32a555..a296420f62f 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 @@ -4,6 +4,7 @@ using System; using System.ClientModel.Primitives; using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; using System.IO; using System.Linq; using System.Threading; @@ -36,6 +37,8 @@ private record ApiVersionFields(FieldProvider Field, PropertyProvider? Correspon private const string TokenProviderFieldName = "_tokenProvider"; private const string TokenCredentialFieldName = "_tokenCredential"; private const string EndpointFieldName = "_endpoint"; + private const string CredentialParamName = "credential"; + private const string SettingsParamName = "settings"; private const string ClientSuffix = "Client"; private readonly FormattableString _publicCtorDescription; private readonly InputClient _inputClient; @@ -102,6 +105,7 @@ public ClientProvider(InputClient inputClient) _publicCtorDescription = $"Initializes a new instance of {Name}."; ClientOptions = _inputClient.Parent is null ? ClientOptionsProvider.CreateClientOptionsProvider(_inputClient, this) : null; ClientOptionsParameter = ClientOptions != null ? ScmKnownParameters.ClientOptions(ClientOptions.Type) : null; + ClientSettings = ClientOptions != null ? new ClientSettingsProvider(_inputClient, this) : null; IsMultiServiceClient = _inputClient.IsMultiServiceClient; var apiKey = _inputAuth?.ApiKey; @@ -378,6 +382,7 @@ private IReadOnlyList GetClientParameters() /// public RestClientProvider RestClient => _restClient ??= new RestClientProvider(_inputClient, this); public ClientOptionsProvider? ClientOptions { get; } + public ClientSettingsProvider? ClientSettings { get; } public PropertyProvider PipelineProperty { get; } public FieldProvider EndpointField { get; } @@ -394,7 +399,7 @@ protected override FieldProvider[] BuildFields() if (_apiKeyAuthFields != null) { - fields.Add(_apiKeyAuthFields.AuthField); + // No longer add AuthField (_keyCredential) — auth is handled via AuthenticationPolicy parameter in the internal constructor fields.Add(_apiKeyAuthFields.AuthorizationHeaderField); if (_apiKeyAuthFields.AuthorizationApiKeyPrefixField != null) { @@ -404,7 +409,7 @@ protected override FieldProvider[] BuildFields() if (_oauth2Fields != null) { - fields.Add(_oauth2Fields.AuthField); + // No longer add AuthField (_tokenProvider) — auth is handled via AuthenticationPolicy parameter in the internal constructor fields.Add(_oauth2Fields.AuthorizationScopesField); } @@ -569,45 +574,87 @@ protected override ConstructorProvider[] BuildConstructors() var primaryConstructors = new List(); var secondaryConstructors = new List(); + bool hasAnyAuth = _apiKeyAuthFields != null || _oauth2Fields != null; + + // The internal implementation constructor takes AuthenticationPolicy? as first parameter. + // It is shared across all auth types - add it once. + if (hasAnyAuth || _apiKeyAuthFields == null && _oauth2Fields == null) + { + // Always add the single internal implementation constructor + var authPolicyParam = new ParameterProvider( + "authenticationPolicy", + $"The authentication policy to use for pipeline creation.", + new CSharpType(typeof(AuthenticationPolicy), isNullable: true)); + + var requiredNonAuthParams = GetRequiredParameters(null); + ParameterProvider[] internalConstructorParameters = [authPolicyParam, _endpointParameter, .. requiredNonAuthParams, ClientOptionsParameter]; + + // Use the first available auth fields to determine pipeline auth type + AuthFields? firstAuthFields = _apiKeyAuthFields as AuthFields ?? _oauth2Fields; + var internalConstructor = new ConstructorProvider( + new ConstructorSignature(Type, _publicCtorDescription, MethodSignatureModifiers.Internal, internalConstructorParameters), + BuildPrimaryConstructorBody(internalConstructorParameters, firstAuthFields, authPolicyParam, ClientOptions, ClientOptionsParameter, addExplicitValidation: true), + this); + primaryConstructors.Add(internalConstructor); + } + // if there is key auth if (_apiKeyAuthFields != null) { - AppendConstructors(_apiKeyAuthFields, primaryConstructors, secondaryConstructors); + AppendPublicConstructors(_apiKeyAuthFields, primaryConstructors, secondaryConstructors); } // if there is oauth2 auth if (_oauth2Fields != null) { - AppendConstructors(_oauth2Fields, primaryConstructors, secondaryConstructors); + AppendPublicConstructors(_oauth2Fields, primaryConstructors, secondaryConstructors); } bool onlyContainsUnsupportedAuth = _inputAuth != null && _apiKeyAuthFields == null && _oauth2Fields == null; // if there is no auth if (_apiKeyAuthFields == null && _oauth2Fields == null) { - AppendConstructors(null, primaryConstructors, secondaryConstructors, onlyContainsUnsupportedAuth); + AppendPublicConstructors(null, primaryConstructors, secondaryConstructors, onlyContainsUnsupportedAuth); } var shouldIncludeMockingConstructor = !onlyContainsUnsupportedAuth && secondaryConstructors.All(c => c.Signature.Parameters.Count > 0); + var settingsConstructors = BuildSettingsConstructors(); + return shouldIncludeMockingConstructor - ? [ConstructorProviderHelper.BuildMockingConstructor(this), .. secondaryConstructors, .. primaryConstructors] - : [.. secondaryConstructors, .. primaryConstructors]; + ? [ConstructorProviderHelper.BuildMockingConstructor(this), .. secondaryConstructors, .. primaryConstructors, .. settingsConstructors] + : [.. secondaryConstructors, .. primaryConstructors, .. settingsConstructors]; - void AppendConstructors( + void AppendPublicConstructors( AuthFields? authFields, List primaryConstructors, List secondaryConstructors, bool onlyContainsUnsupportedAuth = false) { + // Public constructor with credential parameter — delegates to the internal constructor. var requiredParameters = GetRequiredParameters(authFields?.AuthField); ParameterProvider[] primaryConstructorParameters = [_endpointParameter, .. requiredParameters, ClientOptionsParameter]; - // If auth exists but it's not supported, we will make the constructor internal. var constructorModifier = onlyContainsUnsupportedAuth ? MethodSignatureModifiers.Internal : MethodSignatureModifiers.Public; + + // Build the auth policy expression for the this() initializer + ValueExpression authPolicyArg = BuildAuthPolicyArgument(authFields, requiredParameters); + var initializerArgs = new List { authPolicyArg, _endpointParameter }; + // Add non-auth required parameters from the SAME parameter list (requiredParameters) + // to ensure the initializer references the same objects as the constructor signature. + string? authParamName = authFields != null + ? (authFields.AuthField.Name != TokenProviderFieldName ? CredentialParamName : authFields.AuthField.AsParameter.Name) + : null; + foreach (var p in requiredParameters) + { + if (authParamName == null || p.Name != authParamName) + initializerArgs.Add(p); + } + initializerArgs.Add(ClientOptionsParameter!); + var primaryConstructor = new ConstructorProvider( - new ConstructorSignature(Type, _publicCtorDescription, constructorModifier, primaryConstructorParameters), - BuildPrimaryConstructorBody(primaryConstructorParameters, authFields, ClientOptions, ClientOptionsParameter), + new ConstructorSignature(Type, _publicCtorDescription, constructorModifier, primaryConstructorParameters, + initializer: new ConstructorInitializer(false, initializerArgs)), + MethodBodyStatement.Empty, this); - primaryConstructors.Add(primaryConstructor); // If the endpoint parameter contains an initialization value, it is not required. @@ -631,6 +678,57 @@ void AppendConstructors( } } + private IEnumerable BuildSettingsConstructors() + { + if (ClientSettings == null || ClientSettings.EndpointPropertyName == null) + { + yield break; + } + + var settingsParam = new ParameterProvider(SettingsParamName, $"The settings for {Name}.", ClientSettings.Type); + var experimentalAttr = new AttributeStatement(typeof(ExperimentalAttribute), [Literal(ClientSettingsProvider.ClientSettingsDiagnosticId)]); + + // Build the arguments for the this(...) internal constructor initializer: + // this(AuthenticationPolicy.Create(settings), settings?.Endpoint, otherParams..., settings?.Options) + var args = new List(); + + // auth policy argument: AuthenticationPolicy.Create(settings) +#pragma warning disable SCME0002 + args.Add(Static(typeof(AuthenticationPolicy)).Invoke("Create", settingsParam)); +#pragma warning restore SCME0002 + + // endpoint argument - we know EndpointPropertyName is not null at this point + args.Add(new MemberExpression(new NullConditionalExpression(settingsParam), ClientSettings.EndpointPropertyName)); + + // other required parameters (non-auth, non-endpoint) in primary constructor order + foreach (var param in ClientSettings.OtherRequiredParams) + { + var propName = param.Name.ToIdentifierName(); + var propAccess = new MemberExpression(new NullConditionalExpression(settingsParam), propName); + // Value types (enums, primitives) need ?? default since null-conditional returns T? + ValueExpression arg = param.Type.IsValueType + ? propAccess.NullCoalesce(new KeywordExpression("default", null)) + : propAccess; + args.Add(arg); + } + + // options argument + args.Add(new MemberExpression(new NullConditionalExpression(settingsParam), "Options")); + + var settingsConstructor = new ConstructorProvider( + new ConstructorSignature( + Type, + $"Initializes a new instance of {Name} from a .", + MethodSignatureModifiers.Public, + [settingsParam], + attributes: [experimentalAttr], + initializer: new ConstructorInitializer(false, args)), + MethodBodyStatement.Empty, + this); + + yield return settingsConstructor; + } + private void AppendSubClientPublicConstructors(List constructors) { // For sub-clients that can be initialized individually, we need to create public constructors @@ -680,7 +778,7 @@ void AppendSubClientPublicConstructorsForAuth( ParameterProvider[] primaryConstructorParameters = [_endpointParameter, .. requiredParameters, clientOptionsParameter]; var primaryConstructor = new ConstructorProvider( new ConstructorSignature(Type, _publicCtorDescription, MethodSignatureModifiers.Public, primaryConstructorParameters), - BuildPrimaryConstructorBody(primaryConstructorParameters, authFields, clientOptionsProvider, clientOptionsParameter), + BuildPrimaryConstructorBody(primaryConstructorParameters, authFields, null, clientOptionsProvider, clientOptionsParameter), this); primaryConstructors.Add(primaryConstructor); @@ -734,7 +832,7 @@ private IReadOnlyList GetRequiredParameters(FieldProvider? au var authParameter = authField.AsParameter; if (authField.Name != TokenProviderFieldName) { - authParameter.Update(name: "credential"); + authParameter.Update(name: CredentialParamName); } requiredParameters.Add(authParameter); } @@ -753,12 +851,34 @@ private IReadOnlyList GetRequiredParameters(FieldProvider? au return param; } - private MethodBodyStatement[] BuildPrimaryConstructorBody(IReadOnlyList primaryConstructorParameters, AuthFields? authFields, ClientOptionsProvider? clientOptionsProvider, ParameterProvider? clientOptionsParameter) + private MethodBodyStatement[] BuildPrimaryConstructorBody(IReadOnlyList primaryConstructorParameters, AuthFields? authFields, ParameterProvider? authPolicyParam, ClientOptionsProvider? clientOptionsProvider, ParameterProvider? clientOptionsParameter, bool addExplicitValidation = false) { if (clientOptionsProvider is null || clientOptionsParameter is null) { return [MethodBodyStatement.Empty]; } + + List body = []; + // Add parameter validation assertions explicitly only for internal constructors. + // The framework's automatic validation only applies to public methods, so internal + // implementation constructors need explicit validation since they contain the body. + if (addExplicitValidation) + { + bool hasValidation = false; + foreach (var p in primaryConstructorParameters) + { + if (p.Validation != ParameterValidationType.None) + { + body.Add(ArgumentSnippets.ValidateParameter(p)); + hasValidation = true; + } + } + if (hasValidation) + { + body.Add(MethodBodyStatement.EmptyLine); + } + } + AssignmentExpression endpointAssignment; if (_endpointParameter.Type.Equals(typeof(string))) { @@ -773,11 +893,9 @@ private MethodBodyStatement[] BuildPrimaryConstructorBody(IReadOnlyList body = [ - clientOptionsParameter.Assign(clientOptionsParameter.InitializationValue!, nullCoalesce: true).Terminate(), - MethodBodyStatement.EmptyLine, - endpointAssignment.Terminate() - ]; + body.Add(clientOptionsParameter.Assign(clientOptionsParameter.InitializationValue!, nullCoalesce: true).Terminate()); + body.Add(MethodBodyStatement.EmptyLine); + body.Add(endpointAssignment.Terminate()); // add other parameter assignments to their corresponding fields foreach (var p in primaryConstructorParameters) @@ -798,20 +916,29 @@ private MethodBodyStatement[] BuildPrimaryConstructorBody(IReadOnlyList().KeyAuthorizationPolicy(keyAuthFields.AuthField, keyAuthFields.AuthorizationHeaderField, keyPrefixExpression)); - perRetryPolicies = New.Array(ScmCodeModelGenerator.Instance.TypeFactory.ClientPipelineApi.PipelinePolicyType, isInline: true, [.. perRetryPoliciesList]); - break; - case OAuth2Fields oauth2AuthFields: - perRetryPoliciesList.Add(This.ToApi().TokenAuthorizationPolicy(oauth2AuthFields.AuthField, oauth2AuthFields.AuthorizationScopesField)); - perRetryPolicies = New.Array(ScmCodeModelGenerator.Instance.TypeFactory.ClientPipelineApi.PipelinePolicyType, isInline: true, [.. perRetryPoliciesList]); - break; - default: - perRetryPolicies = New.Array(ScmCodeModelGenerator.Instance.TypeFactory.ClientPipelineApi.PipelinePolicyType, isInline: true, [.. perRetryPoliciesList]); - break; + // Internal implementation constructor: use the authenticationPolicy parameter directly + perRetryPoliciesList.Add(authPolicyParam); + perRetryPolicies = New.Array(ScmCodeModelGenerator.Instance.TypeFactory.ClientPipelineApi.PipelinePolicyType, isInline: true, [.. perRetryPoliciesList]); + } + else + { + switch (authFields) + { + case ApiKeyFields keyAuthFields: + ValueExpression? keyPrefixExpression = keyAuthFields.AuthorizationApiKeyPrefixField != null ? (ValueExpression)keyAuthFields.AuthorizationApiKeyPrefixField : null; + perRetryPoliciesList.Add(This.ToApi().KeyAuthorizationPolicy(keyAuthFields.AuthField, keyAuthFields.AuthorizationHeaderField, keyPrefixExpression)); + perRetryPolicies = New.Array(ScmCodeModelGenerator.Instance.TypeFactory.ClientPipelineApi.PipelinePolicyType, isInline: true, [.. perRetryPoliciesList]); + break; + case OAuth2Fields oauth2AuthFields: + perRetryPoliciesList.Add(This.ToApi().TokenAuthorizationPolicy(oauth2AuthFields.AuthField, oauth2AuthFields.AuthorizationScopesField)); + perRetryPolicies = New.Array(ScmCodeModelGenerator.Instance.TypeFactory.ClientPipelineApi.PipelinePolicyType, isInline: true, [.. perRetryPoliciesList]); + break; + default: + perRetryPolicies = New.Array(ScmCodeModelGenerator.Instance.TypeFactory.ClientPipelineApi.PipelinePolicyType, isInline: true, [.. perRetryPoliciesList]); + break; + } } body.Add(PipelineProperty.Assign(This.ToApi().Create(clientOptionsParameter, perRetryPolicies)).Terminate()); @@ -828,6 +955,37 @@ private MethodBodyStatement[] BuildPrimaryConstructorBody(IReadOnlyList + /// Builds the ValueExpression for the AuthenticationPolicy argument passed to the internal constructor initializer. + /// + private ValueExpression BuildAuthPolicyArgument(AuthFields? authFields, IReadOnlyList requiredParameters) + { + if (authFields is ApiKeyFields keyFields) + { + // ApiKeyAuthenticationPolicy.CreateHeaderApiKeyPolicy(credential, AuthorizationHeader, prefix?) + var credParam = requiredParameters.FirstOrDefault(p => p.Name == CredentialParamName); + if (credParam != null) + { + ValueExpression? keyPrefixExpression = keyFields.AuthorizationApiKeyPrefixField != null ? (ValueExpression)keyFields.AuthorizationApiKeyPrefixField : null; + return This.ToApi().KeyAuthorizationPolicy(credParam, keyFields.AuthorizationHeaderField, keyPrefixExpression); + } + } + else if (authFields is OAuth2Fields oauth2Fields) + { + // new BearerTokenPolicy(tokenProvider, AuthorizationScopes) + // The param name is derived from the field name: _tokenProvider → tokenProvider, _tokenCredential → credential + var credParam = requiredParameters.FirstOrDefault(p => + p.Name == TokenProviderFieldName.ToVariableName() || + p.Name == CredentialParamName); + if (credParam != null) + { + return This.ToApi().TokenAuthorizationPolicy(credParam, oauth2Fields.AuthorizationScopesField); + } + } + + return Null; + } + /// /// Builds the secondary constructor for the client. The secondary constructor contains all required parameters as arguments. /// @@ -1326,7 +1484,7 @@ [new MemberExpression(typeof(GetTokenOptions), nameof(GetTokenOptions.ScopesProp } return new FieldProvider( - FieldModifiers.Private | FieldModifiers.ReadOnly, + FieldModifiers.Private | FieldModifiers.Static | FieldModifiers.ReadOnly, typeof(Dictionary[]), TokenCredentialFlowsFieldName, this, diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ClientResultProvider.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ClientResultProvider.cs index 50c312cc161..ab246abdb3d 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ClientResultProvider.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ClientResultProvider.cs @@ -1,14 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -using System.ClientModel.Primitives; using System.ClientModel; +using System.ClientModel.Primitives; using Microsoft.TypeSpec.Generator.Expressions; using Microsoft.TypeSpec.Generator.Input; -using Microsoft.TypeSpec.Generator.Snippets; -using static Microsoft.TypeSpec.Generator.Snippets.Snippet; using Microsoft.TypeSpec.Generator.Primitives; using Microsoft.TypeSpec.Generator.Providers; +using Microsoft.TypeSpec.Generator.Snippets; +using static Microsoft.TypeSpec.Generator.Snippets.Snippet; namespace Microsoft.TypeSpec.Generator.ClientModel.Providers { diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ClientSettingsProvider.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ClientSettingsProvider.cs new file mode 100644 index 00000000000..046d9d0e9c6 --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ClientSettingsProvider.cs @@ -0,0 +1,384 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; +using System.IO; +using System.Linq; +using Microsoft.Extensions.Configuration; +using Microsoft.TypeSpec.Generator.Expressions; +using Microsoft.TypeSpec.Generator.Input; +using Microsoft.TypeSpec.Generator.Input.Extensions; +using Microsoft.TypeSpec.Generator.Primitives; +using Microsoft.TypeSpec.Generator.Providers; +using Microsoft.TypeSpec.Generator.Snippets; +using Microsoft.TypeSpec.Generator.Statements; +using static Microsoft.TypeSpec.Generator.Snippets.Snippet; + +namespace Microsoft.TypeSpec.Generator.ClientModel.Providers +{ + public class ClientSettingsProvider : TypeProvider + { + internal const string ClientSettingsDiagnosticId = "SCME0002"; + + private readonly ClientProvider _clientProvider; + +#pragma warning disable SCME0002 // ClientSettings is for evaluation purposes only + internal static readonly CSharpType ClientSettingsType = typeof(ClientSettings); +#pragma warning restore SCME0002 + + internal static readonly CSharpType IConfigurationSectionType = typeof(IConfigurationSection); + + internal ClientSettingsProvider(InputClient inputClient, ClientProvider clientProvider) + { + _clientProvider = clientProvider; + + var inputEndpointParam = inputClient.Parameters + .FirstOrDefault(p => p is InputEndpointParameter ep && ep.IsEndpoint) as InputEndpointParameter; + EndpointPropertyName = inputEndpointParam?.Name.ToIdentifierName(); + + // Collect non-endpoint, non-apiVersion required parameters (auth params come separately via InputClient.Auth) + OtherRequiredParams = inputClient.Parameters + .Where(p => p.IsRequired && !p.IsApiVersion && + !(p is InputEndpointParameter ep && ep.IsEndpoint)) + .Select(p => ScmCodeModelGenerator.Instance.TypeFactory.CreateParameter(p)) + .Where(p => p != null) + .Select(p => p!) + .ToList(); + } + + internal string? EndpointPropertyName { get; } + + /// Gets non-endpoint, non-auth required parameters that have settings properties. + internal IReadOnlyList OtherRequiredParams { get; } + + protected override FormattableString BuildDescription() + => $"Represents the settings used to configure a that can be loaded from an ."; + + protected override string BuildRelativeFilePath() => Path.Combine("src", "Generated", $"{Name}.cs"); + + protected override string BuildName() => $"{_clientProvider.Name}Settings"; + + protected override string BuildNamespace() => _clientProvider.Type.Namespace; + + protected override CSharpType BuildBaseType() => ClientSettingsType; + + protected override IReadOnlyList BuildAttributes() + { + return [new AttributeStatement(typeof(ExperimentalAttribute), Literal(ClientSettingsDiagnosticId))]; + } + + protected override PropertyProvider[] BuildProperties() + { + var properties = new List(); + + if (EndpointPropertyName != null) + { + properties.Add(new PropertyProvider( + null, + MethodSignatureModifiers.Public, + new CSharpType(typeof(Uri), isNullable: true), + EndpointPropertyName, + new AutoPropertyBody(true), + this)); + } + + foreach (var param in OtherRequiredParams) + { + properties.Add(new PropertyProvider( + null, + MethodSignatureModifiers.Public, + param.Type.WithNullable(true), + param.Name.ToIdentifierName(), + new AutoPropertyBody(true), + this)); + } + + if (_clientProvider.ClientOptions != null) + { + properties.Add(new PropertyProvider( + null, + MethodSignatureModifiers.Public, + _clientProvider.ClientOptions.Type.WithNullable(true), + "Options", + new AutoPropertyBody(true), + this)); + } + + return [.. properties]; + } + + protected override MethodProvider[] BuildMethods() + { + var sectionParam = new ParameterProvider("section", $"The configuration section.", IConfigurationSectionType); + var body = new List(); + + if (EndpointPropertyName != null) + { + AppendUriTryCreateBinding(body, sectionParam, EndpointPropertyName, EndpointPropertyName.ToVariableName()); + } + + foreach (var param in OtherRequiredParams) + { + var propName = param.Name.ToIdentifierName(); + AppendBindingForProperty(body, sectionParam, propName, param.Name.ToVariableName(), param.Type); + } + + if (_clientProvider.ClientOptions != null) + { + AppendComplexObjectBinding(body, sectionParam, "Options", "options", _clientProvider.ClientOptions.Type); + } + + var bindCoreMethod = new MethodProvider( + new MethodSignature( + "BindCore", + $"Binds configuration values from the given section.", + MethodSignatureModifiers.Protected | MethodSignatureModifiers.Override, + null, + null, + [sectionParam]), + new MethodBodyStatements([.. body]), + this); + + return [bindCoreMethod]; + } + + /// + /// Dispatches to the appropriate binding method based on the property type. + /// + internal static void AppendBindingForProperty( + List body, + ParameterProvider sectionParam, + string propName, + string varName, + CSharpType type) + { + // Handle non-framework types (enums, complex objects) + if (!type.IsFrameworkType) + { + if (type.IsEnum) + { + if (type.IsStruct) + { + AppendEnumBinding(body, sectionParam, propName, varName, type); + } + else + { + AppendFixedEnumBinding(body, sectionParam, propName, varName, type); + } + } + else + { + AppendComplexObjectBinding(body, sectionParam, propName, varName, type); + } + return; + } + + // Handle collection types (string[]/List) + if (type.IsList) + { + AppendStringListBinding(body, sectionParam, propName, varName, type); + return; + } + + var frameworkType = type.FrameworkType; + + if (frameworkType == typeof(string)) + { + AppendStringBinding(body, sectionParam, propName, varName); + } + else if (frameworkType == typeof(bool)) + { + AppendTryParseBinding(body, sectionParam, propName, varName, typeof(bool)); + } + else if (frameworkType == typeof(int)) + { + AppendTryParseBinding(body, sectionParam, propName, varName, typeof(int)); + } + else if (frameworkType == typeof(long)) + { + AppendTryParseBinding(body, sectionParam, propName, varName, typeof(long)); + } + else if (frameworkType == typeof(float)) + { + AppendTryParseBinding(body, sectionParam, propName, varName, typeof(float)); + } + else if (frameworkType == typeof(double)) + { + AppendTryParseBinding(body, sectionParam, propName, varName, typeof(double)); + } + else if (frameworkType == typeof(TimeSpan)) + { + AppendTryParseBinding(body, sectionParam, propName, varName, typeof(TimeSpan)); + } + else if (frameworkType == typeof(Uri)) + { + AppendUriTryCreateBinding(body, sectionParam, propName, varName); + } + else + { + AppendComplexObjectBinding(body, sectionParam, propName, varName, type); + } + } + + /// + /// Appends a string binding: string? val = section[name]; if (!string.IsNullOrEmpty(val)) PropName = val; + /// + internal static void AppendStringBinding( + List body, + ParameterProvider sectionParam, + string propName, + string varName) + { + body.Add(Declare(varName, new CSharpType(typeof(string), isNullable: true), new IndexerExpression(sectionParam, Literal(propName)), out var valVar)); + var ifStatement = new IfStatement(Not(StringSnippets.IsNullOrEmpty(valVar.As()))); + ifStatement.Add(This.Property(propName).Assign(valVar).Terminate()); + body.Add(ifStatement); + } + + /// + /// Appends a TryParse-based binding statement: if (Type.TryParse(section[name], out Type val)) PropName = val; + /// + internal static void AppendTryParseBinding( + List body, + ParameterProvider sectionParam, + string propName, + string varName, + Type parseType) + { + var outDecl = new DeclarationExpression(parseType, varName, out var parsedVar, isOut: true); + var ifStatement = new IfStatement(Static(parseType).Invoke("TryParse", + new ValueExpression[] + { + new IndexerExpression(sectionParam, Literal(propName)), + outDecl + })); + ifStatement.Add(This.Property(propName).Assign(parsedVar).Terminate()); + body.Add(ifStatement); + } + + /// + /// Appends a Uri.TryCreate binding: if (Uri.TryCreate(section[name], UriKind.Absolute, out Uri val)) PropName = val; + /// + internal static void AppendUriTryCreateBinding( + List body, + ParameterProvider sectionParam, + string propName, + string varName) + { + var outUriDecl = new DeclarationExpression(typeof(Uri), varName, out var uriVar, isOut: true); + var ifStatement = new IfStatement(Static(typeof(Uri)).Invoke("TryCreate", + new ValueExpression[] + { + new IndexerExpression(sectionParam, Literal(propName)), + new MemberExpression(typeof(UriKind), nameof(UriKind.Absolute)), + outUriDecl + })); + ifStatement.Add(This.Property(propName).Assign(uriVar).Terminate()); + body.Add(ifStatement); + } + + /// + /// Appends a string list binding: IConfigurationSection s = section.GetSection(name); + /// if (s.Exists()) { PropName = s.GetChildren().Where(c => c.Value is not null).Select(c => c.Value!).ToList(); } + /// + internal static void AppendStringListBinding( + List body, + ParameterProvider sectionParam, + string propName, + string varName, + CSharpType type) + { + // Only handle List for now + if (type.Arguments.Count == 0 || + !type.Arguments[0].IsFrameworkType || + type.Arguments[0].FrameworkType != typeof(string)) + { + return; + } + + // IConfigurationSection listSection = section.GetSection("PropName"); + body.Add(Declare((propName + "Section").ToVariableName(), IConfigurationSectionType, sectionParam.Invoke("GetSection", Literal(propName)), out var sectionVar)); + + // if (listSection.Exists()) + var ifExistsStatement = new IfStatement(sectionVar.Invoke("Exists")); + + // listSection.GetChildren().Where(c => c.Value is not null).Select(c => c.Value!).ToList() + var cWhereVar = new VariableExpression(IConfigurationSectionType, "c"); + var whereCondition = cWhereVar.Property("Value").IsNot(Null); + var whereLambda = new FuncExpression([cWhereVar.Declaration], whereCondition); + var whereResult = sectionVar.Invoke("GetChildren") + .Invoke("Where", [whereLambda], null, false, extensionType: typeof(Enumerable)); + + var cSelectVar = new VariableExpression(IConfigurationSectionType, "c"); + var selectBody = new UnaryOperatorExpression("!", cSelectVar.Property("Value"), true); + var selectLambda = new FuncExpression([cSelectVar.Declaration], selectBody); + var selectResult = whereResult + .Invoke("Select", [selectLambda], null, false, extensionType: typeof(Enumerable)); + + var toListResult = selectResult.ToList(); + + ifExistsStatement.Add(This.Property(propName).Assign(toListResult).Terminate()); + body.Add(ifExistsStatement); + } + + /// + /// Appends an extensible enum binding: if (section[name] is string val) { PropName = new TypeName(val); } + /// + internal static void AppendEnumBinding( + List body, + ParameterProvider sectionParam, + string propName, + string varName, + CSharpType type) + { + var decl = Declare(varName, new CSharpType(typeof(string)), out var declVar); + var ifStatement = new IfStatement(new IndexerExpression(sectionParam, Literal(propName)).Is(decl)); + ifStatement.Add(This.Property(propName).Assign(New.Instance(type, declVar)).Terminate()); + body.Add(ifStatement); + } + + /// + /// Appends a fixed enum binding: if (Enum.TryParse(section[name], out TypeName val)) { PropName = val; } + /// + internal static void AppendFixedEnumBinding( + List body, + ParameterProvider sectionParam, + string propName, + string varName, + CSharpType type) + { + var outDecl = new DeclarationExpression(type, varName, out var parsedVar, isOut: true); + var ifStatement = new IfStatement(Static(typeof(Enum)).Invoke("TryParse", + new ValueExpression[] + { + new IndexerExpression(sectionParam, Literal(propName)), + outDecl + })); + ifStatement.Add(This.Property(propName).Assign(parsedVar).Terminate()); + body.Add(ifStatement); + } + + /// + /// Appends a complex object binding: IConfigurationSection s = section.GetSection(name); + /// if (s.Exists()) { PropName = new TypeName(s); } + /// + internal static void AppendComplexObjectBinding( + List body, + ParameterProvider sectionParam, + string propName, + string varName, + CSharpType type) + { + // IConfigurationSection {name}Section = section.GetSection("PropName"); + body.Add(Declare((propName + "Section").ToVariableName(), IConfigurationSectionType, sectionParam.Invoke("GetSection", Literal(propName)), out var sectionVar)); + + // if ({name}Section.Exists()) { PropName = new TypeName({name}Section); } + var ifExistsStatement = new IfStatement(sectionVar.Invoke("Exists")); + ifExistsStatement.Add(This.Property(propName).Assign(New.Instance(type, sectionVar)).Terminate()); + body.Add(ifExistsStatement); + } + } +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/CollectionResultDefinition.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/CollectionResultDefinition.cs index d704c3eec74..b85fc44c6a9 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/CollectionResultDefinition.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/CollectionResultDefinition.cs @@ -531,7 +531,7 @@ private ScopedApi InvokeCreateRequestForNextLink(ValueExpressio Client.RestClient.GetCreateNextLinkRequestMethod(Operation).Signature.Name; return ClientField.Invoke( createNextLinkRequestMethodName, - [nextPageUri, ..RequestFields]) + [nextPageUri, .. RequestFields]) .As(); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/PipelineMessageClassifierProvider.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/PipelineMessageClassifierProvider.cs index 9e42f218ff4..32b550c2384 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/PipelineMessageClassifierProvider.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/PipelineMessageClassifierProvider.cs @@ -1,12 +1,12 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -using Microsoft.TypeSpec.Generator.Expressions; -using static Microsoft.TypeSpec.Generator.Snippets.Snippet; using System.ClientModel.Primitives; -using Microsoft.TypeSpec.Generator.Primitives; using System.Collections.Generic; using System.Linq; +using Microsoft.TypeSpec.Generator.Expressions; +using Microsoft.TypeSpec.Generator.Primitives; +using static Microsoft.TypeSpec.Generator.Snippets.Snippet; namespace Microsoft.TypeSpec.Generator.ClientModel.Providers { diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/PipelineRequestProvider.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/PipelineRequestProvider.cs index e3d0819ba31..63c100116e0 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/PipelineRequestProvider.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/PipelineRequestProvider.cs @@ -1,11 +1,11 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. +using System; using System.ClientModel.Primitives; using System.Collections.Generic; using Microsoft.TypeSpec.Generator.Expressions; using Microsoft.TypeSpec.Generator.Statements; -using System; namespace Microsoft.TypeSpec.Generator.ClientModel.Providers { diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ScmMethodProvider.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ScmMethodProvider.cs index fc4847b10e6..9bc034f8378 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ScmMethodProvider.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ScmMethodProvider.cs @@ -1,11 +1,11 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. +using Microsoft.TypeSpec.Generator.ClientModel.Primitives; using Microsoft.TypeSpec.Generator.Input; using Microsoft.TypeSpec.Generator.Primitives; using Microsoft.TypeSpec.Generator.Providers; using Microsoft.TypeSpec.Generator.Statements; -using Microsoft.TypeSpec.Generator.ClientModel.Primitives; namespace Microsoft.TypeSpec.Generator.ClientModel.Providers { diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ScmMethodProviderCollection.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ScmMethodProviderCollection.cs index 6879f6c7b7f..9b8fb7433dc 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ScmMethodProviderCollection.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ScmMethodProviderCollection.cs @@ -698,13 +698,13 @@ private IReadOnlyList GetProtocolMethodArguments(Dictionary 1 } && nonBodyProperties?.ContainsKey(protocolParam.Name) != true) { // The MethodParameterSegments represents a path (e.g., ['Params', 'foo'] means params.foo) - var rootParameterName = protocolParam.InputParameter.MethodParameterSegments[0].Name; - if (!convenienceParamsMap.TryGetValue(rootParameterName, out var convenienceParam) || - // Body parameters are handled separately - convenienceParam.Location == ParameterLocation.Body) - { - continue; - } + var rootParameterName = protocolParam.InputParameter.MethodParameterSegments[0].Name; + if (!convenienceParamsMap.TryGetValue(rootParameterName, out var convenienceParam) || + // Body parameters are handled separately + convenienceParam.Location == ParameterLocation.Body) + { + continue; + } // Navigate through the property path var propertySegments = protocolParam.InputParameter.MethodParameterSegments diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/SerializationFormatDefinition.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/SerializationFormatDefinition.cs index 79e0987acf6..13233bee220 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/SerializationFormatDefinition.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/SerializationFormatDefinition.cs @@ -73,7 +73,7 @@ protected override IReadOnlyList BuildEnumValues() var members = new EnumTypeMember[enumValues.Count]; for (int i = 0; i < enumValues.Count; i++) { - var (name, value, description ) = enumValues[i]; + var (name, value, description) = enumValues[i]; var field = new FieldProvider( FieldModifiers.Public | FieldModifiers.Static, EnumUnderlyingType, diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/ScmOutputLibrary.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/ScmOutputLibrary.cs index 432561572ba..fc1d9cd87df 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/ScmOutputLibrary.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/ScmOutputLibrary.cs @@ -41,6 +41,11 @@ private static void BuildClient(InputClient inputClient, HashSet t if (clientOptions != null) { types.Add(clientOptions); + var clientSettings = client.ClientSettings; + if (clientSettings != null) + { + types.Add(clientSettings); + } } // We use the spec view methods so that we include collection definitions even if the user is customizing or suppressing diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Snippets/JsonElementSnippets.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Snippets/JsonElementSnippets.cs index f9951bc523d..f320ef94429 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Snippets/JsonElementSnippets.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Snippets/JsonElementSnippets.cs @@ -105,7 +105,7 @@ public static ScopedApi TryGetInt64(this ScopedApi jsonElemen public static ScopedApi TryGetSingle(this ScopedApi jsonElement, out ScopedApi floatValue) { var floatValueDeclaration = new VariableExpression(typeof(float), "floatValue"); - floatValue= floatValueDeclaration.As(); + floatValue = floatValueDeclaration.As(); var invocation = new InvokeMethodExpression(jsonElement, nameof(JsonElement.TryGetSingle), [new DeclarationExpression(floatValueDeclaration, true)]); return invocation.As(); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/ModelReaderWriterValidation/TestProjects/Sample_TypeSpec/TreeXmlTests.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/ModelReaderWriterValidation/TestProjects/Sample_TypeSpec/TreeXmlTests.cs index 34024d47cc2..d9ac35840d3 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/ModelReaderWriterValidation/TestProjects/Sample_TypeSpec/TreeXmlTests.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/ModelReaderWriterValidation/TestProjects/Sample_TypeSpec/TreeXmlTests.cs @@ -89,8 +89,8 @@ public void ToBinaryContent_WithJsonFormat_ProducesJsonPayload() var binaryContent = (BinaryContent)method!.Invoke(tree, new object[] { "J" })!; // Verify the MediaType is set correctly for JSON - Assert.That(binaryContent.MediaType, - Is.EqualTo("application/json"), + Assert.That(binaryContent.MediaType, + Is.EqualTo("application/json"), "MediaType should be application/json for format 'J'"); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/Abstractions/RequestContentApiTests.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/Abstractions/RequestContentApiTests.cs index 49dd83bbb03..c0cf268aa1a 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/Abstractions/RequestContentApiTests.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/Abstractions/RequestContentApiTests.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. using System.ClientModel; diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientOptionsProviderTests.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientOptionsProviderTests.cs index 5f5abcd8410..2fe18535d4e 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientOptionsProviderTests.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientOptionsProviderTests.cs @@ -137,21 +137,67 @@ public void TestConstructors(bool containsApiVersions) Assert.IsNotNull(clientOptionsProvider); var ctors = clientOptionsProvider.Constructors; + // IConfigurationSection constructor is always generated + var configSectionCtor = ctors.FirstOrDefault(c => c.Signature.Parameters.Any(p => p.Name == "section")); + Assert.IsNotNull(configSectionCtor, "IConfigurationSection constructor should always be generated"); + if (containsApiVersions) { - Assert.AreEqual(1, ctors.Count); - var ctor = ctors[0]; - var signature = ctor.Signature; + Assert.AreEqual(2, ctors.Count); + var versionCtor = ctors.First(c => c.Signature.Parameters.Any(p => p.Name == "version")); + var signature = versionCtor.Signature; Assert.AreEqual(1, signature.Parameters.Count); var versionParam = signature.Parameters[0]; Assert.AreEqual("version", versionParam.Name); Assert.AreEqual(clientOptionsProvider.NestedTypes[0].Type, versionParam.Type); Assert.IsNotNull(versionParam.DefaultValue); - Assert.IsNotNull(ctor.BodyStatements); + Assert.IsNotNull(versionCtor.BodyStatements); } else { - Assert.AreEqual(0, ctors.Count); + Assert.AreEqual(2, ctors.Count); + var defaultCtor = ctors.First(c => !c.Signature.Parameters.Any()); + Assert.IsNotNull(defaultCtor, "Default parameterless constructor should be generated"); + } + } + + [TestCase(true, Category = ApiVersionsCategory)] + [TestCase(false)] + public void TestConfigurationSectionConstructorBody(bool containsApiVersions) + { + var client = InputFactory.Client("TestClient"); + var clientProvider = new ClientProvider(client); + var clientOptionsProvider = new ClientOptionsProvider(client, clientProvider); + + var ctors = clientOptionsProvider.Constructors; + var configSectionCtor = ctors.FirstOrDefault(c => c.Signature.Parameters.Any(p => p.Name == "section")); + Assert.IsNotNull(configSectionCtor); + + // Validate it's internal + Assert.AreEqual(MethodSignatureModifiers.Internal, configSectionCtor!.Signature.Modifiers); + + // Validate it has the base(section) initializer + Assert.IsNotNull(configSectionCtor.Signature.Initializer); + Assert.IsTrue(configSectionCtor.Signature.Initializer!.IsBase); + + // Validate the body is not empty + var body = configSectionCtor.BodyStatements; + Assert.IsNotNull(body); + + var bodyString = body!.ToDisplayString(); + + // Always has a guard statement + Assert.IsTrue(bodyString.Contains("section is null") || bodyString.Contains("Exists"), + "Configuration section constructor should have a guard statement"); + + if (containsApiVersions) + { + // When API versions exist, Version should be set to latest before guard + Assert.IsTrue(bodyString.Contains("Version ="), + "Configuration constructor should set Version when API versions exist"); + // After guard, should read version from config + Assert.IsTrue(bodyString.Contains("section[\"Version\"]"), + "Configuration constructor should read Version from config section"); } } @@ -330,7 +376,7 @@ await MockHelpers.LoadMockGeneratorAsync( var body = constructor?.BodyStatements?.ToDisplayString(); Assert.IsNotNull(body); - + // Verify the switch statement contains custom enum members with their correct string values Assert.IsTrue(body?.Contains("ServiceVersion.V2023_10_01_Preview_1 => \"2023-10-01-preview-1\"")); Assert.IsTrue(body?.Contains("ServiceVersion.V2023_11_01 => \"2023-11-01\"")); @@ -368,17 +414,17 @@ public void SingletonCreatedForMultipleClientsWithStandardParameters() public void SingleClientCreatesClientSpecificOptions() { var client = InputFactory.Client("TestClient", clientNamespace: "TestNamespace"); - + MockHelpers.LoadMockGenerator(clients: () => [client]); var clientProvider = ScmCodeModelGenerator.Instance.TypeFactory.CreateClient(client); Assert.IsNotNull(clientProvider); - + var options = clientProvider!.ClientOptions; Assert.IsNotNull(options); - + // The name should be based on the client name Assert.AreEqual("TestClientOptions", options!.Name); } @@ -666,5 +712,215 @@ public void MultiServiceCombinedClient_WithThreeServices_GeneratesExpectedClient Assert.AreEqual(Helpers.GetExpectedFromFile(), file.Content); } + + [Test] + public void TestConfigurationSectionConstructorBody_WithBoolProperty() + { + var boolParam = InputFactory.MethodParameter( + "enableRetry", + InputPrimitiveType.Boolean, + isRequired: false, + defaultValue: new InputConstant(true, InputPrimitiveType.Boolean), + scope: InputParameterScope.Client); + + var client = InputFactory.Client("TestClient", parameters: [boolParam]); + + MockHelpers.LoadMockGenerator(clients: () => [client]); + + var clientProvider = ScmCodeModelGenerator.Instance.TypeFactory.CreateClient(client); + var clientOptionsProvider = clientProvider!.ClientOptions; + + Assert.IsNotNull(clientOptionsProvider); + + var configSectionCtor = clientOptionsProvider!.Constructors + .FirstOrDefault(c => c.Signature.Parameters.Any(p => p.Name == "section")); + Assert.IsNotNull(configSectionCtor); + + var bodyString = configSectionCtor!.BodyStatements!.ToDisplayString(); + Assert.IsTrue(bodyString.Contains("bool.TryParse"), + "IConfigurationSection constructor should use bool.TryParse for bool property binding"); + Assert.IsTrue(bodyString.Contains("EnableRetry"), + "IConfigurationSection constructor should assign to EnableRetry property"); + } + + [Test] + public void TestConfigurationSectionConstructorBody_WithIntProperty() + { + var intParam = InputFactory.MethodParameter( + "maxRetries", + InputPrimitiveType.Int32, + isRequired: false, + defaultValue: new InputConstant(3, InputPrimitiveType.Int32), + scope: InputParameterScope.Client); + + var client = InputFactory.Client("TestClient", parameters: [intParam]); + + MockHelpers.LoadMockGenerator(clients: () => [client]); + + var clientProvider = ScmCodeModelGenerator.Instance.TypeFactory.CreateClient(client); + var clientOptionsProvider = clientProvider!.ClientOptions; + + Assert.IsNotNull(clientOptionsProvider); + + var configSectionCtor = clientOptionsProvider!.Constructors + .FirstOrDefault(c => c.Signature.Parameters.Any(p => p.Name == "section")); + Assert.IsNotNull(configSectionCtor); + + var bodyString = configSectionCtor!.BodyStatements!.ToDisplayString(); + Assert.IsTrue(bodyString.Contains("int.TryParse"), + "IConfigurationSection constructor should use int.TryParse for int property binding"); + Assert.IsTrue(bodyString.Contains("MaxRetries"), + "IConfigurationSection constructor should assign to MaxRetries property"); + } + + [Test] + public void TestConfigurationSectionConstructorBody_WithEnumProperty() + { + var enumType = InputFactory.StringEnum( + "AppAudience", + [("Public", "public"), ("Private", "private")], + isExtensible: true); + + var enumParam = InputFactory.MethodParameter( + "audience", + enumType, + isRequired: false, + defaultValue: new InputConstant("public", enumType), + scope: InputParameterScope.Client); + + var client = InputFactory.Client("TestClient", parameters: [enumParam]); + + MockHelpers.LoadMockGenerator( + clients: () => [client], + inputEnums: () => [enumType]); + + var clientProvider = ScmCodeModelGenerator.Instance.TypeFactory.CreateClient(client); + var clientOptionsProvider = clientProvider!.ClientOptions; + + Assert.IsNotNull(clientOptionsProvider); + + var configSectionCtor = clientOptionsProvider!.Constructors + .FirstOrDefault(c => c.Signature.Parameters.Any(p => p.Name == "section")); + Assert.IsNotNull(configSectionCtor); + + var bodyString = configSectionCtor!.BodyStatements!.ToDisplayString(); + Assert.IsTrue(bodyString.Contains("is string"), + "IConfigurationSection constructor should use 'is string' pattern for extensible enum property binding"); + Assert.IsTrue(bodyString.Contains("new"), + "IConfigurationSection constructor should create new enum instance"); + Assert.IsTrue(bodyString.Contains("Audience"), + "IConfigurationSection constructor should assign to Audience property"); + } + + [Test] + public void TestConfigurationSectionConstructorBody_WithStringProperty() + { + var stringParam = InputFactory.MethodParameter( + "tenantId", + InputPrimitiveType.String, + isRequired: false, + defaultValue: InputFactory.Constant.String("default"), + scope: InputParameterScope.Client); + + var client = InputFactory.Client("TestClient", parameters: [stringParam]); + + MockHelpers.LoadMockGenerator(clients: () => [client]); + + var clientProvider = ScmCodeModelGenerator.Instance.TypeFactory.CreateClient(client); + var clientOptionsProvider = clientProvider!.ClientOptions; + + Assert.IsNotNull(clientOptionsProvider); + + var configSectionCtor = clientOptionsProvider!.Constructors + .FirstOrDefault(c => c.Signature.Parameters.Any(p => p.Name == "section")); + Assert.IsNotNull(configSectionCtor); + + var bodyString = configSectionCtor!.BodyStatements!.ToDisplayString(); + Assert.IsTrue(bodyString.Contains("IsNullOrEmpty"), + "IConfigurationSection constructor should use string.IsNullOrEmpty for string property binding"); + Assert.IsTrue(bodyString.Contains("TenantId"), + "IConfigurationSection constructor should assign to TenantId property"); + } + + [Test] + public void TestConfigurationSectionConstructorBody_WithComplexObjectProperty() + { + var complexModel = InputFactory.Model( + "CustomOptions", + properties: new[] + { + InputFactory.Property("setting1", InputPrimitiveType.String, isRequired: true, wireName: "setting1"), + InputFactory.Property("setting2", InputPrimitiveType.Int32, isRequired: false, wireName: "setting2") + }); + + var complexParam = InputFactory.MethodParameter( + "customOptions", + complexModel, + isRequired: false, + defaultValue: new InputConstant(null, complexModel), + scope: InputParameterScope.Client); + + var client = InputFactory.Client("TestClient", parameters: [complexParam]); + + MockHelpers.LoadMockGenerator( + clients: () => [client], + inputModels: () => [complexModel]); + + var clientProvider = ScmCodeModelGenerator.Instance.TypeFactory.CreateClient(client); + var clientOptionsProvider = clientProvider!.ClientOptions; + + Assert.IsNotNull(clientOptionsProvider); + + var configSectionCtor = clientOptionsProvider!.Constructors + .FirstOrDefault(c => c.Signature.Parameters.Any(p => p.Name == "section")); + Assert.IsNotNull(configSectionCtor); + + var bodyString = configSectionCtor!.BodyStatements!.ToDisplayString(); + Assert.IsTrue(bodyString.Contains("GetSection"), + "IConfigurationSection constructor should use GetSection for complex object property binding"); + Assert.IsTrue(bodyString.Contains("Exists"), + "IConfigurationSection constructor should check Exists for complex object property binding"); + Assert.IsTrue(bodyString.Contains("CustomOptions") && bodyString.Contains("new"), + "IConfigurationSection constructor should create new CustomOptions instance for complex object property binding"); + } + + [Test] + public void TestConfigurationSectionConstructorBody_WithFixedEnumProperty() + { + var enumType = InputFactory.StringEnum( + "ClientMode", + [("Default", "default"), ("MultiClient", "multi-client")], + isExtensible: false); + + var enumParam = InputFactory.MethodParameter( + "mode", + enumType, + isRequired: false, + defaultValue: new InputConstant("default", enumType), + scope: InputParameterScope.Client); + + var client = InputFactory.Client("TestClient", parameters: [enumParam]); + + MockHelpers.LoadMockGenerator( + clients: () => [client], + inputEnums: () => [enumType]); + + var clientProvider = ScmCodeModelGenerator.Instance.TypeFactory.CreateClient(client); + var clientOptionsProvider = clientProvider!.ClientOptions; + + Assert.IsNotNull(clientOptionsProvider); + + var configSectionCtor = clientOptionsProvider!.Constructors + .FirstOrDefault(c => c.Signature.Parameters.Any(p => p.Name == "section")); + Assert.IsNotNull(configSectionCtor); + + var bodyString = configSectionCtor!.BodyStatements!.ToDisplayString(); + Assert.IsTrue(bodyString.Contains("Enum.TryParse"), + "IConfigurationSection constructor should use Enum.TryParse for fixed enum property binding"); + Assert.IsTrue(bodyString.Contains("Mode"), + "IConfigurationSection constructor should assign to Mode property"); + Assert.IsFalse(bodyString.Contains("new ClientMode"), + "IConfigurationSection constructor should NOT use new for fixed enum property binding"); + } } } 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 985ecf3b6a2..f90957cdb1e 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 @@ -160,31 +160,34 @@ public void TestBuildAuthFields_WithAuth(List inputParameters) if (_hasKeyAuth) { - // key auth should have the following fields: AuthorizationHeader, _keyCredential + // key auth should have the AuthorizationHeader const field; _keyCredential is no longer stored AssertHasFields(clientProvider, new List { new(FieldModifiers.Private | FieldModifiers.Const, new CSharpType(typeof(string)), "AuthorizationHeader"), - new(FieldModifiers.Private | FieldModifiers.ReadOnly, new CSharpType(typeof(ApiKeyCredential)), "_keyCredential") }); + // _keyCredential field is no longer on the client (auth handled via AuthenticationPolicy parameter) + Assert.IsFalse(clientProvider.Fields.Any(f => f.Name == "_keyCredential")); } if (_hasOAuth2) { - // oauth2 auth should have the following fields: _flows, _tokenProvider + // oauth2 auth should have the _flows field; _tokenProvider is no longer stored AssertHasFields(clientProvider, new List { - new(FieldModifiers.Private | FieldModifiers.ReadOnly, new CSharpType(typeof(Dictionary[])), "_flows"), - new(FieldModifiers.Private | FieldModifiers.ReadOnly, new CSharpType(typeof(AuthenticationTokenProvider)), "_tokenProvider"), + new(FieldModifiers.Private | FieldModifiers.Static | FieldModifiers.ReadOnly, new CSharpType(typeof(Dictionary[])), "_flows"), }); + // _tokenProvider field is no longer on the client (auth handled via AuthenticationPolicy parameter) + Assert.IsFalse(clientProvider.Fields.Any(f => f.Name == "_tokenProvider")); } if (_hasOAuth2WithOtherCredType) { - // if another cred type other than the SCM type is used, then the client should default to the following fields: _scopes, _tokenCredential + // if another cred type other than the SCM type is used, then the client should default to the following fields: _scopes (no _tokenCredential) AssertHasFields(clientProvider, new List { new(FieldModifiers.Private | FieldModifiers.Static | FieldModifiers.ReadOnly, new CSharpType(typeof(string[])), "AuthorizationScopes"), - new(FieldModifiers.Private | FieldModifiers.ReadOnly, new CSharpType(typeof(FakeTokenCredential)), "_tokenCredential"), }); + // _tokenCredential field is no longer on the client (auth handled via AuthenticationPolicy parameter) + Assert.IsFalse(clientProvider.Fields.Any(f => f.Name == "_tokenCredential")); } if (_hasOnlyUnsupportedAuth) @@ -206,12 +209,12 @@ public void TestBuildOAuth2FlowsField(IEnumerable inputFlows) Assert.IsNotNull(clientProvider); - // oauth2 auth should have the following fields: _flows, _tokenProvider + // oauth2 auth should have the _flows field; _tokenProvider is no longer stored on the client AssertHasFields(clientProvider, new List { - new(FieldModifiers.Private | FieldModifiers.ReadOnly, new CSharpType(typeof(AuthenticationTokenProvider)), "_tokenProvider"), - new(FieldModifiers.Private | FieldModifiers.ReadOnly, new CSharpType(typeof(Dictionary[])), "_flows"), + new(FieldModifiers.Private | FieldModifiers.Static | FieldModifiers.ReadOnly, new CSharpType(typeof(Dictionary[])), "_flows"), }); + Assert.IsFalse(clientProvider.Fields.Any(f => f.Name == "_tokenProvider"), "_tokenProvider should not be present - auth handled via AuthenticationPolicy parameter"); // validate the field initialization var testName = TestContext.CurrentContext.Test.Name; @@ -298,29 +301,29 @@ public void TestBuildAuthFields_WithSubClients_WithAuth(InputClient client) if (_hasKeyAuth) { - // key auth should have the following fields: AuthorizationHeader, _keyCredential + // key auth should have AuthorizationHeader const field; _keyCredential is no longer stored AssertHasFields(clientProvider, new List { new(FieldModifiers.Private | FieldModifiers.Const, new CSharpType(typeof(string)), "AuthorizationHeader"), - new(FieldModifiers.Private | FieldModifiers.ReadOnly, new CSharpType(typeof(ApiKeyCredential)), "_keyCredential") }); + Assert.IsFalse(clientProvider.Fields.Any(f => f.Name == "_keyCredential")); } if (_hasOAuth2) { - // oauth2 auth should have the following fields: _flows, _tokenProvider + // oauth2 auth should have _flows field; _tokenProvider is no longer stored AssertHasFields(clientProvider, new List { - new(FieldModifiers.Private | FieldModifiers.ReadOnly, new CSharpType(typeof(Dictionary[])), "_flows"), - new(FieldModifiers.Private | FieldModifiers.ReadOnly, new CSharpType(typeof(AuthenticationTokenProvider)), "_tokenProvider"), + new(FieldModifiers.Private | FieldModifiers.Static | FieldModifiers.ReadOnly, new CSharpType(typeof(Dictionary[])), "_flows"), }); + Assert.IsFalse(clientProvider.Fields.Any(f => f.Name == "_tokenProvider")); } if (_hasOAuth2WithOtherCredType) { AssertHasFields(clientProvider, new List { new(FieldModifiers.Private | FieldModifiers.Static | FieldModifiers.ReadOnly, new CSharpType(typeof(string[])), "AuthorizationScopes"), - new(FieldModifiers.Private | FieldModifiers.ReadOnly, new CSharpType(typeof(FakeTokenCredential)), "_tokenCredential"), }); + Assert.IsFalse(clientProvider.Fields.Any(f => f.Name == "_tokenCredential")); } } @@ -366,26 +369,18 @@ public void TestBuildConstructors_PrimaryConstructor(List inputP var constructors = clientProvider.Constructors; - var primaryPublicConstructors = constructors.Where( - c => c.Signature?.Initializer == null && c.Signature?.Modifiers == MethodSignatureModifiers.Public).ToArray(); + // The implementation constructors are now INTERNAL (taking AuthenticationPolicy? as first param) + var implementationConstructors = constructors.Where( + c => c.Signature?.Initializer == null && c.Signature?.Modifiers == MethodSignatureModifiers.Internal).ToArray(); - // for no auth or one auth case, this should be 1 - // for both auth case, this should be 2 - // for only unsupported auth case, this should be 0 - int expectedPrimaryCtorCount; - if (_hasOnlyUnsupportedAuth) - { - expectedPrimaryCtorCount = 0; - } - else - { - expectedPrimaryCtorCount = _hasKeyAuth && _hasOAuth2 ? 2 : 1; - } - Assert.AreEqual(expectedPrimaryCtorCount, primaryPublicConstructors.Length); + // There is always exactly 1 internal implementation constructor, regardless of auth type count. + // All public credential constructors are pass-throughs to this single implementation constructor. + int expectedImplCtorCount = 1; + Assert.AreEqual(expectedImplCtorCount, implementationConstructors.Length); - for (int i = 0; i < primaryPublicConstructors.Length; i++) + for (int i = 0; i < implementationConstructors.Length; i++) { - ValidatePrimaryConstructor(primaryPublicConstructors[i], inputParameters, i); + ValidatePrimaryConstructor(implementationConstructors[i], inputParameters, i); } } @@ -404,10 +399,14 @@ public void TestBuildConstructors_SecondaryConstructor(List inpu var constructors = clientProvider.Constructors; - var primaryPublicConstructors = constructors.Where( - c => c.Signature?.Initializer == null && c.Signature?.Modifiers == MethodSignatureModifiers.Public).ToArray(); + var implementationConstructors = constructors.Where( + c => c.Signature?.Initializer == null && c.Signature?.Modifiers == MethodSignatureModifiers.Internal).ToArray(); var secondaryPublicConstructors = constructors.Where( - c => c.Signature?.Initializer != null && c.Signature?.Modifiers == MethodSignatureModifiers.Public).ToArray(); + c => c.Signature?.Initializer != null && + c.Signature?.Modifiers == MethodSignatureModifiers.Public && + !IsSettingsConstructor(c) && + !IsPrimaryPassThroughConstructor(c)).ToArray(); + var primaryPassThroughConstructors = constructors.Where(IsPrimaryPassThroughConstructor).ToArray(); // Check if endpoint has a default value var endpointParam = inputParameters.FirstOrDefault(p => p is InputEndpointParameter ep && ep.IsEndpoint); @@ -447,7 +446,7 @@ public void TestBuildConstructors_SecondaryConstructor(List inpu Assert.AreEqual(expectedSecondaryCtorCount, secondaryPublicConstructors.Length); foreach (var secondaryPublicConstructor in secondaryPublicConstructors) { - ValidateSecondaryConstructor(primaryPublicConstructors, secondaryPublicConstructor, inputParameters); + ValidateSecondaryConstructor(primaryPassThroughConstructors, secondaryPublicConstructor, inputParameters); } } @@ -543,15 +542,22 @@ public void TestBuildConstructors_SimplifiedWithOptions_WhenDefaultEndpoint() var constructors = clientProvider.Constructors; - // Get all public constructors with an initializer (secondary constructors) + // Get secondary constructors (not primary pass-through, not settings constructor) var secondaryPublicConstructors = constructors.Where( - c => c.Signature?.Initializer != null && c.Signature?.Modifiers == MethodSignatureModifiers.Public).ToList(); + c => c.Signature?.Initializer != null && + c.Signature?.Modifiers == MethodSignatureModifiers.Public && + !IsSettingsConstructor(c) && + !IsPrimaryPassThroughConstructor(c)).ToList(); // We should have 2 secondary constructors per auth type: // 1. Client(credential) - simple with just auth // 2. Client(credential, options) - simplified with auth + options Assert.AreEqual(2, secondaryPublicConstructors.Count); + // Verify the settings constructor also exists + var settingsConstructor = constructors.FirstOrDefault(IsSettingsConstructor); + Assert.IsNotNull(settingsConstructor, "Expected a settings constructor"); + // Verify the simple constructor exists (just auth) var simpleConstructor = secondaryPublicConstructors.FirstOrDefault(c => c.Signature.Parameters.Count == 1); Assert.IsNotNull(simpleConstructor, "Expected a simple constructor with just auth parameter"); @@ -582,6 +588,58 @@ public void TestBuildConstructors_SimplifiedWithOptions_WhenDefaultEndpoint() Assert.IsFalse(optionsArg is NewInstanceExpression, "Options argument should be the parameter itself, not a new instance"); } + [TestCase(Category = KeyAuthCategory)] + [TestCase(Category = OAuth2Category)] + public void TestBuildConstructors_SettingsConstructor() + { + var inputParameters = new List + { + InputFactory.EndpointParameter( + KnownParameters.Endpoint.Name, + InputPrimitiveType.String, + defaultValue: InputFactory.Constant.String("https://default.endpoint.io"), + scope: InputParameterScope.Client, + isEndpoint: true) + }; + var client = InputFactory.Client(TestClientName, parameters: [.. inputParameters]); + var clientProvider = new ClientProvider(client); + + Assert.IsNotNull(clientProvider); + + var constructors = clientProvider.Constructors; + var settingsConstructor = constructors.FirstOrDefault(IsSettingsConstructor); + Assert.IsNotNull(settingsConstructor, "Expected a settings constructor"); + + // Validate it's public + Assert.AreEqual(MethodSignatureModifiers.Public, settingsConstructor!.Signature.Modifiers); + + // Validate it has exactly 1 parameter: settings + Assert.AreEqual(1, settingsConstructor.Signature.Parameters.Count); + Assert.AreEqual("settings", settingsConstructor.Signature.Parameters[0].Name); + + // Validate it's a pass-through (body is empty) + Assert.AreEqual(MethodBodyStatement.Empty, settingsConstructor.BodyStatements); + + // Validate it has a this(...) initializer + var initializer = settingsConstructor.Signature.Initializer; + Assert.IsNotNull(initializer); + Assert.IsFalse(initializer!.IsBase, "Settings constructor should use this() initializer, not base()"); + } + + [Test] + public void TestBuildConstructors_NoSettingsConstructor_WhenNoEndpoint() + { + // No endpoint parameter — settings constructor should not be generated + var client = InputFactory.Client(TestClientName); + var clientProvider = new ClientProvider(client); + + Assert.IsNotNull(clientProvider); + + var constructors = clientProvider.Constructors; + var settingsConstructor = constructors.FirstOrDefault(IsSettingsConstructor); + Assert.IsNull(settingsConstructor, "Settings constructor should not be generated when there is no endpoint"); + } + [Test] public void TestBuildConstructors_DeduplicatesParametersBySerializedName() { @@ -1017,15 +1075,18 @@ private void ValidatePrimaryConstructor( [CallerFilePath] string filePath = "") { var primaryCtorParams = primaryPublicConstructor?.Signature?.Parameters; - // in no auth case, the ctor only have two parameters: endpoint and options - // in other cases, the ctor should have three parameters: endpoint, credential, options - // specifically, in both auth cases, we should have two ctors corresponding to each credential type as the second parameter - var expectedPrimaryCtorParamCount = !_hasKeyAuth && !_hasOAuth2 ? 2 : 3; + // The internal implementation constructor always has 3 parameters: authenticationPolicy, endpoint, options + var expectedPrimaryCtorParamCount = 3; Assert.AreEqual(expectedPrimaryCtorParamCount, primaryCtorParams?.Count); - // the first should be endpoint - var endpointParam = primaryCtorParams?[0]; + // the first should be authenticationPolicy (AuthenticationPolicy?) + var authPolicyParam = primaryCtorParams?[0]; + Assert.AreEqual("authenticationPolicy", authPolicyParam?.Name); + Assert.IsTrue(authPolicyParam?.Type.Equals(new CSharpType(typeof(AuthenticationPolicy), isNullable: true))); + + // the second should be endpoint + var endpointParam = primaryCtorParams?[1]; Assert.AreEqual(KnownParameters.Endpoint.Name, endpointParam?.Name); if (endpointParam?.DefaultValue != null) @@ -1040,25 +1101,6 @@ private void ValidatePrimaryConstructor( var optionsParam = primaryCtorParams?[^1]; Assert.AreEqual("options", optionsParam?.Name); - if (_hasSupportedAuth) - { - // when there is any auth, the second should be auth parameter - var authParam = primaryCtorParams?[1]; - Assert.IsNotNull(authParam); - if (authParam?.Type.Equals(typeof(ApiKeyCredential)) == true) - { - Assert.AreEqual("credential", authParam.Name); - } - else if (authParam?.Type.Equals(typeof(AuthenticationTokenProvider)) == true) - { - Assert.AreEqual("tokenProvider", authParam.Name); - } - else - { - Assert.Fail("Unexpected auth parameter"); - } - } - // validate the body of the primary ctor var caseName = TestContext.CurrentContext.Test.Properties.Get("caseName"); var expected = Helpers.GetExpectedFromFile($"{caseName},{_hasKeyAuth},{_hasOAuth2},{ctorIndex}", method, filePath); @@ -1130,6 +1172,23 @@ private void ValidateSecondaryConstructor( Assert.IsTrue(primaryConstructors.Any(pc => pc.Signature.Parameters.Count == initializer?.Arguments.Count)); } + private static bool IsSettingsConstructor(ConstructorProvider c) => + c.Signature?.Initializer != null && + c.Signature?.Modifiers == MethodSignatureModifiers.Public && + c.Signature.Parameters.Any(p => p.Name == "settings"); + + /// + /// Identifies the public primary pass-through constructor (calls the internal implementation constructor). + /// It is the public constructor that has both an endpoint parameter AND an options parameter. + /// Secondary constructors never have both endpoint and options (they have a subset). + /// + private static bool IsPrimaryPassThroughConstructor(ConstructorProvider c) => + c.Signature?.Initializer != null && + c.Signature?.Modifiers == MethodSignatureModifiers.Public && + !IsSettingsConstructor(c) && + c.Signature.Parameters.Any(p => p.Name == KnownParameters.Endpoint.Name) && + c.Signature.Parameters.Any(p => p.Name == "options"); + [TestCaseSource(nameof(EndpointParamInitializationValueTestCases))] public void EndpointInitializationValue(InputParameter endpointParameter, ValueExpression? expectedValue) { @@ -1139,7 +1198,7 @@ public void EndpointInitializationValue(InputParameter endpointParameter, ValueE Assert.IsNotNull(clientProvider); // find the endpoint parameter from the primary constructor var primaryConstructor = clientProvider.Constructors.FirstOrDefault( - c => c.Signature?.Initializer == null && c.Signature?.Modifiers == MethodSignatureModifiers.Public); + c => c.Signature?.Initializer == null && c.Signature?.Modifiers == MethodSignatureModifiers.Internal); var endpoint = primaryConstructor?.Signature?.Parameters?.FirstOrDefault(p => p.Name == KnownParameters.Endpoint.Name); Assert.IsNotNull(endpoint); @@ -1456,7 +1515,7 @@ public void TestApiVersionOfClient() /* verify the apiVersion assignment in constructor body */ var primaryConstructor = clientProvider.Constructors.FirstOrDefault( - c => c.Signature?.Initializer == null && c.Signature?.Modifiers == MethodSignatureModifiers.Public); + c => c.Signature?.Initializer == null && c.Signature?.Modifiers == MethodSignatureModifiers.Internal); Assert.IsNotNull(primaryConstructor); var bodyStatements = primaryConstructor?.BodyStatements as MethodBodyStatements; Assert.IsNotNull(bodyStatements); @@ -1493,7 +1552,7 @@ public void TestApiVersionPathParameterOfClient(InputClient inputClient) /* verify the apiVersion assignment in constructor body */ var primaryConstructor = clientProvider.Constructors.FirstOrDefault( - c => c.Signature?.Initializer == null && c.Signature?.Modifiers == MethodSignatureModifiers.Public); + c => c.Signature?.Initializer == null && c.Signature?.Modifiers == MethodSignatureModifiers.Internal); Assert.IsNotNull(primaryConstructor); var bodyStatements = primaryConstructor?.BodyStatements as MethodBodyStatements; Assert.IsNotNull(bodyStatements); @@ -1667,7 +1726,7 @@ public void EndpointFieldAssignedFromUriParameter() isEndpoint: true)]); var clientProvider = new ClientProvider(client); var constructor = clientProvider.Constructors.FirstOrDefault( - c => c.Signature.Initializer == null && c.Signature?.Modifiers == MethodSignatureModifiers.Public); + c => c.Signature.Initializer == null && c.Signature?.Modifiers == MethodSignatureModifiers.Internal); StringAssert.Contains("_endpoint = endpoint;", constructor?.BodyStatements?.ToDisplayString()); } @@ -1688,7 +1747,7 @@ public void EndpointFieldAssignedFromStringParameter(string serverTemplate, stri isEndpoint: true)]); var clientProvider = new ClientProvider(client); var constructor = clientProvider.Constructors.FirstOrDefault( - c => c.Signature.Initializer == null && c.Signature?.Modifiers == MethodSignatureModifiers.Public); + c => c.Signature.Initializer == null && c.Signature?.Modifiers == MethodSignatureModifiers.Internal); StringAssert.Contains($"_endpoint = new global::System.Uri($\"{serverTemplate}\");", constructor?.BodyStatements?.ToDisplayString()); } @@ -3762,7 +3821,7 @@ public void ConvertUriTemplate_CaseInsensitiveEndpointLookup(string serverTempla isEndpoint: true)]); var clientProvider = new ClientProvider(client); var constructor = clientProvider.Constructors.FirstOrDefault( - c => c.Signature.Initializer == null && c.Signature?.Modifiers == MethodSignatureModifiers.Public); + c => c.Signature.Initializer == null && c.Signature?.Modifiers == MethodSignatureModifiers.Internal); Assert.IsNotNull(constructor); // Should not throw and should contain the Uri assignment @@ -3796,7 +3855,7 @@ public void ConvertUriTemplate_CaseInsensitivePathParameterLookup() ]); var clientProvider = new ClientProvider(client); var constructor = clientProvider.Constructors.FirstOrDefault( - c => c.Signature.Initializer == null && c.Signature?.Modifiers == MethodSignatureModifiers.Public); + c => c.Signature.Initializer == null && c.Signature?.Modifiers == MethodSignatureModifiers.Internal); Assert.IsNotNull(constructor); // Should not throw - case-insensitive lookup should find parameters @@ -3837,7 +3896,7 @@ public void ConvertUriTemplate_WithMultiplePlaceholders() ]); var clientProvider = new ClientProvider(client); var constructor = clientProvider.Constructors.FirstOrDefault( - c => c.Signature.Initializer == null && c.Signature?.Modifiers == MethodSignatureModifiers.Public); + c => c.Signature.Initializer == null && c.Signature?.Modifiers == MethodSignatureModifiers.Internal); Assert.IsNotNull(constructor); var bodyText = constructor!.BodyStatements!.ToDisplayString(); diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/MultiServiceClient_GeneratesExpectedClient.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/MultiServiceClient_GeneratesExpectedClient.cs index b650c53a695..3e82b811e69 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/MultiServiceClient_GeneratesExpectedClient.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/MultiServiceClient_GeneratesExpectedClient.cs @@ -27,7 +27,7 @@ protected TestClient() { } - public TestClient(global::System.Uri endpoint, string subscriptionId, global::Sample.TestClientOptions options) + internal TestClient(global::System.ClientModel.Primitives.AuthenticationPolicy authenticationPolicy, global::System.Uri endpoint, string subscriptionId, global::Sample.TestClientOptions options) { global::Sample.Argument.AssertNotNull(endpoint, nameof(endpoint)); global::Sample.Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); @@ -41,6 +41,10 @@ public TestClient(global::System.Uri endpoint, string subscriptionId, global::Sa _serviceBApiVersion = options.ServiceBApiVersion; } + public TestClient(global::System.Uri endpoint, string subscriptionId, global::Sample.TestClientOptions options) : this(null, endpoint, subscriptionId, options) + { + } + public global::System.ClientModel.Primitives.ClientPipeline Pipeline { get; } public virtual global::Sample.ServiceA.ServiceA GetServiceAClient() diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/MultiServiceClient_WithThreeServices_GeneratesExpectedClient.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/MultiServiceClient_WithThreeServices_GeneratesExpectedClient.cs index ae8e7b8d8ae..54206fc6ffb 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/MultiServiceClient_WithThreeServices_GeneratesExpectedClient.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/MultiServiceClient_WithThreeServices_GeneratesExpectedClient.cs @@ -30,7 +30,7 @@ protected TestClient() { } - public TestClient(global::System.Uri endpoint, string subscriptionId, global::Sample.TestClientOptions options) + internal TestClient(global::System.ClientModel.Primitives.AuthenticationPolicy authenticationPolicy, global::System.Uri endpoint, string subscriptionId, global::Sample.TestClientOptions options) { global::Sample.Argument.AssertNotNull(endpoint, nameof(endpoint)); global::Sample.Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); @@ -45,6 +45,10 @@ public TestClient(global::System.Uri endpoint, string subscriptionId, global::Sa _serviceStorageApiVersion = options.ServiceStorageApiVersion; } + public TestClient(global::System.Uri endpoint, string subscriptionId, global::Sample.TestClientOptions options) : this(null, endpoint, subscriptionId, options) + { + } + public global::System.ClientModel.Primitives.ClientPipeline Pipeline { get; } public virtual global::Sample.KeyVault.KeyVault GetKeyVaultClient() diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/MultiServiceCombinedClient_GeneratesExpectedClient.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/MultiServiceCombinedClient_GeneratesExpectedClient.cs index 7ca9e6f204f..1bd204e71e8 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/MultiServiceCombinedClient_GeneratesExpectedClient.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/MultiServiceCombinedClient_GeneratesExpectedClient.cs @@ -24,7 +24,7 @@ protected TestClient() { } - public TestClient(global::System.Uri endpoint, global::Sample.TestClientOptions options) + internal TestClient(global::System.ClientModel.Primitives.AuthenticationPolicy authenticationPolicy, global::System.Uri endpoint, global::Sample.TestClientOptions options) { global::Sample.Argument.AssertNotNull(endpoint, nameof(endpoint)); @@ -36,6 +36,10 @@ public TestClient(global::System.Uri endpoint, global::Sample.TestClientOptions _serviceBApiVersion = options.ServiceBApiVersion; } + public TestClient(global::System.Uri endpoint, global::Sample.TestClientOptions options) : this(null, endpoint, options) + { + } + public global::System.ClientModel.Primitives.ClientPipeline Pipeline { get; } public virtual global::System.ClientModel.ClientResult ServiceAOperation(global::System.ClientModel.Primitives.RequestOptions options) diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/MultiServiceCombinedClient_WithThreeServices_GeneratesExpectedClient.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/MultiServiceCombinedClient_WithThreeServices_GeneratesExpectedClient.cs index dcb06d16e99..a5520eb71c1 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/MultiServiceCombinedClient_WithThreeServices_GeneratesExpectedClient.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/MultiServiceCombinedClient_WithThreeServices_GeneratesExpectedClient.cs @@ -25,7 +25,7 @@ protected TestClient() { } - public TestClient(global::System.Uri endpoint, global::Sample.TestClientOptions options) + internal TestClient(global::System.ClientModel.Primitives.AuthenticationPolicy authenticationPolicy, global::System.Uri endpoint, global::Sample.TestClientOptions options) { global::Sample.Argument.AssertNotNull(endpoint, nameof(endpoint)); @@ -38,6 +38,10 @@ public TestClient(global::System.Uri endpoint, global::Sample.TestClientOptions _serviceStorageApiVersion = options.ServiceStorageApiVersion; } + public TestClient(global::System.Uri endpoint, global::Sample.TestClientOptions options) : this(null, endpoint, options) + { + } + public global::System.ClientModel.Primitives.ClientPipeline Pipeline { get; } public virtual global::System.ClientModel.ClientResult KeyVaultOperation(global::System.ClientModel.Primitives.RequestOptions options) diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/TestBuildConstructors_PrimaryConstructor(WithDefault,False,True,0).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/TestBuildConstructors_PrimaryConstructor(WithDefault,False,True,0).cs index 4bfcac8a646..579690c23a0 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/TestBuildConstructors_PrimaryConstructor(WithDefault,False,True,0).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/TestBuildConstructors_PrimaryConstructor(WithDefault,False,True,0).cs @@ -1,8 +1,6 @@ global::Sample.Argument.AssertNotNull(endpoint, nameof(endpoint)); -global::Sample.Argument.AssertNotNull(tokenProvider, nameof(tokenProvider)); options ??= new global::Sample.TestClientOptions(); _endpoint = endpoint; -_tokenProvider = tokenProvider; -Pipeline = global::System.ClientModel.Primitives.ClientPipeline.Create(options, Array.Empty(), new global::System.ClientModel.Primitives.PipelinePolicy[] { new global::System.ClientModel.Primitives.UserAgentPolicy(typeof(global::Sample.TestClient).Assembly), new global::System.ClientModel.Primitives.BearerTokenPolicy(_tokenProvider, _flows) }, Array.Empty()); +Pipeline = global::System.ClientModel.Primitives.ClientPipeline.Create(options, Array.Empty(), new global::System.ClientModel.Primitives.PipelinePolicy[] { new global::System.ClientModel.Primitives.UserAgentPolicy(typeof(global::Sample.TestClient).Assembly), authenticationPolicy }, Array.Empty()); diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/TestBuildConstructors_PrimaryConstructor(WithDefault,True,False,0).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/TestBuildConstructors_PrimaryConstructor(WithDefault,True,False,0).cs index da28a866fe6..579690c23a0 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/TestBuildConstructors_PrimaryConstructor(WithDefault,True,False,0).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/TestBuildConstructors_PrimaryConstructor(WithDefault,True,False,0).cs @@ -1,8 +1,6 @@ global::Sample.Argument.AssertNotNull(endpoint, nameof(endpoint)); -global::Sample.Argument.AssertNotNull(credential, nameof(credential)); options ??= new global::Sample.TestClientOptions(); _endpoint = endpoint; -_keyCredential = credential; -Pipeline = global::System.ClientModel.Primitives.ClientPipeline.Create(options, Array.Empty(), new global::System.ClientModel.Primitives.PipelinePolicy[] { new global::System.ClientModel.Primitives.UserAgentPolicy(typeof(global::Sample.TestClient).Assembly), global::System.ClientModel.Primitives.ApiKeyAuthenticationPolicy.CreateHeaderApiKeyPolicy(_keyCredential, AuthorizationHeader) }, Array.Empty()); +Pipeline = global::System.ClientModel.Primitives.ClientPipeline.Create(options, Array.Empty(), new global::System.ClientModel.Primitives.PipelinePolicy[] { new global::System.ClientModel.Primitives.UserAgentPolicy(typeof(global::Sample.TestClient).Assembly), authenticationPolicy }, Array.Empty()); diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/TestBuildConstructors_PrimaryConstructor(WithDefault,True,True,0).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/TestBuildConstructors_PrimaryConstructor(WithDefault,True,True,0).cs index da28a866fe6..579690c23a0 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/TestBuildConstructors_PrimaryConstructor(WithDefault,True,True,0).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/TestBuildConstructors_PrimaryConstructor(WithDefault,True,True,0).cs @@ -1,8 +1,6 @@ global::Sample.Argument.AssertNotNull(endpoint, nameof(endpoint)); -global::Sample.Argument.AssertNotNull(credential, nameof(credential)); options ??= new global::Sample.TestClientOptions(); _endpoint = endpoint; -_keyCredential = credential; -Pipeline = global::System.ClientModel.Primitives.ClientPipeline.Create(options, Array.Empty(), new global::System.ClientModel.Primitives.PipelinePolicy[] { new global::System.ClientModel.Primitives.UserAgentPolicy(typeof(global::Sample.TestClient).Assembly), global::System.ClientModel.Primitives.ApiKeyAuthenticationPolicy.CreateHeaderApiKeyPolicy(_keyCredential, AuthorizationHeader) }, Array.Empty()); +Pipeline = global::System.ClientModel.Primitives.ClientPipeline.Create(options, Array.Empty(), new global::System.ClientModel.Primitives.PipelinePolicy[] { new global::System.ClientModel.Primitives.UserAgentPolicy(typeof(global::Sample.TestClient).Assembly), authenticationPolicy }, Array.Empty()); diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/TestBuildConstructors_PrimaryConstructor(WithDefault,True,True,1).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/TestBuildConstructors_PrimaryConstructor(WithDefault,True,True,1).cs index 4bfcac8a646..579690c23a0 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/TestBuildConstructors_PrimaryConstructor(WithDefault,True,True,1).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/TestBuildConstructors_PrimaryConstructor(WithDefault,True,True,1).cs @@ -1,8 +1,6 @@ global::Sample.Argument.AssertNotNull(endpoint, nameof(endpoint)); -global::Sample.Argument.AssertNotNull(tokenProvider, nameof(tokenProvider)); options ??= new global::Sample.TestClientOptions(); _endpoint = endpoint; -_tokenProvider = tokenProvider; -Pipeline = global::System.ClientModel.Primitives.ClientPipeline.Create(options, Array.Empty(), new global::System.ClientModel.Primitives.PipelinePolicy[] { new global::System.ClientModel.Primitives.UserAgentPolicy(typeof(global::Sample.TestClient).Assembly), new global::System.ClientModel.Primitives.BearerTokenPolicy(_tokenProvider, _flows) }, Array.Empty()); +Pipeline = global::System.ClientModel.Primitives.ClientPipeline.Create(options, Array.Empty(), new global::System.ClientModel.Primitives.PipelinePolicy[] { new global::System.ClientModel.Primitives.UserAgentPolicy(typeof(global::Sample.TestClient).Assembly), authenticationPolicy }, Array.Empty()); diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/TestBuildConstructors_PrimaryConstructor(WithRequired,False,True,0).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/TestBuildConstructors_PrimaryConstructor(WithRequired,False,True,0).cs index 4bfcac8a646..579690c23a0 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/TestBuildConstructors_PrimaryConstructor(WithRequired,False,True,0).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/TestBuildConstructors_PrimaryConstructor(WithRequired,False,True,0).cs @@ -1,8 +1,6 @@ global::Sample.Argument.AssertNotNull(endpoint, nameof(endpoint)); -global::Sample.Argument.AssertNotNull(tokenProvider, nameof(tokenProvider)); options ??= new global::Sample.TestClientOptions(); _endpoint = endpoint; -_tokenProvider = tokenProvider; -Pipeline = global::System.ClientModel.Primitives.ClientPipeline.Create(options, Array.Empty(), new global::System.ClientModel.Primitives.PipelinePolicy[] { new global::System.ClientModel.Primitives.UserAgentPolicy(typeof(global::Sample.TestClient).Assembly), new global::System.ClientModel.Primitives.BearerTokenPolicy(_tokenProvider, _flows) }, Array.Empty()); +Pipeline = global::System.ClientModel.Primitives.ClientPipeline.Create(options, Array.Empty(), new global::System.ClientModel.Primitives.PipelinePolicy[] { new global::System.ClientModel.Primitives.UserAgentPolicy(typeof(global::Sample.TestClient).Assembly), authenticationPolicy }, Array.Empty()); diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/TestBuildConstructors_PrimaryConstructor(WithRequired,True,False,0).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/TestBuildConstructors_PrimaryConstructor(WithRequired,True,False,0).cs index da28a866fe6..579690c23a0 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/TestBuildConstructors_PrimaryConstructor(WithRequired,True,False,0).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/TestBuildConstructors_PrimaryConstructor(WithRequired,True,False,0).cs @@ -1,8 +1,6 @@ global::Sample.Argument.AssertNotNull(endpoint, nameof(endpoint)); -global::Sample.Argument.AssertNotNull(credential, nameof(credential)); options ??= new global::Sample.TestClientOptions(); _endpoint = endpoint; -_keyCredential = credential; -Pipeline = global::System.ClientModel.Primitives.ClientPipeline.Create(options, Array.Empty(), new global::System.ClientModel.Primitives.PipelinePolicy[] { new global::System.ClientModel.Primitives.UserAgentPolicy(typeof(global::Sample.TestClient).Assembly), global::System.ClientModel.Primitives.ApiKeyAuthenticationPolicy.CreateHeaderApiKeyPolicy(_keyCredential, AuthorizationHeader) }, Array.Empty()); +Pipeline = global::System.ClientModel.Primitives.ClientPipeline.Create(options, Array.Empty(), new global::System.ClientModel.Primitives.PipelinePolicy[] { new global::System.ClientModel.Primitives.UserAgentPolicy(typeof(global::Sample.TestClient).Assembly), authenticationPolicy }, Array.Empty()); diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/TestBuildConstructors_PrimaryConstructor(WithRequired,True,True,0).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/TestBuildConstructors_PrimaryConstructor(WithRequired,True,True,0).cs index da28a866fe6..579690c23a0 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/TestBuildConstructors_PrimaryConstructor(WithRequired,True,True,0).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/TestBuildConstructors_PrimaryConstructor(WithRequired,True,True,0).cs @@ -1,8 +1,6 @@ global::Sample.Argument.AssertNotNull(endpoint, nameof(endpoint)); -global::Sample.Argument.AssertNotNull(credential, nameof(credential)); options ??= new global::Sample.TestClientOptions(); _endpoint = endpoint; -_keyCredential = credential; -Pipeline = global::System.ClientModel.Primitives.ClientPipeline.Create(options, Array.Empty(), new global::System.ClientModel.Primitives.PipelinePolicy[] { new global::System.ClientModel.Primitives.UserAgentPolicy(typeof(global::Sample.TestClient).Assembly), global::System.ClientModel.Primitives.ApiKeyAuthenticationPolicy.CreateHeaderApiKeyPolicy(_keyCredential, AuthorizationHeader) }, Array.Empty()); +Pipeline = global::System.ClientModel.Primitives.ClientPipeline.Create(options, Array.Empty(), new global::System.ClientModel.Primitives.PipelinePolicy[] { new global::System.ClientModel.Primitives.UserAgentPolicy(typeof(global::Sample.TestClient).Assembly), authenticationPolicy }, Array.Empty()); diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/TestBuildConstructors_PrimaryConstructor(WithRequired,True,True,1).cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/TestBuildConstructors_PrimaryConstructor(WithRequired,True,True,1).cs index 4bfcac8a646..579690c23a0 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/TestBuildConstructors_PrimaryConstructor(WithRequired,True,True,1).cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/TestBuildConstructors_PrimaryConstructor(WithRequired,True,True,1).cs @@ -1,8 +1,6 @@ global::Sample.Argument.AssertNotNull(endpoint, nameof(endpoint)); -global::Sample.Argument.AssertNotNull(tokenProvider, nameof(tokenProvider)); options ??= new global::Sample.TestClientOptions(); _endpoint = endpoint; -_tokenProvider = tokenProvider; -Pipeline = global::System.ClientModel.Primitives.ClientPipeline.Create(options, Array.Empty(), new global::System.ClientModel.Primitives.PipelinePolicy[] { new global::System.ClientModel.Primitives.UserAgentPolicy(typeof(global::Sample.TestClient).Assembly), new global::System.ClientModel.Primitives.BearerTokenPolicy(_tokenProvider, _flows) }, Array.Empty()); +Pipeline = global::System.ClientModel.Primitives.ClientPipeline.Create(options, Array.Empty(), new global::System.ClientModel.Primitives.PipelinePolicy[] { new global::System.ClientModel.Primitives.UserAgentPolicy(typeof(global::Sample.TestClient).Assembly), authenticationPolicy }, Array.Empty()); diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/ValidateConstructorsWhenUnsupportedAuth.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/ValidateConstructorsWhenUnsupportedAuth.cs index 67b3361362f..60e6d68058d 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/ValidateConstructorsWhenUnsupportedAuth.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/ValidateConstructorsWhenUnsupportedAuth.cs @@ -13,12 +13,18 @@ public partial class TestClient { } - internal TestClient(global::System.Uri endpoint, global::Sample.TestClientOptions options) + internal TestClient(global::System.ClientModel.Primitives.AuthenticationPolicy authenticationPolicy, global::System.Uri endpoint, global::Sample.TestClientOptions options) { + global::Sample.Argument.AssertNotNull(endpoint, nameof(endpoint)); + options ??= new global::Sample.TestClientOptions(); _endpoint = endpoint; Pipeline = global::System.ClientModel.Primitives.ClientPipeline.Create(options, Array.Empty(), new global::System.ClientModel.Primitives.PipelinePolicy[] { new global::System.ClientModel.Primitives.UserAgentPolicy(typeof(global::Sample.TestClient).Assembly) }, Array.Empty()); } + + internal TestClient(global::System.Uri endpoint, global::Sample.TestClientOptions options) : this(null, endpoint, options) + { + } } } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/XmlDocsAreWritten.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/XmlDocsAreWritten.cs index 31e104ce003..5e455f24f4c 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/XmlDocsAreWritten.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/XmlDocsAreWritten.cs @@ -31,12 +31,11 @@ protected TestClient() } /// Initializes a new instance of TestClient. + /// The authentication policy to use for pipeline creation. /// Service endpoint. /// queryParam description. /// The options for configuring the client. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public TestClient(global::System.Uri endpoint, string queryParam, global::Sample.TestClientOptions options) + internal TestClient(global::System.ClientModel.Primitives.AuthenticationPolicy authenticationPolicy, global::System.Uri endpoint, string queryParam, global::Sample.TestClientOptions options) { global::Sample.Argument.AssertNotNull(endpoint, nameof(endpoint)); global::Sample.Argument.AssertNotNullOrEmpty(queryParam, nameof(queryParam)); @@ -48,6 +47,16 @@ public TestClient(global::System.Uri endpoint, string queryParam, global::Sample Pipeline = global::System.ClientModel.Primitives.ClientPipeline.Create(options, Array.Empty(), new global::System.ClientModel.Primitives.PipelinePolicy[] { new global::System.ClientModel.Primitives.UserAgentPolicy(typeof(global::Sample.TestClient).Assembly) }, Array.Empty()); } + /// Initializes a new instance of TestClient. + /// Service endpoint. + /// queryParam description. + /// The options for configuring the client. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public TestClient(global::System.Uri endpoint, string queryParam, global::Sample.TestClientOptions options) : this(null, endpoint, queryParam, options) + { + } + /// The HTTP pipeline for sending and receiving REST requests and responses. public global::System.ClientModel.Primitives.ClientPipeline Pipeline { get; } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientSettingsProviderTests.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientSettingsProviderTests.cs new file mode 100644 index 00000000000..9c9fc994075 --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientSettingsProviderTests.cs @@ -0,0 +1,621 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Linq; +using Microsoft.TypeSpec.Generator.ClientModel.Providers; +using Microsoft.TypeSpec.Generator.Input; +using Microsoft.TypeSpec.Generator.Primitives; +using Microsoft.TypeSpec.Generator.Tests.Common; +using NUnit.Framework; + +namespace Microsoft.TypeSpec.Generator.ClientModel.Tests.Providers +{ + public class ClientSettingsProviderTests + { + [SetUp] + public void SetUp() + { + MockHelpers.LoadMockGenerator(); + } + + [Test] + public void TestName() + { + var client = InputFactory.Client("TestClient"); + var clientProvider = new ClientProvider(client); + var settingsProvider = clientProvider.ClientSettings; + + Assert.IsNotNull(settingsProvider); + Assert.AreEqual("TestClientSettings", settingsProvider!.Name); + } + + [Test] + public void TestBaseType() + { + var client = InputFactory.Client("TestClient"); + var clientProvider = new ClientProvider(client); + var settingsProvider = clientProvider.ClientSettings; + + Assert.IsNotNull(settingsProvider); + Assert.AreEqual(ClientSettingsProvider.ClientSettingsType, settingsProvider!.Type.BaseType); + } + + [Test] + public void TestProperties_WithEndpoint() + { + var inputParameters = new[] + { + InputFactory.EndpointParameter( + "endpoint", + InputPrimitiveType.String, + defaultValue: InputFactory.Constant.String("https://default.endpoint.io"), + scope: InputParameterScope.Client, + isEndpoint: true) + }; + var client = InputFactory.Client("TestClient", parameters: inputParameters); + var clientProvider = new ClientProvider(client); + var settingsProvider = clientProvider.ClientSettings; + + Assert.IsNotNull(settingsProvider); + + var properties = settingsProvider!.Properties; + // Should have Endpoint and Options properties + var endpointProp = properties.FirstOrDefault(p => p.Name == "Endpoint" && p.Type.Equals(new CSharpType(typeof(Uri), isNullable: true))); + Assert.IsNotNull(endpointProp, "Settings should have an Endpoint property of type Uri?"); + + var optionsProp = properties.FirstOrDefault(p => p.Name == "Options"); + Assert.IsNotNull(optionsProp, "Settings should have an Options property"); + } + + [Test] + public void TestProperties_NoEndpoint() + { + var client = InputFactory.Client("TestClient"); + var clientProvider = new ClientProvider(client); + var settingsProvider = clientProvider.ClientSettings; + + // Settings provider should exist but without endpoint-related properties + Assert.IsNotNull(settingsProvider); + + var endpointProp = settingsProvider!.Properties.FirstOrDefault(p => p.Name == "Endpoint" && p.Type.Equals(new CSharpType(typeof(Uri), isNullable: true))); + Assert.IsNull(endpointProp, "Settings should not have an Endpoint property when no endpoint parameter exists"); + } + + [Test] + public void TestBindCoreMethod_WithEndpoint() + { + var inputParameters = new[] + { + InputFactory.EndpointParameter( + "endpoint", + InputPrimitiveType.String, + defaultValue: InputFactory.Constant.String("https://default.endpoint.io"), + scope: InputParameterScope.Client, + isEndpoint: true) + }; + var client = InputFactory.Client("TestClient", parameters: inputParameters); + var clientProvider = new ClientProvider(client); + var settingsProvider = clientProvider.ClientSettings; + + Assert.IsNotNull(settingsProvider); + + var methods = settingsProvider!.Methods; + var bindCoreMethod = methods.FirstOrDefault(m => m.Signature.Name == "BindCore"); + Assert.IsNotNull(bindCoreMethod, "Settings should have a BindCore method"); + + // Validate it's protected override + Assert.AreEqual( + MethodSignatureModifiers.Protected | MethodSignatureModifiers.Override, + bindCoreMethod!.Signature.Modifiers); + + // Validate it has section parameter + Assert.AreEqual(1, bindCoreMethod.Signature.Parameters.Count); + Assert.AreEqual("section", bindCoreMethod.Signature.Parameters[0].Name); + + // Validate the body contains Uri.TryCreate for endpoint binding + var body = bindCoreMethod.BodyStatements; + Assert.IsNotNull(body); + var bodyString = body!.ToDisplayString(); + Assert.IsTrue(bodyString.Contains("TryCreate"), "BindCore should use Uri.TryCreate for endpoint binding"); + } + + [Test] + public void TestBindCoreMethod_WithOptionsSection() + { + var inputParameters = new[] + { + InputFactory.EndpointParameter( + "endpoint", + InputPrimitiveType.String, + defaultValue: InputFactory.Constant.String("https://default.endpoint.io"), + scope: InputParameterScope.Client, + isEndpoint: true) + }; + var client = InputFactory.Client("TestClient", parameters: inputParameters); + var clientProvider = new ClientProvider(client); + var settingsProvider = clientProvider.ClientSettings; + + Assert.IsNotNull(settingsProvider); + + var methods = settingsProvider!.Methods; + var bindCoreMethod = methods.FirstOrDefault(m => m.Signature.Name == "BindCore"); + Assert.IsNotNull(bindCoreMethod); + + var bodyString = bindCoreMethod!.BodyStatements!.ToDisplayString(); + // Should get the options section and create options from it + Assert.IsTrue(bodyString.Contains("GetSection") && bodyString.Contains("Options"), + "BindCore should get the Options section from configuration"); + } + + [Test] + public void TestBindCoreMethod_WithBoolParam() + { + var inputParameters = new InputParameter[] + { + InputFactory.EndpointParameter( + "endpoint", + InputPrimitiveType.String, + defaultValue: InputFactory.Constant.String("https://default.endpoint.io"), + scope: InputParameterScope.Client, + isEndpoint: true), + InputFactory.MethodParameter( + "enableRetry", + InputPrimitiveType.Boolean, + isRequired: true, + scope: InputParameterScope.Client) + }; + var client = InputFactory.Client("TestClient", parameters: inputParameters); + var clientProvider = new ClientProvider(client); + var settingsProvider = clientProvider.ClientSettings; + + Assert.IsNotNull(settingsProvider); + + var bindCoreMethod = settingsProvider!.Methods.FirstOrDefault(m => m.Signature.Name == "BindCore"); + Assert.IsNotNull(bindCoreMethod); + + var bodyString = bindCoreMethod!.BodyStatements!.ToDisplayString(); + Assert.IsTrue(bodyString.Contains("bool.TryParse"), "BindCore should use bool.TryParse for bool parameter binding"); + Assert.IsTrue(bodyString.Contains("EnableRetry"), "BindCore should assign to EnableRetry property"); + } + + [Test] + public void TestBindCoreMethod_WithIntParam() + { + var inputParameters = new InputParameter[] + { + InputFactory.EndpointParameter( + "endpoint", + InputPrimitiveType.String, + defaultValue: InputFactory.Constant.String("https://default.endpoint.io"), + scope: InputParameterScope.Client, + isEndpoint: true), + InputFactory.MethodParameter( + "maxRetries", + InputPrimitiveType.Int32, + isRequired: true, + scope: InputParameterScope.Client) + }; + var client = InputFactory.Client("TestClient", parameters: inputParameters); + var clientProvider = new ClientProvider(client); + var settingsProvider = clientProvider.ClientSettings; + + Assert.IsNotNull(settingsProvider); + + var bindCoreMethod = settingsProvider!.Methods.FirstOrDefault(m => m.Signature.Name == "BindCore"); + Assert.IsNotNull(bindCoreMethod); + + var bodyString = bindCoreMethod!.BodyStatements!.ToDisplayString(); + Assert.IsTrue(bodyString.Contains("int.TryParse"), "BindCore should use int.TryParse for int parameter binding"); + Assert.IsTrue(bodyString.Contains("MaxRetries"), "BindCore should assign to MaxRetries property"); + } + + [Test] + public void TestBindCoreMethod_WithStringParam() + { + var inputParameters = new InputParameter[] + { + InputFactory.EndpointParameter( + "endpoint", + InputPrimitiveType.String, + defaultValue: InputFactory.Constant.String("https://default.endpoint.io"), + scope: InputParameterScope.Client, + isEndpoint: true), + InputFactory.MethodParameter( + "tenantId", + InputPrimitiveType.String, + isRequired: true, + scope: InputParameterScope.Client) + }; + var client = InputFactory.Client("TestClient", parameters: inputParameters); + var clientProvider = new ClientProvider(client); + var settingsProvider = clientProvider.ClientSettings; + + Assert.IsNotNull(settingsProvider); + + var bindCoreMethod = settingsProvider!.Methods.FirstOrDefault(m => m.Signature.Name == "BindCore"); + Assert.IsNotNull(bindCoreMethod); + + var bodyString = bindCoreMethod!.BodyStatements!.ToDisplayString(); + Assert.IsTrue(bodyString.Contains("IsNullOrEmpty"), "BindCore should use string.IsNullOrEmpty for string parameter binding"); + Assert.IsTrue(bodyString.Contains("TenantId"), "BindCore should assign to TenantId property"); + } + + [Test] + public void TestProperties_WithMultipleParamTypes() + { + var inputParameters = new InputParameter[] + { + InputFactory.EndpointParameter( + "endpoint", + InputPrimitiveType.String, + defaultValue: InputFactory.Constant.String("https://default.endpoint.io"), + scope: InputParameterScope.Client, + isEndpoint: true), + InputFactory.MethodParameter( + "enableRetry", + InputPrimitiveType.Boolean, + isRequired: true, + scope: InputParameterScope.Client), + InputFactory.MethodParameter( + "maxRetries", + InputPrimitiveType.Int32, + isRequired: true, + scope: InputParameterScope.Client), + InputFactory.MethodParameter( + "tenantId", + InputPrimitiveType.String, + isRequired: true, + scope: InputParameterScope.Client) + }; + var client = InputFactory.Client("TestClient", parameters: inputParameters); + var clientProvider = new ClientProvider(client); + var settingsProvider = clientProvider.ClientSettings; + + Assert.IsNotNull(settingsProvider); + + var properties = settingsProvider!.Properties; + Assert.IsNotNull(properties.FirstOrDefault(p => p.Name == "Endpoint"), "Settings should have Endpoint property"); + Assert.IsNotNull(properties.FirstOrDefault(p => p.Name == "EnableRetry"), "Settings should have EnableRetry property"); + Assert.IsNotNull(properties.FirstOrDefault(p => p.Name == "MaxRetries"), "Settings should have MaxRetries property"); + Assert.IsNotNull(properties.FirstOrDefault(p => p.Name == "TenantId"), "Settings should have TenantId property"); + Assert.IsNotNull(properties.FirstOrDefault(p => p.Name == "Options"), "Settings should have Options property"); + } + + [Test] + public void TestBindCoreMethod_WithUriParam() + { + var inputParameters = new InputParameter[] + { + InputFactory.EndpointParameter( + "endpoint", + InputPrimitiveType.String, + defaultValue: InputFactory.Constant.String("https://default.endpoint.io"), + scope: InputParameterScope.Client, + isEndpoint: true), + InputFactory.MethodParameter( + "redirectUri", + InputPrimitiveType.Url, + isRequired: true, + scope: InputParameterScope.Client) + }; + var client = InputFactory.Client("TestClient", parameters: inputParameters); + var clientProvider = new ClientProvider(client); + var settingsProvider = clientProvider.ClientSettings; + + Assert.IsNotNull(settingsProvider); + + var bindCoreMethod = settingsProvider!.Methods.FirstOrDefault(m => m.Signature.Name == "BindCore"); + Assert.IsNotNull(bindCoreMethod); + + var bodyString = bindCoreMethod!.BodyStatements!.ToDisplayString(); + Assert.IsTrue(bodyString.Contains("Uri.TryCreate"), "BindCore should use Uri.TryCreate for Uri parameter binding"); + Assert.IsTrue(bodyString.Contains("UriKind.Absolute"), "BindCore should use UriKind.Absolute"); + Assert.IsTrue(bodyString.Contains("RedirectUri"), "BindCore should assign to RedirectUri property"); + } + + [Test] + public void TestBindCoreMethod_WithStringListParam() + { + var inputParameters = new InputParameter[] + { + InputFactory.EndpointParameter( + "endpoint", + InputPrimitiveType.String, + defaultValue: InputFactory.Constant.String("https://default.endpoint.io"), + scope: InputParameterScope.Client, + isEndpoint: true), + InputFactory.MethodParameter( + "allowedTenants", + InputFactory.Array(InputPrimitiveType.String), + isRequired: true, + scope: InputParameterScope.Client) + }; + var client = InputFactory.Client("TestClient", parameters: inputParameters); + var clientProvider = new ClientProvider(client); + var settingsProvider = clientProvider.ClientSettings; + + Assert.IsNotNull(settingsProvider); + + var bindCoreMethod = settingsProvider!.Methods.FirstOrDefault(m => m.Signature.Name == "BindCore"); + Assert.IsNotNull(bindCoreMethod); + + var bodyString = bindCoreMethod!.BodyStatements!.ToDisplayString(); + Assert.IsTrue(bodyString.Contains("GetSection"), "BindCore should use GetSection for list parameter binding"); + Assert.IsTrue(bodyString.Contains("GetChildren"), "BindCore should use GetChildren for list parameter binding"); + Assert.IsTrue(bodyString.Contains("Where"), "BindCore should use Where to filter null values"); + Assert.IsTrue(bodyString.Contains("is not null"), "BindCore should use 'is not null' pattern in Where filter"); + Assert.IsTrue(bodyString.Contains("Select"), "BindCore should use Select to extract values"); + Assert.IsTrue(bodyString.Contains("ToList"), "BindCore should use ToList to materialize the list"); + } + + [Test] + public void TestBindCoreMethod_WithEnumParam() + { + var enumType = InputFactory.StringEnum( + "AppAudience", + [("Public", "public"), ("Private", "private")], + isExtensible: true); + + MockHelpers.LoadMockGenerator(inputEnums: () => [enumType]); + + var inputParameters = new InputParameter[] + { + InputFactory.EndpointParameter( + "endpoint", + InputPrimitiveType.String, + defaultValue: InputFactory.Constant.String("https://default.endpoint.io"), + scope: InputParameterScope.Client, + isEndpoint: true), + InputFactory.MethodParameter( + "audience", + enumType, + isRequired: true, + scope: InputParameterScope.Client) + }; + var client = InputFactory.Client("TestClient", parameters: inputParameters); + var clientProvider = new ClientProvider(client); + var settingsProvider = clientProvider.ClientSettings; + + Assert.IsNotNull(settingsProvider); + + var bindCoreMethod = settingsProvider!.Methods.FirstOrDefault(m => m.Signature.Name == "BindCore"); + Assert.IsNotNull(bindCoreMethod); + + var bodyString = bindCoreMethod!.BodyStatements!.ToDisplayString(); + Assert.IsTrue(bodyString.Contains("is string"), "BindCore should use 'is string' pattern for enum parameter binding"); + Assert.IsTrue(bodyString.Contains("new"), "BindCore should create new enum instance"); + Assert.IsTrue(bodyString.Contains("Audience"), "BindCore should assign to Audience property"); + } + + [Test] + public void TestBindCoreMethod_WithFixedEnumParam() + { + var enumType = InputFactory.StringEnum( + "ClientMode", + [("Default", "default"), ("MultiClient", "multi-client")], + isExtensible: false); + + MockHelpers.LoadMockGenerator(inputEnums: () => [enumType]); + + var inputParameters = new InputParameter[] + { + InputFactory.EndpointParameter( + "endpoint", + InputPrimitiveType.String, + defaultValue: InputFactory.Constant.String("https://default.endpoint.io"), + scope: InputParameterScope.Client, + isEndpoint: true), + InputFactory.MethodParameter( + "mode", + enumType, + isRequired: true, + scope: InputParameterScope.Client) + }; + var client = InputFactory.Client("TestClient", parameters: inputParameters); + var clientProvider = new ClientProvider(client); + var settingsProvider = clientProvider.ClientSettings; + + Assert.IsNotNull(settingsProvider); + + var bindCoreMethod = settingsProvider!.Methods.FirstOrDefault(m => m.Signature.Name == "BindCore"); + Assert.IsNotNull(bindCoreMethod); + + var bodyString = bindCoreMethod!.BodyStatements!.ToDisplayString(); + Assert.IsTrue(bodyString.Contains("Enum.TryParse"), "BindCore should use Enum.TryParse for fixed enum parameter binding"); + Assert.IsTrue(bodyString.Contains("Mode"), "BindCore should assign to Mode property"); + Assert.IsFalse(bodyString.Contains("new ClientMode"), "BindCore should NOT use new for fixed enum binding"); + } + + [Test] + public void TestBindCoreMethod_WithTimeSpanParam() + { + var inputParameters = new InputParameter[] + { + InputFactory.EndpointParameter( + "endpoint", + InputPrimitiveType.String, + defaultValue: InputFactory.Constant.String("https://default.endpoint.io"), + scope: InputParameterScope.Client, + isEndpoint: true), + InputFactory.MethodParameter( + "networkTimeout", + InputPrimitiveType.PlainTime, + isRequired: true, + scope: InputParameterScope.Client) + }; + var client = InputFactory.Client("TestClient", parameters: inputParameters); + var clientProvider = new ClientProvider(client); + var settingsProvider = clientProvider.ClientSettings; + + Assert.IsNotNull(settingsProvider); + + var bindCoreMethod = settingsProvider!.Methods.FirstOrDefault(m => m.Signature.Name == "BindCore"); + Assert.IsNotNull(bindCoreMethod); + + var bodyString = bindCoreMethod!.BodyStatements!.ToDisplayString(); + Assert.IsTrue(bodyString.Contains("TimeSpan.TryParse"), "BindCore should use TimeSpan.TryParse for TimeSpan parameter binding"); + Assert.IsTrue(bodyString.Contains("NetworkTimeout"), "BindCore should assign to NetworkTimeout property"); + } + + [Test] + public void TestBindCoreMethod_WithComplexObjectParam() + { + var complexModel = InputFactory.Model( + "CustomOptions", + properties: new[] + { + InputFactory.Property("setting1", InputPrimitiveType.String, isRequired: true, wireName: "setting1"), + InputFactory.Property("setting2", InputPrimitiveType.Int32, isRequired: false, wireName: "setting2") + }); + + MockHelpers.LoadMockGenerator(inputModels: () => [complexModel]); + + var inputParameters = new InputParameter[] + { + InputFactory.EndpointParameter( + "endpoint", + InputPrimitiveType.String, + defaultValue: InputFactory.Constant.String("https://default.endpoint.io"), + scope: InputParameterScope.Client, + isEndpoint: true), + InputFactory.MethodParameter( + "customOptions", + complexModel, + isRequired: true, + scope: InputParameterScope.Client) + }; + var client = InputFactory.Client("TestClient", parameters: inputParameters); + var clientProvider = new ClientProvider(client); + var settingsProvider = clientProvider.ClientSettings; + + Assert.IsNotNull(settingsProvider); + + var bindCoreMethod = settingsProvider!.Methods.FirstOrDefault(m => m.Signature.Name == "BindCore"); + Assert.IsNotNull(bindCoreMethod); + + var bodyString = bindCoreMethod!.BodyStatements!.ToDisplayString(); + Assert.IsTrue(bodyString.Contains("GetSection"), "BindCore should use GetSection for complex object binding"); + Assert.IsTrue(bodyString.Contains("Exists"), "BindCore should check Exists for complex object binding"); + Assert.IsTrue(bodyString.Contains("CustomOptions") && bodyString.Contains("new"), "BindCore should create new CustomOptions instance for complex object binding"); + } + + [Test] + public void TestBindCoreMethod_WithLongParam() + { + var inputParameters = new InputParameter[] + { + InputFactory.EndpointParameter( + "endpoint", + InputPrimitiveType.String, + defaultValue: InputFactory.Constant.String("https://default.endpoint.io"), + scope: InputParameterScope.Client, + isEndpoint: true), + InputFactory.MethodParameter( + "maxSize", + InputPrimitiveType.Int64, + isRequired: true, + scope: InputParameterScope.Client) + }; + var client = InputFactory.Client("TestClient", parameters: inputParameters); + var clientProvider = new ClientProvider(client); + var settingsProvider = clientProvider.ClientSettings; + + Assert.IsNotNull(settingsProvider); + + var bindCoreMethod = settingsProvider!.Methods.FirstOrDefault(m => m.Signature.Name == "BindCore"); + Assert.IsNotNull(bindCoreMethod); + + var bodyString = bindCoreMethod!.BodyStatements!.ToDisplayString(); + Assert.IsTrue(bodyString.Contains("long.TryParse"), "BindCore should use long.TryParse for long parameter binding"); + Assert.IsTrue(bodyString.Contains("MaxSize"), "BindCore should assign to MaxSize property"); + } + + [Test] + public void TestBindCoreMethod_WithFloatParam() + { + var inputParameters = new InputParameter[] + { + InputFactory.EndpointParameter( + "endpoint", + InputPrimitiveType.String, + defaultValue: InputFactory.Constant.String("https://default.endpoint.io"), + scope: InputParameterScope.Client, + isEndpoint: true), + InputFactory.MethodParameter( + "temperature", + InputPrimitiveType.Float32, + isRequired: true, + scope: InputParameterScope.Client) + }; + var client = InputFactory.Client("TestClient", parameters: inputParameters); + var clientProvider = new ClientProvider(client); + var settingsProvider = clientProvider.ClientSettings; + + Assert.IsNotNull(settingsProvider); + + var bindCoreMethod = settingsProvider!.Methods.FirstOrDefault(m => m.Signature.Name == "BindCore"); + Assert.IsNotNull(bindCoreMethod); + + var bodyString = bindCoreMethod!.BodyStatements!.ToDisplayString(); + Assert.IsTrue(bodyString.Contains("float.TryParse"), "BindCore should use float.TryParse for float parameter binding"); + Assert.IsTrue(bodyString.Contains("Temperature"), "BindCore should assign to Temperature property"); + } + + [Test] + public void TestBindCoreMethod_WithDoubleParam() + { + var inputParameters = new InputParameter[] + { + InputFactory.EndpointParameter( + "endpoint", + InputPrimitiveType.String, + defaultValue: InputFactory.Constant.String("https://default.endpoint.io"), + scope: InputParameterScope.Client, + isEndpoint: true), + InputFactory.MethodParameter( + "precision", + InputPrimitiveType.Float64, + isRequired: true, + scope: InputParameterScope.Client) + }; + var client = InputFactory.Client("TestClient", parameters: inputParameters); + var clientProvider = new ClientProvider(client); + var settingsProvider = clientProvider.ClientSettings; + + Assert.IsNotNull(settingsProvider); + + var bindCoreMethod = settingsProvider!.Methods.FirstOrDefault(m => m.Signature.Name == "BindCore"); + Assert.IsNotNull(bindCoreMethod); + + var bodyString = bindCoreMethod!.BodyStatements!.ToDisplayString(); + Assert.IsTrue(bodyString.Contains("double.TryParse"), "BindCore should use double.TryParse for double parameter binding"); + Assert.IsTrue(bodyString.Contains("Precision"), "BindCore should assign to Precision property"); + } + + [Test] + public void TestExperimentalAttribute() + { + var client = InputFactory.Client("TestClient"); + var clientProvider = new ClientProvider(client); + var settingsProvider = clientProvider.ClientSettings; + + Assert.IsNotNull(settingsProvider); + + var attributes = settingsProvider!.Attributes; + Assert.IsNotNull(attributes); + Assert.IsTrue(attributes.Any(), "Settings should have an Experimental attribute"); + } + + [Test] + public void TestNamespace() + { + var client = InputFactory.Client("TestClient"); + var clientProvider = new ClientProvider(client); + var settingsProvider = clientProvider.ClientSettings; + + Assert.IsNotNull(settingsProvider); + Assert.AreEqual(clientProvider.Type.Namespace, settingsProvider!.Type.Namespace); + } + } +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/CollectionResultDefinitions/CollectionResultDefinitionTests.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/CollectionResultDefinitions/CollectionResultDefinitionTests.cs index b9957e4c6e9..6947ee8104e 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/CollectionResultDefinitions/CollectionResultDefinitionTests.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/CollectionResultDefinitions/CollectionResultDefinitionTests.cs @@ -165,9 +165,9 @@ public void TestEmptyStringHandlingForStringContinuationToken() var writer = new TypeProviderWriter(collectionResultDefinition!); var file = writer.Write(); - + // Verify the generated code includes empty string check - Assert.IsTrue(file.Content.Contains("string.IsNullOrEmpty"), + Assert.IsTrue(file.Content.Contains("string.IsNullOrEmpty"), "Generated code should check for empty strings in continuation tokens"); } @@ -199,9 +199,9 @@ public void TestEmptyStringHandlingForUriNextLink() var writer = new TypeProviderWriter(collectionResultDefinition!); var file = writer.Write(); - + // Verify the generated code handles URI types correctly (null check is sufficient for Uri type) - Assert.IsTrue(file.Content.Contains("if ((nextPageUri == null))"), + Assert.IsTrue(file.Content.Contains("if ((nextPageUri == null))"), "Generated code should check for null URI"); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/CollectionResultDefinitions/ListPageableTests.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/CollectionResultDefinitions/ListPageableTests.cs index 2aaddae9e52..56b0b87fe10 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/CollectionResultDefinitions/ListPageableTests.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/CollectionResultDefinitions/ListPageableTests.cs @@ -63,7 +63,7 @@ public void TopParameterRenamedToMaxCountInPagingOperation() .OfType().ToList(); Assert.IsTrue(restClientProviders.Count > 0, "RestClientProvider should be generated"); - + var parameterNames = restClientProviders .SelectMany(p => p.Methods) .SelectMany(m => m.Signature.Parameters) @@ -134,7 +134,7 @@ public async Task TopParameterPreservedWhenExistsInLastContractView() Assert.AreEqual("top", topParam!.Name, "Parameter name should be 'top' (from LastContractView), not 'maxCount' (conversion should be prevented)"); } - + [Test] public void NoNextLinkOrContinuationTokenOfT() { diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/Definitions/BinaryContentHelperDefinitionTests.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/Definitions/BinaryContentHelperDefinitionTests.cs index 3e9fbe0bbfa..715bdb21e5b 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/Definitions/BinaryContentHelperDefinitionTests.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/Definitions/BinaryContentHelperDefinitionTests.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. using System; diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/Definitions/MultiPartFormDataBinaryContentDefinitionTests.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/Definitions/MultiPartFormDataBinaryContentDefinitionTests.cs index 19015ea0588..f7481fa91b6 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/Definitions/MultiPartFormDataBinaryContentDefinitionTests.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/Definitions/MultiPartFormDataBinaryContentDefinitionTests.cs @@ -1,11 +1,11 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. using System.Linq; using Microsoft.TypeSpec.Generator.ClientModel.Providers; using Microsoft.TypeSpec.Generator.Tests.Common; -using NUnit.Framework; using Moq; +using NUnit.Framework; namespace Microsoft.TypeSpec.Generator.ClientModel.Tests.Providers.Definitions { diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/Definitions/PipelineRequestHeadersExtensionsDefinitionTests.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/Definitions/PipelineRequestHeadersExtensionsDefinitionTests.cs index 241dece98eb..66b026ff2d4 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/Definitions/PipelineRequestHeadersExtensionsDefinitionTests.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/Definitions/PipelineRequestHeadersExtensionsDefinitionTests.cs @@ -1,8 +1,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -using System.Collections.Generic; using System.ClientModel.Primitives; +using System.Collections.Generic; using System.Linq; using Microsoft.TypeSpec.Generator.ClientModel.Providers; using Microsoft.TypeSpec.Generator.Primitives; diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/EnumProvider/EnumProviderSerializationTests.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/EnumProvider/EnumProviderSerializationTests.cs index d4355c3920d..1ba06a081f6 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/EnumProvider/EnumProviderSerializationTests.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/EnumProvider/EnumProviderSerializationTests.cs @@ -25,17 +25,17 @@ private static object[] ValidateTypes(bool isExtensible) { var intType = InputFactory.Int32Enum( "mockInputEnum", - [ ("One", 1), ("Two", 2)], + [("One", 1), ("Two", 2)], isExtensible: isExtensible); var floatType = InputFactory.Float32Enum( "mockInputEnum", - [ ("One", 1f), ("Two", 2f)], + [("One", 1f), ("Two", 2f)], isExtensible: isExtensible); var stringType = InputFactory.StringEnum( "mockInputEnum", - [ ("One", "1"), ("Two", "2")], + [("One", "1"), ("Two", "2")], isExtensible: isExtensible); return [intType, floatType, stringType]; diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/MrwSerializationTypeDefinitions/DiscriminatorTests.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/MrwSerializationTypeDefinitions/DiscriminatorTests.cs index e5945ad27b1..e09cb635a1f 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/MrwSerializationTypeDefinitions/DiscriminatorTests.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/MrwSerializationTypeDefinitions/DiscriminatorTests.cs @@ -139,7 +139,7 @@ public void UnknownVariantDeserializeShouldUseBaseProperties() var serialization = unknownModel!.SerializationProviders.FirstOrDefault(); Assert.IsNotNull(serialization); var deserializeMethod = serialization!.Methods.FirstOrDefault(m => m.Signature.Name == "DeserializeUnknownPet"); - foreach(var property in _baseModel.Properties) + foreach (var property in _baseModel.Properties) { Assert.IsNotNull( deserializeMethod!.BodyStatements!.ToDisplayString().Contains($"if (property.NameEquals(\"{property.Name}\"u8))"), diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/MrwSerializationTypeDefinitions/DynamicModelSerializationTests.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/MrwSerializationTypeDefinitions/DynamicModelSerializationTests.cs index a06cbeb18ea..3613629c0be 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/MrwSerializationTypeDefinitions/DynamicModelSerializationTests.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/MrwSerializationTypeDefinitions/DynamicModelSerializationTests.cs @@ -1318,7 +1318,7 @@ public void DerivedModelWithoutOwnDynamicPropertiesDoesNotGeneratePropagators() Assert.IsNotNull(model); Assert.IsTrue(model!.IsDynamicModel, "Derived model should be marked as dynamic because base is dynamic"); Assert.IsFalse(model.HasDynamicProperties, "Derived model should not have dynamic properties when neither it nor base have dynamic property types"); - + var serialization = model.SerializationProviders.SingleOrDefault(); Assert.IsNotNull(serialization); @@ -1367,12 +1367,12 @@ public void DerivedModelWithoutDynamicPropertiesButBaseHasDynamicProperties() ]); MockHelpers.LoadMockGenerator(inputModels: () => [baseModel, derivedModel, baseDynamicModel]); - + // Validate base model has dynamic properties and propagators var baseModelProvider = ScmCodeModelGenerator.Instance.TypeFactory.CreateModel(baseModel) as ClientModel.Providers.ScmModelProvider; Assert.IsNotNull(baseModelProvider); Assert.IsTrue(baseModelProvider!.HasDynamicProperties, "Base model should have dynamic properties"); - + var baseSerialization = baseModelProvider.SerializationProviders.SingleOrDefault(); Assert.IsNotNull(baseSerialization); var baseMethods = baseSerialization!.Methods; @@ -1384,7 +1384,7 @@ public void DerivedModelWithoutDynamicPropertiesButBaseHasDynamicProperties() Assert.IsNotNull(derivedModelProvider); Assert.IsTrue(derivedModelProvider!.IsDynamicModel, "Derived model should be marked as dynamic because base is dynamic"); Assert.IsFalse(derivedModelProvider.HasDynamicProperties, "Derived model should not have dynamic properties when it has no dynamic property types of its own"); - + var derivedSerialization = derivedModelProvider.SerializationProviders.SingleOrDefault(); Assert.IsNotNull(derivedSerialization); @@ -1423,7 +1423,7 @@ public void WriteDynamicDerivedModelWithNonDiscriminatedBase() ]); MockHelpers.LoadMockGenerator(inputModels: () => [baseModel, dynamicDerivedModel]); - + // Verify base model is NOT dynamic var baseModelProvider = ScmCodeModelGenerator.Instance.TypeFactory.CreateModel(baseModel) as ClientModel.Providers.ScmModelProvider; Assert.IsNotNull(baseModelProvider); @@ -1479,7 +1479,7 @@ public void DeserializeDynamicDerivedModelWithNonDiscriminatedBase() Assert.IsTrue(derivedModelProvider!.IsDynamicModel, "Derived model should be dynamic"); Assert.IsTrue(derivedModelProvider.Constructors.Count > 0); -var serialization = derivedModelProvider.SerializationProviders.SingleOrDefault(); + var serialization = derivedModelProvider.SerializationProviders.SingleOrDefault(); Assert.IsNotNull(serialization); var writer = new TypeProviderWriter(new FilteredMethodsTypeProvider( diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/MrwSerializationTypeDefinitions/ModelCustomizationTests.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/MrwSerializationTypeDefinitions/ModelCustomizationTests.cs index fcff349c3f3..1ed43b979a1 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/MrwSerializationTypeDefinitions/ModelCustomizationTests.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/MrwSerializationTypeDefinitions/ModelCustomizationTests.cs @@ -367,13 +367,13 @@ public async Task CustomizedExplicitOperatorNotGenerated() var customCodeView = modelProvider.CustomCodeView; Assert.IsNotNull(customCodeView, "CustomCodeView should be detected"); var customMethods = customCodeView!.Methods; - var customOperator = customMethods.FirstOrDefault(m => + var customOperator = customMethods.FirstOrDefault(m => m.Signature.Modifiers.HasFlag(MethodSignatureModifiers.Explicit) && m.Signature.Modifiers.HasFlag(MethodSignatureModifiers.Operator)); Assert.IsNotNull(customOperator, "Custom explicit operator should be detected in CustomCodeView"); // Verify that the custom explicit operator is recognized and not generated - var explicitOperator = serializationProvider!.Methods.FirstOrDefault(m => + var explicitOperator = serializationProvider!.Methods.FirstOrDefault(m => m.Signature.Modifiers.HasFlag(MethodSignatureModifiers.Explicit) && m.Signature.Modifiers.HasFlag(MethodSignatureModifiers.Operator)); Assert.IsNull(explicitOperator, "Custom explicit operator should not be generated"); diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/MrwSerializationTypeDefinitions/MrwSerializationTypeDefinitionTests.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/MrwSerializationTypeDefinitions/MrwSerializationTypeDefinitionTests.cs index 8aab43af3e5..1ea6851d8b1 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/MrwSerializationTypeDefinitions/MrwSerializationTypeDefinitionTests.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/MrwSerializationTypeDefinitions/MrwSerializationTypeDefinitionTests.cs @@ -29,7 +29,7 @@ internal static (ModelProvider Model, MrwSerializationTypeDefinition Serializati var generator = MockHelpers.LoadMockGenerator( inputModels: () => [inputModel], createSerializationsCore: (inputType, typeProvider) => - inputType is InputModelType modelType ? [new MrwSerializationTypeDefinition(modelType, (typeProvider as ModelProvider)!)]: []); + inputType is InputModelType modelType ? [new MrwSerializationTypeDefinition(modelType, (typeProvider as ModelProvider)!)] : []); if (isRootInput) { generator.Object.TypeFactory.RootInputModels.Add(inputModel); @@ -1145,7 +1145,7 @@ public void TestGetDeserializationMethodInvocationForType_InDeserializationMetho var generator = MockHelpers.LoadMockGenerator( inputModels: () => [inputModel, innerModel], createSerializationsCore: (inputType, typeProvider) => - inputType is InputModelType modelType ? [new MrwSerializationTypeDefinition(modelType, (typeProvider as ModelProvider)!)]: []); + inputType is InputModelType modelType ? [new MrwSerializationTypeDefinition(modelType, (typeProvider as ModelProvider)!)] : []); generator.Object.TypeFactory.RootInputModels.Add(inputModel); generator.Object.TypeFactory.RootOutputModels.Add(inputModel); @@ -1183,7 +1183,7 @@ public void TestGetDeserializationMethodInvocationForType_CollectionOfModels() var generator = MockHelpers.LoadMockGenerator( inputModels: () => [inputModel, innerModel], createSerializationsCore: (inputType, typeProvider) => - inputType is InputModelType modelType ? [new MrwSerializationTypeDefinition(modelType, (typeProvider as ModelProvider)!)]: []); + inputType is InputModelType modelType ? [new MrwSerializationTypeDefinition(modelType, (typeProvider as ModelProvider)!)] : []); generator.Object.TypeFactory.RootInputModels.Add(inputModel); generator.Object.TypeFactory.RootOutputModels.Add(inputModel); @@ -1220,7 +1220,7 @@ public void TestGetDeserializationMethodInvocationForType_DictionaryOfModels() var generator = MockHelpers.LoadMockGenerator( inputModels: () => [inputModel, valueModel], createSerializationsCore: (inputType, typeProvider) => - inputType is InputModelType modelType ? [new MrwSerializationTypeDefinition(modelType, (typeProvider as ModelProvider)!)]: []); + inputType is InputModelType modelType ? [new MrwSerializationTypeDefinition(modelType, (typeProvider as ModelProvider)!)] : []); generator.Object.TypeFactory.RootInputModels.Add(inputModel); generator.Object.TypeFactory.RootOutputModels.Add(inputModel); @@ -1250,9 +1250,9 @@ public void TestSerializationTypeNameMatchesModelProviderName() var (model, serialization) = CreateModelAndSerialization(inputModel); // The serialization type name should match the model provider name - Assert.AreEqual(model.Name, serialization.Name, + Assert.AreEqual(model.Name, serialization.Name, "Serialization type name should match ModelProvider name"); - + // The deserialization method should also use the model provider name var deserializationMethod = serialization.BuildDeserializationMethod(); Assert.IsNotNull(deserializationMethod); @@ -1269,29 +1269,29 @@ public void TestArrayEncodingSerializationStatement(string encoding, string expe Enum.TryParse(encoding, ignoreCase: true, out var arrayEncoding); var arrayType = new InputArrayType("TestArray", "TypeSpec.Array", InputPrimitiveType.String); var arrayProperty = new InputModelProperty( - "TestArray", + "TestArray", "Test array property summary", - "Test array property", - arrayType, - true, - false, - null, - false, - "testArray", - false, - false, - null, + "Test array property", + arrayType, + true, + false, + null, + false, + "testArray", + false, + false, + null, new(json: new("testArray")), arrayEncoding); - + var properties = new List { arrayProperty }; var inputModel = new InputModelType("TestModel", "TestNamespace", "TestModel", "public", null, null, "Test model.", InputModelTypeUsage.Input, properties, null, Array.Empty(), null, null, new Dictionary(), null, false, new(), false); var (_, serialization) = CreateModelAndSerialization(inputModel); var writeMethod = serialization.BuildJsonModelWriteCoreMethod(); var methodBody = writeMethod.BodyStatements!.ToDisplayString(); - - Assert.IsTrue(methodBody.Contains($"string.Join(\"{expectedDelimiter}\", TestArray)"), + + Assert.IsTrue(methodBody.Contains($"string.Join(\"{expectedDelimiter}\", TestArray)"), $"Expected serialization to use string.Join with delimiter '{expectedDelimiter}', but got: {methodBody}"); } @@ -1304,21 +1304,21 @@ public void TestArrayEncodingDeserializationStatement(string encoding, string ex Enum.TryParse(encoding, ignoreCase: true, out var arrayEncoding); var arrayType = new InputArrayType("TestArray", "TypeSpec.Array", InputPrimitiveType.String); var arrayProperty = new InputModelProperty( - "TestArray", + "TestArray", "Test array property summary", - "Test array property", - arrayType, - true, - false, - null, - false, - "testArray", - false, - false, - null, + "Test array property", + arrayType, + true, + false, + null, + false, + "testArray", + false, + false, + null, new(json: new("testArray")), arrayEncoding); - + var properties = new List { arrayProperty }; var inputModel = new InputModelType("TestModel", "TestNamespace", "TestModel", "public", null, null, "Test model.", InputModelTypeUsage.Input, properties, null, Array.Empty(), null, null, new Dictionary(), null, false, new(), false); diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/RestClientProviders/RestClientProviderTests.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/RestClientProviders/RestClientProviderTests.cs index 1e0509129c9..0111de0dc0e 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/RestClientProviders/RestClientProviderTests.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/RestClientProviders/RestClientProviderTests.cs @@ -8,13 +8,13 @@ using Microsoft.CodeAnalysis; using Microsoft.TypeSpec.Generator.ClientModel.Providers; using Microsoft.TypeSpec.Generator.Input; +using Microsoft.TypeSpec.Generator.Input.Extensions; using Microsoft.TypeSpec.Generator.Primitives; using Microsoft.TypeSpec.Generator.Providers; -using Microsoft.TypeSpec.Generator.Tests.Common; -using NUnit.Framework; using Microsoft.TypeSpec.Generator.Snippets; using Microsoft.TypeSpec.Generator.Statements; -using Microsoft.TypeSpec.Generator.Input.Extensions; +using Microsoft.TypeSpec.Generator.Tests.Common; +using NUnit.Framework; namespace Microsoft.TypeSpec.Generator.ClientModel.Tests.Providers.RestClientProviders { @@ -533,7 +533,7 @@ public void ValidateGetResponseClassifiersThrowsWhenNoSuccess() try { - var methods = restClientProvider.Methods; + var methods = restClientProvider.Methods; } catch (InvalidOperationException e) { diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ScmModelProvider/ScmModelProviderTests.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ScmModelProvider/ScmModelProviderTests.cs index 9dfe03131ff..86d0fce01d6 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ScmModelProvider/ScmModelProviderTests.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ScmModelProvider/ScmModelProviderTests.cs @@ -62,7 +62,7 @@ public void TestSingleDiscriminatorDynamicModel(bool validateBase) InputFactory.Property("kind", InputPrimitiveType.String, isRequired: true, isDiscriminator: true), InputFactory.Property("name", InputPrimitiveType.String, isRequired: true) ], - discriminatedModels: new Dictionary() { {"cat", catModel } }); + discriminatedModels: new Dictionary() { { "cat", catModel } }); MockHelpers.LoadMockGenerator(inputModels: () => [baseModel, catModel]); var outputLibrary = ScmCodeModelGenerator.Instance.OutputLibrary; diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ClientOptionsProviderTests/MultiServiceClient_GeneratesExpectedClientOptions.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ClientOptionsProviderTests/MultiServiceClient_GeneratesExpectedClientOptions.cs index f3f3227ef90..1eb960fa71f 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ClientOptionsProviderTests/MultiServiceClient_GeneratesExpectedClientOptions.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ClientOptionsProviderTests/MultiServiceClient_GeneratesExpectedClientOptions.cs @@ -4,6 +4,8 @@ using System; using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; +using Microsoft.Extensions.Configuration; namespace Sample { @@ -28,6 +30,25 @@ public TestClientOptions(global::Sample.TestClientOptions.ServiceAVersion servic }; } + [global::System.Diagnostics.CodeAnalysis.ExperimentalAttribute("SCME0002")] + internal TestClientOptions(global::Microsoft.Extensions.Configuration.IConfigurationSection section) : base(section) + { + ServiceAApiVersion = "2.0"; + ServiceBApiVersion = "4.0"; + if (((section is null) || !section.Exists())) + { + return; + } + if ((section["ServiceAApiVersion"] is string serviceAApiVersion)) + { + this.ServiceAApiVersion = serviceAApiVersion; + } + if ((section["ServiceBApiVersion"] is string serviceBApiVersion)) + { + this.ServiceBApiVersion = serviceBApiVersion; + } + } + internal string ServiceAApiVersion { get; } internal string ServiceBApiVersion { get; } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ClientOptionsProviderTests/MultiServiceClient_WithThreeServices_GeneratesExpectedClientOptions.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ClientOptionsProviderTests/MultiServiceClient_WithThreeServices_GeneratesExpectedClientOptions.cs index d7c4856dae2..1dffdca1dbb 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ClientOptionsProviderTests/MultiServiceClient_WithThreeServices_GeneratesExpectedClientOptions.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ClientOptionsProviderTests/MultiServiceClient_WithThreeServices_GeneratesExpectedClientOptions.cs @@ -4,6 +4,8 @@ using System; using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; +using Microsoft.Extensions.Configuration; namespace Sample { @@ -36,6 +38,30 @@ public TestClientOptions(global::Sample.TestClientOptions.ServiceKeyVaultVersion }; } + [global::System.Diagnostics.CodeAnalysis.ExperimentalAttribute("SCME0002")] + internal TestClientOptions(global::Microsoft.Extensions.Configuration.IConfigurationSection section) : base(section) + { + ServiceComputeApiVersion = "2024-07-01"; + ServiceKeyVaultApiVersion = "7.5"; + ServiceStorageApiVersion = "2024-01-01"; + if (((section is null) || !section.Exists())) + { + return; + } + if ((section["ServiceComputeApiVersion"] is string serviceComputeApiVersion)) + { + this.ServiceComputeApiVersion = serviceComputeApiVersion; + } + if ((section["ServiceKeyVaultApiVersion"] is string serviceKeyVaultApiVersion)) + { + this.ServiceKeyVaultApiVersion = serviceKeyVaultApiVersion; + } + if ((section["ServiceStorageApiVersion"] is string serviceStorageApiVersion)) + { + this.ServiceStorageApiVersion = serviceStorageApiVersion; + } + } + internal string ServiceComputeApiVersion { get; } internal string ServiceKeyVaultApiVersion { get; } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ClientOptionsProviderTests/MultiServiceCombinedClient_GeneratesExpectedClientOptions.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ClientOptionsProviderTests/MultiServiceCombinedClient_GeneratesExpectedClientOptions.cs index f3f3227ef90..1eb960fa71f 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ClientOptionsProviderTests/MultiServiceCombinedClient_GeneratesExpectedClientOptions.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ClientOptionsProviderTests/MultiServiceCombinedClient_GeneratesExpectedClientOptions.cs @@ -4,6 +4,8 @@ using System; using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; +using Microsoft.Extensions.Configuration; namespace Sample { @@ -28,6 +30,25 @@ public TestClientOptions(global::Sample.TestClientOptions.ServiceAVersion servic }; } + [global::System.Diagnostics.CodeAnalysis.ExperimentalAttribute("SCME0002")] + internal TestClientOptions(global::Microsoft.Extensions.Configuration.IConfigurationSection section) : base(section) + { + ServiceAApiVersion = "2.0"; + ServiceBApiVersion = "4.0"; + if (((section is null) || !section.Exists())) + { + return; + } + if ((section["ServiceAApiVersion"] is string serviceAApiVersion)) + { + this.ServiceAApiVersion = serviceAApiVersion; + } + if ((section["ServiceBApiVersion"] is string serviceBApiVersion)) + { + this.ServiceBApiVersion = serviceBApiVersion; + } + } + internal string ServiceAApiVersion { get; } internal string ServiceBApiVersion { get; } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ClientOptionsProviderTests/MultiServiceCombinedClient_WithThreeServices_GeneratesExpectedClientOptions.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ClientOptionsProviderTests/MultiServiceCombinedClient_WithThreeServices_GeneratesExpectedClientOptions.cs index d7c4856dae2..1dffdca1dbb 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ClientOptionsProviderTests/MultiServiceCombinedClient_WithThreeServices_GeneratesExpectedClientOptions.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ClientOptionsProviderTests/MultiServiceCombinedClient_WithThreeServices_GeneratesExpectedClientOptions.cs @@ -4,6 +4,8 @@ using System; using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; +using Microsoft.Extensions.Configuration; namespace Sample { @@ -36,6 +38,30 @@ public TestClientOptions(global::Sample.TestClientOptions.ServiceKeyVaultVersion }; } + [global::System.Diagnostics.CodeAnalysis.ExperimentalAttribute("SCME0002")] + internal TestClientOptions(global::Microsoft.Extensions.Configuration.IConfigurationSection section) : base(section) + { + ServiceComputeApiVersion = "2024-07-01"; + ServiceKeyVaultApiVersion = "7.5"; + ServiceStorageApiVersion = "2024-01-01"; + if (((section is null) || !section.Exists())) + { + return; + } + if ((section["ServiceComputeApiVersion"] is string serviceComputeApiVersion)) + { + this.ServiceComputeApiVersion = serviceComputeApiVersion; + } + if ((section["ServiceKeyVaultApiVersion"] is string serviceKeyVaultApiVersion)) + { + this.ServiceKeyVaultApiVersion = serviceKeyVaultApiVersion; + } + if ((section["ServiceStorageApiVersion"] is string serviceStorageApiVersion)) + { + this.ServiceStorageApiVersion = serviceStorageApiVersion; + } + } + internal string ServiceComputeApiVersion { get; } internal string ServiceKeyVaultApiVersion { get; } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/TestHelpers/TestRequestContentApi.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/TestHelpers/TestRequestContentApi.cs index 106afd687af..3c84cc249ea 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/TestHelpers/TestRequestContentApi.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/TestHelpers/TestRequestContentApi.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. using Microsoft.TypeSpec.Generator.ClientModel.Providers; diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Expressions/ValueExpression.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Expressions/ValueExpression.cs index 35de326bf4d..0e37d14cd15 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Expressions/ValueExpression.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Expressions/ValueExpression.cs @@ -126,6 +126,8 @@ public InvokeMethodExpression Invoke(string methodName, IReadOnlyList Is(ValueExpression other) => new BinaryOperatorExpression("is", this, other).As(); + public ScopedApi IsNot(ValueExpression other) => new BinaryOperatorExpression("is not", this, other).As(); + public UnaryOperatorExpression Increment() => new UnaryOperatorExpression("++", this, true); public ValueExpression AndExpr(ValueExpression other) => new BinaryOperatorExpression("and", this, other); diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Snippets/Snippet.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Snippets/Snippet.cs index 783263be300..bfb6e7360ff 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Snippets/Snippet.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Snippets/Snippet.cs @@ -15,6 +15,7 @@ public static partial class Snippet { public static ScopedApi Equal(this ParameterProvider parameter, ValueExpression other) => new BinaryOperatorExpression("==", parameter, other).As(); public static ScopedApi Is(this ParameterProvider parameter, ValueExpression other) => new BinaryOperatorExpression("is", parameter, other).As(); + public static ScopedApi IsNot(this ParameterProvider parameter, ValueExpression other) => new BinaryOperatorExpression("is not", parameter, other).As(); public static ScopedApi As(this ParameterProvider parameter, CSharpType type) => ((ValueExpression)parameter).As(type); public static ScopedApi As(this ParameterProvider parameter) => ((ValueExpression)parameter).As(); diff --git a/packages/http-client-csharp/generator/Packages.Data.props b/packages/http-client-csharp/generator/Packages.Data.props index 3a46d074dfa..332a7ad5ab8 100644 --- a/packages/http-client-csharp/generator/Packages.Data.props +++ b/packages/http-client-csharp/generator/Packages.Data.props @@ -15,6 +15,7 @@ + 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..78cb15103f5 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 @@ -9,6 +9,7 @@ using System.ClientModel; using System.ClientModel.Primitives; using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; using System.Linq; using System.Threading; using System.Threading.Tasks; @@ -20,13 +21,9 @@ namespace SampleTypeSpec public partial class SampleTypeSpecClient { private readonly Uri _endpoint; - /// A credential used to authenticate to the service. - private readonly ApiKeyCredential _keyCredential; private const string AuthorizationHeader = "my-api-key"; - /// A credential provider used to authenticate to the service. - private readonly AuthenticationTokenProvider _tokenProvider; /// The OAuth2 flows supported by the service. - private readonly Dictionary[] _flows = new Dictionary[] + private static readonly Dictionary[] _flows = new Dictionary[] { new Dictionary { @@ -55,39 +52,43 @@ protected SampleTypeSpecClient() } /// Initializes a new instance of SampleTypeSpecClient. + /// The authentication policy to use for pipeline creation. /// 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) + internal SampleTypeSpecClient(AuthenticationPolicy authenticationPolicy, Uri endpoint, SampleTypeSpecClientOptions options) { Argument.AssertNotNull(endpoint, nameof(endpoint)); - Argument.AssertNotNull(credential, nameof(credential)); options ??= new SampleTypeSpecClientOptions(); _endpoint = endpoint; - _keyCredential = credential; - Pipeline = ClientPipeline.Create(options, Array.Empty(), new PipelinePolicy[] { new UserAgentPolicy(typeof(SampleTypeSpecClient).Assembly), ApiKeyAuthenticationPolicy.CreateHeaderApiKeyPolicy(_keyCredential, AuthorizationHeader) }, Array.Empty()); + Pipeline = ClientPipeline.Create(options, Array.Empty(), new PipelinePolicy[] { new UserAgentPolicy(typeof(SampleTypeSpecClient).Assembly), authenticationPolicy }, Array.Empty()); _apiVersion = options.Version; } + /// 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) : this(ApiKeyAuthenticationPolicy.CreateHeaderApiKeyPolicy(credential, AuthorizationHeader), endpoint, options) + { + } + /// 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) + public SampleTypeSpecClient(Uri endpoint, AuthenticationTokenProvider tokenProvider, SampleTypeSpecClientOptions options) : this(new BearerTokenPolicy(tokenProvider, _flows), endpoint, options) { - Argument.AssertNotNull(endpoint, nameof(endpoint)); - Argument.AssertNotNull(tokenProvider, nameof(tokenProvider)); - - options ??= new SampleTypeSpecClientOptions(); + } - _endpoint = endpoint; - _tokenProvider = tokenProvider; - Pipeline = ClientPipeline.Create(options, Array.Empty(), new PipelinePolicy[] { new UserAgentPolicy(typeof(SampleTypeSpecClient).Assembly), new BearerTokenPolicy(_tokenProvider, _flows) }, Array.Empty()); - _apiVersion = options.Version; + /// Initializes a new instance of SampleTypeSpecClient from a . + /// The settings for SampleTypeSpecClient. + [Experimental("SCME0002")] + public SampleTypeSpecClient(SampleTypeSpecClientSettings settings) : this(AuthenticationPolicy.Create(settings), settings?.SampleTypeSpecUrl, settings?.Options) + { } /// The HTTP pipeline for sending and receiving REST requests and responses. diff --git a/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/SampleTypeSpecClientOptions.cs b/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/SampleTypeSpecClientOptions.cs index 43baf1ff90f..e26fb92bc89 100644 --- a/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/SampleTypeSpecClientOptions.cs +++ b/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/SampleTypeSpecClientOptions.cs @@ -7,6 +7,8 @@ using System; using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; +using Microsoft.Extensions.Configuration; namespace SampleTypeSpec { @@ -27,6 +29,22 @@ public SampleTypeSpecClientOptions(ServiceVersion version = LatestVersion) }; } + /// Initializes a new instance of SampleTypeSpecClientOptions from configuration. + /// The configuration section. + [Experimental("SCME0002")] + internal SampleTypeSpecClientOptions(IConfigurationSection section) : base(section) + { + Version = "2024-08-16-preview"; + if (section is null || !section.Exists()) + { + return; + } + if (section["Version"] is string version) + { + Version = version; + } + } + /// Gets the Version. internal string Version { get; } diff --git a/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/SampleTypeSpecClientSettings.cs b/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/SampleTypeSpecClientSettings.cs new file mode 100644 index 00000000000..ecda8d3d801 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/SampleTypeSpecClientSettings.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; +using Microsoft.Extensions.Configuration; + +namespace SampleTypeSpec +{ + /// Represents the settings used to configure a that can be loaded from an . + [Experimental("SCME0002")] + public partial class SampleTypeSpecClientSettings : ClientSettings + { + /// Gets or sets the SampleTypeSpecUrl. + public Uri SampleTypeSpecUrl { get; set; } + + /// Gets or sets the Options. + public SampleTypeSpecClientOptions Options { get; set; } + + /// Binds configuration values from the given section. + /// The configuration section. + protected override void BindCore(IConfigurationSection section) + { + if (Uri.TryCreate(section["SampleTypeSpecUrl"], UriKind.Absolute, out Uri sampleTypeSpecUrl)) + { + SampleTypeSpecUrl = sampleTypeSpecUrl; + } + IConfigurationSection optionsSection = section.GetSection("Options"); + if (optionsSection.Exists()) + { + Options = new SampleTypeSpecClientOptions(optionsSection); + } + } + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/Spector.Tests/Http/Authentication/OAuth2/OAuth2Tests.cs b/packages/http-client-csharp/generator/TestProjects/Spector.Tests/Http/Authentication/OAuth2/OAuth2Tests.cs index dc6e99bee90..f40e866724e 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector.Tests/Http/Authentication/OAuth2/OAuth2Tests.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector.Tests/Http/Authentication/OAuth2/OAuth2Tests.cs @@ -22,12 +22,12 @@ public Task Valid() => Test(async (host) => // create a test client to access the private field "_flows". This will be used to pass to the test token provider. var tokenProvider = new ClientCredentialTokenProvider("myClientId", "myClientSecret"); var testClient = new OAuth2Client(tokenProvider); - var flowsField = testClient.GetType().GetField("_flows", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance); + var flowsField = testClient.GetType().GetField("_flows", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Static); Assert.IsNotNull(flowsField, "Flows field should not be null"); - Assert.IsInstanceOf[]>(flowsField!.GetValue(testClient), "Flows field should be of type Dictionary[]"); + Assert.IsInstanceOf[]>(flowsField!.GetValue(null), "Flows field should be of type Dictionary[]"); // Retrieve the value of the field and cast it to the expected type. - var flows = flowsField!.GetValue(testClient) as Dictionary[]; + var flows = flowsField!.GetValue(null) as Dictionary[]; Assert.IsNotNull(flows, "Flows field should be of type Dictionary[]"); // Parse the generated scope to use in the test. @@ -62,12 +62,12 @@ public Task Invalid() => Test((host) => // create a test client to access the private field "_flows". This will be used to pass to the test token provider. var tokenProvider = new ClientCredentialTokenProvider("myClientId", "myClientSecret"); var testClient = new OAuth2Client(tokenProvider); - var flowsField = testClient.GetType().GetField("_flows", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance); + var flowsField = testClient.GetType().GetField("_flows", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Static); Assert.IsNotNull(flowsField, "Flows field should not be null"); - Assert.IsInstanceOf[]>(flowsField!.GetValue(testClient), "Flows field should be of type Dictionary[]"); + Assert.IsInstanceOf[]>(flowsField!.GetValue(null), "Flows field should be of type Dictionary[]"); // Retrieve the value of the field and cast it to the expected type. - var flows = flowsField!.GetValue(testClient) as Dictionary[]; + var flows = flowsField!.GetValue(null) as Dictionary[]; Assert.IsNotNull(flows, "Flows field should be of type Dictionary[]"); // Parse the generated scope to use in the test. diff --git a/packages/http-client-csharp/generator/TestProjects/Spector.Tests/Http/Authentication/Union/UnionAuthTests.cs b/packages/http-client-csharp/generator/TestProjects/Spector.Tests/Http/Authentication/Union/UnionAuthTests.cs index e95d981e829..00084d6ed77 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector.Tests/Http/Authentication/Union/UnionAuthTests.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector.Tests/Http/Authentication/Union/UnionAuthTests.cs @@ -29,12 +29,12 @@ public Task AuthenticationUnionValidToken() => Test(async (host) => // create a test client to access the private field "_flows". This will be used to pass to the test token provider. var tokenProvider = new ClientCredentialTokenProvider("myClientId", "myClientSecret"); var testClient = new UnionClient(tokenProvider); - var flowsField = testClient.GetType().GetField("_flows", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance); + var flowsField = testClient.GetType().GetField("_flows", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Static); Assert.IsNotNull(flowsField, "Flows field should not be null"); - Assert.IsInstanceOf[]>(flowsField!.GetValue(testClient), "Flows field should be of type Dictionary[]"); + Assert.IsInstanceOf[]>(flowsField!.GetValue(null), "Flows field should be of type Dictionary[]"); // Retrieve the value of the field and cast it to the expected type. - var flows = flowsField!.GetValue(testClient) as Dictionary[]; + var flows = flowsField!.GetValue(null) as Dictionary[]; Assert.IsNotNull(flows, "Flows field should be of type Dictionary[]"); // Parse the generated scope to use in the test. diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/api-key/src/Generated/ApiKeyClient.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/api-key/src/Generated/ApiKeyClient.cs index 4cc79b324ba..bb90d193964 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/api-key/src/Generated/ApiKeyClient.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/api-key/src/Generated/ApiKeyClient.cs @@ -5,6 +5,7 @@ using System; using System.ClientModel; using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; using System.Threading; using System.Threading.Tasks; @@ -12,13 +13,20 @@ namespace Authentication.ApiKey { public partial class ApiKeyClient { + private const string AuthorizationHeader = "x-ms-api-key"; + protected ApiKeyClient() => throw null; public ApiKeyClient(ApiKeyCredential credential) : this(new Uri("http://localhost:3000"), credential, new ApiKeyClientOptions()) => throw null; public ApiKeyClient(ApiKeyCredential credential, ApiKeyClientOptions options) : this(new Uri("http://localhost:3000"), credential, options) => throw null; - public ApiKeyClient(Uri endpoint, ApiKeyCredential credential, ApiKeyClientOptions options) => throw null; + internal ApiKeyClient(AuthenticationPolicy authenticationPolicy, Uri endpoint, ApiKeyClientOptions options) => throw null; + + public ApiKeyClient(Uri endpoint, ApiKeyCredential credential, ApiKeyClientOptions options) : this(ApiKeyAuthenticationPolicy.CreateHeaderApiKeyPolicy(credential, AuthorizationHeader), endpoint, options) => throw null; + + [Experimental("SCME0002")] + public ApiKeyClient(ApiKeyClientSettings settings) : this(AuthenticationPolicy.Create(settings), settings?.Endpoint, settings?.Options) => throw null; public ClientPipeline Pipeline => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/api-key/src/Generated/ApiKeyClientOptions.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/api-key/src/Generated/ApiKeyClientOptions.cs index 898f3926f96..7f1d0ec3a4c 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/api-key/src/Generated/ApiKeyClientOptions.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/api-key/src/Generated/ApiKeyClientOptions.cs @@ -3,10 +3,16 @@ #nullable disable using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; +using Microsoft.Extensions.Configuration; namespace Authentication.ApiKey { public partial class ApiKeyClientOptions : ClientPipelineOptions { + public ApiKeyClientOptions() => throw null; + + [Experimental("SCME0002")] + internal ApiKeyClientOptions(IConfigurationSection section) : base(section) => throw null; } } diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/api-key/src/Generated/ApiKeyClientSettings.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/api-key/src/Generated/ApiKeyClientSettings.cs new file mode 100644 index 00000000000..54fd6f05531 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/api-key/src/Generated/ApiKeyClientSettings.cs @@ -0,0 +1,29 @@ +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; +using Microsoft.Extensions.Configuration; + +namespace Authentication.ApiKey +{ + [Experimental("SCME0002")] + public partial class ApiKeyClientSettings : ClientSettings + { + public Uri Endpoint + { + get => throw null; + set => throw null; + } + + public ApiKeyClientOptions Options + { + get => throw null; + set => throw null; + } + + protected override void BindCore(IConfigurationSection section) => throw null; + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/http/custom/src/Generated/CustomClient.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/http/custom/src/Generated/CustomClient.cs index 1bae28cfe95..25ff19d43b1 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/http/custom/src/Generated/CustomClient.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/http/custom/src/Generated/CustomClient.cs @@ -5,6 +5,7 @@ using System; using System.ClientModel; using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; using System.Threading; using System.Threading.Tasks; @@ -12,13 +13,21 @@ namespace Authentication.Http.Custom { public partial class CustomClient { + private const string AuthorizationHeader = "Authorization"; + private const string AuthorizationApiKeyPrefix = "SharedAccessKey"; + protected CustomClient() => throw null; public CustomClient(ApiKeyCredential credential) : this(new Uri("http://localhost:3000"), credential, new CustomClientOptions()) => throw null; public CustomClient(ApiKeyCredential credential, CustomClientOptions options) : this(new Uri("http://localhost:3000"), credential, options) => throw null; - public CustomClient(Uri endpoint, ApiKeyCredential credential, CustomClientOptions options) => throw null; + internal CustomClient(AuthenticationPolicy authenticationPolicy, Uri endpoint, CustomClientOptions options) => throw null; + + public CustomClient(Uri endpoint, ApiKeyCredential credential, CustomClientOptions options) : this(ApiKeyAuthenticationPolicy.CreateHeaderApiKeyPolicy(credential, AuthorizationHeader, AuthorizationApiKeyPrefix), endpoint, options) => throw null; + + [Experimental("SCME0002")] + public CustomClient(CustomClientSettings settings) : this(AuthenticationPolicy.Create(settings), settings?.Endpoint, settings?.Options) => throw null; public ClientPipeline Pipeline => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/http/custom/src/Generated/CustomClientOptions.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/http/custom/src/Generated/CustomClientOptions.cs index bd234ac920d..ae206c5cecf 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/http/custom/src/Generated/CustomClientOptions.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/http/custom/src/Generated/CustomClientOptions.cs @@ -3,10 +3,16 @@ #nullable disable using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; +using Microsoft.Extensions.Configuration; namespace Authentication.Http.Custom { public partial class CustomClientOptions : ClientPipelineOptions { + public CustomClientOptions() => throw null; + + [Experimental("SCME0002")] + internal CustomClientOptions(IConfigurationSection section) : base(section) => throw null; } } diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/http/custom/src/Generated/CustomClientSettings.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/http/custom/src/Generated/CustomClientSettings.cs new file mode 100644 index 00000000000..2a96fe4f0e7 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/http/custom/src/Generated/CustomClientSettings.cs @@ -0,0 +1,29 @@ +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; +using Microsoft.Extensions.Configuration; + +namespace Authentication.Http.Custom +{ + [Experimental("SCME0002")] + public partial class CustomClientSettings : ClientSettings + { + public Uri Endpoint + { + get => throw null; + set => throw null; + } + + public CustomClientOptions Options + { + get => throw null; + set => throw null; + } + + protected override void BindCore(IConfigurationSection section) => throw null; + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/oauth2/src/Generated/OAuth2Client.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/oauth2/src/Generated/OAuth2Client.cs index be4fc518c9f..0b34d500610 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/oauth2/src/Generated/OAuth2Client.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/oauth2/src/Generated/OAuth2Client.cs @@ -5,6 +5,8 @@ using System; using System.ClientModel; using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; using System.Threading; using System.Threading.Tasks; @@ -12,13 +14,28 @@ namespace Authentication.OAuth2 { public partial class OAuth2Client { + /// The OAuth2 flows supported by the service. + private static readonly Dictionary[] _flows = new Dictionary[] + { + new Dictionary + { + { GetTokenOptions.ScopesPropertyName, new string[] { "https://security.microsoft.com/.default" } }, + { GetTokenOptions.AuthorizationUrlPropertyName, "https://login.microsoftonline.com/common/oauth2/authorize" } + } + }; + protected OAuth2Client() => throw null; public OAuth2Client(AuthenticationTokenProvider tokenProvider) : this(new Uri("http://localhost:3000"), tokenProvider, new OAuth2ClientOptions()) => throw null; public OAuth2Client(AuthenticationTokenProvider tokenProvider, OAuth2ClientOptions options) : this(new Uri("http://localhost:3000"), tokenProvider, options) => throw null; - public OAuth2Client(Uri endpoint, AuthenticationTokenProvider tokenProvider, OAuth2ClientOptions options) => throw null; + internal OAuth2Client(AuthenticationPolicy authenticationPolicy, Uri endpoint, OAuth2ClientOptions options) => throw null; + + public OAuth2Client(Uri endpoint, AuthenticationTokenProvider tokenProvider, OAuth2ClientOptions options) : this(new BearerTokenPolicy(tokenProvider, _flows), endpoint, options) => throw null; + + [Experimental("SCME0002")] + public OAuth2Client(OAuth2ClientSettings settings) : this(AuthenticationPolicy.Create(settings), settings?.Endpoint, settings?.Options) => throw null; public ClientPipeline Pipeline => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/oauth2/src/Generated/OAuth2ClientOptions.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/oauth2/src/Generated/OAuth2ClientOptions.cs index 1c41f844e44..8fc4380d187 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/oauth2/src/Generated/OAuth2ClientOptions.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/oauth2/src/Generated/OAuth2ClientOptions.cs @@ -3,10 +3,16 @@ #nullable disable using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; +using Microsoft.Extensions.Configuration; namespace Authentication.OAuth2 { public partial class OAuth2ClientOptions : ClientPipelineOptions { + public OAuth2ClientOptions() => throw null; + + [Experimental("SCME0002")] + internal OAuth2ClientOptions(IConfigurationSection section) : base(section) => throw null; } } diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/oauth2/src/Generated/OAuth2ClientSettings.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/oauth2/src/Generated/OAuth2ClientSettings.cs new file mode 100644 index 00000000000..1051c7cf048 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/oauth2/src/Generated/OAuth2ClientSettings.cs @@ -0,0 +1,29 @@ +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; +using Microsoft.Extensions.Configuration; + +namespace Authentication.OAuth2 +{ + [Experimental("SCME0002")] + public partial class OAuth2ClientSettings : ClientSettings + { + public Uri Endpoint + { + get => throw null; + set => throw null; + } + + public OAuth2ClientOptions Options + { + get => throw null; + set => throw null; + } + + protected override void BindCore(IConfigurationSection section) => throw null; + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/union/src/Generated/UnionClient.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/union/src/Generated/UnionClient.cs index f7f4255c91e..cf14844ba08 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/union/src/Generated/UnionClient.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/union/src/Generated/UnionClient.cs @@ -5,6 +5,8 @@ using System; using System.ClientModel; using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; using System.Threading; using System.Threading.Tasks; @@ -12,6 +14,17 @@ namespace Authentication.Union { public partial class UnionClient { + private const string AuthorizationHeader = "x-ms-api-key"; + /// The OAuth2 flows supported by the service. + private static readonly Dictionary[] _flows = new Dictionary[] + { + new Dictionary + { + { GetTokenOptions.ScopesPropertyName, new string[] { "https://security.microsoft.com/.default" } }, + { GetTokenOptions.AuthorizationUrlPropertyName, "https://login.microsoftonline.com/common/oauth2/authorize" } + } + }; + protected UnionClient() => throw null; public UnionClient(ApiKeyCredential credential) : this(new Uri("http://localhost:3000"), credential, new UnionClientOptions()) => throw null; @@ -22,9 +35,14 @@ public partial class UnionClient public UnionClient(AuthenticationTokenProvider tokenProvider, UnionClientOptions options) : this(new Uri("http://localhost:3000"), tokenProvider, options) => throw null; - public UnionClient(Uri endpoint, ApiKeyCredential credential, UnionClientOptions options) => throw null; + internal UnionClient(AuthenticationPolicy authenticationPolicy, Uri endpoint, UnionClientOptions options) => throw null; + + public UnionClient(Uri endpoint, ApiKeyCredential credential, UnionClientOptions options) : this(ApiKeyAuthenticationPolicy.CreateHeaderApiKeyPolicy(credential, AuthorizationHeader), endpoint, options) => throw null; + + public UnionClient(Uri endpoint, AuthenticationTokenProvider tokenProvider, UnionClientOptions options) : this(new BearerTokenPolicy(tokenProvider, _flows), endpoint, options) => throw null; - public UnionClient(Uri endpoint, AuthenticationTokenProvider tokenProvider, UnionClientOptions options) => throw null; + [Experimental("SCME0002")] + public UnionClient(UnionClientSettings settings) : this(AuthenticationPolicy.Create(settings), settings?.Endpoint, settings?.Options) => throw null; public ClientPipeline Pipeline => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/union/src/Generated/UnionClientOptions.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/union/src/Generated/UnionClientOptions.cs index 3a0a17570ae..c75e08f6cee 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/union/src/Generated/UnionClientOptions.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/union/src/Generated/UnionClientOptions.cs @@ -3,10 +3,16 @@ #nullable disable using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; +using Microsoft.Extensions.Configuration; namespace Authentication.Union { public partial class UnionClientOptions : ClientPipelineOptions { + public UnionClientOptions() => throw null; + + [Experimental("SCME0002")] + internal UnionClientOptions(IConfigurationSection section) : base(section) => throw null; } } diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/union/src/Generated/UnionClientSettings.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/union/src/Generated/UnionClientSettings.cs new file mode 100644 index 00000000000..f14eadcbcd3 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/union/src/Generated/UnionClientSettings.cs @@ -0,0 +1,29 @@ +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; +using Microsoft.Extensions.Configuration; + +namespace Authentication.Union +{ + [Experimental("SCME0002")] + public partial class UnionClientSettings : ClientSettings + { + public Uri Endpoint + { + get => throw null; + set => throw null; + } + + public UnionClientOptions Options + { + get => throw null; + set => throw null; + } + + protected override void BindCore(IConfigurationSection section) => throw null; + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/client-operation-group/src/Generated/FirstClient.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/client-operation-group/src/Generated/FirstClient.cs index 09efa090360..0ae16d068ff 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/client-operation-group/src/Generated/FirstClient.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/client-operation-group/src/Generated/FirstClient.cs @@ -5,6 +5,7 @@ using System; using System.ClientModel; using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; using System.Threading; using System.Threading.Tasks; using Client.Structure.Service; @@ -17,7 +18,12 @@ public partial class FirstClient public FirstClient(Uri endpoint, ClientType client) : this(endpoint, client, new FirstClientOptions()) => throw null; - public FirstClient(Uri endpoint, ClientType client, FirstClientOptions options) => throw null; + internal FirstClient(AuthenticationPolicy authenticationPolicy, Uri endpoint, ClientType client, FirstClientOptions options) => throw null; + + public FirstClient(Uri endpoint, ClientType client, FirstClientOptions options) : this(null, endpoint, client, options) => throw null; + + [Experimental("SCME0002")] + public FirstClient(FirstClientSettings settings) : this(AuthenticationPolicy.Create(settings), settings?.Endpoint, settings?.Client ?? default, settings?.Options) => throw null; public ClientPipeline Pipeline => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/client-operation-group/src/Generated/FirstClientOptions.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/client-operation-group/src/Generated/FirstClientOptions.cs index 881ed44ef7e..6a8bb3b3dab 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/client-operation-group/src/Generated/FirstClientOptions.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/client-operation-group/src/Generated/FirstClientOptions.cs @@ -3,10 +3,16 @@ #nullable disable using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; +using Microsoft.Extensions.Configuration; namespace Client.Structure.ClientOperationGroup { public partial class FirstClientOptions : ClientPipelineOptions { + public FirstClientOptions() => throw null; + + [Experimental("SCME0002")] + internal FirstClientOptions(IConfigurationSection section) : base(section) => throw null; } } diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/client-operation-group/src/Generated/FirstClientSettings.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/client-operation-group/src/Generated/FirstClientSettings.cs new file mode 100644 index 00000000000..47fe311045d --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/client-operation-group/src/Generated/FirstClientSettings.cs @@ -0,0 +1,36 @@ +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; +using Client.Structure.Service; +using Microsoft.Extensions.Configuration; + +namespace Client.Structure.ClientOperationGroup +{ + [Experimental("SCME0002")] + public partial class FirstClientSettings : ClientSettings + { + public Uri Endpoint + { + get => throw null; + set => throw null; + } + + public ClientType? Client + { + get => throw null; + set => throw null; + } + + public FirstClientOptions Options + { + get => throw null; + set => throw null; + } + + protected override void BindCore(IConfigurationSection section) => throw null; + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/client-operation-group/src/Generated/Group3.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/client-operation-group/src/Generated/Group3.cs index 36f592b901d..424b1f729bd 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/client-operation-group/src/Generated/Group3.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/client-operation-group/src/Generated/Group3.cs @@ -2,10 +2,12 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Threading; using System.Threading.Tasks; +using Client.Structure.Service; namespace Client.Structure.ClientOperationGroup { @@ -13,6 +15,8 @@ public partial class Group3 { protected Group3() => throw null; + internal Group3(ClientPipeline pipeline, Uri endpoint, ClientType client) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult Two(RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/client-operation-group/src/Generated/Group4.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/client-operation-group/src/Generated/Group4.cs index 5470b3bbc52..6f372e14c53 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/client-operation-group/src/Generated/Group4.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/client-operation-group/src/Generated/Group4.cs @@ -2,10 +2,12 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Threading; using System.Threading.Tasks; +using Client.Structure.Service; namespace Client.Structure.ClientOperationGroup { @@ -13,6 +15,8 @@ public partial class Group4 { protected Group4() => throw null; + internal Group4(ClientPipeline pipeline, Uri endpoint, ClientType client) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult Four(RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/client-operation-group/src/Generated/Group5.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/client-operation-group/src/Generated/Group5.cs index eb10cff56a7..16a035048f3 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/client-operation-group/src/Generated/Group5.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/client-operation-group/src/Generated/Group5.cs @@ -2,10 +2,12 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Threading; using System.Threading.Tasks; +using Client.Structure.Service; namespace Client.Structure.AnotherClientOperationGroup { @@ -13,6 +15,8 @@ public partial class Group5 { protected Group5() => throw null; + internal Group5(ClientPipeline pipeline, Uri endpoint, ClientType client) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult Six(RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/client-operation-group/src/Generated/SubNamespaceSecondClient.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/client-operation-group/src/Generated/SubNamespaceSecondClient.cs index 9fe43ebbd7c..693eca9df30 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/client-operation-group/src/Generated/SubNamespaceSecondClient.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/client-operation-group/src/Generated/SubNamespaceSecondClient.cs @@ -5,6 +5,7 @@ using System; using System.ClientModel; using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; using System.Threading; using System.Threading.Tasks; using Client.Structure.Service; @@ -17,7 +18,12 @@ public partial class SubNamespaceSecondClient public SubNamespaceSecondClient(Uri endpoint, ClientType client) : this(endpoint, client, new SubNamespaceSecondClientOptions()) => throw null; - public SubNamespaceSecondClient(Uri endpoint, ClientType client, SubNamespaceSecondClientOptions options) => throw null; + internal SubNamespaceSecondClient(AuthenticationPolicy authenticationPolicy, Uri endpoint, ClientType client, SubNamespaceSecondClientOptions options) => throw null; + + public SubNamespaceSecondClient(Uri endpoint, ClientType client, SubNamespaceSecondClientOptions options) : this(null, endpoint, client, options) => throw null; + + [Experimental("SCME0002")] + public SubNamespaceSecondClient(SubNamespaceSecondClientSettings settings) : this(AuthenticationPolicy.Create(settings), settings?.Endpoint, settings?.Client ?? default, settings?.Options) => throw null; public ClientPipeline Pipeline => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/client-operation-group/src/Generated/SubNamespaceSecondClientOptions.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/client-operation-group/src/Generated/SubNamespaceSecondClientOptions.cs index d853790bd79..9bdb3865466 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/client-operation-group/src/Generated/SubNamespaceSecondClientOptions.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/client-operation-group/src/Generated/SubNamespaceSecondClientOptions.cs @@ -3,10 +3,16 @@ #nullable disable using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; +using Microsoft.Extensions.Configuration; namespace Client.Structure.AnotherClientOperationGroup { public partial class SubNamespaceSecondClientOptions : ClientPipelineOptions { + public SubNamespaceSecondClientOptions() => throw null; + + [Experimental("SCME0002")] + internal SubNamespaceSecondClientOptions(IConfigurationSection section) : base(section) => throw null; } } diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/client-operation-group/src/Generated/SubNamespaceSecondClientSettings.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/client-operation-group/src/Generated/SubNamespaceSecondClientSettings.cs new file mode 100644 index 00000000000..1f632d30799 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/client-operation-group/src/Generated/SubNamespaceSecondClientSettings.cs @@ -0,0 +1,36 @@ +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; +using Client.Structure.Service; +using Microsoft.Extensions.Configuration; + +namespace Client.Structure.AnotherClientOperationGroup +{ + [Experimental("SCME0002")] + public partial class SubNamespaceSecondClientSettings : ClientSettings + { + public Uri Endpoint + { + get => throw null; + set => throw null; + } + + public ClientType? Client + { + get => throw null; + set => throw null; + } + + public SubNamespaceSecondClientOptions Options + { + get => throw null; + set => throw null; + } + + protected override void BindCore(IConfigurationSection section) => throw null; + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/default/src/Generated/Bar.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/default/src/Generated/Bar.cs index b477c997e2f..ecb520de880 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/default/src/Generated/Bar.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/default/src/Generated/Bar.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Threading; @@ -13,6 +14,8 @@ public partial class Bar { protected Bar() => throw null; + internal Bar(ClientPipeline pipeline, Uri endpoint, ClientType client) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult Five(RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/default/src/Generated/Baz.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/default/src/Generated/Baz.cs index c13fd297ec5..9846828d6a2 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/default/src/Generated/Baz.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/default/src/Generated/Baz.cs @@ -2,7 +2,9 @@ #nullable disable +using System; using System.ClientModel.Primitives; +using Client.Structure.Service; namespace Client.Structure.Service._Baz { @@ -10,6 +12,8 @@ public partial class Baz { protected Baz() => throw null; + internal Baz(ClientPipeline pipeline, Uri endpoint, ClientType client) => throw null; + public ClientPipeline Pipeline => throw null; public virtual BazFoo GetBazFooClient() => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/default/src/Generated/BazFoo.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/default/src/Generated/BazFoo.cs index 6ed62d51d4e..4b8d81d5939 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/default/src/Generated/BazFoo.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/default/src/Generated/BazFoo.cs @@ -2,10 +2,12 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Threading; using System.Threading.Tasks; +using Client.Structure.Service; namespace Client.Structure.Service._Baz { @@ -13,6 +15,8 @@ public partial class BazFoo { protected BazFoo() => throw null; + internal BazFoo(ClientPipeline pipeline, Uri endpoint, ClientType client) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult Seven(RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/default/src/Generated/Foo.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/default/src/Generated/Foo.cs index 4989e29298c..40c3caa537f 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/default/src/Generated/Foo.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/default/src/Generated/Foo.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Threading; @@ -13,6 +14,8 @@ public partial class Foo { protected Foo() => throw null; + internal Foo(ClientPipeline pipeline, Uri endpoint, ClientType client) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult Three(RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/default/src/Generated/Qux.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/default/src/Generated/Qux.cs index e94b919e17f..886bf284df7 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/default/src/Generated/Qux.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/default/src/Generated/Qux.cs @@ -2,10 +2,12 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Threading; using System.Threading.Tasks; +using Client.Structure.Service; namespace Client.Structure.Service._Qux { @@ -13,6 +15,8 @@ public partial class Qux { protected Qux() => throw null; + internal Qux(ClientPipeline pipeline, Uri endpoint, ClientType client) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult Eight(RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/default/src/Generated/QuxBar.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/default/src/Generated/QuxBar.cs index 1cf32f91487..5b7bc794ae7 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/default/src/Generated/QuxBar.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/default/src/Generated/QuxBar.cs @@ -2,10 +2,12 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Threading; using System.Threading.Tasks; +using Client.Structure.Service; namespace Client.Structure.Service._Qux { @@ -13,6 +15,8 @@ public partial class QuxBar { protected QuxBar() => throw null; + internal QuxBar(ClientPipeline pipeline, Uri endpoint, ClientType client) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult Nine(RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/default/src/Generated/ServiceClient.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/default/src/Generated/ServiceClient.cs index c6745dfd7c9..7dd25ed35c3 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/default/src/Generated/ServiceClient.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/default/src/Generated/ServiceClient.cs @@ -5,6 +5,7 @@ using System; using System.ClientModel; using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; using System.Threading; using System.Threading.Tasks; using Client.Structure.Service._Baz; @@ -18,7 +19,12 @@ public partial class ServiceClient public ServiceClient(Uri endpoint, ClientType client) : this(endpoint, client, new ServiceClientOptions()) => throw null; - public ServiceClient(Uri endpoint, ClientType client, ServiceClientOptions options) => throw null; + internal ServiceClient(AuthenticationPolicy authenticationPolicy, Uri endpoint, ClientType client, ServiceClientOptions options) => throw null; + + public ServiceClient(Uri endpoint, ClientType client, ServiceClientOptions options) : this(null, endpoint, client, options) => throw null; + + [Experimental("SCME0002")] + public ServiceClient(ServiceClientSettings settings) : this(AuthenticationPolicy.Create(settings), settings?.Endpoint, settings?.Client ?? default, settings?.Options) => throw null; public ClientPipeline Pipeline => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/default/src/Generated/ServiceClientOptions.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/default/src/Generated/ServiceClientOptions.cs index 721c8b6c398..629dbd99553 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/default/src/Generated/ServiceClientOptions.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/default/src/Generated/ServiceClientOptions.cs @@ -3,10 +3,16 @@ #nullable disable using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; +using Microsoft.Extensions.Configuration; namespace Client.Structure.Service { public partial class ServiceClientOptions : ClientPipelineOptions { + public ServiceClientOptions() => throw null; + + [Experimental("SCME0002")] + internal ServiceClientOptions(IConfigurationSection section) : base(section) => throw null; } } diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/default/src/Generated/ServiceClientSettings.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/default/src/Generated/ServiceClientSettings.cs new file mode 100644 index 00000000000..3f55cc86a90 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/default/src/Generated/ServiceClientSettings.cs @@ -0,0 +1,35 @@ +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; +using Microsoft.Extensions.Configuration; + +namespace Client.Structure.Service +{ + [Experimental("SCME0002")] + public partial class ServiceClientSettings : ClientSettings + { + public Uri Endpoint + { + get => throw null; + set => throw null; + } + + public ClientType? Client + { + get => throw null; + set => throw null; + } + + public ServiceClientOptions Options + { + get => throw null; + set => throw null; + } + + protected override void BindCore(IConfigurationSection section) => throw null; + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/multi-client/src/Generated/ClientAClient.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/multi-client/src/Generated/ClientAClient.cs index 8474e633848..8c586cc178c 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/multi-client/src/Generated/ClientAClient.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/multi-client/src/Generated/ClientAClient.cs @@ -5,6 +5,7 @@ using System; using System.ClientModel; using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; using System.Threading; using System.Threading.Tasks; using Client.Structure.Service; @@ -17,7 +18,12 @@ public partial class ClientAClient public ClientAClient(Uri endpoint, ClientType client) : this(endpoint, client, new ClientAClientOptions()) => throw null; - public ClientAClient(Uri endpoint, ClientType client, ClientAClientOptions options) => throw null; + internal ClientAClient(AuthenticationPolicy authenticationPolicy, Uri endpoint, ClientType client, ClientAClientOptions options) => throw null; + + public ClientAClient(Uri endpoint, ClientType client, ClientAClientOptions options) : this(null, endpoint, client, options) => throw null; + + [Experimental("SCME0002")] + public ClientAClient(ClientAClientSettings settings) : this(AuthenticationPolicy.Create(settings), settings?.Endpoint, settings?.Client ?? default, settings?.Options) => throw null; public ClientPipeline Pipeline => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/multi-client/src/Generated/ClientAClientOptions.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/multi-client/src/Generated/ClientAClientOptions.cs index d52bc376d61..3eb91cb70a2 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/multi-client/src/Generated/ClientAClientOptions.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/multi-client/src/Generated/ClientAClientOptions.cs @@ -3,10 +3,16 @@ #nullable disable using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; +using Microsoft.Extensions.Configuration; namespace Client.Structure.MultiClient { public partial class ClientAClientOptions : ClientPipelineOptions { + public ClientAClientOptions() => throw null; + + [Experimental("SCME0002")] + internal ClientAClientOptions(IConfigurationSection section) : base(section) => throw null; } } diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/multi-client/src/Generated/ClientAClientSettings.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/multi-client/src/Generated/ClientAClientSettings.cs new file mode 100644 index 00000000000..6f0bbb16861 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/multi-client/src/Generated/ClientAClientSettings.cs @@ -0,0 +1,36 @@ +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; +using Client.Structure.Service; +using Microsoft.Extensions.Configuration; + +namespace Client.Structure.MultiClient +{ + [Experimental("SCME0002")] + public partial class ClientAClientSettings : ClientSettings + { + public Uri Endpoint + { + get => throw null; + set => throw null; + } + + public ClientType? Client + { + get => throw null; + set => throw null; + } + + public ClientAClientOptions Options + { + get => throw null; + set => throw null; + } + + protected override void BindCore(IConfigurationSection section) => throw null; + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/multi-client/src/Generated/ClientBClient.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/multi-client/src/Generated/ClientBClient.cs index 63271b0bf6f..603a41b38b0 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/multi-client/src/Generated/ClientBClient.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/multi-client/src/Generated/ClientBClient.cs @@ -5,6 +5,7 @@ using System; using System.ClientModel; using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; using System.Threading; using System.Threading.Tasks; using Client.Structure.Service; @@ -17,7 +18,12 @@ public partial class ClientBClient public ClientBClient(Uri endpoint, ClientType client) : this(endpoint, client, new ClientBClientOptions()) => throw null; - public ClientBClient(Uri endpoint, ClientType client, ClientBClientOptions options) => throw null; + internal ClientBClient(AuthenticationPolicy authenticationPolicy, Uri endpoint, ClientType client, ClientBClientOptions options) => throw null; + + public ClientBClient(Uri endpoint, ClientType client, ClientBClientOptions options) : this(null, endpoint, client, options) => throw null; + + [Experimental("SCME0002")] + public ClientBClient(ClientBClientSettings settings) : this(AuthenticationPolicy.Create(settings), settings?.Endpoint, settings?.Client ?? default, settings?.Options) => throw null; public ClientPipeline Pipeline => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/multi-client/src/Generated/ClientBClientOptions.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/multi-client/src/Generated/ClientBClientOptions.cs index 79f628d59e3..5a0fed08e44 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/multi-client/src/Generated/ClientBClientOptions.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/multi-client/src/Generated/ClientBClientOptions.cs @@ -3,10 +3,16 @@ #nullable disable using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; +using Microsoft.Extensions.Configuration; namespace Client.Structure.MultiClient { public partial class ClientBClientOptions : ClientPipelineOptions { + public ClientBClientOptions() => throw null; + + [Experimental("SCME0002")] + internal ClientBClientOptions(IConfigurationSection section) : base(section) => throw null; } } diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/multi-client/src/Generated/ClientBClientSettings.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/multi-client/src/Generated/ClientBClientSettings.cs new file mode 100644 index 00000000000..e7fc25b871d --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/multi-client/src/Generated/ClientBClientSettings.cs @@ -0,0 +1,36 @@ +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; +using Client.Structure.Service; +using Microsoft.Extensions.Configuration; + +namespace Client.Structure.MultiClient +{ + [Experimental("SCME0002")] + public partial class ClientBClientSettings : ClientSettings + { + public Uri Endpoint + { + get => throw null; + set => throw null; + } + + public ClientType? Client + { + get => throw null; + set => throw null; + } + + public ClientBClientOptions Options + { + get => throw null; + set => throw null; + } + + protected override void BindCore(IConfigurationSection section) => throw null; + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/renamed-operation/src/Generated/Group.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/renamed-operation/src/Generated/Group.cs index 43d04d3edb0..f9ce619bfe6 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/renamed-operation/src/Generated/Group.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/renamed-operation/src/Generated/Group.cs @@ -2,10 +2,12 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Threading; using System.Threading.Tasks; +using Client.Structure.Service; namespace Client.Structure.RenamedOperation { @@ -13,6 +15,8 @@ public partial class Group { protected Group() => throw null; + internal Group(ClientPipeline pipeline, Uri endpoint, ClientType client) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult RenamedTwo(RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/renamed-operation/src/Generated/RenamedOperationClient.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/renamed-operation/src/Generated/RenamedOperationClient.cs index acb300be1b5..a3aa6ae6103 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/renamed-operation/src/Generated/RenamedOperationClient.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/renamed-operation/src/Generated/RenamedOperationClient.cs @@ -5,6 +5,7 @@ using System; using System.ClientModel; using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; using System.Threading; using System.Threading.Tasks; using Client.Structure.Service; @@ -17,7 +18,12 @@ public partial class RenamedOperationClient public RenamedOperationClient(Uri endpoint, ClientType client) : this(endpoint, client, new RenamedOperationClientOptions()) => throw null; - public RenamedOperationClient(Uri endpoint, ClientType client, RenamedOperationClientOptions options) => throw null; + internal RenamedOperationClient(AuthenticationPolicy authenticationPolicy, Uri endpoint, ClientType client, RenamedOperationClientOptions options) => throw null; + + public RenamedOperationClient(Uri endpoint, ClientType client, RenamedOperationClientOptions options) : this(null, endpoint, client, options) => throw null; + + [Experimental("SCME0002")] + public RenamedOperationClient(RenamedOperationClientSettings settings) : this(AuthenticationPolicy.Create(settings), settings?.Endpoint, settings?.Client ?? default, settings?.Options) => throw null; public ClientPipeline Pipeline => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/renamed-operation/src/Generated/RenamedOperationClientOptions.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/renamed-operation/src/Generated/RenamedOperationClientOptions.cs index 981265b249d..d0992ccf0df 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/renamed-operation/src/Generated/RenamedOperationClientOptions.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/renamed-operation/src/Generated/RenamedOperationClientOptions.cs @@ -3,10 +3,16 @@ #nullable disable using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; +using Microsoft.Extensions.Configuration; namespace Client.Structure.RenamedOperation { public partial class RenamedOperationClientOptions : ClientPipelineOptions { + public RenamedOperationClientOptions() => throw null; + + [Experimental("SCME0002")] + internal RenamedOperationClientOptions(IConfigurationSection section) : base(section) => throw null; } } diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/renamed-operation/src/Generated/RenamedOperationClientSettings.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/renamed-operation/src/Generated/RenamedOperationClientSettings.cs new file mode 100644 index 00000000000..ad180f069ef --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/renamed-operation/src/Generated/RenamedOperationClientSettings.cs @@ -0,0 +1,36 @@ +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; +using Client.Structure.Service; +using Microsoft.Extensions.Configuration; + +namespace Client.Structure.RenamedOperation +{ + [Experimental("SCME0002")] + public partial class RenamedOperationClientSettings : ClientSettings + { + public Uri Endpoint + { + get => throw null; + set => throw null; + } + + public ClientType? Client + { + get => throw null; + set => throw null; + } + + public RenamedOperationClientOptions Options + { + get => throw null; + set => throw null; + } + + protected override void BindCore(IConfigurationSection section) => throw null; + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/two-operation-group/src/Generated/Group1.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/two-operation-group/src/Generated/Group1.cs index 4657d169616..292fd14c3c6 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/two-operation-group/src/Generated/Group1.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/two-operation-group/src/Generated/Group1.cs @@ -2,10 +2,12 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Threading; using System.Threading.Tasks; +using Client.Structure.Service; namespace Client.Structure.TwoOperationGroup { @@ -13,6 +15,8 @@ public partial class Group1 { protected Group1() => throw null; + internal Group1(ClientPipeline pipeline, Uri endpoint, ClientType client) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult One(RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/two-operation-group/src/Generated/Group2.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/two-operation-group/src/Generated/Group2.cs index 783310627ed..9b04ac2eba9 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/two-operation-group/src/Generated/Group2.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/two-operation-group/src/Generated/Group2.cs @@ -2,10 +2,12 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Threading; using System.Threading.Tasks; +using Client.Structure.Service; namespace Client.Structure.TwoOperationGroup { @@ -13,6 +15,8 @@ public partial class Group2 { protected Group2() => throw null; + internal Group2(ClientPipeline pipeline, Uri endpoint, ClientType client) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult Two(RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/two-operation-group/src/Generated/TwoOperationGroupClient.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/two-operation-group/src/Generated/TwoOperationGroupClient.cs index 42cdaf6080a..a5ae0dae401 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/two-operation-group/src/Generated/TwoOperationGroupClient.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/two-operation-group/src/Generated/TwoOperationGroupClient.cs @@ -4,6 +4,7 @@ using System; using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; using Client.Structure.Service; namespace Client.Structure.TwoOperationGroup @@ -14,7 +15,12 @@ public partial class TwoOperationGroupClient public TwoOperationGroupClient(Uri endpoint, ClientType client) : this(endpoint, client, new TwoOperationGroupClientOptions()) => throw null; - public TwoOperationGroupClient(Uri endpoint, ClientType client, TwoOperationGroupClientOptions options) => throw null; + internal TwoOperationGroupClient(AuthenticationPolicy authenticationPolicy, Uri endpoint, ClientType client, TwoOperationGroupClientOptions options) => throw null; + + public TwoOperationGroupClient(Uri endpoint, ClientType client, TwoOperationGroupClientOptions options) : this(null, endpoint, client, options) => throw null; + + [Experimental("SCME0002")] + public TwoOperationGroupClient(TwoOperationGroupClientSettings settings) : this(AuthenticationPolicy.Create(settings), settings?.Endpoint, settings?.Client ?? default, settings?.Options) => throw null; public ClientPipeline Pipeline => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/two-operation-group/src/Generated/TwoOperationGroupClientOptions.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/two-operation-group/src/Generated/TwoOperationGroupClientOptions.cs index 95058870aa8..f2f71a70cb9 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/two-operation-group/src/Generated/TwoOperationGroupClientOptions.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/two-operation-group/src/Generated/TwoOperationGroupClientOptions.cs @@ -3,10 +3,16 @@ #nullable disable using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; +using Microsoft.Extensions.Configuration; namespace Client.Structure.TwoOperationGroup { public partial class TwoOperationGroupClientOptions : ClientPipelineOptions { + public TwoOperationGroupClientOptions() => throw null; + + [Experimental("SCME0002")] + internal TwoOperationGroupClientOptions(IConfigurationSection section) : base(section) => throw null; } } diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/two-operation-group/src/Generated/TwoOperationGroupClientSettings.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/two-operation-group/src/Generated/TwoOperationGroupClientSettings.cs new file mode 100644 index 00000000000..95a3a7d145b --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/two-operation-group/src/Generated/TwoOperationGroupClientSettings.cs @@ -0,0 +1,36 @@ +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; +using Client.Structure.Service; +using Microsoft.Extensions.Configuration; + +namespace Client.Structure.TwoOperationGroup +{ + [Experimental("SCME0002")] + public partial class TwoOperationGroupClientSettings : ClientSettings + { + public Uri Endpoint + { + get => throw null; + set => throw null; + } + + public ClientType? Client + { + get => throw null; + set => throw null; + } + + public TwoOperationGroupClientOptions Options + { + get => throw null; + set => throw null; + } + + protected override void BindCore(IConfigurationSection section) => throw null; + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/documentation/src/Generated/DocumentationClient.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/documentation/src/Generated/DocumentationClient.cs index 8f961dff791..a666718a60c 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/documentation/src/Generated/DocumentationClient.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/documentation/src/Generated/DocumentationClient.cs @@ -4,6 +4,7 @@ using System; using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; using Documentation._Lists; using Documentation._TextFormatting; @@ -13,7 +14,12 @@ public partial class DocumentationClient { public DocumentationClient() : this(new Uri("http://localhost:3000"), new DocumentationClientOptions()) => throw null; - public DocumentationClient(Uri endpoint, DocumentationClientOptions options) => throw null; + internal DocumentationClient(AuthenticationPolicy authenticationPolicy, Uri endpoint, DocumentationClientOptions options) => throw null; + + public DocumentationClient(Uri endpoint, DocumentationClientOptions options) : this(null, endpoint, options) => throw null; + + [Experimental("SCME0002")] + public DocumentationClient(DocumentationClientSettings settings) : this(AuthenticationPolicy.Create(settings), settings?.Endpoint, settings?.Options) => throw null; public ClientPipeline Pipeline => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/documentation/src/Generated/DocumentationClientOptions.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/documentation/src/Generated/DocumentationClientOptions.cs index d14497f2a3d..71abccf911b 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/documentation/src/Generated/DocumentationClientOptions.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/documentation/src/Generated/DocumentationClientOptions.cs @@ -3,10 +3,16 @@ #nullable disable using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; +using Microsoft.Extensions.Configuration; namespace Documentation { public partial class DocumentationClientOptions : ClientPipelineOptions { + public DocumentationClientOptions() => throw null; + + [Experimental("SCME0002")] + internal DocumentationClientOptions(IConfigurationSection section) : base(section) => throw null; } } diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/documentation/src/Generated/DocumentationClientSettings.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/documentation/src/Generated/DocumentationClientSettings.cs new file mode 100644 index 00000000000..3359778538d --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/documentation/src/Generated/DocumentationClientSettings.cs @@ -0,0 +1,29 @@ +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; +using Microsoft.Extensions.Configuration; + +namespace Documentation +{ + [Experimental("SCME0002")] + public partial class DocumentationClientSettings : ClientSettings + { + public Uri Endpoint + { + get => throw null; + set => throw null; + } + + public DocumentationClientOptions Options + { + get => throw null; + set => throw null; + } + + protected override void BindCore(IConfigurationSection section) => throw null; + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/documentation/src/Generated/Lists.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/documentation/src/Generated/Lists.cs index 34bf1c4e427..448bdd8c7c6 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/documentation/src/Generated/Lists.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/documentation/src/Generated/Lists.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Threading; @@ -13,6 +14,8 @@ public partial class Lists { protected Lists() => throw null; + internal Lists(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult BulletPointsOp(RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/documentation/src/Generated/TextFormatting.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/documentation/src/Generated/TextFormatting.cs index 6fb8a1e8646..d2190f98461 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/documentation/src/Generated/TextFormatting.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/documentation/src/Generated/TextFormatting.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Threading; @@ -13,6 +14,8 @@ public partial class TextFormatting { protected TextFormatting() => throw null; + internal TextFormatting(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult BoldText(RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/array/src/Generated/ArrayClient.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/array/src/Generated/ArrayClient.cs index 55ae5b366f0..be13cf124dd 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/array/src/Generated/ArrayClient.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/array/src/Generated/ArrayClient.cs @@ -4,6 +4,7 @@ using System; using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; using Encode._Array._Property; namespace Encode._Array @@ -12,7 +13,12 @@ public partial class ArrayClient { public ArrayClient() : this(new Uri("http://localhost:3000"), new ArrayClientOptions()) => throw null; - public ArrayClient(Uri endpoint, ArrayClientOptions options) => throw null; + internal ArrayClient(AuthenticationPolicy authenticationPolicy, Uri endpoint, ArrayClientOptions options) => throw null; + + public ArrayClient(Uri endpoint, ArrayClientOptions options) : this(null, endpoint, options) => throw null; + + [Experimental("SCME0002")] + public ArrayClient(ArrayClientSettings settings) : this(AuthenticationPolicy.Create(settings), settings?.Endpoint, settings?.Options) => throw null; public ClientPipeline Pipeline => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/array/src/Generated/ArrayClientOptions.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/array/src/Generated/ArrayClientOptions.cs index 392d2e67a55..53bc44de8ab 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/array/src/Generated/ArrayClientOptions.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/array/src/Generated/ArrayClientOptions.cs @@ -3,10 +3,16 @@ #nullable disable using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; +using Microsoft.Extensions.Configuration; namespace Encode._Array { public partial class ArrayClientOptions : ClientPipelineOptions { + public ArrayClientOptions() => throw null; + + [Experimental("SCME0002")] + internal ArrayClientOptions(IConfigurationSection section) : base(section) => throw null; } } diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/array/src/Generated/ArrayClientSettings.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/array/src/Generated/ArrayClientSettings.cs new file mode 100644 index 00000000000..a63b499749e --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/array/src/Generated/ArrayClientSettings.cs @@ -0,0 +1,29 @@ +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; +using Microsoft.Extensions.Configuration; + +namespace Encode._Array +{ + [Experimental("SCME0002")] + public partial class ArrayClientSettings : ClientSettings + { + public Uri Endpoint + { + get => throw null; + set => throw null; + } + + public ArrayClientOptions Options + { + get => throw null; + set => throw null; + } + + protected override void BindCore(IConfigurationSection section) => throw null; + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/array/src/Generated/Property.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/array/src/Generated/Property.cs index 11ac1e8bde6..cca72b3496d 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/array/src/Generated/Property.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/array/src/Generated/Property.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Threading; @@ -14,6 +15,8 @@ public partial class Property { protected Property() => throw null; + internal Property(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult CommaDelimited(BinaryContent content, RequestOptions options = null) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/bytes/src/Generated/BytesClient.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/bytes/src/Generated/BytesClient.cs index 9f869034eb7..66889ea19e6 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/bytes/src/Generated/BytesClient.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/bytes/src/Generated/BytesClient.cs @@ -4,6 +4,7 @@ using System; using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; using Encode.Bytes._Header; using Encode.Bytes._Property; using Encode.Bytes._Query; @@ -16,7 +17,12 @@ public partial class BytesClient { public BytesClient() : this(new Uri("http://localhost:3000"), new BytesClientOptions()) => throw null; - public BytesClient(Uri endpoint, BytesClientOptions options) => throw null; + internal BytesClient(AuthenticationPolicy authenticationPolicy, Uri endpoint, BytesClientOptions options) => throw null; + + public BytesClient(Uri endpoint, BytesClientOptions options) : this(null, endpoint, options) => throw null; + + [Experimental("SCME0002")] + public BytesClient(BytesClientSettings settings) : this(AuthenticationPolicy.Create(settings), settings?.Endpoint, settings?.Options) => throw null; public ClientPipeline Pipeline => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/bytes/src/Generated/BytesClientOptions.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/bytes/src/Generated/BytesClientOptions.cs index cd5fed986b7..9e4ed241a12 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/bytes/src/Generated/BytesClientOptions.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/bytes/src/Generated/BytesClientOptions.cs @@ -3,10 +3,16 @@ #nullable disable using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; +using Microsoft.Extensions.Configuration; namespace Encode.Bytes { public partial class BytesClientOptions : ClientPipelineOptions { + public BytesClientOptions() => throw null; + + [Experimental("SCME0002")] + internal BytesClientOptions(IConfigurationSection section) : base(section) => throw null; } } diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/bytes/src/Generated/BytesClientSettings.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/bytes/src/Generated/BytesClientSettings.cs new file mode 100644 index 00000000000..a6033329a11 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/bytes/src/Generated/BytesClientSettings.cs @@ -0,0 +1,29 @@ +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; +using Microsoft.Extensions.Configuration; + +namespace Encode.Bytes +{ + [Experimental("SCME0002")] + public partial class BytesClientSettings : ClientSettings + { + public Uri Endpoint + { + get => throw null; + set => throw null; + } + + public BytesClientOptions Options + { + get => throw null; + set => throw null; + } + + protected override void BindCore(IConfigurationSection section) => throw null; + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/bytes/src/Generated/Header.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/bytes/src/Generated/Header.cs index 04f54e9db06..fd23134b48c 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/bytes/src/Generated/Header.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/bytes/src/Generated/Header.cs @@ -15,6 +15,8 @@ public partial class Header { protected Header() => throw null; + internal Header(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult Default(BinaryData value, RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/bytes/src/Generated/Property.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/bytes/src/Generated/Property.cs index cd447f162f2..98856cd5b6c 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/bytes/src/Generated/Property.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/bytes/src/Generated/Property.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Threading; @@ -14,6 +15,8 @@ public partial class Property { protected Property() => throw null; + internal Property(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult Default(BinaryContent content, RequestOptions options = null) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/bytes/src/Generated/Query.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/bytes/src/Generated/Query.cs index e833cb0b334..a4bdf915ccf 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/bytes/src/Generated/Query.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/bytes/src/Generated/Query.cs @@ -15,6 +15,8 @@ public partial class Query { protected Query() => throw null; + internal Query(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult Default(BinaryData value, RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/bytes/src/Generated/RequestBody.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/bytes/src/Generated/RequestBody.cs index 8f2b981bd11..11350490a12 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/bytes/src/Generated/RequestBody.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/bytes/src/Generated/RequestBody.cs @@ -14,6 +14,8 @@ public partial class RequestBody { protected RequestBody() => throw null; + internal RequestBody(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult Default(BinaryContent content, RequestOptions options = null) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/bytes/src/Generated/ResponseBody.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/bytes/src/Generated/ResponseBody.cs index d61d52ae44f..2ccbb28aadf 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/bytes/src/Generated/ResponseBody.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/bytes/src/Generated/ResponseBody.cs @@ -14,6 +14,8 @@ public partial class ResponseBody { protected ResponseBody() => throw null; + internal ResponseBody(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult Default(RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/datetime/src/Generated/DatetimeClient.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/datetime/src/Generated/DatetimeClient.cs index 99b7355986c..52989bc8104 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/datetime/src/Generated/DatetimeClient.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/datetime/src/Generated/DatetimeClient.cs @@ -4,6 +4,7 @@ using System; using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; using Encode.Datetime._Header; using Encode.Datetime._Property; using Encode.Datetime._Query; @@ -15,7 +16,12 @@ public partial class DatetimeClient { public DatetimeClient() : this(new Uri("http://localhost:3000"), new DatetimeClientOptions()) => throw null; - public DatetimeClient(Uri endpoint, DatetimeClientOptions options) => throw null; + internal DatetimeClient(AuthenticationPolicy authenticationPolicy, Uri endpoint, DatetimeClientOptions options) => throw null; + + public DatetimeClient(Uri endpoint, DatetimeClientOptions options) : this(null, endpoint, options) => throw null; + + [Experimental("SCME0002")] + public DatetimeClient(DatetimeClientSettings settings) : this(AuthenticationPolicy.Create(settings), settings?.Endpoint, settings?.Options) => throw null; public ClientPipeline Pipeline => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/datetime/src/Generated/DatetimeClientOptions.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/datetime/src/Generated/DatetimeClientOptions.cs index 698cb7d64f1..39b0653f0a2 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/datetime/src/Generated/DatetimeClientOptions.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/datetime/src/Generated/DatetimeClientOptions.cs @@ -3,10 +3,16 @@ #nullable disable using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; +using Microsoft.Extensions.Configuration; namespace Encode.Datetime { public partial class DatetimeClientOptions : ClientPipelineOptions { + public DatetimeClientOptions() => throw null; + + [Experimental("SCME0002")] + internal DatetimeClientOptions(IConfigurationSection section) : base(section) => throw null; } } diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/datetime/src/Generated/DatetimeClientSettings.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/datetime/src/Generated/DatetimeClientSettings.cs new file mode 100644 index 00000000000..9924fa8a904 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/datetime/src/Generated/DatetimeClientSettings.cs @@ -0,0 +1,29 @@ +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; +using Microsoft.Extensions.Configuration; + +namespace Encode.Datetime +{ + [Experimental("SCME0002")] + public partial class DatetimeClientSettings : ClientSettings + { + public Uri Endpoint + { + get => throw null; + set => throw null; + } + + public DatetimeClientOptions Options + { + get => throw null; + set => throw null; + } + + protected override void BindCore(IConfigurationSection section) => throw null; + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/datetime/src/Generated/Header.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/datetime/src/Generated/Header.cs index 5fb8d90bc90..73e83a93a8d 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/datetime/src/Generated/Header.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/datetime/src/Generated/Header.cs @@ -15,6 +15,8 @@ public partial class Header { protected Header() => throw null; + internal Header(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult Default(DateTimeOffset value, RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/datetime/src/Generated/Property.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/datetime/src/Generated/Property.cs index 2a05e4eb487..178a86cf0b2 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/datetime/src/Generated/Property.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/datetime/src/Generated/Property.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Threading; @@ -14,6 +15,8 @@ public partial class Property { protected Property() => throw null; + internal Property(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult Default(BinaryContent content, RequestOptions options = null) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/datetime/src/Generated/Query.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/datetime/src/Generated/Query.cs index 797db67529f..2e39c63316f 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/datetime/src/Generated/Query.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/datetime/src/Generated/Query.cs @@ -15,6 +15,8 @@ public partial class Query { protected Query() => throw null; + internal Query(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult Default(DateTimeOffset value, RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/datetime/src/Generated/ResponseHeader.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/datetime/src/Generated/ResponseHeader.cs index 01d39032c85..0f6c15d6f9e 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/datetime/src/Generated/ResponseHeader.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/datetime/src/Generated/ResponseHeader.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Threading; @@ -13,6 +14,8 @@ public partial class ResponseHeader { protected ResponseHeader() => throw null; + internal ResponseHeader(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult Default(RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/duration/src/Generated/DurationClient.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/duration/src/Generated/DurationClient.cs index 5f2a93cce5a..efdd9208ab4 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/duration/src/Generated/DurationClient.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/duration/src/Generated/DurationClient.cs @@ -4,6 +4,7 @@ using System; using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; using Encode.Duration._Header; using Encode.Duration._Property; using Encode.Duration._Query; @@ -14,7 +15,12 @@ public partial class DurationClient { public DurationClient() : this(new Uri("http://localhost:3000"), new DurationClientOptions()) => throw null; - public DurationClient(Uri endpoint, DurationClientOptions options) => throw null; + internal DurationClient(AuthenticationPolicy authenticationPolicy, Uri endpoint, DurationClientOptions options) => throw null; + + public DurationClient(Uri endpoint, DurationClientOptions options) : this(null, endpoint, options) => throw null; + + [Experimental("SCME0002")] + public DurationClient(DurationClientSettings settings) : this(AuthenticationPolicy.Create(settings), settings?.Endpoint, settings?.Options) => throw null; public ClientPipeline Pipeline => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/duration/src/Generated/DurationClientOptions.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/duration/src/Generated/DurationClientOptions.cs index a78e11b5410..a3259a567ec 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/duration/src/Generated/DurationClientOptions.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/duration/src/Generated/DurationClientOptions.cs @@ -3,10 +3,16 @@ #nullable disable using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; +using Microsoft.Extensions.Configuration; namespace Encode.Duration { public partial class DurationClientOptions : ClientPipelineOptions { + public DurationClientOptions() => throw null; + + [Experimental("SCME0002")] + internal DurationClientOptions(IConfigurationSection section) : base(section) => throw null; } } diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/duration/src/Generated/DurationClientSettings.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/duration/src/Generated/DurationClientSettings.cs new file mode 100644 index 00000000000..d5794c77d32 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/duration/src/Generated/DurationClientSettings.cs @@ -0,0 +1,29 @@ +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; +using Microsoft.Extensions.Configuration; + +namespace Encode.Duration +{ + [Experimental("SCME0002")] + public partial class DurationClientSettings : ClientSettings + { + public Uri Endpoint + { + get => throw null; + set => throw null; + } + + public DurationClientOptions Options + { + get => throw null; + set => throw null; + } + + protected override void BindCore(IConfigurationSection section) => throw null; + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/duration/src/Generated/Header.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/duration/src/Generated/Header.cs index f8b13ad6053..60aaa9d639d 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/duration/src/Generated/Header.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/duration/src/Generated/Header.cs @@ -15,6 +15,8 @@ public partial class Header { protected Header() => throw null; + internal Header(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult Default(TimeSpan duration, RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/duration/src/Generated/Property.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/duration/src/Generated/Property.cs index 68a98785695..5932c8916b1 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/duration/src/Generated/Property.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/duration/src/Generated/Property.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Threading; @@ -13,6 +14,8 @@ public partial class Property { protected Property() => throw null; + internal Property(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult Default(BinaryContent content, RequestOptions options = null) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/duration/src/Generated/Query.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/duration/src/Generated/Query.cs index ab8d0db30f9..3389d4bc03c 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/duration/src/Generated/Query.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/duration/src/Generated/Query.cs @@ -15,6 +15,8 @@ public partial class Query { protected Query() => throw null; + internal Query(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult Default(TimeSpan input, RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/numeric/src/Generated/NumericClient.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/numeric/src/Generated/NumericClient.cs index a43095cc1bc..62c37a7e84d 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/numeric/src/Generated/NumericClient.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/numeric/src/Generated/NumericClient.cs @@ -4,6 +4,7 @@ using System; using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; using Encode.Numeric._Property; namespace Encode.Numeric @@ -12,7 +13,12 @@ public partial class NumericClient { public NumericClient() : this(new Uri("http://localhost:3000"), new NumericClientOptions()) => throw null; - public NumericClient(Uri endpoint, NumericClientOptions options) => throw null; + internal NumericClient(AuthenticationPolicy authenticationPolicy, Uri endpoint, NumericClientOptions options) => throw null; + + public NumericClient(Uri endpoint, NumericClientOptions options) : this(null, endpoint, options) => throw null; + + [Experimental("SCME0002")] + public NumericClient(NumericClientSettings settings) : this(AuthenticationPolicy.Create(settings), settings?.Endpoint, settings?.Options) => throw null; public ClientPipeline Pipeline => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/numeric/src/Generated/NumericClientOptions.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/numeric/src/Generated/NumericClientOptions.cs index 94e681301bf..678f0fd0618 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/numeric/src/Generated/NumericClientOptions.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/numeric/src/Generated/NumericClientOptions.cs @@ -3,10 +3,16 @@ #nullable disable using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; +using Microsoft.Extensions.Configuration; namespace Encode.Numeric { public partial class NumericClientOptions : ClientPipelineOptions { + public NumericClientOptions() => throw null; + + [Experimental("SCME0002")] + internal NumericClientOptions(IConfigurationSection section) : base(section) => throw null; } } diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/numeric/src/Generated/NumericClientSettings.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/numeric/src/Generated/NumericClientSettings.cs new file mode 100644 index 00000000000..1eb21a455d6 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/numeric/src/Generated/NumericClientSettings.cs @@ -0,0 +1,29 @@ +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; +using Microsoft.Extensions.Configuration; + +namespace Encode.Numeric +{ + [Experimental("SCME0002")] + public partial class NumericClientSettings : ClientSettings + { + public Uri Endpoint + { + get => throw null; + set => throw null; + } + + public NumericClientOptions Options + { + get => throw null; + set => throw null; + } + + protected override void BindCore(IConfigurationSection section) => throw null; + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/numeric/src/Generated/Property.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/numeric/src/Generated/Property.cs index 49349a4add9..a24512ae6df 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/numeric/src/Generated/Property.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/numeric/src/Generated/Property.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Threading; @@ -13,6 +14,8 @@ public partial class Property { protected Property() => throw null; + internal Property(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult SafeintAsString(BinaryContent content, RequestOptions options = null) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/basic/src/Generated/BasicClient.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/basic/src/Generated/BasicClient.cs index dfb24ed2a43..14502febffd 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/basic/src/Generated/BasicClient.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/basic/src/Generated/BasicClient.cs @@ -4,6 +4,7 @@ using System; using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; using Parameters.Basic._ExplicitBody; using Parameters.Basic._ImplicitBody; @@ -13,7 +14,12 @@ public partial class BasicClient { public BasicClient() : this(new Uri("http://localhost:3000"), new BasicClientOptions()) => throw null; - public BasicClient(Uri endpoint, BasicClientOptions options) => throw null; + internal BasicClient(AuthenticationPolicy authenticationPolicy, Uri endpoint, BasicClientOptions options) => throw null; + + public BasicClient(Uri endpoint, BasicClientOptions options) : this(null, endpoint, options) => throw null; + + [Experimental("SCME0002")] + public BasicClient(BasicClientSettings settings) : this(AuthenticationPolicy.Create(settings), settings?.Endpoint, settings?.Options) => throw null; public ClientPipeline Pipeline => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/basic/src/Generated/BasicClientOptions.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/basic/src/Generated/BasicClientOptions.cs index 8739650ee13..a537b38f60a 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/basic/src/Generated/BasicClientOptions.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/basic/src/Generated/BasicClientOptions.cs @@ -3,10 +3,16 @@ #nullable disable using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; +using Microsoft.Extensions.Configuration; namespace Parameters.Basic { public partial class BasicClientOptions : ClientPipelineOptions { + public BasicClientOptions() => throw null; + + [Experimental("SCME0002")] + internal BasicClientOptions(IConfigurationSection section) : base(section) => throw null; } } diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/basic/src/Generated/BasicClientSettings.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/basic/src/Generated/BasicClientSettings.cs new file mode 100644 index 00000000000..51e2b9e6c0f --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/basic/src/Generated/BasicClientSettings.cs @@ -0,0 +1,29 @@ +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; +using Microsoft.Extensions.Configuration; + +namespace Parameters.Basic +{ + [Experimental("SCME0002")] + public partial class BasicClientSettings : ClientSettings + { + public Uri Endpoint + { + get => throw null; + set => throw null; + } + + public BasicClientOptions Options + { + get => throw null; + set => throw null; + } + + protected override void BindCore(IConfigurationSection section) => throw null; + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/basic/src/Generated/ExplicitBody.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/basic/src/Generated/ExplicitBody.cs index 383030dc1bf..d9157b03926 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/basic/src/Generated/ExplicitBody.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/basic/src/Generated/ExplicitBody.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Threading; @@ -13,6 +14,8 @@ public partial class ExplicitBody { protected ExplicitBody() => throw null; + internal ExplicitBody(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult Simple(BinaryContent content, RequestOptions options = null) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/basic/src/Generated/ImplicitBody.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/basic/src/Generated/ImplicitBody.cs index 478ec3b4e2e..8d46cf80d63 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/basic/src/Generated/ImplicitBody.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/basic/src/Generated/ImplicitBody.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Threading; @@ -13,6 +14,8 @@ public partial class ImplicitBody { protected ImplicitBody() => throw null; + internal ImplicitBody(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult Simple(BinaryContent content, RequestOptions options = null) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/body-optionality/src/Generated/BodyOptionalityClient.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/body-optionality/src/Generated/BodyOptionalityClient.cs index 3c77de1b7fe..457b49eac2f 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/body-optionality/src/Generated/BodyOptionalityClient.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/body-optionality/src/Generated/BodyOptionalityClient.cs @@ -5,6 +5,7 @@ using System; using System.ClientModel; using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; using System.Threading; using System.Threading.Tasks; using Parameters.BodyOptionality._OptionalExplicit; @@ -15,7 +16,12 @@ public partial class BodyOptionalityClient { public BodyOptionalityClient() : this(new Uri("http://localhost:3000"), new BodyOptionalityClientOptions()) => throw null; - public BodyOptionalityClient(Uri endpoint, BodyOptionalityClientOptions options) => throw null; + internal BodyOptionalityClient(AuthenticationPolicy authenticationPolicy, Uri endpoint, BodyOptionalityClientOptions options) => throw null; + + public BodyOptionalityClient(Uri endpoint, BodyOptionalityClientOptions options) : this(null, endpoint, options) => throw null; + + [Experimental("SCME0002")] + public BodyOptionalityClient(BodyOptionalityClientSettings settings) : this(AuthenticationPolicy.Create(settings), settings?.Endpoint, settings?.Options) => throw null; public ClientPipeline Pipeline => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/body-optionality/src/Generated/BodyOptionalityClientOptions.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/body-optionality/src/Generated/BodyOptionalityClientOptions.cs index 80f4405292a..33804b10acc 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/body-optionality/src/Generated/BodyOptionalityClientOptions.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/body-optionality/src/Generated/BodyOptionalityClientOptions.cs @@ -3,10 +3,16 @@ #nullable disable using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; +using Microsoft.Extensions.Configuration; namespace Parameters.BodyOptionality { public partial class BodyOptionalityClientOptions : ClientPipelineOptions { + public BodyOptionalityClientOptions() => throw null; + + [Experimental("SCME0002")] + internal BodyOptionalityClientOptions(IConfigurationSection section) : base(section) => throw null; } } diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/body-optionality/src/Generated/BodyOptionalityClientSettings.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/body-optionality/src/Generated/BodyOptionalityClientSettings.cs new file mode 100644 index 00000000000..137094caec7 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/body-optionality/src/Generated/BodyOptionalityClientSettings.cs @@ -0,0 +1,29 @@ +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; +using Microsoft.Extensions.Configuration; + +namespace Parameters.BodyOptionality +{ + [Experimental("SCME0002")] + public partial class BodyOptionalityClientSettings : ClientSettings + { + public Uri Endpoint + { + get => throw null; + set => throw null; + } + + public BodyOptionalityClientOptions Options + { + get => throw null; + set => throw null; + } + + protected override void BindCore(IConfigurationSection section) => throw null; + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/body-optionality/src/Generated/OptionalExplicit.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/body-optionality/src/Generated/OptionalExplicit.cs index ffa4809571b..5d4de240634 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/body-optionality/src/Generated/OptionalExplicit.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/body-optionality/src/Generated/OptionalExplicit.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Threading; @@ -14,6 +15,8 @@ public partial class OptionalExplicit { protected OptionalExplicit() => throw null; + internal OptionalExplicit(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult Set(BinaryContent content, RequestOptions options = null) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/collection-format/src/Generated/CollectionFormatClient.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/collection-format/src/Generated/CollectionFormatClient.cs index c75beeba0ad..cfac396e5f9 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/collection-format/src/Generated/CollectionFormatClient.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/collection-format/src/Generated/CollectionFormatClient.cs @@ -4,6 +4,7 @@ using System; using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; using Parameters.CollectionFormat._Header; using Parameters.CollectionFormat._Query; @@ -13,7 +14,12 @@ public partial class CollectionFormatClient { public CollectionFormatClient() : this(new Uri("http://localhost:3000"), new CollectionFormatClientOptions()) => throw null; - public CollectionFormatClient(Uri endpoint, CollectionFormatClientOptions options) => throw null; + internal CollectionFormatClient(AuthenticationPolicy authenticationPolicy, Uri endpoint, CollectionFormatClientOptions options) => throw null; + + public CollectionFormatClient(Uri endpoint, CollectionFormatClientOptions options) : this(null, endpoint, options) => throw null; + + [Experimental("SCME0002")] + public CollectionFormatClient(CollectionFormatClientSettings settings) : this(AuthenticationPolicy.Create(settings), settings?.Endpoint, settings?.Options) => throw null; public ClientPipeline Pipeline => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/collection-format/src/Generated/CollectionFormatClientOptions.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/collection-format/src/Generated/CollectionFormatClientOptions.cs index 31d6176ffa4..227d9ffd344 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/collection-format/src/Generated/CollectionFormatClientOptions.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/collection-format/src/Generated/CollectionFormatClientOptions.cs @@ -3,10 +3,16 @@ #nullable disable using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; +using Microsoft.Extensions.Configuration; namespace Parameters.CollectionFormat { public partial class CollectionFormatClientOptions : ClientPipelineOptions { + public CollectionFormatClientOptions() => throw null; + + [Experimental("SCME0002")] + internal CollectionFormatClientOptions(IConfigurationSection section) : base(section) => throw null; } } diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/collection-format/src/Generated/CollectionFormatClientSettings.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/collection-format/src/Generated/CollectionFormatClientSettings.cs new file mode 100644 index 00000000000..ae7b80aa260 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/collection-format/src/Generated/CollectionFormatClientSettings.cs @@ -0,0 +1,29 @@ +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; +using Microsoft.Extensions.Configuration; + +namespace Parameters.CollectionFormat +{ + [Experimental("SCME0002")] + public partial class CollectionFormatClientSettings : ClientSettings + { + public Uri Endpoint + { + get => throw null; + set => throw null; + } + + public CollectionFormatClientOptions Options + { + get => throw null; + set => throw null; + } + + protected override void BindCore(IConfigurationSection section) => throw null; + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/collection-format/src/Generated/Header.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/collection-format/src/Generated/Header.cs index 6188a2785ea..e29a1876bcd 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/collection-format/src/Generated/Header.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/collection-format/src/Generated/Header.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Collections.Generic; @@ -14,6 +15,8 @@ public partial class Header { protected Header() => throw null; + internal Header(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult Csv(IEnumerable colors, RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/collection-format/src/Generated/Query.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/collection-format/src/Generated/Query.cs index c54d95436b6..f0d37525882 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/collection-format/src/Generated/Query.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/collection-format/src/Generated/Query.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Collections.Generic; @@ -14,6 +15,8 @@ public partial class Query { protected Query() => throw null; + internal Query(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult Multi(IEnumerable colors, RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/path/src/Generated/PathClient.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/path/src/Generated/PathClient.cs index d4db42a991a..d0563f49bda 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/path/src/Generated/PathClient.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/path/src/Generated/PathClient.cs @@ -5,6 +5,7 @@ using System; using System.ClientModel; using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; using System.Threading; using System.Threading.Tasks; @@ -14,7 +15,12 @@ public partial class PathClient { public PathClient() : this(new Uri("http://localhost:3000"), new PathClientOptions()) => throw null; - public PathClient(Uri endpoint, PathClientOptions options) => throw null; + internal PathClient(AuthenticationPolicy authenticationPolicy, Uri endpoint, PathClientOptions options) => throw null; + + public PathClient(Uri endpoint, PathClientOptions options) : this(null, endpoint, options) => throw null; + + [Experimental("SCME0002")] + public PathClient(PathClientSettings settings) : this(AuthenticationPolicy.Create(settings), settings?.Endpoint, settings?.Options) => throw null; public ClientPipeline Pipeline => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/path/src/Generated/PathClientOptions.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/path/src/Generated/PathClientOptions.cs index 9a352e9e917..b544589353f 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/path/src/Generated/PathClientOptions.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/path/src/Generated/PathClientOptions.cs @@ -3,10 +3,16 @@ #nullable disable using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; +using Microsoft.Extensions.Configuration; namespace Parameters.Path { public partial class PathClientOptions : ClientPipelineOptions { + public PathClientOptions() => throw null; + + [Experimental("SCME0002")] + internal PathClientOptions(IConfigurationSection section) : base(section) => throw null; } } diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/path/src/Generated/PathClientSettings.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/path/src/Generated/PathClientSettings.cs new file mode 100644 index 00000000000..a5fa1a1373e --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/path/src/Generated/PathClientSettings.cs @@ -0,0 +1,29 @@ +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; +using Microsoft.Extensions.Configuration; + +namespace Parameters.Path +{ + [Experimental("SCME0002")] + public partial class PathClientSettings : ClientSettings + { + public Uri Endpoint + { + get => throw null; + set => throw null; + } + + public PathClientOptions Options + { + get => throw null; + set => throw null; + } + + protected override void BindCore(IConfigurationSection section) => throw null; + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/query/src/Generated/Constant.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/query/src/Generated/Constant.cs index b1be965f2d8..3545cccf023 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/query/src/Generated/Constant.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/query/src/Generated/Constant.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Threading; @@ -13,6 +14,8 @@ public partial class Constant { protected Constant() => throw null; + internal Constant(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult Post(RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/query/src/Generated/QueryClient.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/query/src/Generated/QueryClient.cs index c3ed5f02aab..6a4be8cbeed 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/query/src/Generated/QueryClient.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/query/src/Generated/QueryClient.cs @@ -4,6 +4,7 @@ using System; using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; namespace Parameters.Query { @@ -11,7 +12,12 @@ public partial class QueryClient { public QueryClient() : this(new Uri("http://localhost:3000"), new QueryClientOptions()) => throw null; - public QueryClient(Uri endpoint, QueryClientOptions options) => throw null; + internal QueryClient(AuthenticationPolicy authenticationPolicy, Uri endpoint, QueryClientOptions options) => throw null; + + public QueryClient(Uri endpoint, QueryClientOptions options) : this(null, endpoint, options) => throw null; + + [Experimental("SCME0002")] + public QueryClient(QueryClientSettings settings) : this(AuthenticationPolicy.Create(settings), settings?.Endpoint, settings?.Options) => throw null; public ClientPipeline Pipeline => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/query/src/Generated/QueryClientOptions.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/query/src/Generated/QueryClientOptions.cs index a625c60f864..a785237dffc 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/query/src/Generated/QueryClientOptions.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/query/src/Generated/QueryClientOptions.cs @@ -3,10 +3,16 @@ #nullable disable using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; +using Microsoft.Extensions.Configuration; namespace Parameters.Query { public partial class QueryClientOptions : ClientPipelineOptions { + public QueryClientOptions() => throw null; + + [Experimental("SCME0002")] + internal QueryClientOptions(IConfigurationSection section) : base(section) => throw null; } } diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/query/src/Generated/QueryClientSettings.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/query/src/Generated/QueryClientSettings.cs new file mode 100644 index 00000000000..d41690bb4e7 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/query/src/Generated/QueryClientSettings.cs @@ -0,0 +1,29 @@ +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; +using Microsoft.Extensions.Configuration; + +namespace Parameters.Query +{ + [Experimental("SCME0002")] + public partial class QueryClientSettings : ClientSettings + { + public Uri Endpoint + { + get => throw null; + set => throw null; + } + + public QueryClientOptions Options + { + get => throw null; + set => throw null; + } + + protected override void BindCore(IConfigurationSection section) => throw null; + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/spread/src/Generated/Alias.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/spread/src/Generated/Alias.cs index ec8be6a9570..201900b0bc1 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/spread/src/Generated/Alias.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/spread/src/Generated/Alias.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Collections.Generic; @@ -14,6 +15,8 @@ public partial class Alias { protected Alias() => throw null; + internal Alias(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult SpreadAsRequestBody(BinaryContent content, RequestOptions options = null) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/spread/src/Generated/Model.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/spread/src/Generated/Model.cs index 31ca1bfeab4..792e9511624 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/spread/src/Generated/Model.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/spread/src/Generated/Model.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Threading; @@ -13,6 +14,8 @@ public partial class Model { protected Model() => throw null; + internal Model(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult SpreadAsRequestBody(BinaryContent content, RequestOptions options = null) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/spread/src/Generated/SpreadClient.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/spread/src/Generated/SpreadClient.cs index 310ea3031c4..5367a1359ab 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/spread/src/Generated/SpreadClient.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/spread/src/Generated/SpreadClient.cs @@ -4,6 +4,7 @@ using System; using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; using Parameters.Spread._Alias; using Parameters.Spread._Model; @@ -13,7 +14,12 @@ public partial class SpreadClient { public SpreadClient() : this(new Uri("http://localhost:3000"), new SpreadClientOptions()) => throw null; - public SpreadClient(Uri endpoint, SpreadClientOptions options) => throw null; + internal SpreadClient(AuthenticationPolicy authenticationPolicy, Uri endpoint, SpreadClientOptions options) => throw null; + + public SpreadClient(Uri endpoint, SpreadClientOptions options) : this(null, endpoint, options) => throw null; + + [Experimental("SCME0002")] + public SpreadClient(SpreadClientSettings settings) : this(AuthenticationPolicy.Create(settings), settings?.Endpoint, settings?.Options) => throw null; public ClientPipeline Pipeline => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/spread/src/Generated/SpreadClientOptions.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/spread/src/Generated/SpreadClientOptions.cs index c738d114fae..27baba6242d 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/spread/src/Generated/SpreadClientOptions.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/spread/src/Generated/SpreadClientOptions.cs @@ -3,10 +3,16 @@ #nullable disable using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; +using Microsoft.Extensions.Configuration; namespace Parameters.Spread { public partial class SpreadClientOptions : ClientPipelineOptions { + public SpreadClientOptions() => throw null; + + [Experimental("SCME0002")] + internal SpreadClientOptions(IConfigurationSection section) : base(section) => throw null; } } diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/spread/src/Generated/SpreadClientSettings.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/spread/src/Generated/SpreadClientSettings.cs new file mode 100644 index 00000000000..1ca4f6c34d8 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/spread/src/Generated/SpreadClientSettings.cs @@ -0,0 +1,29 @@ +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; +using Microsoft.Extensions.Configuration; + +namespace Parameters.Spread +{ + [Experimental("SCME0002")] + public partial class SpreadClientSettings : ClientSettings + { + public Uri Endpoint + { + get => throw null; + set => throw null; + } + + public SpreadClientOptions Options + { + get => throw null; + set => throw null; + } + + protected override void BindCore(IConfigurationSection section) => throw null; + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/content-negotiation/src/Generated/ContentNegotiationClient.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/content-negotiation/src/Generated/ContentNegotiationClient.cs index 3632bd3895d..919000580c5 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/content-negotiation/src/Generated/ContentNegotiationClient.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/content-negotiation/src/Generated/ContentNegotiationClient.cs @@ -4,6 +4,7 @@ using System; using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; using Payload.ContentNegotiation._DifferentBody; using Payload.ContentNegotiation._SameBody; @@ -13,7 +14,12 @@ public partial class ContentNegotiationClient { public ContentNegotiationClient() : this(new Uri("http://localhost:3000"), new ContentNegotiationClientOptions()) => throw null; - public ContentNegotiationClient(Uri endpoint, ContentNegotiationClientOptions options) => throw null; + internal ContentNegotiationClient(AuthenticationPolicy authenticationPolicy, Uri endpoint, ContentNegotiationClientOptions options) => throw null; + + public ContentNegotiationClient(Uri endpoint, ContentNegotiationClientOptions options) : this(null, endpoint, options) => throw null; + + [Experimental("SCME0002")] + public ContentNegotiationClient(ContentNegotiationClientSettings settings) : this(AuthenticationPolicy.Create(settings), settings?.Endpoint, settings?.Options) => throw null; public ClientPipeline Pipeline => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/content-negotiation/src/Generated/ContentNegotiationClientOptions.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/content-negotiation/src/Generated/ContentNegotiationClientOptions.cs index b35052fa447..c6e914d7f4c 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/content-negotiation/src/Generated/ContentNegotiationClientOptions.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/content-negotiation/src/Generated/ContentNegotiationClientOptions.cs @@ -3,10 +3,16 @@ #nullable disable using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; +using Microsoft.Extensions.Configuration; namespace Payload.ContentNegotiation { public partial class ContentNegotiationClientOptions : ClientPipelineOptions { + public ContentNegotiationClientOptions() => throw null; + + [Experimental("SCME0002")] + internal ContentNegotiationClientOptions(IConfigurationSection section) : base(section) => throw null; } } diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/content-negotiation/src/Generated/ContentNegotiationClientSettings.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/content-negotiation/src/Generated/ContentNegotiationClientSettings.cs new file mode 100644 index 00000000000..518fbf6fb65 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/content-negotiation/src/Generated/ContentNegotiationClientSettings.cs @@ -0,0 +1,29 @@ +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; +using Microsoft.Extensions.Configuration; + +namespace Payload.ContentNegotiation +{ + [Experimental("SCME0002")] + public partial class ContentNegotiationClientSettings : ClientSettings + { + public Uri Endpoint + { + get => throw null; + set => throw null; + } + + public ContentNegotiationClientOptions Options + { + get => throw null; + set => throw null; + } + + protected override void BindCore(IConfigurationSection section) => throw null; + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/content-negotiation/src/Generated/DifferentBody.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/content-negotiation/src/Generated/DifferentBody.cs index 76ada7bada7..765ef0cc721 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/content-negotiation/src/Generated/DifferentBody.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/content-negotiation/src/Generated/DifferentBody.cs @@ -14,6 +14,8 @@ public partial class DifferentBody { protected DifferentBody() => throw null; + internal DifferentBody(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult GetAvatarAsPng(RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/content-negotiation/src/Generated/SameBody.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/content-negotiation/src/Generated/SameBody.cs index fd6ad96379d..57af2a77ab4 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/content-negotiation/src/Generated/SameBody.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/content-negotiation/src/Generated/SameBody.cs @@ -14,6 +14,8 @@ public partial class SameBody { protected SameBody() => throw null; + internal SameBody(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult GetAvatarAsPng(RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/json-merge-patch/src/Generated/JsonMergePatchClient.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/json-merge-patch/src/Generated/JsonMergePatchClient.cs index 06f7a37dced..878bd2ed9bd 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/json-merge-patch/src/Generated/JsonMergePatchClient.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/json-merge-patch/src/Generated/JsonMergePatchClient.cs @@ -5,6 +5,7 @@ using System; using System.ClientModel; using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; using System.Threading; using System.Threading.Tasks; @@ -14,7 +15,12 @@ public partial class JsonMergePatchClient { public JsonMergePatchClient() : this(new Uri("http://localhost:3000"), new JsonMergePatchClientOptions()) => throw null; - public JsonMergePatchClient(Uri endpoint, JsonMergePatchClientOptions options) => throw null; + internal JsonMergePatchClient(AuthenticationPolicy authenticationPolicy, Uri endpoint, JsonMergePatchClientOptions options) => throw null; + + public JsonMergePatchClient(Uri endpoint, JsonMergePatchClientOptions options) : this(null, endpoint, options) => throw null; + + [Experimental("SCME0002")] + public JsonMergePatchClient(JsonMergePatchClientSettings settings) : this(AuthenticationPolicy.Create(settings), settings?.Endpoint, settings?.Options) => throw null; public ClientPipeline Pipeline => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/json-merge-patch/src/Generated/JsonMergePatchClientOptions.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/json-merge-patch/src/Generated/JsonMergePatchClientOptions.cs index 044a4f35fb3..c64a14e0ec1 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/json-merge-patch/src/Generated/JsonMergePatchClientOptions.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/json-merge-patch/src/Generated/JsonMergePatchClientOptions.cs @@ -3,10 +3,16 @@ #nullable disable using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; +using Microsoft.Extensions.Configuration; namespace Payload.JsonMergePatch { public partial class JsonMergePatchClientOptions : ClientPipelineOptions { + public JsonMergePatchClientOptions() => throw null; + + [Experimental("SCME0002")] + internal JsonMergePatchClientOptions(IConfigurationSection section) : base(section) => throw null; } } diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/json-merge-patch/src/Generated/JsonMergePatchClientSettings.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/json-merge-patch/src/Generated/JsonMergePatchClientSettings.cs new file mode 100644 index 00000000000..53e5788c5d5 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/json-merge-patch/src/Generated/JsonMergePatchClientSettings.cs @@ -0,0 +1,29 @@ +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; +using Microsoft.Extensions.Configuration; + +namespace Payload.JsonMergePatch +{ + [Experimental("SCME0002")] + public partial class JsonMergePatchClientSettings : ClientSettings + { + public Uri Endpoint + { + get => throw null; + set => throw null; + } + + public JsonMergePatchClientOptions Options + { + get => throw null; + set => throw null; + } + + protected override void BindCore(IConfigurationSection section) => throw null; + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/media-type/src/Generated/MediaTypeClient.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/media-type/src/Generated/MediaTypeClient.cs index 6e34839a39c..dbfd6a68c4c 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/media-type/src/Generated/MediaTypeClient.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/media-type/src/Generated/MediaTypeClient.cs @@ -4,6 +4,7 @@ using System; using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; using Payload.MediaType._StringBody; namespace Payload.MediaType @@ -12,7 +13,12 @@ public partial class MediaTypeClient { public MediaTypeClient() : this(new Uri("http://localhost:3000"), new MediaTypeClientOptions()) => throw null; - public MediaTypeClient(Uri endpoint, MediaTypeClientOptions options) => throw null; + internal MediaTypeClient(AuthenticationPolicy authenticationPolicy, Uri endpoint, MediaTypeClientOptions options) => throw null; + + public MediaTypeClient(Uri endpoint, MediaTypeClientOptions options) : this(null, endpoint, options) => throw null; + + [Experimental("SCME0002")] + public MediaTypeClient(MediaTypeClientSettings settings) : this(AuthenticationPolicy.Create(settings), settings?.Endpoint, settings?.Options) => throw null; public ClientPipeline Pipeline => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/media-type/src/Generated/MediaTypeClientOptions.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/media-type/src/Generated/MediaTypeClientOptions.cs index 34c7b715a6f..eb36f49a44c 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/media-type/src/Generated/MediaTypeClientOptions.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/media-type/src/Generated/MediaTypeClientOptions.cs @@ -3,10 +3,16 @@ #nullable disable using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; +using Microsoft.Extensions.Configuration; namespace Payload.MediaType { public partial class MediaTypeClientOptions : ClientPipelineOptions { + public MediaTypeClientOptions() => throw null; + + [Experimental("SCME0002")] + internal MediaTypeClientOptions(IConfigurationSection section) : base(section) => throw null; } } diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/media-type/src/Generated/MediaTypeClientSettings.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/media-type/src/Generated/MediaTypeClientSettings.cs new file mode 100644 index 00000000000..2d7404eca4e --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/media-type/src/Generated/MediaTypeClientSettings.cs @@ -0,0 +1,29 @@ +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; +using Microsoft.Extensions.Configuration; + +namespace Payload.MediaType +{ + [Experimental("SCME0002")] + public partial class MediaTypeClientSettings : ClientSettings + { + public Uri Endpoint + { + get => throw null; + set => throw null; + } + + public MediaTypeClientOptions Options + { + get => throw null; + set => throw null; + } + + protected override void BindCore(IConfigurationSection section) => throw null; + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/media-type/src/Generated/StringBody.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/media-type/src/Generated/StringBody.cs index f31c4875707..3efbadabb94 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/media-type/src/Generated/StringBody.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/media-type/src/Generated/StringBody.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Threading; @@ -13,6 +14,8 @@ public partial class StringBody { protected StringBody() => throw null; + internal StringBody(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult SendAsText(BinaryContent content, RequestOptions options = null) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/multipart/src/Generated/FormData.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/multipart/src/Generated/FormData.cs index c6e02e93832..7af85b26e37 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/multipart/src/Generated/FormData.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/multipart/src/Generated/FormData.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Threading.Tasks; @@ -14,6 +15,8 @@ public partial class FormData { protected FormData() => throw null; + internal FormData(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult Basic(BinaryContent content, string contentType, RequestOptions options = null) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/multipart/src/Generated/FormDataFile.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/multipart/src/Generated/FormDataFile.cs index 055f8f20cb7..af3b92422ad 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/multipart/src/Generated/FormDataFile.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/multipart/src/Generated/FormDataFile.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Threading.Tasks; @@ -12,6 +13,8 @@ public partial class FormDataFile { protected FormDataFile() => throw null; + internal FormDataFile(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult UploadFileSpecificContentType(BinaryContent content, string contentType, RequestOptions options = null) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/multipart/src/Generated/FormDataHttpParts.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/multipart/src/Generated/FormDataHttpParts.cs index 033e295e92d..53b236c7af8 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/multipart/src/Generated/FormDataHttpParts.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/multipart/src/Generated/FormDataHttpParts.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Threading.Tasks; @@ -14,6 +15,8 @@ public partial class FormDataHttpParts { protected FormDataHttpParts() => throw null; + internal FormDataHttpParts(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult JsonArrayAndFileArray(BinaryContent content, string contentType, RequestOptions options = null) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/multipart/src/Generated/FormDataHttpPartsContentType.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/multipart/src/Generated/FormDataHttpPartsContentType.cs index 32cb80df3d0..971ee6ad114 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/multipart/src/Generated/FormDataHttpPartsContentType.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/multipart/src/Generated/FormDataHttpPartsContentType.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Threading.Tasks; @@ -12,6 +13,8 @@ public partial class FormDataHttpPartsContentType { protected FormDataHttpPartsContentType() => throw null; + internal FormDataHttpPartsContentType(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult ImageJpegContentType(BinaryContent content, string contentType, RequestOptions options = null) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/multipart/src/Generated/FormDataHttpPartsNonString.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/multipart/src/Generated/FormDataHttpPartsNonString.cs index 47557d7876b..cfb735ba1c8 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/multipart/src/Generated/FormDataHttpPartsNonString.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/multipart/src/Generated/FormDataHttpPartsNonString.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Threading.Tasks; @@ -12,6 +13,8 @@ public partial class FormDataHttpPartsNonString { protected FormDataHttpPartsNonString() => throw null; + internal FormDataHttpPartsNonString(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult Float(BinaryContent content, string contentType, RequestOptions options = null) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/multipart/src/Generated/MultiPartClient.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/multipart/src/Generated/MultiPartClient.cs index cd0cceb3f85..882e5cd3826 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/multipart/src/Generated/MultiPartClient.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/multipart/src/Generated/MultiPartClient.cs @@ -4,6 +4,7 @@ using System; using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; using Payload.MultiPart._FormData; namespace Payload.MultiPart @@ -12,7 +13,12 @@ public partial class MultiPartClient { public MultiPartClient() : this(new Uri("http://localhost:3000"), new MultiPartClientOptions()) => throw null; - public MultiPartClient(Uri endpoint, MultiPartClientOptions options) => throw null; + internal MultiPartClient(AuthenticationPolicy authenticationPolicy, Uri endpoint, MultiPartClientOptions options) => throw null; + + public MultiPartClient(Uri endpoint, MultiPartClientOptions options) : this(null, endpoint, options) => throw null; + + [Experimental("SCME0002")] + public MultiPartClient(MultiPartClientSettings settings) : this(AuthenticationPolicy.Create(settings), settings?.Endpoint, settings?.Options) => throw null; public ClientPipeline Pipeline => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/multipart/src/Generated/MultiPartClientOptions.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/multipart/src/Generated/MultiPartClientOptions.cs index 637c71f86aa..8c4e0bdd9bc 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/multipart/src/Generated/MultiPartClientOptions.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/multipart/src/Generated/MultiPartClientOptions.cs @@ -3,10 +3,16 @@ #nullable disable using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; +using Microsoft.Extensions.Configuration; namespace Payload.MultiPart { public partial class MultiPartClientOptions : ClientPipelineOptions { + public MultiPartClientOptions() => throw null; + + [Experimental("SCME0002")] + internal MultiPartClientOptions(IConfigurationSection section) : base(section) => throw null; } } diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/multipart/src/Generated/MultiPartClientSettings.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/multipart/src/Generated/MultiPartClientSettings.cs new file mode 100644 index 00000000000..4952a597b64 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/multipart/src/Generated/MultiPartClientSettings.cs @@ -0,0 +1,29 @@ +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; +using Microsoft.Extensions.Configuration; + +namespace Payload.MultiPart +{ + [Experimental("SCME0002")] + public partial class MultiPartClientSettings : ClientSettings + { + public Uri Endpoint + { + get => throw null; + set => throw null; + } + + public MultiPartClientOptions Options + { + get => throw null; + set => throw null; + } + + protected override void BindCore(IConfigurationSection section) => throw null; + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/pageable/src/Generated/PageSize.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/pageable/src/Generated/PageSize.cs index aa4b7b3ce6a..1ba387d0819 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/pageable/src/Generated/PageSize.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/pageable/src/Generated/PageSize.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Threading; @@ -13,6 +14,8 @@ public partial class PageSize { protected PageSize() => throw null; + internal PageSize(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual CollectionResult GetWithoutContinuation(RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/pageable/src/Generated/PageableClient.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/pageable/src/Generated/PageableClient.cs index 990fa78c378..3b78a1ed79c 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/pageable/src/Generated/PageableClient.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/pageable/src/Generated/PageableClient.cs @@ -4,6 +4,7 @@ using System; using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; using Payload.Pageable._PageSize; using Payload.Pageable._ServerDrivenPagination; using Payload.Pageable._XmlPagination; @@ -14,7 +15,12 @@ public partial class PageableClient { public PageableClient() : this(new Uri("http://localhost:3000"), new PageableClientOptions()) => throw null; - public PageableClient(Uri endpoint, PageableClientOptions options) => throw null; + internal PageableClient(AuthenticationPolicy authenticationPolicy, Uri endpoint, PageableClientOptions options) => throw null; + + public PageableClient(Uri endpoint, PageableClientOptions options) : this(null, endpoint, options) => throw null; + + [Experimental("SCME0002")] + public PageableClient(PageableClientSettings settings) : this(AuthenticationPolicy.Create(settings), settings?.Endpoint, settings?.Options) => throw null; public ClientPipeline Pipeline => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/pageable/src/Generated/PageableClientOptions.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/pageable/src/Generated/PageableClientOptions.cs index a852c495b1e..42a316d9908 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/pageable/src/Generated/PageableClientOptions.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/pageable/src/Generated/PageableClientOptions.cs @@ -3,10 +3,16 @@ #nullable disable using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; +using Microsoft.Extensions.Configuration; namespace Payload.Pageable { public partial class PageableClientOptions : ClientPipelineOptions { + public PageableClientOptions() => throw null; + + [Experimental("SCME0002")] + internal PageableClientOptions(IConfigurationSection section) : base(section) => throw null; } } diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/pageable/src/Generated/PageableClientSettings.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/pageable/src/Generated/PageableClientSettings.cs new file mode 100644 index 00000000000..f1e6a9393e2 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/pageable/src/Generated/PageableClientSettings.cs @@ -0,0 +1,29 @@ +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; +using Microsoft.Extensions.Configuration; + +namespace Payload.Pageable +{ + [Experimental("SCME0002")] + public partial class PageableClientSettings : ClientSettings + { + public Uri Endpoint + { + get => throw null; + set => throw null; + } + + public PageableClientOptions Options + { + get => throw null; + set => throw null; + } + + protected override void BindCore(IConfigurationSection section) => throw null; + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/pageable/src/Generated/ServerDrivenPagination.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/pageable/src/Generated/ServerDrivenPagination.cs index b611ba4910d..b027b296309 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/pageable/src/Generated/ServerDrivenPagination.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/pageable/src/Generated/ServerDrivenPagination.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Threading; @@ -14,6 +15,8 @@ public partial class ServerDrivenPagination { protected ServerDrivenPagination() => throw null; + internal ServerDrivenPagination(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual CollectionResult Link(RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/pageable/src/Generated/ServerDrivenPaginationContinuationToken.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/pageable/src/Generated/ServerDrivenPaginationContinuationToken.cs index 5c48d40f9b3..928eaab911f 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/pageable/src/Generated/ServerDrivenPaginationContinuationToken.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/pageable/src/Generated/ServerDrivenPaginationContinuationToken.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Threading; @@ -13,6 +14,8 @@ public partial class ServerDrivenPaginationContinuationToken { protected ServerDrivenPaginationContinuationToken() => throw null; + internal ServerDrivenPaginationContinuationToken(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual CollectionResult RequestQueryResponseBody(string token, string foo, string bar, RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/pageable/src/Generated/XmlPagination.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/pageable/src/Generated/XmlPagination.cs index f5423d536cc..edbc61168f7 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/pageable/src/Generated/XmlPagination.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/pageable/src/Generated/XmlPagination.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Threading; @@ -13,6 +14,8 @@ public partial class XmlPagination { protected XmlPagination() => throw null; + internal XmlPagination(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual CollectionResult GetWithContinuation(string marker, RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/xml/src/Generated/ModelWithArrayOfModelValue.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/xml/src/Generated/ModelWithArrayOfModelValue.cs index e3bb0da6da6..f1cfe2710d1 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/xml/src/Generated/ModelWithArrayOfModelValue.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/xml/src/Generated/ModelWithArrayOfModelValue.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Threading; @@ -13,6 +14,8 @@ public partial class ModelWithArrayOfModelValue { protected ModelWithArrayOfModelValue() => throw null; + internal ModelWithArrayOfModelValue(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult Get(RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/xml/src/Generated/ModelWithAttributesValue.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/xml/src/Generated/ModelWithAttributesValue.cs index b9e82ff75b4..283cfb4c443 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/xml/src/Generated/ModelWithAttributesValue.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/xml/src/Generated/ModelWithAttributesValue.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Threading; @@ -13,6 +14,8 @@ public partial class ModelWithAttributesValue { protected ModelWithAttributesValue() => throw null; + internal ModelWithAttributesValue(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult Get(RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/xml/src/Generated/ModelWithDatetimeValue.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/xml/src/Generated/ModelWithDatetimeValue.cs index d2d2be2b477..f986467c432 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/xml/src/Generated/ModelWithDatetimeValue.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/xml/src/Generated/ModelWithDatetimeValue.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Threading; @@ -13,6 +14,8 @@ public partial class ModelWithDatetimeValue { protected ModelWithDatetimeValue() => throw null; + internal ModelWithDatetimeValue(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult Get(RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/xml/src/Generated/ModelWithDictionaryValue.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/xml/src/Generated/ModelWithDictionaryValue.cs index 454fd7f51b9..0c0df435c8a 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/xml/src/Generated/ModelWithDictionaryValue.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/xml/src/Generated/ModelWithDictionaryValue.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Threading; @@ -13,6 +14,8 @@ public partial class ModelWithDictionaryValue { protected ModelWithDictionaryValue() => throw null; + internal ModelWithDictionaryValue(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult Get(RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/xml/src/Generated/ModelWithEmptyArrayValue.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/xml/src/Generated/ModelWithEmptyArrayValue.cs index f97e5bb89d6..bad31fbc8cc 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/xml/src/Generated/ModelWithEmptyArrayValue.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/xml/src/Generated/ModelWithEmptyArrayValue.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Threading; @@ -13,6 +14,8 @@ public partial class ModelWithEmptyArrayValue { protected ModelWithEmptyArrayValue() => throw null; + internal ModelWithEmptyArrayValue(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult Get(RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/xml/src/Generated/ModelWithEncodedNamesValue.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/xml/src/Generated/ModelWithEncodedNamesValue.cs index 1dbf3924200..6b6a02b751f 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/xml/src/Generated/ModelWithEncodedNamesValue.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/xml/src/Generated/ModelWithEncodedNamesValue.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Threading; @@ -13,6 +14,8 @@ public partial class ModelWithEncodedNamesValue { protected ModelWithEncodedNamesValue() => throw null; + internal ModelWithEncodedNamesValue(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult Get(RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/xml/src/Generated/ModelWithEnumValue.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/xml/src/Generated/ModelWithEnumValue.cs index cf8151f7576..92f3738b2ec 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/xml/src/Generated/ModelWithEnumValue.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/xml/src/Generated/ModelWithEnumValue.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Threading; @@ -13,6 +14,8 @@ public partial class ModelWithEnumValue { protected ModelWithEnumValue() => throw null; + internal ModelWithEnumValue(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult Get(RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/xml/src/Generated/ModelWithOptionalFieldValue.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/xml/src/Generated/ModelWithOptionalFieldValue.cs index 3dc923de469..e2bbd2a0fe9 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/xml/src/Generated/ModelWithOptionalFieldValue.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/xml/src/Generated/ModelWithOptionalFieldValue.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Threading; @@ -13,6 +14,8 @@ public partial class ModelWithOptionalFieldValue { protected ModelWithOptionalFieldValue() => throw null; + internal ModelWithOptionalFieldValue(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult Get(RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/xml/src/Generated/ModelWithRenamedArraysValue.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/xml/src/Generated/ModelWithRenamedArraysValue.cs index c27e948d0ef..f387ba00d47 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/xml/src/Generated/ModelWithRenamedArraysValue.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/xml/src/Generated/ModelWithRenamedArraysValue.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Threading; @@ -13,6 +14,8 @@ public partial class ModelWithRenamedArraysValue { protected ModelWithRenamedArraysValue() => throw null; + internal ModelWithRenamedArraysValue(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult Get(RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/xml/src/Generated/ModelWithRenamedFieldsValue.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/xml/src/Generated/ModelWithRenamedFieldsValue.cs index 976fe8192f3..291ca0113d2 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/xml/src/Generated/ModelWithRenamedFieldsValue.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/xml/src/Generated/ModelWithRenamedFieldsValue.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Threading; @@ -13,6 +14,8 @@ public partial class ModelWithRenamedFieldsValue { protected ModelWithRenamedFieldsValue() => throw null; + internal ModelWithRenamedFieldsValue(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult Get(RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/xml/src/Generated/ModelWithSimpleArraysValue.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/xml/src/Generated/ModelWithSimpleArraysValue.cs index 221293cbc43..ef168252ce1 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/xml/src/Generated/ModelWithSimpleArraysValue.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/xml/src/Generated/ModelWithSimpleArraysValue.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Threading; @@ -13,6 +14,8 @@ public partial class ModelWithSimpleArraysValue { protected ModelWithSimpleArraysValue() => throw null; + internal ModelWithSimpleArraysValue(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult Get(RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/xml/src/Generated/ModelWithTextValue.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/xml/src/Generated/ModelWithTextValue.cs index c87bf14cccd..273515d228e 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/xml/src/Generated/ModelWithTextValue.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/xml/src/Generated/ModelWithTextValue.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Threading; @@ -13,6 +14,8 @@ public partial class ModelWithTextValue { protected ModelWithTextValue() => throw null; + internal ModelWithTextValue(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult Get(RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/xml/src/Generated/ModelWithUnwrappedArrayValue.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/xml/src/Generated/ModelWithUnwrappedArrayValue.cs index 74372fd6b84..319bba5194c 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/xml/src/Generated/ModelWithUnwrappedArrayValue.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/xml/src/Generated/ModelWithUnwrappedArrayValue.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Threading; @@ -13,6 +14,8 @@ public partial class ModelWithUnwrappedArrayValue { protected ModelWithUnwrappedArrayValue() => throw null; + internal ModelWithUnwrappedArrayValue(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult Get(RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/xml/src/Generated/SimpleModelValue.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/xml/src/Generated/SimpleModelValue.cs index 6a020d4c531..0ca41673678 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/xml/src/Generated/SimpleModelValue.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/xml/src/Generated/SimpleModelValue.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Threading; @@ -13,6 +14,8 @@ public partial class SimpleModelValue { protected SimpleModelValue() => throw null; + internal SimpleModelValue(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult Get(RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/xml/src/Generated/XmlClient.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/xml/src/Generated/XmlClient.cs index f39437ebf8f..4022728cc3b 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/xml/src/Generated/XmlClient.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/xml/src/Generated/XmlClient.cs @@ -4,6 +4,7 @@ using System; using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; namespace Payload.Xml { @@ -11,7 +12,12 @@ public partial class XmlClient { public XmlClient() : this(new Uri("http://localhost:3000"), new XmlClientOptions()) => throw null; - public XmlClient(Uri endpoint, XmlClientOptions options) => throw null; + internal XmlClient(AuthenticationPolicy authenticationPolicy, Uri endpoint, XmlClientOptions options) => throw null; + + public XmlClient(Uri endpoint, XmlClientOptions options) : this(null, endpoint, options) => throw null; + + [Experimental("SCME0002")] + public XmlClient(XmlClientSettings settings) : this(AuthenticationPolicy.Create(settings), settings?.Endpoint, settings?.Options) => throw null; public ClientPipeline Pipeline => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/xml/src/Generated/XmlClientOptions.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/xml/src/Generated/XmlClientOptions.cs index 467bebf98b1..8969f41eb08 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/xml/src/Generated/XmlClientOptions.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/xml/src/Generated/XmlClientOptions.cs @@ -3,10 +3,16 @@ #nullable disable using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; +using Microsoft.Extensions.Configuration; namespace Payload.Xml { public partial class XmlClientOptions : ClientPipelineOptions { + public XmlClientOptions() => throw null; + + [Experimental("SCME0002")] + internal XmlClientOptions(IConfigurationSection section) : base(section) => throw null; } } diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/xml/src/Generated/XmlClientSettings.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/xml/src/Generated/XmlClientSettings.cs new file mode 100644 index 00000000000..57bc9f1bbc8 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/xml/src/Generated/XmlClientSettings.cs @@ -0,0 +1,29 @@ +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; +using Microsoft.Extensions.Configuration; + +namespace Payload.Xml +{ + [Experimental("SCME0002")] + public partial class XmlClientSettings : ClientSettings + { + public Uri Endpoint + { + get => throw null; + set => throw null; + } + + public XmlClientOptions Options + { + get => throw null; + set => throw null; + } + + protected override void BindCore(IConfigurationSection section) => throw null; + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/xml/src/Generated/XmlErrorValue.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/xml/src/Generated/XmlErrorValue.cs index 13069ff4ebb..cf37b300967 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/xml/src/Generated/XmlErrorValue.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/xml/src/Generated/XmlErrorValue.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Threading; @@ -13,6 +14,8 @@ public partial class XmlErrorValue { protected XmlErrorValue() => throw null; + internal XmlErrorValue(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult Get(RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/resiliency/srv-driven/v1/src/Generated/ResiliencyServiceDrivenClient.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/resiliency/srv-driven/v1/src/Generated/ResiliencyServiceDrivenClient.cs index d5a954479be..0d010ec8ea0 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/resiliency/srv-driven/v1/src/Generated/ResiliencyServiceDrivenClient.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/resiliency/srv-driven/v1/src/Generated/ResiliencyServiceDrivenClient.cs @@ -5,6 +5,7 @@ using System; using System.ClientModel; using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; using System.Threading; using System.Threading.Tasks; @@ -16,7 +17,12 @@ public partial class ResiliencyServiceDrivenClient public ResiliencyServiceDrivenClient(Uri endpoint, string serviceDeploymentVersion) : this(endpoint, serviceDeploymentVersion, new ResiliencyServiceDrivenClientOptions()) => throw null; - public ResiliencyServiceDrivenClient(Uri endpoint, string serviceDeploymentVersion, ResiliencyServiceDrivenClientOptions options) => throw null; + internal ResiliencyServiceDrivenClient(AuthenticationPolicy authenticationPolicy, Uri endpoint, string serviceDeploymentVersion, ResiliencyServiceDrivenClientOptions options) => throw null; + + public ResiliencyServiceDrivenClient(Uri endpoint, string serviceDeploymentVersion, ResiliencyServiceDrivenClientOptions options) : this(null, endpoint, serviceDeploymentVersion, options) => throw null; + + [Experimental("SCME0002")] + public ResiliencyServiceDrivenClient(ResiliencyServiceDrivenClientSettings settings) : this(AuthenticationPolicy.Create(settings), settings?.Endpoint, settings?.ServiceDeploymentVersion, settings?.Options) => throw null; public ClientPipeline Pipeline => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/resiliency/srv-driven/v1/src/Generated/ResiliencyServiceDrivenClientOptions.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/resiliency/srv-driven/v1/src/Generated/ResiliencyServiceDrivenClientOptions.cs index d5dd7cc38e0..2612bc02b39 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/resiliency/srv-driven/v1/src/Generated/ResiliencyServiceDrivenClientOptions.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/resiliency/srv-driven/v1/src/Generated/ResiliencyServiceDrivenClientOptions.cs @@ -3,6 +3,8 @@ #nullable disable using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; +using Microsoft.Extensions.Configuration; namespace Resiliency.ServiceDriven { @@ -12,6 +14,9 @@ public partial class ResiliencyServiceDrivenClientOptions : ClientPipelineOption public ResiliencyServiceDrivenClientOptions(ServiceVersion version = LatestVersion) => throw null; + [Experimental("SCME0002")] + internal ResiliencyServiceDrivenClientOptions(IConfigurationSection section) : base(section) => throw null; + public enum ServiceVersion { /// Version 1. diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/resiliency/srv-driven/v1/src/Generated/ResiliencyServiceDrivenClientSettings.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/resiliency/srv-driven/v1/src/Generated/ResiliencyServiceDrivenClientSettings.cs new file mode 100644 index 00000000000..dd1dd517226 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/resiliency/srv-driven/v1/src/Generated/ResiliencyServiceDrivenClientSettings.cs @@ -0,0 +1,35 @@ +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; +using Microsoft.Extensions.Configuration; + +namespace Resiliency.ServiceDriven +{ + [Experimental("SCME0002")] + public partial class ResiliencyServiceDrivenClientSettings : ClientSettings + { + public Uri Endpoint + { + get => throw null; + set => throw null; + } + + public string ServiceDeploymentVersion + { + get => throw null; + set => throw null; + } + + public ResiliencyServiceDrivenClientOptions Options + { + get => throw null; + set => throw null; + } + + protected override void BindCore(IConfigurationSection section) => throw null; + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/resiliency/srv-driven/v2/src/Generated/ResiliencyServiceDrivenClient.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/resiliency/srv-driven/v2/src/Generated/ResiliencyServiceDrivenClient.cs index d99259d205c..59d7160e347 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/resiliency/srv-driven/v2/src/Generated/ResiliencyServiceDrivenClient.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/resiliency/srv-driven/v2/src/Generated/ResiliencyServiceDrivenClient.cs @@ -5,6 +5,7 @@ using System; using System.ClientModel; using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; using System.Threading; using System.Threading.Tasks; @@ -16,7 +17,12 @@ public partial class ResiliencyServiceDrivenClient public ResiliencyServiceDrivenClient(Uri endpoint, string serviceDeploymentVersion) : this(endpoint, serviceDeploymentVersion, new ResiliencyServiceDrivenClientOptions()) => throw null; - public ResiliencyServiceDrivenClient(Uri endpoint, string serviceDeploymentVersion, ResiliencyServiceDrivenClientOptions options) => throw null; + internal ResiliencyServiceDrivenClient(AuthenticationPolicy authenticationPolicy, Uri endpoint, string serviceDeploymentVersion, ResiliencyServiceDrivenClientOptions options) => throw null; + + public ResiliencyServiceDrivenClient(Uri endpoint, string serviceDeploymentVersion, ResiliencyServiceDrivenClientOptions options) : this(null, endpoint, serviceDeploymentVersion, options) => throw null; + + [Experimental("SCME0002")] + public ResiliencyServiceDrivenClient(ResiliencyServiceDrivenClientSettings settings) : this(AuthenticationPolicy.Create(settings), settings?.Endpoint, settings?.ServiceDeploymentVersion, settings?.Options) => throw null; public ClientPipeline Pipeline => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/resiliency/srv-driven/v2/src/Generated/ResiliencyServiceDrivenClientOptions.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/resiliency/srv-driven/v2/src/Generated/ResiliencyServiceDrivenClientOptions.cs index 233945b82e3..b4d13f3a8f5 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/resiliency/srv-driven/v2/src/Generated/ResiliencyServiceDrivenClientOptions.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/resiliency/srv-driven/v2/src/Generated/ResiliencyServiceDrivenClientOptions.cs @@ -3,6 +3,8 @@ #nullable disable using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; +using Microsoft.Extensions.Configuration; namespace Resiliency.ServiceDriven { @@ -12,6 +14,9 @@ public partial class ResiliencyServiceDrivenClientOptions : ClientPipelineOption public ResiliencyServiceDrivenClientOptions(ServiceVersion version = LatestVersion) => throw null; + [Experimental("SCME0002")] + internal ResiliencyServiceDrivenClientOptions(IConfigurationSection section) : base(section) => throw null; + public enum ServiceVersion { /// Version 1. diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/resiliency/srv-driven/v2/src/Generated/ResiliencyServiceDrivenClientSettings.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/resiliency/srv-driven/v2/src/Generated/ResiliencyServiceDrivenClientSettings.cs new file mode 100644 index 00000000000..dd1dd517226 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/resiliency/srv-driven/v2/src/Generated/ResiliencyServiceDrivenClientSettings.cs @@ -0,0 +1,35 @@ +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; +using Microsoft.Extensions.Configuration; + +namespace Resiliency.ServiceDriven +{ + [Experimental("SCME0002")] + public partial class ResiliencyServiceDrivenClientSettings : ClientSettings + { + public Uri Endpoint + { + get => throw null; + set => throw null; + } + + public string ServiceDeploymentVersion + { + get => throw null; + set => throw null; + } + + public ResiliencyServiceDrivenClientOptions Options + { + get => throw null; + set => throw null; + } + + protected override void BindCore(IConfigurationSection section) => throw null; + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/response/status-code-range/src/Generated/StatusCodeRangeClient.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/response/status-code-range/src/Generated/StatusCodeRangeClient.cs index 68220900e03..1cf6258e804 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/response/status-code-range/src/Generated/StatusCodeRangeClient.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/response/status-code-range/src/Generated/StatusCodeRangeClient.cs @@ -5,6 +5,7 @@ using System; using System.ClientModel; using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; using System.Threading; using System.Threading.Tasks; @@ -14,7 +15,12 @@ public partial class StatusCodeRangeClient { public StatusCodeRangeClient() : this(new Uri("http://localhost:3000"), new StatusCodeRangeClientOptions()) => throw null; - public StatusCodeRangeClient(Uri endpoint, StatusCodeRangeClientOptions options) => throw null; + internal StatusCodeRangeClient(AuthenticationPolicy authenticationPolicy, Uri endpoint, StatusCodeRangeClientOptions options) => throw null; + + public StatusCodeRangeClient(Uri endpoint, StatusCodeRangeClientOptions options) : this(null, endpoint, options) => throw null; + + [Experimental("SCME0002")] + public StatusCodeRangeClient(StatusCodeRangeClientSettings settings) : this(AuthenticationPolicy.Create(settings), settings?.Endpoint, settings?.Options) => throw null; public ClientPipeline Pipeline => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/response/status-code-range/src/Generated/StatusCodeRangeClientOptions.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/response/status-code-range/src/Generated/StatusCodeRangeClientOptions.cs index 2433a12ddfd..6c81e4b3cb9 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/response/status-code-range/src/Generated/StatusCodeRangeClientOptions.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/response/status-code-range/src/Generated/StatusCodeRangeClientOptions.cs @@ -3,10 +3,16 @@ #nullable disable using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; +using Microsoft.Extensions.Configuration; namespace Response.StatusCodeRange { public partial class StatusCodeRangeClientOptions : ClientPipelineOptions { + public StatusCodeRangeClientOptions() => throw null; + + [Experimental("SCME0002")] + internal StatusCodeRangeClientOptions(IConfigurationSection section) : base(section) => throw null; } } diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/response/status-code-range/src/Generated/StatusCodeRangeClientSettings.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/response/status-code-range/src/Generated/StatusCodeRangeClientSettings.cs new file mode 100644 index 00000000000..c08b681519a --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/response/status-code-range/src/Generated/StatusCodeRangeClientSettings.cs @@ -0,0 +1,29 @@ +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; +using Microsoft.Extensions.Configuration; + +namespace Response.StatusCodeRange +{ + [Experimental("SCME0002")] + public partial class StatusCodeRangeClientSettings : ClientSettings + { + public Uri Endpoint + { + get => throw null; + set => throw null; + } + + public StatusCodeRangeClientOptions Options + { + get => throw null; + set => throw null; + } + + protected override void BindCore(IConfigurationSection section) => throw null; + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/routes/src/Generated/InInterface.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/routes/src/Generated/InInterface.cs index 2c68d8281b8..934018fdcc3 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/routes/src/Generated/InInterface.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/routes/src/Generated/InInterface.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Threading; @@ -13,6 +14,8 @@ public partial class InInterface { protected InInterface() => throw null; + internal InInterface(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult Fixed(RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/routes/src/Generated/PathParameters.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/routes/src/Generated/PathParameters.cs index 3e17767b7d8..305a607546a 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/routes/src/Generated/PathParameters.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/routes/src/Generated/PathParameters.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Threading; @@ -18,6 +19,8 @@ public partial class PathParameters { protected PathParameters() => throw null; + internal PathParameters(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult TemplateOnly(string @param, RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/routes/src/Generated/PathParametersLabelExpansion.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/routes/src/Generated/PathParametersLabelExpansion.cs index b7d6a6cbc7c..a3daa8878cb 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/routes/src/Generated/PathParametersLabelExpansion.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/routes/src/Generated/PathParametersLabelExpansion.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel.Primitives; using Routes._PathParameters.LabelExpansion.Explode; using Routes._PathParameters.LabelExpansion.Standard; @@ -12,6 +13,8 @@ public partial class PathParametersLabelExpansion { protected PathParametersLabelExpansion() => throw null; + internal PathParametersLabelExpansion(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual PathParametersLabelExpansionStandard GetPathParametersLabelExpansionStandardClient() => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/routes/src/Generated/PathParametersLabelExpansionExplode.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/routes/src/Generated/PathParametersLabelExpansionExplode.cs index 79470e680e1..d032c33fc38 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/routes/src/Generated/PathParametersLabelExpansionExplode.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/routes/src/Generated/PathParametersLabelExpansionExplode.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Collections.Generic; @@ -14,6 +15,8 @@ public partial class PathParametersLabelExpansionExplode { protected PathParametersLabelExpansionExplode() => throw null; + internal PathParametersLabelExpansionExplode(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult Primitive(string @param, RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/routes/src/Generated/PathParametersLabelExpansionStandard.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/routes/src/Generated/PathParametersLabelExpansionStandard.cs index 0b742d05724..f18f1e516cc 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/routes/src/Generated/PathParametersLabelExpansionStandard.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/routes/src/Generated/PathParametersLabelExpansionStandard.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Collections.Generic; @@ -14,6 +15,8 @@ public partial class PathParametersLabelExpansionStandard { protected PathParametersLabelExpansionStandard() => throw null; + internal PathParametersLabelExpansionStandard(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult Primitive(string @param, RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/routes/src/Generated/PathParametersMatrixExpansion.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/routes/src/Generated/PathParametersMatrixExpansion.cs index 6bf98190256..5c60d18f7bb 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/routes/src/Generated/PathParametersMatrixExpansion.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/routes/src/Generated/PathParametersMatrixExpansion.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel.Primitives; using Routes._PathParameters.MatrixExpansion.Explode; using Routes._PathParameters.MatrixExpansion.Standard; @@ -12,6 +13,8 @@ public partial class PathParametersMatrixExpansion { protected PathParametersMatrixExpansion() => throw null; + internal PathParametersMatrixExpansion(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual PathParametersMatrixExpansionStandard GetPathParametersMatrixExpansionStandardClient() => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/routes/src/Generated/PathParametersMatrixExpansionExplode.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/routes/src/Generated/PathParametersMatrixExpansionExplode.cs index b92df406571..bf3f3e88d58 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/routes/src/Generated/PathParametersMatrixExpansionExplode.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/routes/src/Generated/PathParametersMatrixExpansionExplode.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Collections.Generic; @@ -14,6 +15,8 @@ public partial class PathParametersMatrixExpansionExplode { protected PathParametersMatrixExpansionExplode() => throw null; + internal PathParametersMatrixExpansionExplode(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult Primitive(string @param, RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/routes/src/Generated/PathParametersMatrixExpansionStandard.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/routes/src/Generated/PathParametersMatrixExpansionStandard.cs index d40c1696d15..165a76d190f 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/routes/src/Generated/PathParametersMatrixExpansionStandard.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/routes/src/Generated/PathParametersMatrixExpansionStandard.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Collections.Generic; @@ -14,6 +15,8 @@ public partial class PathParametersMatrixExpansionStandard { protected PathParametersMatrixExpansionStandard() => throw null; + internal PathParametersMatrixExpansionStandard(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult Primitive(string @param, RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/routes/src/Generated/PathParametersPathExpansion.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/routes/src/Generated/PathParametersPathExpansion.cs index ec2f665c1a2..11bd31de479 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/routes/src/Generated/PathParametersPathExpansion.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/routes/src/Generated/PathParametersPathExpansion.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel.Primitives; using Routes._PathParameters.PathExpansion.Explode; using Routes._PathParameters.PathExpansion.Standard; @@ -12,6 +13,8 @@ public partial class PathParametersPathExpansion { protected PathParametersPathExpansion() => throw null; + internal PathParametersPathExpansion(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual PathParametersPathExpansionStandard GetPathParametersPathExpansionStandardClient() => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/routes/src/Generated/PathParametersPathExpansionExplode.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/routes/src/Generated/PathParametersPathExpansionExplode.cs index b7f10f1c6d4..e2368337641 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/routes/src/Generated/PathParametersPathExpansionExplode.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/routes/src/Generated/PathParametersPathExpansionExplode.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Collections.Generic; @@ -14,6 +15,8 @@ public partial class PathParametersPathExpansionExplode { protected PathParametersPathExpansionExplode() => throw null; + internal PathParametersPathExpansionExplode(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult Primitive(string @param, RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/routes/src/Generated/PathParametersPathExpansionStandard.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/routes/src/Generated/PathParametersPathExpansionStandard.cs index d58ca6fbc4d..8c63b0829fb 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/routes/src/Generated/PathParametersPathExpansionStandard.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/routes/src/Generated/PathParametersPathExpansionStandard.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Collections.Generic; @@ -14,6 +15,8 @@ public partial class PathParametersPathExpansionStandard { protected PathParametersPathExpansionStandard() => throw null; + internal PathParametersPathExpansionStandard(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult Primitive(string @param, RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/routes/src/Generated/PathParametersReservedExpansion.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/routes/src/Generated/PathParametersReservedExpansion.cs index 3becc3ca8f2..60f78bfde07 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/routes/src/Generated/PathParametersReservedExpansion.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/routes/src/Generated/PathParametersReservedExpansion.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Threading; @@ -13,6 +14,8 @@ public partial class PathParametersReservedExpansion { protected PathParametersReservedExpansion() => throw null; + internal PathParametersReservedExpansion(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult Template(string @param, RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/routes/src/Generated/PathParametersSimpleExpansion.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/routes/src/Generated/PathParametersSimpleExpansion.cs index cb3b2ce1c3a..87724df6d6d 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/routes/src/Generated/PathParametersSimpleExpansion.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/routes/src/Generated/PathParametersSimpleExpansion.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel.Primitives; using Routes._PathParameters.SimpleExpansion.Explode; using Routes._PathParameters.SimpleExpansion.Standard; @@ -12,6 +13,8 @@ public partial class PathParametersSimpleExpansion { protected PathParametersSimpleExpansion() => throw null; + internal PathParametersSimpleExpansion(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual PathParametersSimpleExpansionStandard GetPathParametersSimpleExpansionStandardClient() => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/routes/src/Generated/PathParametersSimpleExpansionExplode.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/routes/src/Generated/PathParametersSimpleExpansionExplode.cs index 00c4d218a1c..2abcc233d4b 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/routes/src/Generated/PathParametersSimpleExpansionExplode.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/routes/src/Generated/PathParametersSimpleExpansionExplode.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Collections.Generic; @@ -14,6 +15,8 @@ public partial class PathParametersSimpleExpansionExplode { protected PathParametersSimpleExpansionExplode() => throw null; + internal PathParametersSimpleExpansionExplode(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult Primitive(string @param, RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/routes/src/Generated/PathParametersSimpleExpansionStandard.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/routes/src/Generated/PathParametersSimpleExpansionStandard.cs index 63477a318ae..21f896bcdb3 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/routes/src/Generated/PathParametersSimpleExpansionStandard.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/routes/src/Generated/PathParametersSimpleExpansionStandard.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Collections.Generic; @@ -14,6 +15,8 @@ public partial class PathParametersSimpleExpansionStandard { protected PathParametersSimpleExpansionStandard() => throw null; + internal PathParametersSimpleExpansionStandard(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult Primitive(string @param, RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/routes/src/Generated/QueryParameters.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/routes/src/Generated/QueryParameters.cs index 4ccfde73030..50f707d2cf0 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/routes/src/Generated/QueryParameters.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/routes/src/Generated/QueryParameters.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Threading; @@ -15,6 +16,8 @@ public partial class QueryParameters { protected QueryParameters() => throw null; + internal QueryParameters(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult TemplateOnly(string @param, RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/routes/src/Generated/QueryParametersQueryContinuation.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/routes/src/Generated/QueryParametersQueryContinuation.cs index c1e1821e791..3aa640a00e5 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/routes/src/Generated/QueryParametersQueryContinuation.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/routes/src/Generated/QueryParametersQueryContinuation.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel.Primitives; using Routes._QueryParameters.QueryContinuation.Explode; using Routes._QueryParameters.QueryContinuation.Standard; @@ -12,6 +13,8 @@ public partial class QueryParametersQueryContinuation { protected QueryParametersQueryContinuation() => throw null; + internal QueryParametersQueryContinuation(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual QueryParametersQueryContinuationStandard GetQueryParametersQueryContinuationStandardClient() => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/routes/src/Generated/QueryParametersQueryContinuationExplode.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/routes/src/Generated/QueryParametersQueryContinuationExplode.cs index b9a3cb696d4..ca911b55cb3 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/routes/src/Generated/QueryParametersQueryContinuationExplode.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/routes/src/Generated/QueryParametersQueryContinuationExplode.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Collections.Generic; @@ -14,6 +15,8 @@ public partial class QueryParametersQueryContinuationExplode { protected QueryParametersQueryContinuationExplode() => throw null; + internal QueryParametersQueryContinuationExplode(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult Primitive(string @param, RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/routes/src/Generated/QueryParametersQueryContinuationStandard.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/routes/src/Generated/QueryParametersQueryContinuationStandard.cs index 679ca546a46..828f03e49f2 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/routes/src/Generated/QueryParametersQueryContinuationStandard.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/routes/src/Generated/QueryParametersQueryContinuationStandard.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Collections.Generic; @@ -14,6 +15,8 @@ public partial class QueryParametersQueryContinuationStandard { protected QueryParametersQueryContinuationStandard() => throw null; + internal QueryParametersQueryContinuationStandard(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult Primitive(string @param, RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/routes/src/Generated/QueryParametersQueryExpansion.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/routes/src/Generated/QueryParametersQueryExpansion.cs index 7038262cc30..4d2b16565c0 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/routes/src/Generated/QueryParametersQueryExpansion.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/routes/src/Generated/QueryParametersQueryExpansion.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel.Primitives; using Routes._QueryParameters.QueryExpansion.Explode; using Routes._QueryParameters.QueryExpansion.Standard; @@ -12,6 +13,8 @@ public partial class QueryParametersQueryExpansion { protected QueryParametersQueryExpansion() => throw null; + internal QueryParametersQueryExpansion(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual QueryParametersQueryExpansionStandard GetQueryParametersQueryExpansionStandardClient() => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/routes/src/Generated/QueryParametersQueryExpansionExplode.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/routes/src/Generated/QueryParametersQueryExpansionExplode.cs index cedde7fe6aa..e8989434a9d 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/routes/src/Generated/QueryParametersQueryExpansionExplode.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/routes/src/Generated/QueryParametersQueryExpansionExplode.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Collections.Generic; @@ -14,6 +15,8 @@ public partial class QueryParametersQueryExpansionExplode { protected QueryParametersQueryExpansionExplode() => throw null; + internal QueryParametersQueryExpansionExplode(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult Primitive(string @param, RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/routes/src/Generated/QueryParametersQueryExpansionStandard.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/routes/src/Generated/QueryParametersQueryExpansionStandard.cs index dd88da3b509..9566e4d25f8 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/routes/src/Generated/QueryParametersQueryExpansionStandard.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/routes/src/Generated/QueryParametersQueryExpansionStandard.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Collections.Generic; @@ -14,6 +15,8 @@ public partial class QueryParametersQueryExpansionStandard { protected QueryParametersQueryExpansionStandard() => throw null; + internal QueryParametersQueryExpansionStandard(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult Primitive(string @param, RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/routes/src/Generated/RoutesClient.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/routes/src/Generated/RoutesClient.cs index 7b3edc83edf..8e156cfd6b7 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/routes/src/Generated/RoutesClient.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/routes/src/Generated/RoutesClient.cs @@ -5,6 +5,7 @@ using System; using System.ClientModel; using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; using System.Threading; using System.Threading.Tasks; using Routes._PathParameters; @@ -16,7 +17,12 @@ public partial class RoutesClient { public RoutesClient() : this(new Uri("http://localhost:3000"), new RoutesClientOptions()) => throw null; - public RoutesClient(Uri endpoint, RoutesClientOptions options) => throw null; + internal RoutesClient(AuthenticationPolicy authenticationPolicy, Uri endpoint, RoutesClientOptions options) => throw null; + + public RoutesClient(Uri endpoint, RoutesClientOptions options) : this(null, endpoint, options) => throw null; + + [Experimental("SCME0002")] + public RoutesClient(RoutesClientSettings settings) : this(AuthenticationPolicy.Create(settings), settings?.Endpoint, settings?.Options) => throw null; public ClientPipeline Pipeline => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/routes/src/Generated/RoutesClientOptions.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/routes/src/Generated/RoutesClientOptions.cs index f81efdb4ab9..7baddfceeb4 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/routes/src/Generated/RoutesClientOptions.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/routes/src/Generated/RoutesClientOptions.cs @@ -3,10 +3,16 @@ #nullable disable using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; +using Microsoft.Extensions.Configuration; namespace Routes { public partial class RoutesClientOptions : ClientPipelineOptions { + public RoutesClientOptions() => throw null; + + [Experimental("SCME0002")] + internal RoutesClientOptions(IConfigurationSection section) : base(section) => throw null; } } diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/routes/src/Generated/RoutesClientSettings.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/routes/src/Generated/RoutesClientSettings.cs new file mode 100644 index 00000000000..8b389ba6227 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/routes/src/Generated/RoutesClientSettings.cs @@ -0,0 +1,29 @@ +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; +using Microsoft.Extensions.Configuration; + +namespace Routes +{ + [Experimental("SCME0002")] + public partial class RoutesClientSettings : ClientSettings + { + public Uri Endpoint + { + get => throw null; + set => throw null; + } + + public RoutesClientOptions Options + { + get => throw null; + set => throw null; + } + + protected override void BindCore(IConfigurationSection section) => throw null; + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/serialization/encoded-name/json/src/Generated/JsonClient.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/serialization/encoded-name/json/src/Generated/JsonClient.cs index 0e13b569cc6..5501186e310 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/serialization/encoded-name/json/src/Generated/JsonClient.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/serialization/encoded-name/json/src/Generated/JsonClient.cs @@ -4,6 +4,7 @@ using System; using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; using Serialization.EncodedName.Json._Property; namespace Serialization.EncodedName.Json @@ -12,7 +13,12 @@ public partial class JsonClient { public JsonClient() : this(new Uri("http://localhost:3000"), new JsonClientOptions()) => throw null; - public JsonClient(Uri endpoint, JsonClientOptions options) => throw null; + internal JsonClient(AuthenticationPolicy authenticationPolicy, Uri endpoint, JsonClientOptions options) => throw null; + + public JsonClient(Uri endpoint, JsonClientOptions options) : this(null, endpoint, options) => throw null; + + [Experimental("SCME0002")] + public JsonClient(JsonClientSettings settings) : this(AuthenticationPolicy.Create(settings), settings?.Endpoint, settings?.Options) => throw null; public ClientPipeline Pipeline => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/serialization/encoded-name/json/src/Generated/JsonClientOptions.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/serialization/encoded-name/json/src/Generated/JsonClientOptions.cs index bc3159f77db..9ecf64e286d 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/serialization/encoded-name/json/src/Generated/JsonClientOptions.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/serialization/encoded-name/json/src/Generated/JsonClientOptions.cs @@ -3,10 +3,16 @@ #nullable disable using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; +using Microsoft.Extensions.Configuration; namespace Serialization.EncodedName.Json { public partial class JsonClientOptions : ClientPipelineOptions { + public JsonClientOptions() => throw null; + + [Experimental("SCME0002")] + internal JsonClientOptions(IConfigurationSection section) : base(section) => throw null; } } diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/serialization/encoded-name/json/src/Generated/JsonClientSettings.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/serialization/encoded-name/json/src/Generated/JsonClientSettings.cs new file mode 100644 index 00000000000..ae2ecca1041 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/serialization/encoded-name/json/src/Generated/JsonClientSettings.cs @@ -0,0 +1,29 @@ +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; +using Microsoft.Extensions.Configuration; + +namespace Serialization.EncodedName.Json +{ + [Experimental("SCME0002")] + public partial class JsonClientSettings : ClientSettings + { + public Uri Endpoint + { + get => throw null; + set => throw null; + } + + public JsonClientOptions Options + { + get => throw null; + set => throw null; + } + + protected override void BindCore(IConfigurationSection section) => throw null; + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/serialization/encoded-name/json/src/Generated/Property.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/serialization/encoded-name/json/src/Generated/Property.cs index 2a1aea1756d..67558d68030 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/serialization/encoded-name/json/src/Generated/Property.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/serialization/encoded-name/json/src/Generated/Property.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Threading; @@ -13,6 +14,8 @@ public partial class Property { protected Property() => throw null; + internal Property(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult Send(BinaryContent content, RequestOptions options = null) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/server/endpoint/not-defined/src/Generated/NotDefinedClient.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/server/endpoint/not-defined/src/Generated/NotDefinedClient.cs index c9b371e3911..a503b59d200 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/server/endpoint/not-defined/src/Generated/NotDefinedClient.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/server/endpoint/not-defined/src/Generated/NotDefinedClient.cs @@ -5,6 +5,7 @@ using System; using System.ClientModel; using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; using System.Threading; using System.Threading.Tasks; @@ -16,7 +17,12 @@ public partial class NotDefinedClient public NotDefinedClient(Uri endpoint) : this(endpoint, new NotDefinedClientOptions()) => throw null; - public NotDefinedClient(Uri endpoint, NotDefinedClientOptions options) => throw null; + internal NotDefinedClient(AuthenticationPolicy authenticationPolicy, Uri endpoint, NotDefinedClientOptions options) => throw null; + + public NotDefinedClient(Uri endpoint, NotDefinedClientOptions options) : this(null, endpoint, options) => throw null; + + [Experimental("SCME0002")] + public NotDefinedClient(NotDefinedClientSettings settings) : this(AuthenticationPolicy.Create(settings), settings?.Endpoint, settings?.Options) => throw null; public ClientPipeline Pipeline => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/server/endpoint/not-defined/src/Generated/NotDefinedClientOptions.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/server/endpoint/not-defined/src/Generated/NotDefinedClientOptions.cs index 7621f589fdc..4b087e11457 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/server/endpoint/not-defined/src/Generated/NotDefinedClientOptions.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/server/endpoint/not-defined/src/Generated/NotDefinedClientOptions.cs @@ -3,10 +3,16 @@ #nullable disable using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; +using Microsoft.Extensions.Configuration; namespace Server.Endpoint.NotDefined { public partial class NotDefinedClientOptions : ClientPipelineOptions { + public NotDefinedClientOptions() => throw null; + + [Experimental("SCME0002")] + internal NotDefinedClientOptions(IConfigurationSection section) : base(section) => throw null; } } diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/server/endpoint/not-defined/src/Generated/NotDefinedClientSettings.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/server/endpoint/not-defined/src/Generated/NotDefinedClientSettings.cs new file mode 100644 index 00000000000..fd6f73d8ae7 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/server/endpoint/not-defined/src/Generated/NotDefinedClientSettings.cs @@ -0,0 +1,29 @@ +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; +using Microsoft.Extensions.Configuration; + +namespace Server.Endpoint.NotDefined +{ + [Experimental("SCME0002")] + public partial class NotDefinedClientSettings : ClientSettings + { + public Uri Endpoint + { + get => throw null; + set => throw null; + } + + public NotDefinedClientOptions Options + { + get => throw null; + set => throw null; + } + + protected override void BindCore(IConfigurationSection section) => throw null; + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/server/path/multiple/src/Generated/MultipleClient.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/server/path/multiple/src/Generated/MultipleClient.cs index cfb066bf912..10ba60fb3a1 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/server/path/multiple/src/Generated/MultipleClient.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/server/path/multiple/src/Generated/MultipleClient.cs @@ -5,6 +5,7 @@ using System; using System.ClientModel; using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; using System.Threading; using System.Threading.Tasks; @@ -16,7 +17,12 @@ public partial class MultipleClient public MultipleClient(Uri endpoint) : this(endpoint, new MultipleClientOptions()) => throw null; - public MultipleClient(Uri endpoint, MultipleClientOptions options) => throw null; + internal MultipleClient(AuthenticationPolicy authenticationPolicy, Uri endpoint, MultipleClientOptions options) => throw null; + + public MultipleClient(Uri endpoint, MultipleClientOptions options) : this(null, endpoint, options) => throw null; + + [Experimental("SCME0002")] + public MultipleClient(MultipleClientSettings settings) : this(AuthenticationPolicy.Create(settings), settings?.Endpoint, settings?.Options) => throw null; public ClientPipeline Pipeline => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/server/path/multiple/src/Generated/MultipleClientOptions.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/server/path/multiple/src/Generated/MultipleClientOptions.cs index 3c63332cfb3..caa3e5d7a43 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/server/path/multiple/src/Generated/MultipleClientOptions.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/server/path/multiple/src/Generated/MultipleClientOptions.cs @@ -3,6 +3,8 @@ #nullable disable using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; +using Microsoft.Extensions.Configuration; namespace Server.Path.Multiple { @@ -12,6 +14,9 @@ public partial class MultipleClientOptions : ClientPipelineOptions public MultipleClientOptions(ServiceVersion version = LatestVersion) => throw null; + [Experimental("SCME0002")] + internal MultipleClientOptions(IConfigurationSection section) : base(section) => throw null; + public enum ServiceVersion { /// Version 1.0. diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/server/path/multiple/src/Generated/MultipleClientSettings.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/server/path/multiple/src/Generated/MultipleClientSettings.cs new file mode 100644 index 00000000000..6f63f3d49bd --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/server/path/multiple/src/Generated/MultipleClientSettings.cs @@ -0,0 +1,29 @@ +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; +using Microsoft.Extensions.Configuration; + +namespace Server.Path.Multiple +{ + [Experimental("SCME0002")] + public partial class MultipleClientSettings : ClientSettings + { + public Uri Endpoint + { + get => throw null; + set => throw null; + } + + public MultipleClientOptions Options + { + get => throw null; + set => throw null; + } + + protected override void BindCore(IConfigurationSection section) => throw null; + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/server/path/single/src/Generated/SingleClient.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/server/path/single/src/Generated/SingleClient.cs index 25d2f13eb10..3bc250e9775 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/server/path/single/src/Generated/SingleClient.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/server/path/single/src/Generated/SingleClient.cs @@ -5,6 +5,7 @@ using System; using System.ClientModel; using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; using System.Threading; using System.Threading.Tasks; @@ -16,7 +17,12 @@ public partial class SingleClient public SingleClient(Uri endpoint) : this(endpoint, new SingleClientOptions()) => throw null; - public SingleClient(Uri endpoint, SingleClientOptions options) => throw null; + internal SingleClient(AuthenticationPolicy authenticationPolicy, Uri endpoint, SingleClientOptions options) => throw null; + + public SingleClient(Uri endpoint, SingleClientOptions options) : this(null, endpoint, options) => throw null; + + [Experimental("SCME0002")] + public SingleClient(SingleClientSettings settings) : this(AuthenticationPolicy.Create(settings), settings?.Endpoint, settings?.Options) => throw null; public ClientPipeline Pipeline => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/server/path/single/src/Generated/SingleClientOptions.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/server/path/single/src/Generated/SingleClientOptions.cs index 2bf92e1e4dd..2437f3efb2e 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/server/path/single/src/Generated/SingleClientOptions.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/server/path/single/src/Generated/SingleClientOptions.cs @@ -3,10 +3,16 @@ #nullable disable using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; +using Microsoft.Extensions.Configuration; namespace Server.Path.Single { public partial class SingleClientOptions : ClientPipelineOptions { + public SingleClientOptions() => throw null; + + [Experimental("SCME0002")] + internal SingleClientOptions(IConfigurationSection section) : base(section) => throw null; } } diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/server/path/single/src/Generated/SingleClientSettings.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/server/path/single/src/Generated/SingleClientSettings.cs new file mode 100644 index 00000000000..62fc1c47174 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/server/path/single/src/Generated/SingleClientSettings.cs @@ -0,0 +1,29 @@ +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; +using Microsoft.Extensions.Configuration; + +namespace Server.Path.Single +{ + [Experimental("SCME0002")] + public partial class SingleClientSettings : ClientSettings + { + public Uri Endpoint + { + get => throw null; + set => throw null; + } + + public SingleClientOptions Options + { + get => throw null; + set => throw null; + } + + protected override void BindCore(IConfigurationSection section) => throw null; + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/server/versions/not-versioned/src/Generated/NotVersionedClient.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/server/versions/not-versioned/src/Generated/NotVersionedClient.cs index 6fb0abe3bce..66b8752fa2d 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/server/versions/not-versioned/src/Generated/NotVersionedClient.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/server/versions/not-versioned/src/Generated/NotVersionedClient.cs @@ -5,6 +5,7 @@ using System; using System.ClientModel; using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; using System.Threading; using System.Threading.Tasks; @@ -16,7 +17,12 @@ public partial class NotVersionedClient public NotVersionedClient(Uri endpoint) : this(endpoint, new NotVersionedClientOptions()) => throw null; - public NotVersionedClient(Uri endpoint, NotVersionedClientOptions options) => throw null; + internal NotVersionedClient(AuthenticationPolicy authenticationPolicy, Uri endpoint, NotVersionedClientOptions options) => throw null; + + public NotVersionedClient(Uri endpoint, NotVersionedClientOptions options) : this(null, endpoint, options) => throw null; + + [Experimental("SCME0002")] + public NotVersionedClient(NotVersionedClientSettings settings) : this(AuthenticationPolicy.Create(settings), settings?.Endpoint, settings?.Options) => throw null; public ClientPipeline Pipeline => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/server/versions/not-versioned/src/Generated/NotVersionedClientOptions.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/server/versions/not-versioned/src/Generated/NotVersionedClientOptions.cs index f08093acac4..d799204f298 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/server/versions/not-versioned/src/Generated/NotVersionedClientOptions.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/server/versions/not-versioned/src/Generated/NotVersionedClientOptions.cs @@ -3,10 +3,16 @@ #nullable disable using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; +using Microsoft.Extensions.Configuration; namespace Server.Versions.NotVersioned { public partial class NotVersionedClientOptions : ClientPipelineOptions { + public NotVersionedClientOptions() => throw null; + + [Experimental("SCME0002")] + internal NotVersionedClientOptions(IConfigurationSection section) : base(section) => throw null; } } diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/server/versions/not-versioned/src/Generated/NotVersionedClientSettings.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/server/versions/not-versioned/src/Generated/NotVersionedClientSettings.cs new file mode 100644 index 00000000000..f090470d82a --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/server/versions/not-versioned/src/Generated/NotVersionedClientSettings.cs @@ -0,0 +1,29 @@ +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; +using Microsoft.Extensions.Configuration; + +namespace Server.Versions.NotVersioned +{ + [Experimental("SCME0002")] + public partial class NotVersionedClientSettings : ClientSettings + { + public Uri Endpoint + { + get => throw null; + set => throw null; + } + + public NotVersionedClientOptions Options + { + get => throw null; + set => throw null; + } + + protected override void BindCore(IConfigurationSection section) => throw null; + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/server/versions/versioned/src/Generated/VersionedClient.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/server/versions/versioned/src/Generated/VersionedClient.cs index 01e9d2e3224..fc5d889c517 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/server/versions/versioned/src/Generated/VersionedClient.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/server/versions/versioned/src/Generated/VersionedClient.cs @@ -5,6 +5,7 @@ using System; using System.ClientModel; using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; using System.Threading; using System.Threading.Tasks; @@ -16,7 +17,12 @@ public partial class VersionedClient public VersionedClient(Uri endpoint) : this(endpoint, new VersionedClientOptions()) => throw null; - public VersionedClient(Uri endpoint, VersionedClientOptions options) => throw null; + internal VersionedClient(AuthenticationPolicy authenticationPolicy, Uri endpoint, VersionedClientOptions options) => throw null; + + public VersionedClient(Uri endpoint, VersionedClientOptions options) : this(null, endpoint, options) => throw null; + + [Experimental("SCME0002")] + public VersionedClient(VersionedClientSettings settings) : this(AuthenticationPolicy.Create(settings), settings?.Endpoint, settings?.Options) => throw null; public ClientPipeline Pipeline => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/server/versions/versioned/src/Generated/VersionedClientOptions.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/server/versions/versioned/src/Generated/VersionedClientOptions.cs index 6caa7e3df01..ad90f69c8ee 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/server/versions/versioned/src/Generated/VersionedClientOptions.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/server/versions/versioned/src/Generated/VersionedClientOptions.cs @@ -3,6 +3,8 @@ #nullable disable using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; +using Microsoft.Extensions.Configuration; namespace Server.Versions.Versioned { @@ -12,6 +14,9 @@ public partial class VersionedClientOptions : ClientPipelineOptions public VersionedClientOptions(ServiceVersion version = LatestVersion) => throw null; + [Experimental("SCME0002")] + internal VersionedClientOptions(IConfigurationSection section) : base(section) => throw null; + public enum ServiceVersion { /// The version 2022-12-01-preview. diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/server/versions/versioned/src/Generated/VersionedClientSettings.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/server/versions/versioned/src/Generated/VersionedClientSettings.cs new file mode 100644 index 00000000000..b9d2f526719 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/server/versions/versioned/src/Generated/VersionedClientSettings.cs @@ -0,0 +1,29 @@ +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; +using Microsoft.Extensions.Configuration; + +namespace Server.Versions.Versioned +{ + [Experimental("SCME0002")] + public partial class VersionedClientSettings : ClientSettings + { + public Uri Endpoint + { + get => throw null; + set => throw null; + } + + public VersionedClientOptions Options + { + get => throw null; + set => throw null; + } + + protected override void BindCore(IConfigurationSection section) => throw null; + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/special-headers/conditional-request/src/Generated/ConditionalRequestClient.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/special-headers/conditional-request/src/Generated/ConditionalRequestClient.cs index 0e54b80f164..cac754cfedb 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/special-headers/conditional-request/src/Generated/ConditionalRequestClient.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/special-headers/conditional-request/src/Generated/ConditionalRequestClient.cs @@ -5,6 +5,7 @@ using System; using System.ClientModel; using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; using System.Threading; using System.Threading.Tasks; @@ -14,7 +15,12 @@ public partial class ConditionalRequestClient { public ConditionalRequestClient() : this(new Uri("http://localhost:3000"), new ConditionalRequestClientOptions()) => throw null; - public ConditionalRequestClient(Uri endpoint, ConditionalRequestClientOptions options) => throw null; + internal ConditionalRequestClient(AuthenticationPolicy authenticationPolicy, Uri endpoint, ConditionalRequestClientOptions options) => throw null; + + public ConditionalRequestClient(Uri endpoint, ConditionalRequestClientOptions options) : this(null, endpoint, options) => throw null; + + [Experimental("SCME0002")] + public ConditionalRequestClient(ConditionalRequestClientSettings settings) : this(AuthenticationPolicy.Create(settings), settings?.Endpoint, settings?.Options) => throw null; public ClientPipeline Pipeline => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/special-headers/conditional-request/src/Generated/ConditionalRequestClientOptions.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/special-headers/conditional-request/src/Generated/ConditionalRequestClientOptions.cs index 924fd0111b6..95d658caefb 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/special-headers/conditional-request/src/Generated/ConditionalRequestClientOptions.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/special-headers/conditional-request/src/Generated/ConditionalRequestClientOptions.cs @@ -3,10 +3,16 @@ #nullable disable using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; +using Microsoft.Extensions.Configuration; namespace SpecialHeaders.ConditionalRequest { public partial class ConditionalRequestClientOptions : ClientPipelineOptions { + public ConditionalRequestClientOptions() => throw null; + + [Experimental("SCME0002")] + internal ConditionalRequestClientOptions(IConfigurationSection section) : base(section) => throw null; } } diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/special-headers/conditional-request/src/Generated/ConditionalRequestClientSettings.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/special-headers/conditional-request/src/Generated/ConditionalRequestClientSettings.cs new file mode 100644 index 00000000000..875c80b7101 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/special-headers/conditional-request/src/Generated/ConditionalRequestClientSettings.cs @@ -0,0 +1,29 @@ +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; +using Microsoft.Extensions.Configuration; + +namespace SpecialHeaders.ConditionalRequest +{ + [Experimental("SCME0002")] + public partial class ConditionalRequestClientSettings : ClientSettings + { + public Uri Endpoint + { + get => throw null; + set => throw null; + } + + public ConditionalRequestClientOptions Options + { + get => throw null; + set => throw null; + } + + protected override void BindCore(IConfigurationSection section) => throw null; + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/special-headers/repeatability/src/Generated/RepeatabilityClient.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/special-headers/repeatability/src/Generated/RepeatabilityClient.cs index 325865ab679..cff3310bcef 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/special-headers/repeatability/src/Generated/RepeatabilityClient.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/special-headers/repeatability/src/Generated/RepeatabilityClient.cs @@ -5,6 +5,7 @@ using System; using System.ClientModel; using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; using System.Threading; using System.Threading.Tasks; @@ -14,7 +15,12 @@ public partial class RepeatabilityClient { public RepeatabilityClient() : this(new Uri("http://localhost:3000"), new RepeatabilityClientOptions()) => throw null; - public RepeatabilityClient(Uri endpoint, RepeatabilityClientOptions options) => throw null; + internal RepeatabilityClient(AuthenticationPolicy authenticationPolicy, Uri endpoint, RepeatabilityClientOptions options) => throw null; + + public RepeatabilityClient(Uri endpoint, RepeatabilityClientOptions options) : this(null, endpoint, options) => throw null; + + [Experimental("SCME0002")] + public RepeatabilityClient(RepeatabilityClientSettings settings) : this(AuthenticationPolicy.Create(settings), settings?.Endpoint, settings?.Options) => throw null; public ClientPipeline Pipeline => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/special-headers/repeatability/src/Generated/RepeatabilityClientOptions.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/special-headers/repeatability/src/Generated/RepeatabilityClientOptions.cs index e41461a9acc..fb088f71dbb 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/special-headers/repeatability/src/Generated/RepeatabilityClientOptions.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/special-headers/repeatability/src/Generated/RepeatabilityClientOptions.cs @@ -3,10 +3,16 @@ #nullable disable using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; +using Microsoft.Extensions.Configuration; namespace SpecialHeaders.Repeatability { public partial class RepeatabilityClientOptions : ClientPipelineOptions { + public RepeatabilityClientOptions() => throw null; + + [Experimental("SCME0002")] + internal RepeatabilityClientOptions(IConfigurationSection section) : base(section) => throw null; } } diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/special-headers/repeatability/src/Generated/RepeatabilityClientSettings.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/special-headers/repeatability/src/Generated/RepeatabilityClientSettings.cs new file mode 100644 index 00000000000..3a295325198 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/special-headers/repeatability/src/Generated/RepeatabilityClientSettings.cs @@ -0,0 +1,29 @@ +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; +using Microsoft.Extensions.Configuration; + +namespace SpecialHeaders.Repeatability +{ + [Experimental("SCME0002")] + public partial class RepeatabilityClientSettings : ClientSettings + { + public Uri Endpoint + { + get => throw null; + set => throw null; + } + + public RepeatabilityClientOptions Options + { + get => throw null; + set => throw null; + } + + protected override void BindCore(IConfigurationSection section) => throw null; + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/ExtensibleStrings.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/ExtensibleStrings.cs index eaa136ac8ca..a806732aa86 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/ExtensibleStrings.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/ExtensibleStrings.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Threading; @@ -13,6 +14,8 @@ public partial class ExtensibleStrings { protected ExtensibleStrings() => throw null; + internal ExtensibleStrings(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult PutExtensibleStringValue(string accept, BinaryContent content, RequestOptions options = null) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/ModelProperties.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/ModelProperties.cs index 76f4b999169..145be0ededd 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/ModelProperties.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/ModelProperties.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Threading; @@ -13,6 +14,8 @@ public partial class ModelProperties { protected ModelProperties() => throw null; + internal ModelProperties(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult SameAsModel(BinaryContent content, RequestOptions options = null) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models.cs index af9e99fa778..ec89fe4d3f7 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Threading; @@ -13,6 +14,8 @@ public partial class Models { protected Models() => throw null; + internal Models(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult WithAnd(BinaryContent content, RequestOptions options = null) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Operations.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Operations.cs index bb367d9e0e7..1dfa7cdcfbe 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Operations.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Operations.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Threading; @@ -13,6 +14,8 @@ public partial class Operations { protected Operations() => throw null; + internal Operations(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult And(RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Parameters.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Parameters.cs index a489749d1a9..fb1b60d7ad1 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Parameters.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Parameters.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Threading; @@ -13,6 +14,8 @@ public partial class Parameters { protected Parameters() => throw null; + internal Parameters(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult WithAnd(string @and, RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/SpecialWordsClient.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/SpecialWordsClient.cs index 431e86de748..652db690e95 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/SpecialWordsClient.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/SpecialWordsClient.cs @@ -4,6 +4,7 @@ using System; using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; using SpecialWords._ModelProperties; using SpecialWords._Models; @@ -13,7 +14,12 @@ public partial class SpecialWordsClient { public SpecialWordsClient() : this(new Uri("http://localhost:3000"), new SpecialWordsClientOptions()) => throw null; - public SpecialWordsClient(Uri endpoint, SpecialWordsClientOptions options) => throw null; + internal SpecialWordsClient(AuthenticationPolicy authenticationPolicy, Uri endpoint, SpecialWordsClientOptions options) => throw null; + + public SpecialWordsClient(Uri endpoint, SpecialWordsClientOptions options) : this(null, endpoint, options) => throw null; + + [Experimental("SCME0002")] + public SpecialWordsClient(SpecialWordsClientSettings settings) : this(AuthenticationPolicy.Create(settings), settings?.Endpoint, settings?.Options) => throw null; public ClientPipeline Pipeline => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/SpecialWordsClientOptions.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/SpecialWordsClientOptions.cs index 51d0271c810..62880034a3c 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/SpecialWordsClientOptions.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/SpecialWordsClientOptions.cs @@ -3,10 +3,16 @@ #nullable disable using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; +using Microsoft.Extensions.Configuration; namespace SpecialWords { public partial class SpecialWordsClientOptions : ClientPipelineOptions { + public SpecialWordsClientOptions() => throw null; + + [Experimental("SCME0002")] + internal SpecialWordsClientOptions(IConfigurationSection section) : base(section) => throw null; } } diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/SpecialWordsClientSettings.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/SpecialWordsClientSettings.cs new file mode 100644 index 00000000000..28c09cdfd51 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/SpecialWordsClientSettings.cs @@ -0,0 +1,29 @@ +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; +using Microsoft.Extensions.Configuration; + +namespace SpecialWords +{ + [Experimental("SCME0002")] + public partial class SpecialWordsClientSettings : ClientSettings + { + public Uri Endpoint + { + get => throw null; + set => throw null; + } + + public SpecialWordsClientOptions Options + { + get => throw null; + set => throw null; + } + + protected override void BindCore(IConfigurationSection section) => throw null; + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/array/src/Generated/ArrayClient.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/array/src/Generated/ArrayClient.cs index 515ecb8abaa..1597bfe32fb 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/array/src/Generated/ArrayClient.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/array/src/Generated/ArrayClient.cs @@ -4,6 +4,7 @@ using System; using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; namespace _Type._Array { @@ -11,7 +12,12 @@ public partial class ArrayClient { public ArrayClient() : this(new Uri("http://localhost:3000"), new ArrayClientOptions()) => throw null; - public ArrayClient(Uri endpoint, ArrayClientOptions options) => throw null; + internal ArrayClient(AuthenticationPolicy authenticationPolicy, Uri endpoint, ArrayClientOptions options) => throw null; + + public ArrayClient(Uri endpoint, ArrayClientOptions options) : this(null, endpoint, options) => throw null; + + [Experimental("SCME0002")] + public ArrayClient(ArrayClientSettings settings) : this(AuthenticationPolicy.Create(settings), settings?.Endpoint, settings?.Options) => throw null; public ClientPipeline Pipeline => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/array/src/Generated/ArrayClientOptions.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/array/src/Generated/ArrayClientOptions.cs index 90179926109..dc7837266e1 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/array/src/Generated/ArrayClientOptions.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/array/src/Generated/ArrayClientOptions.cs @@ -3,10 +3,16 @@ #nullable disable using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; +using Microsoft.Extensions.Configuration; namespace _Type._Array { public partial class ArrayClientOptions : ClientPipelineOptions { + public ArrayClientOptions() => throw null; + + [Experimental("SCME0002")] + internal ArrayClientOptions(IConfigurationSection section) : base(section) => throw null; } } diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/array/src/Generated/ArrayClientSettings.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/array/src/Generated/ArrayClientSettings.cs new file mode 100644 index 00000000000..c315edcc62d --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/array/src/Generated/ArrayClientSettings.cs @@ -0,0 +1,29 @@ +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; +using Microsoft.Extensions.Configuration; + +namespace _Type._Array +{ + [Experimental("SCME0002")] + public partial class ArrayClientSettings : ClientSettings + { + public Uri Endpoint + { + get => throw null; + set => throw null; + } + + public ArrayClientOptions Options + { + get => throw null; + set => throw null; + } + + protected override void BindCore(IConfigurationSection section) => throw null; + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/array/src/Generated/BooleanValue.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/array/src/Generated/BooleanValue.cs index 01b3af52309..d290fed4d03 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/array/src/Generated/BooleanValue.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/array/src/Generated/BooleanValue.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Collections.Generic; @@ -14,6 +15,8 @@ public partial class BooleanValue { protected BooleanValue() => throw null; + internal BooleanValue(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult Get(RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/array/src/Generated/DatetimeValue.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/array/src/Generated/DatetimeValue.cs index 720dc85c07b..c7cd4718045 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/array/src/Generated/DatetimeValue.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/array/src/Generated/DatetimeValue.cs @@ -15,6 +15,8 @@ public partial class DatetimeValue { protected DatetimeValue() => throw null; + internal DatetimeValue(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult Get(RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/array/src/Generated/DurationValue.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/array/src/Generated/DurationValue.cs index 2b2696da40c..d41e7956ded 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/array/src/Generated/DurationValue.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/array/src/Generated/DurationValue.cs @@ -15,6 +15,8 @@ public partial class DurationValue { protected DurationValue() => throw null; + internal DurationValue(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult Get(RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/array/src/Generated/Float32Value.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/array/src/Generated/Float32Value.cs index 56b5ffb2f95..139091b980e 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/array/src/Generated/Float32Value.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/array/src/Generated/Float32Value.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Collections.Generic; @@ -14,6 +15,8 @@ public partial class Float32Value { protected Float32Value() => throw null; + internal Float32Value(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult Get(RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/array/src/Generated/Int32Value.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/array/src/Generated/Int32Value.cs index 7babbc0f8f9..b38525f6496 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/array/src/Generated/Int32Value.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/array/src/Generated/Int32Value.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Collections.Generic; @@ -14,6 +15,8 @@ public partial class Int32Value { protected Int32Value() => throw null; + internal Int32Value(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult Get(RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/array/src/Generated/Int64Value.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/array/src/Generated/Int64Value.cs index ba6f600bae1..952fb96e4cc 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/array/src/Generated/Int64Value.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/array/src/Generated/Int64Value.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Collections.Generic; @@ -14,6 +15,8 @@ public partial class Int64Value { protected Int64Value() => throw null; + internal Int64Value(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult Get(RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/array/src/Generated/ModelValue.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/array/src/Generated/ModelValue.cs index d842b2c8829..333dfabdcff 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/array/src/Generated/ModelValue.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/array/src/Generated/ModelValue.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Collections.Generic; @@ -14,6 +15,8 @@ public partial class ModelValue { protected ModelValue() => throw null; + internal ModelValue(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult Get(RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/array/src/Generated/NullableBooleanValue.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/array/src/Generated/NullableBooleanValue.cs index 21c9ed002fe..eb0177c832a 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/array/src/Generated/NullableBooleanValue.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/array/src/Generated/NullableBooleanValue.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Collections.Generic; @@ -14,6 +15,8 @@ public partial class NullableBooleanValue { protected NullableBooleanValue() => throw null; + internal NullableBooleanValue(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult Get(RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/array/src/Generated/NullableFloatValue.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/array/src/Generated/NullableFloatValue.cs index dcfe8553721..ab401bf7739 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/array/src/Generated/NullableFloatValue.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/array/src/Generated/NullableFloatValue.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Collections.Generic; @@ -14,6 +15,8 @@ public partial class NullableFloatValue { protected NullableFloatValue() => throw null; + internal NullableFloatValue(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult Get(RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/array/src/Generated/NullableInt32Value.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/array/src/Generated/NullableInt32Value.cs index 6aae5a6a603..df168f64ea3 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/array/src/Generated/NullableInt32Value.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/array/src/Generated/NullableInt32Value.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Collections.Generic; @@ -14,6 +15,8 @@ public partial class NullableInt32Value { protected NullableInt32Value() => throw null; + internal NullableInt32Value(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult Get(RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/array/src/Generated/NullableModelValue.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/array/src/Generated/NullableModelValue.cs index bb14d5e8e9d..336d4186bd1 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/array/src/Generated/NullableModelValue.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/array/src/Generated/NullableModelValue.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Collections.Generic; @@ -14,6 +15,8 @@ public partial class NullableModelValue { protected NullableModelValue() => throw null; + internal NullableModelValue(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult Get(RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/array/src/Generated/NullableStringValue.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/array/src/Generated/NullableStringValue.cs index 490dd4aad6e..f22d0fb8493 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/array/src/Generated/NullableStringValue.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/array/src/Generated/NullableStringValue.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Collections.Generic; @@ -14,6 +15,8 @@ public partial class NullableStringValue { protected NullableStringValue() => throw null; + internal NullableStringValue(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult Get(RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/array/src/Generated/StringValue.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/array/src/Generated/StringValue.cs index 7d61138920c..e330fa6ffa4 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/array/src/Generated/StringValue.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/array/src/Generated/StringValue.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Collections.Generic; @@ -14,6 +15,8 @@ public partial class StringValue { protected StringValue() => throw null; + internal StringValue(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult Get(RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/array/src/Generated/UnknownValue.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/array/src/Generated/UnknownValue.cs index 0fcbbd28461..a049ca8e8b3 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/array/src/Generated/UnknownValue.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/array/src/Generated/UnknownValue.cs @@ -15,6 +15,8 @@ public partial class UnknownValue { protected UnknownValue() => throw null; + internal UnknownValue(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult Get(RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/dictionary/src/Generated/BooleanValue.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/dictionary/src/Generated/BooleanValue.cs index 8e54e093f42..f4727e78b82 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/dictionary/src/Generated/BooleanValue.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/dictionary/src/Generated/BooleanValue.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Collections.Generic; @@ -14,6 +15,8 @@ public partial class BooleanValue { protected BooleanValue() => throw null; + internal BooleanValue(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult Get(RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/dictionary/src/Generated/DatetimeValue.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/dictionary/src/Generated/DatetimeValue.cs index 1063eabc942..03241999bc4 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/dictionary/src/Generated/DatetimeValue.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/dictionary/src/Generated/DatetimeValue.cs @@ -15,6 +15,8 @@ public partial class DatetimeValue { protected DatetimeValue() => throw null; + internal DatetimeValue(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult Get(RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/dictionary/src/Generated/DictionaryClient.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/dictionary/src/Generated/DictionaryClient.cs index ce6ad9364b3..54d7b564602 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/dictionary/src/Generated/DictionaryClient.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/dictionary/src/Generated/DictionaryClient.cs @@ -4,6 +4,7 @@ using System; using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; namespace _Type.Dictionary { @@ -11,7 +12,12 @@ public partial class DictionaryClient { public DictionaryClient() : this(new Uri("http://localhost:3000"), new DictionaryClientOptions()) => throw null; - public DictionaryClient(Uri endpoint, DictionaryClientOptions options) => throw null; + internal DictionaryClient(AuthenticationPolicy authenticationPolicy, Uri endpoint, DictionaryClientOptions options) => throw null; + + public DictionaryClient(Uri endpoint, DictionaryClientOptions options) : this(null, endpoint, options) => throw null; + + [Experimental("SCME0002")] + public DictionaryClient(DictionaryClientSettings settings) : this(AuthenticationPolicy.Create(settings), settings?.Endpoint, settings?.Options) => throw null; public ClientPipeline Pipeline => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/dictionary/src/Generated/DictionaryClientOptions.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/dictionary/src/Generated/DictionaryClientOptions.cs index 7cb91a10843..ffc737d6134 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/dictionary/src/Generated/DictionaryClientOptions.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/dictionary/src/Generated/DictionaryClientOptions.cs @@ -3,10 +3,16 @@ #nullable disable using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; +using Microsoft.Extensions.Configuration; namespace _Type.Dictionary { public partial class DictionaryClientOptions : ClientPipelineOptions { + public DictionaryClientOptions() => throw null; + + [Experimental("SCME0002")] + internal DictionaryClientOptions(IConfigurationSection section) : base(section) => throw null; } } diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/dictionary/src/Generated/DictionaryClientSettings.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/dictionary/src/Generated/DictionaryClientSettings.cs new file mode 100644 index 00000000000..2e51cfc2467 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/dictionary/src/Generated/DictionaryClientSettings.cs @@ -0,0 +1,29 @@ +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; +using Microsoft.Extensions.Configuration; + +namespace _Type.Dictionary +{ + [Experimental("SCME0002")] + public partial class DictionaryClientSettings : ClientSettings + { + public Uri Endpoint + { + get => throw null; + set => throw null; + } + + public DictionaryClientOptions Options + { + get => throw null; + set => throw null; + } + + protected override void BindCore(IConfigurationSection section) => throw null; + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/dictionary/src/Generated/DurationValue.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/dictionary/src/Generated/DurationValue.cs index 677f6e3c69f..025fb9260d0 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/dictionary/src/Generated/DurationValue.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/dictionary/src/Generated/DurationValue.cs @@ -15,6 +15,8 @@ public partial class DurationValue { protected DurationValue() => throw null; + internal DurationValue(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult Get(RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/dictionary/src/Generated/Float32Value.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/dictionary/src/Generated/Float32Value.cs index 89e188a1dfa..bb5152ac021 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/dictionary/src/Generated/Float32Value.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/dictionary/src/Generated/Float32Value.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Collections.Generic; @@ -14,6 +15,8 @@ public partial class Float32Value { protected Float32Value() => throw null; + internal Float32Value(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult Get(RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/dictionary/src/Generated/Int32Value.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/dictionary/src/Generated/Int32Value.cs index 1746503b91b..943b687f046 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/dictionary/src/Generated/Int32Value.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/dictionary/src/Generated/Int32Value.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Collections.Generic; @@ -14,6 +15,8 @@ public partial class Int32Value { protected Int32Value() => throw null; + internal Int32Value(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult Get(RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/dictionary/src/Generated/Int64Value.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/dictionary/src/Generated/Int64Value.cs index a86d59c62e2..7963141ea14 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/dictionary/src/Generated/Int64Value.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/dictionary/src/Generated/Int64Value.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Collections.Generic; @@ -14,6 +15,8 @@ public partial class Int64Value { protected Int64Value() => throw null; + internal Int64Value(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult Get(RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/dictionary/src/Generated/ModelValue.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/dictionary/src/Generated/ModelValue.cs index becd3b219d2..58bd7395fb9 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/dictionary/src/Generated/ModelValue.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/dictionary/src/Generated/ModelValue.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Collections.Generic; @@ -14,6 +15,8 @@ public partial class ModelValue { protected ModelValue() => throw null; + internal ModelValue(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult Get(RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/dictionary/src/Generated/NullableFloatValue.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/dictionary/src/Generated/NullableFloatValue.cs index bf6a1626799..b1b16591b20 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/dictionary/src/Generated/NullableFloatValue.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/dictionary/src/Generated/NullableFloatValue.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Collections.Generic; @@ -14,6 +15,8 @@ public partial class NullableFloatValue { protected NullableFloatValue() => throw null; + internal NullableFloatValue(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult Get(RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/dictionary/src/Generated/RecursiveModelValue.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/dictionary/src/Generated/RecursiveModelValue.cs index 83cced869b4..eb4eac17013 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/dictionary/src/Generated/RecursiveModelValue.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/dictionary/src/Generated/RecursiveModelValue.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Collections.Generic; @@ -14,6 +15,8 @@ public partial class RecursiveModelValue { protected RecursiveModelValue() => throw null; + internal RecursiveModelValue(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult Get(RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/dictionary/src/Generated/StringValue.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/dictionary/src/Generated/StringValue.cs index 66b9650148f..7fe039c683c 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/dictionary/src/Generated/StringValue.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/dictionary/src/Generated/StringValue.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Collections.Generic; @@ -14,6 +15,8 @@ public partial class StringValue { protected StringValue() => throw null; + internal StringValue(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult Get(RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/dictionary/src/Generated/UnknownValue.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/dictionary/src/Generated/UnknownValue.cs index 4106f860d0b..f91e8911853 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/dictionary/src/Generated/UnknownValue.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/dictionary/src/Generated/UnknownValue.cs @@ -15,6 +15,8 @@ public partial class UnknownValue { protected UnknownValue() => throw null; + internal UnknownValue(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult Get(RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/enum/extensible/src/Generated/ExtensibleClient.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/enum/extensible/src/Generated/ExtensibleClient.cs index 2d82a8caeb9..25a7ff8aa60 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/enum/extensible/src/Generated/ExtensibleClient.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/enum/extensible/src/Generated/ExtensibleClient.cs @@ -4,6 +4,7 @@ using System; using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; namespace _Type._Enum.Extensible { @@ -11,7 +12,12 @@ public partial class ExtensibleClient { public ExtensibleClient() : this(new Uri("http://localhost:3000"), new ExtensibleClientOptions()) => throw null; - public ExtensibleClient(Uri endpoint, ExtensibleClientOptions options) => throw null; + internal ExtensibleClient(AuthenticationPolicy authenticationPolicy, Uri endpoint, ExtensibleClientOptions options) => throw null; + + public ExtensibleClient(Uri endpoint, ExtensibleClientOptions options) : this(null, endpoint, options) => throw null; + + [Experimental("SCME0002")] + public ExtensibleClient(ExtensibleClientSettings settings) : this(AuthenticationPolicy.Create(settings), settings?.Endpoint, settings?.Options) => throw null; public ClientPipeline Pipeline => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/enum/extensible/src/Generated/ExtensibleClientOptions.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/enum/extensible/src/Generated/ExtensibleClientOptions.cs index 525ccf06c11..8abce3f7be1 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/enum/extensible/src/Generated/ExtensibleClientOptions.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/enum/extensible/src/Generated/ExtensibleClientOptions.cs @@ -3,10 +3,16 @@ #nullable disable using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; +using Microsoft.Extensions.Configuration; namespace _Type._Enum.Extensible { public partial class ExtensibleClientOptions : ClientPipelineOptions { + public ExtensibleClientOptions() => throw null; + + [Experimental("SCME0002")] + internal ExtensibleClientOptions(IConfigurationSection section) : base(section) => throw null; } } diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/enum/extensible/src/Generated/ExtensibleClientSettings.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/enum/extensible/src/Generated/ExtensibleClientSettings.cs new file mode 100644 index 00000000000..feadb885bf8 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/enum/extensible/src/Generated/ExtensibleClientSettings.cs @@ -0,0 +1,29 @@ +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; +using Microsoft.Extensions.Configuration; + +namespace _Type._Enum.Extensible +{ + [Experimental("SCME0002")] + public partial class ExtensibleClientSettings : ClientSettings + { + public Uri Endpoint + { + get => throw null; + set => throw null; + } + + public ExtensibleClientOptions Options + { + get => throw null; + set => throw null; + } + + protected override void BindCore(IConfigurationSection section) => throw null; + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/enum/extensible/src/Generated/String.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/enum/extensible/src/Generated/String.cs index c4aadc25dce..30632b37530 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/enum/extensible/src/Generated/String.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/enum/extensible/src/Generated/String.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Threading; @@ -13,6 +14,8 @@ public partial class String { protected String() => throw null; + internal String(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult GetKnownValue(RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/enum/fixed/src/Generated/FixedClient.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/enum/fixed/src/Generated/FixedClient.cs index 3c72b867393..b111aa81947 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/enum/fixed/src/Generated/FixedClient.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/enum/fixed/src/Generated/FixedClient.cs @@ -4,6 +4,7 @@ using System; using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; namespace _Type._Enum.Fixed { @@ -11,7 +12,12 @@ public partial class FixedClient { public FixedClient() : this(new Uri("http://localhost:3000"), new FixedClientOptions()) => throw null; - public FixedClient(Uri endpoint, FixedClientOptions options) => throw null; + internal FixedClient(AuthenticationPolicy authenticationPolicy, Uri endpoint, FixedClientOptions options) => throw null; + + public FixedClient(Uri endpoint, FixedClientOptions options) : this(null, endpoint, options) => throw null; + + [Experimental("SCME0002")] + public FixedClient(FixedClientSettings settings) : this(AuthenticationPolicy.Create(settings), settings?.Endpoint, settings?.Options) => throw null; public ClientPipeline Pipeline => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/enum/fixed/src/Generated/FixedClientOptions.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/enum/fixed/src/Generated/FixedClientOptions.cs index b3e1ebf26c3..5aa2c9da80c 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/enum/fixed/src/Generated/FixedClientOptions.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/enum/fixed/src/Generated/FixedClientOptions.cs @@ -3,10 +3,16 @@ #nullable disable using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; +using Microsoft.Extensions.Configuration; namespace _Type._Enum.Fixed { public partial class FixedClientOptions : ClientPipelineOptions { + public FixedClientOptions() => throw null; + + [Experimental("SCME0002")] + internal FixedClientOptions(IConfigurationSection section) : base(section) => throw null; } } diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/enum/fixed/src/Generated/FixedClientSettings.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/enum/fixed/src/Generated/FixedClientSettings.cs new file mode 100644 index 00000000000..4e365e6f6c5 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/enum/fixed/src/Generated/FixedClientSettings.cs @@ -0,0 +1,29 @@ +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; +using Microsoft.Extensions.Configuration; + +namespace _Type._Enum.Fixed +{ + [Experimental("SCME0002")] + public partial class FixedClientSettings : ClientSettings + { + public Uri Endpoint + { + get => throw null; + set => throw null; + } + + public FixedClientOptions Options + { + get => throw null; + set => throw null; + } + + protected override void BindCore(IConfigurationSection section) => throw null; + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/enum/fixed/src/Generated/String.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/enum/fixed/src/Generated/String.cs index 65c6edb1c24..056c892aa72 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/enum/fixed/src/Generated/String.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/enum/fixed/src/Generated/String.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Threading; @@ -13,6 +14,8 @@ public partial class String { protected String() => throw null; + internal String(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult GetKnownValue(RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/empty/src/Generated/EmptyClient.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/empty/src/Generated/EmptyClient.cs index 70d8023048c..00f7325cbd9 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/empty/src/Generated/EmptyClient.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/empty/src/Generated/EmptyClient.cs @@ -5,6 +5,7 @@ using System; using System.ClientModel; using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; using System.Threading; using System.Threading.Tasks; @@ -14,7 +15,12 @@ public partial class EmptyClient { public EmptyClient() : this(new Uri("http://localhost:3000"), new EmptyClientOptions()) => throw null; - public EmptyClient(Uri endpoint, EmptyClientOptions options) => throw null; + internal EmptyClient(AuthenticationPolicy authenticationPolicy, Uri endpoint, EmptyClientOptions options) => throw null; + + public EmptyClient(Uri endpoint, EmptyClientOptions options) : this(null, endpoint, options) => throw null; + + [Experimental("SCME0002")] + public EmptyClient(EmptyClientSettings settings) : this(AuthenticationPolicy.Create(settings), settings?.Endpoint, settings?.Options) => throw null; public ClientPipeline Pipeline => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/empty/src/Generated/EmptyClientOptions.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/empty/src/Generated/EmptyClientOptions.cs index 56e786c637d..624ba0c0143 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/empty/src/Generated/EmptyClientOptions.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/empty/src/Generated/EmptyClientOptions.cs @@ -3,10 +3,16 @@ #nullable disable using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; +using Microsoft.Extensions.Configuration; namespace _Type.Model.Empty { public partial class EmptyClientOptions : ClientPipelineOptions { + public EmptyClientOptions() => throw null; + + [Experimental("SCME0002")] + internal EmptyClientOptions(IConfigurationSection section) : base(section) => throw null; } } diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/empty/src/Generated/EmptyClientSettings.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/empty/src/Generated/EmptyClientSettings.cs new file mode 100644 index 00000000000..8635789555e --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/empty/src/Generated/EmptyClientSettings.cs @@ -0,0 +1,29 @@ +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; +using Microsoft.Extensions.Configuration; + +namespace _Type.Model.Empty +{ + [Experimental("SCME0002")] + public partial class EmptyClientSettings : ClientSettings + { + public Uri Endpoint + { + get => throw null; + set => throw null; + } + + public EmptyClientOptions Options + { + get => throw null; + set => throw null; + } + + protected override void BindCore(IConfigurationSection section) => throw null; + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/enum-discriminator/src/Generated/EnumDiscriminatorClient.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/enum-discriminator/src/Generated/EnumDiscriminatorClient.cs index 2eec9f2f047..ca37716df88 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/enum-discriminator/src/Generated/EnumDiscriminatorClient.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/enum-discriminator/src/Generated/EnumDiscriminatorClient.cs @@ -5,6 +5,7 @@ using System; using System.ClientModel; using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; using System.Threading; using System.Threading.Tasks; @@ -14,7 +15,12 @@ public partial class EnumDiscriminatorClient { public EnumDiscriminatorClient() : this(new Uri("http://localhost:3000"), new EnumDiscriminatorClientOptions()) => throw null; - public EnumDiscriminatorClient(Uri endpoint, EnumDiscriminatorClientOptions options) => throw null; + internal EnumDiscriminatorClient(AuthenticationPolicy authenticationPolicy, Uri endpoint, EnumDiscriminatorClientOptions options) => throw null; + + public EnumDiscriminatorClient(Uri endpoint, EnumDiscriminatorClientOptions options) : this(null, endpoint, options) => throw null; + + [Experimental("SCME0002")] + public EnumDiscriminatorClient(EnumDiscriminatorClientSettings settings) : this(AuthenticationPolicy.Create(settings), settings?.Endpoint, settings?.Options) => throw null; public ClientPipeline Pipeline => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/enum-discriminator/src/Generated/EnumDiscriminatorClientOptions.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/enum-discriminator/src/Generated/EnumDiscriminatorClientOptions.cs index fc64fcba766..3945cd829b8 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/enum-discriminator/src/Generated/EnumDiscriminatorClientOptions.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/enum-discriminator/src/Generated/EnumDiscriminatorClientOptions.cs @@ -3,10 +3,16 @@ #nullable disable using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; +using Microsoft.Extensions.Configuration; namespace _Type.Model.Inheritance.EnumDiscriminator { public partial class EnumDiscriminatorClientOptions : ClientPipelineOptions { + public EnumDiscriminatorClientOptions() => throw null; + + [Experimental("SCME0002")] + internal EnumDiscriminatorClientOptions(IConfigurationSection section) : base(section) => throw null; } } diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/enum-discriminator/src/Generated/EnumDiscriminatorClientSettings.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/enum-discriminator/src/Generated/EnumDiscriminatorClientSettings.cs new file mode 100644 index 00000000000..fd5914814bd --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/enum-discriminator/src/Generated/EnumDiscriminatorClientSettings.cs @@ -0,0 +1,29 @@ +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; +using Microsoft.Extensions.Configuration; + +namespace _Type.Model.Inheritance.EnumDiscriminator +{ + [Experimental("SCME0002")] + public partial class EnumDiscriminatorClientSettings : ClientSettings + { + public Uri Endpoint + { + get => throw null; + set => throw null; + } + + public EnumDiscriminatorClientOptions Options + { + get => throw null; + set => throw null; + } + + protected override void BindCore(IConfigurationSection section) => throw null; + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/nested-discriminator/src/Generated/NestedDiscriminatorClient.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/nested-discriminator/src/Generated/NestedDiscriminatorClient.cs index 677ad5ba4f3..7e5536731ab 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/nested-discriminator/src/Generated/NestedDiscriminatorClient.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/nested-discriminator/src/Generated/NestedDiscriminatorClient.cs @@ -5,6 +5,7 @@ using System; using System.ClientModel; using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; using System.Threading; using System.Threading.Tasks; @@ -14,7 +15,12 @@ public partial class NestedDiscriminatorClient { public NestedDiscriminatorClient() : this(new Uri("http://localhost:3000"), new NestedDiscriminatorClientOptions()) => throw null; - public NestedDiscriminatorClient(Uri endpoint, NestedDiscriminatorClientOptions options) => throw null; + internal NestedDiscriminatorClient(AuthenticationPolicy authenticationPolicy, Uri endpoint, NestedDiscriminatorClientOptions options) => throw null; + + public NestedDiscriminatorClient(Uri endpoint, NestedDiscriminatorClientOptions options) : this(null, endpoint, options) => throw null; + + [Experimental("SCME0002")] + public NestedDiscriminatorClient(NestedDiscriminatorClientSettings settings) : this(AuthenticationPolicy.Create(settings), settings?.Endpoint, settings?.Options) => throw null; public ClientPipeline Pipeline => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/nested-discriminator/src/Generated/NestedDiscriminatorClientOptions.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/nested-discriminator/src/Generated/NestedDiscriminatorClientOptions.cs index 000960d84d9..f6c8cb646ab 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/nested-discriminator/src/Generated/NestedDiscriminatorClientOptions.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/nested-discriminator/src/Generated/NestedDiscriminatorClientOptions.cs @@ -3,10 +3,16 @@ #nullable disable using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; +using Microsoft.Extensions.Configuration; namespace _Type.Model.Inheritance.NestedDiscriminator { public partial class NestedDiscriminatorClientOptions : ClientPipelineOptions { + public NestedDiscriminatorClientOptions() => throw null; + + [Experimental("SCME0002")] + internal NestedDiscriminatorClientOptions(IConfigurationSection section) : base(section) => throw null; } } diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/nested-discriminator/src/Generated/NestedDiscriminatorClientSettings.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/nested-discriminator/src/Generated/NestedDiscriminatorClientSettings.cs new file mode 100644 index 00000000000..ebb7fd9e0c8 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/nested-discriminator/src/Generated/NestedDiscriminatorClientSettings.cs @@ -0,0 +1,29 @@ +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; +using Microsoft.Extensions.Configuration; + +namespace _Type.Model.Inheritance.NestedDiscriminator +{ + [Experimental("SCME0002")] + public partial class NestedDiscriminatorClientSettings : ClientSettings + { + public Uri Endpoint + { + get => throw null; + set => throw null; + } + + public NestedDiscriminatorClientOptions Options + { + get => throw null; + set => throw null; + } + + protected override void BindCore(IConfigurationSection section) => throw null; + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/not-discriminated/src/Generated/NotDiscriminatedClient.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/not-discriminated/src/Generated/NotDiscriminatedClient.cs index e573655283f..4a7e240071e 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/not-discriminated/src/Generated/NotDiscriminatedClient.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/not-discriminated/src/Generated/NotDiscriminatedClient.cs @@ -5,6 +5,7 @@ using System; using System.ClientModel; using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; using System.Threading; using System.Threading.Tasks; @@ -14,7 +15,12 @@ public partial class NotDiscriminatedClient { public NotDiscriminatedClient() : this(new Uri("http://localhost:3000"), new NotDiscriminatedClientOptions()) => throw null; - public NotDiscriminatedClient(Uri endpoint, NotDiscriminatedClientOptions options) => throw null; + internal NotDiscriminatedClient(AuthenticationPolicy authenticationPolicy, Uri endpoint, NotDiscriminatedClientOptions options) => throw null; + + public NotDiscriminatedClient(Uri endpoint, NotDiscriminatedClientOptions options) : this(null, endpoint, options) => throw null; + + [Experimental("SCME0002")] + public NotDiscriminatedClient(NotDiscriminatedClientSettings settings) : this(AuthenticationPolicy.Create(settings), settings?.Endpoint, settings?.Options) => throw null; public ClientPipeline Pipeline => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/not-discriminated/src/Generated/NotDiscriminatedClientOptions.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/not-discriminated/src/Generated/NotDiscriminatedClientOptions.cs index c727712c1f8..7b39c39bee2 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/not-discriminated/src/Generated/NotDiscriminatedClientOptions.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/not-discriminated/src/Generated/NotDiscriminatedClientOptions.cs @@ -3,10 +3,16 @@ #nullable disable using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; +using Microsoft.Extensions.Configuration; namespace _Type.Model.Inheritance.NotDiscriminated { public partial class NotDiscriminatedClientOptions : ClientPipelineOptions { + public NotDiscriminatedClientOptions() => throw null; + + [Experimental("SCME0002")] + internal NotDiscriminatedClientOptions(IConfigurationSection section) : base(section) => throw null; } } diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/not-discriminated/src/Generated/NotDiscriminatedClientSettings.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/not-discriminated/src/Generated/NotDiscriminatedClientSettings.cs new file mode 100644 index 00000000000..eab881e66bc --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/not-discriminated/src/Generated/NotDiscriminatedClientSettings.cs @@ -0,0 +1,29 @@ +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; +using Microsoft.Extensions.Configuration; + +namespace _Type.Model.Inheritance.NotDiscriminated +{ + [Experimental("SCME0002")] + public partial class NotDiscriminatedClientSettings : ClientSettings + { + public Uri Endpoint + { + get => throw null; + set => throw null; + } + + public NotDiscriminatedClientOptions Options + { + get => throw null; + set => throw null; + } + + protected override void BindCore(IConfigurationSection section) => throw null; + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/recursive/src/Generated/RecursiveClient.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/recursive/src/Generated/RecursiveClient.cs index 50140c50d04..1f429a7f058 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/recursive/src/Generated/RecursiveClient.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/recursive/src/Generated/RecursiveClient.cs @@ -5,6 +5,7 @@ using System; using System.ClientModel; using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; using System.Threading; using System.Threading.Tasks; @@ -14,7 +15,12 @@ public partial class RecursiveClient { public RecursiveClient() : this(new Uri("http://localhost:3000"), new RecursiveClientOptions()) => throw null; - public RecursiveClient(Uri endpoint, RecursiveClientOptions options) => throw null; + internal RecursiveClient(AuthenticationPolicy authenticationPolicy, Uri endpoint, RecursiveClientOptions options) => throw null; + + public RecursiveClient(Uri endpoint, RecursiveClientOptions options) : this(null, endpoint, options) => throw null; + + [Experimental("SCME0002")] + public RecursiveClient(RecursiveClientSettings settings) : this(AuthenticationPolicy.Create(settings), settings?.Endpoint, settings?.Options) => throw null; public ClientPipeline Pipeline => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/recursive/src/Generated/RecursiveClientOptions.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/recursive/src/Generated/RecursiveClientOptions.cs index cf994ec31db..3d72ed64ff1 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/recursive/src/Generated/RecursiveClientOptions.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/recursive/src/Generated/RecursiveClientOptions.cs @@ -3,10 +3,16 @@ #nullable disable using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; +using Microsoft.Extensions.Configuration; namespace _Type.Model.Inheritance.Recursive { public partial class RecursiveClientOptions : ClientPipelineOptions { + public RecursiveClientOptions() => throw null; + + [Experimental("SCME0002")] + internal RecursiveClientOptions(IConfigurationSection section) : base(section) => throw null; } } diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/recursive/src/Generated/RecursiveClientSettings.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/recursive/src/Generated/RecursiveClientSettings.cs new file mode 100644 index 00000000000..deaa4e1f167 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/recursive/src/Generated/RecursiveClientSettings.cs @@ -0,0 +1,29 @@ +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; +using Microsoft.Extensions.Configuration; + +namespace _Type.Model.Inheritance.Recursive +{ + [Experimental("SCME0002")] + public partial class RecursiveClientSettings : ClientSettings + { + public Uri Endpoint + { + get => throw null; + set => throw null; + } + + public RecursiveClientOptions Options + { + get => throw null; + set => throw null; + } + + protected override void BindCore(IConfigurationSection section) => throw null; + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/single-discriminator/src/Generated/SingleDiscriminatorClient.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/single-discriminator/src/Generated/SingleDiscriminatorClient.cs index 261b93c7665..d6a1a0eb170 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/single-discriminator/src/Generated/SingleDiscriminatorClient.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/single-discriminator/src/Generated/SingleDiscriminatorClient.cs @@ -5,6 +5,7 @@ using System; using System.ClientModel; using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; using System.Threading; using System.Threading.Tasks; @@ -14,7 +15,12 @@ public partial class SingleDiscriminatorClient { public SingleDiscriminatorClient() : this(new Uri("http://localhost:3000"), new SingleDiscriminatorClientOptions()) => throw null; - public SingleDiscriminatorClient(Uri endpoint, SingleDiscriminatorClientOptions options) => throw null; + internal SingleDiscriminatorClient(AuthenticationPolicy authenticationPolicy, Uri endpoint, SingleDiscriminatorClientOptions options) => throw null; + + public SingleDiscriminatorClient(Uri endpoint, SingleDiscriminatorClientOptions options) : this(null, endpoint, options) => throw null; + + [Experimental("SCME0002")] + public SingleDiscriminatorClient(SingleDiscriminatorClientSettings settings) : this(AuthenticationPolicy.Create(settings), settings?.Endpoint, settings?.Options) => throw null; public ClientPipeline Pipeline => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/single-discriminator/src/Generated/SingleDiscriminatorClientOptions.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/single-discriminator/src/Generated/SingleDiscriminatorClientOptions.cs index ab3b42d7150..2b4f31e4023 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/single-discriminator/src/Generated/SingleDiscriminatorClientOptions.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/single-discriminator/src/Generated/SingleDiscriminatorClientOptions.cs @@ -3,10 +3,16 @@ #nullable disable using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; +using Microsoft.Extensions.Configuration; namespace _Type.Model.Inheritance.SingleDiscriminator { public partial class SingleDiscriminatorClientOptions : ClientPipelineOptions { + public SingleDiscriminatorClientOptions() => throw null; + + [Experimental("SCME0002")] + internal SingleDiscriminatorClientOptions(IConfigurationSection section) : base(section) => throw null; } } diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/single-discriminator/src/Generated/SingleDiscriminatorClientSettings.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/single-discriminator/src/Generated/SingleDiscriminatorClientSettings.cs new file mode 100644 index 00000000000..ab187bd8d92 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/single-discriminator/src/Generated/SingleDiscriminatorClientSettings.cs @@ -0,0 +1,29 @@ +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; +using Microsoft.Extensions.Configuration; + +namespace _Type.Model.Inheritance.SingleDiscriminator +{ + [Experimental("SCME0002")] + public partial class SingleDiscriminatorClientSettings : ClientSettings + { + public Uri Endpoint + { + get => throw null; + set => throw null; + } + + public SingleDiscriminatorClientOptions Options + { + get => throw null; + set => throw null; + } + + protected override void BindCore(IConfigurationSection section) => throw null; + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/usage/src/Generated/UsageClient.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/usage/src/Generated/UsageClient.cs index cd3f6b4c23d..b1571ae1df5 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/usage/src/Generated/UsageClient.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/usage/src/Generated/UsageClient.cs @@ -5,6 +5,7 @@ using System; using System.ClientModel; using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; using System.Threading; using System.Threading.Tasks; @@ -14,7 +15,12 @@ public partial class UsageClient { public UsageClient() : this(new Uri("http://localhost:3000"), new UsageClientOptions()) => throw null; - public UsageClient(Uri endpoint, UsageClientOptions options) => throw null; + internal UsageClient(AuthenticationPolicy authenticationPolicy, Uri endpoint, UsageClientOptions options) => throw null; + + public UsageClient(Uri endpoint, UsageClientOptions options) : this(null, endpoint, options) => throw null; + + [Experimental("SCME0002")] + public UsageClient(UsageClientSettings settings) : this(AuthenticationPolicy.Create(settings), settings?.Endpoint, settings?.Options) => throw null; public ClientPipeline Pipeline => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/usage/src/Generated/UsageClientOptions.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/usage/src/Generated/UsageClientOptions.cs index 307a5173a35..d5df51bba00 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/usage/src/Generated/UsageClientOptions.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/usage/src/Generated/UsageClientOptions.cs @@ -3,10 +3,16 @@ #nullable disable using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; +using Microsoft.Extensions.Configuration; namespace _Type.Model.Usage { public partial class UsageClientOptions : ClientPipelineOptions { + public UsageClientOptions() => throw null; + + [Experimental("SCME0002")] + internal UsageClientOptions(IConfigurationSection section) : base(section) => throw null; } } diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/usage/src/Generated/UsageClientSettings.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/usage/src/Generated/UsageClientSettings.cs new file mode 100644 index 00000000000..1d813163af2 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/usage/src/Generated/UsageClientSettings.cs @@ -0,0 +1,29 @@ +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; +using Microsoft.Extensions.Configuration; + +namespace _Type.Model.Usage +{ + [Experimental("SCME0002")] + public partial class UsageClientSettings : ClientSettings + { + public Uri Endpoint + { + get => throw null; + set => throw null; + } + + public UsageClientOptions Options + { + get => throw null; + set => throw null; + } + + protected override void BindCore(IConfigurationSection section) => throw null; + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/visibility/src/Generated/VisibilityClient.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/visibility/src/Generated/VisibilityClient.cs index 901d82e4098..dfb167036d6 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/visibility/src/Generated/VisibilityClient.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/visibility/src/Generated/VisibilityClient.cs @@ -5,6 +5,7 @@ using System; using System.ClientModel; using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; using System.Threading; using System.Threading.Tasks; @@ -14,7 +15,12 @@ public partial class VisibilityClient { public VisibilityClient() : this(new Uri("http://localhost:3000"), new VisibilityClientOptions()) => throw null; - public VisibilityClient(Uri endpoint, VisibilityClientOptions options) => throw null; + internal VisibilityClient(AuthenticationPolicy authenticationPolicy, Uri endpoint, VisibilityClientOptions options) => throw null; + + public VisibilityClient(Uri endpoint, VisibilityClientOptions options) : this(null, endpoint, options) => throw null; + + [Experimental("SCME0002")] + public VisibilityClient(VisibilityClientSettings settings) : this(AuthenticationPolicy.Create(settings), settings?.Endpoint, settings?.Options) => throw null; public ClientPipeline Pipeline => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/visibility/src/Generated/VisibilityClientOptions.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/visibility/src/Generated/VisibilityClientOptions.cs index a32153c9626..520f19501ba 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/visibility/src/Generated/VisibilityClientOptions.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/visibility/src/Generated/VisibilityClientOptions.cs @@ -3,10 +3,16 @@ #nullable disable using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; +using Microsoft.Extensions.Configuration; namespace _Type.Model.Visibility { public partial class VisibilityClientOptions : ClientPipelineOptions { + public VisibilityClientOptions() => throw null; + + [Experimental("SCME0002")] + internal VisibilityClientOptions(IConfigurationSection section) : base(section) => throw null; } } diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/visibility/src/Generated/VisibilityClientSettings.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/visibility/src/Generated/VisibilityClientSettings.cs new file mode 100644 index 00000000000..75f60f4f199 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/visibility/src/Generated/VisibilityClientSettings.cs @@ -0,0 +1,29 @@ +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; +using Microsoft.Extensions.Configuration; + +namespace _Type.Model.Visibility +{ + [Experimental("SCME0002")] + public partial class VisibilityClientSettings : ClientSettings + { + public Uri Endpoint + { + get => throw null; + set => throw null; + } + + public VisibilityClientOptions Options + { + get => throw null; + set => throw null; + } + + protected override void BindCore(IConfigurationSection section) => throw null; + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/additional-properties/src/Generated/AdditionalPropertiesClient.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/additional-properties/src/Generated/AdditionalPropertiesClient.cs index 86b144da674..237007e44d6 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/additional-properties/src/Generated/AdditionalPropertiesClient.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/additional-properties/src/Generated/AdditionalPropertiesClient.cs @@ -4,6 +4,7 @@ using System; using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; namespace _Type.Property.AdditionalProperties { @@ -11,7 +12,12 @@ public partial class AdditionalPropertiesClient { public AdditionalPropertiesClient() : this(new Uri("http://localhost:3000"), new AdditionalPropertiesClientOptions()) => throw null; - public AdditionalPropertiesClient(Uri endpoint, AdditionalPropertiesClientOptions options) => throw null; + internal AdditionalPropertiesClient(AuthenticationPolicy authenticationPolicy, Uri endpoint, AdditionalPropertiesClientOptions options) => throw null; + + public AdditionalPropertiesClient(Uri endpoint, AdditionalPropertiesClientOptions options) : this(null, endpoint, options) => throw null; + + [Experimental("SCME0002")] + public AdditionalPropertiesClient(AdditionalPropertiesClientSettings settings) : this(AuthenticationPolicy.Create(settings), settings?.Endpoint, settings?.Options) => throw null; public ClientPipeline Pipeline => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/additional-properties/src/Generated/AdditionalPropertiesClientOptions.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/additional-properties/src/Generated/AdditionalPropertiesClientOptions.cs index 131277df71b..6564b4c3c8b 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/additional-properties/src/Generated/AdditionalPropertiesClientOptions.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/additional-properties/src/Generated/AdditionalPropertiesClientOptions.cs @@ -3,10 +3,16 @@ #nullable disable using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; +using Microsoft.Extensions.Configuration; namespace _Type.Property.AdditionalProperties { public partial class AdditionalPropertiesClientOptions : ClientPipelineOptions { + public AdditionalPropertiesClientOptions() => throw null; + + [Experimental("SCME0002")] + internal AdditionalPropertiesClientOptions(IConfigurationSection section) : base(section) => throw null; } } diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/additional-properties/src/Generated/AdditionalPropertiesClientSettings.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/additional-properties/src/Generated/AdditionalPropertiesClientSettings.cs new file mode 100644 index 00000000000..2ecc0cb99b0 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/additional-properties/src/Generated/AdditionalPropertiesClientSettings.cs @@ -0,0 +1,29 @@ +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; +using Microsoft.Extensions.Configuration; + +namespace _Type.Property.AdditionalProperties +{ + [Experimental("SCME0002")] + public partial class AdditionalPropertiesClientSettings : ClientSettings + { + public Uri Endpoint + { + get => throw null; + set => throw null; + } + + public AdditionalPropertiesClientOptions Options + { + get => throw null; + set => throw null; + } + + protected override void BindCore(IConfigurationSection section) => throw null; + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/additional-properties/src/Generated/ExtendsDifferentSpreadFloat.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/additional-properties/src/Generated/ExtendsDifferentSpreadFloat.cs index 3711caec903..aa298158cb9 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/additional-properties/src/Generated/ExtendsDifferentSpreadFloat.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/additional-properties/src/Generated/ExtendsDifferentSpreadFloat.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Threading; @@ -13,6 +14,8 @@ public partial class ExtendsDifferentSpreadFloat { protected ExtendsDifferentSpreadFloat() => throw null; + internal ExtendsDifferentSpreadFloat(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult Get(RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/additional-properties/src/Generated/ExtendsDifferentSpreadModel.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/additional-properties/src/Generated/ExtendsDifferentSpreadModel.cs index 16952422f03..eaf913f4276 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/additional-properties/src/Generated/ExtendsDifferentSpreadModel.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/additional-properties/src/Generated/ExtendsDifferentSpreadModel.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Threading; @@ -13,6 +14,8 @@ public partial class ExtendsDifferentSpreadModel { protected ExtendsDifferentSpreadModel() => throw null; + internal ExtendsDifferentSpreadModel(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult Get(RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/additional-properties/src/Generated/ExtendsDifferentSpreadModelArray.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/additional-properties/src/Generated/ExtendsDifferentSpreadModelArray.cs index cafdfaa177b..2aacfeb2d02 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/additional-properties/src/Generated/ExtendsDifferentSpreadModelArray.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/additional-properties/src/Generated/ExtendsDifferentSpreadModelArray.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Threading; @@ -13,6 +14,8 @@ public partial class ExtendsDifferentSpreadModelArray { protected ExtendsDifferentSpreadModelArray() => throw null; + internal ExtendsDifferentSpreadModelArray(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult Get(RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/additional-properties/src/Generated/ExtendsDifferentSpreadString.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/additional-properties/src/Generated/ExtendsDifferentSpreadString.cs index 14de43be0c4..3ee0ddc45c5 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/additional-properties/src/Generated/ExtendsDifferentSpreadString.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/additional-properties/src/Generated/ExtendsDifferentSpreadString.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Threading; @@ -13,6 +14,8 @@ public partial class ExtendsDifferentSpreadString { protected ExtendsDifferentSpreadString() => throw null; + internal ExtendsDifferentSpreadString(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult Get(RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/additional-properties/src/Generated/ExtendsFloat.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/additional-properties/src/Generated/ExtendsFloat.cs index db8c90aa883..6f55bee1976 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/additional-properties/src/Generated/ExtendsFloat.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/additional-properties/src/Generated/ExtendsFloat.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Threading; @@ -13,6 +14,8 @@ public partial class ExtendsFloat { protected ExtendsFloat() => throw null; + internal ExtendsFloat(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult Get(RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/additional-properties/src/Generated/ExtendsModel.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/additional-properties/src/Generated/ExtendsModel.cs index fc3605496dc..a3e6a49c40f 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/additional-properties/src/Generated/ExtendsModel.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/additional-properties/src/Generated/ExtendsModel.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Threading; @@ -13,6 +14,8 @@ public partial class ExtendsModel { protected ExtendsModel() => throw null; + internal ExtendsModel(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult Get(RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/additional-properties/src/Generated/ExtendsModelArray.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/additional-properties/src/Generated/ExtendsModelArray.cs index 9fac072dc49..1da8aae31d1 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/additional-properties/src/Generated/ExtendsModelArray.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/additional-properties/src/Generated/ExtendsModelArray.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Threading; @@ -13,6 +14,8 @@ public partial class ExtendsModelArray { protected ExtendsModelArray() => throw null; + internal ExtendsModelArray(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult Get(RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/additional-properties/src/Generated/ExtendsString.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/additional-properties/src/Generated/ExtendsString.cs index 25a8bce5e84..13a5fbf8c13 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/additional-properties/src/Generated/ExtendsString.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/additional-properties/src/Generated/ExtendsString.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Threading; @@ -13,6 +14,8 @@ public partial class ExtendsString { protected ExtendsString() => throw null; + internal ExtendsString(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult Get(RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/additional-properties/src/Generated/ExtendsUnknown.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/additional-properties/src/Generated/ExtendsUnknown.cs index 3beb5baea3f..6e539221d9b 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/additional-properties/src/Generated/ExtendsUnknown.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/additional-properties/src/Generated/ExtendsUnknown.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Threading; @@ -13,6 +14,8 @@ public partial class ExtendsUnknown { protected ExtendsUnknown() => throw null; + internal ExtendsUnknown(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult Get(RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/additional-properties/src/Generated/ExtendsUnknownDerived.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/additional-properties/src/Generated/ExtendsUnknownDerived.cs index 1ba9e2819a5..f1636a68905 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/additional-properties/src/Generated/ExtendsUnknownDerived.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/additional-properties/src/Generated/ExtendsUnknownDerived.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Threading; @@ -13,6 +14,8 @@ public partial class ExtendsUnknownDerived { protected ExtendsUnknownDerived() => throw null; + internal ExtendsUnknownDerived(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult Get(RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/additional-properties/src/Generated/ExtendsUnknownDiscriminated.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/additional-properties/src/Generated/ExtendsUnknownDiscriminated.cs index dddd20125ee..261d9de0a04 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/additional-properties/src/Generated/ExtendsUnknownDiscriminated.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/additional-properties/src/Generated/ExtendsUnknownDiscriminated.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Threading; @@ -13,6 +14,8 @@ public partial class ExtendsUnknownDiscriminated { protected ExtendsUnknownDiscriminated() => throw null; + internal ExtendsUnknownDiscriminated(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult Get(RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/additional-properties/src/Generated/IsFloat.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/additional-properties/src/Generated/IsFloat.cs index 74284e4cd58..8be79e2ef26 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/additional-properties/src/Generated/IsFloat.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/additional-properties/src/Generated/IsFloat.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Threading; @@ -13,6 +14,8 @@ public partial class IsFloat { protected IsFloat() => throw null; + internal IsFloat(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult Get(RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/additional-properties/src/Generated/IsModel.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/additional-properties/src/Generated/IsModel.cs index 035ee852f98..65a3fa72022 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/additional-properties/src/Generated/IsModel.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/additional-properties/src/Generated/IsModel.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Threading; @@ -13,6 +14,8 @@ public partial class IsModel { protected IsModel() => throw null; + internal IsModel(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult Get(RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/additional-properties/src/Generated/IsModelArray.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/additional-properties/src/Generated/IsModelArray.cs index cb2785116e5..a4a639ee799 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/additional-properties/src/Generated/IsModelArray.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/additional-properties/src/Generated/IsModelArray.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Threading; @@ -13,6 +14,8 @@ public partial class IsModelArray { protected IsModelArray() => throw null; + internal IsModelArray(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult Get(RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/additional-properties/src/Generated/IsString.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/additional-properties/src/Generated/IsString.cs index 6281cebe5bc..10718fca333 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/additional-properties/src/Generated/IsString.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/additional-properties/src/Generated/IsString.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Threading; @@ -13,6 +14,8 @@ public partial class IsString { protected IsString() => throw null; + internal IsString(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult Get(RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/additional-properties/src/Generated/IsUnknown.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/additional-properties/src/Generated/IsUnknown.cs index 756f70c38ba..19c46424094 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/additional-properties/src/Generated/IsUnknown.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/additional-properties/src/Generated/IsUnknown.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Threading; @@ -13,6 +14,8 @@ public partial class IsUnknown { protected IsUnknown() => throw null; + internal IsUnknown(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult Get(RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/additional-properties/src/Generated/IsUnknownDerived.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/additional-properties/src/Generated/IsUnknownDerived.cs index c60981109bc..50e217613ef 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/additional-properties/src/Generated/IsUnknownDerived.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/additional-properties/src/Generated/IsUnknownDerived.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Threading; @@ -13,6 +14,8 @@ public partial class IsUnknownDerived { protected IsUnknownDerived() => throw null; + internal IsUnknownDerived(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult Get(RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/additional-properties/src/Generated/IsUnknownDiscriminated.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/additional-properties/src/Generated/IsUnknownDiscriminated.cs index 3686c8c898c..f6470550016 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/additional-properties/src/Generated/IsUnknownDiscriminated.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/additional-properties/src/Generated/IsUnknownDiscriminated.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Threading; @@ -13,6 +14,8 @@ public partial class IsUnknownDiscriminated { protected IsUnknownDiscriminated() => throw null; + internal IsUnknownDiscriminated(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult Get(RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/additional-properties/src/Generated/MultipleSpread.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/additional-properties/src/Generated/MultipleSpread.cs index 9b081a1a362..47355266fd2 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/additional-properties/src/Generated/MultipleSpread.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/additional-properties/src/Generated/MultipleSpread.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Threading; @@ -13,6 +14,8 @@ public partial class MultipleSpread { protected MultipleSpread() => throw null; + internal MultipleSpread(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult Get(RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/additional-properties/src/Generated/SpreadDifferentFloat.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/additional-properties/src/Generated/SpreadDifferentFloat.cs index f86ae0c3e6e..33d2e052e33 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/additional-properties/src/Generated/SpreadDifferentFloat.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/additional-properties/src/Generated/SpreadDifferentFloat.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Threading; @@ -13,6 +14,8 @@ public partial class SpreadDifferentFloat { protected SpreadDifferentFloat() => throw null; + internal SpreadDifferentFloat(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult Get(RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/additional-properties/src/Generated/SpreadDifferentModel.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/additional-properties/src/Generated/SpreadDifferentModel.cs index 0ba5c6d4854..a69132c7526 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/additional-properties/src/Generated/SpreadDifferentModel.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/additional-properties/src/Generated/SpreadDifferentModel.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Threading; @@ -13,6 +14,8 @@ public partial class SpreadDifferentModel { protected SpreadDifferentModel() => throw null; + internal SpreadDifferentModel(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult Get(RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/additional-properties/src/Generated/SpreadDifferentModelArray.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/additional-properties/src/Generated/SpreadDifferentModelArray.cs index 0d1cd493e84..5c6d809aa7c 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/additional-properties/src/Generated/SpreadDifferentModelArray.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/additional-properties/src/Generated/SpreadDifferentModelArray.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Threading; @@ -13,6 +14,8 @@ public partial class SpreadDifferentModelArray { protected SpreadDifferentModelArray() => throw null; + internal SpreadDifferentModelArray(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult Get(RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/additional-properties/src/Generated/SpreadDifferentString.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/additional-properties/src/Generated/SpreadDifferentString.cs index d990d8ba2c3..4123898a1ec 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/additional-properties/src/Generated/SpreadDifferentString.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/additional-properties/src/Generated/SpreadDifferentString.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Threading; @@ -13,6 +14,8 @@ public partial class SpreadDifferentString { protected SpreadDifferentString() => throw null; + internal SpreadDifferentString(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult Get(RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/additional-properties/src/Generated/SpreadFloat.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/additional-properties/src/Generated/SpreadFloat.cs index a97ea7ff831..a529e2b406f 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/additional-properties/src/Generated/SpreadFloat.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/additional-properties/src/Generated/SpreadFloat.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Threading; @@ -13,6 +14,8 @@ public partial class SpreadFloat { protected SpreadFloat() => throw null; + internal SpreadFloat(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult Get(RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/additional-properties/src/Generated/SpreadModel.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/additional-properties/src/Generated/SpreadModel.cs index 3db2515a716..002a15917bc 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/additional-properties/src/Generated/SpreadModel.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/additional-properties/src/Generated/SpreadModel.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Threading; @@ -13,6 +14,8 @@ public partial class SpreadModel { protected SpreadModel() => throw null; + internal SpreadModel(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult Get(RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/additional-properties/src/Generated/SpreadModelArray.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/additional-properties/src/Generated/SpreadModelArray.cs index aec0c659e11..bdc347b9941 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/additional-properties/src/Generated/SpreadModelArray.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/additional-properties/src/Generated/SpreadModelArray.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Threading; @@ -13,6 +14,8 @@ public partial class SpreadModelArray { protected SpreadModelArray() => throw null; + internal SpreadModelArray(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult Get(RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/additional-properties/src/Generated/SpreadRecordNonDiscriminatedUnion.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/additional-properties/src/Generated/SpreadRecordNonDiscriminatedUnion.cs index 89de049334c..dfd6786a0ab 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/additional-properties/src/Generated/SpreadRecordNonDiscriminatedUnion.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/additional-properties/src/Generated/SpreadRecordNonDiscriminatedUnion.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Threading; @@ -13,6 +14,8 @@ public partial class SpreadRecordNonDiscriminatedUnion { protected SpreadRecordNonDiscriminatedUnion() => throw null; + internal SpreadRecordNonDiscriminatedUnion(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult Get(RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/additional-properties/src/Generated/SpreadRecordNonDiscriminatedUnion2.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/additional-properties/src/Generated/SpreadRecordNonDiscriminatedUnion2.cs index e78b2929cd9..d33e1a547dc 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/additional-properties/src/Generated/SpreadRecordNonDiscriminatedUnion2.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/additional-properties/src/Generated/SpreadRecordNonDiscriminatedUnion2.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Threading; @@ -13,6 +14,8 @@ public partial class SpreadRecordNonDiscriminatedUnion2 { protected SpreadRecordNonDiscriminatedUnion2() => throw null; + internal SpreadRecordNonDiscriminatedUnion2(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult Get(RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/additional-properties/src/Generated/SpreadRecordNonDiscriminatedUnion3.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/additional-properties/src/Generated/SpreadRecordNonDiscriminatedUnion3.cs index ecb9285fa4e..76b3cf8b1fe 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/additional-properties/src/Generated/SpreadRecordNonDiscriminatedUnion3.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/additional-properties/src/Generated/SpreadRecordNonDiscriminatedUnion3.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Threading; @@ -13,6 +14,8 @@ public partial class SpreadRecordNonDiscriminatedUnion3 { protected SpreadRecordNonDiscriminatedUnion3() => throw null; + internal SpreadRecordNonDiscriminatedUnion3(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult Get(RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/additional-properties/src/Generated/SpreadRecordUnion.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/additional-properties/src/Generated/SpreadRecordUnion.cs index 7cc11db7439..97de92c85f4 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/additional-properties/src/Generated/SpreadRecordUnion.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/additional-properties/src/Generated/SpreadRecordUnion.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Threading; @@ -13,6 +14,8 @@ public partial class SpreadRecordUnion { protected SpreadRecordUnion() => throw null; + internal SpreadRecordUnion(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult Get(RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/additional-properties/src/Generated/SpreadString.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/additional-properties/src/Generated/SpreadString.cs index 2c4d33288de..4864d532e5a 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/additional-properties/src/Generated/SpreadString.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/additional-properties/src/Generated/SpreadString.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Threading; @@ -13,6 +14,8 @@ public partial class SpreadString { protected SpreadString() => throw null; + internal SpreadString(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult Get(RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/nullable/src/Generated/Bytes.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/nullable/src/Generated/Bytes.cs index eacf8814b15..4e6ff0b6f10 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/nullable/src/Generated/Bytes.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/nullable/src/Generated/Bytes.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Threading; @@ -13,6 +14,8 @@ public partial class Bytes { protected Bytes() => throw null; + internal Bytes(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult GetNonNull(RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/nullable/src/Generated/CollectionsByte.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/nullable/src/Generated/CollectionsByte.cs index ad2cd996943..147ed22adef 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/nullable/src/Generated/CollectionsByte.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/nullable/src/Generated/CollectionsByte.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Threading; @@ -13,6 +14,8 @@ public partial class CollectionsByte { protected CollectionsByte() => throw null; + internal CollectionsByte(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult GetNonNull(RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/nullable/src/Generated/CollectionsModel.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/nullable/src/Generated/CollectionsModel.cs index a424dcc6309..a2cb3752dd3 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/nullable/src/Generated/CollectionsModel.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/nullable/src/Generated/CollectionsModel.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Threading; @@ -13,6 +14,8 @@ public partial class CollectionsModel { protected CollectionsModel() => throw null; + internal CollectionsModel(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult GetNonNull(RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/nullable/src/Generated/CollectionsString.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/nullable/src/Generated/CollectionsString.cs index 3481b5221d5..9ebdb4ed447 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/nullable/src/Generated/CollectionsString.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/nullable/src/Generated/CollectionsString.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Threading; @@ -13,6 +14,8 @@ public partial class CollectionsString { protected CollectionsString() => throw null; + internal CollectionsString(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult GetNonNull(RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/nullable/src/Generated/Datetime.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/nullable/src/Generated/Datetime.cs index 2d316f989b4..65fd66ab449 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/nullable/src/Generated/Datetime.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/nullable/src/Generated/Datetime.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Threading; @@ -13,6 +14,8 @@ public partial class Datetime { protected Datetime() => throw null; + internal Datetime(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult GetNonNull(RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/nullable/src/Generated/Duration.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/nullable/src/Generated/Duration.cs index 5436a4fda27..d1091acfe3d 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/nullable/src/Generated/Duration.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/nullable/src/Generated/Duration.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Threading; @@ -13,6 +14,8 @@ public partial class Duration { protected Duration() => throw null; + internal Duration(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult GetNonNull(RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/nullable/src/Generated/NullableClient.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/nullable/src/Generated/NullableClient.cs index 96329118412..af9921af400 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/nullable/src/Generated/NullableClient.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/nullable/src/Generated/NullableClient.cs @@ -4,6 +4,7 @@ using System; using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; namespace _Type.Property.Nullable { @@ -11,7 +12,12 @@ public partial class NullableClient { public NullableClient() : this(new Uri("http://localhost:3000"), new NullableClientOptions()) => throw null; - public NullableClient(Uri endpoint, NullableClientOptions options) => throw null; + internal NullableClient(AuthenticationPolicy authenticationPolicy, Uri endpoint, NullableClientOptions options) => throw null; + + public NullableClient(Uri endpoint, NullableClientOptions options) : this(null, endpoint, options) => throw null; + + [Experimental("SCME0002")] + public NullableClient(NullableClientSettings settings) : this(AuthenticationPolicy.Create(settings), settings?.Endpoint, settings?.Options) => throw null; public ClientPipeline Pipeline => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/nullable/src/Generated/NullableClientOptions.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/nullable/src/Generated/NullableClientOptions.cs index d4939dbbb1f..4e33d510c38 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/nullable/src/Generated/NullableClientOptions.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/nullable/src/Generated/NullableClientOptions.cs @@ -3,10 +3,16 @@ #nullable disable using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; +using Microsoft.Extensions.Configuration; namespace _Type.Property.Nullable { public partial class NullableClientOptions : ClientPipelineOptions { + public NullableClientOptions() => throw null; + + [Experimental("SCME0002")] + internal NullableClientOptions(IConfigurationSection section) : base(section) => throw null; } } diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/nullable/src/Generated/NullableClientSettings.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/nullable/src/Generated/NullableClientSettings.cs new file mode 100644 index 00000000000..738504eba24 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/nullable/src/Generated/NullableClientSettings.cs @@ -0,0 +1,29 @@ +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; +using Microsoft.Extensions.Configuration; + +namespace _Type.Property.Nullable +{ + [Experimental("SCME0002")] + public partial class NullableClientSettings : ClientSettings + { + public Uri Endpoint + { + get => throw null; + set => throw null; + } + + public NullableClientOptions Options + { + get => throw null; + set => throw null; + } + + protected override void BindCore(IConfigurationSection section) => throw null; + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/nullable/src/Generated/String.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/nullable/src/Generated/String.cs index 461ad9d615b..786c381fb0b 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/nullable/src/Generated/String.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/nullable/src/Generated/String.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Threading; @@ -13,6 +14,8 @@ public partial class String { protected String() => throw null; + internal String(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult GetNonNull(RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/optionality/src/Generated/BooleanLiteral.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/optionality/src/Generated/BooleanLiteral.cs index 593e92d4244..6dca0711f46 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/optionality/src/Generated/BooleanLiteral.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/optionality/src/Generated/BooleanLiteral.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Threading; @@ -13,6 +14,8 @@ public partial class BooleanLiteral { protected BooleanLiteral() => throw null; + internal BooleanLiteral(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult GetAll(RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/optionality/src/Generated/Bytes.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/optionality/src/Generated/Bytes.cs index b4d7e3788e8..44c535cc253 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/optionality/src/Generated/Bytes.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/optionality/src/Generated/Bytes.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Threading; @@ -13,6 +14,8 @@ public partial class Bytes { protected Bytes() => throw null; + internal Bytes(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult GetAll(RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/optionality/src/Generated/CollectionsByte.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/optionality/src/Generated/CollectionsByte.cs index 706f6515fc5..808a6ca8b49 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/optionality/src/Generated/CollectionsByte.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/optionality/src/Generated/CollectionsByte.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Threading; @@ -13,6 +14,8 @@ public partial class CollectionsByte { protected CollectionsByte() => throw null; + internal CollectionsByte(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult GetAll(RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/optionality/src/Generated/CollectionsModel.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/optionality/src/Generated/CollectionsModel.cs index dfe28feac96..00be1dcec43 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/optionality/src/Generated/CollectionsModel.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/optionality/src/Generated/CollectionsModel.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Threading; @@ -13,6 +14,8 @@ public partial class CollectionsModel { protected CollectionsModel() => throw null; + internal CollectionsModel(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult GetAll(RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/optionality/src/Generated/Datetime.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/optionality/src/Generated/Datetime.cs index 5e578c2da19..3b2e4f0017b 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/optionality/src/Generated/Datetime.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/optionality/src/Generated/Datetime.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Threading; @@ -13,6 +14,8 @@ public partial class Datetime { protected Datetime() => throw null; + internal Datetime(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult GetAll(RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/optionality/src/Generated/Duration.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/optionality/src/Generated/Duration.cs index 03d2758ff8a..9a9c63ae762 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/optionality/src/Generated/Duration.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/optionality/src/Generated/Duration.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Threading; @@ -13,6 +14,8 @@ public partial class Duration { protected Duration() => throw null; + internal Duration(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult GetAll(RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/optionality/src/Generated/FloatLiteral.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/optionality/src/Generated/FloatLiteral.cs index 7d71a102cd8..f7504a61cf2 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/optionality/src/Generated/FloatLiteral.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/optionality/src/Generated/FloatLiteral.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Threading; @@ -13,6 +14,8 @@ public partial class FloatLiteral { protected FloatLiteral() => throw null; + internal FloatLiteral(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult GetAll(RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/optionality/src/Generated/IntLiteral.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/optionality/src/Generated/IntLiteral.cs index 5f5db298391..3309e35bfe2 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/optionality/src/Generated/IntLiteral.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/optionality/src/Generated/IntLiteral.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Threading; @@ -13,6 +14,8 @@ public partial class IntLiteral { protected IntLiteral() => throw null; + internal IntLiteral(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult GetAll(RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/optionality/src/Generated/OptionalClient.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/optionality/src/Generated/OptionalClient.cs index 6f67bdc1b3a..359640c4a3f 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/optionality/src/Generated/OptionalClient.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/optionality/src/Generated/OptionalClient.cs @@ -4,6 +4,7 @@ using System; using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; namespace _Type.Property.Optional { @@ -11,7 +12,12 @@ public partial class OptionalClient { public OptionalClient() : this(new Uri("http://localhost:3000"), new OptionalClientOptions()) => throw null; - public OptionalClient(Uri endpoint, OptionalClientOptions options) => throw null; + internal OptionalClient(AuthenticationPolicy authenticationPolicy, Uri endpoint, OptionalClientOptions options) => throw null; + + public OptionalClient(Uri endpoint, OptionalClientOptions options) : this(null, endpoint, options) => throw null; + + [Experimental("SCME0002")] + public OptionalClient(OptionalClientSettings settings) : this(AuthenticationPolicy.Create(settings), settings?.Endpoint, settings?.Options) => throw null; public ClientPipeline Pipeline => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/optionality/src/Generated/OptionalClientOptions.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/optionality/src/Generated/OptionalClientOptions.cs index a9ffaadfe8f..822e91c77df 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/optionality/src/Generated/OptionalClientOptions.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/optionality/src/Generated/OptionalClientOptions.cs @@ -3,10 +3,16 @@ #nullable disable using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; +using Microsoft.Extensions.Configuration; namespace _Type.Property.Optional { public partial class OptionalClientOptions : ClientPipelineOptions { + public OptionalClientOptions() => throw null; + + [Experimental("SCME0002")] + internal OptionalClientOptions(IConfigurationSection section) : base(section) => throw null; } } diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/optionality/src/Generated/OptionalClientSettings.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/optionality/src/Generated/OptionalClientSettings.cs new file mode 100644 index 00000000000..b6de9fdd7d6 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/optionality/src/Generated/OptionalClientSettings.cs @@ -0,0 +1,29 @@ +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; +using Microsoft.Extensions.Configuration; + +namespace _Type.Property.Optional +{ + [Experimental("SCME0002")] + public partial class OptionalClientSettings : ClientSettings + { + public Uri Endpoint + { + get => throw null; + set => throw null; + } + + public OptionalClientOptions Options + { + get => throw null; + set => throw null; + } + + protected override void BindCore(IConfigurationSection section) => throw null; + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/optionality/src/Generated/PlainDate.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/optionality/src/Generated/PlainDate.cs index 27c9d8c861b..f95ec369404 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/optionality/src/Generated/PlainDate.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/optionality/src/Generated/PlainDate.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Threading; @@ -13,6 +14,8 @@ public partial class PlainDate { protected PlainDate() => throw null; + internal PlainDate(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult GetAll(RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/optionality/src/Generated/PlainTime.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/optionality/src/Generated/PlainTime.cs index 733f618e280..91c30419caf 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/optionality/src/Generated/PlainTime.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/optionality/src/Generated/PlainTime.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Threading; @@ -13,6 +14,8 @@ public partial class PlainTime { protected PlainTime() => throw null; + internal PlainTime(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult GetAll(RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/optionality/src/Generated/RequiredAndOptional.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/optionality/src/Generated/RequiredAndOptional.cs index 94bf40cd0f3..3253e5b109d 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/optionality/src/Generated/RequiredAndOptional.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/optionality/src/Generated/RequiredAndOptional.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Threading; @@ -13,6 +14,8 @@ public partial class RequiredAndOptional { protected RequiredAndOptional() => throw null; + internal RequiredAndOptional(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult GetAll(RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/optionality/src/Generated/String.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/optionality/src/Generated/String.cs index 223187bfb1e..def30985883 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/optionality/src/Generated/String.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/optionality/src/Generated/String.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Threading; @@ -13,6 +14,8 @@ public partial class String { protected String() => throw null; + internal String(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult GetAll(RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/optionality/src/Generated/StringLiteral.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/optionality/src/Generated/StringLiteral.cs index d6fca1040c1..a60ba46a07e 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/optionality/src/Generated/StringLiteral.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/optionality/src/Generated/StringLiteral.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Threading; @@ -13,6 +14,8 @@ public partial class StringLiteral { protected StringLiteral() => throw null; + internal StringLiteral(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult GetAll(RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/optionality/src/Generated/UnionFloatLiteral.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/optionality/src/Generated/UnionFloatLiteral.cs index aa088f014e9..9471446beff 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/optionality/src/Generated/UnionFloatLiteral.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/optionality/src/Generated/UnionFloatLiteral.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Threading; @@ -13,6 +14,8 @@ public partial class UnionFloatLiteral { protected UnionFloatLiteral() => throw null; + internal UnionFloatLiteral(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult GetAll(RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/optionality/src/Generated/UnionIntLiteral.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/optionality/src/Generated/UnionIntLiteral.cs index 65a65dc54ce..45324fc4c4d 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/optionality/src/Generated/UnionIntLiteral.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/optionality/src/Generated/UnionIntLiteral.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Threading; @@ -13,6 +14,8 @@ public partial class UnionIntLiteral { protected UnionIntLiteral() => throw null; + internal UnionIntLiteral(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult GetAll(RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/optionality/src/Generated/UnionStringLiteral.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/optionality/src/Generated/UnionStringLiteral.cs index 1041ae1cf99..4a44db8c460 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/optionality/src/Generated/UnionStringLiteral.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/optionality/src/Generated/UnionStringLiteral.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Threading; @@ -13,6 +14,8 @@ public partial class UnionStringLiteral { protected UnionStringLiteral() => throw null; + internal UnionStringLiteral(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult GetAll(RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/value-types/src/Generated/Boolean.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/value-types/src/Generated/Boolean.cs index 3f6b9d2df7c..f4e93d97aa5 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/value-types/src/Generated/Boolean.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/value-types/src/Generated/Boolean.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Threading; @@ -13,6 +14,8 @@ public partial class Boolean { protected Boolean() => throw null; + internal Boolean(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult Get(RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/value-types/src/Generated/BooleanLiteral.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/value-types/src/Generated/BooleanLiteral.cs index 679f7a738e3..e2bdc72c983 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/value-types/src/Generated/BooleanLiteral.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/value-types/src/Generated/BooleanLiteral.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Threading; @@ -13,6 +14,8 @@ public partial class BooleanLiteral { protected BooleanLiteral() => throw null; + internal BooleanLiteral(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult Get(RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/value-types/src/Generated/Bytes.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/value-types/src/Generated/Bytes.cs index b0a807a9c6d..428e3397974 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/value-types/src/Generated/Bytes.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/value-types/src/Generated/Bytes.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Threading; @@ -13,6 +14,8 @@ public partial class Bytes { protected Bytes() => throw null; + internal Bytes(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult Get(RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/value-types/src/Generated/CollectionsInt.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/value-types/src/Generated/CollectionsInt.cs index 3e6cc227cf5..f49bb79df44 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/value-types/src/Generated/CollectionsInt.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/value-types/src/Generated/CollectionsInt.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Threading; @@ -13,6 +14,8 @@ public partial class CollectionsInt { protected CollectionsInt() => throw null; + internal CollectionsInt(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult Get(RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/value-types/src/Generated/CollectionsModel.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/value-types/src/Generated/CollectionsModel.cs index 2a9ffb958a8..e40359c230c 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/value-types/src/Generated/CollectionsModel.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/value-types/src/Generated/CollectionsModel.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Threading; @@ -13,6 +14,8 @@ public partial class CollectionsModel { protected CollectionsModel() => throw null; + internal CollectionsModel(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult Get(RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/value-types/src/Generated/CollectionsString.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/value-types/src/Generated/CollectionsString.cs index c1dd5d23c45..18a7083e450 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/value-types/src/Generated/CollectionsString.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/value-types/src/Generated/CollectionsString.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Threading; @@ -13,6 +14,8 @@ public partial class CollectionsString { protected CollectionsString() => throw null; + internal CollectionsString(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult Get(RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/value-types/src/Generated/Datetime.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/value-types/src/Generated/Datetime.cs index b8f6983712b..9b6385a11da 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/value-types/src/Generated/Datetime.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/value-types/src/Generated/Datetime.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Threading; @@ -13,6 +14,8 @@ public partial class Datetime { protected Datetime() => throw null; + internal Datetime(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult Get(RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/value-types/src/Generated/Decimal.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/value-types/src/Generated/Decimal.cs index cfc5fa3fc48..90ac68ab77b 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/value-types/src/Generated/Decimal.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/value-types/src/Generated/Decimal.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Threading; @@ -13,6 +14,8 @@ public partial class Decimal { protected Decimal() => throw null; + internal Decimal(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult Get(RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/value-types/src/Generated/Decimal128.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/value-types/src/Generated/Decimal128.cs index 553501b9bdd..06b87e33722 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/value-types/src/Generated/Decimal128.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/value-types/src/Generated/Decimal128.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Threading; @@ -13,6 +14,8 @@ public partial class Decimal128 { protected Decimal128() => throw null; + internal Decimal128(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult Get(RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/value-types/src/Generated/DictionaryString.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/value-types/src/Generated/DictionaryString.cs index 0da288b589b..d1d5dc8e06e 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/value-types/src/Generated/DictionaryString.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/value-types/src/Generated/DictionaryString.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Threading; @@ -13,6 +14,8 @@ public partial class DictionaryString { protected DictionaryString() => throw null; + internal DictionaryString(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult Get(RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/value-types/src/Generated/Duration.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/value-types/src/Generated/Duration.cs index fb81d1ff2de..304ea7ce05e 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/value-types/src/Generated/Duration.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/value-types/src/Generated/Duration.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Threading; @@ -13,6 +14,8 @@ public partial class Duration { protected Duration() => throw null; + internal Duration(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult Get(RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/value-types/src/Generated/Enum.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/value-types/src/Generated/Enum.cs index 082585a6b1b..6ee002b6a38 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/value-types/src/Generated/Enum.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/value-types/src/Generated/Enum.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Threading; @@ -13,6 +14,8 @@ public partial class Enum { protected Enum() => throw null; + internal Enum(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult Get(RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/value-types/src/Generated/ExtensibleEnum.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/value-types/src/Generated/ExtensibleEnum.cs index 1d39d6232b2..05e0b19b4c5 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/value-types/src/Generated/ExtensibleEnum.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/value-types/src/Generated/ExtensibleEnum.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Threading; @@ -13,6 +14,8 @@ public partial class ExtensibleEnum { protected ExtensibleEnum() => throw null; + internal ExtensibleEnum(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult Get(RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/value-types/src/Generated/Float.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/value-types/src/Generated/Float.cs index 89917bd0d67..31ca39d2378 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/value-types/src/Generated/Float.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/value-types/src/Generated/Float.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Threading; @@ -13,6 +14,8 @@ public partial class Float { protected Float() => throw null; + internal Float(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult Get(RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/value-types/src/Generated/FloatLiteral.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/value-types/src/Generated/FloatLiteral.cs index 89f86508d9d..272147c3f79 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/value-types/src/Generated/FloatLiteral.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/value-types/src/Generated/FloatLiteral.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Threading; @@ -13,6 +14,8 @@ public partial class FloatLiteral { protected FloatLiteral() => throw null; + internal FloatLiteral(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult Get(RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/value-types/src/Generated/Int.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/value-types/src/Generated/Int.cs index e4e359014ea..42d5cab9109 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/value-types/src/Generated/Int.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/value-types/src/Generated/Int.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Threading; @@ -13,6 +14,8 @@ public partial class Int { protected Int() => throw null; + internal Int(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult Get(RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/value-types/src/Generated/IntLiteral.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/value-types/src/Generated/IntLiteral.cs index 75851545805..1504957189f 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/value-types/src/Generated/IntLiteral.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/value-types/src/Generated/IntLiteral.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Threading; @@ -13,6 +14,8 @@ public partial class IntLiteral { protected IntLiteral() => throw null; + internal IntLiteral(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult Get(RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/value-types/src/Generated/Model.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/value-types/src/Generated/Model.cs index 83467e85608..1c306e46d07 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/value-types/src/Generated/Model.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/value-types/src/Generated/Model.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Threading; @@ -13,6 +14,8 @@ public partial class Model { protected Model() => throw null; + internal Model(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult Get(RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/value-types/src/Generated/Never.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/value-types/src/Generated/Never.cs index 92ff671d14a..8e08e0fa31e 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/value-types/src/Generated/Never.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/value-types/src/Generated/Never.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Threading; @@ -13,6 +14,8 @@ public partial class Never { protected Never() => throw null; + internal Never(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult Get(RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/value-types/src/Generated/String.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/value-types/src/Generated/String.cs index 750373bbcfc..c49f8856b95 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/value-types/src/Generated/String.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/value-types/src/Generated/String.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Threading; @@ -13,6 +14,8 @@ public partial class String { protected String() => throw null; + internal String(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult Get(RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/value-types/src/Generated/StringLiteral.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/value-types/src/Generated/StringLiteral.cs index d02b76d3dd6..4e4108e032f 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/value-types/src/Generated/StringLiteral.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/value-types/src/Generated/StringLiteral.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Threading; @@ -13,6 +14,8 @@ public partial class StringLiteral { protected StringLiteral() => throw null; + internal StringLiteral(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult Get(RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/value-types/src/Generated/UnionEnumValue.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/value-types/src/Generated/UnionEnumValue.cs index 69962b5cd3f..bc5592782ce 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/value-types/src/Generated/UnionEnumValue.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/value-types/src/Generated/UnionEnumValue.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Threading; @@ -13,6 +14,8 @@ public partial class UnionEnumValue { protected UnionEnumValue() => throw null; + internal UnionEnumValue(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult Get(RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/value-types/src/Generated/UnionFloatLiteral.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/value-types/src/Generated/UnionFloatLiteral.cs index 620ccef7d9d..b722ec14e86 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/value-types/src/Generated/UnionFloatLiteral.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/value-types/src/Generated/UnionFloatLiteral.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Threading; @@ -13,6 +14,8 @@ public partial class UnionFloatLiteral { protected UnionFloatLiteral() => throw null; + internal UnionFloatLiteral(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult Get(RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/value-types/src/Generated/UnionIntLiteral.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/value-types/src/Generated/UnionIntLiteral.cs index 64b2d1651f8..32e42a85f40 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/value-types/src/Generated/UnionIntLiteral.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/value-types/src/Generated/UnionIntLiteral.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Threading; @@ -13,6 +14,8 @@ public partial class UnionIntLiteral { protected UnionIntLiteral() => throw null; + internal UnionIntLiteral(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult Get(RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/value-types/src/Generated/UnionStringLiteral.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/value-types/src/Generated/UnionStringLiteral.cs index 8dbaa7dec43..fde1c748c4d 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/value-types/src/Generated/UnionStringLiteral.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/value-types/src/Generated/UnionStringLiteral.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Threading; @@ -13,6 +14,8 @@ public partial class UnionStringLiteral { protected UnionStringLiteral() => throw null; + internal UnionStringLiteral(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult Get(RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/value-types/src/Generated/UnknownArray.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/value-types/src/Generated/UnknownArray.cs index b8e85f2c700..f40c76b820a 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/value-types/src/Generated/UnknownArray.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/value-types/src/Generated/UnknownArray.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Threading; @@ -13,6 +14,8 @@ public partial class UnknownArray { protected UnknownArray() => throw null; + internal UnknownArray(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult Get(RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/value-types/src/Generated/UnknownDict.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/value-types/src/Generated/UnknownDict.cs index 6c050d94eff..81fdff22645 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/value-types/src/Generated/UnknownDict.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/value-types/src/Generated/UnknownDict.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Threading; @@ -13,6 +14,8 @@ public partial class UnknownDict { protected UnknownDict() => throw null; + internal UnknownDict(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult Get(RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/value-types/src/Generated/UnknownInt.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/value-types/src/Generated/UnknownInt.cs index 222c28277e7..fb2f59c1cc5 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/value-types/src/Generated/UnknownInt.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/value-types/src/Generated/UnknownInt.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Threading; @@ -13,6 +14,8 @@ public partial class UnknownInt { protected UnknownInt() => throw null; + internal UnknownInt(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult Get(RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/value-types/src/Generated/UnknownString.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/value-types/src/Generated/UnknownString.cs index 2af9c5e7276..bb587ae7036 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/value-types/src/Generated/UnknownString.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/value-types/src/Generated/UnknownString.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Threading; @@ -13,6 +14,8 @@ public partial class UnknownString { protected UnknownString() => throw null; + internal UnknownString(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult Get(RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/value-types/src/Generated/ValueTypesClient.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/value-types/src/Generated/ValueTypesClient.cs index 2d928c3bb26..f0d9d59fb35 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/value-types/src/Generated/ValueTypesClient.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/value-types/src/Generated/ValueTypesClient.cs @@ -4,6 +4,7 @@ using System; using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; namespace _Type.Property.ValueTypes { @@ -11,7 +12,12 @@ public partial class ValueTypesClient { public ValueTypesClient() : this(new Uri("http://localhost:3000"), new ValueTypesClientOptions()) => throw null; - public ValueTypesClient(Uri endpoint, ValueTypesClientOptions options) => throw null; + internal ValueTypesClient(AuthenticationPolicy authenticationPolicy, Uri endpoint, ValueTypesClientOptions options) => throw null; + + public ValueTypesClient(Uri endpoint, ValueTypesClientOptions options) : this(null, endpoint, options) => throw null; + + [Experimental("SCME0002")] + public ValueTypesClient(ValueTypesClientSettings settings) : this(AuthenticationPolicy.Create(settings), settings?.Endpoint, settings?.Options) => throw null; public ClientPipeline Pipeline => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/value-types/src/Generated/ValueTypesClientOptions.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/value-types/src/Generated/ValueTypesClientOptions.cs index ecfa4e24e2a..2a908e1bd20 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/value-types/src/Generated/ValueTypesClientOptions.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/value-types/src/Generated/ValueTypesClientOptions.cs @@ -3,10 +3,16 @@ #nullable disable using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; +using Microsoft.Extensions.Configuration; namespace _Type.Property.ValueTypes { public partial class ValueTypesClientOptions : ClientPipelineOptions { + public ValueTypesClientOptions() => throw null; + + [Experimental("SCME0002")] + internal ValueTypesClientOptions(IConfigurationSection section) : base(section) => throw null; } } diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/value-types/src/Generated/ValueTypesClientSettings.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/value-types/src/Generated/ValueTypesClientSettings.cs new file mode 100644 index 00000000000..804ef7bdb0c --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/value-types/src/Generated/ValueTypesClientSettings.cs @@ -0,0 +1,29 @@ +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; +using Microsoft.Extensions.Configuration; + +namespace _Type.Property.ValueTypes +{ + [Experimental("SCME0002")] + public partial class ValueTypesClientSettings : ClientSettings + { + public Uri Endpoint + { + get => throw null; + set => throw null; + } + + public ValueTypesClientOptions Options + { + get => throw null; + set => throw null; + } + + protected override void BindCore(IConfigurationSection section) => throw null; + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/scalar/src/Generated/Boolean.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/scalar/src/Generated/Boolean.cs index 12a173aba7d..f3a074a4c57 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/scalar/src/Generated/Boolean.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/scalar/src/Generated/Boolean.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Threading; @@ -13,6 +14,8 @@ public partial class Boolean { protected Boolean() => throw null; + internal Boolean(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult Get(RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/scalar/src/Generated/Decimal128Type.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/scalar/src/Generated/Decimal128Type.cs index 941ee7e41dc..6e3566ea66a 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/scalar/src/Generated/Decimal128Type.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/scalar/src/Generated/Decimal128Type.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Threading; @@ -13,6 +14,8 @@ public partial class Decimal128Type { protected Decimal128Type() => throw null; + internal Decimal128Type(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult ResponseBody(RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/scalar/src/Generated/Decimal128Verify.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/scalar/src/Generated/Decimal128Verify.cs index 01200f453d3..11e138c5ac3 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/scalar/src/Generated/Decimal128Verify.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/scalar/src/Generated/Decimal128Verify.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Collections.Generic; @@ -14,6 +15,8 @@ public partial class Decimal128Verify { protected Decimal128Verify() => throw null; + internal Decimal128Verify(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult PrepareVerify(RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/scalar/src/Generated/DecimalType.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/scalar/src/Generated/DecimalType.cs index 281338de6ca..c225451e654 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/scalar/src/Generated/DecimalType.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/scalar/src/Generated/DecimalType.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Threading; @@ -13,6 +14,8 @@ public partial class DecimalType { protected DecimalType() => throw null; + internal DecimalType(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult ResponseBody(RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/scalar/src/Generated/DecimalVerify.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/scalar/src/Generated/DecimalVerify.cs index 3c38a946f65..6b00b6964ac 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/scalar/src/Generated/DecimalVerify.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/scalar/src/Generated/DecimalVerify.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Collections.Generic; @@ -14,6 +15,8 @@ public partial class DecimalVerify { protected DecimalVerify() => throw null; + internal DecimalVerify(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult PrepareVerify(RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/scalar/src/Generated/ScalarClient.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/scalar/src/Generated/ScalarClient.cs index 7a2ab78771c..c446fb20afc 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/scalar/src/Generated/ScalarClient.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/scalar/src/Generated/ScalarClient.cs @@ -4,6 +4,7 @@ using System; using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; namespace _Type.Scalar { @@ -11,7 +12,12 @@ public partial class ScalarClient { public ScalarClient() : this(new Uri("http://localhost:3000"), new ScalarClientOptions()) => throw null; - public ScalarClient(Uri endpoint, ScalarClientOptions options) => throw null; + internal ScalarClient(AuthenticationPolicy authenticationPolicy, Uri endpoint, ScalarClientOptions options) => throw null; + + public ScalarClient(Uri endpoint, ScalarClientOptions options) : this(null, endpoint, options) => throw null; + + [Experimental("SCME0002")] + public ScalarClient(ScalarClientSettings settings) : this(AuthenticationPolicy.Create(settings), settings?.Endpoint, settings?.Options) => throw null; public ClientPipeline Pipeline => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/scalar/src/Generated/ScalarClientOptions.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/scalar/src/Generated/ScalarClientOptions.cs index 315778f0dfa..16a42e8a09c 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/scalar/src/Generated/ScalarClientOptions.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/scalar/src/Generated/ScalarClientOptions.cs @@ -3,10 +3,16 @@ #nullable disable using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; +using Microsoft.Extensions.Configuration; namespace _Type.Scalar { public partial class ScalarClientOptions : ClientPipelineOptions { + public ScalarClientOptions() => throw null; + + [Experimental("SCME0002")] + internal ScalarClientOptions(IConfigurationSection section) : base(section) => throw null; } } diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/scalar/src/Generated/ScalarClientSettings.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/scalar/src/Generated/ScalarClientSettings.cs new file mode 100644 index 00000000000..c16448023ec --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/scalar/src/Generated/ScalarClientSettings.cs @@ -0,0 +1,29 @@ +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; +using Microsoft.Extensions.Configuration; + +namespace _Type.Scalar +{ + [Experimental("SCME0002")] + public partial class ScalarClientSettings : ClientSettings + { + public Uri Endpoint + { + get => throw null; + set => throw null; + } + + public ScalarClientOptions Options + { + get => throw null; + set => throw null; + } + + protected override void BindCore(IConfigurationSection section) => throw null; + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/scalar/src/Generated/String.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/scalar/src/Generated/String.cs index b1b7388d369..e58e6a99949 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/scalar/src/Generated/String.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/scalar/src/Generated/String.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Threading; @@ -13,6 +14,8 @@ public partial class String { protected String() => throw null; + internal String(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult Get(RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/scalar/src/Generated/Unknown.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/scalar/src/Generated/Unknown.cs index 39e08fd7025..ad255b77e27 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/scalar/src/Generated/Unknown.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/scalar/src/Generated/Unknown.cs @@ -14,6 +14,8 @@ public partial class Unknown { protected Unknown() => throw null; + internal Unknown(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult Get(RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/union/src/Generated/EnumsOnly.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/union/src/Generated/EnumsOnly.cs index 5ea24aef091..326e87184ee 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/union/src/Generated/EnumsOnly.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/union/src/Generated/EnumsOnly.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Threading; @@ -13,6 +14,8 @@ public partial class EnumsOnly { protected EnumsOnly() => throw null; + internal EnumsOnly(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult Get(RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/union/src/Generated/FloatsOnly.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/union/src/Generated/FloatsOnly.cs index 6165e15eb36..687ca26b9d4 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/union/src/Generated/FloatsOnly.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/union/src/Generated/FloatsOnly.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Threading; @@ -13,6 +14,8 @@ public partial class FloatsOnly { protected FloatsOnly() => throw null; + internal FloatsOnly(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult Get(RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/union/src/Generated/IntsOnly.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/union/src/Generated/IntsOnly.cs index abb9c25fba4..d9e64843d11 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/union/src/Generated/IntsOnly.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/union/src/Generated/IntsOnly.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Threading; @@ -13,6 +14,8 @@ public partial class IntsOnly { protected IntsOnly() => throw null; + internal IntsOnly(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult Get(RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/union/src/Generated/MixedLiterals.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/union/src/Generated/MixedLiterals.cs index dc60eb0f3ab..7ee7a6ee49c 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/union/src/Generated/MixedLiterals.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/union/src/Generated/MixedLiterals.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Threading; @@ -13,6 +14,8 @@ public partial class MixedLiterals { protected MixedLiterals() => throw null; + internal MixedLiterals(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult Get(RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/union/src/Generated/MixedTypes.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/union/src/Generated/MixedTypes.cs index 72608045240..b7ae1cff2e4 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/union/src/Generated/MixedTypes.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/union/src/Generated/MixedTypes.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Threading; @@ -13,6 +14,8 @@ public partial class MixedTypes { protected MixedTypes() => throw null; + internal MixedTypes(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult Get(RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/union/src/Generated/ModelsOnly.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/union/src/Generated/ModelsOnly.cs index 9d638303f32..ebb37812dc0 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/union/src/Generated/ModelsOnly.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/union/src/Generated/ModelsOnly.cs @@ -14,6 +14,8 @@ public partial class ModelsOnly { protected ModelsOnly() => throw null; + internal ModelsOnly(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult Get(RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/union/src/Generated/StringAndArray.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/union/src/Generated/StringAndArray.cs index 914985be3eb..0a470dd358d 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/union/src/Generated/StringAndArray.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/union/src/Generated/StringAndArray.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Threading; @@ -13,6 +14,8 @@ public partial class StringAndArray { protected StringAndArray() => throw null; + internal StringAndArray(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult Get(RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/union/src/Generated/StringExtensible.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/union/src/Generated/StringExtensible.cs index 04035a679a9..c6d886ad068 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/union/src/Generated/StringExtensible.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/union/src/Generated/StringExtensible.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Threading; @@ -13,6 +14,8 @@ public partial class StringExtensible { protected StringExtensible() => throw null; + internal StringExtensible(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult Get(RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/union/src/Generated/StringExtensibleNamed.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/union/src/Generated/StringExtensibleNamed.cs index e4299a80a88..85a4d399263 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/union/src/Generated/StringExtensibleNamed.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/union/src/Generated/StringExtensibleNamed.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Threading; @@ -13,6 +14,8 @@ public partial class StringExtensibleNamed { protected StringExtensibleNamed() => throw null; + internal StringExtensibleNamed(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult Get(RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/union/src/Generated/StringsOnly.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/union/src/Generated/StringsOnly.cs index e94cb73e42f..fb8ec122f24 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/union/src/Generated/StringsOnly.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/union/src/Generated/StringsOnly.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Threading; @@ -13,6 +14,8 @@ public partial class StringsOnly { protected StringsOnly() => throw null; + internal StringsOnly(ClientPipeline pipeline, Uri endpoint) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult Get(RequestOptions options) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/union/src/Generated/UnionClient.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/union/src/Generated/UnionClient.cs index d8169c7677e..48df18bf7cc 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/union/src/Generated/UnionClient.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/union/src/Generated/UnionClient.cs @@ -4,6 +4,7 @@ using System; using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; namespace _Type.Union { @@ -11,7 +12,12 @@ public partial class UnionClient { public UnionClient() : this(new Uri("http://localhost:3000"), new UnionClientOptions()) => throw null; - public UnionClient(Uri endpoint, UnionClientOptions options) => throw null; + internal UnionClient(AuthenticationPolicy authenticationPolicy, Uri endpoint, UnionClientOptions options) => throw null; + + public UnionClient(Uri endpoint, UnionClientOptions options) : this(null, endpoint, options) => throw null; + + [Experimental("SCME0002")] + public UnionClient(UnionClientSettings settings) : this(AuthenticationPolicy.Create(settings), settings?.Endpoint, settings?.Options) => throw null; public ClientPipeline Pipeline => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/union/src/Generated/UnionClientOptions.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/union/src/Generated/UnionClientOptions.cs index e5f6e387e74..9352bd0c9c3 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/union/src/Generated/UnionClientOptions.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/union/src/Generated/UnionClientOptions.cs @@ -3,10 +3,16 @@ #nullable disable using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; +using Microsoft.Extensions.Configuration; namespace _Type.Union { public partial class UnionClientOptions : ClientPipelineOptions { + public UnionClientOptions() => throw null; + + [Experimental("SCME0002")] + internal UnionClientOptions(IConfigurationSection section) : base(section) => throw null; } } diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/type/union/src/Generated/UnionClientSettings.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/union/src/Generated/UnionClientSettings.cs new file mode 100644 index 00000000000..71defed8463 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/type/union/src/Generated/UnionClientSettings.cs @@ -0,0 +1,29 @@ +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; +using Microsoft.Extensions.Configuration; + +namespace _Type.Union +{ + [Experimental("SCME0002")] + public partial class UnionClientSettings : ClientSettings + { + public Uri Endpoint + { + get => throw null; + set => throw null; + } + + public UnionClientOptions Options + { + get => throw null; + set => throw null; + } + + protected override void BindCore(IConfigurationSection section) => throw null; + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/added/v1/src/Generated/AddedClient.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/added/v1/src/Generated/AddedClient.cs index 4f240a760b1..d3cfcb5aa70 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/added/v1/src/Generated/AddedClient.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/added/v1/src/Generated/AddedClient.cs @@ -5,6 +5,7 @@ using System; using System.ClientModel; using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; using System.Threading; using System.Threading.Tasks; @@ -16,7 +17,12 @@ public partial class AddedClient public AddedClient(Uri endpoint) : this(endpoint, new AddedClientOptions()) => throw null; - public AddedClient(Uri endpoint, AddedClientOptions options) => throw null; + internal AddedClient(AuthenticationPolicy authenticationPolicy, Uri endpoint, AddedClientOptions options) => throw null; + + public AddedClient(Uri endpoint, AddedClientOptions options) : this(null, endpoint, options) => throw null; + + [Experimental("SCME0002")] + public AddedClient(AddedClientSettings settings) : this(AuthenticationPolicy.Create(settings), settings?.Endpoint, settings?.Options) => throw null; public ClientPipeline Pipeline => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/added/v1/src/Generated/AddedClientOptions.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/added/v1/src/Generated/AddedClientOptions.cs index 773ddd6c34e..b7fbe47ed89 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/added/v1/src/Generated/AddedClientOptions.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/added/v1/src/Generated/AddedClientOptions.cs @@ -3,6 +3,8 @@ #nullable disable using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; +using Microsoft.Extensions.Configuration; namespace Versioning.Added { @@ -12,6 +14,9 @@ public partial class AddedClientOptions : ClientPipelineOptions public AddedClientOptions(ServiceVersion version = LatestVersion) => throw null; + [Experimental("SCME0002")] + internal AddedClientOptions(IConfigurationSection section) : base(section) => throw null; + public enum ServiceVersion { /// The version v1. diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/added/v1/src/Generated/AddedClientSettings.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/added/v1/src/Generated/AddedClientSettings.cs new file mode 100644 index 00000000000..de45b556cb9 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/added/v1/src/Generated/AddedClientSettings.cs @@ -0,0 +1,29 @@ +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; +using Microsoft.Extensions.Configuration; + +namespace Versioning.Added +{ + [Experimental("SCME0002")] + public partial class AddedClientSettings : ClientSettings + { + public Uri Endpoint + { + get => throw null; + set => throw null; + } + + public AddedClientOptions Options + { + get => throw null; + set => throw null; + } + + protected override void BindCore(IConfigurationSection section) => throw null; + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/added/v2/src/Generated/AddedClient.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/added/v2/src/Generated/AddedClient.cs index 15c9f8e666d..6f27070b32e 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/added/v2/src/Generated/AddedClient.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/added/v2/src/Generated/AddedClient.cs @@ -5,6 +5,7 @@ using System; using System.ClientModel; using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; using System.Threading; using System.Threading.Tasks; @@ -16,7 +17,12 @@ public partial class AddedClient public AddedClient(Uri endpoint) : this(endpoint, new AddedClientOptions()) => throw null; - public AddedClient(Uri endpoint, AddedClientOptions options) => throw null; + internal AddedClient(AuthenticationPolicy authenticationPolicy, Uri endpoint, AddedClientOptions options) => throw null; + + public AddedClient(Uri endpoint, AddedClientOptions options) : this(null, endpoint, options) => throw null; + + [Experimental("SCME0002")] + public AddedClient(AddedClientSettings settings) : this(AuthenticationPolicy.Create(settings), settings?.Endpoint, settings?.Options) => throw null; public ClientPipeline Pipeline => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/added/v2/src/Generated/AddedClientOptions.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/added/v2/src/Generated/AddedClientOptions.cs index e2f29f0a557..9719d90a137 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/added/v2/src/Generated/AddedClientOptions.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/added/v2/src/Generated/AddedClientOptions.cs @@ -3,6 +3,8 @@ #nullable disable using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; +using Microsoft.Extensions.Configuration; namespace Versioning.Added { @@ -12,6 +14,9 @@ public partial class AddedClientOptions : ClientPipelineOptions public AddedClientOptions(ServiceVersion version = LatestVersion) => throw null; + [Experimental("SCME0002")] + internal AddedClientOptions(IConfigurationSection section) : base(section) => throw null; + public enum ServiceVersion { /// The version v1. diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/added/v2/src/Generated/AddedClientSettings.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/added/v2/src/Generated/AddedClientSettings.cs new file mode 100644 index 00000000000..de45b556cb9 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/added/v2/src/Generated/AddedClientSettings.cs @@ -0,0 +1,29 @@ +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; +using Microsoft.Extensions.Configuration; + +namespace Versioning.Added +{ + [Experimental("SCME0002")] + public partial class AddedClientSettings : ClientSettings + { + public Uri Endpoint + { + get => throw null; + set => throw null; + } + + public AddedClientOptions Options + { + get => throw null; + set => throw null; + } + + protected override void BindCore(IConfigurationSection section) => throw null; + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/added/v2/src/Generated/InterfaceV2.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/added/v2/src/Generated/InterfaceV2.cs index cef6e78f45d..09e38898e24 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/added/v2/src/Generated/InterfaceV2.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/added/v2/src/Generated/InterfaceV2.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Threading; @@ -13,6 +14,8 @@ public partial class InterfaceV2 { protected InterfaceV2() => throw null; + internal InterfaceV2(ClientPipeline pipeline, Uri endpoint, string version) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult V2InInterface(BinaryContent content, RequestOptions options = null) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/madeOptional/v1/src/Generated/MadeOptionalClient.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/madeOptional/v1/src/Generated/MadeOptionalClient.cs index 8594bc90f75..d78e1fe494b 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/madeOptional/v1/src/Generated/MadeOptionalClient.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/madeOptional/v1/src/Generated/MadeOptionalClient.cs @@ -5,6 +5,7 @@ using System; using System.ClientModel; using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; using System.Threading; using System.Threading.Tasks; @@ -16,7 +17,12 @@ public partial class MadeOptionalClient public MadeOptionalClient(Uri endpoint) : this(endpoint, new MadeOptionalClientOptions()) => throw null; - public MadeOptionalClient(Uri endpoint, MadeOptionalClientOptions options) => throw null; + internal MadeOptionalClient(AuthenticationPolicy authenticationPolicy, Uri endpoint, MadeOptionalClientOptions options) => throw null; + + public MadeOptionalClient(Uri endpoint, MadeOptionalClientOptions options) : this(null, endpoint, options) => throw null; + + [Experimental("SCME0002")] + public MadeOptionalClient(MadeOptionalClientSettings settings) : this(AuthenticationPolicy.Create(settings), settings?.Endpoint, settings?.Options) => throw null; public ClientPipeline Pipeline => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/madeOptional/v1/src/Generated/MadeOptionalClientOptions.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/madeOptional/v1/src/Generated/MadeOptionalClientOptions.cs index 3eefb1ff588..d26fc936f07 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/madeOptional/v1/src/Generated/MadeOptionalClientOptions.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/madeOptional/v1/src/Generated/MadeOptionalClientOptions.cs @@ -3,6 +3,8 @@ #nullable disable using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; +using Microsoft.Extensions.Configuration; namespace Versioning.MadeOptional { @@ -12,6 +14,9 @@ public partial class MadeOptionalClientOptions : ClientPipelineOptions public MadeOptionalClientOptions(ServiceVersion version = LatestVersion) => throw null; + [Experimental("SCME0002")] + internal MadeOptionalClientOptions(IConfigurationSection section) : base(section) => throw null; + public enum ServiceVersion { /// The version v1. diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/madeOptional/v1/src/Generated/MadeOptionalClientSettings.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/madeOptional/v1/src/Generated/MadeOptionalClientSettings.cs new file mode 100644 index 00000000000..4773765707d --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/madeOptional/v1/src/Generated/MadeOptionalClientSettings.cs @@ -0,0 +1,29 @@ +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; +using Microsoft.Extensions.Configuration; + +namespace Versioning.MadeOptional +{ + [Experimental("SCME0002")] + public partial class MadeOptionalClientSettings : ClientSettings + { + public Uri Endpoint + { + get => throw null; + set => throw null; + } + + public MadeOptionalClientOptions Options + { + get => throw null; + set => throw null; + } + + protected override void BindCore(IConfigurationSection section) => throw null; + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/madeOptional/v2/src/Generated/MadeOptionalClient.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/madeOptional/v2/src/Generated/MadeOptionalClient.cs index a78a2f47210..a7c5df86c22 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/madeOptional/v2/src/Generated/MadeOptionalClient.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/madeOptional/v2/src/Generated/MadeOptionalClient.cs @@ -5,6 +5,7 @@ using System; using System.ClientModel; using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; using System.Threading; using System.Threading.Tasks; @@ -16,7 +17,12 @@ public partial class MadeOptionalClient public MadeOptionalClient(Uri endpoint) : this(endpoint, new MadeOptionalClientOptions()) => throw null; - public MadeOptionalClient(Uri endpoint, MadeOptionalClientOptions options) => throw null; + internal MadeOptionalClient(AuthenticationPolicy authenticationPolicy, Uri endpoint, MadeOptionalClientOptions options) => throw null; + + public MadeOptionalClient(Uri endpoint, MadeOptionalClientOptions options) : this(null, endpoint, options) => throw null; + + [Experimental("SCME0002")] + public MadeOptionalClient(MadeOptionalClientSettings settings) : this(AuthenticationPolicy.Create(settings), settings?.Endpoint, settings?.Options) => throw null; public ClientPipeline Pipeline => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/madeOptional/v2/src/Generated/MadeOptionalClientOptions.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/madeOptional/v2/src/Generated/MadeOptionalClientOptions.cs index f328701bf0d..61493a2cdce 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/madeOptional/v2/src/Generated/MadeOptionalClientOptions.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/madeOptional/v2/src/Generated/MadeOptionalClientOptions.cs @@ -3,6 +3,8 @@ #nullable disable using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; +using Microsoft.Extensions.Configuration; namespace Versioning.MadeOptional { @@ -12,6 +14,9 @@ public partial class MadeOptionalClientOptions : ClientPipelineOptions public MadeOptionalClientOptions(ServiceVersion version = LatestVersion) => throw null; + [Experimental("SCME0002")] + internal MadeOptionalClientOptions(IConfigurationSection section) : base(section) => throw null; + public enum ServiceVersion { /// The version v1. diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/madeOptional/v2/src/Generated/MadeOptionalClientSettings.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/madeOptional/v2/src/Generated/MadeOptionalClientSettings.cs new file mode 100644 index 00000000000..4773765707d --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/madeOptional/v2/src/Generated/MadeOptionalClientSettings.cs @@ -0,0 +1,29 @@ +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; +using Microsoft.Extensions.Configuration; + +namespace Versioning.MadeOptional +{ + [Experimental("SCME0002")] + public partial class MadeOptionalClientSettings : ClientSettings + { + public Uri Endpoint + { + get => throw null; + set => throw null; + } + + public MadeOptionalClientOptions Options + { + get => throw null; + set => throw null; + } + + protected override void BindCore(IConfigurationSection section) => throw null; + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/removed/v1/src/Generated/InterfaceV1.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/removed/v1/src/Generated/InterfaceV1.cs index d3656e7c8d6..65f7690e6d9 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/removed/v1/src/Generated/InterfaceV1.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/removed/v1/src/Generated/InterfaceV1.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Threading; @@ -13,6 +14,8 @@ public partial class InterfaceV1 { protected InterfaceV1() => throw null; + internal InterfaceV1(ClientPipeline pipeline, Uri endpoint, string version) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult V1InInterface(BinaryContent content, RequestOptions options = null) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/removed/v1/src/Generated/RemovedClient.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/removed/v1/src/Generated/RemovedClient.cs index 9d7b39f1c89..3dfd35529a9 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/removed/v1/src/Generated/RemovedClient.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/removed/v1/src/Generated/RemovedClient.cs @@ -5,6 +5,7 @@ using System; using System.ClientModel; using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; using System.Threading; using System.Threading.Tasks; @@ -16,7 +17,12 @@ public partial class RemovedClient public RemovedClient(Uri endpoint) : this(endpoint, new RemovedClientOptions()) => throw null; - public RemovedClient(Uri endpoint, RemovedClientOptions options) => throw null; + internal RemovedClient(AuthenticationPolicy authenticationPolicy, Uri endpoint, RemovedClientOptions options) => throw null; + + public RemovedClient(Uri endpoint, RemovedClientOptions options) : this(null, endpoint, options) => throw null; + + [Experimental("SCME0002")] + public RemovedClient(RemovedClientSettings settings) : this(AuthenticationPolicy.Create(settings), settings?.Endpoint, settings?.Options) => throw null; public ClientPipeline Pipeline => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/removed/v1/src/Generated/RemovedClientOptions.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/removed/v1/src/Generated/RemovedClientOptions.cs index 6389ac97d10..e72954e373d 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/removed/v1/src/Generated/RemovedClientOptions.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/removed/v1/src/Generated/RemovedClientOptions.cs @@ -3,6 +3,8 @@ #nullable disable using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; +using Microsoft.Extensions.Configuration; namespace Versioning.Removed { @@ -12,6 +14,9 @@ public partial class RemovedClientOptions : ClientPipelineOptions public RemovedClientOptions(ServiceVersion version = LatestVersion) => throw null; + [Experimental("SCME0002")] + internal RemovedClientOptions(IConfigurationSection section) : base(section) => throw null; + public enum ServiceVersion { /// The version v1. diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/removed/v1/src/Generated/RemovedClientSettings.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/removed/v1/src/Generated/RemovedClientSettings.cs new file mode 100644 index 00000000000..ff06e89e8df --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/removed/v1/src/Generated/RemovedClientSettings.cs @@ -0,0 +1,29 @@ +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; +using Microsoft.Extensions.Configuration; + +namespace Versioning.Removed +{ + [Experimental("SCME0002")] + public partial class RemovedClientSettings : ClientSettings + { + public Uri Endpoint + { + get => throw null; + set => throw null; + } + + public RemovedClientOptions Options + { + get => throw null; + set => throw null; + } + + protected override void BindCore(IConfigurationSection section) => throw null; + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/removed/v2/src/Generated/RemovedClient.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/removed/v2/src/Generated/RemovedClient.cs index febf2295a42..d07a44fd254 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/removed/v2/src/Generated/RemovedClient.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/removed/v2/src/Generated/RemovedClient.cs @@ -5,6 +5,7 @@ using System; using System.ClientModel; using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; using System.Threading; using System.Threading.Tasks; @@ -16,7 +17,12 @@ public partial class RemovedClient public RemovedClient(Uri endpoint) : this(endpoint, new RemovedClientOptions()) => throw null; - public RemovedClient(Uri endpoint, RemovedClientOptions options) => throw null; + internal RemovedClient(AuthenticationPolicy authenticationPolicy, Uri endpoint, RemovedClientOptions options) => throw null; + + public RemovedClient(Uri endpoint, RemovedClientOptions options) : this(null, endpoint, options) => throw null; + + [Experimental("SCME0002")] + public RemovedClient(RemovedClientSettings settings) : this(AuthenticationPolicy.Create(settings), settings?.Endpoint, settings?.Options) => throw null; public ClientPipeline Pipeline => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/removed/v2/src/Generated/RemovedClientOptions.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/removed/v2/src/Generated/RemovedClientOptions.cs index 4925a16b6eb..f2256cfd36c 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/removed/v2/src/Generated/RemovedClientOptions.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/removed/v2/src/Generated/RemovedClientOptions.cs @@ -3,6 +3,8 @@ #nullable disable using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; +using Microsoft.Extensions.Configuration; namespace Versioning.Removed { @@ -12,6 +14,9 @@ public partial class RemovedClientOptions : ClientPipelineOptions public RemovedClientOptions(ServiceVersion version = LatestVersion) => throw null; + [Experimental("SCME0002")] + internal RemovedClientOptions(IConfigurationSection section) : base(section) => throw null; + public enum ServiceVersion { /// The version v1. diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/removed/v2/src/Generated/RemovedClientSettings.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/removed/v2/src/Generated/RemovedClientSettings.cs new file mode 100644 index 00000000000..ff06e89e8df --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/removed/v2/src/Generated/RemovedClientSettings.cs @@ -0,0 +1,29 @@ +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; +using Microsoft.Extensions.Configuration; + +namespace Versioning.Removed +{ + [Experimental("SCME0002")] + public partial class RemovedClientSettings : ClientSettings + { + public Uri Endpoint + { + get => throw null; + set => throw null; + } + + public RemovedClientOptions Options + { + get => throw null; + set => throw null; + } + + protected override void BindCore(IConfigurationSection section) => throw null; + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/removed/v2Preview/src/Generated/InterfaceV1.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/removed/v2Preview/src/Generated/InterfaceV1.cs index d3656e7c8d6..65f7690e6d9 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/removed/v2Preview/src/Generated/InterfaceV1.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/removed/v2Preview/src/Generated/InterfaceV1.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Threading; @@ -13,6 +14,8 @@ public partial class InterfaceV1 { protected InterfaceV1() => throw null; + internal InterfaceV1(ClientPipeline pipeline, Uri endpoint, string version) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult V1InInterface(BinaryContent content, RequestOptions options = null) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/removed/v2Preview/src/Generated/RemovedClient.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/removed/v2Preview/src/Generated/RemovedClient.cs index 9d7b39f1c89..3dfd35529a9 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/removed/v2Preview/src/Generated/RemovedClient.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/removed/v2Preview/src/Generated/RemovedClient.cs @@ -5,6 +5,7 @@ using System; using System.ClientModel; using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; using System.Threading; using System.Threading.Tasks; @@ -16,7 +17,12 @@ public partial class RemovedClient public RemovedClient(Uri endpoint) : this(endpoint, new RemovedClientOptions()) => throw null; - public RemovedClient(Uri endpoint, RemovedClientOptions options) => throw null; + internal RemovedClient(AuthenticationPolicy authenticationPolicy, Uri endpoint, RemovedClientOptions options) => throw null; + + public RemovedClient(Uri endpoint, RemovedClientOptions options) : this(null, endpoint, options) => throw null; + + [Experimental("SCME0002")] + public RemovedClient(RemovedClientSettings settings) : this(AuthenticationPolicy.Create(settings), settings?.Endpoint, settings?.Options) => throw null; public ClientPipeline Pipeline => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/removed/v2Preview/src/Generated/RemovedClientOptions.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/removed/v2Preview/src/Generated/RemovedClientOptions.cs index 43faac8d671..f7d8d97afa9 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/removed/v2Preview/src/Generated/RemovedClientOptions.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/removed/v2Preview/src/Generated/RemovedClientOptions.cs @@ -3,6 +3,8 @@ #nullable disable using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; +using Microsoft.Extensions.Configuration; namespace Versioning.Removed { @@ -12,6 +14,9 @@ public partial class RemovedClientOptions : ClientPipelineOptions public RemovedClientOptions(ServiceVersion version = LatestVersion) => throw null; + [Experimental("SCME0002")] + internal RemovedClientOptions(IConfigurationSection section) : base(section) => throw null; + public enum ServiceVersion { /// The version v1. diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/removed/v2Preview/src/Generated/RemovedClientSettings.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/removed/v2Preview/src/Generated/RemovedClientSettings.cs new file mode 100644 index 00000000000..ff06e89e8df --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/removed/v2Preview/src/Generated/RemovedClientSettings.cs @@ -0,0 +1,29 @@ +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; +using Microsoft.Extensions.Configuration; + +namespace Versioning.Removed +{ + [Experimental("SCME0002")] + public partial class RemovedClientSettings : ClientSettings + { + public Uri Endpoint + { + get => throw null; + set => throw null; + } + + public RemovedClientOptions Options + { + get => throw null; + set => throw null; + } + + protected override void BindCore(IConfigurationSection section) => throw null; + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/renamedFrom/v1/src/Generated/OldInterface.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/renamedFrom/v1/src/Generated/OldInterface.cs index 27d6fdcc629..165af44a376 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/renamedFrom/v1/src/Generated/OldInterface.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/renamedFrom/v1/src/Generated/OldInterface.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Threading; @@ -13,6 +14,8 @@ public partial class OldInterface { protected OldInterface() => throw null; + internal OldInterface(ClientPipeline pipeline, Uri endpoint, string version) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult NewOpInNewInterface(BinaryContent content, RequestOptions options = null) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/renamedFrom/v1/src/Generated/RenamedFromClient.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/renamedFrom/v1/src/Generated/RenamedFromClient.cs index d65af3f3675..936e395e08f 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/renamedFrom/v1/src/Generated/RenamedFromClient.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/renamedFrom/v1/src/Generated/RenamedFromClient.cs @@ -5,6 +5,7 @@ using System; using System.ClientModel; using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; using System.Threading; using System.Threading.Tasks; @@ -16,7 +17,12 @@ public partial class RenamedFromClient public RenamedFromClient(Uri endpoint) : this(endpoint, new RenamedFromClientOptions()) => throw null; - public RenamedFromClient(Uri endpoint, RenamedFromClientOptions options) => throw null; + internal RenamedFromClient(AuthenticationPolicy authenticationPolicy, Uri endpoint, RenamedFromClientOptions options) => throw null; + + public RenamedFromClient(Uri endpoint, RenamedFromClientOptions options) : this(null, endpoint, options) => throw null; + + [Experimental("SCME0002")] + public RenamedFromClient(RenamedFromClientSettings settings) : this(AuthenticationPolicy.Create(settings), settings?.Endpoint, settings?.Options) => throw null; public ClientPipeline Pipeline => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/renamedFrom/v1/src/Generated/RenamedFromClientOptions.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/renamedFrom/v1/src/Generated/RenamedFromClientOptions.cs index 079e9e380f8..3119ae73302 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/renamedFrom/v1/src/Generated/RenamedFromClientOptions.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/renamedFrom/v1/src/Generated/RenamedFromClientOptions.cs @@ -3,6 +3,8 @@ #nullable disable using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; +using Microsoft.Extensions.Configuration; namespace Versioning.RenamedFrom { @@ -12,6 +14,9 @@ public partial class RenamedFromClientOptions : ClientPipelineOptions public RenamedFromClientOptions(ServiceVersion version = LatestVersion) => throw null; + [Experimental("SCME0002")] + internal RenamedFromClientOptions(IConfigurationSection section) : base(section) => throw null; + public enum ServiceVersion { /// The version v1. diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/renamedFrom/v1/src/Generated/RenamedFromClientSettings.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/renamedFrom/v1/src/Generated/RenamedFromClientSettings.cs new file mode 100644 index 00000000000..da511564820 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/renamedFrom/v1/src/Generated/RenamedFromClientSettings.cs @@ -0,0 +1,29 @@ +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; +using Microsoft.Extensions.Configuration; + +namespace Versioning.RenamedFrom +{ + [Experimental("SCME0002")] + public partial class RenamedFromClientSettings : ClientSettings + { + public Uri Endpoint + { + get => throw null; + set => throw null; + } + + public RenamedFromClientOptions Options + { + get => throw null; + set => throw null; + } + + protected override void BindCore(IConfigurationSection section) => throw null; + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/renamedFrom/v2/src/Generated/NewInterface.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/renamedFrom/v2/src/Generated/NewInterface.cs index 959c7a48106..5a2e1c3333e 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/renamedFrom/v2/src/Generated/NewInterface.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/renamedFrom/v2/src/Generated/NewInterface.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Threading; @@ -13,6 +14,8 @@ public partial class NewInterface { protected NewInterface() => throw null; + internal NewInterface(ClientPipeline pipeline, Uri endpoint, string version) => throw null; + public ClientPipeline Pipeline => throw null; public virtual ClientResult NewOpInNewInterface(BinaryContent content, RequestOptions options = null) => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/renamedFrom/v2/src/Generated/RenamedFromClient.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/renamedFrom/v2/src/Generated/RenamedFromClient.cs index 6c6eb4de56b..18dab03d399 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/renamedFrom/v2/src/Generated/RenamedFromClient.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/renamedFrom/v2/src/Generated/RenamedFromClient.cs @@ -5,6 +5,7 @@ using System; using System.ClientModel; using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; using System.Threading; using System.Threading.Tasks; @@ -16,7 +17,12 @@ public partial class RenamedFromClient public RenamedFromClient(Uri endpoint) : this(endpoint, new RenamedFromClientOptions()) => throw null; - public RenamedFromClient(Uri endpoint, RenamedFromClientOptions options) => throw null; + internal RenamedFromClient(AuthenticationPolicy authenticationPolicy, Uri endpoint, RenamedFromClientOptions options) => throw null; + + public RenamedFromClient(Uri endpoint, RenamedFromClientOptions options) : this(null, endpoint, options) => throw null; + + [Experimental("SCME0002")] + public RenamedFromClient(RenamedFromClientSettings settings) : this(AuthenticationPolicy.Create(settings), settings?.Endpoint, settings?.Options) => throw null; public ClientPipeline Pipeline => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/renamedFrom/v2/src/Generated/RenamedFromClientOptions.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/renamedFrom/v2/src/Generated/RenamedFromClientOptions.cs index 7d99ad1eb2f..6079b82ab55 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/renamedFrom/v2/src/Generated/RenamedFromClientOptions.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/renamedFrom/v2/src/Generated/RenamedFromClientOptions.cs @@ -3,6 +3,8 @@ #nullable disable using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; +using Microsoft.Extensions.Configuration; namespace Versioning.RenamedFrom { @@ -12,6 +14,9 @@ public partial class RenamedFromClientOptions : ClientPipelineOptions public RenamedFromClientOptions(ServiceVersion version = LatestVersion) => throw null; + [Experimental("SCME0002")] + internal RenamedFromClientOptions(IConfigurationSection section) : base(section) => throw null; + public enum ServiceVersion { /// The version v1. diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/renamedFrom/v2/src/Generated/RenamedFromClientSettings.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/renamedFrom/v2/src/Generated/RenamedFromClientSettings.cs new file mode 100644 index 00000000000..da511564820 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/renamedFrom/v2/src/Generated/RenamedFromClientSettings.cs @@ -0,0 +1,29 @@ +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; +using Microsoft.Extensions.Configuration; + +namespace Versioning.RenamedFrom +{ + [Experimental("SCME0002")] + public partial class RenamedFromClientSettings : ClientSettings + { + public Uri Endpoint + { + get => throw null; + set => throw null; + } + + public RenamedFromClientOptions Options + { + get => throw null; + set => throw null; + } + + protected override void BindCore(IConfigurationSection section) => throw null; + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/returnTypeChangedFrom/v1/src/Generated/ReturnTypeChangedFromClient.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/returnTypeChangedFrom/v1/src/Generated/ReturnTypeChangedFromClient.cs index aa02fb0c6aa..60b54b0ab97 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/returnTypeChangedFrom/v1/src/Generated/ReturnTypeChangedFromClient.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/returnTypeChangedFrom/v1/src/Generated/ReturnTypeChangedFromClient.cs @@ -5,6 +5,7 @@ using System; using System.ClientModel; using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; using System.Threading; using System.Threading.Tasks; @@ -16,7 +17,12 @@ public partial class ReturnTypeChangedFromClient public ReturnTypeChangedFromClient(Uri endpoint) : this(endpoint, new ReturnTypeChangedFromClientOptions()) => throw null; - public ReturnTypeChangedFromClient(Uri endpoint, ReturnTypeChangedFromClientOptions options) => throw null; + internal ReturnTypeChangedFromClient(AuthenticationPolicy authenticationPolicy, Uri endpoint, ReturnTypeChangedFromClientOptions options) => throw null; + + public ReturnTypeChangedFromClient(Uri endpoint, ReturnTypeChangedFromClientOptions options) : this(null, endpoint, options) => throw null; + + [Experimental("SCME0002")] + public ReturnTypeChangedFromClient(ReturnTypeChangedFromClientSettings settings) : this(AuthenticationPolicy.Create(settings), settings?.Endpoint, settings?.Options) => throw null; public ClientPipeline Pipeline => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/returnTypeChangedFrom/v1/src/Generated/ReturnTypeChangedFromClientOptions.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/returnTypeChangedFrom/v1/src/Generated/ReturnTypeChangedFromClientOptions.cs index e8bee0a6323..fd2f1ec452c 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/returnTypeChangedFrom/v1/src/Generated/ReturnTypeChangedFromClientOptions.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/returnTypeChangedFrom/v1/src/Generated/ReturnTypeChangedFromClientOptions.cs @@ -3,6 +3,8 @@ #nullable disable using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; +using Microsoft.Extensions.Configuration; namespace Versioning.ReturnTypeChangedFrom { @@ -12,6 +14,9 @@ public partial class ReturnTypeChangedFromClientOptions : ClientPipelineOptions public ReturnTypeChangedFromClientOptions(ServiceVersion version = LatestVersion) => throw null; + [Experimental("SCME0002")] + internal ReturnTypeChangedFromClientOptions(IConfigurationSection section) : base(section) => throw null; + public enum ServiceVersion { /// The version v1. diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/returnTypeChangedFrom/v1/src/Generated/ReturnTypeChangedFromClientSettings.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/returnTypeChangedFrom/v1/src/Generated/ReturnTypeChangedFromClientSettings.cs new file mode 100644 index 00000000000..d8b043ada18 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/returnTypeChangedFrom/v1/src/Generated/ReturnTypeChangedFromClientSettings.cs @@ -0,0 +1,29 @@ +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; +using Microsoft.Extensions.Configuration; + +namespace Versioning.ReturnTypeChangedFrom +{ + [Experimental("SCME0002")] + public partial class ReturnTypeChangedFromClientSettings : ClientSettings + { + public Uri Endpoint + { + get => throw null; + set => throw null; + } + + public ReturnTypeChangedFromClientOptions Options + { + get => throw null; + set => throw null; + } + + protected override void BindCore(IConfigurationSection section) => throw null; + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/returnTypeChangedFrom/v2/src/Generated/ReturnTypeChangedFromClient.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/returnTypeChangedFrom/v2/src/Generated/ReturnTypeChangedFromClient.cs index 59f110a0c55..5a20ae37bc3 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/returnTypeChangedFrom/v2/src/Generated/ReturnTypeChangedFromClient.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/returnTypeChangedFrom/v2/src/Generated/ReturnTypeChangedFromClient.cs @@ -5,6 +5,7 @@ using System; using System.ClientModel; using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; using System.Threading; using System.Threading.Tasks; @@ -16,7 +17,12 @@ public partial class ReturnTypeChangedFromClient public ReturnTypeChangedFromClient(Uri endpoint) : this(endpoint, new ReturnTypeChangedFromClientOptions()) => throw null; - public ReturnTypeChangedFromClient(Uri endpoint, ReturnTypeChangedFromClientOptions options) => throw null; + internal ReturnTypeChangedFromClient(AuthenticationPolicy authenticationPolicy, Uri endpoint, ReturnTypeChangedFromClientOptions options) => throw null; + + public ReturnTypeChangedFromClient(Uri endpoint, ReturnTypeChangedFromClientOptions options) : this(null, endpoint, options) => throw null; + + [Experimental("SCME0002")] + public ReturnTypeChangedFromClient(ReturnTypeChangedFromClientSettings settings) : this(AuthenticationPolicy.Create(settings), settings?.Endpoint, settings?.Options) => throw null; public ClientPipeline Pipeline => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/returnTypeChangedFrom/v2/src/Generated/ReturnTypeChangedFromClientOptions.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/returnTypeChangedFrom/v2/src/Generated/ReturnTypeChangedFromClientOptions.cs index b6d5d3ef543..6c62310339f 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/returnTypeChangedFrom/v2/src/Generated/ReturnTypeChangedFromClientOptions.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/returnTypeChangedFrom/v2/src/Generated/ReturnTypeChangedFromClientOptions.cs @@ -3,6 +3,8 @@ #nullable disable using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; +using Microsoft.Extensions.Configuration; namespace Versioning.ReturnTypeChangedFrom { @@ -12,6 +14,9 @@ public partial class ReturnTypeChangedFromClientOptions : ClientPipelineOptions public ReturnTypeChangedFromClientOptions(ServiceVersion version = LatestVersion) => throw null; + [Experimental("SCME0002")] + internal ReturnTypeChangedFromClientOptions(IConfigurationSection section) : base(section) => throw null; + public enum ServiceVersion { /// The version v1. diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/returnTypeChangedFrom/v2/src/Generated/ReturnTypeChangedFromClientSettings.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/returnTypeChangedFrom/v2/src/Generated/ReturnTypeChangedFromClientSettings.cs new file mode 100644 index 00000000000..d8b043ada18 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/returnTypeChangedFrom/v2/src/Generated/ReturnTypeChangedFromClientSettings.cs @@ -0,0 +1,29 @@ +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; +using Microsoft.Extensions.Configuration; + +namespace Versioning.ReturnTypeChangedFrom +{ + [Experimental("SCME0002")] + public partial class ReturnTypeChangedFromClientSettings : ClientSettings + { + public Uri Endpoint + { + get => throw null; + set => throw null; + } + + public ReturnTypeChangedFromClientOptions Options + { + get => throw null; + set => throw null; + } + + protected override void BindCore(IConfigurationSection section) => throw null; + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/typeChangedFrom/v1/src/Generated/TypeChangedFromClient.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/typeChangedFrom/v1/src/Generated/TypeChangedFromClient.cs index cd3284b715d..fc0dde04309 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/typeChangedFrom/v1/src/Generated/TypeChangedFromClient.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/typeChangedFrom/v1/src/Generated/TypeChangedFromClient.cs @@ -5,6 +5,7 @@ using System; using System.ClientModel; using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; using System.Threading; using System.Threading.Tasks; @@ -16,7 +17,12 @@ public partial class TypeChangedFromClient public TypeChangedFromClient(Uri endpoint) : this(endpoint, new TypeChangedFromClientOptions()) => throw null; - public TypeChangedFromClient(Uri endpoint, TypeChangedFromClientOptions options) => throw null; + internal TypeChangedFromClient(AuthenticationPolicy authenticationPolicy, Uri endpoint, TypeChangedFromClientOptions options) => throw null; + + public TypeChangedFromClient(Uri endpoint, TypeChangedFromClientOptions options) : this(null, endpoint, options) => throw null; + + [Experimental("SCME0002")] + public TypeChangedFromClient(TypeChangedFromClientSettings settings) : this(AuthenticationPolicy.Create(settings), settings?.Endpoint, settings?.Options) => throw null; public ClientPipeline Pipeline => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/typeChangedFrom/v1/src/Generated/TypeChangedFromClientOptions.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/typeChangedFrom/v1/src/Generated/TypeChangedFromClientOptions.cs index e335851e9c0..2fd14057077 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/typeChangedFrom/v1/src/Generated/TypeChangedFromClientOptions.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/typeChangedFrom/v1/src/Generated/TypeChangedFromClientOptions.cs @@ -3,6 +3,8 @@ #nullable disable using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; +using Microsoft.Extensions.Configuration; namespace Versioning.TypeChangedFrom { @@ -12,6 +14,9 @@ public partial class TypeChangedFromClientOptions : ClientPipelineOptions public TypeChangedFromClientOptions(ServiceVersion version = LatestVersion) => throw null; + [Experimental("SCME0002")] + internal TypeChangedFromClientOptions(IConfigurationSection section) : base(section) => throw null; + public enum ServiceVersion { /// The version v1. diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/typeChangedFrom/v1/src/Generated/TypeChangedFromClientSettings.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/typeChangedFrom/v1/src/Generated/TypeChangedFromClientSettings.cs new file mode 100644 index 00000000000..51180632a28 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/typeChangedFrom/v1/src/Generated/TypeChangedFromClientSettings.cs @@ -0,0 +1,29 @@ +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; +using Microsoft.Extensions.Configuration; + +namespace Versioning.TypeChangedFrom +{ + [Experimental("SCME0002")] + public partial class TypeChangedFromClientSettings : ClientSettings + { + public Uri Endpoint + { + get => throw null; + set => throw null; + } + + public TypeChangedFromClientOptions Options + { + get => throw null; + set => throw null; + } + + protected override void BindCore(IConfigurationSection section) => throw null; + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/typeChangedFrom/v2/src/Generated/TypeChangedFromClient.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/typeChangedFrom/v2/src/Generated/TypeChangedFromClient.cs index 4ac83f56d47..bbb62a54e1a 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/typeChangedFrom/v2/src/Generated/TypeChangedFromClient.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/typeChangedFrom/v2/src/Generated/TypeChangedFromClient.cs @@ -5,6 +5,7 @@ using System; using System.ClientModel; using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; using System.Threading; using System.Threading.Tasks; @@ -16,7 +17,12 @@ public partial class TypeChangedFromClient public TypeChangedFromClient(Uri endpoint) : this(endpoint, new TypeChangedFromClientOptions()) => throw null; - public TypeChangedFromClient(Uri endpoint, TypeChangedFromClientOptions options) => throw null; + internal TypeChangedFromClient(AuthenticationPolicy authenticationPolicy, Uri endpoint, TypeChangedFromClientOptions options) => throw null; + + public TypeChangedFromClient(Uri endpoint, TypeChangedFromClientOptions options) : this(null, endpoint, options) => throw null; + + [Experimental("SCME0002")] + public TypeChangedFromClient(TypeChangedFromClientSettings settings) : this(AuthenticationPolicy.Create(settings), settings?.Endpoint, settings?.Options) => throw null; public ClientPipeline Pipeline => throw null; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/typeChangedFrom/v2/src/Generated/TypeChangedFromClientOptions.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/typeChangedFrom/v2/src/Generated/TypeChangedFromClientOptions.cs index bd3fa375597..7ecdd66c06b 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/typeChangedFrom/v2/src/Generated/TypeChangedFromClientOptions.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/typeChangedFrom/v2/src/Generated/TypeChangedFromClientOptions.cs @@ -3,6 +3,8 @@ #nullable disable using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; +using Microsoft.Extensions.Configuration; namespace Versioning.TypeChangedFrom { @@ -12,6 +14,9 @@ public partial class TypeChangedFromClientOptions : ClientPipelineOptions public TypeChangedFromClientOptions(ServiceVersion version = LatestVersion) => throw null; + [Experimental("SCME0002")] + internal TypeChangedFromClientOptions(IConfigurationSection section) : base(section) => throw null; + public enum ServiceVersion { /// The version v1. diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/typeChangedFrom/v2/src/Generated/TypeChangedFromClientSettings.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/typeChangedFrom/v2/src/Generated/TypeChangedFromClientSettings.cs new file mode 100644 index 00000000000..51180632a28 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/typeChangedFrom/v2/src/Generated/TypeChangedFromClientSettings.cs @@ -0,0 +1,29 @@ +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; +using Microsoft.Extensions.Configuration; + +namespace Versioning.TypeChangedFrom +{ + [Experimental("SCME0002")] + public partial class TypeChangedFromClientSettings : ClientSettings + { + public Uri Endpoint + { + get => throw null; + set => throw null; + } + + public TypeChangedFromClientOptions Options + { + get => throw null; + set => throw null; + } + + protected override void BindCore(IConfigurationSection section) => throw null; + } +}