diff --git a/src/libs/GroundX/Generated/GroundX.BucketsClient.BucketCreate.g.cs b/src/libs/GroundX/Generated/GroundX.BucketsClient.BucketCreate.g.cs index cc0f89f..cb10380 100644 --- a/src/libs/GroundX/Generated/GroundX.BucketsClient.BucketCreate.g.cs +++ b/src/libs/GroundX/Generated/GroundX.BucketsClient.BucketCreate.g.cs @@ -5,6 +5,25 @@ namespace GroundX { public partial class BucketsClient { + + + private static readonly global::GroundX.EndPointSecurityRequirement s_BucketCreateSecurityRequirement0 = + new global::GroundX.EndPointSecurityRequirement + { + Authorizations = new global::GroundX.EndPointAuthorizationRequirement[] + { new global::GroundX.EndPointAuthorizationRequirement + { + Type = "ApiKey", + Location = "Header", + Name = "X-API-Key", + FriendlyName = "ApiKeyInHeader", + }, + }, + }; + private static readonly global::GroundX.EndPointSecurityRequirement[] s_BucketCreateSecurityRequirements = + new global::GroundX.EndPointSecurityRequirement[] + { s_BucketCreateSecurityRequirement0, + }; partial void PrepareBucketCreateArguments( global::System.Net.Http.HttpClient httpClient, global::GroundX.BucketCreateRequest request); @@ -42,9 +61,15 @@ partial void ProcessBucketCreateResponseContent( httpClient: HttpClient, request: request); + + var __authorizations = global::GroundX.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_BucketCreateSecurityRequirements, + operationName: "BucketCreateAsync"); + var __pathBuilder = new global::GroundX.PathBuilder( path: "/v1/bucket", - baseUri: HttpClient.BaseAddress); + baseUri: HttpClient.BaseAddress); var __path = __pathBuilder.ToString(); using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( method: global::System.Net.Http.HttpMethod.Post, @@ -54,7 +79,7 @@ partial void ProcessBucketCreateResponseContent( __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; #endif - foreach (var __authorization in Authorizations) + foreach (var __authorization in __authorizations) { if (__authorization.Type == "Http" || __authorization.Type == "OAuth2") diff --git a/src/libs/GroundX/Generated/GroundX.BucketsClient.BucketDelete.g.cs b/src/libs/GroundX/Generated/GroundX.BucketsClient.BucketDelete.g.cs index 61a0bbd..2016c12 100644 --- a/src/libs/GroundX/Generated/GroundX.BucketsClient.BucketDelete.g.cs +++ b/src/libs/GroundX/Generated/GroundX.BucketsClient.BucketDelete.g.cs @@ -5,6 +5,25 @@ namespace GroundX { public partial class BucketsClient { + + + private static readonly global::GroundX.EndPointSecurityRequirement s_BucketDeleteSecurityRequirement0 = + new global::GroundX.EndPointSecurityRequirement + { + Authorizations = new global::GroundX.EndPointAuthorizationRequirement[] + { new global::GroundX.EndPointAuthorizationRequirement + { + Type = "ApiKey", + Location = "Header", + Name = "X-API-Key", + FriendlyName = "ApiKeyInHeader", + }, + }, + }; + private static readonly global::GroundX.EndPointSecurityRequirement[] s_BucketDeleteSecurityRequirements = + new global::GroundX.EndPointSecurityRequirement[] + { s_BucketDeleteSecurityRequirement0, + }; partial void PrepareBucketDeleteArguments( global::System.Net.Http.HttpClient httpClient, ref int bucketId); @@ -39,9 +58,15 @@ partial void ProcessBucketDeleteResponseContent( httpClient: HttpClient, bucketId: ref bucketId); + + var __authorizations = global::GroundX.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_BucketDeleteSecurityRequirements, + operationName: "BucketDeleteAsync"); + var __pathBuilder = new global::GroundX.PathBuilder( path: $"/v1/bucket/{bucketId}", - baseUri: HttpClient.BaseAddress); + baseUri: HttpClient.BaseAddress); var __path = __pathBuilder.ToString(); using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( method: global::System.Net.Http.HttpMethod.Delete, @@ -51,7 +76,7 @@ partial void ProcessBucketDeleteResponseContent( __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; #endif - foreach (var __authorization in Authorizations) + foreach (var __authorization in __authorizations) { if (__authorization.Type == "Http" || __authorization.Type == "OAuth2") diff --git a/src/libs/GroundX/Generated/GroundX.BucketsClient.BucketGet.g.cs b/src/libs/GroundX/Generated/GroundX.BucketsClient.BucketGet.g.cs index 8ebf724..2bbe271 100644 --- a/src/libs/GroundX/Generated/GroundX.BucketsClient.BucketGet.g.cs +++ b/src/libs/GroundX/Generated/GroundX.BucketsClient.BucketGet.g.cs @@ -5,6 +5,25 @@ namespace GroundX { public partial class BucketsClient { + + + private static readonly global::GroundX.EndPointSecurityRequirement s_BucketGetSecurityRequirement0 = + new global::GroundX.EndPointSecurityRequirement + { + Authorizations = new global::GroundX.EndPointAuthorizationRequirement[] + { new global::GroundX.EndPointAuthorizationRequirement + { + Type = "ApiKey", + Location = "Header", + Name = "X-API-Key", + FriendlyName = "ApiKeyInHeader", + }, + }, + }; + private static readonly global::GroundX.EndPointSecurityRequirement[] s_BucketGetSecurityRequirements = + new global::GroundX.EndPointSecurityRequirement[] + { s_BucketGetSecurityRequirement0, + }; partial void PrepareBucketGetArguments( global::System.Net.Http.HttpClient httpClient, ref int bucketId); @@ -39,9 +58,15 @@ partial void ProcessBucketGetResponseContent( httpClient: HttpClient, bucketId: ref bucketId); + + var __authorizations = global::GroundX.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_BucketGetSecurityRequirements, + operationName: "BucketGetAsync"); + var __pathBuilder = new global::GroundX.PathBuilder( path: $"/v1/bucket/{bucketId}", - baseUri: HttpClient.BaseAddress); + baseUri: HttpClient.BaseAddress); var __path = __pathBuilder.ToString(); using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( method: global::System.Net.Http.HttpMethod.Get, @@ -51,7 +76,7 @@ partial void ProcessBucketGetResponseContent( __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; #endif - foreach (var __authorization in Authorizations) + foreach (var __authorization in __authorizations) { if (__authorization.Type == "Http" || __authorization.Type == "OAuth2") diff --git a/src/libs/GroundX/Generated/GroundX.BucketsClient.BucketList.g.cs b/src/libs/GroundX/Generated/GroundX.BucketsClient.BucketList.g.cs index 66ccc8c..991ccb2 100644 --- a/src/libs/GroundX/Generated/GroundX.BucketsClient.BucketList.g.cs +++ b/src/libs/GroundX/Generated/GroundX.BucketsClient.BucketList.g.cs @@ -5,6 +5,25 @@ namespace GroundX { public partial class BucketsClient { + + + private static readonly global::GroundX.EndPointSecurityRequirement s_BucketListSecurityRequirement0 = + new global::GroundX.EndPointSecurityRequirement + { + Authorizations = new global::GroundX.EndPointAuthorizationRequirement[] + { new global::GroundX.EndPointAuthorizationRequirement + { + Type = "ApiKey", + Location = "Header", + Name = "X-API-Key", + FriendlyName = "ApiKeyInHeader", + }, + }, + }; + private static readonly global::GroundX.EndPointSecurityRequirement[] s_BucketListSecurityRequirements = + new global::GroundX.EndPointSecurityRequirement[] + { s_BucketListSecurityRequirement0, + }; partial void PrepareBucketListArguments( global::System.Net.Http.HttpClient httpClient, ref int? n, @@ -44,13 +63,19 @@ partial void ProcessBucketListResponseContent( n: ref n, nextToken: ref nextToken); + + var __authorizations = global::GroundX.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_BucketListSecurityRequirements, + operationName: "BucketListAsync"); + var __pathBuilder = new global::GroundX.PathBuilder( path: "/v1/bucket", baseUri: HttpClient.BaseAddress); __pathBuilder .AddOptionalParameter("n", n?.ToString()) .AddOptionalParameter("nextToken", nextToken) - ; + ; var __path = __pathBuilder.ToString(); using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( method: global::System.Net.Http.HttpMethod.Get, @@ -60,7 +85,7 @@ partial void ProcessBucketListResponseContent( __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; #endif - foreach (var __authorization in Authorizations) + foreach (var __authorization in __authorizations) { if (__authorization.Type == "Http" || __authorization.Type == "OAuth2") diff --git a/src/libs/GroundX/Generated/GroundX.BucketsClient.BucketUpdate.g.cs b/src/libs/GroundX/Generated/GroundX.BucketsClient.BucketUpdate.g.cs index fd7df53..c858090 100644 --- a/src/libs/GroundX/Generated/GroundX.BucketsClient.BucketUpdate.g.cs +++ b/src/libs/GroundX/Generated/GroundX.BucketsClient.BucketUpdate.g.cs @@ -5,6 +5,25 @@ namespace GroundX { public partial class BucketsClient { + + + private static readonly global::GroundX.EndPointSecurityRequirement s_BucketUpdateSecurityRequirement0 = + new global::GroundX.EndPointSecurityRequirement + { + Authorizations = new global::GroundX.EndPointAuthorizationRequirement[] + { new global::GroundX.EndPointAuthorizationRequirement + { + Type = "ApiKey", + Location = "Header", + Name = "X-API-Key", + FriendlyName = "ApiKeyInHeader", + }, + }, + }; + private static readonly global::GroundX.EndPointSecurityRequirement[] s_BucketUpdateSecurityRequirements = + new global::GroundX.EndPointSecurityRequirement[] + { s_BucketUpdateSecurityRequirement0, + }; partial void PrepareBucketUpdateArguments( global::System.Net.Http.HttpClient httpClient, ref int bucketId, @@ -47,9 +66,15 @@ partial void ProcessBucketUpdateResponseContent( bucketId: ref bucketId, request: request); + + var __authorizations = global::GroundX.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_BucketUpdateSecurityRequirements, + operationName: "BucketUpdateAsync"); + var __pathBuilder = new global::GroundX.PathBuilder( path: $"/v1/bucket/{bucketId}", - baseUri: HttpClient.BaseAddress); + baseUri: HttpClient.BaseAddress); var __path = __pathBuilder.ToString(); using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( method: global::System.Net.Http.HttpMethod.Put, @@ -59,7 +84,7 @@ partial void ProcessBucketUpdateResponseContent( __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; #endif - foreach (var __authorization in Authorizations) + foreach (var __authorization in __authorizations) { if (__authorization.Type == "Http" || __authorization.Type == "OAuth2") diff --git a/src/libs/GroundX/Generated/GroundX.CustomerClient.CustomerGet.g.cs b/src/libs/GroundX/Generated/GroundX.CustomerClient.CustomerGet.g.cs index 3799e28..c143e6a 100644 --- a/src/libs/GroundX/Generated/GroundX.CustomerClient.CustomerGet.g.cs +++ b/src/libs/GroundX/Generated/GroundX.CustomerClient.CustomerGet.g.cs @@ -5,6 +5,25 @@ namespace GroundX { public partial class CustomerClient { + + + private static readonly global::GroundX.EndPointSecurityRequirement s_CustomerGetSecurityRequirement0 = + new global::GroundX.EndPointSecurityRequirement + { + Authorizations = new global::GroundX.EndPointAuthorizationRequirement[] + { new global::GroundX.EndPointAuthorizationRequirement + { + Type = "ApiKey", + Location = "Header", + Name = "X-API-Key", + FriendlyName = "ApiKeyInHeader", + }, + }, + }; + private static readonly global::GroundX.EndPointSecurityRequirement[] s_CustomerGetSecurityRequirements = + new global::GroundX.EndPointSecurityRequirement[] + { s_CustomerGetSecurityRequirement0, + }; partial void PrepareCustomerGetArguments( global::System.Net.Http.HttpClient httpClient); partial void PrepareCustomerGetRequest( @@ -33,9 +52,15 @@ partial void ProcessCustomerGetResponseContent( PrepareCustomerGetArguments( httpClient: HttpClient); + + var __authorizations = global::GroundX.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_CustomerGetSecurityRequirements, + operationName: "CustomerGetAsync"); + var __pathBuilder = new global::GroundX.PathBuilder( path: "/v1/customer", - baseUri: HttpClient.BaseAddress); + baseUri: HttpClient.BaseAddress); var __path = __pathBuilder.ToString(); using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( method: global::System.Net.Http.HttpMethod.Get, @@ -45,7 +70,7 @@ partial void ProcessCustomerGetResponseContent( __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; #endif - foreach (var __authorization in Authorizations) + foreach (var __authorization in __authorizations) { if (__authorization.Type == "Http" || __authorization.Type == "OAuth2") diff --git a/src/libs/GroundX/Generated/GroundX.DocumentsClient.DocumentCrawlWebsite.g.cs b/src/libs/GroundX/Generated/GroundX.DocumentsClient.DocumentCrawlWebsite.g.cs index 2763798..53ac485 100644 --- a/src/libs/GroundX/Generated/GroundX.DocumentsClient.DocumentCrawlWebsite.g.cs +++ b/src/libs/GroundX/Generated/GroundX.DocumentsClient.DocumentCrawlWebsite.g.cs @@ -5,6 +5,25 @@ namespace GroundX { public partial class DocumentsClient { + + + private static readonly global::GroundX.EndPointSecurityRequirement s_DocumentCrawlWebsiteSecurityRequirement0 = + new global::GroundX.EndPointSecurityRequirement + { + Authorizations = new global::GroundX.EndPointAuthorizationRequirement[] + { new global::GroundX.EndPointAuthorizationRequirement + { + Type = "ApiKey", + Location = "Header", + Name = "X-API-Key", + FriendlyName = "ApiKeyInHeader", + }, + }, + }; + private static readonly global::GroundX.EndPointSecurityRequirement[] s_DocumentCrawlWebsiteSecurityRequirements = + new global::GroundX.EndPointSecurityRequirement[] + { s_DocumentCrawlWebsiteSecurityRequirement0, + }; partial void PrepareDocumentCrawlWebsiteArguments( global::System.Net.Http.HttpClient httpClient, global::GroundX.WebsiteCrawlRequest request); @@ -42,9 +61,15 @@ partial void ProcessDocumentCrawlWebsiteResponseContent( httpClient: HttpClient, request: request); + + var __authorizations = global::GroundX.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_DocumentCrawlWebsiteSecurityRequirements, + operationName: "DocumentCrawlWebsiteAsync"); + var __pathBuilder = new global::GroundX.PathBuilder( path: "/v1/ingest/documents/website", - baseUri: HttpClient.BaseAddress); + baseUri: HttpClient.BaseAddress); var __path = __pathBuilder.ToString(); using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( method: global::System.Net.Http.HttpMethod.Post, @@ -54,7 +79,7 @@ partial void ProcessDocumentCrawlWebsiteResponseContent( __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; #endif - foreach (var __authorization in Authorizations) + foreach (var __authorization in __authorizations) { if (__authorization.Type == "Http" || __authorization.Type == "OAuth2") diff --git a/src/libs/GroundX/Generated/GroundX.DocumentsClient.DocumentDelete1.g.cs b/src/libs/GroundX/Generated/GroundX.DocumentsClient.DocumentDelete1.g.cs index 9eb76a2..9febcbf 100644 --- a/src/libs/GroundX/Generated/GroundX.DocumentsClient.DocumentDelete1.g.cs +++ b/src/libs/GroundX/Generated/GroundX.DocumentsClient.DocumentDelete1.g.cs @@ -5,6 +5,25 @@ namespace GroundX { public partial class DocumentsClient { + + + private static readonly global::GroundX.EndPointSecurityRequirement s_DocumentDelete1SecurityRequirement0 = + new global::GroundX.EndPointSecurityRequirement + { + Authorizations = new global::GroundX.EndPointAuthorizationRequirement[] + { new global::GroundX.EndPointAuthorizationRequirement + { + Type = "ApiKey", + Location = "Header", + Name = "X-API-Key", + FriendlyName = "ApiKeyInHeader", + }, + }, + }; + private static readonly global::GroundX.EndPointSecurityRequirement[] s_DocumentDelete1SecurityRequirements = + new global::GroundX.EndPointSecurityRequirement[] + { s_DocumentDelete1SecurityRequirement0, + }; partial void PrepareDocumentDelete1Arguments( global::System.Net.Http.HttpClient httpClient, ref global::System.Guid documentId); @@ -39,9 +58,15 @@ partial void ProcessDocumentDelete1ResponseContent( httpClient: HttpClient, documentId: ref documentId); + + var __authorizations = global::GroundX.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_DocumentDelete1SecurityRequirements, + operationName: "DocumentDelete1Async"); + var __pathBuilder = new global::GroundX.PathBuilder( path: $"/v1/ingest/document/{documentId}", - baseUri: HttpClient.BaseAddress); + baseUri: HttpClient.BaseAddress); var __path = __pathBuilder.ToString(); using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( method: global::System.Net.Http.HttpMethod.Delete, @@ -51,7 +76,7 @@ partial void ProcessDocumentDelete1ResponseContent( __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; #endif - foreach (var __authorization in Authorizations) + foreach (var __authorization in __authorizations) { if (__authorization.Type == "Http" || __authorization.Type == "OAuth2") diff --git a/src/libs/GroundX/Generated/GroundX.DocumentsClient.DocumentGet.g.cs b/src/libs/GroundX/Generated/GroundX.DocumentsClient.DocumentGet.g.cs index 409ff66..1c099c9 100644 --- a/src/libs/GroundX/Generated/GroundX.DocumentsClient.DocumentGet.g.cs +++ b/src/libs/GroundX/Generated/GroundX.DocumentsClient.DocumentGet.g.cs @@ -5,6 +5,25 @@ namespace GroundX { public partial class DocumentsClient { + + + private static readonly global::GroundX.EndPointSecurityRequirement s_DocumentGetSecurityRequirement0 = + new global::GroundX.EndPointSecurityRequirement + { + Authorizations = new global::GroundX.EndPointAuthorizationRequirement[] + { new global::GroundX.EndPointAuthorizationRequirement + { + Type = "ApiKey", + Location = "Header", + Name = "X-API-Key", + FriendlyName = "ApiKeyInHeader", + }, + }, + }; + private static readonly global::GroundX.EndPointSecurityRequirement[] s_DocumentGetSecurityRequirements = + new global::GroundX.EndPointSecurityRequirement[] + { s_DocumentGetSecurityRequirement0, + }; partial void PrepareDocumentGetArguments( global::System.Net.Http.HttpClient httpClient, ref global::System.Guid documentId); @@ -39,9 +58,15 @@ partial void ProcessDocumentGetResponseContent( httpClient: HttpClient, documentId: ref documentId); + + var __authorizations = global::GroundX.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_DocumentGetSecurityRequirements, + operationName: "DocumentGetAsync"); + var __pathBuilder = new global::GroundX.PathBuilder( path: $"/v1/ingest/document/{documentId}", - baseUri: HttpClient.BaseAddress); + baseUri: HttpClient.BaseAddress); var __path = __pathBuilder.ToString(); using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( method: global::System.Net.Http.HttpMethod.Get, @@ -51,7 +76,7 @@ partial void ProcessDocumentGetResponseContent( __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; #endif - foreach (var __authorization in Authorizations) + foreach (var __authorization in __authorizations) { if (__authorization.Type == "Http" || __authorization.Type == "OAuth2") diff --git a/src/libs/GroundX/Generated/GroundX.DocumentsClient.DocumentGetProcessingStatusById.g.cs b/src/libs/GroundX/Generated/GroundX.DocumentsClient.DocumentGetProcessingStatusById.g.cs index ee2d3df..5d506fe 100644 --- a/src/libs/GroundX/Generated/GroundX.DocumentsClient.DocumentGetProcessingStatusById.g.cs +++ b/src/libs/GroundX/Generated/GroundX.DocumentsClient.DocumentGetProcessingStatusById.g.cs @@ -5,6 +5,25 @@ namespace GroundX { public partial class DocumentsClient { + + + private static readonly global::GroundX.EndPointSecurityRequirement s_DocumentGetProcessingStatusByIdSecurityRequirement0 = + new global::GroundX.EndPointSecurityRequirement + { + Authorizations = new global::GroundX.EndPointAuthorizationRequirement[] + { new global::GroundX.EndPointAuthorizationRequirement + { + Type = "ApiKey", + Location = "Header", + Name = "X-API-Key", + FriendlyName = "ApiKeyInHeader", + }, + }, + }; + private static readonly global::GroundX.EndPointSecurityRequirement[] s_DocumentGetProcessingStatusByIdSecurityRequirements = + new global::GroundX.EndPointSecurityRequirement[] + { s_DocumentGetProcessingStatusByIdSecurityRequirement0, + }; partial void PrepareDocumentGetProcessingStatusByIdArguments( global::System.Net.Http.HttpClient httpClient, ref global::System.Guid processId); @@ -39,9 +58,15 @@ partial void ProcessDocumentGetProcessingStatusByIdResponseContent( httpClient: HttpClient, processId: ref processId); + + var __authorizations = global::GroundX.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_DocumentGetProcessingStatusByIdSecurityRequirements, + operationName: "DocumentGetProcessingStatusByIdAsync"); + var __pathBuilder = new global::GroundX.PathBuilder( path: $"/v1/ingest/{processId}", - baseUri: HttpClient.BaseAddress); + baseUri: HttpClient.BaseAddress); var __path = __pathBuilder.ToString(); using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( method: global::System.Net.Http.HttpMethod.Get, @@ -51,7 +76,7 @@ partial void ProcessDocumentGetProcessingStatusByIdResponseContent( __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; #endif - foreach (var __authorization in Authorizations) + foreach (var __authorization in __authorizations) { if (__authorization.Type == "Http" || __authorization.Type == "OAuth2") diff --git a/src/libs/GroundX/Generated/GroundX.DocumentsClient.DocumentIngestLocal.g.cs b/src/libs/GroundX/Generated/GroundX.DocumentsClient.DocumentIngestLocal.g.cs index 8e4b4a8..7c8af7b 100644 --- a/src/libs/GroundX/Generated/GroundX.DocumentsClient.DocumentIngestLocal.g.cs +++ b/src/libs/GroundX/Generated/GroundX.DocumentsClient.DocumentIngestLocal.g.cs @@ -5,6 +5,25 @@ namespace GroundX { public partial class DocumentsClient { + + + private static readonly global::GroundX.EndPointSecurityRequirement s_DocumentIngestLocalSecurityRequirement0 = + new global::GroundX.EndPointSecurityRequirement + { + Authorizations = new global::GroundX.EndPointAuthorizationRequirement[] + { new global::GroundX.EndPointAuthorizationRequirement + { + Type = "ApiKey", + Location = "Header", + Name = "X-API-Key", + FriendlyName = "ApiKeyInHeader", + }, + }, + }; + private static readonly global::GroundX.EndPointSecurityRequirement[] s_DocumentIngestLocalSecurityRequirements = + new global::GroundX.EndPointSecurityRequirement[] + { s_DocumentIngestLocalSecurityRequirement0, + }; partial void PrepareDocumentIngestLocalArguments( global::System.Net.Http.HttpClient httpClient, global::System.Collections.Generic.IList request); @@ -42,9 +61,15 @@ partial void ProcessDocumentIngestLocalResponseContent( httpClient: HttpClient, request: request); + + var __authorizations = global::GroundX.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_DocumentIngestLocalSecurityRequirements, + operationName: "DocumentIngestLocalAsync"); + var __pathBuilder = new global::GroundX.PathBuilder( path: "/v1/ingest/documents/local", - baseUri: HttpClient.BaseAddress); + baseUri: HttpClient.BaseAddress); var __path = __pathBuilder.ToString(); using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( method: global::System.Net.Http.HttpMethod.Post, @@ -54,7 +79,7 @@ partial void ProcessDocumentIngestLocalResponseContent( __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; #endif - foreach (var __authorization in Authorizations) + foreach (var __authorization in __authorizations) { if (__authorization.Type == "Http" || __authorization.Type == "OAuth2") diff --git a/src/libs/GroundX/Generated/GroundX.DocumentsClient.DocumentIngestRemote.g.cs b/src/libs/GroundX/Generated/GroundX.DocumentsClient.DocumentIngestRemote.g.cs index d3aaf5e..1c46b1e 100644 --- a/src/libs/GroundX/Generated/GroundX.DocumentsClient.DocumentIngestRemote.g.cs +++ b/src/libs/GroundX/Generated/GroundX.DocumentsClient.DocumentIngestRemote.g.cs @@ -5,6 +5,25 @@ namespace GroundX { public partial class DocumentsClient { + + + private static readonly global::GroundX.EndPointSecurityRequirement s_DocumentIngestRemoteSecurityRequirement0 = + new global::GroundX.EndPointSecurityRequirement + { + Authorizations = new global::GroundX.EndPointAuthorizationRequirement[] + { new global::GroundX.EndPointAuthorizationRequirement + { + Type = "ApiKey", + Location = "Header", + Name = "X-API-Key", + FriendlyName = "ApiKeyInHeader", + }, + }, + }; + private static readonly global::GroundX.EndPointSecurityRequirement[] s_DocumentIngestRemoteSecurityRequirements = + new global::GroundX.EndPointSecurityRequirement[] + { s_DocumentIngestRemoteSecurityRequirement0, + }; partial void PrepareDocumentIngestRemoteArguments( global::System.Net.Http.HttpClient httpClient, global::GroundX.DocumentRemoteIngestRequest request); @@ -42,9 +61,15 @@ partial void ProcessDocumentIngestRemoteResponseContent( httpClient: HttpClient, request: request); + + var __authorizations = global::GroundX.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_DocumentIngestRemoteSecurityRequirements, + operationName: "DocumentIngestRemoteAsync"); + var __pathBuilder = new global::GroundX.PathBuilder( path: "/v1/ingest/documents/remote", - baseUri: HttpClient.BaseAddress); + baseUri: HttpClient.BaseAddress); var __path = __pathBuilder.ToString(); using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( method: global::System.Net.Http.HttpMethod.Post, @@ -54,7 +79,7 @@ partial void ProcessDocumentIngestRemoteResponseContent( __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; #endif - foreach (var __authorization in Authorizations) + foreach (var __authorization in __authorizations) { if (__authorization.Type == "Http" || __authorization.Type == "OAuth2") diff --git a/src/libs/GroundX/Generated/GroundX.DocumentsClient.DocumentList.g.cs b/src/libs/GroundX/Generated/GroundX.DocumentsClient.DocumentList.g.cs index abd22c0..be0cc46 100644 --- a/src/libs/GroundX/Generated/GroundX.DocumentsClient.DocumentList.g.cs +++ b/src/libs/GroundX/Generated/GroundX.DocumentsClient.DocumentList.g.cs @@ -5,6 +5,25 @@ namespace GroundX { public partial class DocumentsClient { + + + private static readonly global::GroundX.EndPointSecurityRequirement s_DocumentListSecurityRequirement0 = + new global::GroundX.EndPointSecurityRequirement + { + Authorizations = new global::GroundX.EndPointAuthorizationRequirement[] + { new global::GroundX.EndPointAuthorizationRequirement + { + Type = "ApiKey", + Location = "Header", + Name = "X-API-Key", + FriendlyName = "ApiKeyInHeader", + }, + }, + }; + private static readonly global::GroundX.EndPointSecurityRequirement[] s_DocumentListSecurityRequirements = + new global::GroundX.EndPointSecurityRequirement[] + { s_DocumentListSecurityRequirement0, + }; partial void PrepareDocumentListArguments( global::System.Net.Http.HttpClient httpClient, ref int? n, @@ -68,6 +87,12 @@ partial void ProcessDocumentListResponseContent( status: ref status, nextToken: ref nextToken); + + var __authorizations = global::GroundX.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_DocumentListSecurityRequirements, + operationName: "DocumentListAsync"); + var __pathBuilder = new global::GroundX.PathBuilder( path: "/v1/ingest/documents", baseUri: HttpClient.BaseAddress); @@ -78,7 +103,7 @@ partial void ProcessDocumentListResponseContent( .AddOptionalParameter("sortOrder", sortOrder?.ToValueString()) .AddOptionalParameter("status", status?.ToValueString()) .AddOptionalParameter("nextToken", nextToken) - ; + ; var __path = __pathBuilder.ToString(); using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( method: global::System.Net.Http.HttpMethod.Get, @@ -88,7 +113,7 @@ partial void ProcessDocumentListResponseContent( __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; #endif - foreach (var __authorization in Authorizations) + foreach (var __authorization in __authorizations) { if (__authorization.Type == "Http" || __authorization.Type == "OAuth2") diff --git a/src/libs/GroundX/Generated/GroundX.DocumentsClient.DocumentLookup.g.cs b/src/libs/GroundX/Generated/GroundX.DocumentsClient.DocumentLookup.g.cs index 46be548..059ddd5 100644 --- a/src/libs/GroundX/Generated/GroundX.DocumentsClient.DocumentLookup.g.cs +++ b/src/libs/GroundX/Generated/GroundX.DocumentsClient.DocumentLookup.g.cs @@ -5,6 +5,25 @@ namespace GroundX { public partial class DocumentsClient { + + + private static readonly global::GroundX.EndPointSecurityRequirement s_DocumentLookupSecurityRequirement0 = + new global::GroundX.EndPointSecurityRequirement + { + Authorizations = new global::GroundX.EndPointAuthorizationRequirement[] + { new global::GroundX.EndPointAuthorizationRequirement + { + Type = "ApiKey", + Location = "Header", + Name = "X-API-Key", + FriendlyName = "ApiKeyInHeader", + }, + }, + }; + private static readonly global::GroundX.EndPointSecurityRequirement[] s_DocumentLookupSecurityRequirements = + new global::GroundX.EndPointSecurityRequirement[] + { s_DocumentLookupSecurityRequirement0, + }; partial void PrepareDocumentLookupArguments( global::System.Net.Http.HttpClient httpClient, ref int id, @@ -73,6 +92,12 @@ partial void ProcessDocumentLookupResponseContent( status: ref status, nextToken: ref nextToken); + + var __authorizations = global::GroundX.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_DocumentLookupSecurityRequirements, + operationName: "DocumentLookupAsync"); + var __pathBuilder = new global::GroundX.PathBuilder( path: $"/v1/ingest/documents/{id}", baseUri: HttpClient.BaseAddress); @@ -83,7 +108,7 @@ partial void ProcessDocumentLookupResponseContent( .AddOptionalParameter("sortOrder", sortOrder?.ToValueString()) .AddOptionalParameter("status", status?.ToValueString()) .AddOptionalParameter("nextToken", nextToken) - ; + ; var __path = __pathBuilder.ToString(); using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( method: global::System.Net.Http.HttpMethod.Get, @@ -93,7 +118,7 @@ partial void ProcessDocumentLookupResponseContent( __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; #endif - foreach (var __authorization in Authorizations) + foreach (var __authorization in __authorizations) { if (__authorization.Type == "Http" || __authorization.Type == "OAuth2") diff --git a/src/libs/GroundX/Generated/GroundX.DocumentsClient.DocumentsDelete.g.cs b/src/libs/GroundX/Generated/GroundX.DocumentsClient.DocumentsDelete.g.cs index df445cf..dd3d946 100644 --- a/src/libs/GroundX/Generated/GroundX.DocumentsClient.DocumentsDelete.g.cs +++ b/src/libs/GroundX/Generated/GroundX.DocumentsClient.DocumentsDelete.g.cs @@ -5,6 +5,25 @@ namespace GroundX { public partial class DocumentsClient { + + + private static readonly global::GroundX.EndPointSecurityRequirement s_DocumentsDeleteSecurityRequirement0 = + new global::GroundX.EndPointSecurityRequirement + { + Authorizations = new global::GroundX.EndPointAuthorizationRequirement[] + { new global::GroundX.EndPointAuthorizationRequirement + { + Type = "ApiKey", + Location = "Header", + Name = "X-API-Key", + FriendlyName = "ApiKeyInHeader", + }, + }, + }; + private static readonly global::GroundX.EndPointSecurityRequirement[] s_DocumentsDeleteSecurityRequirements = + new global::GroundX.EndPointSecurityRequirement[] + { s_DocumentsDeleteSecurityRequirement0, + }; partial void PrepareDocumentsDeleteArguments( global::System.Net.Http.HttpClient httpClient, global::System.Collections.Generic.IList documentIds); @@ -39,12 +58,18 @@ partial void ProcessDocumentsDeleteResponseContent( httpClient: HttpClient, documentIds: documentIds); + + var __authorizations = global::GroundX.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_DocumentsDeleteSecurityRequirements, + operationName: "DocumentsDeleteAsync"); + var __pathBuilder = new global::GroundX.PathBuilder( path: "/v1/ingest/documents", baseUri: HttpClient.BaseAddress); __pathBuilder .AddRequiredParameter("documentIds", documentIds, selector: static x => x.ToString()!, delimiter: ",", explode: false) - ; + ; var __path = __pathBuilder.ToString(); using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( method: global::System.Net.Http.HttpMethod.Delete, @@ -54,7 +79,7 @@ partial void ProcessDocumentsDeleteResponseContent( __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; #endif - foreach (var __authorization in Authorizations) + foreach (var __authorization in __authorizations) { if (__authorization.Type == "Http" || __authorization.Type == "OAuth2") diff --git a/src/libs/GroundX/Generated/GroundX.GroundXClient.Authorizations.ApiKeyInHeader.g.cs b/src/libs/GroundX/Generated/GroundX.GroundXClient.Authorizations.ApiKeyInHeader.g.cs index 7e33844..b0f2c39 100644 --- a/src/libs/GroundX/Generated/GroundX.GroundXClient.Authorizations.ApiKeyInHeader.g.cs +++ b/src/libs/GroundX/Generated/GroundX.GroundXClient.Authorizations.ApiKeyInHeader.g.cs @@ -5,13 +5,24 @@ namespace GroundX { public sealed partial class GroundXClient { + /// public void AuthorizeUsingApiKeyInHeader( string apiKey) { apiKey = apiKey ?? throw new global::System.ArgumentNullException(nameof(apiKey)); - Authorizations.Clear(); + for (var i = Authorizations.Count - 1; i >= 0; i--) + { + var __authorization = Authorizations[i]; + if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header" && + __authorization.Name == "X-API-Key") + { + Authorizations.RemoveAt(i); + } + } + Authorizations.Add(new global::GroundX.EndPointAuthorization { Type = "ApiKey", diff --git a/src/libs/GroundX/Generated/GroundX.GroundXClient.Constructors.ApiKeyInHeader.g.cs b/src/libs/GroundX/Generated/GroundX.GroundXClient.Constructors.ApiKeyInHeader.g.cs index fcb796f..2f536a1 100644 --- a/src/libs/GroundX/Generated/GroundX.GroundXClient.Constructors.ApiKeyInHeader.g.cs +++ b/src/libs/GroundX/Generated/GroundX.GroundXClient.Constructors.ApiKeyInHeader.g.cs @@ -6,6 +6,7 @@ namespace GroundX public sealed partial class GroundXClient { /// + public GroundXClient( string apiKey, global::System.Net.Http.HttpClient? httpClient = null, diff --git a/src/libs/GroundX/Generated/GroundX.GroupsClient.GroupAddBucket.g.cs b/src/libs/GroundX/Generated/GroundX.GroupsClient.GroupAddBucket.g.cs index fd696bf..a7fc5cc 100644 --- a/src/libs/GroundX/Generated/GroundX.GroupsClient.GroupAddBucket.g.cs +++ b/src/libs/GroundX/Generated/GroundX.GroupsClient.GroupAddBucket.g.cs @@ -5,6 +5,25 @@ namespace GroundX { public partial class GroupsClient { + + + private static readonly global::GroundX.EndPointSecurityRequirement s_GroupAddBucketSecurityRequirement0 = + new global::GroundX.EndPointSecurityRequirement + { + Authorizations = new global::GroundX.EndPointAuthorizationRequirement[] + { new global::GroundX.EndPointAuthorizationRequirement + { + Type = "ApiKey", + Location = "Header", + Name = "X-API-Key", + FriendlyName = "ApiKeyInHeader", + }, + }, + }; + private static readonly global::GroundX.EndPointSecurityRequirement[] s_GroupAddBucketSecurityRequirements = + new global::GroundX.EndPointSecurityRequirement[] + { s_GroupAddBucketSecurityRequirement0, + }; partial void PrepareGroupAddBucketArguments( global::System.Net.Http.HttpClient httpClient, ref int groupId, @@ -44,9 +63,15 @@ partial void ProcessGroupAddBucketResponseContent( groupId: ref groupId, bucketId: ref bucketId); + + var __authorizations = global::GroundX.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_GroupAddBucketSecurityRequirements, + operationName: "GroupAddBucketAsync"); + var __pathBuilder = new global::GroundX.PathBuilder( path: $"/v1/group/{groupId}/bucket/{bucketId}", - baseUri: HttpClient.BaseAddress); + baseUri: HttpClient.BaseAddress); var __path = __pathBuilder.ToString(); using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( method: global::System.Net.Http.HttpMethod.Post, @@ -56,7 +81,7 @@ partial void ProcessGroupAddBucketResponseContent( __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; #endif - foreach (var __authorization in Authorizations) + foreach (var __authorization in __authorizations) { if (__authorization.Type == "Http" || __authorization.Type == "OAuth2") diff --git a/src/libs/GroundX/Generated/GroundX.GroupsClient.GroupCreate.g.cs b/src/libs/GroundX/Generated/GroundX.GroupsClient.GroupCreate.g.cs index 971854c..2e75285 100644 --- a/src/libs/GroundX/Generated/GroundX.GroupsClient.GroupCreate.g.cs +++ b/src/libs/GroundX/Generated/GroundX.GroupsClient.GroupCreate.g.cs @@ -5,6 +5,25 @@ namespace GroundX { public partial class GroupsClient { + + + private static readonly global::GroundX.EndPointSecurityRequirement s_GroupCreateSecurityRequirement0 = + new global::GroundX.EndPointSecurityRequirement + { + Authorizations = new global::GroundX.EndPointAuthorizationRequirement[] + { new global::GroundX.EndPointAuthorizationRequirement + { + Type = "ApiKey", + Location = "Header", + Name = "X-API-Key", + FriendlyName = "ApiKeyInHeader", + }, + }, + }; + private static readonly global::GroundX.EndPointSecurityRequirement[] s_GroupCreateSecurityRequirements = + new global::GroundX.EndPointSecurityRequirement[] + { s_GroupCreateSecurityRequirement0, + }; partial void PrepareGroupCreateArguments( global::System.Net.Http.HttpClient httpClient, global::GroundX.GroupCreateRequest request); @@ -42,9 +61,15 @@ partial void ProcessGroupCreateResponseContent( httpClient: HttpClient, request: request); + + var __authorizations = global::GroundX.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_GroupCreateSecurityRequirements, + operationName: "GroupCreateAsync"); + var __pathBuilder = new global::GroundX.PathBuilder( path: "/v1/group", - baseUri: HttpClient.BaseAddress); + baseUri: HttpClient.BaseAddress); var __path = __pathBuilder.ToString(); using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( method: global::System.Net.Http.HttpMethod.Post, @@ -54,7 +79,7 @@ partial void ProcessGroupCreateResponseContent( __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; #endif - foreach (var __authorization in Authorizations) + foreach (var __authorization in __authorizations) { if (__authorization.Type == "Http" || __authorization.Type == "OAuth2") diff --git a/src/libs/GroundX/Generated/GroundX.GroupsClient.GroupDelete.g.cs b/src/libs/GroundX/Generated/GroundX.GroupsClient.GroupDelete.g.cs index 8d58d48..a227cae 100644 --- a/src/libs/GroundX/Generated/GroundX.GroupsClient.GroupDelete.g.cs +++ b/src/libs/GroundX/Generated/GroundX.GroupsClient.GroupDelete.g.cs @@ -5,6 +5,25 @@ namespace GroundX { public partial class GroupsClient { + + + private static readonly global::GroundX.EndPointSecurityRequirement s_GroupDeleteSecurityRequirement0 = + new global::GroundX.EndPointSecurityRequirement + { + Authorizations = new global::GroundX.EndPointAuthorizationRequirement[] + { new global::GroundX.EndPointAuthorizationRequirement + { + Type = "ApiKey", + Location = "Header", + Name = "X-API-Key", + FriendlyName = "ApiKeyInHeader", + }, + }, + }; + private static readonly global::GroundX.EndPointSecurityRequirement[] s_GroupDeleteSecurityRequirements = + new global::GroundX.EndPointSecurityRequirement[] + { s_GroupDeleteSecurityRequirement0, + }; partial void PrepareGroupDeleteArguments( global::System.Net.Http.HttpClient httpClient, ref int groupId); @@ -39,9 +58,15 @@ partial void ProcessGroupDeleteResponseContent( httpClient: HttpClient, groupId: ref groupId); + + var __authorizations = global::GroundX.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_GroupDeleteSecurityRequirements, + operationName: "GroupDeleteAsync"); + var __pathBuilder = new global::GroundX.PathBuilder( path: $"/v1/group/{groupId}", - baseUri: HttpClient.BaseAddress); + baseUri: HttpClient.BaseAddress); var __path = __pathBuilder.ToString(); using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( method: global::System.Net.Http.HttpMethod.Delete, @@ -51,7 +76,7 @@ partial void ProcessGroupDeleteResponseContent( __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; #endif - foreach (var __authorization in Authorizations) + foreach (var __authorization in __authorizations) { if (__authorization.Type == "Http" || __authorization.Type == "OAuth2") diff --git a/src/libs/GroundX/Generated/GroundX.GroupsClient.GroupGet.g.cs b/src/libs/GroundX/Generated/GroundX.GroupsClient.GroupGet.g.cs index 6a7b9c7..fcfdcb6 100644 --- a/src/libs/GroundX/Generated/GroundX.GroupsClient.GroupGet.g.cs +++ b/src/libs/GroundX/Generated/GroundX.GroupsClient.GroupGet.g.cs @@ -5,6 +5,25 @@ namespace GroundX { public partial class GroupsClient { + + + private static readonly global::GroundX.EndPointSecurityRequirement s_GroupGetSecurityRequirement0 = + new global::GroundX.EndPointSecurityRequirement + { + Authorizations = new global::GroundX.EndPointAuthorizationRequirement[] + { new global::GroundX.EndPointAuthorizationRequirement + { + Type = "ApiKey", + Location = "Header", + Name = "X-API-Key", + FriendlyName = "ApiKeyInHeader", + }, + }, + }; + private static readonly global::GroundX.EndPointSecurityRequirement[] s_GroupGetSecurityRequirements = + new global::GroundX.EndPointSecurityRequirement[] + { s_GroupGetSecurityRequirement0, + }; partial void PrepareGroupGetArguments( global::System.Net.Http.HttpClient httpClient, ref int groupId); @@ -39,9 +58,15 @@ partial void ProcessGroupGetResponseContent( httpClient: HttpClient, groupId: ref groupId); + + var __authorizations = global::GroundX.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_GroupGetSecurityRequirements, + operationName: "GroupGetAsync"); + var __pathBuilder = new global::GroundX.PathBuilder( path: $"/v1/group/{groupId}", - baseUri: HttpClient.BaseAddress); + baseUri: HttpClient.BaseAddress); var __path = __pathBuilder.ToString(); using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( method: global::System.Net.Http.HttpMethod.Get, @@ -51,7 +76,7 @@ partial void ProcessGroupGetResponseContent( __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; #endif - foreach (var __authorization in Authorizations) + foreach (var __authorization in __authorizations) { if (__authorization.Type == "Http" || __authorization.Type == "OAuth2") diff --git a/src/libs/GroundX/Generated/GroundX.GroupsClient.GroupList.g.cs b/src/libs/GroundX/Generated/GroundX.GroupsClient.GroupList.g.cs index e855912..b4e3277 100644 --- a/src/libs/GroundX/Generated/GroundX.GroupsClient.GroupList.g.cs +++ b/src/libs/GroundX/Generated/GroundX.GroupsClient.GroupList.g.cs @@ -5,6 +5,25 @@ namespace GroundX { public partial class GroupsClient { + + + private static readonly global::GroundX.EndPointSecurityRequirement s_GroupListSecurityRequirement0 = + new global::GroundX.EndPointSecurityRequirement + { + Authorizations = new global::GroundX.EndPointAuthorizationRequirement[] + { new global::GroundX.EndPointAuthorizationRequirement + { + Type = "ApiKey", + Location = "Header", + Name = "X-API-Key", + FriendlyName = "ApiKeyInHeader", + }, + }, + }; + private static readonly global::GroundX.EndPointSecurityRequirement[] s_GroupListSecurityRequirements = + new global::GroundX.EndPointSecurityRequirement[] + { s_GroupListSecurityRequirement0, + }; partial void PrepareGroupListArguments( global::System.Net.Http.HttpClient httpClient, ref int? n, @@ -44,13 +63,19 @@ partial void ProcessGroupListResponseContent( n: ref n, nextToken: ref nextToken); + + var __authorizations = global::GroundX.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_GroupListSecurityRequirements, + operationName: "GroupListAsync"); + var __pathBuilder = new global::GroundX.PathBuilder( path: "/v1/group", baseUri: HttpClient.BaseAddress); __pathBuilder .AddOptionalParameter("n", n?.ToString()) .AddOptionalParameter("nextToken", nextToken) - ; + ; var __path = __pathBuilder.ToString(); using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( method: global::System.Net.Http.HttpMethod.Get, @@ -60,7 +85,7 @@ partial void ProcessGroupListResponseContent( __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; #endif - foreach (var __authorization in Authorizations) + foreach (var __authorization in __authorizations) { if (__authorization.Type == "Http" || __authorization.Type == "OAuth2") diff --git a/src/libs/GroundX/Generated/GroundX.GroupsClient.GroupRemoveBucket.g.cs b/src/libs/GroundX/Generated/GroundX.GroupsClient.GroupRemoveBucket.g.cs index 12abbf6..fd02657 100644 --- a/src/libs/GroundX/Generated/GroundX.GroupsClient.GroupRemoveBucket.g.cs +++ b/src/libs/GroundX/Generated/GroundX.GroupsClient.GroupRemoveBucket.g.cs @@ -5,6 +5,25 @@ namespace GroundX { public partial class GroupsClient { + + + private static readonly global::GroundX.EndPointSecurityRequirement s_GroupRemoveBucketSecurityRequirement0 = + new global::GroundX.EndPointSecurityRequirement + { + Authorizations = new global::GroundX.EndPointAuthorizationRequirement[] + { new global::GroundX.EndPointAuthorizationRequirement + { + Type = "ApiKey", + Location = "Header", + Name = "X-API-Key", + FriendlyName = "ApiKeyInHeader", + }, + }, + }; + private static readonly global::GroundX.EndPointSecurityRequirement[] s_GroupRemoveBucketSecurityRequirements = + new global::GroundX.EndPointSecurityRequirement[] + { s_GroupRemoveBucketSecurityRequirement0, + }; partial void PrepareGroupRemoveBucketArguments( global::System.Net.Http.HttpClient httpClient, ref int groupId, @@ -44,9 +63,15 @@ partial void ProcessGroupRemoveBucketResponseContent( groupId: ref groupId, bucketId: ref bucketId); + + var __authorizations = global::GroundX.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_GroupRemoveBucketSecurityRequirements, + operationName: "GroupRemoveBucketAsync"); + var __pathBuilder = new global::GroundX.PathBuilder( path: $"/v1/group/{groupId}/bucket/{bucketId}", - baseUri: HttpClient.BaseAddress); + baseUri: HttpClient.BaseAddress); var __path = __pathBuilder.ToString(); using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( method: global::System.Net.Http.HttpMethod.Delete, @@ -56,7 +81,7 @@ partial void ProcessGroupRemoveBucketResponseContent( __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; #endif - foreach (var __authorization in Authorizations) + foreach (var __authorization in __authorizations) { if (__authorization.Type == "Http" || __authorization.Type == "OAuth2") diff --git a/src/libs/GroundX/Generated/GroundX.GroupsClient.GroupUpdate.g.cs b/src/libs/GroundX/Generated/GroundX.GroupsClient.GroupUpdate.g.cs index b197b6a..be03ce6 100644 --- a/src/libs/GroundX/Generated/GroundX.GroupsClient.GroupUpdate.g.cs +++ b/src/libs/GroundX/Generated/GroundX.GroupsClient.GroupUpdate.g.cs @@ -5,6 +5,25 @@ namespace GroundX { public partial class GroupsClient { + + + private static readonly global::GroundX.EndPointSecurityRequirement s_GroupUpdateSecurityRequirement0 = + new global::GroundX.EndPointSecurityRequirement + { + Authorizations = new global::GroundX.EndPointAuthorizationRequirement[] + { new global::GroundX.EndPointAuthorizationRequirement + { + Type = "ApiKey", + Location = "Header", + Name = "X-API-Key", + FriendlyName = "ApiKeyInHeader", + }, + }, + }; + private static readonly global::GroundX.EndPointSecurityRequirement[] s_GroupUpdateSecurityRequirements = + new global::GroundX.EndPointSecurityRequirement[] + { s_GroupUpdateSecurityRequirement0, + }; partial void PrepareGroupUpdateArguments( global::System.Net.Http.HttpClient httpClient, ref int groupId, @@ -47,9 +66,15 @@ partial void ProcessGroupUpdateResponseContent( groupId: ref groupId, request: request); + + var __authorizations = global::GroundX.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_GroupUpdateSecurityRequirements, + operationName: "GroupUpdateAsync"); + var __pathBuilder = new global::GroundX.PathBuilder( path: $"/v1/group/{groupId}", - baseUri: HttpClient.BaseAddress); + baseUri: HttpClient.BaseAddress); var __path = __pathBuilder.ToString(); using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( method: global::System.Net.Http.HttpMethod.Put, @@ -59,7 +84,7 @@ partial void ProcessGroupUpdateResponseContent( __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; #endif - foreach (var __authorization in Authorizations) + foreach (var __authorization in __authorizations) { if (__authorization.Type == "Http" || __authorization.Type == "OAuth2") diff --git a/src/libs/GroundX/Generated/GroundX.HealthClient.HealthGet.g.cs b/src/libs/GroundX/Generated/GroundX.HealthClient.HealthGet.g.cs index e08685c..fd2ac84 100644 --- a/src/libs/GroundX/Generated/GroundX.HealthClient.HealthGet.g.cs +++ b/src/libs/GroundX/Generated/GroundX.HealthClient.HealthGet.g.cs @@ -5,6 +5,25 @@ namespace GroundX { public partial class HealthClient { + + + private static readonly global::GroundX.EndPointSecurityRequirement s_HealthGetSecurityRequirement0 = + new global::GroundX.EndPointSecurityRequirement + { + Authorizations = new global::GroundX.EndPointAuthorizationRequirement[] + { new global::GroundX.EndPointAuthorizationRequirement + { + Type = "ApiKey", + Location = "Header", + Name = "X-API-Key", + FriendlyName = "ApiKeyInHeader", + }, + }, + }; + private static readonly global::GroundX.EndPointSecurityRequirement[] s_HealthGetSecurityRequirements = + new global::GroundX.EndPointSecurityRequirement[] + { s_HealthGetSecurityRequirement0, + }; partial void PrepareHealthGetArguments( global::System.Net.Http.HttpClient httpClient, ref string service); @@ -38,9 +57,15 @@ partial void ProcessHealthGetResponseContent( httpClient: HttpClient, service: ref service); + + var __authorizations = global::GroundX.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_HealthGetSecurityRequirements, + operationName: "HealthGetAsync"); + var __pathBuilder = new global::GroundX.PathBuilder( path: $"/v1/health/{service}", - baseUri: HttpClient.BaseAddress); + baseUri: HttpClient.BaseAddress); var __path = __pathBuilder.ToString(); using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( method: global::System.Net.Http.HttpMethod.Get, @@ -50,7 +75,7 @@ partial void ProcessHealthGetResponseContent( __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; #endif - foreach (var __authorization in Authorizations) + foreach (var __authorization in __authorizations) { if (__authorization.Type == "Http" || __authorization.Type == "OAuth2") diff --git a/src/libs/GroundX/Generated/GroundX.HealthClient.HealthList.g.cs b/src/libs/GroundX/Generated/GroundX.HealthClient.HealthList.g.cs index c6bc298..dc3200e 100644 --- a/src/libs/GroundX/Generated/GroundX.HealthClient.HealthList.g.cs +++ b/src/libs/GroundX/Generated/GroundX.HealthClient.HealthList.g.cs @@ -5,6 +5,25 @@ namespace GroundX { public partial class HealthClient { + + + private static readonly global::GroundX.EndPointSecurityRequirement s_HealthListSecurityRequirement0 = + new global::GroundX.EndPointSecurityRequirement + { + Authorizations = new global::GroundX.EndPointAuthorizationRequirement[] + { new global::GroundX.EndPointAuthorizationRequirement + { + Type = "ApiKey", + Location = "Header", + Name = "X-API-Key", + FriendlyName = "ApiKeyInHeader", + }, + }, + }; + private static readonly global::GroundX.EndPointSecurityRequirement[] s_HealthListSecurityRequirements = + new global::GroundX.EndPointSecurityRequirement[] + { s_HealthListSecurityRequirement0, + }; partial void PrepareHealthListArguments( global::System.Net.Http.HttpClient httpClient); partial void PrepareHealthListRequest( @@ -33,9 +52,15 @@ partial void ProcessHealthListResponseContent( PrepareHealthListArguments( httpClient: HttpClient); + + var __authorizations = global::GroundX.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_HealthListSecurityRequirements, + operationName: "HealthListAsync"); + var __pathBuilder = new global::GroundX.PathBuilder( path: "/v1/health", - baseUri: HttpClient.BaseAddress); + baseUri: HttpClient.BaseAddress); var __path = __pathBuilder.ToString(); using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( method: global::System.Net.Http.HttpMethod.Get, @@ -45,7 +70,7 @@ partial void ProcessHealthListResponseContent( __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; #endif - foreach (var __authorization in Authorizations) + foreach (var __authorization in __authorizations) { if (__authorization.Type == "Http" || __authorization.Type == "OAuth2") diff --git a/src/libs/GroundX/Generated/GroundX.IGroundXClient.Authorizations.ApiKeyInHeader.g.cs b/src/libs/GroundX/Generated/GroundX.IGroundXClient.Authorizations.ApiKeyInHeader.g.cs index e0322c4..1adf718 100644 --- a/src/libs/GroundX/Generated/GroundX.IGroundXClient.Authorizations.ApiKeyInHeader.g.cs +++ b/src/libs/GroundX/Generated/GroundX.IGroundXClient.Authorizations.ApiKeyInHeader.g.cs @@ -9,6 +9,7 @@ public partial interface IGroundXClient /// Authorize using ApiKey authentication. /// /// + public void AuthorizeUsingApiKeyInHeader( string apiKey); } diff --git a/src/libs/GroundX/Generated/GroundX.PathBuilder.g.cs b/src/libs/GroundX/Generated/GroundX.PathBuilder.g.cs index a4f859f..f60ed0c 100644 --- a/src/libs/GroundX/Generated/GroundX.PathBuilder.g.cs +++ b/src/libs/GroundX/Generated/GroundX.PathBuilder.g.cs @@ -224,6 +224,40 @@ public PathBuilder AddOptionalParameter( return this; } + /// + /// Adds a pre-serialized query string fragment to the URL. + /// + /// The serialized query string value. + /// The current instance. + public PathBuilder AddRawQueryString( + string value) + { + if (string.IsNullOrWhiteSpace(value)) + { + return this; + } + + value = value.TrimStart('?', '&'); + if (value.Length == 0) + { + return this; + } + + if (_firstParameter) + { + _stringBuilder.Append('?'); + _firstParameter = false; + } + else + { + _stringBuilder.Append('&'); + } + + _stringBuilder.Append(value); + + return this; + } + /// /// Returns the constructed URL as a string. /// diff --git a/src/libs/GroundX/Generated/GroundX.SearchClient.SearchContent.g.cs b/src/libs/GroundX/Generated/GroundX.SearchClient.SearchContent.g.cs index a22da00..03f5e83 100644 --- a/src/libs/GroundX/Generated/GroundX.SearchClient.SearchContent.g.cs +++ b/src/libs/GroundX/Generated/GroundX.SearchClient.SearchContent.g.cs @@ -5,6 +5,25 @@ namespace GroundX { public partial class SearchClient { + + + private static readonly global::GroundX.EndPointSecurityRequirement s_SearchContentSecurityRequirement0 = + new global::GroundX.EndPointSecurityRequirement + { + Authorizations = new global::GroundX.EndPointAuthorizationRequirement[] + { new global::GroundX.EndPointAuthorizationRequirement + { + Type = "ApiKey", + Location = "Header", + Name = "X-API-Key", + FriendlyName = "ApiKeyInHeader", + }, + }, + }; + private static readonly global::GroundX.EndPointSecurityRequirement[] s_SearchContentSecurityRequirements = + new global::GroundX.EndPointSecurityRequirement[] + { s_SearchContentSecurityRequirement0, + }; partial void PrepareSearchContentArguments( global::System.Net.Http.HttpClient httpClient, ref global::GroundX.OneOf id, @@ -67,6 +86,12 @@ partial void ProcessSearchContentResponseContent( verbosity: ref verbosity, request: request); + + var __authorizations = global::GroundX.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_SearchContentSecurityRequirements, + operationName: "SearchContentAsync"); + var __pathBuilder = new global::GroundX.PathBuilder( path: $"/v1/search/{id}", baseUri: HttpClient.BaseAddress); @@ -74,7 +99,7 @@ partial void ProcessSearchContentResponseContent( .AddOptionalParameter("n", n?.ToString()) .AddOptionalParameter("nextToken", nextToken) .AddOptionalParameter("verbosity", verbosity?.ToString()) - ; + ; var __path = __pathBuilder.ToString(); using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( method: global::System.Net.Http.HttpMethod.Post, @@ -84,7 +109,7 @@ partial void ProcessSearchContentResponseContent( __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; #endif - foreach (var __authorization in Authorizations) + foreach (var __authorization in __authorizations) { if (__authorization.Type == "Http" || __authorization.Type == "OAuth2") diff --git a/src/libs/GroundX/Generated/GroundX.SearchClient.SearchDocuments.g.cs b/src/libs/GroundX/Generated/GroundX.SearchClient.SearchDocuments.g.cs index 3a0a38f..cecc1f8 100644 --- a/src/libs/GroundX/Generated/GroundX.SearchClient.SearchDocuments.g.cs +++ b/src/libs/GroundX/Generated/GroundX.SearchClient.SearchDocuments.g.cs @@ -5,6 +5,25 @@ namespace GroundX { public partial class SearchClient { + + + private static readonly global::GroundX.EndPointSecurityRequirement s_SearchDocumentsSecurityRequirement0 = + new global::GroundX.EndPointSecurityRequirement + { + Authorizations = new global::GroundX.EndPointAuthorizationRequirement[] + { new global::GroundX.EndPointAuthorizationRequirement + { + Type = "ApiKey", + Location = "Header", + Name = "X-API-Key", + FriendlyName = "ApiKeyInHeader", + }, + }, + }; + private static readonly global::GroundX.EndPointSecurityRequirement[] s_SearchDocumentsSecurityRequirements = + new global::GroundX.EndPointSecurityRequirement[] + { s_SearchDocumentsSecurityRequirement0, + }; partial void PrepareSearchDocumentsArguments( global::System.Net.Http.HttpClient httpClient, ref int? n, @@ -62,6 +81,12 @@ partial void ProcessSearchDocumentsResponseContent( verbosity: ref verbosity, request: request); + + var __authorizations = global::GroundX.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_SearchDocumentsSecurityRequirements, + operationName: "SearchDocumentsAsync"); + var __pathBuilder = new global::GroundX.PathBuilder( path: "/v1/search/documents", baseUri: HttpClient.BaseAddress); @@ -69,7 +94,7 @@ partial void ProcessSearchDocumentsResponseContent( .AddOptionalParameter("n", n?.ToString()) .AddOptionalParameter("nextToken", nextToken) .AddOptionalParameter("verbosity", verbosity?.ToString()) - ; + ; var __path = __pathBuilder.ToString(); using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( method: global::System.Net.Http.HttpMethod.Post, @@ -79,7 +104,7 @@ partial void ProcessSearchDocumentsResponseContent( __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; #endif - foreach (var __authorization in Authorizations) + foreach (var __authorization in __authorizations) { if (__authorization.Type == "Http" || __authorization.Type == "OAuth2") diff --git a/src/libs/GroundX/Generated/GroundX.Security.g.cs b/src/libs/GroundX/Generated/GroundX.Security.g.cs new file mode 100644 index 0000000..6a2150b --- /dev/null +++ b/src/libs/GroundX/Generated/GroundX.Security.g.cs @@ -0,0 +1,145 @@ +#nullable enable + +namespace GroundX +{ + internal sealed class EndPointAuthorizationRequirement + { + internal string Type { get; set; } = string.Empty; + + internal string Location { get; set; } = string.Empty; + + internal string Name { get; set; } = string.Empty; + + internal string FriendlyName { get; set; } = string.Empty; + } + + internal sealed class EndPointSecurityRequirement + { + internal global::System.Collections.Generic.IReadOnlyList Authorizations { get; set; } = + global::System.Array.Empty(); + } + + internal static class EndPointSecurityResolver + { + internal static global::System.Collections.Generic.List ResolveAuthorizations( + global::System.Collections.Generic.IReadOnlyList availableAuthorizations, + global::System.Collections.Generic.IReadOnlyList securityRequirements, + string operationName) + { + availableAuthorizations = availableAuthorizations ?? throw new global::System.ArgumentNullException(nameof(availableAuthorizations)); + securityRequirements = securityRequirements ?? throw new global::System.ArgumentNullException(nameof(securityRequirements)); + operationName = operationName ?? throw new global::System.ArgumentNullException(nameof(operationName)); + + if (securityRequirements.Count == 0) + { + return new global::System.Collections.Generic.List(); + } + + var allowsAnonymous = false; + + foreach (var requirement in securityRequirements) + { + if (requirement.Authorizations.Count == 0) + { + allowsAnonymous = true; + continue; + } + + var selected = new global::System.Collections.Generic.List(requirement.Authorizations.Count); + var satisfied = true; + + foreach (var requiredAuthorization in requirement.Authorizations) + { + var found = false; + + for (var i = 0; i < availableAuthorizations.Count; i++) + { + if (!Matches(availableAuthorizations[i], requiredAuthorization)) + { + continue; + } + + selected.Add(availableAuthorizations[i]); + found = true; + break; + } + + if (!found) + { + satisfied = false; + break; + } + } + + if (satisfied) + { + return selected; + } + } + + if (allowsAnonymous) + { + return new global::System.Collections.Generic.List(); + } + + throw new global::System.InvalidOperationException( + $"Operation '{operationName}' requires one of the configured security alternatives: {DescribeRequirements(securityRequirements)}."); + } + + private static bool Matches( + EndPointAuthorization availableAuthorization, + EndPointAuthorizationRequirement requiredAuthorization) + { + if (!string.Equals(availableAuthorization.Type, requiredAuthorization.Type, global::System.StringComparison.Ordinal)) + { + return false; + } + + return requiredAuthorization.Type switch + { + "OAuth2" => true, + "Http" => string.Equals( + availableAuthorization.Name, + requiredAuthorization.Name, + global::System.StringComparison.Ordinal), + "ApiKey" => string.Equals( + availableAuthorization.Location, + requiredAuthorization.Location, + global::System.StringComparison.Ordinal) && + string.Equals( + availableAuthorization.Name, + requiredAuthorization.Name, + global::System.StringComparison.Ordinal), + _ => string.Equals( + availableAuthorization.Location, + requiredAuthorization.Location, + global::System.StringComparison.Ordinal) && + string.Equals( + availableAuthorization.Name, + requiredAuthorization.Name, + global::System.StringComparison.Ordinal), + }; + } + + private static string DescribeRequirements( + global::System.Collections.Generic.IReadOnlyList securityRequirements) + { + var parts = new global::System.Collections.Generic.List(securityRequirements.Count); + + foreach (var requirement in securityRequirements) + { + if (requirement.Authorizations.Count == 0) + { + parts.Add("anonymous"); + continue; + } + + parts.Add(string.Join( + " + ", + global::System.Linq.Enumerable.Select(requirement.Authorizations, static x => x.FriendlyName))); + } + + return string.Join(" or ", parts); + } + } +} \ No newline at end of file