diff --git a/src/libs/Mubert/Generated/Mubert.IPublicClient.Authorizations.Bearer.g.cs b/src/libs/Mubert/Generated/Mubert.IPublicClient.Authorizations.Bearer.g.cs new file mode 100644 index 0000000..3090372 --- /dev/null +++ b/src/libs/Mubert/Generated/Mubert.IPublicClient.Authorizations.Bearer.g.cs @@ -0,0 +1,16 @@ + +#nullable enable + +namespace Mubert +{ + public partial interface IPublicClient + { + /// + /// Authorize using bearer authentication. + /// + /// + + public void AuthorizeUsingBearer( + string apiKey); + } +} \ No newline at end of file diff --git a/src/libs/Mubert/Generated/Mubert.IPublicServiceClient.Authorizations.Bearer.g.cs b/src/libs/Mubert/Generated/Mubert.IPublicServiceClient.Authorizations.Bearer.g.cs new file mode 100644 index 0000000..f350544 --- /dev/null +++ b/src/libs/Mubert/Generated/Mubert.IPublicServiceClient.Authorizations.Bearer.g.cs @@ -0,0 +1,16 @@ + +#nullable enable + +namespace Mubert +{ + public partial interface IPublicServiceClient + { + /// + /// Authorize using bearer authentication. + /// + /// + + public void AuthorizeUsingBearer( + string apiKey); + } +} \ No newline at end of file diff --git a/src/libs/Mubert/Generated/Mubert.IServiceClient.Authorizations.Bearer.g.cs b/src/libs/Mubert/Generated/Mubert.IServiceClient.Authorizations.Bearer.g.cs new file mode 100644 index 0000000..5206cb6 --- /dev/null +++ b/src/libs/Mubert/Generated/Mubert.IServiceClient.Authorizations.Bearer.g.cs @@ -0,0 +1,16 @@ + +#nullable enable + +namespace Mubert +{ + public partial interface IServiceClient + { + /// + /// Authorize using bearer authentication. + /// + /// + + public void AuthorizeUsingBearer( + string apiKey); + } +} \ No newline at end of file diff --git a/src/libs/Mubert/Generated/Mubert.PublicClient.Authorizations.Bearer.g.cs b/src/libs/Mubert/Generated/Mubert.PublicClient.Authorizations.Bearer.g.cs new file mode 100644 index 0000000..56273c5 --- /dev/null +++ b/src/libs/Mubert/Generated/Mubert.PublicClient.Authorizations.Bearer.g.cs @@ -0,0 +1,35 @@ + +#nullable enable + +namespace Mubert +{ + public sealed partial class PublicClient + { + + /// + public void AuthorizeUsingBearer( + string apiKey) + { + apiKey = apiKey ?? throw new global::System.ArgumentNullException(nameof(apiKey)); + + for (var i = Authorizations.Count - 1; i >= 0; i--) + { + var __authorization = Authorizations[i]; + if (__authorization.Type == "Http" && + __authorization.Name == "Bearer") + { + Authorizations.RemoveAt(i); + } + } + + Authorizations.Add(new global::Mubert.EndPointAuthorization + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + Value = apiKey, + }); + } + } +} \ No newline at end of file diff --git a/src/libs/Mubert/Generated/Mubert.PublicClient.Constructors.Bearer.g.cs b/src/libs/Mubert/Generated/Mubert.PublicClient.Constructors.Bearer.g.cs new file mode 100644 index 0000000..c0e629f --- /dev/null +++ b/src/libs/Mubert/Generated/Mubert.PublicClient.Constructors.Bearer.g.cs @@ -0,0 +1,31 @@ + +#nullable enable + +namespace Mubert +{ + public sealed partial class PublicClient + { + /// + + public PublicClient( + string apiKey, + global::System.Net.Http.HttpClient? httpClient = null, + global::System.Uri? baseUri = null, + global::System.Collections.Generic.List? authorizations = null, + bool disposeHttpClient = true) : this(httpClient, baseUri, authorizations, disposeHttpClient) + { + Authorizing(HttpClient, ref apiKey); + + AuthorizeUsingBearer(apiKey); + + Authorized(HttpClient); + } + + partial void Authorizing( + global::System.Net.Http.HttpClient client, + ref string apiKey); + partial void Authorized( + global::System.Net.Http.HttpClient client); + + } +} \ No newline at end of file diff --git a/src/libs/Mubert/Generated/Mubert.PublicService.JsonSerializerContext.g.cs b/src/libs/Mubert/Generated/Mubert.PublicService.JsonSerializerContext.g.cs new file mode 100644 index 0000000..6c842bb --- /dev/null +++ b/src/libs/Mubert/Generated/Mubert.PublicService.JsonSerializerContext.g.cs @@ -0,0 +1,261 @@ + +#nullable enable + +#pragma warning disable CS0618 // Type or member is obsolete +#pragma warning disable CS3016 // Arrays as attribute arguments is not CLS-compliant + +namespace Mubert +{ + /// + /// + /// + [global::System.Text.Json.Serialization.JsonSourceGenerationOptions( + DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull, + Converters = new global::System.Type[] + { + })] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List), TypeInfoPropertyName = "SystemCollectionsGeneric_ObjectList")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Text.Json.JsonElement?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mubert.FeatureEnum), TypeInfoPropertyName = "FeatureEnum2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mubert.AccessTokenExpiredException))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(string))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.DateTime))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mubert.ForbiddenException))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mubert.UnauthenticatedException))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mubert.CompanyIsNotActiveException))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mubert.LicenseExpiredException))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(int))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(object))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mubert.Error403Response))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mubert.Error403ResponseDiscriminator))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mubert.Error403ResponseDiscriminatorCode), TypeInfoPropertyName = "Error403ResponseDiscriminatorCode2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mubert.Error404Response))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mubert.MetadataPagination))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Guid))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(bool))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mubert.TrackIntensityEnum), TypeInfoPropertyName = "TrackIntensityEnum2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mubert.TrackFormatEnum), TypeInfoPropertyName = "TrackFormatEnum2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mubert.TrackModeEnum), TypeInfoPropertyName = "TrackModeEnum2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mubert.LicenseServiceResource))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mubert.CustomerServiceResource))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mubert.LicenseLimitServiceResource))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mubert.PutServiceCustomersByCustomerRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mubert.PostServiceCustomersRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mubert.PutServiceLicensesByLicenseRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mubert.GetServiceCustomersResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mubert.GetServiceLicensesResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mubert.FeatureEnum?), TypeInfoPropertyName = "NullableFeatureEnum2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.DateTime?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(int?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mubert.Error403ResponseDiscriminatorCode?), TypeInfoPropertyName = "NullableError403ResponseDiscriminatorCode2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Guid?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(bool?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mubert.TrackIntensityEnum?), TypeInfoPropertyName = "NullableTrackIntensityEnum2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mubert.TrackFormatEnum?), TypeInfoPropertyName = "NullableTrackFormatEnum2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mubert.TrackModeEnum?), TypeInfoPropertyName = "NullableTrackModeEnum2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + internal sealed partial class PublicServiceSourceGenerationContextChunk0 : global::System.Text.Json.Serialization.JsonSerializerContext + { + } + /// + /// + /// + public sealed partial class PublicServiceSourceGenerationContext : global::System.Text.Json.Serialization.JsonSerializerContext + { + private static readonly global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver Resolver = new LazyChunkResolver(); + + + private static readonly global::System.Text.Json.JsonSerializerOptions DefaultOptions = CreateDefaultOptions(); + + /// + /// + /// + public static PublicServiceSourceGenerationContext Default { get; } = new(DefaultOptions); + + private PublicServiceSourceGenerationContext(global::System.Text.Json.JsonSerializerOptions options) + : base(options) + { + } + + /// + protected override global::System.Text.Json.JsonSerializerOptions? GeneratedSerializerOptions => DefaultOptions; + + /// + public override global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? GetTypeInfo(global::System.Type type) + { + return Resolver.GetTypeInfo(type, Options); + } + + /// + /// Adds this package's converters to . + /// + /// + /// A converter has to be on the options a chained resolver builds its JsonTypeInfo against, + /// and a context resolves types from every package below it. Each package contributes only + /// what it owns and calls down the chain for the rest, so the family's converter table is + /// written once rather than copied into all of them. + /// + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public static void AddConverters(global::System.Text.Json.JsonSerializerOptions options) + { + options.Converters.Add(new global::Mubert.JsonConverters.UnixTimestampJsonConverter()); + options.Converters.Add(new LazyEnumJsonConverterFactory()); + } + + private static global::System.Text.Json.JsonSerializerOptions CreateDefaultOptions() + { + var options = new global::System.Text.Json.JsonSerializerOptions + { + DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull, + TypeInfoResolver = Resolver, + }; + AddConverters(options); + + return options; + } + + + private sealed class LazyEnumJsonConverterFactory : global::System.Text.Json.Serialization.JsonConverterFactory + { + public override bool CanConvert(global::System.Type typeToConvert) + { + return + typeToConvert == typeof(global::Mubert.FeatureEnum) + + || typeToConvert == typeof(global::Mubert.FeatureEnum?) + + || typeToConvert == typeof(global::Mubert.Error403ResponseDiscriminatorCode) + + || typeToConvert == typeof(global::Mubert.Error403ResponseDiscriminatorCode?) + + || typeToConvert == typeof(global::Mubert.TrackFormatEnum) + + || typeToConvert == typeof(global::Mubert.TrackFormatEnum?) + + || typeToConvert == typeof(global::Mubert.TrackIntensityEnum) + + || typeToConvert == typeof(global::Mubert.TrackIntensityEnum?) + + || typeToConvert == typeof(global::Mubert.TrackModeEnum) + + || typeToConvert == typeof(global::Mubert.TrackModeEnum?); + } + + public override global::System.Text.Json.Serialization.JsonConverter CreateConverter( + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + if (typeToConvert == typeof(global::Mubert.FeatureEnum)) + { + return new global::Mubert.JsonConverters.FeatureEnumJsonConverter(); + } + + if (typeToConvert == typeof(global::Mubert.FeatureEnum?)) + { + return new global::Mubert.JsonConverters.FeatureEnumNullableJsonConverter(); + } + + if (typeToConvert == typeof(global::Mubert.Error403ResponseDiscriminatorCode)) + { + return new global::Mubert.JsonConverters.Error403ResponseDiscriminatorCodeJsonConverter(); + } + + if (typeToConvert == typeof(global::Mubert.Error403ResponseDiscriminatorCode?)) + { + return new global::Mubert.JsonConverters.Error403ResponseDiscriminatorCodeNullableJsonConverter(); + } + + if (typeToConvert == typeof(global::Mubert.TrackFormatEnum)) + { + return new global::Mubert.JsonConverters.TrackFormatEnumJsonConverter(); + } + + if (typeToConvert == typeof(global::Mubert.TrackFormatEnum?)) + { + return new global::Mubert.JsonConverters.TrackFormatEnumNullableJsonConverter(); + } + + if (typeToConvert == typeof(global::Mubert.TrackIntensityEnum)) + { + return new global::Mubert.JsonConverters.TrackIntensityEnumJsonConverter(); + } + + if (typeToConvert == typeof(global::Mubert.TrackIntensityEnum?)) + { + return new global::Mubert.JsonConverters.TrackIntensityEnumNullableJsonConverter(); + } + + if (typeToConvert == typeof(global::Mubert.TrackModeEnum)) + { + return new global::Mubert.JsonConverters.TrackModeEnumJsonConverter(); + } + + if (typeToConvert == typeof(global::Mubert.TrackModeEnum?)) + { + return new global::Mubert.JsonConverters.TrackModeEnumNullableJsonConverter(); + } + throw new global::System.NotSupportedException($"No generated enum converter is registered for '{typeToConvert}'."); + } + } + + private sealed class LazyChunkResolver : global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver + { + private readonly object _gate = new(); + private readonly global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver?[] _resolvers = new global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver?[1]; + + public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? GetTypeInfo( + global::System.Type type, + global::System.Text.Json.JsonSerializerOptions options) + { + for (var index = 0; index < _resolvers.Length; index++) + { + var typeInfo = GetResolver(index).GetTypeInfo(type, options); + if (typeInfo is not null) + { + return typeInfo; + } + } + + return null; + } + + private global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver GetResolver(int index) + { + var resolver = global::System.Threading.Volatile.Read(ref _resolvers[index]); + if (resolver is not null) + { + return resolver; + } + + lock (_gate) + { + return _resolvers[index] ??= CreateResolver(index); + } + } + + private static global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver CreateResolver(int index) + { + return index switch + { + 0 => new PublicServiceSourceGenerationContextChunk0(new global::System.Text.Json.JsonSerializerOptions()), + _ => throw new global::System.ArgumentOutOfRangeException(nameof(index)), + }; + } + } + } +} \ No newline at end of file diff --git a/src/libs/Mubert/Generated/Mubert.PublicServiceClient.Authorizations.Bearer.g.cs b/src/libs/Mubert/Generated/Mubert.PublicServiceClient.Authorizations.Bearer.g.cs new file mode 100644 index 0000000..fdcbdda --- /dev/null +++ b/src/libs/Mubert/Generated/Mubert.PublicServiceClient.Authorizations.Bearer.g.cs @@ -0,0 +1,35 @@ + +#nullable enable + +namespace Mubert +{ + public sealed partial class PublicServiceClient + { + + /// + public void AuthorizeUsingBearer( + string apiKey) + { + apiKey = apiKey ?? throw new global::System.ArgumentNullException(nameof(apiKey)); + + for (var i = Authorizations.Count - 1; i >= 0; i--) + { + var __authorization = Authorizations[i]; + if (__authorization.Type == "Http" && + __authorization.Name == "Bearer") + { + Authorizations.RemoveAt(i); + } + } + + Authorizations.Add(new global::Mubert.EndPointAuthorization + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + Value = apiKey, + }); + } + } +} \ No newline at end of file diff --git a/src/libs/Mubert/Generated/Mubert.PublicServiceClient.Constructors.Bearer.g.cs b/src/libs/Mubert/Generated/Mubert.PublicServiceClient.Constructors.Bearer.g.cs new file mode 100644 index 0000000..d4fb4cb --- /dev/null +++ b/src/libs/Mubert/Generated/Mubert.PublicServiceClient.Constructors.Bearer.g.cs @@ -0,0 +1,31 @@ + +#nullable enable + +namespace Mubert +{ + public sealed partial class PublicServiceClient + { + /// + + public PublicServiceClient( + string apiKey, + global::System.Net.Http.HttpClient? httpClient = null, + global::System.Uri? baseUri = null, + global::System.Collections.Generic.List? authorizations = null, + bool disposeHttpClient = true) : this(httpClient, baseUri, authorizations, disposeHttpClient) + { + Authorizing(HttpClient, ref apiKey); + + AuthorizeUsingBearer(apiKey); + + Authorized(HttpClient); + } + + partial void Authorizing( + global::System.Net.Http.HttpClient client, + ref string apiKey); + partial void Authorized( + global::System.Net.Http.HttpClient client); + + } +} \ No newline at end of file diff --git a/src/libs/Mubert/Generated/Mubert.PublicServiceClient.g.cs b/src/libs/Mubert/Generated/Mubert.PublicServiceClient.g.cs index 33a76e0..38c8996 100644 --- a/src/libs/Mubert/Generated/Mubert.PublicServiceClient.g.cs +++ b/src/libs/Mubert/Generated/Mubert.PublicServiceClient.g.cs @@ -35,7 +35,7 @@ public sealed partial class PublicServiceClient : global::Mubert.IPublicServiceC /// public global::Mubert.AutoSDKClientOptions Options { get; } - internal global::System.Lazy JsonSerializerContextProvider { get; set; } = new(() => global::Mubert.SourceGenerationContext.Default); + internal global::System.Lazy JsonSerializerContextProvider { get; set; } = new(() => global::Mubert.PublicServiceSourceGenerationContext.Default); /// /// diff --git a/src/libs/Mubert/Generated/Mubert.Service.JsonSerializerContext.g.cs b/src/libs/Mubert/Generated/Mubert.Service.JsonSerializerContext.g.cs new file mode 100644 index 0000000..cdbb86d --- /dev/null +++ b/src/libs/Mubert/Generated/Mubert.Service.JsonSerializerContext.g.cs @@ -0,0 +1,141 @@ + +#nullable enable + +#pragma warning disable CS0618 // Type or member is obsolete +#pragma warning disable CS3016 // Arrays as attribute arguments is not CLS-compliant + +namespace Mubert +{ + /// + /// + /// + [global::System.Text.Json.Serialization.JsonSourceGenerationOptions( + DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull, + Converters = new global::System.Type[] + { + })] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List), TypeInfoPropertyName = "SystemCollectionsGeneric_ObjectList")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Text.Json.JsonElement?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(string))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mubert.PriceNotFoundException))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Guid))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(bool))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mubert.GetServiceStripeBillingPortalRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mubert.PostServiceStripeBillingPortalRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mubert.GetServiceStripeSubscriptionsBuyRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mubert.PostServiceStripeSubscriptionsBuyRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mubert.GetServiceStripeSubscriptionsCancelRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mubert.PostServiceStripeSubscriptionsCancelRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mubert.GetServiceStripeBillingPortalResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mubert.GetServiceStripeBillingPortalResponseData))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mubert.GetServiceStripeSubscriptionsBuyResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Mubert.PostServiceStripeSubscriptionsBuyResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Guid?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(bool?))] + internal sealed partial class ServiceSourceGenerationContextChunk0 : global::System.Text.Json.Serialization.JsonSerializerContext + { + } + /// + /// + /// + public sealed partial class ServiceSourceGenerationContext : global::System.Text.Json.Serialization.JsonSerializerContext + { + private static readonly global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver Resolver = new LazyChunkResolver(); + + + private static readonly global::System.Text.Json.JsonSerializerOptions DefaultOptions = CreateDefaultOptions(); + + /// + /// + /// + public static ServiceSourceGenerationContext Default { get; } = new(DefaultOptions); + + private ServiceSourceGenerationContext(global::System.Text.Json.JsonSerializerOptions options) + : base(options) + { + } + + /// + protected override global::System.Text.Json.JsonSerializerOptions? GeneratedSerializerOptions => DefaultOptions; + + /// + public override global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? GetTypeInfo(global::System.Type type) + { + return Resolver.GetTypeInfo(type, Options); + } + + /// + /// Adds this package's converters to . + /// + /// + /// A converter has to be on the options a chained resolver builds its JsonTypeInfo against, + /// and a context resolves types from every package below it. Each package contributes only + /// what it owns and calls down the chain for the rest, so the family's converter table is + /// written once rather than copied into all of them. + /// + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public static void AddConverters(global::System.Text.Json.JsonSerializerOptions options) + { + options.Converters.Add(new global::Mubert.JsonConverters.UnixTimestampJsonConverter()); + } + + private static global::System.Text.Json.JsonSerializerOptions CreateDefaultOptions() + { + var options = new global::System.Text.Json.JsonSerializerOptions + { + DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull, + TypeInfoResolver = Resolver, + }; + AddConverters(options); + + return options; + } + + private sealed class LazyChunkResolver : global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver + { + private readonly object _gate = new(); + private readonly global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver?[] _resolvers = new global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver?[1]; + + public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? GetTypeInfo( + global::System.Type type, + global::System.Text.Json.JsonSerializerOptions options) + { + for (var index = 0; index < _resolvers.Length; index++) + { + var typeInfo = GetResolver(index).GetTypeInfo(type, options); + if (typeInfo is not null) + { + return typeInfo; + } + } + + return null; + } + + private global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver GetResolver(int index) + { + var resolver = global::System.Threading.Volatile.Read(ref _resolvers[index]); + if (resolver is not null) + { + return resolver; + } + + lock (_gate) + { + return _resolvers[index] ??= CreateResolver(index); + } + } + + private static global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver CreateResolver(int index) + { + return index switch + { + 0 => new ServiceSourceGenerationContextChunk0(new global::System.Text.Json.JsonSerializerOptions()), + _ => throw new global::System.ArgumentOutOfRangeException(nameof(index)), + }; + } + } + } +} \ No newline at end of file diff --git a/src/libs/Mubert/Generated/Mubert.ServiceClient.Authorizations.Bearer.g.cs b/src/libs/Mubert/Generated/Mubert.ServiceClient.Authorizations.Bearer.g.cs new file mode 100644 index 0000000..1b03542 --- /dev/null +++ b/src/libs/Mubert/Generated/Mubert.ServiceClient.Authorizations.Bearer.g.cs @@ -0,0 +1,35 @@ + +#nullable enable + +namespace Mubert +{ + public sealed partial class ServiceClient + { + + /// + public void AuthorizeUsingBearer( + string apiKey) + { + apiKey = apiKey ?? throw new global::System.ArgumentNullException(nameof(apiKey)); + + for (var i = Authorizations.Count - 1; i >= 0; i--) + { + var __authorization = Authorizations[i]; + if (__authorization.Type == "Http" && + __authorization.Name == "Bearer") + { + Authorizations.RemoveAt(i); + } + } + + Authorizations.Add(new global::Mubert.EndPointAuthorization + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + Value = apiKey, + }); + } + } +} \ No newline at end of file diff --git a/src/libs/Mubert/Generated/Mubert.ServiceClient.Constructors.Bearer.g.cs b/src/libs/Mubert/Generated/Mubert.ServiceClient.Constructors.Bearer.g.cs new file mode 100644 index 0000000..1d7d69d --- /dev/null +++ b/src/libs/Mubert/Generated/Mubert.ServiceClient.Constructors.Bearer.g.cs @@ -0,0 +1,31 @@ + +#nullable enable + +namespace Mubert +{ + public sealed partial class ServiceClient + { + /// + + public ServiceClient( + string apiKey, + global::System.Net.Http.HttpClient? httpClient = null, + global::System.Uri? baseUri = null, + global::System.Collections.Generic.List? authorizations = null, + bool disposeHttpClient = true) : this(httpClient, baseUri, authorizations, disposeHttpClient) + { + Authorizing(HttpClient, ref apiKey); + + AuthorizeUsingBearer(apiKey); + + Authorized(HttpClient); + } + + partial void Authorizing( + global::System.Net.Http.HttpClient client, + ref string apiKey); + partial void Authorized( + global::System.Net.Http.HttpClient client); + + } +} \ No newline at end of file diff --git a/src/libs/Mubert/Generated/Mubert.ServiceClient.g.cs b/src/libs/Mubert/Generated/Mubert.ServiceClient.g.cs index d43d579..e0cf24b 100644 --- a/src/libs/Mubert/Generated/Mubert.ServiceClient.g.cs +++ b/src/libs/Mubert/Generated/Mubert.ServiceClient.g.cs @@ -35,7 +35,7 @@ public sealed partial class ServiceClient : global::Mubert.IServiceClient, globa /// public global::Mubert.AutoSDKClientOptions Options { get; } - internal global::System.Lazy JsonSerializerContextProvider { get; set; } = new(() => global::Mubert.SourceGenerationContext.Default); + internal global::System.Lazy JsonSerializerContextProvider { get; set; } = new(() => global::Mubert.ServiceSourceGenerationContext.Default); /// ///