From 49a4d4304c7a3a6d2d76f69604c7902768754267 Mon Sep 17 00:00:00 2001 From: Junyi Ou Date: Wed, 29 Jul 2026 11:18:43 -0400 Subject: [PATCH 1/4] update openapi --- devolutions-gateway/openapi/gateway-api.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/devolutions-gateway/openapi/gateway-api.yaml b/devolutions-gateway/openapi/gateway-api.yaml index c64ef1c77..51f832347 100644 --- a/devolutions-gateway/openapi/gateway-api.yaml +++ b/devolutions-gateway/openapi/gateway-api.yaml @@ -574,9 +574,9 @@ paths: in: query description: |- The probes to run. Each value is either `ping`, a port number - (`22`), or a named service (`rdp`, `https`, …). Validation is + (`22`), or a named service (`rdp`, `https`, ΓǪ). Validation is deferred to scan-time so failures can be surfaced as a structured - 400 — naming the offending value — instead of a generic serde + 400 ΓÇö naming the offending value ΓÇö instead of a generic serde rejection at extraction time. required: false schema: @@ -724,7 +724,7 @@ paths: ping-failure and TCP-probe-failure reporting. The two are now split: clients that want the old "both at once" semantics must send `enable_failure=true&report_tcp_failure=true` together. The split is - intentional — TCP-probe failures are typically high-volume noise that + intentional ΓÇö TCP-probe failures are typically high-volume noise that callers were filtering client-side anyway, so the two streams are independently gated. required: false From 3a32e0452ff9eaa2e7f8be17f7ed06d8964d457e Mon Sep 17 00:00:00 2001 From: Junyi Ou Date: Wed, 29 Jul 2026 12:58:41 -0400 Subject: [PATCH 2/4] chore(openapi): restore UTF-8 in the generated gateway document The previous run went through a shell whose console codepage was 437, so PowerShell mangled the em dashes and ellipsis coming out of cargo. Re-ran the script from a UTF-8 console. --- devolutions-gateway/openapi/gateway-api.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/devolutions-gateway/openapi/gateway-api.yaml b/devolutions-gateway/openapi/gateway-api.yaml index 51f832347..c64ef1c77 100644 --- a/devolutions-gateway/openapi/gateway-api.yaml +++ b/devolutions-gateway/openapi/gateway-api.yaml @@ -574,9 +574,9 @@ paths: in: query description: |- The probes to run. Each value is either `ping`, a port number - (`22`), or a named service (`rdp`, `https`, ΓǪ). Validation is + (`22`), or a named service (`rdp`, `https`, …). Validation is deferred to scan-time so failures can be surfaced as a structured - 400 ΓÇö naming the offending value ΓÇö instead of a generic serde + 400 — naming the offending value — instead of a generic serde rejection at extraction time. required: false schema: @@ -724,7 +724,7 @@ paths: ping-failure and TCP-probe-failure reporting. The two are now split: clients that want the old "both at once" semantics must send `enable_failure=true&report_tcp_failure=true` together. The split is - intentional ΓÇö TCP-probe failures are typically high-volume noise that + intentional — TCP-probe failures are typically high-volume noise that callers were filtering client-side anyway, so the two streams are independently gated. required: false From 90e7c3b06ed4c8d862c71894fbd0b85f83c57e6a Mon Sep 17 00:00:00 2001 From: Junyi Ou Date: Wed, 29 Jul 2026 11:20:29 -0400 Subject: [PATCH 3/4] chore(dgw): generate openapi client --- .../openapi/doc/.openapi-generator/VERSION | 2 +- devolutions-gateway/openapi/doc/index.adoc | 1286 ++++++++++++++++- .../dotnet-client/.openapi-generator/FILES | 28 + .../dotnet-client/.openapi-generator/VERSION | 2 +- .../openapi/dotnet-client/README.md | 25 +- .../docs/GetUpdateProductsResponse.md | 12 + .../docs/GetUpdateScheduleResponse.md | 16 + .../dotnet-client/docs/HostScanStateDto.md | 9 + .../openapi/dotnet-client/docs/NetApi.md | 257 ++++ .../dotnet-client/docs/NetworkInterfaceDto.md | 18 + .../docs/NetworkInterfacesResponse.md | 10 + .../docs/NetworkScanResultEventDto.md | 23 + .../docs/NetworkScanResultKindDto.md | 9 + .../docs/NetworkScanSourceCapabilitiesDto.md | 16 + .../docs/NetworkScanSourceDto.md | 16 + .../dotnet-client/docs/PreflightOperation.md | 2 +- .../dotnet-client/docs/ScanOriginDto.md | 9 + .../dotnet-client/docs/ScanResultSourceDto.md | 9 + .../docs/SetUpdateScheduleRequest.md | 15 + .../openapi/dotnet-client/docs/UpdateApi.md | 328 ++++- .../dotnet-client/docs/UpdateProductInfo.md | 11 + .../dotnet-client/docs/UpdateRequestSchema.md | 11 + .../Api/ConfigApi.cs | 10 +- .../Api/DiagnosticsApi.cs | 26 +- .../Api/HealthApi.cs | 10 +- .../Api/HeartbeatApi.cs | 10 +- .../Devolutions.Gateway.Client/Api/JrecApi.cs | 34 +- .../Devolutions.Gateway.Client/Api/JrlApi.cs | 18 +- .../Devolutions.Gateway.Client/Api/NetApi.cs | 821 ++++++++++- .../Api/NetworkMonitoringApi.cs | 18 +- .../Api/PreflightApi.cs | 10 +- .../Api/SessionsApi.cs | 18 +- .../Api/TrafficApi.cs | 18 +- .../Api/UpdateApi.cs | 570 +++++++- .../Api/WebAppApi.cs | 18 +- .../Client/ApiClient.cs | 52 +- .../Client/ApiException.cs | 2 +- .../Client/ApiResponse.cs | 2 +- .../Client/ClientUtils.cs | 2 +- .../Client/Configuration.cs | 4 +- .../Client/ExceptionFactory.cs | 2 +- .../Client/FileParameter.cs | 2 +- .../Client/GlobalConfiguration.cs | 2 +- .../Client/IApiAccessor.cs | 2 +- .../Client/IAsynchronousClient.cs | 16 +- .../Client/IReadableConfiguration.cs | 6 +- .../Client/ISynchronousClient.cs | 2 +- .../Client/Multimap.cs | 2 +- .../Client/OpenAPIDateConverter.cs | 2 +- .../Client/RequestOptions.cs | 2 +- .../Client/RetryConfiguration.cs | 6 +- .../Client/WebRequestPathBuilder.cs | 2 +- .../Model/AbstractOpenAPISchema.cs | 2 +- .../Model/AccessScope.cs | 36 +- .../Model/AckRequest.cs | 4 +- .../Model/AckResponse.cs | 4 +- .../Model/AddressFamily.cs | 2 +- .../Model/AppCredential.cs | 4 +- .../Model/AppCredentialKind.cs | 2 +- .../Model/AppTokenContentType.cs | 2 +- .../Model/AppTokenSignRequest.cs | 4 +- .../Model/ClaimedTrafficEvent.cs | 4 +- .../Model/ClockDiagnostic.cs | 4 +- .../Model/ConfigDiagnostic.cs | 4 +- .../Model/ConfigPatch.cs | 4 +- .../Model/ConnectionMode.cs | 2 +- .../Model/DataEncoding.cs | 2 +- .../Model/DeleteManyResult.cs | 4 +- .../Model/EventOutcomeResponse.cs | 2 +- .../Model/GetUpdateProductsResponse.cs | 105 ++ .../Model/GetUpdateScheduleResponse.cs | 163 +++ .../Model/Heartbeat.cs | 4 +- .../Model/HostScanStateDto.cs | 84 ++ .../Model/Identity.cs | 4 +- .../Model/InterfaceInfo.cs | 4 +- .../Model/JrlInfo.cs | 4 +- .../Model/ListenerUrls.cs | 4 +- .../Model/MonitorDefinition.cs | 4 +- .../Model/MonitorDefinitionProbeTypeError.cs | 4 +- .../Model/MonitorResult.cs | 4 +- .../Model/MonitoringLogResponse.cs | 4 +- .../Model/MonitoringProbeType.cs | 2 +- .../Model/MonitoringProbeTypeOneOf.cs | 4 +- .../Model/MonitorsConfig.cs | 4 +- .../Model/NetworkInterfaceDto.cs | 192 +++ .../Model/NetworkInterfacesResponse.cs | 94 ++ .../Model/NetworkScanResultEventDto.cs | 223 +++ .../Model/NetworkScanResultKindDto.cs | 68 + .../Model/NetworkScanSourceCapabilitiesDto.cs | 143 ++ .../Model/NetworkScanSourceDto.cs | 174 +++ .../Model/PreflightAlertStatus.cs | 2 +- .../Model/PreflightOperation.cs | 10 +- .../Model/PreflightOperationKind.cs | 2 +- .../Model/PreflightOutput.cs | 4 +- .../Model/PreflightOutputKind.cs | 2 +- .../Model/PubKeyFormat.cs | 2 +- .../Model/ScanOriginDto.cs | 60 + .../Model/ScanResultSourceDto.cs | 92 ++ .../Model/SessionInfo.cs | 4 +- .../Model/SessionTokenContentType.cs | 2 +- .../Model/SessionTokenSignRequest.cs | 4 +- .../Model/SetConfigResponse.cs | 4 +- .../Model/SetUpdateScheduleRequest.cs | 148 ++ .../Model/SubProvisionerKey.cs | 4 +- .../Model/Subscriber.cs | 4 +- .../Model/TrafficEventResponse.cs | 4 +- .../Model/TransportProtocolResponse.cs | 2 +- .../Model/UpdateProductInfo.cs | 95 ++ .../Model/UpdateRequestSchema.cs | 85 ++ .../.openapi-generator/VERSION | 2 +- .../Attributes/ValidateModelStateAttribute.cs | 2 +- .../Authentication/ApiAuthentication.cs | 2 +- .../Controllers/SubscriberApi.cs | 2 +- .../Converters/CustomEnumConverter.cs | 2 +- .../Devolutions.Gateway.Subscriber.csproj | 50 +- .../Formatters/InputFormatterStream.cs | 2 +- .../Models/SubscriberMessage.cs | 2 +- .../Models/SubscriberMessageKind.cs | 14 +- .../Models/SubscriberSessionInfo.cs | 2 +- .../OpenApi/TypeExtensions.cs | 2 +- .../.openapi-generator/FILES | 17 + .../.openapi-generator/VERSION | 2 +- .../openapi/ts-angular-client/README.md | 237 ++- .../ts-angular-client/api.base.service.ts | 96 ++ .../ts-angular-client/api/config.service.ts | 101 +- .../api/diagnostics.service.ts | 169 +-- .../ts-angular-client/api/health.service.ts | 97 +- .../api/heartbeat.service.ts | 103 +- .../ts-angular-client/api/jrec.service.ts | 226 +-- .../ts-angular-client/api/jrl.service.ts | 137 +- .../ts-angular-client/api/net.service.ts | 522 ++++++- .../api/networkMonitoring.service.ts | 139 +- .../api/preflight.service.ts | 103 +- .../ts-angular-client/api/sessions.service.ts | 137 +- .../ts-angular-client/api/traffic.service.ts | 169 +-- .../ts-angular-client/api/update.service.ts | 306 ++-- .../ts-angular-client/api/webApp.service.ts | 139 +- .../ts-angular-client/configuration.ts | 57 +- .../openapi/ts-angular-client/encoder.ts | 15 + .../openapi/ts-angular-client/index.ts | 1 + .../ts-angular-client/model/accessScope.ts | 40 +- .../ts-angular-client/model/addressFamily.ts | 9 +- .../model/appCredentialKind.ts | 7 +- .../model/appTokenContentType.ts | 7 +- .../ts-angular-client/model/connectionMode.ts | 9 +- .../ts-angular-client/model/dataEncoding.ts | 15 +- .../model/eventOutcomeResponse.ts | 11 +- .../model/getUpdateProductsResponse.ts | 26 + .../model/getUpdateScheduleResponse.ts | 41 + .../model/hostScanStateDto.ts | 19 + .../openapi/ts-angular-client/model/models.ts | 14 + .../model/networkInterfaceDto.ts | 32 + .../model/networkInterfacesResponse.ts | 16 + .../model/networkScanResultEventDto.ts | 35 + .../model/networkScanResultKindDto.ts | 17 + .../model/networkScanSourceCapabilitiesDto.ts | 21 + .../model/networkScanSourceDto.ts | 23 + .../model/preflightAlertStatus.ts | 21 +- .../model/preflightOperation.ts | 2 +- .../model/preflightOperationKind.ts | 19 +- .../model/preflightOutputKind.ts | 17 +- .../ts-angular-client/model/pubKeyFormat.ts | 9 +- .../ts-angular-client/model/scanOriginDto.ts | 16 + .../model/scanResultSourceDto.ts | 20 + .../model/sessionTokenContentType.ts | 11 +- .../model/setUpdateScheduleRequest.ts | 37 + .../model/transportProtocolResponse.ts | 9 +- .../model/updateProductInfo.ts | 21 + .../model/updateRequestSchema.ts | 22 + .../openapi/ts-angular-client/package.json | 18 +- .../openapi/ts-angular-client/provide-api.ts | 15 + .../openapi/ts-angular-client/query.params.ts | 160 ++ .../openapi/ts-angular-client/tsconfig.json | 3 + openapitools.json | 7 + 174 files changed, 7328 insertions(+), 1987 deletions(-) create mode 100644 devolutions-gateway/openapi/dotnet-client/docs/GetUpdateProductsResponse.md create mode 100644 devolutions-gateway/openapi/dotnet-client/docs/GetUpdateScheduleResponse.md create mode 100644 devolutions-gateway/openapi/dotnet-client/docs/HostScanStateDto.md create mode 100644 devolutions-gateway/openapi/dotnet-client/docs/NetworkInterfaceDto.md create mode 100644 devolutions-gateway/openapi/dotnet-client/docs/NetworkInterfacesResponse.md create mode 100644 devolutions-gateway/openapi/dotnet-client/docs/NetworkScanResultEventDto.md create mode 100644 devolutions-gateway/openapi/dotnet-client/docs/NetworkScanResultKindDto.md create mode 100644 devolutions-gateway/openapi/dotnet-client/docs/NetworkScanSourceCapabilitiesDto.md create mode 100644 devolutions-gateway/openapi/dotnet-client/docs/NetworkScanSourceDto.md create mode 100644 devolutions-gateway/openapi/dotnet-client/docs/ScanOriginDto.md create mode 100644 devolutions-gateway/openapi/dotnet-client/docs/ScanResultSourceDto.md create mode 100644 devolutions-gateway/openapi/dotnet-client/docs/SetUpdateScheduleRequest.md create mode 100644 devolutions-gateway/openapi/dotnet-client/docs/UpdateProductInfo.md create mode 100644 devolutions-gateway/openapi/dotnet-client/docs/UpdateRequestSchema.md create mode 100644 devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/GetUpdateProductsResponse.cs create mode 100644 devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/GetUpdateScheduleResponse.cs create mode 100644 devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/HostScanStateDto.cs create mode 100644 devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/NetworkInterfaceDto.cs create mode 100644 devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/NetworkInterfacesResponse.cs create mode 100644 devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/NetworkScanResultEventDto.cs create mode 100644 devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/NetworkScanResultKindDto.cs create mode 100644 devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/NetworkScanSourceCapabilitiesDto.cs create mode 100644 devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/NetworkScanSourceDto.cs create mode 100644 devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/ScanOriginDto.cs create mode 100644 devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/ScanResultSourceDto.cs create mode 100644 devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/SetUpdateScheduleRequest.cs create mode 100644 devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/UpdateProductInfo.cs create mode 100644 devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/UpdateRequestSchema.cs create mode 100644 devolutions-gateway/openapi/ts-angular-client/api.base.service.ts create mode 100644 devolutions-gateway/openapi/ts-angular-client/model/getUpdateProductsResponse.ts create mode 100644 devolutions-gateway/openapi/ts-angular-client/model/getUpdateScheduleResponse.ts create mode 100644 devolutions-gateway/openapi/ts-angular-client/model/hostScanStateDto.ts create mode 100644 devolutions-gateway/openapi/ts-angular-client/model/networkInterfaceDto.ts create mode 100644 devolutions-gateway/openapi/ts-angular-client/model/networkInterfacesResponse.ts create mode 100644 devolutions-gateway/openapi/ts-angular-client/model/networkScanResultEventDto.ts create mode 100644 devolutions-gateway/openapi/ts-angular-client/model/networkScanResultKindDto.ts create mode 100644 devolutions-gateway/openapi/ts-angular-client/model/networkScanSourceCapabilitiesDto.ts create mode 100644 devolutions-gateway/openapi/ts-angular-client/model/networkScanSourceDto.ts create mode 100644 devolutions-gateway/openapi/ts-angular-client/model/scanOriginDto.ts create mode 100644 devolutions-gateway/openapi/ts-angular-client/model/scanResultSourceDto.ts create mode 100644 devolutions-gateway/openapi/ts-angular-client/model/setUpdateScheduleRequest.ts create mode 100644 devolutions-gateway/openapi/ts-angular-client/model/updateProductInfo.ts create mode 100644 devolutions-gateway/openapi/ts-angular-client/model/updateRequestSchema.ts create mode 100644 devolutions-gateway/openapi/ts-angular-client/provide-api.ts create mode 100644 devolutions-gateway/openapi/ts-angular-client/query.params.ts create mode 100644 openapitools.json diff --git a/devolutions-gateway/openapi/doc/.openapi-generator/VERSION b/devolutions-gateway/openapi/doc/.openapi-generator/VERSION index 4bc5d6181..07832195c 100644 --- a/devolutions-gateway/openapi/doc/.openapi-generator/VERSION +++ b/devolutions-gateway/openapi/doc/.openapi-generator/VERSION @@ -1 +1 @@ -7.9.0 +7.24.0 diff --git a/devolutions-gateway/openapi/doc/index.adoc b/devolutions-gateway/openapi/doc/index.adoc index 405c6a6bf..7f53b7eb0 100644 --- a/devolutions-gateway/openapi/doc/index.adoc +++ b/devolutions-gateway/openapi/doc/index.adoc @@ -1,6 +1,6 @@ = devolutions-gateway infos@devolutions.net -2025.3.2 +2026.2.4 :toc: left :numbered: :toclevels: 4 @@ -102,13 +102,11 @@ Modifies configuration | X | | - |=== - ===== Return Type @@ -564,13 +562,11 @@ If you try to delete more than 50,000 recordings at once, you should split the l | X | | - |=== - ===== Return Type <> @@ -669,14 +665,12 @@ Deletes a recording stored on this instance | X | null | - |=== - ===== Return Type @@ -777,10 +771,8 @@ Lists all recordings stored on this instance | X | null | - |=== - ===== Return Type @@ -870,20 +862,17 @@ Retrieves a recording file for a given session | X | null | - | filename | Name of recording file to retrieve | X | null | - |=== - ===== Return Type @@ -1188,6 +1177,339 @@ ifdef::internal-generation[] endif::internal-generation[] +[.getNetInterfaces] +==== getNetInterfaces + +`GET /jet/net/interfaces` + +Lists Gateway network scan sources. + +===== Description + + + + +// markup not found, no include::{specDir}jet/net/interfaces/GET/spec.adoc[opts=optional] + + + +===== Security + +[cols="2,1,1"] +|=== +| Name | Type | Scheme + +| `netscan_token` +| http +| bearer +|=== + + +===== Return Type + +<> + + +===== Content Type + +* application/json + +===== Responses + +.HTTP Response Codes +[cols="2,3,1"] +|=== +| Code | Message | Datatype + + +| 200 +| Gateway network scan sources +| <> + + +| 400 +| Bad request +| <<>> + + +| 401 +| Invalid or missing authorization token +| <<>> + + +| 403 +| Insufficient permissions +| <<>> + + +| 500 +| Unexpected server error +| <<>> + +|=== + + +ifdef::internal-generation[] +===== Implementation + +// markup not found, no include::{specDir}jet/net/interfaces/GET/implementation.adoc[opts=optional] + + +endif::internal-generation[] + + +[.getNetScan] +==== getNetScan + +`GET /jet/net/scan` + +Stream network scan events over a websocket. + +===== Description + +The endpoint is upgraded from HTTP, so OpenAPI describes the **handshake**: the query parameters that drive the scan (validated before upgrade) and the legacy / v1 event payloads streamed back as JSON text frames. See `NetworkScanResultEvent` for the v1 shape and `LegacyScanEvent` for the legacy shape (selected via `response_format`). + + +// markup not found, no include::{specDir}jet/net/scan/GET/spec.adoc[opts=optional] + + + +===== Security + +[cols="2,1,1"] +|=== +| Name | Type | Scheme + +| `netscan_token` +| http +| bearer +|=== + +===== Parameters + + + + + +====== Query Parameters + +[cols="2,3,1,1,1"] +|=== +|Name| Description| Required| Default| Pattern + +| ping_interval +| Interval in milliseconds (default is 200) +| - +| null +| +| ping_timeout +| Timeout in milliseconds (default is 500) +| - +| null +| +| broadcast_timeout +| Timeout in milliseconds (default is 1000) +| - +| null +| +| port_scan_timeout +| Timeout in milliseconds (default is 1000) +| - +| null +| +| netbios_timeout +| Timeout in milliseconds (default is 1000) +| - +| null +| +| netbios_interval +| Interval in milliseconds (default is 200) +| - +| null +| +| mdns_query_timeout +| The maximum time for each mdns query in milliseconds. (default is 5 * 1000) +| - +| null +| +| max_wait +| The maximum duration for whole networking scan in milliseconds. Highly suggested! +| - +| null +| +| range +| The start and end IP address of the range to scan. for example: 10.10.0.0-10.10.0.255 <> +| - +| null +| +| target +| Explicit single-host targets to scan. Each value must parse as an IPv4 or IPv6 address; invalid values yield a structured `{ error: \"invalid_target\", value: \"\" }` 400 rather than a generic serde rejection at extraction time (mirrors the `range=` / `probe=` validation path). <> +| - +| null +| +| interface_id +| Gateway network interface IDs to use as scan sources. <> +| - +| null +| +| probe +| The probes to run. Each value is either `ping`, a port number (`22`), or a named service (`rdp`, `https`, ΓǪ). Validation is deferred to scan-time so failures can be surfaced as a structured 400 ΓÇö naming the offending value ΓÇö instead of a generic serde rejection at extraction time. <> +| - +| null +| +| enable_ping_start +| **Legacy alias** for `report_ping_start`. Prefer the explicit name in new clients; kept so existing consumers don't break. +| - +| null +| +| enable_broadcast +| Enable the execution of broadcast scan +| - +| null +| +| enable_subnet_scan +| Enable the ping scan on subnet +| - +| null +| +| enable_zeroconf +| Enable ZeroConf/mDNS +| - +| null +| +| enable_netbios +| Enable NetBIOS name-service queries. Default `true` for backward compatibility. Set `false` (or pair with explicit `target=`) to keep NetBIOS from sweeping the surrounding subnet when the caller only wants results for the targets they listed. +| - +| null +| +| enable_resolve_dns +| Enable resolve dns +| - +| null +| +| include_host_results +| Include host-only results. +| - +| null +| +| report_ping_start +| Emit ping queued/start host results. +| - +| null +| +| report_ping_success +| Emit ping success host results. +| - +| null +| +| report_ping_failure +| Emit ping failure host results. +| - +| null +| +| enable_tcp_probes +| Enable TCP service probes. +| - +| null +| +| range_interface_policy +| Policy applied when `range=` and `interface_id=` are both provided. Accepted values: `intersect_selected_interfaces` (default) or `allow_cross_interface_range`. Invalid values yield a structured `{ error: \"invalid_range_interface_policy\", value: \"\" }` 400 instead of a generic serde rejection (mirrors the `range=` / `probe=` / `target=` validation path). +| - +| null +| +| allow_cross_interface_range +| **Legacy alias** for `range_interface_policy=allow_cross_interface_range`. Prefer the structured policy in new clients. +| - +| null +| +| response_format +| Response shape emitted on the websocket. Accepted values: `legacy` (default) or `network_scan_result_v1`. Invalid values yield a structured `{ error: \"invalid_response_format\", value: \"\" }` 400 instead of a generic serde rejection. +| - +| null +| +| max_concurrency +| Maximum scanner concurrency. +| - +| null +| +| max_ping_concurrency +| Maximum ping probe concurrency. +| - +| null +| +| max_tcp_probe_concurrency +| Maximum TCP probe concurrency. +| - +| null +| +| enable_failure +| **Legacy alias** for `report_ping_failure`. `enable_failure=true` only opts into ping-failure events; TCP-probe failure events require the explicit `report_tcp_failure=true` and are not affected by this alias. **Behavior change:** historically this single flag controlled both ping-failure and TCP-probe-failure reporting. The two are now split: clients that want the old \"both at once\" semantics must send `enable_failure=true&report_tcp_failure=true` together. The split is intentional ΓÇö TCP-probe failures are typically high-volume noise that callers were filtering client-side anyway, so the two streams are independently gated. +| - +| null +| +| report_tcp_failure +| Enable TCP port knocking failure events. +| - +| null +| +| interface_bind_strict +| When `true`, fail with HTTP 400 if a ping/TCP-probe socket cannot be bound to the planner-selected interface. Default `false` (warn and fall back to default routing). +| - +| null +| +|=== + +===== Return Type + + + +- + + +===== Responses + +.HTTP Response Codes +[cols="2,3,1"] +|=== +| Code | Message | Datatype + + +| 101 +| WebSocket upgrade; subsequent text frames carry NetworkScanResultEvent or LegacyScanEvent JSON +| <<>> + + +| 400 +| Invalid query, mixed target/range, oversized range, or selected interface error +| <<>> + + +| 401 +| Invalid or missing authorization token +| <<>> + + +| 403 +| Insufficient permissions +| <<>> + + +| 500 +| Unexpected server error +| <<>> + +|=== + + +ifdef::internal-generation[] +===== Implementation + +// markup not found, no include::{specDir}jet/net/scan/GET/implementation.adoc[opts=optional] + + +endif::internal-generation[] + + [.NetworkMonitoring] === NetworkMonitoring @@ -1314,13 +1636,11 @@ Changes take effect immediately: - Starts any monitors newly defined in the payl | X | | - |=== - ===== Return Type <> @@ -1419,13 +1739,11 @@ Performs a batch of preflight operations | X | | - |=== - ===== Return Type array[<>] @@ -1599,14 +1917,12 @@ Terminate forcefully a running session | X | null | - |=== - ===== Return Type @@ -1708,13 +2024,11 @@ Acknowledge traffic audit events and remove them from the queue | X | | - |=== - ===== Return Type <> @@ -1817,16 +2131,13 @@ Claim traffic audit events for processing | X | null | - | max | Maximum number of events to claim (1-1000, default: 100) | X | null | - |=== - ===== Return Type array[<>] @@ -1884,19 +2195,19 @@ endif::internal-generation[] === Update -[.triggerUpdate] -==== triggerUpdate +[.getUpdateProducts] +==== getUpdateProducts -`POST /jet/update` +`GET /jet/update` -Triggers Devolutions Gateway update process. +Retrieve the currently installed version of each Devolutions product. ===== Description -This is done via updating `Agent/update.json` file, which is then read by Devolutions Agent when changes are detected. If the version written to `update.json` is indeed higher than the currently installed version, Devolutions Agent will proceed with the update process. +Reads `update_status.json`, which is written by the Devolutions Agent on startup and refreshed after every update run. When the file does not exist (agent not installed or is an older version), the endpoint returns HTTP 503 because updater status is unavailable. -// markup not found, no include::{specDir}jet/update/POST/spec.adoc[opts=optional] +// markup not found, no include::{specDir}jet/update/GET/spec.adoc[opts=optional] @@ -1911,26 +2222,303 @@ This is done via updating `Agent/update.json` file, which is then read by Devolu | bearer |=== -===== Parameters +===== Return Type +<> +===== Content Type -====== Query Parameters +* application/json -[cols="2,3,1,1,1"] -|=== -|Name| Description| Required| Default| Pattern +===== Responses -| version -| The version to install; use 'latest' for the latest version, or 'w.x.y.z' for a specific version -| X -| null +.HTTP Response Codes +[cols="2,3,1"] +|=== +| Code | Message | Datatype + + +| 200 +| Installed product versions +| <> + + +| 401 +| Invalid or missing authorization token +| <<>> + + +| 403 +| Insufficient permissions +| <<>> + + +| 500 +| Failed to read agent status file +| <<>> + + +| 503 +| Agent updater service is unavailable +| <<>> + +|=== + + +ifdef::internal-generation[] +===== Implementation + +// markup not found, no include::{specDir}jet/update/GET/implementation.adoc[opts=optional] + + +endif::internal-generation[] + + +[.getUpdateSchedule] +==== getUpdateSchedule + +`GET /jet/update/schedule` + +Retrieve the current Devolutions Agent auto-update schedule. + +===== Description + +Reads the `Schedule` field from `update_status.json`. When the field is absent the response contains zeroed defaults (`Enabled: false`, interval `0`, window start `0`, no products). + + +// markup not found, no include::{specDir}jet/update/schedule/GET/spec.adoc[opts=optional] + + + +===== Security + +[cols="2,1,1"] +|=== +| Name | Type | Scheme + +| `scope_token` +| http +| bearer +|=== + + +===== Return Type + +<> + + +===== Content Type + +* application/json + +===== Responses + +.HTTP Response Codes +[cols="2,3,1"] +|=== +| Code | Message | Datatype + + +| 200 +| Current auto-update schedule +| <> + + +| 401 +| Invalid or missing authorization token +| <<>> + + +| 403 +| Insufficient permissions +| <<>> + + +| 500 +| Failed to read agent status file +| <<>> + + +| 503 +| Agent updater service is unavailable +| <<>> + +|=== + + +ifdef::internal-generation[] +===== Implementation + +// markup not found, no include::{specDir}jet/update/schedule/GET/implementation.adoc[opts=optional] + + +endif::internal-generation[] + + +[.setUpdateSchedule] +==== setUpdateSchedule + +`POST /jet/update/schedule` + +Set the Devolutions Agent auto-update schedule. + +===== Description + +Writes the `Schedule` field into `update.json`. The agent watches this file and applies the new schedule immediately, then persists it to `agent.json`. All other fields in `update.json` are preserved; the `VersionMinor` field is reset to the minor version this gateway build understands so the agent does not see an unknown future version. + + +// markup not found, no include::{specDir}jet/update/schedule/POST/spec.adoc[opts=optional] + + + +===== Security + +[cols="2,1,1"] +|=== +| Name | Type | Scheme + +| `scope_token` +| http +| bearer +|=== + +===== Parameters + + +====== Body Parameter + +[cols="2,3,1,1,1"] +|=== +|Name| Description| Required| Default| Pattern + +| SetUpdateScheduleRequest +| <> +| X +| +| +|=== + + + + +===== Return Type + + +<> + + +===== Content Type + +* application/json + +===== Responses + +.HTTP Response Codes +[cols="2,3,1"] +|=== +| Code | Message | Datatype + + +| 200 +| Auto-update schedule applied +| <> + + +| 400 +| Bad request +| <<>> + + +| 401 +| Invalid or missing authorization token +| <<>> + + +| 403 +| Insufficient permissions +| <<>> + + +| 500 +| Failed to write update manifest +| <<>> + + +| 503 +| Agent updater service is unavailable +| <<>> + +|=== + + +ifdef::internal-generation[] +===== Implementation + +// markup not found, no include::{specDir}jet/update/schedule/POST/implementation.adoc[opts=optional] + + +endif::internal-generation[] + + +[.triggerUpdate] +==== triggerUpdate + +`POST /jet/update` + +Trigger an update for one or more Devolutions products. + +===== Description + +Writes the requested version(s) into `Agent/update.json`, which is watched by Devolutions Agent. When a requested version is higher than the installed version the agent proceeds with the update. **Body form** (preferred): pass a JSON body with a `Products` map. **Query-param form** (legacy, gateway-only): `POST /jet/update?version=latest`. This form updates only the Gateway product and is kept for backward compatibility. Both forms cannot be used simultaneously; doing so returns HTTP 400. + + +// markup not found, no include::{specDir}jet/update/POST/spec.adoc[opts=optional] + + + +===== Security + +[cols="2,1,1"] +|=== +| Name | Type | Scheme + +| `scope_token` +| http +| bearer +|=== + +===== Parameters + + +====== Body Parameter + +[cols="2,3,1,1,1"] +|=== +|Name| Description| Required| Default| Pattern + +| UpdateRequestSchema +| Products and target versions to update <> +| - +| | +|=== + + +====== Query Parameters + +[cols="2,3,1,1,1"] |=== +|Name| Description| Required| Default| Pattern +| version +| Gateway-only target version; use the request body for multi-product updates +| - +| null +| +|=== ===== Return Type @@ -1951,7 +2539,7 @@ This is done via updating `Agent/update.json` file, which is then read by Devolu | 200 -| Update request has been processed successfully +| Update request accepted | <> @@ -1971,7 +2559,7 @@ This is done via updating `Agent/update.json` file, which is then read by Devolu | 500 -| Agent updater service is malfunctioning +| Failed to write update manifest | <<>> @@ -2036,13 +2624,11 @@ Requests a web application token using the configured authorization method | X | | - |=== - ===== Return Type @@ -2138,13 +2724,11 @@ Requests a session token using a web application token | X | | - |=== - ===== Return Type @@ -2227,11 +2811,14 @@ endif::internal-generation[] | gateway.recording.delete | gateway.recordings.read | gateway.update +| gateway.update.read | gateway.preflight | gateway.traffic.claim | gateway.traffic.ack | gateway.net.monitor.config | gateway.net.monitor.drain +| gateway.agent.delete +| gateway.agent.read |=== @@ -2704,9 +3291,95 @@ Service configuration diagnostic |=== -[#Heartbeat] -=== _Heartbeat_ - +[#GetUpdateProductsResponse] +=== _GetUpdateProductsResponse_ + +Installed version of each product, as reported by Devolutions Agent. + + +[.fields-GetUpdateProductsResponse] +[cols="2,1,1,2,4,1"] +|=== +| Field Name| Required| Nullable | Type| Description | Format + +| ManifestVersion +| X +| +| String +| Version of the `update_status.json` format in `\"major.minor\"` form (e.g. `\"1.1\"`). +| + +| Products +| +| +| Map of <> +| Map of product name to API-specific product info. +| + +|=== + + + +[#GetUpdateScheduleResponse] +=== _GetUpdateScheduleResponse_ + +Current auto-update schedule for Devolutions Agent. + + +[.fields-GetUpdateScheduleResponse] +[cols="2,1,1,2,4,1"] +|=== +| Field Name| Required| Nullable | Type| Description | Format + +| Enabled +| X +| +| Boolean +| Enable periodic Devolutions Agent self-update checks. +| + +| Interval +| X +| +| Long +| Minimum interval between auto-update checks, in seconds. `0` means check once at `UpdateWindowStart`. +| int64 + +| ManifestVersion +| X +| +| String +| Version of the `update_status.json` format in `\"major.minor\"` form (e.g. `\"1.1\"`). +| + +| Products +| +| +| List of <> +| Products the agent autonomously polls for new versions. +| + +| UpdateWindowEnd +| +| X +| Integer +| End of the maintenance window as seconds past midnight (local time, exclusive). `None` means no upper bound (single check at `UpdateWindowStart`). +| int32 + +| UpdateWindowStart +| X +| +| Integer +| Start of the maintenance window as seconds past midnight (local time). +| int32 + +|=== + + + +[#Heartbeat] +=== _Heartbeat_ + @@ -2775,6 +3448,27 @@ Service configuration diagnostic +[#HostScanStateDto] +=== _HostScanStateDto_ + + + + + + +[.fields-HostScanStateDto] +[cols="1"] +|=== +| Enum Values + +| queued +| probing +| reachable +| unreachable + +|=== + + [#Identity] === _Identity_ @@ -3143,6 +3837,366 @@ Service configuration diagnostic +[#NetworkInterfaceDto] +=== _NetworkInterfaceDto_ + + + + +[.fields-NetworkInterfaceDto] +[cols="2,1,1,2,4,1"] +|=== +| Field Name| Required| Nullable | Type| Description | Format + +| description +| +| X +| String +| +| + +| id +| X +| +| String +| +| + +| index +| +| X +| Integer +| +| int32 + +| isUp +| +| X +| Boolean +| +| + +| linkType +| +| X +| String +| Coarse link type: `ethernet`, `wifi`, `loopback`, `virtual`, `unknown`. +| + +| macAddress +| +| X +| String +| +| + +| mtu +| +| X +| Integer +| MTU in bytes when known. +| int32 + +| name +| X +| +| String +| +| + +| speedMbps +| +| X +| Long +| Link speed in megabits per second when reported by the OS. +| int64 + +|=== + + + +[#NetworkInterfacesResponse] +=== _NetworkInterfacesResponse_ + + + + +[.fields-NetworkInterfacesResponse] +[cols="2,1,1,2,4,1"] +|=== +| Field Name| Required| Nullable | Type| Description | Format + +| interfaces +| X +| +| List of <> +| +| + +|=== + + + +[#NetworkScanResultEventDto] +=== _NetworkScanResultEventDto_ + + + + +[.fields-NetworkScanResultEventDto] +[cols="2,1,1,2,4,1"] +|=== +| Field Name| Required| Nullable | Type| Description | Format + +| address +| X +| +| String +| +| + +| discoverySource +| X +| +| <> +| +| subnet, broadcast, tcp_probe, gateway, zero_conf, + +| hostName +| +| X +| String +| +| + +| hostScanState +| +| X +| <> +| +| queued, probing, reachable, unreachable, + +| interfaceId +| +| X +| String +| +| + +| interfaceName +| +| X +| String +| +| + +| isReachable +| +| X +| Boolean +| +| + +| kind +| X +| +| <> +| +| host, service, + +| macAddress +| +| X +| String +| +| + +| port +| +| X +| Integer +| +| int32 + +| responseTimeMs +| +| X +| Integer +| +| + +| serviceLabel +| +| X +| String +| +| + +| serviceType +| +| X +| String +| +| + +| source +| X +| +| <> +| +| gateway, + +|=== + + + +[#NetworkScanResultKindDto] +=== _NetworkScanResultKindDto_ + + + + + + +[.fields-NetworkScanResultKindDto] +[cols="1"] +|=== +| Enum Values + +| host +| service + +|=== + + +[#NetworkScanSourceCapabilitiesDto] +=== _NetworkScanSourceCapabilitiesDto_ + + + + +[.fields-NetworkScanSourceCapabilitiesDto] +[cols="2,1,1,2,4,1"] +|=== +| Field Name| Required| Nullable | Type| Description | Format + +| broadcast +| X +| +| Boolean +| +| + +| dnsResolve +| X +| +| Boolean +| +| + +| ipv4 +| X +| +| Boolean +| +| + +| ipv6 +| X +| +| Boolean +| +| + +| subnet +| X +| +| Boolean +| +| + +| tcpProbe +| X +| +| Boolean +| +| + +| zeroConf +| X +| +| Boolean +| +| + +|=== + + + +[#NetworkScanSourceDto] +=== _NetworkScanSourceDto_ + + + + +[.fields-NetworkScanSourceDto] +[cols="2,1,1,2,4,1"] +|=== +| Field Name| Required| Nullable | Type| Description | Format + +| address +| X +| +| String +| +| + +| broadcastAddress +| +| X +| String +| +| + +| capabilities +| X +| +| <> +| +| + +| endAddress +| X +| +| String +| +| + +| interface +| X +| +| <> +| +| + +| prefixLength +| +| X +| Integer +| +| int32 + +| startAddress +| X +| +| String +| +| + +|=== + + + [#PreflightAlertStatus] === _PreflightAlertStatus_ @@ -3218,7 +4272,7 @@ Service configuration diagnostic | | X | Integer -| Minimum persistance duration in seconds for the data provisioned via this operation. Optional parameter for \"provision-token\" and \"provision-credentials\" kinds. +| Minimum persistence duration in seconds for the data provisioned via this operation. Optional parameter for \"provision-token\" and \"provision-credentials\" kinds. | int32 | token @@ -3397,6 +4451,46 @@ Service configuration diagnostic |=== +[#ScanOriginDto] +=== _ScanOriginDto_ + + + + + + +[.fields-ScanOriginDto] +[cols="1"] +|=== +| Enum Values + +| gateway + +|=== + + +[#ScanResultSourceDto] +=== _ScanResultSourceDto_ + + + + + + +[.fields-ScanResultSourceDto] +[cols="1"] +|=== +| Enum Values + +| subnet +| broadcast +| tcp_probe +| gateway +| zero_conf + +|=== + + [#SessionInfo] === _SessionInfo_ @@ -3574,6 +4668,56 @@ This body is returned when the config is successfully set, even if one or all pr +[#SetUpdateScheduleRequest] +=== _SetUpdateScheduleRequest_ + +Desired auto-update schedule to apply to Devolutions Agent. + + +[.fields-SetUpdateScheduleRequest] +[cols="2,1,1,2,4,1"] +|=== +| Field Name| Required| Nullable | Type| Description | Format + +| Enabled +| X +| +| Boolean +| Enable periodic Devolutions Agent self-update checks. +| + +| Interval +| +| +| Long +| Minimum interval between auto-update checks, in seconds. `0` means check once at `UpdateWindowStart` (default). +| int64 + +| Products +| +| +| List of <> +| Products the agent autonomously polls for new versions (default: empty). +| + +| UpdateWindowEnd +| +| X +| Integer +| End of the maintenance window as seconds past midnight in local time, exclusive. `null` (default) means no upper bound - a single check fires at `UpdateWindowStart`. When end < start the window crosses midnight. +| int32 + +| UpdateWindowStart +| +| +| Integer +| Start of the maintenance window as seconds past midnight in local time (default: `7200` = 02:00). +| int32 + +|=== + + + [#SubProvisionerKey] === _SubProvisionerKey_ @@ -3757,3 +4901,49 @@ Subscriber configuration |=== +[#UpdateProductInfo] +=== _UpdateProductInfo_ + +Per-product update information. + + +[.fields-UpdateProductInfo] +[cols="2,1,1,2,4,1"] +|=== +| Field Name| Required| Nullable | Type| Description | Format + +| Version +| X +| +| String +| Requested or installed version: `\"latest\"` or `\"YYYY.M.D\"` / `\"YYYY.M.D.R\"`. +| + +|=== + + + +[#UpdateRequestSchema] +=== _UpdateRequestSchema_ + +OpenAPI schema for the update request body. + +The API accepts an object containing a `Products` map, whose keys are product names +and whose values are update information. + + +[.fields-UpdateRequestSchema] +[cols="2,1,1,2,4,1"] +|=== +| Field Name| Required| Nullable | Type| Description | Format + +| Products +| +| +| Map of <> +| Map of product name to update information. +| + +|=== + + diff --git a/devolutions-gateway/openapi/dotnet-client/.openapi-generator/FILES b/devolutions-gateway/openapi/dotnet-client/.openapi-generator/FILES index 16fd9a133..d175e6c2e 100644 --- a/devolutions-gateway/openapi/dotnet-client/.openapi-generator/FILES +++ b/devolutions-gateway/openapi/dotnet-client/.openapi-generator/FILES @@ -19,9 +19,12 @@ docs/DataEncoding.md docs/DeleteManyResult.md docs/DiagnosticsApi.md docs/EventOutcomeResponse.md +docs/GetUpdateProductsResponse.md +docs/GetUpdateScheduleResponse.md docs/HealthApi.md docs/Heartbeat.md docs/HeartbeatApi.md +docs/HostScanStateDto.md docs/Identity.md docs/InterfaceInfo.md docs/JrecApi.md @@ -36,7 +39,13 @@ docs/MonitoringProbeType.md docs/MonitoringProbeTypeOneOf.md docs/MonitorsConfig.md docs/NetApi.md +docs/NetworkInterfaceDto.md +docs/NetworkInterfacesResponse.md docs/NetworkMonitoringApi.md +docs/NetworkScanResultEventDto.md +docs/NetworkScanResultKindDto.md +docs/NetworkScanSourceCapabilitiesDto.md +docs/NetworkScanSourceDto.md docs/PreflightAlertStatus.md docs/PreflightApi.md docs/PreflightOperation.md @@ -44,17 +53,22 @@ docs/PreflightOperationKind.md docs/PreflightOutput.md docs/PreflightOutputKind.md docs/PubKeyFormat.md +docs/ScanOriginDto.md +docs/ScanResultSourceDto.md docs/SessionInfo.md docs/SessionTokenContentType.md docs/SessionTokenSignRequest.md docs/SessionsApi.md docs/SetConfigResponse.md +docs/SetUpdateScheduleRequest.md docs/SubProvisionerKey.md docs/Subscriber.md docs/TrafficApi.md docs/TrafficEventResponse.md docs/TransportProtocolResponse.md docs/UpdateApi.md +docs/UpdateProductInfo.md +docs/UpdateRequestSchema.md docs/WebAppApi.md src/Devolutions.Gateway.Client/Api/ConfigApi.cs src/Devolutions.Gateway.Client/Api/DiagnosticsApi.cs @@ -104,7 +118,10 @@ src/Devolutions.Gateway.Client/Model/ConnectionMode.cs src/Devolutions.Gateway.Client/Model/DataEncoding.cs src/Devolutions.Gateway.Client/Model/DeleteManyResult.cs src/Devolutions.Gateway.Client/Model/EventOutcomeResponse.cs +src/Devolutions.Gateway.Client/Model/GetUpdateProductsResponse.cs +src/Devolutions.Gateway.Client/Model/GetUpdateScheduleResponse.cs src/Devolutions.Gateway.Client/Model/Heartbeat.cs +src/Devolutions.Gateway.Client/Model/HostScanStateDto.cs src/Devolutions.Gateway.Client/Model/Identity.cs src/Devolutions.Gateway.Client/Model/InterfaceInfo.cs src/Devolutions.Gateway.Client/Model/JrlInfo.cs @@ -116,17 +133,28 @@ src/Devolutions.Gateway.Client/Model/MonitoringLogResponse.cs src/Devolutions.Gateway.Client/Model/MonitoringProbeType.cs src/Devolutions.Gateway.Client/Model/MonitoringProbeTypeOneOf.cs src/Devolutions.Gateway.Client/Model/MonitorsConfig.cs +src/Devolutions.Gateway.Client/Model/NetworkInterfaceDto.cs +src/Devolutions.Gateway.Client/Model/NetworkInterfacesResponse.cs +src/Devolutions.Gateway.Client/Model/NetworkScanResultEventDto.cs +src/Devolutions.Gateway.Client/Model/NetworkScanResultKindDto.cs +src/Devolutions.Gateway.Client/Model/NetworkScanSourceCapabilitiesDto.cs +src/Devolutions.Gateway.Client/Model/NetworkScanSourceDto.cs src/Devolutions.Gateway.Client/Model/PreflightAlertStatus.cs src/Devolutions.Gateway.Client/Model/PreflightOperation.cs src/Devolutions.Gateway.Client/Model/PreflightOperationKind.cs src/Devolutions.Gateway.Client/Model/PreflightOutput.cs src/Devolutions.Gateway.Client/Model/PreflightOutputKind.cs src/Devolutions.Gateway.Client/Model/PubKeyFormat.cs +src/Devolutions.Gateway.Client/Model/ScanOriginDto.cs +src/Devolutions.Gateway.Client/Model/ScanResultSourceDto.cs src/Devolutions.Gateway.Client/Model/SessionInfo.cs src/Devolutions.Gateway.Client/Model/SessionTokenContentType.cs src/Devolutions.Gateway.Client/Model/SessionTokenSignRequest.cs src/Devolutions.Gateway.Client/Model/SetConfigResponse.cs +src/Devolutions.Gateway.Client/Model/SetUpdateScheduleRequest.cs src/Devolutions.Gateway.Client/Model/SubProvisionerKey.cs src/Devolutions.Gateway.Client/Model/Subscriber.cs src/Devolutions.Gateway.Client/Model/TrafficEventResponse.cs src/Devolutions.Gateway.Client/Model/TransportProtocolResponse.cs +src/Devolutions.Gateway.Client/Model/UpdateProductInfo.cs +src/Devolutions.Gateway.Client/Model/UpdateRequestSchema.cs diff --git a/devolutions-gateway/openapi/dotnet-client/.openapi-generator/VERSION b/devolutions-gateway/openapi/dotnet-client/.openapi-generator/VERSION index 4bc5d6181..07832195c 100644 --- a/devolutions-gateway/openapi/dotnet-client/.openapi-generator/VERSION +++ b/devolutions-gateway/openapi/dotnet-client/.openapi-generator/VERSION @@ -1 +1 @@ -7.9.0 +7.24.0 diff --git a/devolutions-gateway/openapi/dotnet-client/README.md b/devolutions-gateway/openapi/dotnet-client/README.md index 8f17bd5a4..1b88aca9f 100644 --- a/devolutions-gateway/openapi/dotnet-client/README.md +++ b/devolutions-gateway/openapi/dotnet-client/README.md @@ -4,9 +4,9 @@ Protocol-aware fine-grained relay server This C# SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: -- API version: 2025.3.2 +- API version: 2026.2.4 - SDK version: 2025.12.2 -- Generator version: 7.9.0 +- Generator version: 7.24.0 - Build package: org.openapitools.codegen.languages.CSharpClientCodegen @@ -154,6 +154,8 @@ Class | Method | HTTP request | Description *JrlApi* | [**GetJrlInfo**](docs/JrlApi.md#getjrlinfo) | **GET** /jet/jrl/info | Retrieves current JRL (Json Revocation List) info *JrlApi* | [**UpdateJrl**](docs/JrlApi.md#updatejrl) | **POST** /jet/jrl | Updates JRL (Json Revocation List) using a JRL token *NetApi* | [**GetNetConfig**](docs/NetApi.md#getnetconfig) | **GET** /jet/net/config | Lists network interfaces +*NetApi* | [**GetNetInterfaces**](docs/NetApi.md#getnetinterfaces) | **GET** /jet/net/interfaces | Lists Gateway network scan sources. +*NetApi* | [**GetNetScan**](docs/NetApi.md#getnetscan) | **GET** /jet/net/scan | Stream network scan events over a websocket. *NetworkMonitoringApi* | [**DrainMonitoringLog**](docs/NetworkMonitoringApi.md#drainmonitoringlog) | **POST** /jet/net/monitor/log/drain | Monitors store their results in a temporary log, which is returned here. *NetworkMonitoringApi* | [**SetMonitoringConfig**](docs/NetworkMonitoringApi.md#setmonitoringconfig) | **POST** /jet/net/monitor/config | Replace the current monitoring configuration with the configuration in the request body. *PreflightApi* | [**PostPreflight**](docs/PreflightApi.md#postpreflight) | **POST** /jet/preflight | Performs a batch of preflight operations @@ -161,7 +163,10 @@ Class | Method | HTTP request | Description *SessionsApi* | [**TerminateSession**](docs/SessionsApi.md#terminatesession) | **POST** /jet/session/{id}/terminate | Terminate forcefully a running session *TrafficApi* | [**AckTrafficEvents**](docs/TrafficApi.md#acktrafficevents) | **POST** /jet/traffic/ack | Acknowledge traffic audit events and remove them from the queue *TrafficApi* | [**ClaimTrafficEvents**](docs/TrafficApi.md#claimtrafficevents) | **POST** /jet/traffic/claim | Claim traffic audit events for processing -*UpdateApi* | [**TriggerUpdate**](docs/UpdateApi.md#triggerupdate) | **POST** /jet/update | Triggers Devolutions Gateway update process. +*UpdateApi* | [**GetUpdateProducts**](docs/UpdateApi.md#getupdateproducts) | **GET** /jet/update | Retrieve the currently installed version of each Devolutions product. +*UpdateApi* | [**GetUpdateSchedule**](docs/UpdateApi.md#getupdateschedule) | **GET** /jet/update/schedule | Retrieve the current Devolutions Agent auto-update schedule. +*UpdateApi* | [**SetUpdateSchedule**](docs/UpdateApi.md#setupdateschedule) | **POST** /jet/update/schedule | Set the Devolutions Agent auto-update schedule. +*UpdateApi* | [**TriggerUpdate**](docs/UpdateApi.md#triggerupdate) | **POST** /jet/update | Trigger an update for one or more Devolutions products. *WebAppApi* | [**SignAppToken**](docs/WebAppApi.md#signapptoken) | **POST** /jet/webapp/app-token | Requests a web application token using the configured authorization method *WebAppApi* | [**SignSessionToken**](docs/WebAppApi.md#signsessiontoken) | **POST** /jet/webapp/session-token | Requests a session token using a web application token @@ -185,7 +190,10 @@ Class | Method | HTTP request | Description - [Model.DataEncoding](docs/DataEncoding.md) - [Model.DeleteManyResult](docs/DeleteManyResult.md) - [Model.EventOutcomeResponse](docs/EventOutcomeResponse.md) + - [Model.GetUpdateProductsResponse](docs/GetUpdateProductsResponse.md) + - [Model.GetUpdateScheduleResponse](docs/GetUpdateScheduleResponse.md) - [Model.Heartbeat](docs/Heartbeat.md) + - [Model.HostScanStateDto](docs/HostScanStateDto.md) - [Model.Identity](docs/Identity.md) - [Model.InterfaceInfo](docs/InterfaceInfo.md) - [Model.JrlInfo](docs/JrlInfo.md) @@ -197,20 +205,31 @@ Class | Method | HTTP request | Description - [Model.MonitoringProbeType](docs/MonitoringProbeType.md) - [Model.MonitoringProbeTypeOneOf](docs/MonitoringProbeTypeOneOf.md) - [Model.MonitorsConfig](docs/MonitorsConfig.md) + - [Model.NetworkInterfaceDto](docs/NetworkInterfaceDto.md) + - [Model.NetworkInterfacesResponse](docs/NetworkInterfacesResponse.md) + - [Model.NetworkScanResultEventDto](docs/NetworkScanResultEventDto.md) + - [Model.NetworkScanResultKindDto](docs/NetworkScanResultKindDto.md) + - [Model.NetworkScanSourceCapabilitiesDto](docs/NetworkScanSourceCapabilitiesDto.md) + - [Model.NetworkScanSourceDto](docs/NetworkScanSourceDto.md) - [Model.PreflightAlertStatus](docs/PreflightAlertStatus.md) - [Model.PreflightOperation](docs/PreflightOperation.md) - [Model.PreflightOperationKind](docs/PreflightOperationKind.md) - [Model.PreflightOutput](docs/PreflightOutput.md) - [Model.PreflightOutputKind](docs/PreflightOutputKind.md) - [Model.PubKeyFormat](docs/PubKeyFormat.md) + - [Model.ScanOriginDto](docs/ScanOriginDto.md) + - [Model.ScanResultSourceDto](docs/ScanResultSourceDto.md) - [Model.SessionInfo](docs/SessionInfo.md) - [Model.SessionTokenContentType](docs/SessionTokenContentType.md) - [Model.SessionTokenSignRequest](docs/SessionTokenSignRequest.md) - [Model.SetConfigResponse](docs/SetConfigResponse.md) + - [Model.SetUpdateScheduleRequest](docs/SetUpdateScheduleRequest.md) - [Model.SubProvisionerKey](docs/SubProvisionerKey.md) - [Model.Subscriber](docs/Subscriber.md) - [Model.TrafficEventResponse](docs/TrafficEventResponse.md) - [Model.TransportProtocolResponse](docs/TransportProtocolResponse.md) + - [Model.UpdateProductInfo](docs/UpdateProductInfo.md) + - [Model.UpdateRequestSchema](docs/UpdateRequestSchema.md) diff --git a/devolutions-gateway/openapi/dotnet-client/docs/GetUpdateProductsResponse.md b/devolutions-gateway/openapi/dotnet-client/docs/GetUpdateProductsResponse.md new file mode 100644 index 000000000..915f7d3cf --- /dev/null +++ b/devolutions-gateway/openapi/dotnet-client/docs/GetUpdateProductsResponse.md @@ -0,0 +1,12 @@ +# Devolutions.Gateway.Client.Model.GetUpdateProductsResponse +Installed version of each product, as reported by Devolutions Agent. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ManifestVersion** | **string** | Version of the `update_status.json` format in `\"major.minor\"` form (e.g. `\"1.1\"`). | +**Products** | [**Dictionary<string, UpdateProductInfo>**](UpdateProductInfo.md) | Map of product name to API-specific product info. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/devolutions-gateway/openapi/dotnet-client/docs/GetUpdateScheduleResponse.md b/devolutions-gateway/openapi/dotnet-client/docs/GetUpdateScheduleResponse.md new file mode 100644 index 000000000..8402ef8af --- /dev/null +++ b/devolutions-gateway/openapi/dotnet-client/docs/GetUpdateScheduleResponse.md @@ -0,0 +1,16 @@ +# Devolutions.Gateway.Client.Model.GetUpdateScheduleResponse +Current auto-update schedule for Devolutions Agent. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Enabled** | **bool** | Enable periodic Devolutions Agent self-update checks. | +**Interval** | **long** | Minimum interval between auto-update checks, in seconds. `0` means check once at `UpdateWindowStart`. | +**ManifestVersion** | **string** | Version of the `update_status.json` format in `\"major.minor\"` form (e.g. `\"1.1\"`). | +**Products** | **List<string>** | Products the agent autonomously polls for new versions. | [optional] +**UpdateWindowEnd** | **int?** | End of the maintenance window as seconds past midnight (local time, exclusive). `None` means no upper bound (single check at `UpdateWindowStart`). | [optional] +**UpdateWindowStart** | **int** | Start of the maintenance window as seconds past midnight (local time). | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/devolutions-gateway/openapi/dotnet-client/docs/HostScanStateDto.md b/devolutions-gateway/openapi/dotnet-client/docs/HostScanStateDto.md new file mode 100644 index 000000000..4e16a06f0 --- /dev/null +++ b/devolutions-gateway/openapi/dotnet-client/docs/HostScanStateDto.md @@ -0,0 +1,9 @@ +# Devolutions.Gateway.Client.Model.HostScanStateDto + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/devolutions-gateway/openapi/dotnet-client/docs/NetApi.md b/devolutions-gateway/openapi/dotnet-client/docs/NetApi.md index 5664a5b20..4dead2e60 100644 --- a/devolutions-gateway/openapi/dotnet-client/docs/NetApi.md +++ b/devolutions-gateway/openapi/dotnet-client/docs/NetApi.md @@ -5,6 +5,8 @@ All URIs are relative to *http://localhost* | Method | HTTP request | Description | |--------|--------------|-------------| | [**GetNetConfig**](NetApi.md#getnetconfig) | **GET** /jet/net/config | Lists network interfaces | +| [**GetNetInterfaces**](NetApi.md#getnetinterfaces) | **GET** /jet/net/interfaces | Lists Gateway network scan sources. | +| [**GetNetScan**](NetApi.md#getnetscan) | **GET** /jet/net/scan | Stream network scan events over a websocket. | # **GetNetConfig** @@ -101,3 +103,258 @@ This endpoint does not need any parameter. [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GetNetInterfaces** +> NetworkInterfacesResponse GetNetInterfaces () + +Lists Gateway network scan sources. + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using System.Net.Http; +using Devolutions.Gateway.Client.Api; +using Devolutions.Gateway.Client.Client; +using Devolutions.Gateway.Client.Model; + +namespace Example +{ + public class GetNetInterfacesExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost"; + // Configure Bearer token for authorization: netscan_token + config.AccessToken = "YOUR_BEARER_TOKEN"; + + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new NetApi(httpClient, config, httpClientHandler); + + try + { + // Lists Gateway network scan sources. + NetworkInterfacesResponse result = apiInstance.GetNetInterfaces(); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling NetApi.GetNetInterfaces: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the GetNetInterfacesWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Lists Gateway network scan sources. + ApiResponse response = apiInstance.GetNetInterfacesWithHttpInfo(); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling NetApi.GetNetInterfacesWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters +This endpoint does not need any parameter. +### Return type + +[**NetworkInterfacesResponse**](NetworkInterfacesResponse.md) + +### Authorization + +[netscan_token](../README.md#netscan_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Gateway network scan sources | - | +| **400** | Bad request | - | +| **401** | Invalid or missing authorization token | - | +| **403** | Insufficient permissions | - | +| **500** | Unexpected server error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **GetNetScan** +> void GetNetScan (long? pingInterval = null, long? pingTimeout = null, long? broadcastTimeout = null, long? portScanTimeout = null, long? netbiosTimeout = null, long? netbiosInterval = null, long? mdnsQueryTimeout = null, long? maxWait = null, List? range = null, List? target = null, List? interfaceId = null, List? probe = null, bool? enablePingStart = null, bool? enableBroadcast = null, bool? enableSubnetScan = null, bool? enableZeroconf = null, bool? enableNetbios = null, bool? enableResolveDns = null, bool? includeHostResults = null, bool? reportPingStart = null, bool? reportPingSuccess = null, bool? reportPingFailure = null, bool? enableTcpProbes = null, string? rangeInterfacePolicy = null, bool? allowCrossInterfaceRange = null, string? responseFormat = null, int? maxConcurrency = null, int? maxPingConcurrency = null, int? maxTcpProbeConcurrency = null, bool? enableFailure = null, bool? reportTcpFailure = null, bool? interfaceBindStrict = null) + +Stream network scan events over a websocket. + +The endpoint is upgraded from HTTP, so OpenAPI describes the **handshake**: the query parameters that drive the scan (validated before upgrade) and the legacy / v1 event payloads streamed back as JSON text frames. See `NetworkScanResultEvent` for the v1 shape and `LegacyScanEvent` for the legacy shape (selected via `response_format`). + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using System.Net.Http; +using Devolutions.Gateway.Client.Api; +using Devolutions.Gateway.Client.Client; +using Devolutions.Gateway.Client.Model; + +namespace Example +{ + public class GetNetScanExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost"; + // Configure Bearer token for authorization: netscan_token + config.AccessToken = "YOUR_BEARER_TOKEN"; + + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new NetApi(httpClient, config, httpClientHandler); + var pingInterval = 789L; // long? | Interval in milliseconds (default is 200) (optional) + var pingTimeout = 789L; // long? | Timeout in milliseconds (default is 500) (optional) + var broadcastTimeout = 789L; // long? | Timeout in milliseconds (default is 1000) (optional) + var portScanTimeout = 789L; // long? | Timeout in milliseconds (default is 1000) (optional) + var netbiosTimeout = 789L; // long? | Timeout in milliseconds (default is 1000) (optional) + var netbiosInterval = 789L; // long? | Interval in milliseconds (default is 200) (optional) + var mdnsQueryTimeout = 789L; // long? | The maximum time for each mdns query in milliseconds. (default is 5 * 1000) (optional) + var maxWait = 789L; // long? | The maximum duration for whole networking scan in milliseconds. Highly suggested! (optional) + var range = new List?(); // List? | The start and end IP address of the range to scan. for example: 10.10.0.0-10.10.0.255 (optional) + var target = new List?(); // List? | Explicit single-host targets to scan. Each value must parse as an IPv4 or IPv6 address; invalid values yield a structured `{ error: \"invalid_target\", value: \"\" }` 400 rather than a generic serde rejection at extraction time (mirrors the `range=` / `probe=` validation path). (optional) + var interfaceId = new List?(); // List? | Gateway network interface IDs to use as scan sources. (optional) + var probe = new List?(); // List? | The probes to run. Each value is either `ping`, a port number (`22`), or a named service (`rdp`, `https`, ΓǪ). Validation is deferred to scan-time so failures can be surfaced as a structured 400 ΓÇö naming the offending value ΓÇö instead of a generic serde rejection at extraction time. (optional) + var enablePingStart = true; // bool? | **Legacy alias** for `report_ping_start`. Prefer the explicit name in new clients; kept so existing consumers don't break. (optional) + var enableBroadcast = true; // bool? | Enable the execution of broadcast scan (optional) + var enableSubnetScan = true; // bool? | Enable the ping scan on subnet (optional) + var enableZeroconf = true; // bool? | Enable ZeroConf/mDNS (optional) + var enableNetbios = true; // bool? | Enable NetBIOS name-service queries. Default `true` for backward compatibility. Set `false` (or pair with explicit `target=`) to keep NetBIOS from sweeping the surrounding subnet when the caller only wants results for the targets they listed. (optional) + var enableResolveDns = true; // bool? | Enable resolve dns (optional) + var includeHostResults = true; // bool? | Include host-only results. (optional) + var reportPingStart = true; // bool? | Emit ping queued/start host results. (optional) + var reportPingSuccess = true; // bool? | Emit ping success host results. (optional) + var reportPingFailure = true; // bool? | Emit ping failure host results. (optional) + var enableTcpProbes = true; // bool? | Enable TCP service probes. (optional) + var rangeInterfacePolicy = "rangeInterfacePolicy_example"; // string? | Policy applied when `range=` and `interface_id=` are both provided. Accepted values: `intersect_selected_interfaces` (default) or `allow_cross_interface_range`. Invalid values yield a structured `{ error: \"invalid_range_interface_policy\", value: \"\" }` 400 instead of a generic serde rejection (mirrors the `range=` / `probe=` / `target=` validation path). (optional) + var allowCrossInterfaceRange = true; // bool? | **Legacy alias** for `range_interface_policy=allow_cross_interface_range`. Prefer the structured policy in new clients. (optional) + var responseFormat = "responseFormat_example"; // string? | Response shape emitted on the websocket. Accepted values: `legacy` (default) or `network_scan_result_v1`. Invalid values yield a structured `{ error: \"invalid_response_format\", value: \"\" }` 400 instead of a generic serde rejection. (optional) + var maxConcurrency = 56; // int? | Maximum scanner concurrency. (optional) + var maxPingConcurrency = 56; // int? | Maximum ping probe concurrency. (optional) + var maxTcpProbeConcurrency = 56; // int? | Maximum TCP probe concurrency. (optional) + var enableFailure = true; // bool? | **Legacy alias** for `report_ping_failure`. `enable_failure=true` only opts into ping-failure events; TCP-probe failure events require the explicit `report_tcp_failure=true` and are not affected by this alias. **Behavior change:** historically this single flag controlled both ping-failure and TCP-probe-failure reporting. The two are now split: clients that want the old \"both at once\" semantics must send `enable_failure=true&report_tcp_failure=true` together. The split is intentional ΓÇö TCP-probe failures are typically high-volume noise that callers were filtering client-side anyway, so the two streams are independently gated. (optional) + var reportTcpFailure = true; // bool? | Enable TCP port knocking failure events. (optional) + var interfaceBindStrict = true; // bool? | When `true`, fail with HTTP 400 if a ping/TCP-probe socket cannot be bound to the planner-selected interface. Default `false` (warn and fall back to default routing). (optional) + + try + { + // Stream network scan events over a websocket. + apiInstance.GetNetScan(pingInterval, pingTimeout, broadcastTimeout, portScanTimeout, netbiosTimeout, netbiosInterval, mdnsQueryTimeout, maxWait, range, target, interfaceId, probe, enablePingStart, enableBroadcast, enableSubnetScan, enableZeroconf, enableNetbios, enableResolveDns, includeHostResults, reportPingStart, reportPingSuccess, reportPingFailure, enableTcpProbes, rangeInterfacePolicy, allowCrossInterfaceRange, responseFormat, maxConcurrency, maxPingConcurrency, maxTcpProbeConcurrency, enableFailure, reportTcpFailure, interfaceBindStrict); + } + catch (ApiException e) + { + Debug.Print("Exception when calling NetApi.GetNetScan: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the GetNetScanWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Stream network scan events over a websocket. + apiInstance.GetNetScanWithHttpInfo(pingInterval, pingTimeout, broadcastTimeout, portScanTimeout, netbiosTimeout, netbiosInterval, mdnsQueryTimeout, maxWait, range, target, interfaceId, probe, enablePingStart, enableBroadcast, enableSubnetScan, enableZeroconf, enableNetbios, enableResolveDns, includeHostResults, reportPingStart, reportPingSuccess, reportPingFailure, enableTcpProbes, rangeInterfacePolicy, allowCrossInterfaceRange, responseFormat, maxConcurrency, maxPingConcurrency, maxTcpProbeConcurrency, enableFailure, reportTcpFailure, interfaceBindStrict); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling NetApi.GetNetScanWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **pingInterval** | **long?** | Interval in milliseconds (default is 200) | [optional] | +| **pingTimeout** | **long?** | Timeout in milliseconds (default is 500) | [optional] | +| **broadcastTimeout** | **long?** | Timeout in milliseconds (default is 1000) | [optional] | +| **portScanTimeout** | **long?** | Timeout in milliseconds (default is 1000) | [optional] | +| **netbiosTimeout** | **long?** | Timeout in milliseconds (default is 1000) | [optional] | +| **netbiosInterval** | **long?** | Interval in milliseconds (default is 200) | [optional] | +| **mdnsQueryTimeout** | **long?** | The maximum time for each mdns query in milliseconds. (default is 5 * 1000) | [optional] | +| **maxWait** | **long?** | The maximum duration for whole networking scan in milliseconds. Highly suggested! | [optional] | +| **range** | [**List<string>?**](string.md) | The start and end IP address of the range to scan. for example: 10.10.0.0-10.10.0.255 | [optional] | +| **target** | [**List<string>?**](string.md) | Explicit single-host targets to scan. Each value must parse as an IPv4 or IPv6 address; invalid values yield a structured `{ error: \"invalid_target\", value: \"<raw>\" }` 400 rather than a generic serde rejection at extraction time (mirrors the `range=` / `probe=` validation path). | [optional] | +| **interfaceId** | [**List<string>?**](string.md) | Gateway network interface IDs to use as scan sources. | [optional] | +| **probe** | [**List<string>?**](string.md) | The probes to run. Each value is either `ping`, a port number (`22`), or a named service (`rdp`, `https`, ΓǪ). Validation is deferred to scan-time so failures can be surfaced as a structured 400 ΓÇö naming the offending value ΓÇö instead of a generic serde rejection at extraction time. | [optional] | +| **enablePingStart** | **bool?** | **Legacy alias** for `report_ping_start`. Prefer the explicit name in new clients; kept so existing consumers don't break. | [optional] | +| **enableBroadcast** | **bool?** | Enable the execution of broadcast scan | [optional] | +| **enableSubnetScan** | **bool?** | Enable the ping scan on subnet | [optional] | +| **enableZeroconf** | **bool?** | Enable ZeroConf/mDNS | [optional] | +| **enableNetbios** | **bool?** | Enable NetBIOS name-service queries. Default `true` for backward compatibility. Set `false` (or pair with explicit `target=`) to keep NetBIOS from sweeping the surrounding subnet when the caller only wants results for the targets they listed. | [optional] | +| **enableResolveDns** | **bool?** | Enable resolve dns | [optional] | +| **includeHostResults** | **bool?** | Include host-only results. | [optional] | +| **reportPingStart** | **bool?** | Emit ping queued/start host results. | [optional] | +| **reportPingSuccess** | **bool?** | Emit ping success host results. | [optional] | +| **reportPingFailure** | **bool?** | Emit ping failure host results. | [optional] | +| **enableTcpProbes** | **bool?** | Enable TCP service probes. | [optional] | +| **rangeInterfacePolicy** | **string?** | Policy applied when `range=` and `interface_id=` are both provided. Accepted values: `intersect_selected_interfaces` (default) or `allow_cross_interface_range`. Invalid values yield a structured `{ error: \"invalid_range_interface_policy\", value: \"<raw>\" }` 400 instead of a generic serde rejection (mirrors the `range=` / `probe=` / `target=` validation path). | [optional] | +| **allowCrossInterfaceRange** | **bool?** | **Legacy alias** for `range_interface_policy=allow_cross_interface_range`. Prefer the structured policy in new clients. | [optional] | +| **responseFormat** | **string?** | Response shape emitted on the websocket. Accepted values: `legacy` (default) or `network_scan_result_v1`. Invalid values yield a structured `{ error: \"invalid_response_format\", value: \"<raw>\" }` 400 instead of a generic serde rejection. | [optional] | +| **maxConcurrency** | **int?** | Maximum scanner concurrency. | [optional] | +| **maxPingConcurrency** | **int?** | Maximum ping probe concurrency. | [optional] | +| **maxTcpProbeConcurrency** | **int?** | Maximum TCP probe concurrency. | [optional] | +| **enableFailure** | **bool?** | **Legacy alias** for `report_ping_failure`. `enable_failure=true` only opts into ping-failure events; TCP-probe failure events require the explicit `report_tcp_failure=true` and are not affected by this alias. **Behavior change:** historically this single flag controlled both ping-failure and TCP-probe-failure reporting. The two are now split: clients that want the old \"both at once\" semantics must send `enable_failure=true&report_tcp_failure=true` together. The split is intentional ΓÇö TCP-probe failures are typically high-volume noise that callers were filtering client-side anyway, so the two streams are independently gated. | [optional] | +| **reportTcpFailure** | **bool?** | Enable TCP port knocking failure events. | [optional] | +| **interfaceBindStrict** | **bool?** | When `true`, fail with HTTP 400 if a ping/TCP-probe socket cannot be bound to the planner-selected interface. Default `false` (warn and fall back to default routing). | [optional] | + +### Return type + +void (empty response body) + +### Authorization + +[netscan_token](../README.md#netscan_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **101** | WebSocket upgrade; subsequent text frames carry NetworkScanResultEvent or LegacyScanEvent JSON | - | +| **400** | Invalid query, mixed target/range, oversized range, or selected interface error | - | +| **401** | Invalid or missing authorization token | - | +| **403** | Insufficient permissions | - | +| **500** | Unexpected server error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/devolutions-gateway/openapi/dotnet-client/docs/NetworkInterfaceDto.md b/devolutions-gateway/openapi/dotnet-client/docs/NetworkInterfaceDto.md new file mode 100644 index 000000000..43198fc8e --- /dev/null +++ b/devolutions-gateway/openapi/dotnet-client/docs/NetworkInterfaceDto.md @@ -0,0 +1,18 @@ +# Devolutions.Gateway.Client.Model.NetworkInterfaceDto + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Description** | **string** | | [optional] +**Id** | **string** | | +**Index** | **int?** | | [optional] +**IsUp** | **bool?** | | [optional] +**LinkType** | **string** | Coarse link type: `ethernet`, `wifi`, `loopback`, `virtual`, `unknown`. | [optional] +**MacAddress** | **string** | | [optional] +**Mtu** | **int?** | MTU in bytes when known. | [optional] +**Name** | **string** | | +**SpeedMbps** | **long?** | Link speed in megabits per second when reported by the OS. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/devolutions-gateway/openapi/dotnet-client/docs/NetworkInterfacesResponse.md b/devolutions-gateway/openapi/dotnet-client/docs/NetworkInterfacesResponse.md new file mode 100644 index 000000000..179220e3d --- /dev/null +++ b/devolutions-gateway/openapi/dotnet-client/docs/NetworkInterfacesResponse.md @@ -0,0 +1,10 @@ +# Devolutions.Gateway.Client.Model.NetworkInterfacesResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Interfaces** | [**List<NetworkScanSourceDto>**](NetworkScanSourceDto.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/devolutions-gateway/openapi/dotnet-client/docs/NetworkScanResultEventDto.md b/devolutions-gateway/openapi/dotnet-client/docs/NetworkScanResultEventDto.md new file mode 100644 index 000000000..4b24baa49 --- /dev/null +++ b/devolutions-gateway/openapi/dotnet-client/docs/NetworkScanResultEventDto.md @@ -0,0 +1,23 @@ +# Devolutions.Gateway.Client.Model.NetworkScanResultEventDto + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Address** | **string** | | +**DiscoverySource** | **ScanResultSourceDto** | | +**HostName** | **string** | | [optional] +**HostScanState** | **HostScanStateDto** | | [optional] +**InterfaceId** | **string** | | [optional] +**InterfaceName** | **string** | | [optional] +**IsReachable** | **bool?** | | [optional] +**Kind** | **NetworkScanResultKindDto** | | +**MacAddress** | **string** | | [optional] +**Port** | **int?** | | [optional] +**ResponseTimeMs** | **int?** | | [optional] +**ServiceLabel** | **string** | | [optional] +**ServiceType** | **string** | | [optional] +**Source** | **ScanOriginDto** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/devolutions-gateway/openapi/dotnet-client/docs/NetworkScanResultKindDto.md b/devolutions-gateway/openapi/dotnet-client/docs/NetworkScanResultKindDto.md new file mode 100644 index 000000000..d9975c71e --- /dev/null +++ b/devolutions-gateway/openapi/dotnet-client/docs/NetworkScanResultKindDto.md @@ -0,0 +1,9 @@ +# Devolutions.Gateway.Client.Model.NetworkScanResultKindDto + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/devolutions-gateway/openapi/dotnet-client/docs/NetworkScanSourceCapabilitiesDto.md b/devolutions-gateway/openapi/dotnet-client/docs/NetworkScanSourceCapabilitiesDto.md new file mode 100644 index 000000000..72cbe518d --- /dev/null +++ b/devolutions-gateway/openapi/dotnet-client/docs/NetworkScanSourceCapabilitiesDto.md @@ -0,0 +1,16 @@ +# Devolutions.Gateway.Client.Model.NetworkScanSourceCapabilitiesDto + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Broadcast** | **bool** | | +**DnsResolve** | **bool** | | +**Ipv4** | **bool** | | +**Ipv6** | **bool** | | +**Subnet** | **bool** | | +**TcpProbe** | **bool** | | +**ZeroConf** | **bool** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/devolutions-gateway/openapi/dotnet-client/docs/NetworkScanSourceDto.md b/devolutions-gateway/openapi/dotnet-client/docs/NetworkScanSourceDto.md new file mode 100644 index 000000000..712c6ac24 --- /dev/null +++ b/devolutions-gateway/openapi/dotnet-client/docs/NetworkScanSourceDto.md @@ -0,0 +1,16 @@ +# Devolutions.Gateway.Client.Model.NetworkScanSourceDto + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Address** | **string** | | +**BroadcastAddress** | **string** | | [optional] +**Capabilities** | [**NetworkScanSourceCapabilitiesDto**](NetworkScanSourceCapabilitiesDto.md) | | +**EndAddress** | **string** | | +**Interface** | [**NetworkInterfaceDto**](NetworkInterfaceDto.md) | | +**PrefixLength** | **int?** | | [optional] +**StartAddress** | **string** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/devolutions-gateway/openapi/dotnet-client/docs/PreflightOperation.md b/devolutions-gateway/openapi/dotnet-client/docs/PreflightOperation.md index 926754235..022b2843f 100644 --- a/devolutions-gateway/openapi/dotnet-client/docs/PreflightOperation.md +++ b/devolutions-gateway/openapi/dotnet-client/docs/PreflightOperation.md @@ -9,7 +9,7 @@ Name | Type | Description | Notes **Kind** | **PreflightOperationKind** | | **ProxyCredential** | [**AppCredential**](AppCredential.md) | | [optional] **TargetCredential** | [**AppCredential**](AppCredential.md) | | [optional] -**TimeToLive** | **int?** | Minimum persistance duration in seconds for the data provisioned via this operation. Optional parameter for \"provision-token\" and \"provision-credentials\" kinds. | [optional] +**TimeToLive** | **int?** | Minimum persistence duration in seconds for the data provisioned via this operation. Optional parameter for \"provision-token\" and \"provision-credentials\" kinds. | [optional] **Token** | **string** | The token to be stored on the proxy-side. Required for \"provision-token\" and \"provision-credentials\" kinds. | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/devolutions-gateway/openapi/dotnet-client/docs/ScanOriginDto.md b/devolutions-gateway/openapi/dotnet-client/docs/ScanOriginDto.md new file mode 100644 index 000000000..8256f5282 --- /dev/null +++ b/devolutions-gateway/openapi/dotnet-client/docs/ScanOriginDto.md @@ -0,0 +1,9 @@ +# Devolutions.Gateway.Client.Model.ScanOriginDto + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/devolutions-gateway/openapi/dotnet-client/docs/ScanResultSourceDto.md b/devolutions-gateway/openapi/dotnet-client/docs/ScanResultSourceDto.md new file mode 100644 index 000000000..09e07d005 --- /dev/null +++ b/devolutions-gateway/openapi/dotnet-client/docs/ScanResultSourceDto.md @@ -0,0 +1,9 @@ +# Devolutions.Gateway.Client.Model.ScanResultSourceDto + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/devolutions-gateway/openapi/dotnet-client/docs/SetUpdateScheduleRequest.md b/devolutions-gateway/openapi/dotnet-client/docs/SetUpdateScheduleRequest.md new file mode 100644 index 000000000..90d7fc8a4 --- /dev/null +++ b/devolutions-gateway/openapi/dotnet-client/docs/SetUpdateScheduleRequest.md @@ -0,0 +1,15 @@ +# Devolutions.Gateway.Client.Model.SetUpdateScheduleRequest +Desired auto-update schedule to apply to Devolutions Agent. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Enabled** | **bool** | Enable periodic Devolutions Agent self-update checks. | +**Interval** | **long** | Minimum interval between auto-update checks, in seconds. `0` means check once at `UpdateWindowStart` (default). | [optional] +**Products** | **List<string>** | Products the agent autonomously polls for new versions (default: empty). | [optional] +**UpdateWindowEnd** | **int?** | End of the maintenance window as seconds past midnight in local time, exclusive. `null` (default) means no upper bound - a single check fires at `UpdateWindowStart`. When end < start the window crosses midnight. | [optional] +**UpdateWindowStart** | **int** | Start of the maintenance window as seconds past midnight in local time (default: `7200` = 02:00). | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/devolutions-gateway/openapi/dotnet-client/docs/UpdateApi.md b/devolutions-gateway/openapi/dotnet-client/docs/UpdateApi.md index 2cc70c368..ffd85c00a 100644 --- a/devolutions-gateway/openapi/dotnet-client/docs/UpdateApi.md +++ b/devolutions-gateway/openapi/dotnet-client/docs/UpdateApi.md @@ -4,15 +4,315 @@ All URIs are relative to *http://localhost* | Method | HTTP request | Description | |--------|--------------|-------------| -| [**TriggerUpdate**](UpdateApi.md#triggerupdate) | **POST** /jet/update | Triggers Devolutions Gateway update process. | +| [**GetUpdateProducts**](UpdateApi.md#getupdateproducts) | **GET** /jet/update | Retrieve the currently installed version of each Devolutions product. | +| [**GetUpdateSchedule**](UpdateApi.md#getupdateschedule) | **GET** /jet/update/schedule | Retrieve the current Devolutions Agent auto-update schedule. | +| [**SetUpdateSchedule**](UpdateApi.md#setupdateschedule) | **POST** /jet/update/schedule | Set the Devolutions Agent auto-update schedule. | +| [**TriggerUpdate**](UpdateApi.md#triggerupdate) | **POST** /jet/update | Trigger an update for one or more Devolutions products. | + + +# **GetUpdateProducts** +> GetUpdateProductsResponse GetUpdateProducts () + +Retrieve the currently installed version of each Devolutions product. + +Reads `update_status.json`, which is written by the Devolutions Agent on startup and refreshed after every update run. When the file does not exist (agent not installed or is an older version), the endpoint returns HTTP 503 because updater status is unavailable. + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using System.Net.Http; +using Devolutions.Gateway.Client.Api; +using Devolutions.Gateway.Client.Client; +using Devolutions.Gateway.Client.Model; + +namespace Example +{ + public class GetUpdateProductsExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost"; + // Configure Bearer token for authorization: scope_token + config.AccessToken = "YOUR_BEARER_TOKEN"; + + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new UpdateApi(httpClient, config, httpClientHandler); + + try + { + // Retrieve the currently installed version of each Devolutions product. + GetUpdateProductsResponse result = apiInstance.GetUpdateProducts(); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling UpdateApi.GetUpdateProducts: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the GetUpdateProductsWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Retrieve the currently installed version of each Devolutions product. + ApiResponse response = apiInstance.GetUpdateProductsWithHttpInfo(); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling UpdateApi.GetUpdateProductsWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters +This endpoint does not need any parameter. +### Return type + +[**GetUpdateProductsResponse**](GetUpdateProductsResponse.md) + +### Authorization + +[scope_token](../README.md#scope_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Installed product versions | - | +| **401** | Invalid or missing authorization token | - | +| **403** | Insufficient permissions | - | +| **500** | Failed to read agent status file | - | +| **503** | Agent updater service is unavailable | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **GetUpdateSchedule** +> GetUpdateScheduleResponse GetUpdateSchedule () + +Retrieve the current Devolutions Agent auto-update schedule. + +Reads the `Schedule` field from `update_status.json`. When the field is absent the response contains zeroed defaults (`Enabled: false`, interval `0`, window start `0`, no products). + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using System.Net.Http; +using Devolutions.Gateway.Client.Api; +using Devolutions.Gateway.Client.Client; +using Devolutions.Gateway.Client.Model; + +namespace Example +{ + public class GetUpdateScheduleExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost"; + // Configure Bearer token for authorization: scope_token + config.AccessToken = "YOUR_BEARER_TOKEN"; + + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new UpdateApi(httpClient, config, httpClientHandler); + + try + { + // Retrieve the current Devolutions Agent auto-update schedule. + GetUpdateScheduleResponse result = apiInstance.GetUpdateSchedule(); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling UpdateApi.GetUpdateSchedule: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the GetUpdateScheduleWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Retrieve the current Devolutions Agent auto-update schedule. + ApiResponse response = apiInstance.GetUpdateScheduleWithHttpInfo(); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling UpdateApi.GetUpdateScheduleWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters +This endpoint does not need any parameter. +### Return type + +[**GetUpdateScheduleResponse**](GetUpdateScheduleResponse.md) + +### Authorization + +[scope_token](../README.md#scope_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Current auto-update schedule | - | +| **401** | Invalid or missing authorization token | - | +| **403** | Insufficient permissions | - | +| **500** | Failed to read agent status file | - | +| **503** | Agent updater service is unavailable | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **SetUpdateSchedule** +> Object SetUpdateSchedule (SetUpdateScheduleRequest setUpdateScheduleRequest) + +Set the Devolutions Agent auto-update schedule. + +Writes the `Schedule` field into `update.json`. The agent watches this file and applies the new schedule immediately, then persists it to `agent.json`. All other fields in `update.json` are preserved; the `VersionMinor` field is reset to the minor version this gateway build understands so the agent does not see an unknown future version. + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using System.Net.Http; +using Devolutions.Gateway.Client.Api; +using Devolutions.Gateway.Client.Client; +using Devolutions.Gateway.Client.Model; + +namespace Example +{ + public class SetUpdateScheduleExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://localhost"; + // Configure Bearer token for authorization: scope_token + config.AccessToken = "YOUR_BEARER_TOKEN"; + + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new UpdateApi(httpClient, config, httpClientHandler); + var setUpdateScheduleRequest = new SetUpdateScheduleRequest(); // SetUpdateScheduleRequest | + + try + { + // Set the Devolutions Agent auto-update schedule. + Object result = apiInstance.SetUpdateSchedule(setUpdateScheduleRequest); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling UpdateApi.SetUpdateSchedule: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the SetUpdateScheduleWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Set the Devolutions Agent auto-update schedule. + ApiResponse response = apiInstance.SetUpdateScheduleWithHttpInfo(setUpdateScheduleRequest); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling UpdateApi.SetUpdateScheduleWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **setUpdateScheduleRequest** | [**SetUpdateScheduleRequest**](SetUpdateScheduleRequest.md) | | | + +### Return type + +**Object** + +### Authorization + +[scope_token](../README.md#scope_token) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Auto-update schedule applied | - | +| **400** | Bad request | - | +| **401** | Invalid or missing authorization token | - | +| **403** | Insufficient permissions | - | +| **500** | Failed to write update manifest | - | +| **503** | Agent updater service is unavailable | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **TriggerUpdate** -> Object TriggerUpdate (string version) +> Object TriggerUpdate (string? version = null, UpdateRequestSchema? updateRequestSchema = null) -Triggers Devolutions Gateway update process. +Trigger an update for one or more Devolutions products. -This is done via updating `Agent/update.json` file, which is then read by Devolutions Agent when changes are detected. If the version written to `update.json` is indeed higher than the currently installed version, Devolutions Agent will proceed with the update process. +Writes the requested version(s) into `Agent/update.json`, which is watched by Devolutions Agent. When a requested version is higher than the installed version the agent proceeds with the update. **Body form** (preferred): pass a JSON body with a `Products` map. **Query-param form** (legacy, gateway-only): `POST /jet/update?version=latest`. This form updates only the Gateway product and is kept for backward compatibility. Both forms cannot be used simultaneously; doing so returns HTTP 400. ### Example ```csharp @@ -38,12 +338,13 @@ namespace Example HttpClient httpClient = new HttpClient(); HttpClientHandler httpClientHandler = new HttpClientHandler(); var apiInstance = new UpdateApi(httpClient, config, httpClientHandler); - var version = "version_example"; // string | The version to install; use 'latest' for the latest version, or 'w.x.y.z' for a specific version + var version = "version_example"; // string? | Gateway-only target version; use the request body for multi-product updates (optional) + var updateRequestSchema = new UpdateRequestSchema?(); // UpdateRequestSchema? | Products and target versions to update (optional) try { - // Triggers Devolutions Gateway update process. - Object result = apiInstance.TriggerUpdate(version); + // Trigger an update for one or more Devolutions products. + Object result = apiInstance.TriggerUpdate(version, updateRequestSchema); Debug.WriteLine(result); } catch (ApiException e) @@ -63,8 +364,8 @@ This returns an ApiResponse object which contains the response data, status code ```csharp try { - // Triggers Devolutions Gateway update process. - ApiResponse response = apiInstance.TriggerUpdateWithHttpInfo(version); + // Trigger an update for one or more Devolutions products. + ApiResponse response = apiInstance.TriggerUpdateWithHttpInfo(version, updateRequestSchema); Debug.Write("Status Code: " + response.StatusCode); Debug.Write("Response Headers: " + response.Headers); Debug.Write("Response Body: " + response.Data); @@ -81,7 +382,8 @@ catch (ApiException e) | Name | Type | Description | Notes | |------|------|-------------|-------| -| **version** | **string** | The version to install; use 'latest' for the latest version, or 'w.x.y.z' for a specific version | | +| **version** | **string?** | Gateway-only target version; use the request body for multi-product updates | [optional] | +| **updateRequestSchema** | [**UpdateRequestSchema?**](UpdateRequestSchema?.md) | Products and target versions to update | [optional] | ### Return type @@ -93,18 +395,18 @@ catch (ApiException e) ### HTTP request headers - - **Content-Type**: Not defined + - **Content-Type**: application/json - **Accept**: application/json ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -| **200** | Update request has been processed successfully | - | +| **200** | Update request accepted | - | | **400** | Bad request | - | | **401** | Invalid or missing authorization token | - | | **403** | Insufficient permissions | - | -| **500** | Agent updater service is malfunctioning | - | +| **500** | Failed to write update manifest | - | | **503** | Agent updater service is unavailable | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/devolutions-gateway/openapi/dotnet-client/docs/UpdateProductInfo.md b/devolutions-gateway/openapi/dotnet-client/docs/UpdateProductInfo.md new file mode 100644 index 000000000..fc61d2909 --- /dev/null +++ b/devolutions-gateway/openapi/dotnet-client/docs/UpdateProductInfo.md @@ -0,0 +1,11 @@ +# Devolutions.Gateway.Client.Model.UpdateProductInfo +Per-product update information. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**VarVersion** | **string** | Requested or installed version: `\"latest\"` or `\"YYYY.M.D\"` / `\"YYYY.M.D.R\"`. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/devolutions-gateway/openapi/dotnet-client/docs/UpdateRequestSchema.md b/devolutions-gateway/openapi/dotnet-client/docs/UpdateRequestSchema.md new file mode 100644 index 000000000..161ad7b7b --- /dev/null +++ b/devolutions-gateway/openapi/dotnet-client/docs/UpdateRequestSchema.md @@ -0,0 +1,11 @@ +# Devolutions.Gateway.Client.Model.UpdateRequestSchema +OpenAPI schema for the update request body. The API accepts an object containing a `Products` map, whose keys are product names and whose values are update information. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Products** | [**Dictionary<string, UpdateProductInfo>**](UpdateProductInfo.md) | Map of product name to update information. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Api/ConfigApi.cs b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Api/ConfigApi.cs index e83d5a92c..0472c53c2 100644 --- a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Api/ConfigApi.cs +++ b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Api/ConfigApi.cs @@ -3,7 +3,7 @@ * * Protocol-aware fine-grained relay server * - * The version of the OpenAPI document: 2025.3.2 + * The version of the OpenAPI document: 2026.2.4 * Contact: infos@devolutions.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -65,7 +65,7 @@ public interface IConfigApiAsync : IApiAccessor /// JSON-encoded configuration patch /// Cancellation Token to cancel the request. /// Task of void - System.Threading.Tasks.Task PatchConfigAsync(ConfigPatch configPatch, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task PatchConfigAsync(ConfigPatch configPatch, System.Threading.CancellationToken cancellationToken = default); /// /// Modifies configuration @@ -77,7 +77,7 @@ public interface IConfigApiAsync : IApiAccessor /// JSON-encoded configuration patch /// Cancellation Token to cancel the request. /// Task of ApiResponse - System.Threading.Tasks.Task> PatchConfigWithHttpInfoAsync(ConfigPatch configPatch, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task> PatchConfigWithHttpInfoAsync(ConfigPatch configPatch, System.Threading.CancellationToken cancellationToken = default); #endregion Asynchronous Operations } @@ -358,7 +358,7 @@ public Devolutions.Gateway.Client.Client.ApiResponse PatchConfigWithHttp /// JSON-encoded configuration patch /// Cancellation Token to cancel the request. /// Task of void - public async System.Threading.Tasks.Task PatchConfigAsync(ConfigPatch configPatch, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task PatchConfigAsync(ConfigPatch configPatch, System.Threading.CancellationToken cancellationToken = default) { await PatchConfigWithHttpInfoAsync(configPatch, cancellationToken).ConfigureAwait(false); } @@ -370,7 +370,7 @@ public Devolutions.Gateway.Client.Client.ApiResponse PatchConfigWithHttp /// JSON-encoded configuration patch /// Cancellation Token to cancel the request. /// Task of ApiResponse - public async System.Threading.Tasks.Task> PatchConfigWithHttpInfoAsync(ConfigPatch configPatch, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> PatchConfigWithHttpInfoAsync(ConfigPatch configPatch, System.Threading.CancellationToken cancellationToken = default) { // verify the required parameter 'configPatch' is set if (configPatch == null) diff --git a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Api/DiagnosticsApi.cs b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Api/DiagnosticsApi.cs index 96d0a7d9d..f551f173a 100644 --- a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Api/DiagnosticsApi.cs +++ b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Api/DiagnosticsApi.cs @@ -3,7 +3,7 @@ * * Protocol-aware fine-grained relay server * - * The version of the OpenAPI document: 2025.3.2 + * The version of the OpenAPI document: 2026.2.4 * Contact: infos@devolutions.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -100,7 +100,7 @@ public interface IDiagnosticsApiAsync : IApiAccessor /// Thrown when fails to make API call /// Cancellation Token to cancel the request. /// Task of ClockDiagnostic - System.Threading.Tasks.Task GetClockDiagnosticAsync(System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task GetClockDiagnosticAsync(System.Threading.CancellationToken cancellationToken = default); /// /// Retrieves server's clock in order to diagnose clock drifting. @@ -111,7 +111,7 @@ public interface IDiagnosticsApiAsync : IApiAccessor /// Thrown when fails to make API call /// Cancellation Token to cancel the request. /// Task of ApiResponse (ClockDiagnostic) - System.Threading.Tasks.Task> GetClockDiagnosticWithHttpInfoAsync(System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task> GetClockDiagnosticWithHttpInfoAsync(System.Threading.CancellationToken cancellationToken = default); /// /// Retrieves a subset of the configuration, for diagnosis purposes. /// @@ -121,7 +121,7 @@ public interface IDiagnosticsApiAsync : IApiAccessor /// Thrown when fails to make API call /// Cancellation Token to cancel the request. /// Task of ConfigDiagnostic - System.Threading.Tasks.Task GetConfigurationDiagnosticAsync(System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task GetConfigurationDiagnosticAsync(System.Threading.CancellationToken cancellationToken = default); /// /// Retrieves a subset of the configuration, for diagnosis purposes. @@ -132,7 +132,7 @@ public interface IDiagnosticsApiAsync : IApiAccessor /// Thrown when fails to make API call /// Cancellation Token to cancel the request. /// Task of ApiResponse (ConfigDiagnostic) - System.Threading.Tasks.Task> GetConfigurationDiagnosticWithHttpInfoAsync(System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task> GetConfigurationDiagnosticWithHttpInfoAsync(System.Threading.CancellationToken cancellationToken = default); /// /// Retrieves latest logs. /// @@ -142,7 +142,7 @@ public interface IDiagnosticsApiAsync : IApiAccessor /// Thrown when fails to make API call /// Cancellation Token to cancel the request. /// Task of string - System.Threading.Tasks.Task GetLogsAsync(System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task GetLogsAsync(System.Threading.CancellationToken cancellationToken = default); /// /// Retrieves latest logs. @@ -153,7 +153,7 @@ public interface IDiagnosticsApiAsync : IApiAccessor /// Thrown when fails to make API call /// Cancellation Token to cancel the request. /// Task of ApiResponse (string) - System.Threading.Tasks.Task> GetLogsWithHttpInfoAsync(System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task> GetLogsWithHttpInfoAsync(System.Threading.CancellationToken cancellationToken = default); #endregion Asynchronous Operations } @@ -421,7 +421,7 @@ public Devolutions.Gateway.Client.Client.ApiResponse GetClockDi /// Thrown when fails to make API call /// Cancellation Token to cancel the request. /// Task of ClockDiagnostic - public async System.Threading.Tasks.Task GetClockDiagnosticAsync(System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task GetClockDiagnosticAsync(System.Threading.CancellationToken cancellationToken = default) { Devolutions.Gateway.Client.Client.ApiResponse localVarResponse = await GetClockDiagnosticWithHttpInfoAsync(cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -433,7 +433,7 @@ public Devolutions.Gateway.Client.Client.ApiResponse GetClockDi /// Thrown when fails to make API call /// Cancellation Token to cancel the request. /// Task of ApiResponse (ClockDiagnostic) - public async System.Threading.Tasks.Task> GetClockDiagnosticWithHttpInfoAsync(System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> GetClockDiagnosticWithHttpInfoAsync(System.Threading.CancellationToken cancellationToken = default) { Devolutions.Gateway.Client.Client.RequestOptions localVarRequestOptions = new Devolutions.Gateway.Client.Client.RequestOptions(); @@ -528,7 +528,7 @@ public Devolutions.Gateway.Client.Client.ApiResponse GetConfig /// Thrown when fails to make API call /// Cancellation Token to cancel the request. /// Task of ConfigDiagnostic - public async System.Threading.Tasks.Task GetConfigurationDiagnosticAsync(System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task GetConfigurationDiagnosticAsync(System.Threading.CancellationToken cancellationToken = default) { Devolutions.Gateway.Client.Client.ApiResponse localVarResponse = await GetConfigurationDiagnosticWithHttpInfoAsync(cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -540,7 +540,7 @@ public Devolutions.Gateway.Client.Client.ApiResponse GetConfig /// Thrown when fails to make API call /// Cancellation Token to cancel the request. /// Task of ApiResponse (ConfigDiagnostic) - public async System.Threading.Tasks.Task> GetConfigurationDiagnosticWithHttpInfoAsync(System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> GetConfigurationDiagnosticWithHttpInfoAsync(System.Threading.CancellationToken cancellationToken = default) { Devolutions.Gateway.Client.Client.RequestOptions localVarRequestOptions = new Devolutions.Gateway.Client.Client.RequestOptions(); @@ -641,7 +641,7 @@ public Devolutions.Gateway.Client.Client.ApiResponse GetLogsWithHttpInfo /// Thrown when fails to make API call /// Cancellation Token to cancel the request. /// Task of string - public async System.Threading.Tasks.Task GetLogsAsync(System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task GetLogsAsync(System.Threading.CancellationToken cancellationToken = default) { Devolutions.Gateway.Client.Client.ApiResponse localVarResponse = await GetLogsWithHttpInfoAsync(cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -653,7 +653,7 @@ public Devolutions.Gateway.Client.Client.ApiResponse GetLogsWithHttpInfo /// Thrown when fails to make API call /// Cancellation Token to cancel the request. /// Task of ApiResponse (string) - public async System.Threading.Tasks.Task> GetLogsWithHttpInfoAsync(System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> GetLogsWithHttpInfoAsync(System.Threading.CancellationToken cancellationToken = default) { Devolutions.Gateway.Client.Client.RequestOptions localVarRequestOptions = new Devolutions.Gateway.Client.Client.RequestOptions(); diff --git a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Api/HealthApi.cs b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Api/HealthApi.cs index f1d27e6d3..0343b33d4 100644 --- a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Api/HealthApi.cs +++ b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Api/HealthApi.cs @@ -3,7 +3,7 @@ * * Protocol-aware fine-grained relay server * - * The version of the OpenAPI document: 2025.3.2 + * The version of the OpenAPI document: 2026.2.4 * Contact: infos@devolutions.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -62,7 +62,7 @@ public interface IHealthApiAsync : IApiAccessor /// Thrown when fails to make API call /// Cancellation Token to cancel the request. /// Task of Identity - System.Threading.Tasks.Task GetHealthAsync(System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task GetHealthAsync(System.Threading.CancellationToken cancellationToken = default); /// /// Performs a health check @@ -73,7 +73,7 @@ public interface IHealthApiAsync : IApiAccessor /// Thrown when fails to make API call /// Cancellation Token to cancel the request. /// Task of ApiResponse (Identity) - System.Threading.Tasks.Task> GetHealthWithHttpInfoAsync(System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task> GetHealthWithHttpInfoAsync(System.Threading.CancellationToken cancellationToken = default); #endregion Asynchronous Operations } @@ -341,7 +341,7 @@ public Devolutions.Gateway.Client.Client.ApiResponse GetHealthWithHttp /// Thrown when fails to make API call /// Cancellation Token to cancel the request. /// Task of Identity - public async System.Threading.Tasks.Task GetHealthAsync(System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task GetHealthAsync(System.Threading.CancellationToken cancellationToken = default) { Devolutions.Gateway.Client.Client.ApiResponse localVarResponse = await GetHealthWithHttpInfoAsync(cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -353,7 +353,7 @@ public Devolutions.Gateway.Client.Client.ApiResponse GetHealthWithHttp /// Thrown when fails to make API call /// Cancellation Token to cancel the request. /// Task of ApiResponse (Identity) - public async System.Threading.Tasks.Task> GetHealthWithHttpInfoAsync(System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> GetHealthWithHttpInfoAsync(System.Threading.CancellationToken cancellationToken = default) { Devolutions.Gateway.Client.Client.RequestOptions localVarRequestOptions = new Devolutions.Gateway.Client.Client.RequestOptions(); diff --git a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Api/HeartbeatApi.cs b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Api/HeartbeatApi.cs index 8c4e70250..9cb6163b5 100644 --- a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Api/HeartbeatApi.cs +++ b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Api/HeartbeatApi.cs @@ -3,7 +3,7 @@ * * Protocol-aware fine-grained relay server * - * The version of the OpenAPI document: 2025.3.2 + * The version of the OpenAPI document: 2026.2.4 * Contact: infos@devolutions.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -62,7 +62,7 @@ public interface IHeartbeatApiAsync : IApiAccessor /// Thrown when fails to make API call /// Cancellation Token to cancel the request. /// Task of Heartbeat - System.Threading.Tasks.Task GetHeartbeatAsync(System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task GetHeartbeatAsync(System.Threading.CancellationToken cancellationToken = default); /// /// Performs a heartbeat check @@ -73,7 +73,7 @@ public interface IHeartbeatApiAsync : IApiAccessor /// Thrown when fails to make API call /// Cancellation Token to cancel the request. /// Task of ApiResponse (Heartbeat) - System.Threading.Tasks.Task> GetHeartbeatWithHttpInfoAsync(System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task> GetHeartbeatWithHttpInfoAsync(System.Threading.CancellationToken cancellationToken = default); #endregion Asynchronous Operations } @@ -347,7 +347,7 @@ public Devolutions.Gateway.Client.Client.ApiResponse GetHeartbeatWith /// Thrown when fails to make API call /// Cancellation Token to cancel the request. /// Task of Heartbeat - public async System.Threading.Tasks.Task GetHeartbeatAsync(System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task GetHeartbeatAsync(System.Threading.CancellationToken cancellationToken = default) { Devolutions.Gateway.Client.Client.ApiResponse localVarResponse = await GetHeartbeatWithHttpInfoAsync(cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -359,7 +359,7 @@ public Devolutions.Gateway.Client.Client.ApiResponse GetHeartbeatWith /// Thrown when fails to make API call /// Cancellation Token to cancel the request. /// Task of ApiResponse (Heartbeat) - public async System.Threading.Tasks.Task> GetHeartbeatWithHttpInfoAsync(System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> GetHeartbeatWithHttpInfoAsync(System.Threading.CancellationToken cancellationToken = default) { Devolutions.Gateway.Client.Client.RequestOptions localVarRequestOptions = new Devolutions.Gateway.Client.Client.RequestOptions(); diff --git a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Api/JrecApi.cs b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Api/JrecApi.cs index cd77b2d8d..228de55ec 100644 --- a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Api/JrecApi.cs +++ b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Api/JrecApi.cs @@ -3,7 +3,7 @@ * * Protocol-aware fine-grained relay server * - * The version of the OpenAPI document: 2025.3.2 + * The version of the OpenAPI document: 2026.2.4 * Contact: infos@devolutions.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -124,7 +124,7 @@ public interface IJrecApiAsync : IApiAccessor /// JSON-encoded list of session IDs /// Cancellation Token to cancel the request. /// Task of DeleteManyResult - System.Threading.Tasks.Task DeleteManyRecordingsAsync(List requestBody, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task DeleteManyRecordingsAsync(List requestBody, System.Threading.CancellationToken cancellationToken = default); /// /// Mass-deletes recordings stored on this instance @@ -136,7 +136,7 @@ public interface IJrecApiAsync : IApiAccessor /// JSON-encoded list of session IDs /// Cancellation Token to cancel the request. /// Task of ApiResponse (DeleteManyResult) - System.Threading.Tasks.Task> DeleteManyRecordingsWithHttpInfoAsync(List requestBody, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task> DeleteManyRecordingsWithHttpInfoAsync(List requestBody, System.Threading.CancellationToken cancellationToken = default); /// /// Deletes a recording stored on this instance /// @@ -147,7 +147,7 @@ public interface IJrecApiAsync : IApiAccessor /// Recorded session ID /// Cancellation Token to cancel the request. /// Task of void - System.Threading.Tasks.Task DeleteRecordingAsync(Guid id, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task DeleteRecordingAsync(Guid id, System.Threading.CancellationToken cancellationToken = default); /// /// Deletes a recording stored on this instance @@ -159,7 +159,7 @@ public interface IJrecApiAsync : IApiAccessor /// Recorded session ID /// Cancellation Token to cancel the request. /// Task of ApiResponse - System.Threading.Tasks.Task> DeleteRecordingWithHttpInfoAsync(Guid id, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task> DeleteRecordingWithHttpInfoAsync(Guid id, System.Threading.CancellationToken cancellationToken = default); /// /// Lists all recordings stored on this instance /// @@ -170,7 +170,7 @@ public interface IJrecApiAsync : IApiAccessor /// When true, only the active recordings are returned /// Cancellation Token to cancel the request. /// Task of List<Guid> - System.Threading.Tasks.Task> ListRecordingsAsync(bool active, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task> ListRecordingsAsync(bool active, System.Threading.CancellationToken cancellationToken = default); /// /// Lists all recordings stored on this instance @@ -182,7 +182,7 @@ public interface IJrecApiAsync : IApiAccessor /// When true, only the active recordings are returned /// Cancellation Token to cancel the request. /// Task of ApiResponse (List<Guid>) - System.Threading.Tasks.Task>> ListRecordingsWithHttpInfoAsync(bool active, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task>> ListRecordingsWithHttpInfoAsync(bool active, System.Threading.CancellationToken cancellationToken = default); /// /// Retrieves a recording file for a given session /// @@ -194,7 +194,7 @@ public interface IJrecApiAsync : IApiAccessor /// Name of recording file to retrieve /// Cancellation Token to cancel the request. /// Task of FileParameter - System.Threading.Tasks.Task PullRecordingFileAsync(Guid id, string filename, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task PullRecordingFileAsync(Guid id, string filename, System.Threading.CancellationToken cancellationToken = default); /// /// Retrieves a recording file for a given session @@ -207,7 +207,7 @@ public interface IJrecApiAsync : IApiAccessor /// Name of recording file to retrieve /// Cancellation Token to cancel the request. /// Task of ApiResponse (FileParameter) - System.Threading.Tasks.Task> PullRecordingFileWithHttpInfoAsync(Guid id, string filename, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task> PullRecordingFileWithHttpInfoAsync(Guid id, string filename, System.Threading.CancellationToken cancellationToken = default); #endregion Asynchronous Operations } @@ -490,7 +490,7 @@ public Devolutions.Gateway.Client.Client.ApiResponse DeleteMan /// JSON-encoded list of session IDs /// Cancellation Token to cancel the request. /// Task of DeleteManyResult - public async System.Threading.Tasks.Task DeleteManyRecordingsAsync(List requestBody, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task DeleteManyRecordingsAsync(List requestBody, System.Threading.CancellationToken cancellationToken = default) { Devolutions.Gateway.Client.Client.ApiResponse localVarResponse = await DeleteManyRecordingsWithHttpInfoAsync(requestBody, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -503,7 +503,7 @@ public Devolutions.Gateway.Client.Client.ApiResponse DeleteMan /// JSON-encoded list of session IDs /// Cancellation Token to cancel the request. /// Task of ApiResponse (DeleteManyResult) - public async System.Threading.Tasks.Task> DeleteManyRecordingsWithHttpInfoAsync(List requestBody, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> DeleteManyRecordingsWithHttpInfoAsync(List requestBody, System.Threading.CancellationToken cancellationToken = default) { // verify the required parameter 'requestBody' is set if (requestBody == null) @@ -612,7 +612,7 @@ public Devolutions.Gateway.Client.Client.ApiResponse DeleteRecordingWith /// Recorded session ID /// Cancellation Token to cancel the request. /// Task of void - public async System.Threading.Tasks.Task DeleteRecordingAsync(Guid id, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task DeleteRecordingAsync(Guid id, System.Threading.CancellationToken cancellationToken = default) { await DeleteRecordingWithHttpInfoAsync(id, cancellationToken).ConfigureAwait(false); } @@ -624,7 +624,7 @@ public Devolutions.Gateway.Client.Client.ApiResponse DeleteRecordingWith /// Recorded session ID /// Cancellation Token to cancel the request. /// Task of ApiResponse - public async System.Threading.Tasks.Task> DeleteRecordingWithHttpInfoAsync(Guid id, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> DeleteRecordingWithHttpInfoAsync(Guid id, System.Threading.CancellationToken cancellationToken = default) { Devolutions.Gateway.Client.Client.RequestOptions localVarRequestOptions = new Devolutions.Gateway.Client.Client.RequestOptions(); @@ -729,7 +729,7 @@ public Devolutions.Gateway.Client.Client.ApiResponse> ListRecordingsW /// When true, only the active recordings are returned /// Cancellation Token to cancel the request. /// Task of List<Guid> - public async System.Threading.Tasks.Task> ListRecordingsAsync(bool active, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> ListRecordingsAsync(bool active, System.Threading.CancellationToken cancellationToken = default) { Devolutions.Gateway.Client.Client.ApiResponse> localVarResponse = await ListRecordingsWithHttpInfoAsync(active, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -742,7 +742,7 @@ public Devolutions.Gateway.Client.Client.ApiResponse> ListRecordingsW /// When true, only the active recordings are returned /// Cancellation Token to cancel the request. /// Task of ApiResponse (List<Guid>) - public async System.Threading.Tasks.Task>> ListRecordingsWithHttpInfoAsync(bool active, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task>> ListRecordingsWithHttpInfoAsync(bool active, System.Threading.CancellationToken cancellationToken = default) { Devolutions.Gateway.Client.Client.RequestOptions localVarRequestOptions = new Devolutions.Gateway.Client.Client.RequestOptions(); @@ -856,7 +856,7 @@ public Devolutions.Gateway.Client.Client.ApiResponse PullRecordin /// Name of recording file to retrieve /// Cancellation Token to cancel the request. /// Task of FileParameter - public async System.Threading.Tasks.Task PullRecordingFileAsync(Guid id, string filename, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task PullRecordingFileAsync(Guid id, string filename, System.Threading.CancellationToken cancellationToken = default) { Devolutions.Gateway.Client.Client.ApiResponse localVarResponse = await PullRecordingFileWithHttpInfoAsync(id, filename, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -870,7 +870,7 @@ public Devolutions.Gateway.Client.Client.ApiResponse PullRecordin /// Name of recording file to retrieve /// Cancellation Token to cancel the request. /// Task of ApiResponse (FileParameter) - public async System.Threading.Tasks.Task> PullRecordingFileWithHttpInfoAsync(Guid id, string filename, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> PullRecordingFileWithHttpInfoAsync(Guid id, string filename, System.Threading.CancellationToken cancellationToken = default) { // verify the required parameter 'filename' is set if (filename == null) diff --git a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Api/JrlApi.cs b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Api/JrlApi.cs index 81eb23a4c..62f71a93d 100644 --- a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Api/JrlApi.cs +++ b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Api/JrlApi.cs @@ -3,7 +3,7 @@ * * Protocol-aware fine-grained relay server * - * The version of the OpenAPI document: 2025.3.2 + * The version of the OpenAPI document: 2026.2.4 * Contact: infos@devolutions.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -78,7 +78,7 @@ public interface IJrlApiAsync : IApiAccessor /// Thrown when fails to make API call /// Cancellation Token to cancel the request. /// Task of JrlInfo - System.Threading.Tasks.Task GetJrlInfoAsync(System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task GetJrlInfoAsync(System.Threading.CancellationToken cancellationToken = default); /// /// Retrieves current JRL (Json Revocation List) info @@ -89,7 +89,7 @@ public interface IJrlApiAsync : IApiAccessor /// Thrown when fails to make API call /// Cancellation Token to cancel the request. /// Task of ApiResponse (JrlInfo) - System.Threading.Tasks.Task> GetJrlInfoWithHttpInfoAsync(System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task> GetJrlInfoWithHttpInfoAsync(System.Threading.CancellationToken cancellationToken = default); /// /// Updates JRL (Json Revocation List) using a JRL token /// @@ -99,7 +99,7 @@ public interface IJrlApiAsync : IApiAccessor /// Thrown when fails to make API call /// Cancellation Token to cancel the request. /// Task of void - System.Threading.Tasks.Task UpdateJrlAsync(System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task UpdateJrlAsync(System.Threading.CancellationToken cancellationToken = default); /// /// Updates JRL (Json Revocation List) using a JRL token @@ -110,7 +110,7 @@ public interface IJrlApiAsync : IApiAccessor /// Thrown when fails to make API call /// Cancellation Token to cancel the request. /// Task of ApiResponse - System.Threading.Tasks.Task> UpdateJrlWithHttpInfoAsync(System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task> UpdateJrlWithHttpInfoAsync(System.Threading.CancellationToken cancellationToken = default); #endregion Asynchronous Operations } @@ -384,7 +384,7 @@ public Devolutions.Gateway.Client.Client.ApiResponse GetJrlInfoWithHttp /// Thrown when fails to make API call /// Cancellation Token to cancel the request. /// Task of JrlInfo - public async System.Threading.Tasks.Task GetJrlInfoAsync(System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task GetJrlInfoAsync(System.Threading.CancellationToken cancellationToken = default) { Devolutions.Gateway.Client.Client.ApiResponse localVarResponse = await GetJrlInfoWithHttpInfoAsync(cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -396,7 +396,7 @@ public Devolutions.Gateway.Client.Client.ApiResponse GetJrlInfoWithHttp /// Thrown when fails to make API call /// Cancellation Token to cancel the request. /// Task of ApiResponse (JrlInfo) - public async System.Threading.Tasks.Task> GetJrlInfoWithHttpInfoAsync(System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> GetJrlInfoWithHttpInfoAsync(System.Threading.CancellationToken cancellationToken = default) { Devolutions.Gateway.Client.Client.RequestOptions localVarRequestOptions = new Devolutions.Gateway.Client.Client.RequestOptions(); @@ -495,7 +495,7 @@ public Devolutions.Gateway.Client.Client.ApiResponse UpdateJrlWithHttpIn /// Thrown when fails to make API call /// Cancellation Token to cancel the request. /// Task of void - public async System.Threading.Tasks.Task UpdateJrlAsync(System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task UpdateJrlAsync(System.Threading.CancellationToken cancellationToken = default) { await UpdateJrlWithHttpInfoAsync(cancellationToken).ConfigureAwait(false); } @@ -506,7 +506,7 @@ public Devolutions.Gateway.Client.Client.ApiResponse UpdateJrlWithHttpIn /// Thrown when fails to make API call /// Cancellation Token to cancel the request. /// Task of ApiResponse - public async System.Threading.Tasks.Task> UpdateJrlWithHttpInfoAsync(System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> UpdateJrlWithHttpInfoAsync(System.Threading.CancellationToken cancellationToken = default) { Devolutions.Gateway.Client.Client.RequestOptions localVarRequestOptions = new Devolutions.Gateway.Client.Client.RequestOptions(); diff --git a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Api/NetApi.cs b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Api/NetApi.cs index a0ab71e31..60d71230a 100644 --- a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Api/NetApi.cs +++ b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Api/NetApi.cs @@ -3,7 +3,7 @@ * * Protocol-aware fine-grained relay server * - * The version of the OpenAPI document: 2025.3.2 + * The version of the OpenAPI document: 2026.2.4 * Contact: infos@devolutions.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -44,6 +44,105 @@ public interface INetApiSync : IApiAccessor /// Thrown when fails to make API call /// ApiResponse of List<Dictionary<string, List<InterfaceInfo>>> ApiResponse>>> GetNetConfigWithHttpInfo(); + /// + /// Lists Gateway network scan sources. + /// + /// Thrown when fails to make API call + /// NetworkInterfacesResponse + NetworkInterfacesResponse GetNetInterfaces(); + + /// + /// Lists Gateway network scan sources. + /// + /// + /// + /// + /// Thrown when fails to make API call + /// ApiResponse of NetworkInterfacesResponse + ApiResponse GetNetInterfacesWithHttpInfo(); + /// + /// Stream network scan events over a websocket. + /// + /// + /// The endpoint is upgraded from HTTP, so OpenAPI describes the **handshake**: the query parameters that drive the scan (validated before upgrade) and the legacy / v1 event payloads streamed back as JSON text frames. See `NetworkScanResultEvent` for the v1 shape and `LegacyScanEvent` for the legacy shape (selected via `response_format`). + /// + /// Thrown when fails to make API call + /// Interval in milliseconds (default is 200) (optional) + /// Timeout in milliseconds (default is 500) (optional) + /// Timeout in milliseconds (default is 1000) (optional) + /// Timeout in milliseconds (default is 1000) (optional) + /// Timeout in milliseconds (default is 1000) (optional) + /// Interval in milliseconds (default is 200) (optional) + /// The maximum time for each mdns query in milliseconds. (default is 5 * 1000) (optional) + /// The maximum duration for whole networking scan in milliseconds. Highly suggested! (optional) + /// The start and end IP address of the range to scan. for example: 10.10.0.0-10.10.0.255 (optional) + /// Explicit single-host targets to scan. Each value must parse as an IPv4 or IPv6 address; invalid values yield a structured `{ error: \"invalid_target\", value: \"<raw>\" }` 400 rather than a generic serde rejection at extraction time (mirrors the `range=` / `probe=` validation path). (optional) + /// Gateway network interface IDs to use as scan sources. (optional) + /// The probes to run. Each value is either `ping`, a port number (`22`), or a named service (`rdp`, `https`, ΓǪ). Validation is deferred to scan-time so failures can be surfaced as a structured 400 ΓÇö naming the offending value ΓÇö instead of a generic serde rejection at extraction time. (optional) + /// **Legacy alias** for `report_ping_start`. Prefer the explicit name in new clients; kept so existing consumers don't break. (optional) (deprecated) + /// Enable the execution of broadcast scan (optional) + /// Enable the ping scan on subnet (optional) + /// Enable ZeroConf/mDNS (optional) + /// Enable NetBIOS name-service queries. Default `true` for backward compatibility. Set `false` (or pair with explicit `target=`) to keep NetBIOS from sweeping the surrounding subnet when the caller only wants results for the targets they listed. (optional) + /// Enable resolve dns (optional) + /// Include host-only results. (optional) + /// Emit ping queued/start host results. (optional) + /// Emit ping success host results. (optional) + /// Emit ping failure host results. (optional) + /// Enable TCP service probes. (optional) + /// Policy applied when `range=` and `interface_id=` are both provided. Accepted values: `intersect_selected_interfaces` (default) or `allow_cross_interface_range`. Invalid values yield a structured `{ error: \"invalid_range_interface_policy\", value: \"<raw>\" }` 400 instead of a generic serde rejection (mirrors the `range=` / `probe=` / `target=` validation path). (optional) + /// **Legacy alias** for `range_interface_policy=allow_cross_interface_range`. Prefer the structured policy in new clients. (optional) (deprecated) + /// Response shape emitted on the websocket. Accepted values: `legacy` (default) or `network_scan_result_v1`. Invalid values yield a structured `{ error: \"invalid_response_format\", value: \"<raw>\" }` 400 instead of a generic serde rejection. (optional) + /// Maximum scanner concurrency. (optional) + /// Maximum ping probe concurrency. (optional) + /// Maximum TCP probe concurrency. (optional) + /// **Legacy alias** for `report_ping_failure`. `enable_failure=true` only opts into ping-failure events; TCP-probe failure events require the explicit `report_tcp_failure=true` and are not affected by this alias. **Behavior change:** historically this single flag controlled both ping-failure and TCP-probe-failure reporting. The two are now split: clients that want the old \"both at once\" semantics must send `enable_failure=true&report_tcp_failure=true` together. The split is intentional ΓÇö TCP-probe failures are typically high-volume noise that callers were filtering client-side anyway, so the two streams are independently gated. (optional) (deprecated) + /// Enable TCP port knocking failure events. (optional) + /// When `true`, fail with HTTP 400 if a ping/TCP-probe socket cannot be bound to the planner-selected interface. Default `false` (warn and fall back to default routing). (optional) + /// + void GetNetScan(long? pingInterval = default, long? pingTimeout = default, long? broadcastTimeout = default, long? portScanTimeout = default, long? netbiosTimeout = default, long? netbiosInterval = default, long? mdnsQueryTimeout = default, long? maxWait = default, List? range = default, List? target = default, List? interfaceId = default, List? probe = default, bool? enablePingStart = default, bool? enableBroadcast = default, bool? enableSubnetScan = default, bool? enableZeroconf = default, bool? enableNetbios = default, bool? enableResolveDns = default, bool? includeHostResults = default, bool? reportPingStart = default, bool? reportPingSuccess = default, bool? reportPingFailure = default, bool? enableTcpProbes = default, string? rangeInterfacePolicy = default, bool? allowCrossInterfaceRange = default, string? responseFormat = default, int? maxConcurrency = default, int? maxPingConcurrency = default, int? maxTcpProbeConcurrency = default, bool? enableFailure = default, bool? reportTcpFailure = default, bool? interfaceBindStrict = default); + + /// + /// Stream network scan events over a websocket. + /// + /// + /// The endpoint is upgraded from HTTP, so OpenAPI describes the **handshake**: the query parameters that drive the scan (validated before upgrade) and the legacy / v1 event payloads streamed back as JSON text frames. See `NetworkScanResultEvent` for the v1 shape and `LegacyScanEvent` for the legacy shape (selected via `response_format`). + /// + /// Thrown when fails to make API call + /// Interval in milliseconds (default is 200) (optional) + /// Timeout in milliseconds (default is 500) (optional) + /// Timeout in milliseconds (default is 1000) (optional) + /// Timeout in milliseconds (default is 1000) (optional) + /// Timeout in milliseconds (default is 1000) (optional) + /// Interval in milliseconds (default is 200) (optional) + /// The maximum time for each mdns query in milliseconds. (default is 5 * 1000) (optional) + /// The maximum duration for whole networking scan in milliseconds. Highly suggested! (optional) + /// The start and end IP address of the range to scan. for example: 10.10.0.0-10.10.0.255 (optional) + /// Explicit single-host targets to scan. Each value must parse as an IPv4 or IPv6 address; invalid values yield a structured `{ error: \"invalid_target\", value: \"<raw>\" }` 400 rather than a generic serde rejection at extraction time (mirrors the `range=` / `probe=` validation path). (optional) + /// Gateway network interface IDs to use as scan sources. (optional) + /// The probes to run. Each value is either `ping`, a port number (`22`), or a named service (`rdp`, `https`, ΓǪ). Validation is deferred to scan-time so failures can be surfaced as a structured 400 ΓÇö naming the offending value ΓÇö instead of a generic serde rejection at extraction time. (optional) + /// **Legacy alias** for `report_ping_start`. Prefer the explicit name in new clients; kept so existing consumers don't break. (optional) (deprecated) + /// Enable the execution of broadcast scan (optional) + /// Enable the ping scan on subnet (optional) + /// Enable ZeroConf/mDNS (optional) + /// Enable NetBIOS name-service queries. Default `true` for backward compatibility. Set `false` (or pair with explicit `target=`) to keep NetBIOS from sweeping the surrounding subnet when the caller only wants results for the targets they listed. (optional) + /// Enable resolve dns (optional) + /// Include host-only results. (optional) + /// Emit ping queued/start host results. (optional) + /// Emit ping success host results. (optional) + /// Emit ping failure host results. (optional) + /// Enable TCP service probes. (optional) + /// Policy applied when `range=` and `interface_id=` are both provided. Accepted values: `intersect_selected_interfaces` (default) or `allow_cross_interface_range`. Invalid values yield a structured `{ error: \"invalid_range_interface_policy\", value: \"<raw>\" }` 400 instead of a generic serde rejection (mirrors the `range=` / `probe=` / `target=` validation path). (optional) + /// **Legacy alias** for `range_interface_policy=allow_cross_interface_range`. Prefer the structured policy in new clients. (optional) (deprecated) + /// Response shape emitted on the websocket. Accepted values: `legacy` (default) or `network_scan_result_v1`. Invalid values yield a structured `{ error: \"invalid_response_format\", value: \"<raw>\" }` 400 instead of a generic serde rejection. (optional) + /// Maximum scanner concurrency. (optional) + /// Maximum ping probe concurrency. (optional) + /// Maximum TCP probe concurrency. (optional) + /// **Legacy alias** for `report_ping_failure`. `enable_failure=true` only opts into ping-failure events; TCP-probe failure events require the explicit `report_tcp_failure=true` and are not affected by this alias. **Behavior change:** historically this single flag controlled both ping-failure and TCP-probe-failure reporting. The two are now split: clients that want the old \"both at once\" semantics must send `enable_failure=true&report_tcp_failure=true` together. The split is intentional ΓÇö TCP-probe failures are typically high-volume noise that callers were filtering client-side anyway, so the two streams are independently gated. (optional) (deprecated) + /// Enable TCP port knocking failure events. (optional) + /// When `true`, fail with HTTP 400 if a ping/TCP-probe socket cannot be bound to the planner-selected interface. Default `false` (warn and fall back to default routing). (optional) + /// ApiResponse of Object(void) + ApiResponse GetNetScanWithHttpInfo(long? pingInterval = default, long? pingTimeout = default, long? broadcastTimeout = default, long? portScanTimeout = default, long? netbiosTimeout = default, long? netbiosInterval = default, long? mdnsQueryTimeout = default, long? maxWait = default, List? range = default, List? target = default, List? interfaceId = default, List? probe = default, bool? enablePingStart = default, bool? enableBroadcast = default, bool? enableSubnetScan = default, bool? enableZeroconf = default, bool? enableNetbios = default, bool? enableResolveDns = default, bool? includeHostResults = default, bool? reportPingStart = default, bool? reportPingSuccess = default, bool? reportPingFailure = default, bool? enableTcpProbes = default, string? rangeInterfacePolicy = default, bool? allowCrossInterfaceRange = default, string? responseFormat = default, int? maxConcurrency = default, int? maxPingConcurrency = default, int? maxTcpProbeConcurrency = default, bool? enableFailure = default, bool? reportTcpFailure = default, bool? interfaceBindStrict = default); #endregion Synchronous Operations } @@ -62,7 +161,7 @@ public interface INetApiAsync : IApiAccessor /// Thrown when fails to make API call /// Cancellation Token to cancel the request. /// Task of List<Dictionary<string, List<InterfaceInfo>>> - System.Threading.Tasks.Task>>> GetNetConfigAsync(System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task>>> GetNetConfigAsync(System.Threading.CancellationToken cancellationToken = default); /// /// Lists network interfaces @@ -73,7 +172,113 @@ public interface INetApiAsync : IApiAccessor /// Thrown when fails to make API call /// Cancellation Token to cancel the request. /// Task of ApiResponse (List<Dictionary<string, List<InterfaceInfo>>>) - System.Threading.Tasks.Task>>>> GetNetConfigWithHttpInfoAsync(System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task>>>> GetNetConfigWithHttpInfoAsync(System.Threading.CancellationToken cancellationToken = default); + /// + /// Lists Gateway network scan sources. + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// Task of NetworkInterfacesResponse + System.Threading.Tasks.Task GetNetInterfacesAsync(System.Threading.CancellationToken cancellationToken = default); + + /// + /// Lists Gateway network scan sources. + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (NetworkInterfacesResponse) + System.Threading.Tasks.Task> GetNetInterfacesWithHttpInfoAsync(System.Threading.CancellationToken cancellationToken = default); + /// + /// Stream network scan events over a websocket. + /// + /// + /// The endpoint is upgraded from HTTP, so OpenAPI describes the **handshake**: the query parameters that drive the scan (validated before upgrade) and the legacy / v1 event payloads streamed back as JSON text frames. See `NetworkScanResultEvent` for the v1 shape and `LegacyScanEvent` for the legacy shape (selected via `response_format`). + /// + /// Thrown when fails to make API call + /// Interval in milliseconds (default is 200) (optional) + /// Timeout in milliseconds (default is 500) (optional) + /// Timeout in milliseconds (default is 1000) (optional) + /// Timeout in milliseconds (default is 1000) (optional) + /// Timeout in milliseconds (default is 1000) (optional) + /// Interval in milliseconds (default is 200) (optional) + /// The maximum time for each mdns query in milliseconds. (default is 5 * 1000) (optional) + /// The maximum duration for whole networking scan in milliseconds. Highly suggested! (optional) + /// The start and end IP address of the range to scan. for example: 10.10.0.0-10.10.0.255 (optional) + /// Explicit single-host targets to scan. Each value must parse as an IPv4 or IPv6 address; invalid values yield a structured `{ error: \"invalid_target\", value: \"<raw>\" }` 400 rather than a generic serde rejection at extraction time (mirrors the `range=` / `probe=` validation path). (optional) + /// Gateway network interface IDs to use as scan sources. (optional) + /// The probes to run. Each value is either `ping`, a port number (`22`), or a named service (`rdp`, `https`, ΓǪ). Validation is deferred to scan-time so failures can be surfaced as a structured 400 ΓÇö naming the offending value ΓÇö instead of a generic serde rejection at extraction time. (optional) + /// **Legacy alias** for `report_ping_start`. Prefer the explicit name in new clients; kept so existing consumers don't break. (optional) (deprecated) + /// Enable the execution of broadcast scan (optional) + /// Enable the ping scan on subnet (optional) + /// Enable ZeroConf/mDNS (optional) + /// Enable NetBIOS name-service queries. Default `true` for backward compatibility. Set `false` (or pair with explicit `target=`) to keep NetBIOS from sweeping the surrounding subnet when the caller only wants results for the targets they listed. (optional) + /// Enable resolve dns (optional) + /// Include host-only results. (optional) + /// Emit ping queued/start host results. (optional) + /// Emit ping success host results. (optional) + /// Emit ping failure host results. (optional) + /// Enable TCP service probes. (optional) + /// Policy applied when `range=` and `interface_id=` are both provided. Accepted values: `intersect_selected_interfaces` (default) or `allow_cross_interface_range`. Invalid values yield a structured `{ error: \"invalid_range_interface_policy\", value: \"<raw>\" }` 400 instead of a generic serde rejection (mirrors the `range=` / `probe=` / `target=` validation path). (optional) + /// **Legacy alias** for `range_interface_policy=allow_cross_interface_range`. Prefer the structured policy in new clients. (optional) (deprecated) + /// Response shape emitted on the websocket. Accepted values: `legacy` (default) or `network_scan_result_v1`. Invalid values yield a structured `{ error: \"invalid_response_format\", value: \"<raw>\" }` 400 instead of a generic serde rejection. (optional) + /// Maximum scanner concurrency. (optional) + /// Maximum ping probe concurrency. (optional) + /// Maximum TCP probe concurrency. (optional) + /// **Legacy alias** for `report_ping_failure`. `enable_failure=true` only opts into ping-failure events; TCP-probe failure events require the explicit `report_tcp_failure=true` and are not affected by this alias. **Behavior change:** historically this single flag controlled both ping-failure and TCP-probe-failure reporting. The two are now split: clients that want the old \"both at once\" semantics must send `enable_failure=true&report_tcp_failure=true` together. The split is intentional ΓÇö TCP-probe failures are typically high-volume noise that callers were filtering client-side anyway, so the two streams are independently gated. (optional) (deprecated) + /// Enable TCP port knocking failure events. (optional) + /// When `true`, fail with HTTP 400 if a ping/TCP-probe socket cannot be bound to the planner-selected interface. Default `false` (warn and fall back to default routing). (optional) + /// Cancellation Token to cancel the request. + /// Task of void + System.Threading.Tasks.Task GetNetScanAsync(long? pingInterval = default, long? pingTimeout = default, long? broadcastTimeout = default, long? portScanTimeout = default, long? netbiosTimeout = default, long? netbiosInterval = default, long? mdnsQueryTimeout = default, long? maxWait = default, List? range = default, List? target = default, List? interfaceId = default, List? probe = default, bool? enablePingStart = default, bool? enableBroadcast = default, bool? enableSubnetScan = default, bool? enableZeroconf = default, bool? enableNetbios = default, bool? enableResolveDns = default, bool? includeHostResults = default, bool? reportPingStart = default, bool? reportPingSuccess = default, bool? reportPingFailure = default, bool? enableTcpProbes = default, string? rangeInterfacePolicy = default, bool? allowCrossInterfaceRange = default, string? responseFormat = default, int? maxConcurrency = default, int? maxPingConcurrency = default, int? maxTcpProbeConcurrency = default, bool? enableFailure = default, bool? reportTcpFailure = default, bool? interfaceBindStrict = default, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Stream network scan events over a websocket. + /// + /// + /// The endpoint is upgraded from HTTP, so OpenAPI describes the **handshake**: the query parameters that drive the scan (validated before upgrade) and the legacy / v1 event payloads streamed back as JSON text frames. See `NetworkScanResultEvent` for the v1 shape and `LegacyScanEvent` for the legacy shape (selected via `response_format`). + /// + /// Thrown when fails to make API call + /// Interval in milliseconds (default is 200) (optional) + /// Timeout in milliseconds (default is 500) (optional) + /// Timeout in milliseconds (default is 1000) (optional) + /// Timeout in milliseconds (default is 1000) (optional) + /// Timeout in milliseconds (default is 1000) (optional) + /// Interval in milliseconds (default is 200) (optional) + /// The maximum time for each mdns query in milliseconds. (default is 5 * 1000) (optional) + /// The maximum duration for whole networking scan in milliseconds. Highly suggested! (optional) + /// The start and end IP address of the range to scan. for example: 10.10.0.0-10.10.0.255 (optional) + /// Explicit single-host targets to scan. Each value must parse as an IPv4 or IPv6 address; invalid values yield a structured `{ error: \"invalid_target\", value: \"<raw>\" }` 400 rather than a generic serde rejection at extraction time (mirrors the `range=` / `probe=` validation path). (optional) + /// Gateway network interface IDs to use as scan sources. (optional) + /// The probes to run. Each value is either `ping`, a port number (`22`), or a named service (`rdp`, `https`, ΓǪ). Validation is deferred to scan-time so failures can be surfaced as a structured 400 ΓÇö naming the offending value ΓÇö instead of a generic serde rejection at extraction time. (optional) + /// **Legacy alias** for `report_ping_start`. Prefer the explicit name in new clients; kept so existing consumers don't break. (optional) (deprecated) + /// Enable the execution of broadcast scan (optional) + /// Enable the ping scan on subnet (optional) + /// Enable ZeroConf/mDNS (optional) + /// Enable NetBIOS name-service queries. Default `true` for backward compatibility. Set `false` (or pair with explicit `target=`) to keep NetBIOS from sweeping the surrounding subnet when the caller only wants results for the targets they listed. (optional) + /// Enable resolve dns (optional) + /// Include host-only results. (optional) + /// Emit ping queued/start host results. (optional) + /// Emit ping success host results. (optional) + /// Emit ping failure host results. (optional) + /// Enable TCP service probes. (optional) + /// Policy applied when `range=` and `interface_id=` are both provided. Accepted values: `intersect_selected_interfaces` (default) or `allow_cross_interface_range`. Invalid values yield a structured `{ error: \"invalid_range_interface_policy\", value: \"<raw>\" }` 400 instead of a generic serde rejection (mirrors the `range=` / `probe=` / `target=` validation path). (optional) + /// **Legacy alias** for `range_interface_policy=allow_cross_interface_range`. Prefer the structured policy in new clients. (optional) (deprecated) + /// Response shape emitted on the websocket. Accepted values: `legacy` (default) or `network_scan_result_v1`. Invalid values yield a structured `{ error: \"invalid_response_format\", value: \"<raw>\" }` 400 instead of a generic serde rejection. (optional) + /// Maximum scanner concurrency. (optional) + /// Maximum ping probe concurrency. (optional) + /// Maximum TCP probe concurrency. (optional) + /// **Legacy alias** for `report_ping_failure`. `enable_failure=true` only opts into ping-failure events; TCP-probe failure events require the explicit `report_tcp_failure=true` and are not affected by this alias. **Behavior change:** historically this single flag controlled both ping-failure and TCP-probe-failure reporting. The two are now split: clients that want the old \"both at once\" semantics must send `enable_failure=true&report_tcp_failure=true` together. The split is intentional ΓÇö TCP-probe failures are typically high-volume noise that callers were filtering client-side anyway, so the two streams are independently gated. (optional) (deprecated) + /// Enable TCP port knocking failure events. (optional) + /// When `true`, fail with HTTP 400 if a ping/TCP-probe socket cannot be bound to the planner-selected interface. Default `false` (warn and fall back to default routing). (optional) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse + System.Threading.Tasks.Task> GetNetScanWithHttpInfoAsync(long? pingInterval = default, long? pingTimeout = default, long? broadcastTimeout = default, long? portScanTimeout = default, long? netbiosTimeout = default, long? netbiosInterval = default, long? mdnsQueryTimeout = default, long? maxWait = default, List? range = default, List? target = default, List? interfaceId = default, List? probe = default, bool? enablePingStart = default, bool? enableBroadcast = default, bool? enableSubnetScan = default, bool? enableZeroconf = default, bool? enableNetbios = default, bool? enableResolveDns = default, bool? includeHostResults = default, bool? reportPingStart = default, bool? reportPingSuccess = default, bool? reportPingFailure = default, bool? enableTcpProbes = default, string? rangeInterfacePolicy = default, bool? allowCrossInterfaceRange = default, string? responseFormat = default, int? maxConcurrency = default, int? maxPingConcurrency = default, int? maxTcpProbeConcurrency = default, bool? enableFailure = default, bool? reportTcpFailure = default, bool? interfaceBindStrict = default, System.Threading.CancellationToken cancellationToken = default); #endregion Asynchronous Operations } @@ -347,7 +552,7 @@ public Devolutions.Gateway.Client.Client.ApiResponseThrown when fails to make API call /// Cancellation Token to cancel the request. /// Task of List<Dictionary<string, List<InterfaceInfo>>> - public async System.Threading.Tasks.Task>>> GetNetConfigAsync(System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task>>> GetNetConfigAsync(System.Threading.CancellationToken cancellationToken = default) { Devolutions.Gateway.Client.Client.ApiResponse>>> localVarResponse = await GetNetConfigWithHttpInfoAsync(cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -359,7 +564,7 @@ public Devolutions.Gateway.Client.Client.ApiResponseThrown when fails to make API call /// Cancellation Token to cancel the request. /// Task of ApiResponse (List<Dictionary<string, List<InterfaceInfo>>>) - public async System.Threading.Tasks.Task>>>> GetNetConfigWithHttpInfoAsync(System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task>>>> GetNetConfigWithHttpInfoAsync(System.Threading.CancellationToken cancellationToken = default) { Devolutions.Gateway.Client.Client.RequestOptions localVarRequestOptions = new Devolutions.Gateway.Client.Client.RequestOptions(); @@ -400,5 +605,611 @@ public Devolutions.Gateway.Client.Client.ApiResponse + /// Lists Gateway network scan sources. + /// + /// Thrown when fails to make API call + /// NetworkInterfacesResponse + public NetworkInterfacesResponse GetNetInterfaces() + { + Devolutions.Gateway.Client.Client.ApiResponse localVarResponse = GetNetInterfacesWithHttpInfo(); + return localVarResponse.Data; + } + + /// + /// Lists Gateway network scan sources. + /// + /// Thrown when fails to make API call + /// ApiResponse of NetworkInterfacesResponse + public Devolutions.Gateway.Client.Client.ApiResponse GetNetInterfacesWithHttpInfo() + { + Devolutions.Gateway.Client.Client.RequestOptions localVarRequestOptions = new Devolutions.Gateway.Client.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = Devolutions.Gateway.Client.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Devolutions.Gateway.Client.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + + // authentication (netscan_token) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Get("/jet/net/interfaces", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("GetNetInterfaces", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Lists Gateway network scan sources. + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// Task of NetworkInterfacesResponse + public async System.Threading.Tasks.Task GetNetInterfacesAsync(System.Threading.CancellationToken cancellationToken = default) + { + Devolutions.Gateway.Client.Client.ApiResponse localVarResponse = await GetNetInterfacesWithHttpInfoAsync(cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Lists Gateway network scan sources. + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (NetworkInterfacesResponse) + public async System.Threading.Tasks.Task> GetNetInterfacesWithHttpInfoAsync(System.Threading.CancellationToken cancellationToken = default) + { + + Devolutions.Gateway.Client.Client.RequestOptions localVarRequestOptions = new Devolutions.Gateway.Client.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + + var localVarContentType = Devolutions.Gateway.Client.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Devolutions.Gateway.Client.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + + // authentication (netscan_token) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.GetAsync("/jet/net/interfaces", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("GetNetInterfaces", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Stream network scan events over a websocket. The endpoint is upgraded from HTTP, so OpenAPI describes the **handshake**: the query parameters that drive the scan (validated before upgrade) and the legacy / v1 event payloads streamed back as JSON text frames. See `NetworkScanResultEvent` for the v1 shape and `LegacyScanEvent` for the legacy shape (selected via `response_format`). + /// + /// Thrown when fails to make API call + /// Interval in milliseconds (default is 200) (optional) + /// Timeout in milliseconds (default is 500) (optional) + /// Timeout in milliseconds (default is 1000) (optional) + /// Timeout in milliseconds (default is 1000) (optional) + /// Timeout in milliseconds (default is 1000) (optional) + /// Interval in milliseconds (default is 200) (optional) + /// The maximum time for each mdns query in milliseconds. (default is 5 * 1000) (optional) + /// The maximum duration for whole networking scan in milliseconds. Highly suggested! (optional) + /// The start and end IP address of the range to scan. for example: 10.10.0.0-10.10.0.255 (optional) + /// Explicit single-host targets to scan. Each value must parse as an IPv4 or IPv6 address; invalid values yield a structured `{ error: \"invalid_target\", value: \"<raw>\" }` 400 rather than a generic serde rejection at extraction time (mirrors the `range=` / `probe=` validation path). (optional) + /// Gateway network interface IDs to use as scan sources. (optional) + /// The probes to run. Each value is either `ping`, a port number (`22`), or a named service (`rdp`, `https`, ΓǪ). Validation is deferred to scan-time so failures can be surfaced as a structured 400 ΓÇö naming the offending value ΓÇö instead of a generic serde rejection at extraction time. (optional) + /// **Legacy alias** for `report_ping_start`. Prefer the explicit name in new clients; kept so existing consumers don't break. (optional) (deprecated) + /// Enable the execution of broadcast scan (optional) + /// Enable the ping scan on subnet (optional) + /// Enable ZeroConf/mDNS (optional) + /// Enable NetBIOS name-service queries. Default `true` for backward compatibility. Set `false` (or pair with explicit `target=`) to keep NetBIOS from sweeping the surrounding subnet when the caller only wants results for the targets they listed. (optional) + /// Enable resolve dns (optional) + /// Include host-only results. (optional) + /// Emit ping queued/start host results. (optional) + /// Emit ping success host results. (optional) + /// Emit ping failure host results. (optional) + /// Enable TCP service probes. (optional) + /// Policy applied when `range=` and `interface_id=` are both provided. Accepted values: `intersect_selected_interfaces` (default) or `allow_cross_interface_range`. Invalid values yield a structured `{ error: \"invalid_range_interface_policy\", value: \"<raw>\" }` 400 instead of a generic serde rejection (mirrors the `range=` / `probe=` / `target=` validation path). (optional) + /// **Legacy alias** for `range_interface_policy=allow_cross_interface_range`. Prefer the structured policy in new clients. (optional) (deprecated) + /// Response shape emitted on the websocket. Accepted values: `legacy` (default) or `network_scan_result_v1`. Invalid values yield a structured `{ error: \"invalid_response_format\", value: \"<raw>\" }` 400 instead of a generic serde rejection. (optional) + /// Maximum scanner concurrency. (optional) + /// Maximum ping probe concurrency. (optional) + /// Maximum TCP probe concurrency. (optional) + /// **Legacy alias** for `report_ping_failure`. `enable_failure=true` only opts into ping-failure events; TCP-probe failure events require the explicit `report_tcp_failure=true` and are not affected by this alias. **Behavior change:** historically this single flag controlled both ping-failure and TCP-probe-failure reporting. The two are now split: clients that want the old \"both at once\" semantics must send `enable_failure=true&report_tcp_failure=true` together. The split is intentional ΓÇö TCP-probe failures are typically high-volume noise that callers were filtering client-side anyway, so the two streams are independently gated. (optional) (deprecated) + /// Enable TCP port knocking failure events. (optional) + /// When `true`, fail with HTTP 400 if a ping/TCP-probe socket cannot be bound to the planner-selected interface. Default `false` (warn and fall back to default routing). (optional) + /// + public void GetNetScan(long? pingInterval = default, long? pingTimeout = default, long? broadcastTimeout = default, long? portScanTimeout = default, long? netbiosTimeout = default, long? netbiosInterval = default, long? mdnsQueryTimeout = default, long? maxWait = default, List? range = default, List? target = default, List? interfaceId = default, List? probe = default, bool? enablePingStart = default, bool? enableBroadcast = default, bool? enableSubnetScan = default, bool? enableZeroconf = default, bool? enableNetbios = default, bool? enableResolveDns = default, bool? includeHostResults = default, bool? reportPingStart = default, bool? reportPingSuccess = default, bool? reportPingFailure = default, bool? enableTcpProbes = default, string? rangeInterfacePolicy = default, bool? allowCrossInterfaceRange = default, string? responseFormat = default, int? maxConcurrency = default, int? maxPingConcurrency = default, int? maxTcpProbeConcurrency = default, bool? enableFailure = default, bool? reportTcpFailure = default, bool? interfaceBindStrict = default) + { + GetNetScanWithHttpInfo(pingInterval, pingTimeout, broadcastTimeout, portScanTimeout, netbiosTimeout, netbiosInterval, mdnsQueryTimeout, maxWait, range, target, interfaceId, probe, enablePingStart, enableBroadcast, enableSubnetScan, enableZeroconf, enableNetbios, enableResolveDns, includeHostResults, reportPingStart, reportPingSuccess, reportPingFailure, enableTcpProbes, rangeInterfacePolicy, allowCrossInterfaceRange, responseFormat, maxConcurrency, maxPingConcurrency, maxTcpProbeConcurrency, enableFailure, reportTcpFailure, interfaceBindStrict); + } + + /// + /// Stream network scan events over a websocket. The endpoint is upgraded from HTTP, so OpenAPI describes the **handshake**: the query parameters that drive the scan (validated before upgrade) and the legacy / v1 event payloads streamed back as JSON text frames. See `NetworkScanResultEvent` for the v1 shape and `LegacyScanEvent` for the legacy shape (selected via `response_format`). + /// + /// Thrown when fails to make API call + /// Interval in milliseconds (default is 200) (optional) + /// Timeout in milliseconds (default is 500) (optional) + /// Timeout in milliseconds (default is 1000) (optional) + /// Timeout in milliseconds (default is 1000) (optional) + /// Timeout in milliseconds (default is 1000) (optional) + /// Interval in milliseconds (default is 200) (optional) + /// The maximum time for each mdns query in milliseconds. (default is 5 * 1000) (optional) + /// The maximum duration for whole networking scan in milliseconds. Highly suggested! (optional) + /// The start and end IP address of the range to scan. for example: 10.10.0.0-10.10.0.255 (optional) + /// Explicit single-host targets to scan. Each value must parse as an IPv4 or IPv6 address; invalid values yield a structured `{ error: \"invalid_target\", value: \"<raw>\" }` 400 rather than a generic serde rejection at extraction time (mirrors the `range=` / `probe=` validation path). (optional) + /// Gateway network interface IDs to use as scan sources. (optional) + /// The probes to run. Each value is either `ping`, a port number (`22`), or a named service (`rdp`, `https`, ΓǪ). Validation is deferred to scan-time so failures can be surfaced as a structured 400 ΓÇö naming the offending value ΓÇö instead of a generic serde rejection at extraction time. (optional) + /// **Legacy alias** for `report_ping_start`. Prefer the explicit name in new clients; kept so existing consumers don't break. (optional) (deprecated) + /// Enable the execution of broadcast scan (optional) + /// Enable the ping scan on subnet (optional) + /// Enable ZeroConf/mDNS (optional) + /// Enable NetBIOS name-service queries. Default `true` for backward compatibility. Set `false` (or pair with explicit `target=`) to keep NetBIOS from sweeping the surrounding subnet when the caller only wants results for the targets they listed. (optional) + /// Enable resolve dns (optional) + /// Include host-only results. (optional) + /// Emit ping queued/start host results. (optional) + /// Emit ping success host results. (optional) + /// Emit ping failure host results. (optional) + /// Enable TCP service probes. (optional) + /// Policy applied when `range=` and `interface_id=` are both provided. Accepted values: `intersect_selected_interfaces` (default) or `allow_cross_interface_range`. Invalid values yield a structured `{ error: \"invalid_range_interface_policy\", value: \"<raw>\" }` 400 instead of a generic serde rejection (mirrors the `range=` / `probe=` / `target=` validation path). (optional) + /// **Legacy alias** for `range_interface_policy=allow_cross_interface_range`. Prefer the structured policy in new clients. (optional) (deprecated) + /// Response shape emitted on the websocket. Accepted values: `legacy` (default) or `network_scan_result_v1`. Invalid values yield a structured `{ error: \"invalid_response_format\", value: \"<raw>\" }` 400 instead of a generic serde rejection. (optional) + /// Maximum scanner concurrency. (optional) + /// Maximum ping probe concurrency. (optional) + /// Maximum TCP probe concurrency. (optional) + /// **Legacy alias** for `report_ping_failure`. `enable_failure=true` only opts into ping-failure events; TCP-probe failure events require the explicit `report_tcp_failure=true` and are not affected by this alias. **Behavior change:** historically this single flag controlled both ping-failure and TCP-probe-failure reporting. The two are now split: clients that want the old \"both at once\" semantics must send `enable_failure=true&report_tcp_failure=true` together. The split is intentional ΓÇö TCP-probe failures are typically high-volume noise that callers were filtering client-side anyway, so the two streams are independently gated. (optional) (deprecated) + /// Enable TCP port knocking failure events. (optional) + /// When `true`, fail with HTTP 400 if a ping/TCP-probe socket cannot be bound to the planner-selected interface. Default `false` (warn and fall back to default routing). (optional) + /// ApiResponse of Object(void) + public Devolutions.Gateway.Client.Client.ApiResponse GetNetScanWithHttpInfo(long? pingInterval = default, long? pingTimeout = default, long? broadcastTimeout = default, long? portScanTimeout = default, long? netbiosTimeout = default, long? netbiosInterval = default, long? mdnsQueryTimeout = default, long? maxWait = default, List? range = default, List? target = default, List? interfaceId = default, List? probe = default, bool? enablePingStart = default, bool? enableBroadcast = default, bool? enableSubnetScan = default, bool? enableZeroconf = default, bool? enableNetbios = default, bool? enableResolveDns = default, bool? includeHostResults = default, bool? reportPingStart = default, bool? reportPingSuccess = default, bool? reportPingFailure = default, bool? enableTcpProbes = default, string? rangeInterfacePolicy = default, bool? allowCrossInterfaceRange = default, string? responseFormat = default, int? maxConcurrency = default, int? maxPingConcurrency = default, int? maxTcpProbeConcurrency = default, bool? enableFailure = default, bool? reportTcpFailure = default, bool? interfaceBindStrict = default) + { + Devolutions.Gateway.Client.Client.RequestOptions localVarRequestOptions = new Devolutions.Gateway.Client.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + }; + + var localVarContentType = Devolutions.Gateway.Client.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Devolutions.Gateway.Client.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + if (pingInterval != null) + { + localVarRequestOptions.QueryParameters.Add(Devolutions.Gateway.Client.Client.ClientUtils.ParameterToMultiMap("", "ping_interval", pingInterval)); + } + if (pingTimeout != null) + { + localVarRequestOptions.QueryParameters.Add(Devolutions.Gateway.Client.Client.ClientUtils.ParameterToMultiMap("", "ping_timeout", pingTimeout)); + } + if (broadcastTimeout != null) + { + localVarRequestOptions.QueryParameters.Add(Devolutions.Gateway.Client.Client.ClientUtils.ParameterToMultiMap("", "broadcast_timeout", broadcastTimeout)); + } + if (portScanTimeout != null) + { + localVarRequestOptions.QueryParameters.Add(Devolutions.Gateway.Client.Client.ClientUtils.ParameterToMultiMap("", "port_scan_timeout", portScanTimeout)); + } + if (netbiosTimeout != null) + { + localVarRequestOptions.QueryParameters.Add(Devolutions.Gateway.Client.Client.ClientUtils.ParameterToMultiMap("", "netbios_timeout", netbiosTimeout)); + } + if (netbiosInterval != null) + { + localVarRequestOptions.QueryParameters.Add(Devolutions.Gateway.Client.Client.ClientUtils.ParameterToMultiMap("", "netbios_interval", netbiosInterval)); + } + if (mdnsQueryTimeout != null) + { + localVarRequestOptions.QueryParameters.Add(Devolutions.Gateway.Client.Client.ClientUtils.ParameterToMultiMap("", "mdns_query_timeout", mdnsQueryTimeout)); + } + if (maxWait != null) + { + localVarRequestOptions.QueryParameters.Add(Devolutions.Gateway.Client.Client.ClientUtils.ParameterToMultiMap("", "max_wait", maxWait)); + } + if (range != null) + { + localVarRequestOptions.QueryParameters.Add(Devolutions.Gateway.Client.Client.ClientUtils.ParameterToMultiMap("multi", "range", range)); + } + if (target != null) + { + localVarRequestOptions.QueryParameters.Add(Devolutions.Gateway.Client.Client.ClientUtils.ParameterToMultiMap("multi", "target", target)); + } + if (interfaceId != null) + { + localVarRequestOptions.QueryParameters.Add(Devolutions.Gateway.Client.Client.ClientUtils.ParameterToMultiMap("multi", "interface_id", interfaceId)); + } + if (probe != null) + { + localVarRequestOptions.QueryParameters.Add(Devolutions.Gateway.Client.Client.ClientUtils.ParameterToMultiMap("multi", "probe", probe)); + } + if (enablePingStart != null) + { + localVarRequestOptions.QueryParameters.Add(Devolutions.Gateway.Client.Client.ClientUtils.ParameterToMultiMap("", "enable_ping_start", enablePingStart)); + } + if (enableBroadcast != null) + { + localVarRequestOptions.QueryParameters.Add(Devolutions.Gateway.Client.Client.ClientUtils.ParameterToMultiMap("", "enable_broadcast", enableBroadcast)); + } + if (enableSubnetScan != null) + { + localVarRequestOptions.QueryParameters.Add(Devolutions.Gateway.Client.Client.ClientUtils.ParameterToMultiMap("", "enable_subnet_scan", enableSubnetScan)); + } + if (enableZeroconf != null) + { + localVarRequestOptions.QueryParameters.Add(Devolutions.Gateway.Client.Client.ClientUtils.ParameterToMultiMap("", "enable_zeroconf", enableZeroconf)); + } + if (enableNetbios != null) + { + localVarRequestOptions.QueryParameters.Add(Devolutions.Gateway.Client.Client.ClientUtils.ParameterToMultiMap("", "enable_netbios", enableNetbios)); + } + if (enableResolveDns != null) + { + localVarRequestOptions.QueryParameters.Add(Devolutions.Gateway.Client.Client.ClientUtils.ParameterToMultiMap("", "enable_resolve_dns", enableResolveDns)); + } + if (includeHostResults != null) + { + localVarRequestOptions.QueryParameters.Add(Devolutions.Gateway.Client.Client.ClientUtils.ParameterToMultiMap("", "include_host_results", includeHostResults)); + } + if (reportPingStart != null) + { + localVarRequestOptions.QueryParameters.Add(Devolutions.Gateway.Client.Client.ClientUtils.ParameterToMultiMap("", "report_ping_start", reportPingStart)); + } + if (reportPingSuccess != null) + { + localVarRequestOptions.QueryParameters.Add(Devolutions.Gateway.Client.Client.ClientUtils.ParameterToMultiMap("", "report_ping_success", reportPingSuccess)); + } + if (reportPingFailure != null) + { + localVarRequestOptions.QueryParameters.Add(Devolutions.Gateway.Client.Client.ClientUtils.ParameterToMultiMap("", "report_ping_failure", reportPingFailure)); + } + if (enableTcpProbes != null) + { + localVarRequestOptions.QueryParameters.Add(Devolutions.Gateway.Client.Client.ClientUtils.ParameterToMultiMap("", "enable_tcp_probes", enableTcpProbes)); + } + if (rangeInterfacePolicy != null) + { + localVarRequestOptions.QueryParameters.Add(Devolutions.Gateway.Client.Client.ClientUtils.ParameterToMultiMap("", "range_interface_policy", rangeInterfacePolicy)); + } + if (allowCrossInterfaceRange != null) + { + localVarRequestOptions.QueryParameters.Add(Devolutions.Gateway.Client.Client.ClientUtils.ParameterToMultiMap("", "allow_cross_interface_range", allowCrossInterfaceRange)); + } + if (responseFormat != null) + { + localVarRequestOptions.QueryParameters.Add(Devolutions.Gateway.Client.Client.ClientUtils.ParameterToMultiMap("", "response_format", responseFormat)); + } + if (maxConcurrency != null) + { + localVarRequestOptions.QueryParameters.Add(Devolutions.Gateway.Client.Client.ClientUtils.ParameterToMultiMap("", "max_concurrency", maxConcurrency)); + } + if (maxPingConcurrency != null) + { + localVarRequestOptions.QueryParameters.Add(Devolutions.Gateway.Client.Client.ClientUtils.ParameterToMultiMap("", "max_ping_concurrency", maxPingConcurrency)); + } + if (maxTcpProbeConcurrency != null) + { + localVarRequestOptions.QueryParameters.Add(Devolutions.Gateway.Client.Client.ClientUtils.ParameterToMultiMap("", "max_tcp_probe_concurrency", maxTcpProbeConcurrency)); + } + if (enableFailure != null) + { + localVarRequestOptions.QueryParameters.Add(Devolutions.Gateway.Client.Client.ClientUtils.ParameterToMultiMap("", "enable_failure", enableFailure)); + } + if (reportTcpFailure != null) + { + localVarRequestOptions.QueryParameters.Add(Devolutions.Gateway.Client.Client.ClientUtils.ParameterToMultiMap("", "report_tcp_failure", reportTcpFailure)); + } + if (interfaceBindStrict != null) + { + localVarRequestOptions.QueryParameters.Add(Devolutions.Gateway.Client.Client.ClientUtils.ParameterToMultiMap("", "interface_bind_strict", interfaceBindStrict)); + } + + // authentication (netscan_token) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Get("/jet/net/scan", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("GetNetScan", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Stream network scan events over a websocket. The endpoint is upgraded from HTTP, so OpenAPI describes the **handshake**: the query parameters that drive the scan (validated before upgrade) and the legacy / v1 event payloads streamed back as JSON text frames. See `NetworkScanResultEvent` for the v1 shape and `LegacyScanEvent` for the legacy shape (selected via `response_format`). + /// + /// Thrown when fails to make API call + /// Interval in milliseconds (default is 200) (optional) + /// Timeout in milliseconds (default is 500) (optional) + /// Timeout in milliseconds (default is 1000) (optional) + /// Timeout in milliseconds (default is 1000) (optional) + /// Timeout in milliseconds (default is 1000) (optional) + /// Interval in milliseconds (default is 200) (optional) + /// The maximum time for each mdns query in milliseconds. (default is 5 * 1000) (optional) + /// The maximum duration for whole networking scan in milliseconds. Highly suggested! (optional) + /// The start and end IP address of the range to scan. for example: 10.10.0.0-10.10.0.255 (optional) + /// Explicit single-host targets to scan. Each value must parse as an IPv4 or IPv6 address; invalid values yield a structured `{ error: \"invalid_target\", value: \"<raw>\" }` 400 rather than a generic serde rejection at extraction time (mirrors the `range=` / `probe=` validation path). (optional) + /// Gateway network interface IDs to use as scan sources. (optional) + /// The probes to run. Each value is either `ping`, a port number (`22`), or a named service (`rdp`, `https`, ΓǪ). Validation is deferred to scan-time so failures can be surfaced as a structured 400 ΓÇö naming the offending value ΓÇö instead of a generic serde rejection at extraction time. (optional) + /// **Legacy alias** for `report_ping_start`. Prefer the explicit name in new clients; kept so existing consumers don't break. (optional) (deprecated) + /// Enable the execution of broadcast scan (optional) + /// Enable the ping scan on subnet (optional) + /// Enable ZeroConf/mDNS (optional) + /// Enable NetBIOS name-service queries. Default `true` for backward compatibility. Set `false` (or pair with explicit `target=`) to keep NetBIOS from sweeping the surrounding subnet when the caller only wants results for the targets they listed. (optional) + /// Enable resolve dns (optional) + /// Include host-only results. (optional) + /// Emit ping queued/start host results. (optional) + /// Emit ping success host results. (optional) + /// Emit ping failure host results. (optional) + /// Enable TCP service probes. (optional) + /// Policy applied when `range=` and `interface_id=` are both provided. Accepted values: `intersect_selected_interfaces` (default) or `allow_cross_interface_range`. Invalid values yield a structured `{ error: \"invalid_range_interface_policy\", value: \"<raw>\" }` 400 instead of a generic serde rejection (mirrors the `range=` / `probe=` / `target=` validation path). (optional) + /// **Legacy alias** for `range_interface_policy=allow_cross_interface_range`. Prefer the structured policy in new clients. (optional) (deprecated) + /// Response shape emitted on the websocket. Accepted values: `legacy` (default) or `network_scan_result_v1`. Invalid values yield a structured `{ error: \"invalid_response_format\", value: \"<raw>\" }` 400 instead of a generic serde rejection. (optional) + /// Maximum scanner concurrency. (optional) + /// Maximum ping probe concurrency. (optional) + /// Maximum TCP probe concurrency. (optional) + /// **Legacy alias** for `report_ping_failure`. `enable_failure=true` only opts into ping-failure events; TCP-probe failure events require the explicit `report_tcp_failure=true` and are not affected by this alias. **Behavior change:** historically this single flag controlled both ping-failure and TCP-probe-failure reporting. The two are now split: clients that want the old \"both at once\" semantics must send `enable_failure=true&report_tcp_failure=true` together. The split is intentional ΓÇö TCP-probe failures are typically high-volume noise that callers were filtering client-side anyway, so the two streams are independently gated. (optional) (deprecated) + /// Enable TCP port knocking failure events. (optional) + /// When `true`, fail with HTTP 400 if a ping/TCP-probe socket cannot be bound to the planner-selected interface. Default `false` (warn and fall back to default routing). (optional) + /// Cancellation Token to cancel the request. + /// Task of void + public async System.Threading.Tasks.Task GetNetScanAsync(long? pingInterval = default, long? pingTimeout = default, long? broadcastTimeout = default, long? portScanTimeout = default, long? netbiosTimeout = default, long? netbiosInterval = default, long? mdnsQueryTimeout = default, long? maxWait = default, List? range = default, List? target = default, List? interfaceId = default, List? probe = default, bool? enablePingStart = default, bool? enableBroadcast = default, bool? enableSubnetScan = default, bool? enableZeroconf = default, bool? enableNetbios = default, bool? enableResolveDns = default, bool? includeHostResults = default, bool? reportPingStart = default, bool? reportPingSuccess = default, bool? reportPingFailure = default, bool? enableTcpProbes = default, string? rangeInterfacePolicy = default, bool? allowCrossInterfaceRange = default, string? responseFormat = default, int? maxConcurrency = default, int? maxPingConcurrency = default, int? maxTcpProbeConcurrency = default, bool? enableFailure = default, bool? reportTcpFailure = default, bool? interfaceBindStrict = default, System.Threading.CancellationToken cancellationToken = default) + { + await GetNetScanWithHttpInfoAsync(pingInterval, pingTimeout, broadcastTimeout, portScanTimeout, netbiosTimeout, netbiosInterval, mdnsQueryTimeout, maxWait, range, target, interfaceId, probe, enablePingStart, enableBroadcast, enableSubnetScan, enableZeroconf, enableNetbios, enableResolveDns, includeHostResults, reportPingStart, reportPingSuccess, reportPingFailure, enableTcpProbes, rangeInterfacePolicy, allowCrossInterfaceRange, responseFormat, maxConcurrency, maxPingConcurrency, maxTcpProbeConcurrency, enableFailure, reportTcpFailure, interfaceBindStrict, cancellationToken).ConfigureAwait(false); + } + + /// + /// Stream network scan events over a websocket. The endpoint is upgraded from HTTP, so OpenAPI describes the **handshake**: the query parameters that drive the scan (validated before upgrade) and the legacy / v1 event payloads streamed back as JSON text frames. See `NetworkScanResultEvent` for the v1 shape and `LegacyScanEvent` for the legacy shape (selected via `response_format`). + /// + /// Thrown when fails to make API call + /// Interval in milliseconds (default is 200) (optional) + /// Timeout in milliseconds (default is 500) (optional) + /// Timeout in milliseconds (default is 1000) (optional) + /// Timeout in milliseconds (default is 1000) (optional) + /// Timeout in milliseconds (default is 1000) (optional) + /// Interval in milliseconds (default is 200) (optional) + /// The maximum time for each mdns query in milliseconds. (default is 5 * 1000) (optional) + /// The maximum duration for whole networking scan in milliseconds. Highly suggested! (optional) + /// The start and end IP address of the range to scan. for example: 10.10.0.0-10.10.0.255 (optional) + /// Explicit single-host targets to scan. Each value must parse as an IPv4 or IPv6 address; invalid values yield a structured `{ error: \"invalid_target\", value: \"<raw>\" }` 400 rather than a generic serde rejection at extraction time (mirrors the `range=` / `probe=` validation path). (optional) + /// Gateway network interface IDs to use as scan sources. (optional) + /// The probes to run. Each value is either `ping`, a port number (`22`), or a named service (`rdp`, `https`, ΓǪ). Validation is deferred to scan-time so failures can be surfaced as a structured 400 ΓÇö naming the offending value ΓÇö instead of a generic serde rejection at extraction time. (optional) + /// **Legacy alias** for `report_ping_start`. Prefer the explicit name in new clients; kept so existing consumers don't break. (optional) (deprecated) + /// Enable the execution of broadcast scan (optional) + /// Enable the ping scan on subnet (optional) + /// Enable ZeroConf/mDNS (optional) + /// Enable NetBIOS name-service queries. Default `true` for backward compatibility. Set `false` (or pair with explicit `target=`) to keep NetBIOS from sweeping the surrounding subnet when the caller only wants results for the targets they listed. (optional) + /// Enable resolve dns (optional) + /// Include host-only results. (optional) + /// Emit ping queued/start host results. (optional) + /// Emit ping success host results. (optional) + /// Emit ping failure host results. (optional) + /// Enable TCP service probes. (optional) + /// Policy applied when `range=` and `interface_id=` are both provided. Accepted values: `intersect_selected_interfaces` (default) or `allow_cross_interface_range`. Invalid values yield a structured `{ error: \"invalid_range_interface_policy\", value: \"<raw>\" }` 400 instead of a generic serde rejection (mirrors the `range=` / `probe=` / `target=` validation path). (optional) + /// **Legacy alias** for `range_interface_policy=allow_cross_interface_range`. Prefer the structured policy in new clients. (optional) (deprecated) + /// Response shape emitted on the websocket. Accepted values: `legacy` (default) or `network_scan_result_v1`. Invalid values yield a structured `{ error: \"invalid_response_format\", value: \"<raw>\" }` 400 instead of a generic serde rejection. (optional) + /// Maximum scanner concurrency. (optional) + /// Maximum ping probe concurrency. (optional) + /// Maximum TCP probe concurrency. (optional) + /// **Legacy alias** for `report_ping_failure`. `enable_failure=true` only opts into ping-failure events; TCP-probe failure events require the explicit `report_tcp_failure=true` and are not affected by this alias. **Behavior change:** historically this single flag controlled both ping-failure and TCP-probe-failure reporting. The two are now split: clients that want the old \"both at once\" semantics must send `enable_failure=true&report_tcp_failure=true` together. The split is intentional ΓÇö TCP-probe failures are typically high-volume noise that callers were filtering client-side anyway, so the two streams are independently gated. (optional) (deprecated) + /// Enable TCP port knocking failure events. (optional) + /// When `true`, fail with HTTP 400 if a ping/TCP-probe socket cannot be bound to the planner-selected interface. Default `false` (warn and fall back to default routing). (optional) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse + public async System.Threading.Tasks.Task> GetNetScanWithHttpInfoAsync(long? pingInterval = default, long? pingTimeout = default, long? broadcastTimeout = default, long? portScanTimeout = default, long? netbiosTimeout = default, long? netbiosInterval = default, long? mdnsQueryTimeout = default, long? maxWait = default, List? range = default, List? target = default, List? interfaceId = default, List? probe = default, bool? enablePingStart = default, bool? enableBroadcast = default, bool? enableSubnetScan = default, bool? enableZeroconf = default, bool? enableNetbios = default, bool? enableResolveDns = default, bool? includeHostResults = default, bool? reportPingStart = default, bool? reportPingSuccess = default, bool? reportPingFailure = default, bool? enableTcpProbes = default, string? rangeInterfacePolicy = default, bool? allowCrossInterfaceRange = default, string? responseFormat = default, int? maxConcurrency = default, int? maxPingConcurrency = default, int? maxTcpProbeConcurrency = default, bool? enableFailure = default, bool? reportTcpFailure = default, bool? interfaceBindStrict = default, System.Threading.CancellationToken cancellationToken = default) + { + + Devolutions.Gateway.Client.Client.RequestOptions localVarRequestOptions = new Devolutions.Gateway.Client.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + }; + + + var localVarContentType = Devolutions.Gateway.Client.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Devolutions.Gateway.Client.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + if (pingInterval != null) + { + localVarRequestOptions.QueryParameters.Add(Devolutions.Gateway.Client.Client.ClientUtils.ParameterToMultiMap("", "ping_interval", pingInterval)); + } + if (pingTimeout != null) + { + localVarRequestOptions.QueryParameters.Add(Devolutions.Gateway.Client.Client.ClientUtils.ParameterToMultiMap("", "ping_timeout", pingTimeout)); + } + if (broadcastTimeout != null) + { + localVarRequestOptions.QueryParameters.Add(Devolutions.Gateway.Client.Client.ClientUtils.ParameterToMultiMap("", "broadcast_timeout", broadcastTimeout)); + } + if (portScanTimeout != null) + { + localVarRequestOptions.QueryParameters.Add(Devolutions.Gateway.Client.Client.ClientUtils.ParameterToMultiMap("", "port_scan_timeout", portScanTimeout)); + } + if (netbiosTimeout != null) + { + localVarRequestOptions.QueryParameters.Add(Devolutions.Gateway.Client.Client.ClientUtils.ParameterToMultiMap("", "netbios_timeout", netbiosTimeout)); + } + if (netbiosInterval != null) + { + localVarRequestOptions.QueryParameters.Add(Devolutions.Gateway.Client.Client.ClientUtils.ParameterToMultiMap("", "netbios_interval", netbiosInterval)); + } + if (mdnsQueryTimeout != null) + { + localVarRequestOptions.QueryParameters.Add(Devolutions.Gateway.Client.Client.ClientUtils.ParameterToMultiMap("", "mdns_query_timeout", mdnsQueryTimeout)); + } + if (maxWait != null) + { + localVarRequestOptions.QueryParameters.Add(Devolutions.Gateway.Client.Client.ClientUtils.ParameterToMultiMap("", "max_wait", maxWait)); + } + if (range != null) + { + localVarRequestOptions.QueryParameters.Add(Devolutions.Gateway.Client.Client.ClientUtils.ParameterToMultiMap("multi", "range", range)); + } + if (target != null) + { + localVarRequestOptions.QueryParameters.Add(Devolutions.Gateway.Client.Client.ClientUtils.ParameterToMultiMap("multi", "target", target)); + } + if (interfaceId != null) + { + localVarRequestOptions.QueryParameters.Add(Devolutions.Gateway.Client.Client.ClientUtils.ParameterToMultiMap("multi", "interface_id", interfaceId)); + } + if (probe != null) + { + localVarRequestOptions.QueryParameters.Add(Devolutions.Gateway.Client.Client.ClientUtils.ParameterToMultiMap("multi", "probe", probe)); + } + if (enablePingStart != null) + { + localVarRequestOptions.QueryParameters.Add(Devolutions.Gateway.Client.Client.ClientUtils.ParameterToMultiMap("", "enable_ping_start", enablePingStart)); + } + if (enableBroadcast != null) + { + localVarRequestOptions.QueryParameters.Add(Devolutions.Gateway.Client.Client.ClientUtils.ParameterToMultiMap("", "enable_broadcast", enableBroadcast)); + } + if (enableSubnetScan != null) + { + localVarRequestOptions.QueryParameters.Add(Devolutions.Gateway.Client.Client.ClientUtils.ParameterToMultiMap("", "enable_subnet_scan", enableSubnetScan)); + } + if (enableZeroconf != null) + { + localVarRequestOptions.QueryParameters.Add(Devolutions.Gateway.Client.Client.ClientUtils.ParameterToMultiMap("", "enable_zeroconf", enableZeroconf)); + } + if (enableNetbios != null) + { + localVarRequestOptions.QueryParameters.Add(Devolutions.Gateway.Client.Client.ClientUtils.ParameterToMultiMap("", "enable_netbios", enableNetbios)); + } + if (enableResolveDns != null) + { + localVarRequestOptions.QueryParameters.Add(Devolutions.Gateway.Client.Client.ClientUtils.ParameterToMultiMap("", "enable_resolve_dns", enableResolveDns)); + } + if (includeHostResults != null) + { + localVarRequestOptions.QueryParameters.Add(Devolutions.Gateway.Client.Client.ClientUtils.ParameterToMultiMap("", "include_host_results", includeHostResults)); + } + if (reportPingStart != null) + { + localVarRequestOptions.QueryParameters.Add(Devolutions.Gateway.Client.Client.ClientUtils.ParameterToMultiMap("", "report_ping_start", reportPingStart)); + } + if (reportPingSuccess != null) + { + localVarRequestOptions.QueryParameters.Add(Devolutions.Gateway.Client.Client.ClientUtils.ParameterToMultiMap("", "report_ping_success", reportPingSuccess)); + } + if (reportPingFailure != null) + { + localVarRequestOptions.QueryParameters.Add(Devolutions.Gateway.Client.Client.ClientUtils.ParameterToMultiMap("", "report_ping_failure", reportPingFailure)); + } + if (enableTcpProbes != null) + { + localVarRequestOptions.QueryParameters.Add(Devolutions.Gateway.Client.Client.ClientUtils.ParameterToMultiMap("", "enable_tcp_probes", enableTcpProbes)); + } + if (rangeInterfacePolicy != null) + { + localVarRequestOptions.QueryParameters.Add(Devolutions.Gateway.Client.Client.ClientUtils.ParameterToMultiMap("", "range_interface_policy", rangeInterfacePolicy)); + } + if (allowCrossInterfaceRange != null) + { + localVarRequestOptions.QueryParameters.Add(Devolutions.Gateway.Client.Client.ClientUtils.ParameterToMultiMap("", "allow_cross_interface_range", allowCrossInterfaceRange)); + } + if (responseFormat != null) + { + localVarRequestOptions.QueryParameters.Add(Devolutions.Gateway.Client.Client.ClientUtils.ParameterToMultiMap("", "response_format", responseFormat)); + } + if (maxConcurrency != null) + { + localVarRequestOptions.QueryParameters.Add(Devolutions.Gateway.Client.Client.ClientUtils.ParameterToMultiMap("", "max_concurrency", maxConcurrency)); + } + if (maxPingConcurrency != null) + { + localVarRequestOptions.QueryParameters.Add(Devolutions.Gateway.Client.Client.ClientUtils.ParameterToMultiMap("", "max_ping_concurrency", maxPingConcurrency)); + } + if (maxTcpProbeConcurrency != null) + { + localVarRequestOptions.QueryParameters.Add(Devolutions.Gateway.Client.Client.ClientUtils.ParameterToMultiMap("", "max_tcp_probe_concurrency", maxTcpProbeConcurrency)); + } + if (enableFailure != null) + { + localVarRequestOptions.QueryParameters.Add(Devolutions.Gateway.Client.Client.ClientUtils.ParameterToMultiMap("", "enable_failure", enableFailure)); + } + if (reportTcpFailure != null) + { + localVarRequestOptions.QueryParameters.Add(Devolutions.Gateway.Client.Client.ClientUtils.ParameterToMultiMap("", "report_tcp_failure", reportTcpFailure)); + } + if (interfaceBindStrict != null) + { + localVarRequestOptions.QueryParameters.Add(Devolutions.Gateway.Client.Client.ClientUtils.ParameterToMultiMap("", "interface_bind_strict", interfaceBindStrict)); + } + + // authentication (netscan_token) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.GetAsync("/jet/net/scan", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("GetNetScan", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + } } diff --git a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Api/NetworkMonitoringApi.cs b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Api/NetworkMonitoringApi.cs index 659e5ee61..e2a79a49c 100644 --- a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Api/NetworkMonitoringApi.cs +++ b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Api/NetworkMonitoringApi.cs @@ -3,7 +3,7 @@ * * Protocol-aware fine-grained relay server * - * The version of the OpenAPI document: 2025.3.2 + * The version of the OpenAPI document: 2026.2.4 * Contact: infos@devolutions.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -86,7 +86,7 @@ public interface INetworkMonitoringApiAsync : IApiAccessor /// Thrown when fails to make API call /// Cancellation Token to cancel the request. /// Task of MonitoringLogResponse - System.Threading.Tasks.Task DrainMonitoringLogAsync(System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task DrainMonitoringLogAsync(System.Threading.CancellationToken cancellationToken = default); /// /// Monitors store their results in a temporary log, which is returned here. @@ -97,7 +97,7 @@ public interface INetworkMonitoringApiAsync : IApiAccessor /// Thrown when fails to make API call /// Cancellation Token to cancel the request. /// Task of ApiResponse (MonitoringLogResponse) - System.Threading.Tasks.Task> DrainMonitoringLogWithHttpInfoAsync(System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task> DrainMonitoringLogWithHttpInfoAsync(System.Threading.CancellationToken cancellationToken = default); /// /// Replace the current monitoring configuration with the configuration in the request body. /// @@ -108,7 +108,7 @@ public interface INetworkMonitoringApiAsync : IApiAccessor /// JSON object containing a list of monitors /// Cancellation Token to cancel the request. /// Task of SetConfigResponse - System.Threading.Tasks.Task SetMonitoringConfigAsync(MonitorsConfig monitorsConfig, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task SetMonitoringConfigAsync(MonitorsConfig monitorsConfig, System.Threading.CancellationToken cancellationToken = default); /// /// Replace the current monitoring configuration with the configuration in the request body. @@ -120,7 +120,7 @@ public interface INetworkMonitoringApiAsync : IApiAccessor /// JSON object containing a list of monitors /// Cancellation Token to cancel the request. /// Task of ApiResponse (SetConfigResponse) - System.Threading.Tasks.Task> SetMonitoringConfigWithHttpInfoAsync(MonitorsConfig monitorsConfig, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task> SetMonitoringConfigWithHttpInfoAsync(MonitorsConfig monitorsConfig, System.Threading.CancellationToken cancellationToken = default); #endregion Asynchronous Operations } @@ -394,7 +394,7 @@ public Devolutions.Gateway.Client.Client.ApiResponse Drai /// Thrown when fails to make API call /// Cancellation Token to cancel the request. /// Task of MonitoringLogResponse - public async System.Threading.Tasks.Task DrainMonitoringLogAsync(System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task DrainMonitoringLogAsync(System.Threading.CancellationToken cancellationToken = default) { Devolutions.Gateway.Client.Client.ApiResponse localVarResponse = await DrainMonitoringLogWithHttpInfoAsync(cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -406,7 +406,7 @@ public Devolutions.Gateway.Client.Client.ApiResponse Drai /// Thrown when fails to make API call /// Cancellation Token to cancel the request. /// Task of ApiResponse (MonitoringLogResponse) - public async System.Threading.Tasks.Task> DrainMonitoringLogWithHttpInfoAsync(System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> DrainMonitoringLogWithHttpInfoAsync(System.Threading.CancellationToken cancellationToken = default) { Devolutions.Gateway.Client.Client.RequestOptions localVarRequestOptions = new Devolutions.Gateway.Client.Client.RequestOptions(); @@ -516,7 +516,7 @@ public Devolutions.Gateway.Client.Client.ApiResponse SetMonit /// JSON object containing a list of monitors /// Cancellation Token to cancel the request. /// Task of SetConfigResponse - public async System.Threading.Tasks.Task SetMonitoringConfigAsync(MonitorsConfig monitorsConfig, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task SetMonitoringConfigAsync(MonitorsConfig monitorsConfig, System.Threading.CancellationToken cancellationToken = default) { Devolutions.Gateway.Client.Client.ApiResponse localVarResponse = await SetMonitoringConfigWithHttpInfoAsync(monitorsConfig, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -529,7 +529,7 @@ public Devolutions.Gateway.Client.Client.ApiResponse SetMonit /// JSON object containing a list of monitors /// Cancellation Token to cancel the request. /// Task of ApiResponse (SetConfigResponse) - public async System.Threading.Tasks.Task> SetMonitoringConfigWithHttpInfoAsync(MonitorsConfig monitorsConfig, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> SetMonitoringConfigWithHttpInfoAsync(MonitorsConfig monitorsConfig, System.Threading.CancellationToken cancellationToken = default) { // verify the required parameter 'monitorsConfig' is set if (monitorsConfig == null) diff --git a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Api/PreflightApi.cs b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Api/PreflightApi.cs index ddedb993c..facdf0d00 100644 --- a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Api/PreflightApi.cs +++ b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Api/PreflightApi.cs @@ -3,7 +3,7 @@ * * Protocol-aware fine-grained relay server * - * The version of the OpenAPI document: 2025.3.2 + * The version of the OpenAPI document: 2026.2.4 * Contact: infos@devolutions.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -65,7 +65,7 @@ public interface IPreflightApiAsync : IApiAccessor /// /// Cancellation Token to cancel the request. /// Task of List<PreflightOutput> - System.Threading.Tasks.Task> PostPreflightAsync(List preflightOperation, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task> PostPreflightAsync(List preflightOperation, System.Threading.CancellationToken cancellationToken = default); /// /// Performs a batch of preflight operations @@ -77,7 +77,7 @@ public interface IPreflightApiAsync : IApiAccessor /// /// Cancellation Token to cancel the request. /// Task of ApiResponse (List<PreflightOutput>) - System.Threading.Tasks.Task>> PostPreflightWithHttpInfoAsync(List preflightOperation, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task>> PostPreflightWithHttpInfoAsync(List preflightOperation, System.Threading.CancellationToken cancellationToken = default); #endregion Asynchronous Operations } @@ -360,7 +360,7 @@ public Devolutions.Gateway.Client.Client.ApiResponse> Post /// /// Cancellation Token to cancel the request. /// Task of List<PreflightOutput> - public async System.Threading.Tasks.Task> PostPreflightAsync(List preflightOperation, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> PostPreflightAsync(List preflightOperation, System.Threading.CancellationToken cancellationToken = default) { Devolutions.Gateway.Client.Client.ApiResponse> localVarResponse = await PostPreflightWithHttpInfoAsync(preflightOperation, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -373,7 +373,7 @@ public Devolutions.Gateway.Client.Client.ApiResponse> Post /// /// Cancellation Token to cancel the request. /// Task of ApiResponse (List<PreflightOutput>) - public async System.Threading.Tasks.Task>> PostPreflightWithHttpInfoAsync(List preflightOperation, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task>> PostPreflightWithHttpInfoAsync(List preflightOperation, System.Threading.CancellationToken cancellationToken = default) { // verify the required parameter 'preflightOperation' is set if (preflightOperation == null) diff --git a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Api/SessionsApi.cs b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Api/SessionsApi.cs index 687defe3c..ca5096320 100644 --- a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Api/SessionsApi.cs +++ b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Api/SessionsApi.cs @@ -3,7 +3,7 @@ * * Protocol-aware fine-grained relay server * - * The version of the OpenAPI document: 2025.3.2 + * The version of the OpenAPI document: 2026.2.4 * Contact: infos@devolutions.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -80,7 +80,7 @@ public interface ISessionsApiAsync : IApiAccessor /// Thrown when fails to make API call /// Cancellation Token to cancel the request. /// Task of List<SessionInfo> - System.Threading.Tasks.Task> GetSessionsAsync(System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task> GetSessionsAsync(System.Threading.CancellationToken cancellationToken = default); /// /// Lists running sessions @@ -91,7 +91,7 @@ public interface ISessionsApiAsync : IApiAccessor /// Thrown when fails to make API call /// Cancellation Token to cancel the request. /// Task of ApiResponse (List<SessionInfo>) - System.Threading.Tasks.Task>> GetSessionsWithHttpInfoAsync(System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task>> GetSessionsWithHttpInfoAsync(System.Threading.CancellationToken cancellationToken = default); /// /// Terminate forcefully a running session /// @@ -102,7 +102,7 @@ public interface ISessionsApiAsync : IApiAccessor /// Session / association ID of the session to terminate /// Cancellation Token to cancel the request. /// Task of void - System.Threading.Tasks.Task TerminateSessionAsync(Guid id, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task TerminateSessionAsync(Guid id, System.Threading.CancellationToken cancellationToken = default); /// /// Terminate forcefully a running session @@ -114,7 +114,7 @@ public interface ISessionsApiAsync : IApiAccessor /// Session / association ID of the session to terminate /// Cancellation Token to cancel the request. /// Task of ApiResponse - System.Threading.Tasks.Task> TerminateSessionWithHttpInfoAsync(Guid id, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task> TerminateSessionWithHttpInfoAsync(Guid id, System.Threading.CancellationToken cancellationToken = default); #endregion Asynchronous Operations } @@ -388,7 +388,7 @@ public Devolutions.Gateway.Client.Client.ApiResponse> GetSessi /// Thrown when fails to make API call /// Cancellation Token to cancel the request. /// Task of List<SessionInfo> - public async System.Threading.Tasks.Task> GetSessionsAsync(System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> GetSessionsAsync(System.Threading.CancellationToken cancellationToken = default) { Devolutions.Gateway.Client.Client.ApiResponse> localVarResponse = await GetSessionsWithHttpInfoAsync(cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -400,7 +400,7 @@ public Devolutions.Gateway.Client.Client.ApiResponse> GetSessi /// Thrown when fails to make API call /// Cancellation Token to cancel the request. /// Task of ApiResponse (List<SessionInfo>) - public async System.Threading.Tasks.Task>> GetSessionsWithHttpInfoAsync(System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task>> GetSessionsWithHttpInfoAsync(System.Threading.CancellationToken cancellationToken = default) { Devolutions.Gateway.Client.Client.RequestOptions localVarRequestOptions = new Devolutions.Gateway.Client.Client.RequestOptions(); @@ -503,7 +503,7 @@ public Devolutions.Gateway.Client.Client.ApiResponse TerminateSessionWit /// Session / association ID of the session to terminate /// Cancellation Token to cancel the request. /// Task of void - public async System.Threading.Tasks.Task TerminateSessionAsync(Guid id, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task TerminateSessionAsync(Guid id, System.Threading.CancellationToken cancellationToken = default) { await TerminateSessionWithHttpInfoAsync(id, cancellationToken).ConfigureAwait(false); } @@ -515,7 +515,7 @@ public Devolutions.Gateway.Client.Client.ApiResponse TerminateSessionWit /// Session / association ID of the session to terminate /// Cancellation Token to cancel the request. /// Task of ApiResponse - public async System.Threading.Tasks.Task> TerminateSessionWithHttpInfoAsync(Guid id, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> TerminateSessionWithHttpInfoAsync(Guid id, System.Threading.CancellationToken cancellationToken = default) { Devolutions.Gateway.Client.Client.RequestOptions localVarRequestOptions = new Devolutions.Gateway.Client.Client.RequestOptions(); diff --git a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Api/TrafficApi.cs b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Api/TrafficApi.cs index c337afbd8..af919a199 100644 --- a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Api/TrafficApi.cs +++ b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Api/TrafficApi.cs @@ -3,7 +3,7 @@ * * Protocol-aware fine-grained relay server * - * The version of the OpenAPI document: 2025.3.2 + * The version of the OpenAPI document: 2026.2.4 * Contact: infos@devolutions.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -85,7 +85,7 @@ public interface ITrafficApiAsync : IApiAccessor /// Array of event IDs to acknowledge /// Cancellation Token to cancel the request. /// Task of AckResponse - System.Threading.Tasks.Task AckTrafficEventsAsync(AckRequest ackRequest, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task AckTrafficEventsAsync(AckRequest ackRequest, System.Threading.CancellationToken cancellationToken = default); /// /// Acknowledge traffic audit events and remove them from the queue @@ -97,7 +97,7 @@ public interface ITrafficApiAsync : IApiAccessor /// Array of event IDs to acknowledge /// Cancellation Token to cancel the request. /// Task of ApiResponse (AckResponse) - System.Threading.Tasks.Task> AckTrafficEventsWithHttpInfoAsync(AckRequest ackRequest, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task> AckTrafficEventsWithHttpInfoAsync(AckRequest ackRequest, System.Threading.CancellationToken cancellationToken = default); /// /// Claim traffic audit events for processing /// @@ -109,7 +109,7 @@ public interface ITrafficApiAsync : IApiAccessor /// Maximum number of events to claim (1-1000, default: 100) /// Cancellation Token to cancel the request. /// Task of List<ClaimedTrafficEvent> - System.Threading.Tasks.Task> ClaimTrafficEventsAsync(int leaseMs, int max, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task> ClaimTrafficEventsAsync(int leaseMs, int max, System.Threading.CancellationToken cancellationToken = default); /// /// Claim traffic audit events for processing @@ -122,7 +122,7 @@ public interface ITrafficApiAsync : IApiAccessor /// Maximum number of events to claim (1-1000, default: 100) /// Cancellation Token to cancel the request. /// Task of ApiResponse (List<ClaimedTrafficEvent>) - System.Threading.Tasks.Task>> ClaimTrafficEventsWithHttpInfoAsync(int leaseMs, int max, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task>> ClaimTrafficEventsWithHttpInfoAsync(int leaseMs, int max, System.Threading.CancellationToken cancellationToken = default); #endregion Asynchronous Operations } @@ -405,7 +405,7 @@ public Devolutions.Gateway.Client.Client.ApiResponse AckTrafficEven /// Array of event IDs to acknowledge /// Cancellation Token to cancel the request. /// Task of AckResponse - public async System.Threading.Tasks.Task AckTrafficEventsAsync(AckRequest ackRequest, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task AckTrafficEventsAsync(AckRequest ackRequest, System.Threading.CancellationToken cancellationToken = default) { Devolutions.Gateway.Client.Client.ApiResponse localVarResponse = await AckTrafficEventsWithHttpInfoAsync(ackRequest, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -418,7 +418,7 @@ public Devolutions.Gateway.Client.Client.ApiResponse AckTrafficEven /// Array of event IDs to acknowledge /// Cancellation Token to cancel the request. /// Task of ApiResponse (AckResponse) - public async System.Threading.Tasks.Task> AckTrafficEventsWithHttpInfoAsync(AckRequest ackRequest, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> AckTrafficEventsWithHttpInfoAsync(AckRequest ackRequest, System.Threading.CancellationToken cancellationToken = default) { // verify the required parameter 'ackRequest' is set if (ackRequest == null) @@ -533,7 +533,7 @@ public Devolutions.Gateway.Client.Client.ApiResponse> /// Maximum number of events to claim (1-1000, default: 100) /// Cancellation Token to cancel the request. /// Task of List<ClaimedTrafficEvent> - public async System.Threading.Tasks.Task> ClaimTrafficEventsAsync(int leaseMs, int max, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> ClaimTrafficEventsAsync(int leaseMs, int max, System.Threading.CancellationToken cancellationToken = default) { Devolutions.Gateway.Client.Client.ApiResponse> localVarResponse = await ClaimTrafficEventsWithHttpInfoAsync(leaseMs, max, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -547,7 +547,7 @@ public Devolutions.Gateway.Client.Client.ApiResponse> /// Maximum number of events to claim (1-1000, default: 100) /// Cancellation Token to cancel the request. /// Task of ApiResponse (List<ClaimedTrafficEvent>) - public async System.Threading.Tasks.Task>> ClaimTrafficEventsWithHttpInfoAsync(int leaseMs, int max, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task>> ClaimTrafficEventsWithHttpInfoAsync(int leaseMs, int max, System.Threading.CancellationToken cancellationToken = default) { Devolutions.Gateway.Client.Client.RequestOptions localVarRequestOptions = new Devolutions.Gateway.Client.Client.RequestOptions(); diff --git a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Api/UpdateApi.cs b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Api/UpdateApi.cs index 933ab6963..59ead0b85 100644 --- a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Api/UpdateApi.cs +++ b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Api/UpdateApi.cs @@ -3,7 +3,7 @@ * * Protocol-aware fine-grained relay server * - * The version of the OpenAPI document: 2025.3.2 + * The version of the OpenAPI document: 2026.2.4 * Contact: infos@devolutions.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -17,6 +17,7 @@ using System.Net.Http; using System.Net.Mime; using Devolutions.Gateway.Client.Client; +using Devolutions.Gateway.Client.Model; namespace Devolutions.Gateway.Client.Api { @@ -28,26 +29,87 @@ public interface IUpdateApiSync : IApiAccessor { #region Synchronous Operations /// - /// Triggers Devolutions Gateway update process. + /// Retrieve the currently installed version of each Devolutions product. /// /// - /// This is done via updating `Agent/update.json` file, which is then read by Devolutions Agent when changes are detected. If the version written to `update.json` is indeed higher than the currently installed version, Devolutions Agent will proceed with the update process. + /// Reads `update_status.json`, which is written by the Devolutions Agent on startup and refreshed after every update run. When the file does not exist (agent not installed or is an older version), the endpoint returns HTTP 503 because updater status is unavailable. /// /// Thrown when fails to make API call - /// The version to install; use 'latest' for the latest version, or 'w.x.y.z' for a specific version + /// GetUpdateProductsResponse + GetUpdateProductsResponse GetUpdateProducts(); + + /// + /// Retrieve the currently installed version of each Devolutions product. + /// + /// + /// Reads `update_status.json`, which is written by the Devolutions Agent on startup and refreshed after every update run. When the file does not exist (agent not installed or is an older version), the endpoint returns HTTP 503 because updater status is unavailable. + /// + /// Thrown when fails to make API call + /// ApiResponse of GetUpdateProductsResponse + ApiResponse GetUpdateProductsWithHttpInfo(); + /// + /// Retrieve the current Devolutions Agent auto-update schedule. + /// + /// + /// Reads the `Schedule` field from `update_status.json`. When the field is absent the response contains zeroed defaults (`Enabled: false`, interval `0`, window start `0`, no products). + /// + /// Thrown when fails to make API call + /// GetUpdateScheduleResponse + GetUpdateScheduleResponse GetUpdateSchedule(); + + /// + /// Retrieve the current Devolutions Agent auto-update schedule. + /// + /// + /// Reads the `Schedule` field from `update_status.json`. When the field is absent the response contains zeroed defaults (`Enabled: false`, interval `0`, window start `0`, no products). + /// + /// Thrown when fails to make API call + /// ApiResponse of GetUpdateScheduleResponse + ApiResponse GetUpdateScheduleWithHttpInfo(); + /// + /// Set the Devolutions Agent auto-update schedule. + /// + /// + /// Writes the `Schedule` field into `update.json`. The agent watches this file and applies the new schedule immediately, then persists it to `agent.json`. All other fields in `update.json` are preserved; the `VersionMinor` field is reset to the minor version this gateway build understands so the agent does not see an unknown future version. + /// + /// Thrown when fails to make API call + /// /// Object - Object TriggerUpdate(string version); + Object SetUpdateSchedule(SetUpdateScheduleRequest setUpdateScheduleRequest); /// - /// Triggers Devolutions Gateway update process. + /// Set the Devolutions Agent auto-update schedule. /// /// - /// This is done via updating `Agent/update.json` file, which is then read by Devolutions Agent when changes are detected. If the version written to `update.json` is indeed higher than the currently installed version, Devolutions Agent will proceed with the update process. + /// Writes the `Schedule` field into `update.json`. The agent watches this file and applies the new schedule immediately, then persists it to `agent.json`. All other fields in `update.json` are preserved; the `VersionMinor` field is reset to the minor version this gateway build understands so the agent does not see an unknown future version. /// /// Thrown when fails to make API call - /// The version to install; use 'latest' for the latest version, or 'w.x.y.z' for a specific version + /// /// ApiResponse of Object - ApiResponse TriggerUpdateWithHttpInfo(string version); + ApiResponse SetUpdateScheduleWithHttpInfo(SetUpdateScheduleRequest setUpdateScheduleRequest); + /// + /// Trigger an update for one or more Devolutions products. + /// + /// + /// Writes the requested version(s) into `Agent/update.json`, which is watched by Devolutions Agent. When a requested version is higher than the installed version the agent proceeds with the update. **Body form** (preferred): pass a JSON body with a `Products` map. **Query-param form** (legacy, gateway-only): `POST /jet/update?version=latest`. This form updates only the Gateway product and is kept for backward compatibility. Both forms cannot be used simultaneously; doing so returns HTTP 400. + /// + /// Thrown when fails to make API call + /// Gateway-only target version; use the request body for multi-product updates (optional) (deprecated) + /// Products and target versions to update (optional) + /// Object + Object TriggerUpdate(string? version = default, UpdateRequestSchema? updateRequestSchema = default); + + /// + /// Trigger an update for one or more Devolutions products. + /// + /// + /// Writes the requested version(s) into `Agent/update.json`, which is watched by Devolutions Agent. When a requested version is higher than the installed version the agent proceeds with the update. **Body form** (preferred): pass a JSON body with a `Products` map. **Query-param form** (legacy, gateway-only): `POST /jet/update?version=latest`. This form updates only the Gateway product and is kept for backward compatibility. Both forms cannot be used simultaneously; doing so returns HTTP 400. + /// + /// Thrown when fails to make API call + /// Gateway-only target version; use the request body for multi-product updates (optional) (deprecated) + /// Products and target versions to update (optional) + /// ApiResponse of Object + ApiResponse TriggerUpdateWithHttpInfo(string? version = default, UpdateRequestSchema? updateRequestSchema = default); #endregion Synchronous Operations } @@ -58,28 +120,95 @@ public interface IUpdateApiAsync : IApiAccessor { #region Asynchronous Operations /// - /// Triggers Devolutions Gateway update process. + /// Retrieve the currently installed version of each Devolutions product. + /// + /// + /// Reads `update_status.json`, which is written by the Devolutions Agent on startup and refreshed after every update run. When the file does not exist (agent not installed or is an older version), the endpoint returns HTTP 503 because updater status is unavailable. + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// Task of GetUpdateProductsResponse + System.Threading.Tasks.Task GetUpdateProductsAsync(System.Threading.CancellationToken cancellationToken = default); + + /// + /// Retrieve the currently installed version of each Devolutions product. + /// + /// + /// Reads `update_status.json`, which is written by the Devolutions Agent on startup and refreshed after every update run. When the file does not exist (agent not installed or is an older version), the endpoint returns HTTP 503 because updater status is unavailable. + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (GetUpdateProductsResponse) + System.Threading.Tasks.Task> GetUpdateProductsWithHttpInfoAsync(System.Threading.CancellationToken cancellationToken = default); + /// + /// Retrieve the current Devolutions Agent auto-update schedule. + /// + /// + /// Reads the `Schedule` field from `update_status.json`. When the field is absent the response contains zeroed defaults (`Enabled: false`, interval `0`, window start `0`, no products). + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// Task of GetUpdateScheduleResponse + System.Threading.Tasks.Task GetUpdateScheduleAsync(System.Threading.CancellationToken cancellationToken = default); + + /// + /// Retrieve the current Devolutions Agent auto-update schedule. + /// + /// + /// Reads the `Schedule` field from `update_status.json`. When the field is absent the response contains zeroed defaults (`Enabled: false`, interval `0`, window start `0`, no products). + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (GetUpdateScheduleResponse) + System.Threading.Tasks.Task> GetUpdateScheduleWithHttpInfoAsync(System.Threading.CancellationToken cancellationToken = default); + /// + /// Set the Devolutions Agent auto-update schedule. /// /// - /// This is done via updating `Agent/update.json` file, which is then read by Devolutions Agent when changes are detected. If the version written to `update.json` is indeed higher than the currently installed version, Devolutions Agent will proceed with the update process. + /// Writes the `Schedule` field into `update.json`. The agent watches this file and applies the new schedule immediately, then persists it to `agent.json`. All other fields in `update.json` are preserved; the `VersionMinor` field is reset to the minor version this gateway build understands so the agent does not see an unknown future version. /// /// Thrown when fails to make API call - /// The version to install; use 'latest' for the latest version, or 'w.x.y.z' for a specific version + /// /// Cancellation Token to cancel the request. /// Task of Object - System.Threading.Tasks.Task TriggerUpdateAsync(string version, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task SetUpdateScheduleAsync(SetUpdateScheduleRequest setUpdateScheduleRequest, System.Threading.CancellationToken cancellationToken = default); /// - /// Triggers Devolutions Gateway update process. + /// Set the Devolutions Agent auto-update schedule. /// /// - /// This is done via updating `Agent/update.json` file, which is then read by Devolutions Agent when changes are detected. If the version written to `update.json` is indeed higher than the currently installed version, Devolutions Agent will proceed with the update process. + /// Writes the `Schedule` field into `update.json`. The agent watches this file and applies the new schedule immediately, then persists it to `agent.json`. All other fields in `update.json` are preserved; the `VersionMinor` field is reset to the minor version this gateway build understands so the agent does not see an unknown future version. /// /// Thrown when fails to make API call - /// The version to install; use 'latest' for the latest version, or 'w.x.y.z' for a specific version + /// /// Cancellation Token to cancel the request. /// Task of ApiResponse (Object) - System.Threading.Tasks.Task> TriggerUpdateWithHttpInfoAsync(string version, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task> SetUpdateScheduleWithHttpInfoAsync(SetUpdateScheduleRequest setUpdateScheduleRequest, System.Threading.CancellationToken cancellationToken = default); + /// + /// Trigger an update for one or more Devolutions products. + /// + /// + /// Writes the requested version(s) into `Agent/update.json`, which is watched by Devolutions Agent. When a requested version is higher than the installed version the agent proceeds with the update. **Body form** (preferred): pass a JSON body with a `Products` map. **Query-param form** (legacy, gateway-only): `POST /jet/update?version=latest`. This form updates only the Gateway product and is kept for backward compatibility. Both forms cannot be used simultaneously; doing so returns HTTP 400. + /// + /// Thrown when fails to make API call + /// Gateway-only target version; use the request body for multi-product updates (optional) (deprecated) + /// Products and target versions to update (optional) + /// Cancellation Token to cancel the request. + /// Task of Object + System.Threading.Tasks.Task TriggerUpdateAsync(string? version = default, UpdateRequestSchema? updateRequestSchema = default, System.Threading.CancellationToken cancellationToken = default); + + /// + /// Trigger an update for one or more Devolutions products. + /// + /// + /// Writes the requested version(s) into `Agent/update.json`, which is watched by Devolutions Agent. When a requested version is higher than the installed version the agent proceeds with the update. **Body form** (preferred): pass a JSON body with a `Products` map. **Query-param form** (legacy, gateway-only): `POST /jet/update?version=latest`. This form updates only the Gateway product and is kept for backward compatibility. Both forms cannot be used simultaneously; doing so returns HTTP 400. + /// + /// Thrown when fails to make API call + /// Gateway-only target version; use the request body for multi-product updates (optional) (deprecated) + /// Products and target versions to update (optional) + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (Object) + System.Threading.Tasks.Task> TriggerUpdateWithHttpInfoAsync(string? version = default, UpdateRequestSchema? updateRequestSchema = default, System.Threading.CancellationToken cancellationToken = default); #endregion Asynchronous Operations } @@ -294,32 +423,259 @@ public Devolutions.Gateway.Client.Client.ExceptionFactory ExceptionFactory } /// - /// Triggers Devolutions Gateway update process. This is done via updating `Agent/update.json` file, which is then read by Devolutions Agent when changes are detected. If the version written to `update.json` is indeed higher than the currently installed version, Devolutions Agent will proceed with the update process. + /// Retrieve the currently installed version of each Devolutions product. Reads `update_status.json`, which is written by the Devolutions Agent on startup and refreshed after every update run. When the file does not exist (agent not installed or is an older version), the endpoint returns HTTP 503 because updater status is unavailable. + /// + /// Thrown when fails to make API call + /// GetUpdateProductsResponse + public GetUpdateProductsResponse GetUpdateProducts() + { + Devolutions.Gateway.Client.Client.ApiResponse localVarResponse = GetUpdateProductsWithHttpInfo(); + return localVarResponse.Data; + } + + /// + /// Retrieve the currently installed version of each Devolutions product. Reads `update_status.json`, which is written by the Devolutions Agent on startup and refreshed after every update run. When the file does not exist (agent not installed or is an older version), the endpoint returns HTTP 503 because updater status is unavailable. + /// + /// Thrown when fails to make API call + /// ApiResponse of GetUpdateProductsResponse + public Devolutions.Gateway.Client.Client.ApiResponse GetUpdateProductsWithHttpInfo() + { + Devolutions.Gateway.Client.Client.RequestOptions localVarRequestOptions = new Devolutions.Gateway.Client.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = Devolutions.Gateway.Client.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Devolutions.Gateway.Client.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + + // authentication (scope_token) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Get("/jet/update", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("GetUpdateProducts", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Retrieve the currently installed version of each Devolutions product. Reads `update_status.json`, which is written by the Devolutions Agent on startup and refreshed after every update run. When the file does not exist (agent not installed or is an older version), the endpoint returns HTTP 503 because updater status is unavailable. + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// Task of GetUpdateProductsResponse + public async System.Threading.Tasks.Task GetUpdateProductsAsync(System.Threading.CancellationToken cancellationToken = default) + { + Devolutions.Gateway.Client.Client.ApiResponse localVarResponse = await GetUpdateProductsWithHttpInfoAsync(cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Retrieve the currently installed version of each Devolutions product. Reads `update_status.json`, which is written by the Devolutions Agent on startup and refreshed after every update run. When the file does not exist (agent not installed or is an older version), the endpoint returns HTTP 503 because updater status is unavailable. + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (GetUpdateProductsResponse) + public async System.Threading.Tasks.Task> GetUpdateProductsWithHttpInfoAsync(System.Threading.CancellationToken cancellationToken = default) + { + + Devolutions.Gateway.Client.Client.RequestOptions localVarRequestOptions = new Devolutions.Gateway.Client.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + + var localVarContentType = Devolutions.Gateway.Client.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Devolutions.Gateway.Client.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + + // authentication (scope_token) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.GetAsync("/jet/update", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("GetUpdateProducts", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Retrieve the current Devolutions Agent auto-update schedule. Reads the `Schedule` field from `update_status.json`. When the field is absent the response contains zeroed defaults (`Enabled: false`, interval `0`, window start `0`, no products). /// /// Thrown when fails to make API call - /// The version to install; use 'latest' for the latest version, or 'w.x.y.z' for a specific version + /// GetUpdateScheduleResponse + public GetUpdateScheduleResponse GetUpdateSchedule() + { + Devolutions.Gateway.Client.Client.ApiResponse localVarResponse = GetUpdateScheduleWithHttpInfo(); + return localVarResponse.Data; + } + + /// + /// Retrieve the current Devolutions Agent auto-update schedule. Reads the `Schedule` field from `update_status.json`. When the field is absent the response contains zeroed defaults (`Enabled: false`, interval `0`, window start `0`, no products). + /// + /// Thrown when fails to make API call + /// ApiResponse of GetUpdateScheduleResponse + public Devolutions.Gateway.Client.Client.ApiResponse GetUpdateScheduleWithHttpInfo() + { + Devolutions.Gateway.Client.Client.RequestOptions localVarRequestOptions = new Devolutions.Gateway.Client.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = Devolutions.Gateway.Client.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Devolutions.Gateway.Client.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + + // authentication (scope_token) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Get("/jet/update/schedule", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("GetUpdateSchedule", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Retrieve the current Devolutions Agent auto-update schedule. Reads the `Schedule` field from `update_status.json`. When the field is absent the response contains zeroed defaults (`Enabled: false`, interval `0`, window start `0`, no products). + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// Task of GetUpdateScheduleResponse + public async System.Threading.Tasks.Task GetUpdateScheduleAsync(System.Threading.CancellationToken cancellationToken = default) + { + Devolutions.Gateway.Client.Client.ApiResponse localVarResponse = await GetUpdateScheduleWithHttpInfoAsync(cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Retrieve the current Devolutions Agent auto-update schedule. Reads the `Schedule` field from `update_status.json`. When the field is absent the response contains zeroed defaults (`Enabled: false`, interval `0`, window start `0`, no products). + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (GetUpdateScheduleResponse) + public async System.Threading.Tasks.Task> GetUpdateScheduleWithHttpInfoAsync(System.Threading.CancellationToken cancellationToken = default) + { + + Devolutions.Gateway.Client.Client.RequestOptions localVarRequestOptions = new Devolutions.Gateway.Client.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + + var localVarContentType = Devolutions.Gateway.Client.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Devolutions.Gateway.Client.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + + // authentication (scope_token) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.GetAsync("/jet/update/schedule", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("GetUpdateSchedule", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Set the Devolutions Agent auto-update schedule. Writes the `Schedule` field into `update.json`. The agent watches this file and applies the new schedule immediately, then persists it to `agent.json`. All other fields in `update.json` are preserved; the `VersionMinor` field is reset to the minor version this gateway build understands so the agent does not see an unknown future version. + /// + /// Thrown when fails to make API call + /// /// Object - public Object TriggerUpdate(string version) + public Object SetUpdateSchedule(SetUpdateScheduleRequest setUpdateScheduleRequest) { - Devolutions.Gateway.Client.Client.ApiResponse localVarResponse = TriggerUpdateWithHttpInfo(version); + Devolutions.Gateway.Client.Client.ApiResponse localVarResponse = SetUpdateScheduleWithHttpInfo(setUpdateScheduleRequest); return localVarResponse.Data; } /// - /// Triggers Devolutions Gateway update process. This is done via updating `Agent/update.json` file, which is then read by Devolutions Agent when changes are detected. If the version written to `update.json` is indeed higher than the currently installed version, Devolutions Agent will proceed with the update process. + /// Set the Devolutions Agent auto-update schedule. Writes the `Schedule` field into `update.json`. The agent watches this file and applies the new schedule immediately, then persists it to `agent.json`. All other fields in `update.json` are preserved; the `VersionMinor` field is reset to the minor version this gateway build understands so the agent does not see an unknown future version. /// /// Thrown when fails to make API call - /// The version to install; use 'latest' for the latest version, or 'w.x.y.z' for a specific version + /// /// ApiResponse of Object - public Devolutions.Gateway.Client.Client.ApiResponse TriggerUpdateWithHttpInfo(string version) + public Devolutions.Gateway.Client.Client.ApiResponse SetUpdateScheduleWithHttpInfo(SetUpdateScheduleRequest setUpdateScheduleRequest) { - // verify the required parameter 'version' is set - if (version == null) - throw new Devolutions.Gateway.Client.Client.ApiException(400, "Missing required parameter 'version' when calling UpdateApi->TriggerUpdate"); + // verify the required parameter 'setUpdateScheduleRequest' is set + if (setUpdateScheduleRequest == null) + throw new Devolutions.Gateway.Client.Client.ApiException(400, "Missing required parameter 'setUpdateScheduleRequest' when calling UpdateApi->SetUpdateSchedule"); Devolutions.Gateway.Client.Client.RequestOptions localVarRequestOptions = new Devolutions.Gateway.Client.Client.RequestOptions(); string[] _contentTypes = new string[] { + "application/json" }; // to determine the Accept header @@ -333,7 +689,138 @@ public Devolutions.Gateway.Client.Client.ApiResponse TriggerUpdateWithHt var localVarAccept = Devolutions.Gateway.Client.Client.ClientUtils.SelectHeaderAccept(_accepts); if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); - localVarRequestOptions.QueryParameters.Add(Devolutions.Gateway.Client.Client.ClientUtils.ParameterToMultiMap("", "version", version)); + localVarRequestOptions.Data = setUpdateScheduleRequest; + + // authentication (scope_token) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Post("/jet/update/schedule", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("SetUpdateSchedule", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Set the Devolutions Agent auto-update schedule. Writes the `Schedule` field into `update.json`. The agent watches this file and applies the new schedule immediately, then persists it to `agent.json`. All other fields in `update.json` are preserved; the `VersionMinor` field is reset to the minor version this gateway build understands so the agent does not see an unknown future version. + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of Object + public async System.Threading.Tasks.Task SetUpdateScheduleAsync(SetUpdateScheduleRequest setUpdateScheduleRequest, System.Threading.CancellationToken cancellationToken = default) + { + Devolutions.Gateway.Client.Client.ApiResponse localVarResponse = await SetUpdateScheduleWithHttpInfoAsync(setUpdateScheduleRequest, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Set the Devolutions Agent auto-update schedule. Writes the `Schedule` field into `update.json`. The agent watches this file and applies the new schedule immediately, then persists it to `agent.json`. All other fields in `update.json` are preserved; the `VersionMinor` field is reset to the minor version this gateway build understands so the agent does not see an unknown future version. + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (Object) + public async System.Threading.Tasks.Task> SetUpdateScheduleWithHttpInfoAsync(SetUpdateScheduleRequest setUpdateScheduleRequest, System.Threading.CancellationToken cancellationToken = default) + { + // verify the required parameter 'setUpdateScheduleRequest' is set + if (setUpdateScheduleRequest == null) + throw new Devolutions.Gateway.Client.Client.ApiException(400, "Missing required parameter 'setUpdateScheduleRequest' when calling UpdateApi->SetUpdateSchedule"); + + + Devolutions.Gateway.Client.Client.RequestOptions localVarRequestOptions = new Devolutions.Gateway.Client.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + + var localVarContentType = Devolutions.Gateway.Client.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Devolutions.Gateway.Client.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.Data = setUpdateScheduleRequest; + + // authentication (scope_token) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.PostAsync("/jet/update/schedule", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("SetUpdateSchedule", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Trigger an update for one or more Devolutions products. Writes the requested version(s) into `Agent/update.json`, which is watched by Devolutions Agent. When a requested version is higher than the installed version the agent proceeds with the update. **Body form** (preferred): pass a JSON body with a `Products` map. **Query-param form** (legacy, gateway-only): `POST /jet/update?version=latest`. This form updates only the Gateway product and is kept for backward compatibility. Both forms cannot be used simultaneously; doing so returns HTTP 400. + /// + /// Thrown when fails to make API call + /// Gateway-only target version; use the request body for multi-product updates (optional) (deprecated) + /// Products and target versions to update (optional) + /// Object + public Object TriggerUpdate(string? version = default, UpdateRequestSchema? updateRequestSchema = default) + { + Devolutions.Gateway.Client.Client.ApiResponse localVarResponse = TriggerUpdateWithHttpInfo(version, updateRequestSchema); + return localVarResponse.Data; + } + + /// + /// Trigger an update for one or more Devolutions products. Writes the requested version(s) into `Agent/update.json`, which is watched by Devolutions Agent. When a requested version is higher than the installed version the agent proceeds with the update. **Body form** (preferred): pass a JSON body with a `Products` map. **Query-param form** (legacy, gateway-only): `POST /jet/update?version=latest`. This form updates only the Gateway product and is kept for backward compatibility. Both forms cannot be used simultaneously; doing so returns HTTP 400. + /// + /// Thrown when fails to make API call + /// Gateway-only target version; use the request body for multi-product updates (optional) (deprecated) + /// Products and target versions to update (optional) + /// ApiResponse of Object + public Devolutions.Gateway.Client.Client.ApiResponse TriggerUpdateWithHttpInfo(string? version = default, UpdateRequestSchema? updateRequestSchema = default) + { + Devolutions.Gateway.Client.Client.RequestOptions localVarRequestOptions = new Devolutions.Gateway.Client.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = Devolutions.Gateway.Client.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Devolutions.Gateway.Client.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + if (version != null) + { + localVarRequestOptions.QueryParameters.Add(Devolutions.Gateway.Client.Client.ClientUtils.ParameterToMultiMap("", "version", version)); + } + localVarRequestOptions.Data = updateRequestSchema; // authentication (scope_token) required // bearer authentication required @@ -355,35 +842,34 @@ public Devolutions.Gateway.Client.Client.ApiResponse TriggerUpdateWithHt } /// - /// Triggers Devolutions Gateway update process. This is done via updating `Agent/update.json` file, which is then read by Devolutions Agent when changes are detected. If the version written to `update.json` is indeed higher than the currently installed version, Devolutions Agent will proceed with the update process. + /// Trigger an update for one or more Devolutions products. Writes the requested version(s) into `Agent/update.json`, which is watched by Devolutions Agent. When a requested version is higher than the installed version the agent proceeds with the update. **Body form** (preferred): pass a JSON body with a `Products` map. **Query-param form** (legacy, gateway-only): `POST /jet/update?version=latest`. This form updates only the Gateway product and is kept for backward compatibility. Both forms cannot be used simultaneously; doing so returns HTTP 400. /// /// Thrown when fails to make API call - /// The version to install; use 'latest' for the latest version, or 'w.x.y.z' for a specific version + /// Gateway-only target version; use the request body for multi-product updates (optional) (deprecated) + /// Products and target versions to update (optional) /// Cancellation Token to cancel the request. /// Task of Object - public async System.Threading.Tasks.Task TriggerUpdateAsync(string version, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task TriggerUpdateAsync(string? version = default, UpdateRequestSchema? updateRequestSchema = default, System.Threading.CancellationToken cancellationToken = default) { - Devolutions.Gateway.Client.Client.ApiResponse localVarResponse = await TriggerUpdateWithHttpInfoAsync(version, cancellationToken).ConfigureAwait(false); + Devolutions.Gateway.Client.Client.ApiResponse localVarResponse = await TriggerUpdateWithHttpInfoAsync(version, updateRequestSchema, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; } /// - /// Triggers Devolutions Gateway update process. This is done via updating `Agent/update.json` file, which is then read by Devolutions Agent when changes are detected. If the version written to `update.json` is indeed higher than the currently installed version, Devolutions Agent will proceed with the update process. + /// Trigger an update for one or more Devolutions products. Writes the requested version(s) into `Agent/update.json`, which is watched by Devolutions Agent. When a requested version is higher than the installed version the agent proceeds with the update. **Body form** (preferred): pass a JSON body with a `Products` map. **Query-param form** (legacy, gateway-only): `POST /jet/update?version=latest`. This form updates only the Gateway product and is kept for backward compatibility. Both forms cannot be used simultaneously; doing so returns HTTP 400. /// /// Thrown when fails to make API call - /// The version to install; use 'latest' for the latest version, or 'w.x.y.z' for a specific version + /// Gateway-only target version; use the request body for multi-product updates (optional) (deprecated) + /// Products and target versions to update (optional) /// Cancellation Token to cancel the request. /// Task of ApiResponse (Object) - public async System.Threading.Tasks.Task> TriggerUpdateWithHttpInfoAsync(string version, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> TriggerUpdateWithHttpInfoAsync(string? version = default, UpdateRequestSchema? updateRequestSchema = default, System.Threading.CancellationToken cancellationToken = default) { - // verify the required parameter 'version' is set - if (version == null) - throw new Devolutions.Gateway.Client.Client.ApiException(400, "Missing required parameter 'version' when calling UpdateApi->TriggerUpdate"); - Devolutions.Gateway.Client.Client.RequestOptions localVarRequestOptions = new Devolutions.Gateway.Client.Client.RequestOptions(); string[] _contentTypes = new string[] { + "application/json" }; // to determine the Accept header @@ -398,7 +884,11 @@ public Devolutions.Gateway.Client.Client.ApiResponse TriggerUpdateWithHt var localVarAccept = Devolutions.Gateway.Client.Client.ClientUtils.SelectHeaderAccept(_accepts); if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); - localVarRequestOptions.QueryParameters.Add(Devolutions.Gateway.Client.Client.ClientUtils.ParameterToMultiMap("", "version", version)); + if (version != null) + { + localVarRequestOptions.QueryParameters.Add(Devolutions.Gateway.Client.Client.ClientUtils.ParameterToMultiMap("", "version", version)); + } + localVarRequestOptions.Data = updateRequestSchema; // authentication (scope_token) required // bearer authentication required diff --git a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Api/WebAppApi.cs b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Api/WebAppApi.cs index 6750931d2..201cf1d9c 100644 --- a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Api/WebAppApi.cs +++ b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Api/WebAppApi.cs @@ -3,7 +3,7 @@ * * Protocol-aware fine-grained relay server * - * The version of the OpenAPI document: 2025.3.2 + * The version of the OpenAPI document: 2026.2.4 * Contact: infos@devolutions.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -83,7 +83,7 @@ public interface IWebAppApiAsync : IApiAccessor /// JSON-encoded payload specifying the desired claims /// Cancellation Token to cancel the request. /// Task of string - System.Threading.Tasks.Task SignAppTokenAsync(AppTokenSignRequest appTokenSignRequest, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task SignAppTokenAsync(AppTokenSignRequest appTokenSignRequest, System.Threading.CancellationToken cancellationToken = default); /// /// Requests a web application token using the configured authorization method @@ -95,7 +95,7 @@ public interface IWebAppApiAsync : IApiAccessor /// JSON-encoded payload specifying the desired claims /// Cancellation Token to cancel the request. /// Task of ApiResponse (string) - System.Threading.Tasks.Task> SignAppTokenWithHttpInfoAsync(AppTokenSignRequest appTokenSignRequest, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task> SignAppTokenWithHttpInfoAsync(AppTokenSignRequest appTokenSignRequest, System.Threading.CancellationToken cancellationToken = default); /// /// Requests a session token using a web application token /// @@ -106,7 +106,7 @@ public interface IWebAppApiAsync : IApiAccessor /// JSON-encoded payload specifying the desired claims /// Cancellation Token to cancel the request. /// Task of string - System.Threading.Tasks.Task SignSessionTokenAsync(SessionTokenSignRequest sessionTokenSignRequest, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task SignSessionTokenAsync(SessionTokenSignRequest sessionTokenSignRequest, System.Threading.CancellationToken cancellationToken = default); /// /// Requests a session token using a web application token @@ -118,7 +118,7 @@ public interface IWebAppApiAsync : IApiAccessor /// JSON-encoded payload specifying the desired claims /// Cancellation Token to cancel the request. /// Task of ApiResponse (string) - System.Threading.Tasks.Task> SignSessionTokenWithHttpInfoAsync(SessionTokenSignRequest sessionTokenSignRequest, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task> SignSessionTokenWithHttpInfoAsync(SessionTokenSignRequest sessionTokenSignRequest, System.Threading.CancellationToken cancellationToken = default); #endregion Asynchronous Operations } @@ -401,7 +401,7 @@ public Devolutions.Gateway.Client.Client.ApiResponse SignAppTokenWithHtt /// JSON-encoded payload specifying the desired claims /// Cancellation Token to cancel the request. /// Task of string - public async System.Threading.Tasks.Task SignAppTokenAsync(AppTokenSignRequest appTokenSignRequest, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task SignAppTokenAsync(AppTokenSignRequest appTokenSignRequest, System.Threading.CancellationToken cancellationToken = default) { Devolutions.Gateway.Client.Client.ApiResponse localVarResponse = await SignAppTokenWithHttpInfoAsync(appTokenSignRequest, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -414,7 +414,7 @@ public Devolutions.Gateway.Client.Client.ApiResponse SignAppTokenWithHtt /// JSON-encoded payload specifying the desired claims /// Cancellation Token to cancel the request. /// Task of ApiResponse (string) - public async System.Threading.Tasks.Task> SignAppTokenWithHttpInfoAsync(AppTokenSignRequest appTokenSignRequest, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> SignAppTokenWithHttpInfoAsync(AppTokenSignRequest appTokenSignRequest, System.Threading.CancellationToken cancellationToken = default) { // verify the required parameter 'appTokenSignRequest' is set if (appTokenSignRequest == null) @@ -530,7 +530,7 @@ public Devolutions.Gateway.Client.Client.ApiResponse SignSessionTokenWit /// JSON-encoded payload specifying the desired claims /// Cancellation Token to cancel the request. /// Task of string - public async System.Threading.Tasks.Task SignSessionTokenAsync(SessionTokenSignRequest sessionTokenSignRequest, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task SignSessionTokenAsync(SessionTokenSignRequest sessionTokenSignRequest, System.Threading.CancellationToken cancellationToken = default) { Devolutions.Gateway.Client.Client.ApiResponse localVarResponse = await SignSessionTokenWithHttpInfoAsync(sessionTokenSignRequest, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -543,7 +543,7 @@ public Devolutions.Gateway.Client.Client.ApiResponse SignSessionTokenWit /// JSON-encoded payload specifying the desired claims /// Cancellation Token to cancel the request. /// Task of ApiResponse (string) - public async System.Threading.Tasks.Task> SignSessionTokenWithHttpInfoAsync(SessionTokenSignRequest sessionTokenSignRequest, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> SignSessionTokenWithHttpInfoAsync(SessionTokenSignRequest sessionTokenSignRequest, System.Threading.CancellationToken cancellationToken = default) { // verify the required parameter 'sessionTokenSignRequest' is set if (sessionTokenSignRequest == null) diff --git a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Client/ApiClient.cs b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Client/ApiClient.cs index 4b285a4a3..33b488361 100644 --- a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Client/ApiClient.cs +++ b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Client/ApiClient.cs @@ -3,7 +3,7 @@ * * Protocol-aware fine-grained relay server * - * The version of the OpenAPI document: 2025.3.2 + * The version of the OpenAPI document: 2026.2.4 * Contact: infos@devolutions.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -84,7 +84,7 @@ public string Serialize(object obj) public async Task Deserialize(HttpResponseMessage response) { - var result = (T) await Deserialize(response, typeof(T)).ConfigureAwait(false); + var result = (T)await Deserialize(response, typeof(T)).ConfigureAwait(false); return result; } @@ -100,13 +100,13 @@ internal async Task Deserialize(HttpResponseMessage response, Type type) // process response headers, e.g. Access-Control-Allow-Methods foreach (var responseHeader in response.Headers) { - headers.Add(responseHeader.Key + "=" + ClientUtils.ParameterToString(responseHeader.Value)); + headers.Add(responseHeader.Key + "=" + ClientUtils.ParameterToString(responseHeader.Value)); } // process response content headers, e.g. Content-Type foreach (var responseHeader in response.Content.Headers) { - headers.Add(responseHeader.Key + "=" + ClientUtils.ParameterToString(responseHeader.Value)); + headers.Add(responseHeader.Key + "=" + ClientUtils.ParameterToString(responseHeader.Value)); } // RFC 2183 & RFC 2616 @@ -117,7 +117,8 @@ internal async Task Deserialize(HttpResponseMessage response, Type type) } else if (type == typeof(FileParameter)) { - if (headers != null) { + if (headers != null) + { foreach (var header in headers) { var match = fileNameRegex.Match(header.ToString()); @@ -196,6 +197,7 @@ public string ContentType /// public partial class ApiClient : IDisposable, ISynchronousClient, IAsynchronousClient { + private static readonly HttpRequestOptionsKey> _httpOptionsCookieContainerKey = new("CookieContainer"); private readonly string _baseUrl; private readonly HttpClientHandler _httpClientHandler; @@ -288,7 +290,8 @@ public ApiClient(HttpClient client, string basePath, HttpClientHandler handler = /// public void Dispose() { - if(_disposeClient) { + if(_disposeClient) + { _httpClient.Dispose(); } } @@ -416,7 +419,7 @@ private HttpRequestMessage NewRequest( // TODO provide an alternative that allows cookies per request instead of per API client if (options.Cookies != null && options.Cookies.Count > 0) { - request.Properties["CookieContainer"] = options.Cookies; + request.Options.Set(_httpOptionsCookieContainerKey, options.Cookies); } return request; @@ -427,7 +430,7 @@ private HttpRequestMessage NewRequest( private async Task> ToApiResponse(HttpResponseMessage response, object responseData, Uri uri) { - T result = (T) responseData; + T result = (T)responseData; string rawContent = await response.Content.ReadAsStringAsync().ConfigureAwait(false); var transformed = new ApiResponse(response.StatusCode, new Multimap(), result, rawContent) @@ -462,7 +465,7 @@ private async Task> ToApiResponse(HttpResponseMessage response transformed.Cookies.Add(cookie); } } - catch (PlatformNotSupportedException) {} + catch (PlatformNotSupportedException) { } } return transformed; @@ -475,7 +478,7 @@ private ApiResponse Exec(HttpRequestMessage req, IReadableConfiguration co private async Task> ExecAsync(HttpRequestMessage req, IReadableConfiguration configuration, - System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + System.Threading.CancellationToken cancellationToken = default) { CancellationTokenSource timeoutTokenSource = null; CancellationTokenSource finalTokenSource = null; @@ -484,7 +487,7 @@ private async Task> ExecAsync(HttpRequestMessage req, try { - if (configuration.Timeout > 0) + if (configuration.Timeout > TimeSpan.Zero) { timeoutTokenSource = new CancellationTokenSource(configuration.Timeout); finalTokenSource = CancellationTokenSource.CreateLinkedTokenSource(finalToken, timeoutTokenSource.Token); @@ -499,15 +502,14 @@ private async Task> ExecAsync(HttpRequestMessage req, if (configuration.ClientCertificates != null) { - if(_httpClientHandler == null) throw new InvalidOperationException("Configuration `ClientCertificates` not supported when the client is explicitly created without an HttpClientHandler, use the proper constructor."); + if (_httpClientHandler == null) throw new InvalidOperationException("Configuration `ClientCertificates` not supported when the client is explicitly created without an HttpClientHandler, use the proper constructor."); _httpClientHandler.ClientCertificates.AddRange(configuration.ClientCertificates); } - var cookieContainer = req.Properties.ContainsKey("CookieContainer") ? req.Properties["CookieContainer"] as List : null; - if (cookieContainer != null) + if (req.Options.TryGetValue(_httpOptionsCookieContainerKey, out var cookieContainer)) { - if(_httpClientHandler == null) throw new InvalidOperationException("Request property `CookieContainer` not supported when the client is explicitly created without an HttpClientHandler, use the proper constructor."); + if (_httpClientHandler == null) throw new InvalidOperationException("Request property `CookieContainer` not supported when the client is explicitly created without an HttpClientHandler, use the proper constructor."); foreach (var cookie in cookieContainer) { _httpClientHandler.CookieContainer.Add(cookie); @@ -537,7 +539,7 @@ private async Task> ExecAsync(HttpRequestMessage req, if (!response.IsSuccessStatusCode) { - return await ToApiResponse(response, default(T), req.RequestUri).ConfigureAwait(false); + return await ToApiResponse(response, default, req.RequestUri).ConfigureAwait(false); } object responseData = await deserializer.Deserialize(response).ConfigureAwait(false); @@ -545,11 +547,11 @@ private async Task> ExecAsync(HttpRequestMessage req, // if the response type is oneOf/anyOf, call FromJSON to deserialize the data if (typeof(Devolutions.Gateway.Client.Model.AbstractOpenAPISchema).IsAssignableFrom(typeof(T))) { - responseData = (T) typeof(T).GetMethod("FromJson").Invoke(null, new object[] { response.Content }); + responseData = (T)typeof(T).GetMethod("FromJson").Invoke(null, new object[] { response.Content }); } else if (typeof(T).Name == "Stream") // for binary response { - responseData = (T) (object) await response.Content.ReadAsStreamAsync().ConfigureAwait(false); + responseData = (T)(object) await response.Content.ReadAsStreamAsync().ConfigureAwait(false); } InterceptResponse(req, response); @@ -589,7 +591,7 @@ private async Task> ExecAsync(HttpRequestMessage req, /// GlobalConfiguration has been done before calling this method. /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> GetAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public Task> GetAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default) { var config = configuration ?? GlobalConfiguration.Instance; return ExecAsync(NewRequest(HttpMethod.Get, path, options, config), config, cancellationToken); @@ -604,7 +606,7 @@ private async Task> ExecAsync(HttpRequestMessage req, /// GlobalConfiguration has been done before calling this method. /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> PostAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public Task> PostAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default) { var config = configuration ?? GlobalConfiguration.Instance; return ExecAsync(NewRequest(HttpMethod.Post, path, options, config), config, cancellationToken); @@ -619,7 +621,7 @@ private async Task> ExecAsync(HttpRequestMessage req, /// GlobalConfiguration has been done before calling this method. /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> PutAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public Task> PutAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default) { var config = configuration ?? GlobalConfiguration.Instance; return ExecAsync(NewRequest(HttpMethod.Put, path, options, config), config, cancellationToken); @@ -634,7 +636,7 @@ private async Task> ExecAsync(HttpRequestMessage req, /// GlobalConfiguration has been done before calling this method. /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> DeleteAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public Task> DeleteAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default) { var config = configuration ?? GlobalConfiguration.Instance; return ExecAsync(NewRequest(HttpMethod.Delete, path, options, config), config, cancellationToken); @@ -649,7 +651,7 @@ private async Task> ExecAsync(HttpRequestMessage req, /// GlobalConfiguration has been done before calling this method. /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> HeadAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public Task> HeadAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default) { var config = configuration ?? GlobalConfiguration.Instance; return ExecAsync(NewRequest(HttpMethod.Head, path, options, config), config, cancellationToken); @@ -664,7 +666,7 @@ private async Task> ExecAsync(HttpRequestMessage req, /// GlobalConfiguration has been done before calling this method. /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> OptionsAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public Task> OptionsAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default) { var config = configuration ?? GlobalConfiguration.Instance; return ExecAsync(NewRequest(HttpMethod.Options, path, options, config), config, cancellationToken); @@ -679,7 +681,7 @@ private async Task> ExecAsync(HttpRequestMessage req, /// GlobalConfiguration has been done before calling this method. /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> PatchAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public Task> PatchAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default) { var config = configuration ?? GlobalConfiguration.Instance; return ExecAsync(NewRequest(new HttpMethod("PATCH"), path, options, config), config, cancellationToken); diff --git a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Client/ApiException.cs b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Client/ApiException.cs index 4594b482a..19461fa46 100644 --- a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Client/ApiException.cs +++ b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Client/ApiException.cs @@ -3,7 +3,7 @@ * * Protocol-aware fine-grained relay server * - * The version of the OpenAPI document: 2025.3.2 + * The version of the OpenAPI document: 2026.2.4 * Contact: infos@devolutions.net * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Client/ApiResponse.cs b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Client/ApiResponse.cs index b5b8e4753..955894c8f 100644 --- a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Client/ApiResponse.cs +++ b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Client/ApiResponse.cs @@ -3,7 +3,7 @@ * * Protocol-aware fine-grained relay server * - * The version of the OpenAPI document: 2025.3.2 + * The version of the OpenAPI document: 2026.2.4 * Contact: infos@devolutions.net * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Client/ClientUtils.cs b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Client/ClientUtils.cs index 05b5ee056..89ef69ff9 100644 --- a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Client/ClientUtils.cs +++ b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Client/ClientUtils.cs @@ -3,7 +3,7 @@ * * Protocol-aware fine-grained relay server * - * The version of the OpenAPI document: 2025.3.2 + * The version of the OpenAPI document: 2026.2.4 * Contact: infos@devolutions.net * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Client/Configuration.cs b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Client/Configuration.cs index 8a1e61c53..29990bcfa 100644 --- a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Client/Configuration.cs +++ b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Client/Configuration.cs @@ -3,7 +3,7 @@ * * Protocol-aware fine-grained relay server * - * The version of the OpenAPI document: 2025.3.2 + * The version of the OpenAPI document: 2026.2.4 * Contact: infos@devolutions.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -540,7 +540,7 @@ public static string ToDebugReport() string report = "C# SDK (Devolutions.Gateway.Client) Debug Report:\n"; report += " OS: " + System.Environment.OSVersion + "\n"; report += " .NET Framework Version: " + System.Environment.Version + "\n"; - report += " Version of the API: 2025.3.2\n"; + report += " Version of the API: 2026.2.4\n"; report += " SDK Package Version: 2025.12.2\n"; return report; diff --git a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Client/ExceptionFactory.cs b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Client/ExceptionFactory.cs index a1bf2ea63..1e2698d5a 100644 --- a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Client/ExceptionFactory.cs +++ b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Client/ExceptionFactory.cs @@ -3,7 +3,7 @@ * * Protocol-aware fine-grained relay server * - * The version of the OpenAPI document: 2025.3.2 + * The version of the OpenAPI document: 2026.2.4 * Contact: infos@devolutions.net * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Client/FileParameter.cs b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Client/FileParameter.cs index 281f6945d..f557e590d 100644 --- a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Client/FileParameter.cs +++ b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Client/FileParameter.cs @@ -3,7 +3,7 @@ * * Protocol-aware fine-grained relay server * - * The version of the OpenAPI document: 2025.3.2 + * The version of the OpenAPI document: 2026.2.4 * Contact: infos@devolutions.net * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Client/GlobalConfiguration.cs b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Client/GlobalConfiguration.cs index 2e90e183e..06ba08891 100644 --- a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Client/GlobalConfiguration.cs +++ b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Client/GlobalConfiguration.cs @@ -3,7 +3,7 @@ * * Protocol-aware fine-grained relay server * - * The version of the OpenAPI document: 2025.3.2 + * The version of the OpenAPI document: 2026.2.4 * Contact: infos@devolutions.net * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Client/IApiAccessor.cs b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Client/IApiAccessor.cs index 55006b14e..de69db1b1 100644 --- a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Client/IApiAccessor.cs +++ b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Client/IApiAccessor.cs @@ -3,7 +3,7 @@ * * Protocol-aware fine-grained relay server * - * The version of the OpenAPI document: 2025.3.2 + * The version of the OpenAPI document: 2026.2.4 * Contact: infos@devolutions.net * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Client/IAsynchronousClient.cs b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Client/IAsynchronousClient.cs index 09a6cf32c..bd15e394b 100644 --- a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Client/IAsynchronousClient.cs +++ b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Client/IAsynchronousClient.cs @@ -3,7 +3,7 @@ * * Protocol-aware fine-grained relay server * - * The version of the OpenAPI document: 2025.3.2 + * The version of the OpenAPI document: 2026.2.4 * Contact: infos@devolutions.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -30,7 +30,7 @@ public interface IAsynchronousClient /// Cancellation Token to cancel the request. /// The return type. /// A task eventually representing the response data, decorated with - Task> GetAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + Task> GetAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default); /// /// Executes a non-blocking call to some using the POST http verb. @@ -41,7 +41,7 @@ public interface IAsynchronousClient /// Cancellation Token to cancel the request. /// The return type. /// A task eventually representing the response data, decorated with - Task> PostAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + Task> PostAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default); /// /// Executes a non-blocking call to some using the PUT http verb. @@ -52,7 +52,7 @@ public interface IAsynchronousClient /// Cancellation Token to cancel the request. /// The return type. /// A task eventually representing the response data, decorated with - Task> PutAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + Task> PutAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default); /// /// Executes a non-blocking call to some using the DELETE http verb. @@ -63,7 +63,7 @@ public interface IAsynchronousClient /// Cancellation Token to cancel the request. /// The return type. /// A task eventually representing the response data, decorated with - Task> DeleteAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + Task> DeleteAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default); /// /// Executes a non-blocking call to some using the HEAD http verb. @@ -74,7 +74,7 @@ public interface IAsynchronousClient /// Cancellation Token to cancel the request. /// The return type. /// A task eventually representing the response data, decorated with - Task> HeadAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + Task> HeadAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default); /// /// Executes a non-blocking call to some using the OPTIONS http verb. @@ -85,7 +85,7 @@ public interface IAsynchronousClient /// Cancellation Token to cancel the request. /// The return type. /// A task eventually representing the response data, decorated with - Task> OptionsAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + Task> OptionsAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default); /// /// Executes a non-blocking call to some using the PATCH http verb. @@ -96,6 +96,6 @@ public interface IAsynchronousClient /// Cancellation Token to cancel the request. /// The return type. /// A task eventually representing the response data, decorated with - Task> PatchAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + Task> PatchAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default); } } diff --git a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Client/IReadableConfiguration.cs b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Client/IReadableConfiguration.cs index 8b917ec9f..bc96f0a28 100644 --- a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Client/IReadableConfiguration.cs +++ b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Client/IReadableConfiguration.cs @@ -3,7 +3,7 @@ * * Protocol-aware fine-grained relay server * - * The version of the OpenAPI document: 2025.3.2 + * The version of the OpenAPI document: 2026.2.4 * Contact: infos@devolutions.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -72,10 +72,10 @@ public interface IReadableConfiguration string TempFolderPath { get; } /// - /// Gets the HTTP connection timeout (in milliseconds) + /// Gets the HTTP connection timeout. /// /// HTTP connection timeout. - int Timeout { get; } + TimeSpan Timeout { get; } /// /// Gets the proxy. diff --git a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Client/ISynchronousClient.cs b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Client/ISynchronousClient.cs index 1b5d4eec2..24fa46df0 100644 --- a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Client/ISynchronousClient.cs +++ b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Client/ISynchronousClient.cs @@ -3,7 +3,7 @@ * * Protocol-aware fine-grained relay server * - * The version of the OpenAPI document: 2025.3.2 + * The version of the OpenAPI document: 2026.2.4 * Contact: infos@devolutions.net * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Client/Multimap.cs b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Client/Multimap.cs index 75f5900c5..6c6c6dd47 100644 --- a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Client/Multimap.cs +++ b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Client/Multimap.cs @@ -3,7 +3,7 @@ * * Protocol-aware fine-grained relay server * - * The version of the OpenAPI document: 2025.3.2 + * The version of the OpenAPI document: 2026.2.4 * Contact: infos@devolutions.net * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Client/OpenAPIDateConverter.cs b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Client/OpenAPIDateConverter.cs index 51d33afb5..a2c6d86ca 100644 --- a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Client/OpenAPIDateConverter.cs +++ b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Client/OpenAPIDateConverter.cs @@ -3,7 +3,7 @@ * * Protocol-aware fine-grained relay server * - * The version of the OpenAPI document: 2025.3.2 + * The version of the OpenAPI document: 2026.2.4 * Contact: infos@devolutions.net * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Client/RequestOptions.cs b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Client/RequestOptions.cs index c3311adf2..3d250a880 100644 --- a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Client/RequestOptions.cs +++ b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Client/RequestOptions.cs @@ -3,7 +3,7 @@ * * Protocol-aware fine-grained relay server * - * The version of the OpenAPI document: 2025.3.2 + * The version of the OpenAPI document: 2026.2.4 * Contact: infos@devolutions.net * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Client/RetryConfiguration.cs b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Client/RetryConfiguration.cs index ee5537544..788ea50c0 100644 --- a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Client/RetryConfiguration.cs +++ b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Client/RetryConfiguration.cs @@ -3,7 +3,7 @@ * * Protocol-aware fine-grained relay server * - * The version of the OpenAPI document: 2025.3.2 + * The version of the OpenAPI document: 2026.2.4 * Contact: infos@devolutions.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -22,11 +22,11 @@ public static class RetryConfiguration /// /// Retry policy /// - public static Policy RetryPolicy { get; set; } + public static ISyncPolicy RetryPolicy { get; set; } /// /// Async retry policy /// - public static AsyncPolicy AsyncRetryPolicy { get; set; } + public static IAsyncPolicy AsyncRetryPolicy { get; set; } } } diff --git a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Client/WebRequestPathBuilder.cs b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Client/WebRequestPathBuilder.cs index acd6b7337..0246ad865 100644 --- a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Client/WebRequestPathBuilder.cs +++ b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Client/WebRequestPathBuilder.cs @@ -3,7 +3,7 @@ * * Protocol-aware fine-grained relay server * - * The version of the OpenAPI document: 2025.3.2 + * The version of the OpenAPI document: 2026.2.4 * Contact: infos@devolutions.net * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/AbstractOpenAPISchema.cs b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/AbstractOpenAPISchema.cs index cc66daaab..f704f6a04 100644 --- a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/AbstractOpenAPISchema.cs +++ b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/AbstractOpenAPISchema.cs @@ -3,7 +3,7 @@ * * Protocol-aware fine-grained relay server * - * The version of the OpenAPI document: 2025.3.2 + * The version of the OpenAPI document: 2026.2.4 * Contact: infos@devolutions.net * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/AccessScope.cs b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/AccessScope.cs index 700fea365..98c7ac937 100644 --- a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/AccessScope.cs +++ b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/AccessScope.cs @@ -3,7 +3,7 @@ * * Protocol-aware fine-grained relay server * - * The version of the OpenAPI document: 2025.3.2 + * The version of the OpenAPI document: 2026.2.4 * Contact: infos@devolutions.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -99,35 +99,53 @@ public enum AccessScope [EnumMember(Value = "gateway.update")] GatewayUpdate = 11, + /// + /// Enum GatewayUpdateRead for value: gateway.update.read + /// + [EnumMember(Value = "gateway.update.read")] + GatewayUpdateRead = 12, + /// /// Enum GatewayPreflight for value: gateway.preflight /// [EnumMember(Value = "gateway.preflight")] - GatewayPreflight = 12, + GatewayPreflight = 13, /// /// Enum GatewayTrafficClaim for value: gateway.traffic.claim /// [EnumMember(Value = "gateway.traffic.claim")] - GatewayTrafficClaim = 13, + GatewayTrafficClaim = 14, /// /// Enum GatewayTrafficAck for value: gateway.traffic.ack /// [EnumMember(Value = "gateway.traffic.ack")] - GatewayTrafficAck = 14, + GatewayTrafficAck = 15, /// /// Enum GatewayNetMonitorConfig for value: gateway.net.monitor.config /// [EnumMember(Value = "gateway.net.monitor.config")] - GatewayNetMonitorConfig = 15, + GatewayNetMonitorConfig = 16, /// /// Enum GatewayNetMonitorDrain for value: gateway.net.monitor.drain /// [EnumMember(Value = "gateway.net.monitor.drain")] - GatewayNetMonitorDrain = 16 + GatewayNetMonitorDrain = 17, + + /// + /// Enum GatewayAgentDelete for value: gateway.agent.delete + /// + [EnumMember(Value = "gateway.agent.delete")] + GatewayAgentDelete = 18, + + /// + /// Enum GatewayAgentRead for value: gateway.agent.read + /// + [EnumMember(Value = "gateway.agent.read")] + GatewayAgentRead = 19 } public static class AccessScopeExtensions @@ -161,6 +179,8 @@ public static string ToValue(this AccessScope variant) return "gateway.recordings.read"; case AccessScope.GatewayUpdate: return "gateway.update"; + case AccessScope.GatewayUpdateRead: + return "gateway.update.read"; case AccessScope.GatewayPreflight: return "gateway.preflight"; case AccessScope.GatewayTrafficClaim: @@ -171,6 +191,10 @@ public static string ToValue(this AccessScope variant) return "gateway.net.monitor.config"; case AccessScope.GatewayNetMonitorDrain: return "gateway.net.monitor.drain"; + case AccessScope.GatewayAgentDelete: + return "gateway.agent.delete"; + case AccessScope.GatewayAgentRead: + return "gateway.agent.read"; default: throw new ArgumentOutOfRangeException(nameof(variant), $"Unexpected variant: {variant}"); } diff --git a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/AckRequest.cs b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/AckRequest.cs index 9aeb82538..12511c20c 100644 --- a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/AckRequest.cs +++ b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/AckRequest.cs @@ -3,7 +3,7 @@ * * Protocol-aware fine-grained relay server * - * The version of the OpenAPI document: 2025.3.2 + * The version of the OpenAPI document: 2026.2.4 * Contact: infos@devolutions.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -42,7 +42,7 @@ protected AckRequest() { } /// Initializes a new instance of the class. /// /// Array of event IDs to acknowledge (1-10000 items, ULID format) (required). - public AckRequest(List ids = default(List)) + public AckRequest(List ids = default) { // to ensure "ids" is required (not null) if (ids == null) diff --git a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/AckResponse.cs b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/AckResponse.cs index c061175b4..8c3ddb44e 100644 --- a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/AckResponse.cs +++ b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/AckResponse.cs @@ -3,7 +3,7 @@ * * Protocol-aware fine-grained relay server * - * The version of the OpenAPI document: 2025.3.2 + * The version of the OpenAPI document: 2026.2.4 * Contact: infos@devolutions.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -42,7 +42,7 @@ protected AckResponse() { } /// Initializes a new instance of the class. /// /// Number of events that were acknowledged and deleted (required). - public AckResponse(long deletedCount = default(long)) + public AckResponse(long deletedCount = default) { this.DeletedCount = deletedCount; } diff --git a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/AddressFamily.cs b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/AddressFamily.cs index 3e40c5716..d288af632 100644 --- a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/AddressFamily.cs +++ b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/AddressFamily.cs @@ -3,7 +3,7 @@ * * Protocol-aware fine-grained relay server * - * The version of the OpenAPI document: 2025.3.2 + * The version of the OpenAPI document: 2026.2.4 * Contact: infos@devolutions.net * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/AppCredential.cs b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/AppCredential.cs index 0def8adc9..7e312acab 100644 --- a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/AppCredential.cs +++ b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/AppCredential.cs @@ -3,7 +3,7 @@ * * Protocol-aware fine-grained relay server * - * The version of the OpenAPI document: 2025.3.2 + * The version of the OpenAPI document: 2026.2.4 * Contact: infos@devolutions.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -50,7 +50,7 @@ protected AppCredential() { } /// kind (required). /// Password for the credential. Required for \"username-password\" kind.. /// Username for the credential. Required for \"username-password\" kind.. - public AppCredential(AppCredentialKind kind = default(AppCredentialKind), string password = default(string), string username = default(string)) + public AppCredential(AppCredentialKind kind = default, string password = default, string username = default) { this.Kind = kind; this.Password = password; diff --git a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/AppCredentialKind.cs b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/AppCredentialKind.cs index 8d7c4dab6..c6bf83bbf 100644 --- a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/AppCredentialKind.cs +++ b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/AppCredentialKind.cs @@ -3,7 +3,7 @@ * * Protocol-aware fine-grained relay server * - * The version of the OpenAPI document: 2025.3.2 + * The version of the OpenAPI document: 2026.2.4 * Contact: infos@devolutions.net * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/AppTokenContentType.cs b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/AppTokenContentType.cs index 24ac9b6ae..50fcc4962 100644 --- a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/AppTokenContentType.cs +++ b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/AppTokenContentType.cs @@ -3,7 +3,7 @@ * * Protocol-aware fine-grained relay server * - * The version of the OpenAPI document: 2025.3.2 + * The version of the OpenAPI document: 2026.2.4 * Contact: infos@devolutions.net * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/AppTokenSignRequest.cs b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/AppTokenSignRequest.cs index 768c0e2cb..465bcb456 100644 --- a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/AppTokenSignRequest.cs +++ b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/AppTokenSignRequest.cs @@ -3,7 +3,7 @@ * * Protocol-aware fine-grained relay server * - * The version of the OpenAPI document: 2025.3.2 + * The version of the OpenAPI document: 2026.2.4 * Contact: infos@devolutions.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -50,7 +50,7 @@ protected AppTokenSignRequest() { } /// contentType (required). /// The validity duration in seconds for the app token. This value cannot exceed the configured maximum lifetime. If no value is provided, the configured maximum lifetime will be granted.. /// The username used to request the app token. (required). - public AppTokenSignRequest(AppTokenContentType contentType = default(AppTokenContentType), long? lifetime = default(long?), string subject = default(string)) + public AppTokenSignRequest(AppTokenContentType contentType = default, long? lifetime = default, string subject = default) { this.ContentType = contentType; // to ensure "subject" is required (not null) diff --git a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/ClaimedTrafficEvent.cs b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/ClaimedTrafficEvent.cs index b8572a9fd..0ab8b5428 100644 --- a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/ClaimedTrafficEvent.cs +++ b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/ClaimedTrafficEvent.cs @@ -3,7 +3,7 @@ * * Protocol-aware fine-grained relay server * - * The version of the OpenAPI document: 2025.3.2 + * The version of the OpenAPI document: 2026.2.4 * Contact: infos@devolutions.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -65,7 +65,7 @@ protected ClaimedTrafficEvent() { } /// Concrete target IP address after resolution (required). /// Target port number for the connection (required). /// Database ID of the claimed event (used for acknowledgment, ULID format) (required). - public ClaimedTrafficEvent(long activeDurationMs = default(long), long bytesRx = default(long), long bytesTx = default(long), long connectAtMs = default(long), long disconnectAtMs = default(long), EventOutcomeResponse outcome = default(EventOutcomeResponse), TransportProtocolResponse protocol = default(TransportProtocolResponse), Guid sessionId = default(Guid), string targetHost = default(string), string targetIp = default(string), int targetPort = default(int), string id = default(string)) + public ClaimedTrafficEvent(long activeDurationMs = default, long bytesRx = default, long bytesTx = default, long connectAtMs = default, long disconnectAtMs = default, EventOutcomeResponse outcome = default, TransportProtocolResponse protocol = default, Guid sessionId = default, string targetHost = default, string targetIp = default, int targetPort = default, string id = default) { this.ActiveDurationMs = activeDurationMs; this.BytesRx = bytesRx; diff --git a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/ClockDiagnostic.cs b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/ClockDiagnostic.cs index 0cbe1c572..aac39db87 100644 --- a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/ClockDiagnostic.cs +++ b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/ClockDiagnostic.cs @@ -3,7 +3,7 @@ * * Protocol-aware fine-grained relay server * - * The version of the OpenAPI document: 2025.3.2 + * The version of the OpenAPI document: 2026.2.4 * Contact: infos@devolutions.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -43,7 +43,7 @@ protected ClockDiagnostic() { } /// /// Current time in milliseconds (required). /// Current time in seconds (required). - public ClockDiagnostic(long timestampMillis = default(long), long timestampSecs = default(long)) + public ClockDiagnostic(long timestampMillis = default, long timestampSecs = default) { this.TimestampMillis = timestampMillis; this.TimestampSecs = timestampSecs; diff --git a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/ConfigDiagnostic.cs b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/ConfigDiagnostic.cs index ffd26e8cb..718211b7e 100644 --- a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/ConfigDiagnostic.cs +++ b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/ConfigDiagnostic.cs @@ -3,7 +3,7 @@ * * Protocol-aware fine-grained relay server * - * The version of the OpenAPI document: 2025.3.2 + * The version of the OpenAPI document: 2026.2.4 * Contact: infos@devolutions.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -45,7 +45,7 @@ protected ConfigDiagnostic() { } /// This Gateway's unique ID. /// Listeners configured on this instance (required). /// Gateway service version (required). - public ConfigDiagnostic(string hostname = default(string), Guid? id = default(Guid?), List listeners = default(List), string varVersion = default(string)) + public ConfigDiagnostic(string hostname = default, Guid? id = default, List listeners = default, string varVersion = default) { // to ensure "hostname" is required (not null) if (hostname == null) diff --git a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/ConfigPatch.cs b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/ConfigPatch.cs index 78e0b848e..bcd54f115 100644 --- a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/ConfigPatch.cs +++ b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/ConfigPatch.cs @@ -3,7 +3,7 @@ * * Protocol-aware fine-grained relay server * - * The version of the OpenAPI document: 2025.3.2 + * The version of the OpenAPI document: 2026.2.4 * Contact: infos@devolutions.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -39,7 +39,7 @@ public partial class ConfigPatch : IValidatableObject /// This Gateway's unique ID. /// subProvisionerPublicKey. /// subscriber. - public ConfigPatch(Guid? id = default(Guid?), SubProvisionerKey subProvisionerPublicKey = default(SubProvisionerKey), Subscriber subscriber = default(Subscriber)) + public ConfigPatch(Guid? id = default, SubProvisionerKey subProvisionerPublicKey = default, Subscriber subscriber = default) { this.Id = id; this.SubProvisionerPublicKey = subProvisionerPublicKey; diff --git a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/ConnectionMode.cs b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/ConnectionMode.cs index 48afa473c..1b02f8383 100644 --- a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/ConnectionMode.cs +++ b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/ConnectionMode.cs @@ -3,7 +3,7 @@ * * Protocol-aware fine-grained relay server * - * The version of the OpenAPI document: 2025.3.2 + * The version of the OpenAPI document: 2026.2.4 * Contact: infos@devolutions.net * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/DataEncoding.cs b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/DataEncoding.cs index fd94ffdc5..43551f3c4 100644 --- a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/DataEncoding.cs +++ b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/DataEncoding.cs @@ -3,7 +3,7 @@ * * Protocol-aware fine-grained relay server * - * The version of the OpenAPI document: 2025.3.2 + * The version of the OpenAPI document: 2026.2.4 * Contact: infos@devolutions.net * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/DeleteManyResult.cs b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/DeleteManyResult.cs index b03a73230..2c63501bc 100644 --- a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/DeleteManyResult.cs +++ b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/DeleteManyResult.cs @@ -3,7 +3,7 @@ * * Protocol-aware fine-grained relay server * - * The version of the OpenAPI document: 2025.3.2 + * The version of the OpenAPI document: 2026.2.4 * Contact: infos@devolutions.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -43,7 +43,7 @@ protected DeleteManyResult() { } /// /// Number of recordings found (required). /// Number of recordings not found (required). - public DeleteManyResult(int foundCount = default(int), int notFoundCount = default(int)) + public DeleteManyResult(int foundCount = default, int notFoundCount = default) { this.FoundCount = foundCount; this.NotFoundCount = notFoundCount; diff --git a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/EventOutcomeResponse.cs b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/EventOutcomeResponse.cs index b72752912..25dd7a7c9 100644 --- a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/EventOutcomeResponse.cs +++ b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/EventOutcomeResponse.cs @@ -3,7 +3,7 @@ * * Protocol-aware fine-grained relay server * - * The version of the OpenAPI document: 2025.3.2 + * The version of the OpenAPI document: 2026.2.4 * Contact: infos@devolutions.net * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/GetUpdateProductsResponse.cs b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/GetUpdateProductsResponse.cs new file mode 100644 index 000000000..3c8b97814 --- /dev/null +++ b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/GetUpdateProductsResponse.cs @@ -0,0 +1,105 @@ +/* + * devolutions-gateway + * + * Protocol-aware fine-grained relay server + * + * The version of the OpenAPI document: 2026.2.4 + * Contact: infos@devolutions.net + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using FileParameter = Devolutions.Gateway.Client.Client.FileParameter; +using OpenAPIDateConverter = Devolutions.Gateway.Client.Client.OpenAPIDateConverter; + +namespace Devolutions.Gateway.Client.Model +{ + /// + /// Installed version of each product, as reported by Devolutions Agent. + /// + [DataContract(Name = "GetUpdateProductsResponse")] + public partial class GetUpdateProductsResponse : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected GetUpdateProductsResponse() { } + /// + /// Initializes a new instance of the class. + /// + /// Version of the `update_status.json` format in `\"major.minor\"` form (e.g. `\"1.1\"`). (required). + /// Map of product name to API-specific product info.. + public GetUpdateProductsResponse(string manifestVersion = default, Dictionary products = default) + { + // to ensure "manifestVersion" is required (not null) + if (manifestVersion == null) + { + throw new ArgumentNullException("manifestVersion is a required property for GetUpdateProductsResponse and cannot be null"); + } + this.ManifestVersion = manifestVersion; + this.Products = products; + } + + /// + /// Version of the `update_status.json` format in `\"major.minor\"` form (e.g. `\"1.1\"`). + /// + /// Version of the `update_status.json` format in `\"major.minor\"` form (e.g. `\"1.1\"`). + [DataMember(Name = "ManifestVersion", IsRequired = true, EmitDefaultValue = true)] + public string ManifestVersion { get; set; } + + /// + /// Map of product name to API-specific product info. + /// + /// Map of product name to API-specific product info. + [DataMember(Name = "Products", EmitDefaultValue = false)] + public Dictionary Products { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class GetUpdateProductsResponse {\n"); + sb.Append(" ManifestVersion: ").Append(ManifestVersion).Append("\n"); + sb.Append(" Products: ").Append(Products).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/GetUpdateScheduleResponse.cs b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/GetUpdateScheduleResponse.cs new file mode 100644 index 000000000..c37bab87c --- /dev/null +++ b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/GetUpdateScheduleResponse.cs @@ -0,0 +1,163 @@ +/* + * devolutions-gateway + * + * Protocol-aware fine-grained relay server + * + * The version of the OpenAPI document: 2026.2.4 + * Contact: infos@devolutions.net + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using FileParameter = Devolutions.Gateway.Client.Client.FileParameter; +using OpenAPIDateConverter = Devolutions.Gateway.Client.Client.OpenAPIDateConverter; + +namespace Devolutions.Gateway.Client.Model +{ + /// + /// Current auto-update schedule for Devolutions Agent. + /// + [DataContract(Name = "GetUpdateScheduleResponse")] + public partial class GetUpdateScheduleResponse : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected GetUpdateScheduleResponse() { } + /// + /// Initializes a new instance of the class. + /// + /// Enable periodic Devolutions Agent self-update checks. (required). + /// Minimum interval between auto-update checks, in seconds. `0` means check once at `UpdateWindowStart`. (required). + /// Version of the `update_status.json` format in `\"major.minor\"` form (e.g. `\"1.1\"`). (required). + /// Products the agent autonomously polls for new versions.. + /// End of the maintenance window as seconds past midnight (local time, exclusive). `None` means no upper bound (single check at `UpdateWindowStart`).. + /// Start of the maintenance window as seconds past midnight (local time). (required). + public GetUpdateScheduleResponse(bool enabled = default, long interval = default, string manifestVersion = default, List products = default, int? updateWindowEnd = default, int updateWindowStart = default) + { + this.Enabled = enabled; + this.Interval = interval; + // to ensure "manifestVersion" is required (not null) + if (manifestVersion == null) + { + throw new ArgumentNullException("manifestVersion is a required property for GetUpdateScheduleResponse and cannot be null"); + } + this.ManifestVersion = manifestVersion; + this.UpdateWindowStart = updateWindowStart; + this.Products = products; + this.UpdateWindowEnd = updateWindowEnd; + } + + /// + /// Enable periodic Devolutions Agent self-update checks. + /// + /// Enable periodic Devolutions Agent self-update checks. + [DataMember(Name = "Enabled", IsRequired = true, EmitDefaultValue = true)] + public bool Enabled { get; set; } + + /// + /// Minimum interval between auto-update checks, in seconds. `0` means check once at `UpdateWindowStart`. + /// + /// Minimum interval between auto-update checks, in seconds. `0` means check once at `UpdateWindowStart`. + [DataMember(Name = "Interval", IsRequired = true, EmitDefaultValue = true)] + public long Interval { get; set; } + + /// + /// Version of the `update_status.json` format in `\"major.minor\"` form (e.g. `\"1.1\"`). + /// + /// Version of the `update_status.json` format in `\"major.minor\"` form (e.g. `\"1.1\"`). + [DataMember(Name = "ManifestVersion", IsRequired = true, EmitDefaultValue = true)] + public string ManifestVersion { get; set; } + + /// + /// Products the agent autonomously polls for new versions. + /// + /// Products the agent autonomously polls for new versions. + [DataMember(Name = "Products", EmitDefaultValue = false)] + public List Products { get; set; } + + /// + /// End of the maintenance window as seconds past midnight (local time, exclusive). `None` means no upper bound (single check at `UpdateWindowStart`). + /// + /// End of the maintenance window as seconds past midnight (local time, exclusive). `None` means no upper bound (single check at `UpdateWindowStart`). + [DataMember(Name = "UpdateWindowEnd", EmitDefaultValue = true)] + public int? UpdateWindowEnd { get; set; } + + /// + /// Start of the maintenance window as seconds past midnight (local time). + /// + /// Start of the maintenance window as seconds past midnight (local time). + [DataMember(Name = "UpdateWindowStart", IsRequired = true, EmitDefaultValue = true)] + public int UpdateWindowStart { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class GetUpdateScheduleResponse {\n"); + sb.Append(" Enabled: ").Append(Enabled).Append("\n"); + sb.Append(" Interval: ").Append(Interval).Append("\n"); + sb.Append(" ManifestVersion: ").Append(ManifestVersion).Append("\n"); + sb.Append(" Products: ").Append(Products).Append("\n"); + sb.Append(" UpdateWindowEnd: ").Append(UpdateWindowEnd).Append("\n"); + sb.Append(" UpdateWindowStart: ").Append(UpdateWindowStart).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + // Interval (long) minimum + if (this.Interval < (long)0) + { + yield return new ValidationResult("Invalid value for Interval, must be a value greater than or equal to 0.", new [] { "Interval" }); + } + + // UpdateWindowEnd (int?) minimum + if (this.UpdateWindowEnd < (int?)0) + { + yield return new ValidationResult("Invalid value for UpdateWindowEnd, must be a value greater than or equal to 0.", new [] { "UpdateWindowEnd" }); + } + + // UpdateWindowStart (int) minimum + if (this.UpdateWindowStart < (int)0) + { + yield return new ValidationResult("Invalid value for UpdateWindowStart, must be a value greater than or equal to 0.", new [] { "UpdateWindowStart" }); + } + + yield break; + } + } + +} diff --git a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/Heartbeat.cs b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/Heartbeat.cs index 3cee0d048..70f3803b9 100644 --- a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/Heartbeat.cs +++ b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/Heartbeat.cs @@ -3,7 +3,7 @@ * * Protocol-aware fine-grained relay server * - * The version of the OpenAPI document: 2025.3.2 + * The version of the OpenAPI document: 2026.2.4 * Contact: infos@devolutions.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -49,7 +49,7 @@ protected Heartbeat() { } /// The total space of the disk used to store recordings, in bytes. Since v2024.1.6.. /// Number of running sessions. (required). /// Gateway service version. (required). - public Heartbeat(string agentVersion = default(string), string hostname = default(string), Guid? id = default(Guid?), long? recordingStorageAvailableSpace = default(long?), bool? recordingStorageIsWriteable = default(bool?), long? recordingStorageTotalSpace = default(long?), int runningSessionCount = default(int), string varVersion = default(string)) + public Heartbeat(string agentVersion = default, string hostname = default, Guid? id = default, long? recordingStorageAvailableSpace = default, bool? recordingStorageIsWriteable = default, long? recordingStorageTotalSpace = default, int runningSessionCount = default, string varVersion = default) { // to ensure "hostname" is required (not null) if (hostname == null) diff --git a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/HostScanStateDto.cs b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/HostScanStateDto.cs new file mode 100644 index 000000000..a8773544a --- /dev/null +++ b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/HostScanStateDto.cs @@ -0,0 +1,84 @@ +/* + * devolutions-gateway + * + * Protocol-aware fine-grained relay server + * + * The version of the OpenAPI document: 2026.2.4 + * Contact: infos@devolutions.net + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using FileParameter = Devolutions.Gateway.Client.Client.FileParameter; +using OpenAPIDateConverter = Devolutions.Gateway.Client.Client.OpenAPIDateConverter; + +namespace Devolutions.Gateway.Client.Model +{ + /// + /// Defines HostScanStateDto + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum HostScanStateDto + { + /// + /// Enum Queued for value: queued + /// + [EnumMember(Value = "queued")] + Queued = 1, + + /// + /// Enum Probing for value: probing + /// + [EnumMember(Value = "probing")] + Probing = 2, + + /// + /// Enum Reachable for value: reachable + /// + [EnumMember(Value = "reachable")] + Reachable = 3, + + /// + /// Enum Unreachable for value: unreachable + /// + [EnumMember(Value = "unreachable")] + Unreachable = 4 + } + + public static class HostScanStateDtoExtensions + { + /// + /// Returns the value as string for a given variant + /// + public static string ToValue(this HostScanStateDto variant) + { + switch (variant) + { + case HostScanStateDto.Queued: + return "queued"; + case HostScanStateDto.Probing: + return "probing"; + case HostScanStateDto.Reachable: + return "reachable"; + case HostScanStateDto.Unreachable: + return "unreachable"; + default: + throw new ArgumentOutOfRangeException(nameof(variant), $"Unexpected variant: {variant}"); + } + } + } + +} diff --git a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/Identity.cs b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/Identity.cs index 69740ca33..3ad970405 100644 --- a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/Identity.cs +++ b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/Identity.cs @@ -3,7 +3,7 @@ * * Protocol-aware fine-grained relay server * - * The version of the OpenAPI document: 2025.3.2 + * The version of the OpenAPI document: 2026.2.4 * Contact: infos@devolutions.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -44,7 +44,7 @@ protected Identity() { } /// This Gateway's hostname (required). /// This Gateway's unique ID. /// Gateway service version. - public Identity(string hostname = default(string), Guid? id = default(Guid?), string varVersion = default(string)) + public Identity(string hostname = default, Guid? id = default, string varVersion = default) { // to ensure "hostname" is required (not null) if (hostname == null) diff --git a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/InterfaceInfo.cs b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/InterfaceInfo.cs index c24d33afb..94118d65c 100644 --- a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/InterfaceInfo.cs +++ b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/InterfaceInfo.cs @@ -3,7 +3,7 @@ * * Protocol-aware fine-grained relay server * - * The version of the OpenAPI document: 2025.3.2 + * The version of the OpenAPI document: 2026.2.4 * Contact: infos@devolutions.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -52,7 +52,7 @@ protected InterfaceInfo() { } /// family (required). /// mac. /// netmask. - public InterfaceInfo(string address = default(string), string broadcast = default(string), AddressFamily family = default(AddressFamily), string mac = default(string), string netmask = default(string)) + public InterfaceInfo(string address = default, string broadcast = default, AddressFamily family = default, string mac = default, string netmask = default) { // to ensure "address" is required (not null) if (address == null) diff --git a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/JrlInfo.cs b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/JrlInfo.cs index a4acf996f..3ddb60602 100644 --- a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/JrlInfo.cs +++ b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/JrlInfo.cs @@ -3,7 +3,7 @@ * * Protocol-aware fine-grained relay server * - * The version of the OpenAPI document: 2025.3.2 + * The version of the OpenAPI document: 2026.2.4 * Contact: infos@devolutions.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -43,7 +43,7 @@ protected JrlInfo() { } /// /// JWT \"Issued At\" claim of JRL (required). /// Unique ID for current JRL (required). - public JrlInfo(long iat = default(long), Guid jti = default(Guid)) + public JrlInfo(long iat = default, Guid jti = default) { this.Iat = iat; this.Jti = jti; diff --git a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/ListenerUrls.cs b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/ListenerUrls.cs index 1823d9300..98e9e5501 100644 --- a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/ListenerUrls.cs +++ b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/ListenerUrls.cs @@ -3,7 +3,7 @@ * * Protocol-aware fine-grained relay server * - * The version of the OpenAPI document: 2025.3.2 + * The version of the OpenAPI document: 2026.2.4 * Contact: infos@devolutions.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -43,7 +43,7 @@ protected ListenerUrls() { } /// /// URL to use from external networks (required). /// URL to use on local network (required). - public ListenerUrls(string externalUrl = default(string), string internalUrl = default(string)) + public ListenerUrls(string externalUrl = default, string internalUrl = default) { // to ensure "externalUrl" is required (not null) if (externalUrl == null) diff --git a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/MonitorDefinition.cs b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/MonitorDefinition.cs index c763d1bf4..b22c9fd97 100644 --- a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/MonitorDefinition.cs +++ b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/MonitorDefinition.cs @@ -3,7 +3,7 @@ * * Protocol-aware fine-grained relay server * - * The version of the OpenAPI document: 2025.3.2 + * The version of the OpenAPI document: 2026.2.4 * Contact: infos@devolutions.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -47,7 +47,7 @@ protected MonitorDefinition() { } /// port. /// probe (required). /// timeout (required). - public MonitorDefinition(string address = default(string), string id = default(string), long interval = default(long), int? port = default(int?), MonitoringProbeType probe = default(MonitoringProbeType), long timeout = default(long)) + public MonitorDefinition(string address = default, string id = default, long interval = default, int? port = default, MonitoringProbeType probe = default, long timeout = default) { // to ensure "address" is required (not null) if (address == null) diff --git a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/MonitorDefinitionProbeTypeError.cs b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/MonitorDefinitionProbeTypeError.cs index f11b7c806..d6f3bb49e 100644 --- a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/MonitorDefinitionProbeTypeError.cs +++ b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/MonitorDefinitionProbeTypeError.cs @@ -3,7 +3,7 @@ * * Protocol-aware fine-grained relay server * - * The version of the OpenAPI document: 2025.3.2 + * The version of the OpenAPI document: 2026.2.4 * Contact: infos@devolutions.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -43,7 +43,7 @@ protected MonitorDefinitionProbeTypeError() { } /// /// The ID of the monitor definition in the client-provided config (required). /// The monitor type that was not supported (required). - public MonitorDefinitionProbeTypeError(string id = default(string), string probe = default(string)) + public MonitorDefinitionProbeTypeError(string id = default, string probe = default) { // to ensure "id" is required (not null) if (id == null) diff --git a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/MonitorResult.cs b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/MonitorResult.cs index ad308e4af..04a2ac4e9 100644 --- a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/MonitorResult.cs +++ b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/MonitorResult.cs @@ -3,7 +3,7 @@ * * Protocol-aware fine-grained relay server * - * The version of the OpenAPI document: 2025.3.2 + * The version of the OpenAPI document: 2026.2.4 * Contact: infos@devolutions.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -46,7 +46,7 @@ protected MonitorResult() { } /// responseMessage. /// responseSuccess (required). /// Duration it took for the response to be received, in seconds. On error, this value is set to f64::INFINITY. (required). - public MonitorResult(string monitorId = default(string), DateTime requestStartTime = default(DateTime), string responseMessage = default(string), bool responseSuccess = default(bool), double responseTime = default(double)) + public MonitorResult(string monitorId = default, DateTime requestStartTime = default, string responseMessage = default, bool responseSuccess = default, double responseTime = default) { // to ensure "monitorId" is required (not null) if (monitorId == null) diff --git a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/MonitoringLogResponse.cs b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/MonitoringLogResponse.cs index 6a4fd51f9..2451450c9 100644 --- a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/MonitoringLogResponse.cs +++ b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/MonitoringLogResponse.cs @@ -3,7 +3,7 @@ * * Protocol-aware fine-grained relay server * - * The version of the OpenAPI document: 2025.3.2 + * The version of the OpenAPI document: 2026.2.4 * Contact: infos@devolutions.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -42,7 +42,7 @@ protected MonitoringLogResponse() { } /// Initializes a new instance of the class. /// /// entries (required). - public MonitoringLogResponse(List entries = default(List)) + public MonitoringLogResponse(List entries = default) { // to ensure "entries" is required (not null) if (entries == null) diff --git a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/MonitoringProbeType.cs b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/MonitoringProbeType.cs index eea997e69..d5940114c 100644 --- a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/MonitoringProbeType.cs +++ b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/MonitoringProbeType.cs @@ -3,7 +3,7 @@ * * Protocol-aware fine-grained relay server * - * The version of the OpenAPI document: 2025.3.2 + * The version of the OpenAPI document: 2026.2.4 * Contact: infos@devolutions.net * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/MonitoringProbeTypeOneOf.cs b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/MonitoringProbeTypeOneOf.cs index ec1b3110c..2022d7fde 100644 --- a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/MonitoringProbeTypeOneOf.cs +++ b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/MonitoringProbeTypeOneOf.cs @@ -3,7 +3,7 @@ * * Protocol-aware fine-grained relay server * - * The version of the OpenAPI document: 2025.3.2 + * The version of the OpenAPI document: 2026.2.4 * Contact: infos@devolutions.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -42,7 +42,7 @@ protected MonitoringProbeTypeOneOf() { } /// Initializes a new instance of the class. /// /// unknown (required). - public MonitoringProbeTypeOneOf(string unknown = default(string)) + public MonitoringProbeTypeOneOf(string unknown = default) { // to ensure "unknown" is required (not null) if (unknown == null) diff --git a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/MonitorsConfig.cs b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/MonitorsConfig.cs index 11d43526b..45cde3395 100644 --- a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/MonitorsConfig.cs +++ b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/MonitorsConfig.cs @@ -3,7 +3,7 @@ * * Protocol-aware fine-grained relay server * - * The version of the OpenAPI document: 2025.3.2 + * The version of the OpenAPI document: 2026.2.4 * Contact: infos@devolutions.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -42,7 +42,7 @@ protected MonitorsConfig() { } /// Initializes a new instance of the class. /// /// monitors (required). - public MonitorsConfig(List monitors = default(List)) + public MonitorsConfig(List monitors = default) { // to ensure "monitors" is required (not null) if (monitors == null) diff --git a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/NetworkInterfaceDto.cs b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/NetworkInterfaceDto.cs new file mode 100644 index 000000000..ab3cb0370 --- /dev/null +++ b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/NetworkInterfaceDto.cs @@ -0,0 +1,192 @@ +/* + * devolutions-gateway + * + * Protocol-aware fine-grained relay server + * + * The version of the OpenAPI document: 2026.2.4 + * Contact: infos@devolutions.net + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using FileParameter = Devolutions.Gateway.Client.Client.FileParameter; +using OpenAPIDateConverter = Devolutions.Gateway.Client.Client.OpenAPIDateConverter; + +namespace Devolutions.Gateway.Client.Model +{ + /// + /// NetworkInterfaceDto + /// + [DataContract(Name = "NetworkInterfaceDto")] + public partial class NetworkInterfaceDto : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected NetworkInterfaceDto() { } + /// + /// Initializes a new instance of the class. + /// + /// description. + /// id (required). + /// index. + /// isUp. + /// Coarse link type: `ethernet`, `wifi`, `loopback`, `virtual`, `unknown`.. + /// macAddress. + /// MTU in bytes when known.. + /// name (required). + /// Link speed in megabits per second when reported by the OS.. + public NetworkInterfaceDto(string description = default, string id = default, int? index = default, bool? isUp = default, string linkType = default, string macAddress = default, int? mtu = default, string name = default, long? speedMbps = default) + { + // to ensure "id" is required (not null) + if (id == null) + { + throw new ArgumentNullException("id is a required property for NetworkInterfaceDto and cannot be null"); + } + this.Id = id; + // to ensure "name" is required (not null) + if (name == null) + { + throw new ArgumentNullException("name is a required property for NetworkInterfaceDto and cannot be null"); + } + this.Name = name; + this.Description = description; + this.Index = index; + this.IsUp = isUp; + this.LinkType = linkType; + this.MacAddress = macAddress; + this.Mtu = mtu; + this.SpeedMbps = speedMbps; + } + + /// + /// Gets or Sets Description + /// + [DataMember(Name = "description", EmitDefaultValue = true)] + public string Description { get; set; } + + /// + /// Gets or Sets Id + /// + [DataMember(Name = "id", IsRequired = true, EmitDefaultValue = true)] + public string Id { get; set; } + + /// + /// Gets or Sets Index + /// + [DataMember(Name = "index", EmitDefaultValue = true)] + public int? Index { get; set; } + + /// + /// Gets or Sets IsUp + /// + [DataMember(Name = "isUp", EmitDefaultValue = true)] + public bool? IsUp { get; set; } + + /// + /// Coarse link type: `ethernet`, `wifi`, `loopback`, `virtual`, `unknown`. + /// + /// Coarse link type: `ethernet`, `wifi`, `loopback`, `virtual`, `unknown`. + [DataMember(Name = "linkType", EmitDefaultValue = true)] + public string LinkType { get; set; } + + /// + /// Gets or Sets MacAddress + /// + [DataMember(Name = "macAddress", EmitDefaultValue = true)] + public string MacAddress { get; set; } + + /// + /// MTU in bytes when known. + /// + /// MTU in bytes when known. + [DataMember(Name = "mtu", EmitDefaultValue = true)] + public int? Mtu { get; set; } + + /// + /// Gets or Sets Name + /// + [DataMember(Name = "name", IsRequired = true, EmitDefaultValue = true)] + public string Name { get; set; } + + /// + /// Link speed in megabits per second when reported by the OS. + /// + /// Link speed in megabits per second when reported by the OS. + [DataMember(Name = "speedMbps", EmitDefaultValue = true)] + public long? SpeedMbps { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class NetworkInterfaceDto {\n"); + sb.Append(" Description: ").Append(Description).Append("\n"); + sb.Append(" Id: ").Append(Id).Append("\n"); + sb.Append(" Index: ").Append(Index).Append("\n"); + sb.Append(" IsUp: ").Append(IsUp).Append("\n"); + sb.Append(" LinkType: ").Append(LinkType).Append("\n"); + sb.Append(" MacAddress: ").Append(MacAddress).Append("\n"); + sb.Append(" Mtu: ").Append(Mtu).Append("\n"); + sb.Append(" Name: ").Append(Name).Append("\n"); + sb.Append(" SpeedMbps: ").Append(SpeedMbps).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + // Index (int?) minimum + if (this.Index < (int?)0) + { + yield return new ValidationResult("Invalid value for Index, must be a value greater than or equal to 0.", new [] { "Index" }); + } + + // Mtu (int?) minimum + if (this.Mtu < (int?)0) + { + yield return new ValidationResult("Invalid value for Mtu, must be a value greater than or equal to 0.", new [] { "Mtu" }); + } + + // SpeedMbps (long?) minimum + if (this.SpeedMbps < (long?)0) + { + yield return new ValidationResult("Invalid value for SpeedMbps, must be a value greater than or equal to 0.", new [] { "SpeedMbps" }); + } + + yield break; + } + } + +} diff --git a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/NetworkInterfacesResponse.cs b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/NetworkInterfacesResponse.cs new file mode 100644 index 000000000..bac886efc --- /dev/null +++ b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/NetworkInterfacesResponse.cs @@ -0,0 +1,94 @@ +/* + * devolutions-gateway + * + * Protocol-aware fine-grained relay server + * + * The version of the OpenAPI document: 2026.2.4 + * Contact: infos@devolutions.net + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using FileParameter = Devolutions.Gateway.Client.Client.FileParameter; +using OpenAPIDateConverter = Devolutions.Gateway.Client.Client.OpenAPIDateConverter; + +namespace Devolutions.Gateway.Client.Model +{ + /// + /// NetworkInterfacesResponse + /// + [DataContract(Name = "NetworkInterfacesResponse")] + public partial class NetworkInterfacesResponse : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected NetworkInterfacesResponse() { } + /// + /// Initializes a new instance of the class. + /// + /// interfaces (required). + public NetworkInterfacesResponse(List interfaces = default) + { + // to ensure "interfaces" is required (not null) + if (interfaces == null) + { + throw new ArgumentNullException("interfaces is a required property for NetworkInterfacesResponse and cannot be null"); + } + this.Interfaces = interfaces; + } + + /// + /// Gets or Sets Interfaces + /// + [DataMember(Name = "interfaces", IsRequired = true, EmitDefaultValue = true)] + public List Interfaces { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class NetworkInterfacesResponse {\n"); + sb.Append(" Interfaces: ").Append(Interfaces).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/NetworkScanResultEventDto.cs b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/NetworkScanResultEventDto.cs new file mode 100644 index 000000000..908480894 --- /dev/null +++ b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/NetworkScanResultEventDto.cs @@ -0,0 +1,223 @@ +/* + * devolutions-gateway + * + * Protocol-aware fine-grained relay server + * + * The version of the OpenAPI document: 2026.2.4 + * Contact: infos@devolutions.net + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using FileParameter = Devolutions.Gateway.Client.Client.FileParameter; +using OpenAPIDateConverter = Devolutions.Gateway.Client.Client.OpenAPIDateConverter; + +namespace Devolutions.Gateway.Client.Model +{ + /// + /// NetworkScanResultEventDto + /// + [DataContract(Name = "NetworkScanResultEventDto")] + public partial class NetworkScanResultEventDto : IValidatableObject + { + + /// + /// Gets or Sets DiscoverySource + /// + [DataMember(Name = "discoverySource", IsRequired = true, EmitDefaultValue = true)] + public ScanResultSourceDto DiscoverySource { get; set; } + + /// + /// Gets or Sets HostScanState + /// + [DataMember(Name = "hostScanState", EmitDefaultValue = true)] + public HostScanStateDto? HostScanState { get; set; } + + /// + /// Gets or Sets Kind + /// + [DataMember(Name = "kind", IsRequired = true, EmitDefaultValue = true)] + public NetworkScanResultKindDto Kind { get; set; } + + /// + /// Gets or Sets Source + /// + [DataMember(Name = "source", IsRequired = true, EmitDefaultValue = true)] + public ScanOriginDto Source { get; set; } + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected NetworkScanResultEventDto() { } + /// + /// Initializes a new instance of the class. + /// + /// address (required). + /// discoverySource (required). + /// hostName. + /// hostScanState. + /// interfaceId. + /// interfaceName. + /// isReachable. + /// kind (required). + /// macAddress. + /// port. + /// responseTimeMs. + /// serviceLabel. + /// serviceType. + /// source (required). + public NetworkScanResultEventDto(string address = default, ScanResultSourceDto discoverySource = default, string hostName = default, HostScanStateDto? hostScanState = default, string interfaceId = default, string interfaceName = default, bool? isReachable = default, NetworkScanResultKindDto kind = default, string macAddress = default, int? port = default, int? responseTimeMs = default, string serviceLabel = default, string serviceType = default, ScanOriginDto source = default) + { + // to ensure "address" is required (not null) + if (address == null) + { + throw new ArgumentNullException("address is a required property for NetworkScanResultEventDto and cannot be null"); + } + this.Address = address; + this.DiscoverySource = discoverySource; + this.Kind = kind; + this.Source = source; + this.HostName = hostName; + this.HostScanState = hostScanState; + this.InterfaceId = interfaceId; + this.InterfaceName = interfaceName; + this.IsReachable = isReachable; + this.MacAddress = macAddress; + this.Port = port; + this.ResponseTimeMs = responseTimeMs; + this.ServiceLabel = serviceLabel; + this.ServiceType = serviceType; + } + + /// + /// Gets or Sets Address + /// + [DataMember(Name = "address", IsRequired = true, EmitDefaultValue = true)] + public string Address { get; set; } + + /// + /// Gets or Sets HostName + /// + [DataMember(Name = "hostName", EmitDefaultValue = true)] + public string HostName { get; set; } + + /// + /// Gets or Sets InterfaceId + /// + [DataMember(Name = "interfaceId", EmitDefaultValue = true)] + public string InterfaceId { get; set; } + + /// + /// Gets or Sets InterfaceName + /// + [DataMember(Name = "interfaceName", EmitDefaultValue = true)] + public string InterfaceName { get; set; } + + /// + /// Gets or Sets IsReachable + /// + [DataMember(Name = "isReachable", EmitDefaultValue = true)] + public bool? IsReachable { get; set; } + + /// + /// Gets or Sets MacAddress + /// + [DataMember(Name = "macAddress", EmitDefaultValue = true)] + public string MacAddress { get; set; } + + /// + /// Gets or Sets Port + /// + [DataMember(Name = "port", EmitDefaultValue = true)] + public int? Port { get; set; } + + /// + /// Gets or Sets ResponseTimeMs + /// + [DataMember(Name = "responseTimeMs", EmitDefaultValue = true)] + public int? ResponseTimeMs { get; set; } + + /// + /// Gets or Sets ServiceLabel + /// + [DataMember(Name = "serviceLabel", EmitDefaultValue = true)] + public string ServiceLabel { get; set; } + + /// + /// Gets or Sets ServiceType + /// + [DataMember(Name = "serviceType", EmitDefaultValue = true)] + public string ServiceType { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class NetworkScanResultEventDto {\n"); + sb.Append(" Address: ").Append(Address).Append("\n"); + sb.Append(" DiscoverySource: ").Append(DiscoverySource).Append("\n"); + sb.Append(" HostName: ").Append(HostName).Append("\n"); + sb.Append(" HostScanState: ").Append(HostScanState).Append("\n"); + sb.Append(" InterfaceId: ").Append(InterfaceId).Append("\n"); + sb.Append(" InterfaceName: ").Append(InterfaceName).Append("\n"); + sb.Append(" IsReachable: ").Append(IsReachable).Append("\n"); + sb.Append(" Kind: ").Append(Kind).Append("\n"); + sb.Append(" MacAddress: ").Append(MacAddress).Append("\n"); + sb.Append(" Port: ").Append(Port).Append("\n"); + sb.Append(" ResponseTimeMs: ").Append(ResponseTimeMs).Append("\n"); + sb.Append(" ServiceLabel: ").Append(ServiceLabel).Append("\n"); + sb.Append(" ServiceType: ").Append(ServiceType).Append("\n"); + sb.Append(" Source: ").Append(Source).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + // Port (int?) minimum + if (this.Port < (int?)0) + { + yield return new ValidationResult("Invalid value for Port, must be a value greater than or equal to 0.", new [] { "Port" }); + } + + // ResponseTimeMs (int?) minimum + if (this.ResponseTimeMs < (int?)0) + { + yield return new ValidationResult("Invalid value for ResponseTimeMs, must be a value greater than or equal to 0.", new [] { "ResponseTimeMs" }); + } + + yield break; + } + } + +} diff --git a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/NetworkScanResultKindDto.cs b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/NetworkScanResultKindDto.cs new file mode 100644 index 000000000..a06d6f44a --- /dev/null +++ b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/NetworkScanResultKindDto.cs @@ -0,0 +1,68 @@ +/* + * devolutions-gateway + * + * Protocol-aware fine-grained relay server + * + * The version of the OpenAPI document: 2026.2.4 + * Contact: infos@devolutions.net + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using FileParameter = Devolutions.Gateway.Client.Client.FileParameter; +using OpenAPIDateConverter = Devolutions.Gateway.Client.Client.OpenAPIDateConverter; + +namespace Devolutions.Gateway.Client.Model +{ + /// + /// Defines NetworkScanResultKindDto + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum NetworkScanResultKindDto + { + /// + /// Enum Host for value: host + /// + [EnumMember(Value = "host")] + Host = 1, + + /// + /// Enum Service for value: service + /// + [EnumMember(Value = "service")] + Service = 2 + } + + public static class NetworkScanResultKindDtoExtensions + { + /// + /// Returns the value as string for a given variant + /// + public static string ToValue(this NetworkScanResultKindDto variant) + { + switch (variant) + { + case NetworkScanResultKindDto.Host: + return "host"; + case NetworkScanResultKindDto.Service: + return "service"; + default: + throw new ArgumentOutOfRangeException(nameof(variant), $"Unexpected variant: {variant}"); + } + } + } + +} diff --git a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/NetworkScanSourceCapabilitiesDto.cs b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/NetworkScanSourceCapabilitiesDto.cs new file mode 100644 index 000000000..b317fda19 --- /dev/null +++ b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/NetworkScanSourceCapabilitiesDto.cs @@ -0,0 +1,143 @@ +/* + * devolutions-gateway + * + * Protocol-aware fine-grained relay server + * + * The version of the OpenAPI document: 2026.2.4 + * Contact: infos@devolutions.net + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using FileParameter = Devolutions.Gateway.Client.Client.FileParameter; +using OpenAPIDateConverter = Devolutions.Gateway.Client.Client.OpenAPIDateConverter; + +namespace Devolutions.Gateway.Client.Model +{ + /// + /// NetworkScanSourceCapabilitiesDto + /// + [DataContract(Name = "NetworkScanSourceCapabilitiesDto")] + public partial class NetworkScanSourceCapabilitiesDto : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected NetworkScanSourceCapabilitiesDto() { } + /// + /// Initializes a new instance of the class. + /// + /// broadcast (required). + /// dnsResolve (required). + /// ipv4 (required). + /// ipv6 (required). + /// subnet (required). + /// tcpProbe (required). + /// zeroConf (required). + public NetworkScanSourceCapabilitiesDto(bool broadcast = default, bool dnsResolve = default, bool ipv4 = default, bool ipv6 = default, bool subnet = default, bool tcpProbe = default, bool zeroConf = default) + { + this.Broadcast = broadcast; + this.DnsResolve = dnsResolve; + this.Ipv4 = ipv4; + this.Ipv6 = ipv6; + this.Subnet = subnet; + this.TcpProbe = tcpProbe; + this.ZeroConf = zeroConf; + } + + /// + /// Gets or Sets Broadcast + /// + [DataMember(Name = "broadcast", IsRequired = true, EmitDefaultValue = true)] + public bool Broadcast { get; set; } + + /// + /// Gets or Sets DnsResolve + /// + [DataMember(Name = "dnsResolve", IsRequired = true, EmitDefaultValue = true)] + public bool DnsResolve { get; set; } + + /// + /// Gets or Sets Ipv4 + /// + [DataMember(Name = "ipv4", IsRequired = true, EmitDefaultValue = true)] + public bool Ipv4 { get; set; } + + /// + /// Gets or Sets Ipv6 + /// + [DataMember(Name = "ipv6", IsRequired = true, EmitDefaultValue = true)] + public bool Ipv6 { get; set; } + + /// + /// Gets or Sets Subnet + /// + [DataMember(Name = "subnet", IsRequired = true, EmitDefaultValue = true)] + public bool Subnet { get; set; } + + /// + /// Gets or Sets TcpProbe + /// + [DataMember(Name = "tcpProbe", IsRequired = true, EmitDefaultValue = true)] + public bool TcpProbe { get; set; } + + /// + /// Gets or Sets ZeroConf + /// + [DataMember(Name = "zeroConf", IsRequired = true, EmitDefaultValue = true)] + public bool ZeroConf { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class NetworkScanSourceCapabilitiesDto {\n"); + sb.Append(" Broadcast: ").Append(Broadcast).Append("\n"); + sb.Append(" DnsResolve: ").Append(DnsResolve).Append("\n"); + sb.Append(" Ipv4: ").Append(Ipv4).Append("\n"); + sb.Append(" Ipv6: ").Append(Ipv6).Append("\n"); + sb.Append(" Subnet: ").Append(Subnet).Append("\n"); + sb.Append(" TcpProbe: ").Append(TcpProbe).Append("\n"); + sb.Append(" ZeroConf: ").Append(ZeroConf).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/NetworkScanSourceDto.cs b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/NetworkScanSourceDto.cs new file mode 100644 index 000000000..99dcfd2c8 --- /dev/null +++ b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/NetworkScanSourceDto.cs @@ -0,0 +1,174 @@ +/* + * devolutions-gateway + * + * Protocol-aware fine-grained relay server + * + * The version of the OpenAPI document: 2026.2.4 + * Contact: infos@devolutions.net + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using FileParameter = Devolutions.Gateway.Client.Client.FileParameter; +using OpenAPIDateConverter = Devolutions.Gateway.Client.Client.OpenAPIDateConverter; + +namespace Devolutions.Gateway.Client.Model +{ + /// + /// NetworkScanSourceDto + /// + [DataContract(Name = "NetworkScanSourceDto")] + public partial class NetworkScanSourceDto : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected NetworkScanSourceDto() { } + /// + /// Initializes a new instance of the class. + /// + /// address (required). + /// broadcastAddress. + /// capabilities (required). + /// endAddress (required). + /// varInterface (required). + /// prefixLength. + /// startAddress (required). + public NetworkScanSourceDto(string address = default, string broadcastAddress = default, NetworkScanSourceCapabilitiesDto capabilities = default, string endAddress = default, NetworkInterfaceDto varInterface = default, int? prefixLength = default, string startAddress = default) + { + // to ensure "address" is required (not null) + if (address == null) + { + throw new ArgumentNullException("address is a required property for NetworkScanSourceDto and cannot be null"); + } + this.Address = address; + // to ensure "capabilities" is required (not null) + if (capabilities == null) + { + throw new ArgumentNullException("capabilities is a required property for NetworkScanSourceDto and cannot be null"); + } + this.Capabilities = capabilities; + // to ensure "endAddress" is required (not null) + if (endAddress == null) + { + throw new ArgumentNullException("endAddress is a required property for NetworkScanSourceDto and cannot be null"); + } + this.EndAddress = endAddress; + // to ensure "varInterface" is required (not null) + if (varInterface == null) + { + throw new ArgumentNullException("varInterface is a required property for NetworkScanSourceDto and cannot be null"); + } + this.Interface = varInterface; + // to ensure "startAddress" is required (not null) + if (startAddress == null) + { + throw new ArgumentNullException("startAddress is a required property for NetworkScanSourceDto and cannot be null"); + } + this.StartAddress = startAddress; + this.BroadcastAddress = broadcastAddress; + this.PrefixLength = prefixLength; + } + + /// + /// Gets or Sets Address + /// + [DataMember(Name = "address", IsRequired = true, EmitDefaultValue = true)] + public string Address { get; set; } + + /// + /// Gets or Sets BroadcastAddress + /// + [DataMember(Name = "broadcastAddress", EmitDefaultValue = true)] + public string BroadcastAddress { get; set; } + + /// + /// Gets or Sets Capabilities + /// + [DataMember(Name = "capabilities", IsRequired = true, EmitDefaultValue = true)] + public NetworkScanSourceCapabilitiesDto Capabilities { get; set; } + + /// + /// Gets or Sets EndAddress + /// + [DataMember(Name = "endAddress", IsRequired = true, EmitDefaultValue = true)] + public string EndAddress { get; set; } + + /// + /// Gets or Sets Interface + /// + [DataMember(Name = "interface", IsRequired = true, EmitDefaultValue = true)] + public NetworkInterfaceDto Interface { get; set; } + + /// + /// Gets or Sets PrefixLength + /// + [DataMember(Name = "prefixLength", EmitDefaultValue = true)] + public int? PrefixLength { get; set; } + + /// + /// Gets or Sets StartAddress + /// + [DataMember(Name = "startAddress", IsRequired = true, EmitDefaultValue = true)] + public string StartAddress { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class NetworkScanSourceDto {\n"); + sb.Append(" Address: ").Append(Address).Append("\n"); + sb.Append(" BroadcastAddress: ").Append(BroadcastAddress).Append("\n"); + sb.Append(" Capabilities: ").Append(Capabilities).Append("\n"); + sb.Append(" EndAddress: ").Append(EndAddress).Append("\n"); + sb.Append(" Interface: ").Append(Interface).Append("\n"); + sb.Append(" PrefixLength: ").Append(PrefixLength).Append("\n"); + sb.Append(" StartAddress: ").Append(StartAddress).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + // PrefixLength (int?) minimum + if (this.PrefixLength < (int?)0) + { + yield return new ValidationResult("Invalid value for PrefixLength, must be a value greater than or equal to 0.", new [] { "PrefixLength" }); + } + + yield break; + } + } + +} diff --git a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/PreflightAlertStatus.cs b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/PreflightAlertStatus.cs index 24da53a6e..f943d4fb6 100644 --- a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/PreflightAlertStatus.cs +++ b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/PreflightAlertStatus.cs @@ -3,7 +3,7 @@ * * Protocol-aware fine-grained relay server * - * The version of the OpenAPI document: 2025.3.2 + * The version of the OpenAPI document: 2026.2.4 * Contact: infos@devolutions.net * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/PreflightOperation.cs b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/PreflightOperation.cs index f2d1e9b56..667640ed7 100644 --- a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/PreflightOperation.cs +++ b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/PreflightOperation.cs @@ -3,7 +3,7 @@ * * Protocol-aware fine-grained relay server * - * The version of the OpenAPI document: 2025.3.2 + * The version of the OpenAPI document: 2026.2.4 * Contact: infos@devolutions.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -52,9 +52,9 @@ protected PreflightOperation() { } /// kind (required). /// proxyCredential. /// targetCredential. - /// Minimum persistance duration in seconds for the data provisioned via this operation. Optional parameter for \"provision-token\" and \"provision-credentials\" kinds.. + /// Minimum persistence duration in seconds for the data provisioned via this operation. Optional parameter for \"provision-token\" and \"provision-credentials\" kinds.. /// The token to be stored on the proxy-side. Required for \"provision-token\" and \"provision-credentials\" kinds.. - public PreflightOperation(string hostToResolve = default(string), Guid id = default(Guid), PreflightOperationKind kind = default(PreflightOperationKind), AppCredential proxyCredential = default(AppCredential), AppCredential targetCredential = default(AppCredential), int? timeToLive = default(int?), string token = default(string)) + public PreflightOperation(string hostToResolve = default, Guid id = default, PreflightOperationKind kind = default, AppCredential proxyCredential = default, AppCredential targetCredential = default, int? timeToLive = default, string token = default) { this.Id = id; this.Kind = kind; @@ -92,9 +92,9 @@ protected PreflightOperation() { } public AppCredential TargetCredential { get; set; } /// - /// Minimum persistance duration in seconds for the data provisioned via this operation. Optional parameter for \"provision-token\" and \"provision-credentials\" kinds. + /// Minimum persistence duration in seconds for the data provisioned via this operation. Optional parameter for \"provision-token\" and \"provision-credentials\" kinds. /// - /// Minimum persistance duration in seconds for the data provisioned via this operation. Optional parameter for \"provision-token\" and \"provision-credentials\" kinds. + /// Minimum persistence duration in seconds for the data provisioned via this operation. Optional parameter for \"provision-token\" and \"provision-credentials\" kinds. [DataMember(Name = "time_to_live", EmitDefaultValue = true)] public int? TimeToLive { get; set; } diff --git a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/PreflightOperationKind.cs b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/PreflightOperationKind.cs index 51da44a10..c279556ed 100644 --- a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/PreflightOperationKind.cs +++ b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/PreflightOperationKind.cs @@ -3,7 +3,7 @@ * * Protocol-aware fine-grained relay server * - * The version of the OpenAPI document: 2025.3.2 + * The version of the OpenAPI document: 2026.2.4 * Contact: infos@devolutions.net * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/PreflightOutput.cs b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/PreflightOutput.cs index e60158a9e..8fb5ca9ed 100644 --- a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/PreflightOutput.cs +++ b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/PreflightOutput.cs @@ -3,7 +3,7 @@ * * Protocol-aware fine-grained relay server * - * The version of the OpenAPI document: 2025.3.2 + * The version of the OpenAPI document: 2026.2.4 * Contact: infos@devolutions.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -65,7 +65,7 @@ protected PreflightOutput() { } /// Hostname that was resolved. Set for \"resolved-host\" kind.. /// Number of running sessions. Set for \"running-session-count\" kind.. /// Service version. Set for \"version\" kind.. - public PreflightOutput(string agentVersion = default(string), string alertMessage = default(string), PreflightAlertStatus? alertStatus = default(PreflightAlertStatus?), PreflightOutputKind kind = default(PreflightOutputKind), Guid operationId = default(Guid), long? recordingStorageAvailableSpace = default(long?), bool? recordingStorageIsWriteable = default(bool?), long? recordingStorageTotalSpace = default(long?), List resolvedAddresses = default(List), string resolvedHost = default(string), int? runningSessionCount = default(int?), string varVersion = default(string)) + public PreflightOutput(string agentVersion = default, string alertMessage = default, PreflightAlertStatus? alertStatus = default, PreflightOutputKind kind = default, Guid operationId = default, long? recordingStorageAvailableSpace = default, bool? recordingStorageIsWriteable = default, long? recordingStorageTotalSpace = default, List resolvedAddresses = default, string resolvedHost = default, int? runningSessionCount = default, string varVersion = default) { this.Kind = kind; this.OperationId = operationId; diff --git a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/PreflightOutputKind.cs b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/PreflightOutputKind.cs index 872ede506..b05ad143e 100644 --- a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/PreflightOutputKind.cs +++ b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/PreflightOutputKind.cs @@ -3,7 +3,7 @@ * * Protocol-aware fine-grained relay server * - * The version of the OpenAPI document: 2025.3.2 + * The version of the OpenAPI document: 2026.2.4 * Contact: infos@devolutions.net * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/PubKeyFormat.cs b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/PubKeyFormat.cs index a714fd97e..805d381c3 100644 --- a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/PubKeyFormat.cs +++ b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/PubKeyFormat.cs @@ -3,7 +3,7 @@ * * Protocol-aware fine-grained relay server * - * The version of the OpenAPI document: 2025.3.2 + * The version of the OpenAPI document: 2026.2.4 * Contact: infos@devolutions.net * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/ScanOriginDto.cs b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/ScanOriginDto.cs new file mode 100644 index 000000000..a47ef1ba3 --- /dev/null +++ b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/ScanOriginDto.cs @@ -0,0 +1,60 @@ +/* + * devolutions-gateway + * + * Protocol-aware fine-grained relay server + * + * The version of the OpenAPI document: 2026.2.4 + * Contact: infos@devolutions.net + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using FileParameter = Devolutions.Gateway.Client.Client.FileParameter; +using OpenAPIDateConverter = Devolutions.Gateway.Client.Client.OpenAPIDateConverter; + +namespace Devolutions.Gateway.Client.Model +{ + /// + /// Defines ScanOriginDto + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum ScanOriginDto + { + /// + /// Enum Gateway for value: gateway + /// + [EnumMember(Value = "gateway")] + Gateway = 1 + } + + public static class ScanOriginDtoExtensions + { + /// + /// Returns the value as string for a given variant + /// + public static string ToValue(this ScanOriginDto variant) + { + switch (variant) + { + case ScanOriginDto.Gateway: + return "gateway"; + default: + throw new ArgumentOutOfRangeException(nameof(variant), $"Unexpected variant: {variant}"); + } + } + } + +} diff --git a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/ScanResultSourceDto.cs b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/ScanResultSourceDto.cs new file mode 100644 index 000000000..a98ab0a98 --- /dev/null +++ b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/ScanResultSourceDto.cs @@ -0,0 +1,92 @@ +/* + * devolutions-gateway + * + * Protocol-aware fine-grained relay server + * + * The version of the OpenAPI document: 2026.2.4 + * Contact: infos@devolutions.net + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using FileParameter = Devolutions.Gateway.Client.Client.FileParameter; +using OpenAPIDateConverter = Devolutions.Gateway.Client.Client.OpenAPIDateConverter; + +namespace Devolutions.Gateway.Client.Model +{ + /// + /// Defines ScanResultSourceDto + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum ScanResultSourceDto + { + /// + /// Enum Subnet for value: subnet + /// + [EnumMember(Value = "subnet")] + Subnet = 1, + + /// + /// Enum Broadcast for value: broadcast + /// + [EnumMember(Value = "broadcast")] + Broadcast = 2, + + /// + /// Enum TcpProbe for value: tcp_probe + /// + [EnumMember(Value = "tcp_probe")] + TcpProbe = 3, + + /// + /// Enum Gateway for value: gateway + /// + [EnumMember(Value = "gateway")] + Gateway = 4, + + /// + /// Enum ZeroConf for value: zero_conf + /// + [EnumMember(Value = "zero_conf")] + ZeroConf = 5 + } + + public static class ScanResultSourceDtoExtensions + { + /// + /// Returns the value as string for a given variant + /// + public static string ToValue(this ScanResultSourceDto variant) + { + switch (variant) + { + case ScanResultSourceDto.Subnet: + return "subnet"; + case ScanResultSourceDto.Broadcast: + return "broadcast"; + case ScanResultSourceDto.TcpProbe: + return "tcp_probe"; + case ScanResultSourceDto.Gateway: + return "gateway"; + case ScanResultSourceDto.ZeroConf: + return "zero_conf"; + default: + throw new ArgumentOutOfRangeException(nameof(variant), $"Unexpected variant: {variant}"); + } + } + } + +} diff --git a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/SessionInfo.cs b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/SessionInfo.cs index 2dd24b0c0..f5dd1beb9 100644 --- a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/SessionInfo.cs +++ b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/SessionInfo.cs @@ -3,7 +3,7 @@ * * Protocol-aware fine-grained relay server * - * The version of the OpenAPI document: 2025.3.2 + * The version of the OpenAPI document: 2026.2.4 * Contact: infos@devolutions.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -55,7 +55,7 @@ protected SessionInfo() { } /// Recording Policy (required). /// Date this session was started (required). /// Maximum session duration in minutes (0 is used for the infinite duration). - public SessionInfo(string applicationProtocol = default(string), Guid associationId = default(Guid), ConnectionMode connectionMode = default(ConnectionMode), string destinationHost = default(string), bool filteringPolicy = default(bool), bool recordingPolicy = default(bool), DateTime startTimestamp = default(DateTime), long? timeToLive = default(long?)) + public SessionInfo(string applicationProtocol = default, Guid associationId = default, ConnectionMode connectionMode = default, string destinationHost = default, bool filteringPolicy = default, bool recordingPolicy = default, DateTime startTimestamp = default, long? timeToLive = default) { // to ensure "applicationProtocol" is required (not null) if (applicationProtocol == null) diff --git a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/SessionTokenContentType.cs b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/SessionTokenContentType.cs index 8d485f3f5..20b9a1773 100644 --- a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/SessionTokenContentType.cs +++ b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/SessionTokenContentType.cs @@ -3,7 +3,7 @@ * * Protocol-aware fine-grained relay server * - * The version of the OpenAPI document: 2025.3.2 + * The version of the OpenAPI document: 2026.2.4 * Contact: infos@devolutions.net * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/SessionTokenSignRequest.cs b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/SessionTokenSignRequest.cs index b40a10e51..f8874e6a3 100644 --- a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/SessionTokenSignRequest.cs +++ b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/SessionTokenSignRequest.cs @@ -3,7 +3,7 @@ * * Protocol-aware fine-grained relay server * - * The version of the OpenAPI document: 2025.3.2 + * The version of the OpenAPI document: 2026.2.4 * Contact: infos@devolutions.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -54,7 +54,7 @@ protected SessionTokenSignRequest() { } /// The validity duration in seconds for the session token. This value cannot exceed 2 hours. (required). /// Protocol for the session (e.g.: \"rdp\").. /// Unique ID for this session.. - public SessionTokenSignRequest(SessionTokenContentType contentType = default(SessionTokenContentType), string destination = default(string), string krbKdc = default(string), string krbRealm = default(string), long lifetime = default(long), string protocol = default(string), Guid? sessionId = default(Guid?)) + public SessionTokenSignRequest(SessionTokenContentType contentType = default, string destination = default, string krbKdc = default, string krbRealm = default, long lifetime = default, string protocol = default, Guid? sessionId = default) { this.ContentType = contentType; this.Lifetime = lifetime; diff --git a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/SetConfigResponse.cs b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/SetConfigResponse.cs index 1bafc62b1..a71fbbc2e 100644 --- a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/SetConfigResponse.cs +++ b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/SetConfigResponse.cs @@ -3,7 +3,7 @@ * * Protocol-aware fine-grained relay server * - * The version of the OpenAPI document: 2025.3.2 + * The version of the OpenAPI document: 2026.2.4 * Contact: infos@devolutions.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -37,7 +37,7 @@ public partial class SetConfigResponse : IValidatableObject /// Initializes a new instance of the class. /// /// An optional list of probes that this server could not parse.. - public SetConfigResponse(List probeTypeErrors = default(List)) + public SetConfigResponse(List probeTypeErrors = default) { this.ProbeTypeErrors = probeTypeErrors; } diff --git a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/SetUpdateScheduleRequest.cs b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/SetUpdateScheduleRequest.cs new file mode 100644 index 000000000..2f69cf3db --- /dev/null +++ b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/SetUpdateScheduleRequest.cs @@ -0,0 +1,148 @@ +/* + * devolutions-gateway + * + * Protocol-aware fine-grained relay server + * + * The version of the OpenAPI document: 2026.2.4 + * Contact: infos@devolutions.net + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using FileParameter = Devolutions.Gateway.Client.Client.FileParameter; +using OpenAPIDateConverter = Devolutions.Gateway.Client.Client.OpenAPIDateConverter; + +namespace Devolutions.Gateway.Client.Model +{ + /// + /// Desired auto-update schedule to apply to Devolutions Agent. + /// + [DataContract(Name = "SetUpdateScheduleRequest")] + public partial class SetUpdateScheduleRequest : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected SetUpdateScheduleRequest() { } + /// + /// Initializes a new instance of the class. + /// + /// Enable periodic Devolutions Agent self-update checks. (required). + /// Minimum interval between auto-update checks, in seconds. `0` means check once at `UpdateWindowStart` (default).. + /// Products the agent autonomously polls for new versions (default: empty).. + /// End of the maintenance window as seconds past midnight in local time, exclusive. `null` (default) means no upper bound - a single check fires at `UpdateWindowStart`. When end < start the window crosses midnight.. + /// Start of the maintenance window as seconds past midnight in local time (default: `7200` = 02:00).. + public SetUpdateScheduleRequest(bool enabled = default, long interval = default, List products = default, int? updateWindowEnd = default, int updateWindowStart = default) + { + this.Enabled = enabled; + this.Interval = interval; + this.Products = products; + this.UpdateWindowEnd = updateWindowEnd; + this.UpdateWindowStart = updateWindowStart; + } + + /// + /// Enable periodic Devolutions Agent self-update checks. + /// + /// Enable periodic Devolutions Agent self-update checks. + [DataMember(Name = "Enabled", IsRequired = true, EmitDefaultValue = true)] + public bool Enabled { get; set; } + + /// + /// Minimum interval between auto-update checks, in seconds. `0` means check once at `UpdateWindowStart` (default). + /// + /// Minimum interval between auto-update checks, in seconds. `0` means check once at `UpdateWindowStart` (default). + [DataMember(Name = "Interval", EmitDefaultValue = false)] + public long Interval { get; set; } + + /// + /// Products the agent autonomously polls for new versions (default: empty). + /// + /// Products the agent autonomously polls for new versions (default: empty). + [DataMember(Name = "Products", EmitDefaultValue = false)] + public List Products { get; set; } + + /// + /// End of the maintenance window as seconds past midnight in local time, exclusive. `null` (default) means no upper bound - a single check fires at `UpdateWindowStart`. When end < start the window crosses midnight. + /// + /// End of the maintenance window as seconds past midnight in local time, exclusive. `null` (default) means no upper bound - a single check fires at `UpdateWindowStart`. When end < start the window crosses midnight. + [DataMember(Name = "UpdateWindowEnd", EmitDefaultValue = true)] + public int? UpdateWindowEnd { get; set; } + + /// + /// Start of the maintenance window as seconds past midnight in local time (default: `7200` = 02:00). + /// + /// Start of the maintenance window as seconds past midnight in local time (default: `7200` = 02:00). + [DataMember(Name = "UpdateWindowStart", EmitDefaultValue = false)] + public int UpdateWindowStart { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class SetUpdateScheduleRequest {\n"); + sb.Append(" Enabled: ").Append(Enabled).Append("\n"); + sb.Append(" Interval: ").Append(Interval).Append("\n"); + sb.Append(" Products: ").Append(Products).Append("\n"); + sb.Append(" UpdateWindowEnd: ").Append(UpdateWindowEnd).Append("\n"); + sb.Append(" UpdateWindowStart: ").Append(UpdateWindowStart).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + // Interval (long) minimum + if (this.Interval < (long)0) + { + yield return new ValidationResult("Invalid value for Interval, must be a value greater than or equal to 0.", new [] { "Interval" }); + } + + // UpdateWindowEnd (int?) minimum + if (this.UpdateWindowEnd < (int?)0) + { + yield return new ValidationResult("Invalid value for UpdateWindowEnd, must be a value greater than or equal to 0.", new [] { "UpdateWindowEnd" }); + } + + // UpdateWindowStart (int) minimum + if (this.UpdateWindowStart < (int)0) + { + yield return new ValidationResult("Invalid value for UpdateWindowStart, must be a value greater than or equal to 0.", new [] { "UpdateWindowStart" }); + } + + yield break; + } + } + +} diff --git a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/SubProvisionerKey.cs b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/SubProvisionerKey.cs index e51daafcc..e2e3a9d24 100644 --- a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/SubProvisionerKey.cs +++ b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/SubProvisionerKey.cs @@ -3,7 +3,7 @@ * * Protocol-aware fine-grained relay server * - * The version of the OpenAPI document: 2025.3.2 + * The version of the OpenAPI document: 2026.2.4 * Contact: infos@devolutions.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -57,7 +57,7 @@ protected SubProvisionerKey() { } /// format. /// The key ID for this subkey (required). /// The binary-to-text-encoded key data (required). - public SubProvisionerKey(DataEncoding? encoding = default(DataEncoding?), PubKeyFormat? format = default(PubKeyFormat?), string id = default(string), string value = default(string)) + public SubProvisionerKey(DataEncoding? encoding = default, PubKeyFormat? format = default, string id = default, string value = default) { // to ensure "id" is required (not null) if (id == null) diff --git a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/Subscriber.cs b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/Subscriber.cs index 48f0e746d..8569a35d5 100644 --- a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/Subscriber.cs +++ b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/Subscriber.cs @@ -3,7 +3,7 @@ * * Protocol-aware fine-grained relay server * - * The version of the OpenAPI document: 2025.3.2 + * The version of the OpenAPI document: 2026.2.4 * Contact: infos@devolutions.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -43,7 +43,7 @@ protected Subscriber() { } /// /// Bearer token to use when making HTTP requests (required). /// HTTP URL where notification messages are to be sent (required). - public Subscriber(string token = default(string), string url = default(string)) + public Subscriber(string token = default, string url = default) { // to ensure "token" is required (not null) if (token == null) diff --git a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/TrafficEventResponse.cs b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/TrafficEventResponse.cs index baf34a61c..0919f9606 100644 --- a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/TrafficEventResponse.cs +++ b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/TrafficEventResponse.cs @@ -3,7 +3,7 @@ * * Protocol-aware fine-grained relay server * - * The version of the OpenAPI document: 2025.3.2 + * The version of the OpenAPI document: 2026.2.4 * Contact: infos@devolutions.net * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -64,7 +64,7 @@ protected TrafficEventResponse() { } /// Original target host string before DNS resolution (required). /// Concrete target IP address after resolution (required). /// Target port number for the connection (required). - public TrafficEventResponse(long activeDurationMs = default(long), long bytesRx = default(long), long bytesTx = default(long), long connectAtMs = default(long), long disconnectAtMs = default(long), EventOutcomeResponse outcome = default(EventOutcomeResponse), TransportProtocolResponse protocol = default(TransportProtocolResponse), Guid sessionId = default(Guid), string targetHost = default(string), string targetIp = default(string), int targetPort = default(int)) + public TrafficEventResponse(long activeDurationMs = default, long bytesRx = default, long bytesTx = default, long connectAtMs = default, long disconnectAtMs = default, EventOutcomeResponse outcome = default, TransportProtocolResponse protocol = default, Guid sessionId = default, string targetHost = default, string targetIp = default, int targetPort = default) { this.ActiveDurationMs = activeDurationMs; this.BytesRx = bytesRx; diff --git a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/TransportProtocolResponse.cs b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/TransportProtocolResponse.cs index 79ef69d5e..dc275b1a8 100644 --- a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/TransportProtocolResponse.cs +++ b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/TransportProtocolResponse.cs @@ -3,7 +3,7 @@ * * Protocol-aware fine-grained relay server * - * The version of the OpenAPI document: 2025.3.2 + * The version of the OpenAPI document: 2026.2.4 * Contact: infos@devolutions.net * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/UpdateProductInfo.cs b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/UpdateProductInfo.cs new file mode 100644 index 000000000..eb30a0200 --- /dev/null +++ b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/UpdateProductInfo.cs @@ -0,0 +1,95 @@ +/* + * devolutions-gateway + * + * Protocol-aware fine-grained relay server + * + * The version of the OpenAPI document: 2026.2.4 + * Contact: infos@devolutions.net + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using FileParameter = Devolutions.Gateway.Client.Client.FileParameter; +using OpenAPIDateConverter = Devolutions.Gateway.Client.Client.OpenAPIDateConverter; + +namespace Devolutions.Gateway.Client.Model +{ + /// + /// Per-product update information. + /// + [DataContract(Name = "UpdateProductInfo")] + public partial class UpdateProductInfo : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected UpdateProductInfo() { } + /// + /// Initializes a new instance of the class. + /// + /// Requested or installed version: `\"latest\"` or `\"YYYY.M.D\"` / `\"YYYY.M.D.R\"`. (required). + public UpdateProductInfo(string varVersion = default) + { + // to ensure "varVersion" is required (not null) + if (varVersion == null) + { + throw new ArgumentNullException("varVersion is a required property for UpdateProductInfo and cannot be null"); + } + this.VarVersion = varVersion; + } + + /// + /// Requested or installed version: `\"latest\"` or `\"YYYY.M.D\"` / `\"YYYY.M.D.R\"`. + /// + /// Requested or installed version: `\"latest\"` or `\"YYYY.M.D\"` / `\"YYYY.M.D.R\"`. + [DataMember(Name = "Version", IsRequired = true, EmitDefaultValue = true)] + public string VarVersion { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class UpdateProductInfo {\n"); + sb.Append(" VarVersion: ").Append(VarVersion).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/UpdateRequestSchema.cs b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/UpdateRequestSchema.cs new file mode 100644 index 000000000..ebf70abbb --- /dev/null +++ b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/UpdateRequestSchema.cs @@ -0,0 +1,85 @@ +/* + * devolutions-gateway + * + * Protocol-aware fine-grained relay server + * + * The version of the OpenAPI document: 2026.2.4 + * Contact: infos@devolutions.net + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using FileParameter = Devolutions.Gateway.Client.Client.FileParameter; +using OpenAPIDateConverter = Devolutions.Gateway.Client.Client.OpenAPIDateConverter; + +namespace Devolutions.Gateway.Client.Model +{ + /// + /// OpenAPI schema for the update request body. The API accepts an object containing a `Products` map, whose keys are product names and whose values are update information. + /// + [DataContract(Name = "UpdateRequestSchema")] + public partial class UpdateRequestSchema : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// Map of product name to update information.. + public UpdateRequestSchema(Dictionary products = default) + { + this.Products = products; + } + + /// + /// Map of product name to update information. + /// + /// Map of product name to update information. + [DataMember(Name = "Products", EmitDefaultValue = false)] + public Dictionary Products { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class UpdateRequestSchema {\n"); + sb.Append(" Products: ").Append(Products).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/devolutions-gateway/openapi/dotnet-subscriber/.openapi-generator/VERSION b/devolutions-gateway/openapi/dotnet-subscriber/.openapi-generator/VERSION index 4bc5d6181..07832195c 100644 --- a/devolutions-gateway/openapi/dotnet-subscriber/.openapi-generator/VERSION +++ b/devolutions-gateway/openapi/dotnet-subscriber/.openapi-generator/VERSION @@ -1 +1 @@ -7.9.0 +7.24.0 diff --git a/devolutions-gateway/openapi/dotnet-subscriber/src/Devolutions.Gateway.Subscriber/Attributes/ValidateModelStateAttribute.cs b/devolutions-gateway/openapi/dotnet-subscriber/src/Devolutions.Gateway.Subscriber/Attributes/ValidateModelStateAttribute.cs index ab8664636..27433372d 100644 --- a/devolutions-gateway/openapi/dotnet-subscriber/src/Devolutions.Gateway.Subscriber/Attributes/ValidateModelStateAttribute.cs +++ b/devolutions-gateway/openapi/dotnet-subscriber/src/Devolutions.Gateway.Subscriber/Attributes/ValidateModelStateAttribute.cs @@ -3,7 +3,7 @@ * * API a service must implement in order to receive Devolutions Gateway notifications * - * The version of the OpenAPI document: 2025.3.2 + * The version of the OpenAPI document: 2026.2.4 * Contact: infos@devolutions.net * Generated by: https://openapi-generator.tech */ diff --git a/devolutions-gateway/openapi/dotnet-subscriber/src/Devolutions.Gateway.Subscriber/Authentication/ApiAuthentication.cs b/devolutions-gateway/openapi/dotnet-subscriber/src/Devolutions.Gateway.Subscriber/Authentication/ApiAuthentication.cs index c5c9f6eff..71ae543b6 100644 --- a/devolutions-gateway/openapi/dotnet-subscriber/src/Devolutions.Gateway.Subscriber/Authentication/ApiAuthentication.cs +++ b/devolutions-gateway/openapi/dotnet-subscriber/src/Devolutions.Gateway.Subscriber/Authentication/ApiAuthentication.cs @@ -3,7 +3,7 @@ * * API a service must implement in order to receive Devolutions Gateway notifications * - * The version of the OpenAPI document: 2025.3.2 + * The version of the OpenAPI document: 2026.2.4 * Contact: infos@devolutions.net * Generated by: https://openapi-generator.tech */ diff --git a/devolutions-gateway/openapi/dotnet-subscriber/src/Devolutions.Gateway.Subscriber/Controllers/SubscriberApi.cs b/devolutions-gateway/openapi/dotnet-subscriber/src/Devolutions.Gateway.Subscriber/Controllers/SubscriberApi.cs index a4dbe8666..c22598601 100644 --- a/devolutions-gateway/openapi/dotnet-subscriber/src/Devolutions.Gateway.Subscriber/Controllers/SubscriberApi.cs +++ b/devolutions-gateway/openapi/dotnet-subscriber/src/Devolutions.Gateway.Subscriber/Controllers/SubscriberApi.cs @@ -3,7 +3,7 @@ * * API a service must implement in order to receive Devolutions Gateway notifications * - * The version of the OpenAPI document: 2025.3.2 + * The version of the OpenAPI document: 2026.2.4 * Contact: infos@devolutions.net * Generated by: https://openapi-generator.tech */ diff --git a/devolutions-gateway/openapi/dotnet-subscriber/src/Devolutions.Gateway.Subscriber/Converters/CustomEnumConverter.cs b/devolutions-gateway/openapi/dotnet-subscriber/src/Devolutions.Gateway.Subscriber/Converters/CustomEnumConverter.cs index 811441e40..f70017e6f 100644 --- a/devolutions-gateway/openapi/dotnet-subscriber/src/Devolutions.Gateway.Subscriber/Converters/CustomEnumConverter.cs +++ b/devolutions-gateway/openapi/dotnet-subscriber/src/Devolutions.Gateway.Subscriber/Converters/CustomEnumConverter.cs @@ -3,7 +3,7 @@ * * API a service must implement in order to receive Devolutions Gateway notifications * - * The version of the OpenAPI document: 2025.3.2 + * The version of the OpenAPI document: 2026.2.4 * Contact: infos@devolutions.net * Generated by: https://openapi-generator.tech */ diff --git a/devolutions-gateway/openapi/dotnet-subscriber/src/Devolutions.Gateway.Subscriber/Devolutions.Gateway.Subscriber.csproj b/devolutions-gateway/openapi/dotnet-subscriber/src/Devolutions.Gateway.Subscriber/Devolutions.Gateway.Subscriber.csproj index 183bb5590..1e5709596 100644 --- a/devolutions-gateway/openapi/dotnet-subscriber/src/Devolutions.Gateway.Subscriber/Devolutions.Gateway.Subscriber.csproj +++ b/devolutions-gateway/openapi/dotnet-subscriber/src/Devolutions.Gateway.Subscriber/Devolutions.Gateway.Subscriber.csproj @@ -1,27 +1,27 @@ - - C# interface to implement Devolutions Gateway Subscriber API - No Copyright - Devolutions Inc. - net10.0 - true - true - 2023.2.22.0 - annotations - Library - Devolutions.Gateway.Subscriber - Devolutions.Gateway.Subscriber - 06fa9777-a859-4fe6-a84c-cd853e072b44 - Linux - ..\.. - - - - - - - - - - + + C# interface to implement Devolutions Gateway Subscriber API + No Copyright + Devolutions Inc. + net6.0 + true + true + 2023.2.22.0 + annotations + Library + Devolutions.Gateway.Subscriber + Devolutions.Gateway.Subscriber + 06fa9777-a859-4fe6-a84c-cd853e072b44 + Linux + ..\.. + + + + + + + + + + diff --git a/devolutions-gateway/openapi/dotnet-subscriber/src/Devolutions.Gateway.Subscriber/Formatters/InputFormatterStream.cs b/devolutions-gateway/openapi/dotnet-subscriber/src/Devolutions.Gateway.Subscriber/Formatters/InputFormatterStream.cs index 90272ba19..763f1b0f3 100644 --- a/devolutions-gateway/openapi/dotnet-subscriber/src/Devolutions.Gateway.Subscriber/Formatters/InputFormatterStream.cs +++ b/devolutions-gateway/openapi/dotnet-subscriber/src/Devolutions.Gateway.Subscriber/Formatters/InputFormatterStream.cs @@ -3,7 +3,7 @@ * * API a service must implement in order to receive Devolutions Gateway notifications * - * The version of the OpenAPI document: 2025.3.2 + * The version of the OpenAPI document: 2026.2.4 * Contact: infos@devolutions.net * Generated by: https://openapi-generator.tech */ diff --git a/devolutions-gateway/openapi/dotnet-subscriber/src/Devolutions.Gateway.Subscriber/Models/SubscriberMessage.cs b/devolutions-gateway/openapi/dotnet-subscriber/src/Devolutions.Gateway.Subscriber/Models/SubscriberMessage.cs index 3c782ca6b..869acc3ec 100644 --- a/devolutions-gateway/openapi/dotnet-subscriber/src/Devolutions.Gateway.Subscriber/Models/SubscriberMessage.cs +++ b/devolutions-gateway/openapi/dotnet-subscriber/src/Devolutions.Gateway.Subscriber/Models/SubscriberMessage.cs @@ -3,7 +3,7 @@ * * API a service must implement in order to receive Devolutions Gateway notifications * - * The version of the OpenAPI document: 2025.3.2 + * The version of the OpenAPI document: 2026.2.4 * Contact: infos@devolutions.net * Generated by: https://openapi-generator.tech */ diff --git a/devolutions-gateway/openapi/dotnet-subscriber/src/Devolutions.Gateway.Subscriber/Models/SubscriberMessageKind.cs b/devolutions-gateway/openapi/dotnet-subscriber/src/Devolutions.Gateway.Subscriber/Models/SubscriberMessageKind.cs index 1ef9ff3be..f4ae016ea 100644 --- a/devolutions-gateway/openapi/dotnet-subscriber/src/Devolutions.Gateway.Subscriber/Models/SubscriberMessageKind.cs +++ b/devolutions-gateway/openapi/dotnet-subscriber/src/Devolutions.Gateway.Subscriber/Models/SubscriberMessageKind.cs @@ -3,7 +3,7 @@ * * API a service must implement in order to receive Devolutions Gateway notifications * - * The version of the OpenAPI document: 2025.3.2 + * The version of the OpenAPI document: 2026.2.4 * Contact: infos@devolutions.net * Generated by: https://openapi-generator.tech */ @@ -30,21 +30,21 @@ public enum SubscriberMessageKind { /// - /// Enum Started for session.started + /// Enum SessionStarted for session.started /// [EnumMember(Value = "session.started")] - Started = 1, + SessionStarted = 1, /// - /// Enum Ended for session.ended + /// Enum SessionEnded for session.ended /// [EnumMember(Value = "session.ended")] - Ended = 2, + SessionEnded = 2, /// - /// Enum List for session.list + /// Enum SessionList for session.list /// [EnumMember(Value = "session.list")] - List = 3 + SessionList = 3 } } diff --git a/devolutions-gateway/openapi/dotnet-subscriber/src/Devolutions.Gateway.Subscriber/Models/SubscriberSessionInfo.cs b/devolutions-gateway/openapi/dotnet-subscriber/src/Devolutions.Gateway.Subscriber/Models/SubscriberSessionInfo.cs index bdfff0e35..532d5ef72 100644 --- a/devolutions-gateway/openapi/dotnet-subscriber/src/Devolutions.Gateway.Subscriber/Models/SubscriberSessionInfo.cs +++ b/devolutions-gateway/openapi/dotnet-subscriber/src/Devolutions.Gateway.Subscriber/Models/SubscriberSessionInfo.cs @@ -3,7 +3,7 @@ * * API a service must implement in order to receive Devolutions Gateway notifications * - * The version of the OpenAPI document: 2025.3.2 + * The version of the OpenAPI document: 2026.2.4 * Contact: infos@devolutions.net * Generated by: https://openapi-generator.tech */ diff --git a/devolutions-gateway/openapi/dotnet-subscriber/src/Devolutions.Gateway.Subscriber/OpenApi/TypeExtensions.cs b/devolutions-gateway/openapi/dotnet-subscriber/src/Devolutions.Gateway.Subscriber/OpenApi/TypeExtensions.cs index 386f4a040..28fd38278 100644 --- a/devolutions-gateway/openapi/dotnet-subscriber/src/Devolutions.Gateway.Subscriber/OpenApi/TypeExtensions.cs +++ b/devolutions-gateway/openapi/dotnet-subscriber/src/Devolutions.Gateway.Subscriber/OpenApi/TypeExtensions.cs @@ -3,7 +3,7 @@ * * API a service must implement in order to receive Devolutions Gateway notifications * - * The version of the OpenAPI document: 2025.3.2 + * The version of the OpenAPI document: 2026.2.4 * Contact: infos@devolutions.net * Generated by: https://openapi-generator.tech */ diff --git a/devolutions-gateway/openapi/ts-angular-client/.openapi-generator/FILES b/devolutions-gateway/openapi/ts-angular-client/.openapi-generator/FILES index 2f0c2d88c..789664fdb 100644 --- a/devolutions-gateway/openapi/ts-angular-client/.openapi-generator/FILES +++ b/devolutions-gateway/openapi/ts-angular-client/.openapi-generator/FILES @@ -1,5 +1,6 @@ .gitignore README.md +api.base.service.ts api.module.ts api/api.ts api/config.service.ts @@ -34,7 +35,10 @@ model/connectionMode.ts model/dataEncoding.ts model/deleteManyResult.ts model/eventOutcomeResponse.ts +model/getUpdateProductsResponse.ts +model/getUpdateScheduleResponse.ts model/heartbeat.ts +model/hostScanStateDto.ts model/identity.ts model/interfaceInfo.ts model/jrlInfo.ts @@ -47,22 +51,35 @@ model/monitoringLogResponse.ts model/monitoringProbeType.ts model/monitoringProbeTypeOneOf.ts model/monitorsConfig.ts +model/networkInterfaceDto.ts +model/networkInterfacesResponse.ts +model/networkScanResultEventDto.ts +model/networkScanResultKindDto.ts +model/networkScanSourceCapabilitiesDto.ts +model/networkScanSourceDto.ts model/preflightAlertStatus.ts model/preflightOperation.ts model/preflightOperationKind.ts model/preflightOutput.ts model/preflightOutputKind.ts model/pubKeyFormat.ts +model/scanOriginDto.ts +model/scanResultSourceDto.ts model/sessionInfo.ts model/sessionTokenContentType.ts model/sessionTokenSignRequest.ts model/setConfigResponse.ts +model/setUpdateScheduleRequest.ts model/subProvisionerKey.ts model/subscriber.ts model/trafficEventResponse.ts model/transportProtocolResponse.ts +model/updateProductInfo.ts +model/updateRequestSchema.ts ng-package.json package.json param.ts +provide-api.ts +query.params.ts tsconfig.json variables.ts diff --git a/devolutions-gateway/openapi/ts-angular-client/.openapi-generator/VERSION b/devolutions-gateway/openapi/ts-angular-client/.openapi-generator/VERSION index 4bc5d6181..07832195c 100644 --- a/devolutions-gateway/openapi/ts-angular-client/.openapi-generator/VERSION +++ b/devolutions-gateway/openapi/ts-angular-client/.openapi-generator/VERSION @@ -1 +1 @@ -7.9.0 +7.24.0 diff --git a/devolutions-gateway/openapi/ts-angular-client/README.md b/devolutions-gateway/openapi/ts-angular-client/README.md index b2c73d3a3..680a063da 100644 --- a/devolutions-gateway/openapi/ts-angular-client/README.md +++ b/devolutions-gateway/openapi/ts-angular-client/README.md @@ -1,34 +1,35 @@ -## @devolutions/gateway-client@0.15.0 +# @devolutions/gateway-client@0.15.0 Protocol-aware fine-grained relay server -The version of the OpenAPI document: 2025.3.2 +The version of the OpenAPI document: 2026.2.4 -### Building +## Building To install the required dependencies and to build the typescript sources run: -``` + +```console npm install npm run build ``` -### publishing +## Publishing -First build the package then run ```npm publish dist``` (don't forget to specify the `dist` folder!) +First build the package then run `npm publish dist` (don't forget to specify the `dist` folder!) -### consuming +## Consuming Navigate to the folder of your consuming project and run one of next commands. _published:_ -``` +```console npm install @devolutions/gateway-client@0.15.0 --save ``` _without publishing (not recommended):_ -``` +```console npm install PATH_TO_GENERATED_PACKAGE/dist.tgz --save ``` @@ -37,173 +38,126 @@ _It's important to take the tgz file, otherwise you'll get trouble with links on _using `npm link`:_ In PATH_TO_GENERATED_PACKAGE/dist: -``` + +```console npm link ``` In your project: -``` + +```console npm link @devolutions/gateway-client ``` __Note for Windows users:__ The Angular CLI has troubles to use linked npm packages. -Please refer to this issue https://github.com/angular/angular-cli/issues/8284 for a solution / workaround. +Please refer to this issue for a solution / workaround. Published packages are not effected by this issue. - -#### General usage +### General usage In your Angular project: +```typescript -``` -// without configuring providers -import { ApiModule } from '@devolutions/gateway-client'; -import { HttpClientModule } from '@angular/common/http'; - -@NgModule({ - imports: [ - ApiModule, - // make sure to import the HttpClientModule in the AppModule only, - // see https://github.com/angular/angular/issues/20575 - HttpClientModule - ], - declarations: [ AppComponent ], - providers: [], - bootstrap: [ AppComponent ] -}) -export class AppModule {} -``` - -``` -// configuring providers -import { ApiModule, Configuration, ConfigurationParameters } from '@devolutions/gateway-client'; - -export function apiConfigFactory (): Configuration { - const params: ConfigurationParameters = { - // set configuration parameters here. - } - return new Configuration(params); -} - -@NgModule({ - imports: [ ApiModule.forRoot(apiConfigFactory) ], - declarations: [ AppComponent ], - providers: [], - bootstrap: [ AppComponent ] -}) -export class AppModule {} -``` - -``` -// configuring providers with an authentication service that manages your access tokens -import { ApiModule, Configuration } from '@devolutions/gateway-client'; +import { ApplicationConfig } from '@angular/core'; +import { provideHttpClient } from '@angular/common/http'; +import { provideApi } from '@devolutions/gateway-client'; -@NgModule({ - imports: [ ApiModule ], - declarations: [ AppComponent ], +export const appConfig: ApplicationConfig = { providers: [ - { - provide: Configuration, - useFactory: (authService: AuthService) => new Configuration( - { - basePath: environment.apiUrl, - accessToken: authService.getAccessToken.bind(authService) - } - ), - deps: [AuthService], - multi: false - } + // ... + provideHttpClient(), + provideApi() ], - bootstrap: [ AppComponent ] -}) -export class AppModule {} -``` - +}; ``` -import { DefaultApi } from '@devolutions/gateway-client'; -export class AppComponent { - constructor(private apiGateway: DefaultApi) { } -} +**NOTE** +If you're still using `AppModule` and haven't [migrated](https://angular.dev/reference/migrations/standalone) yet, you can still import an Angular module: +```typescript +import { ApiModule } from '@devolutions/gateway-client'; ``` -Note: The ApiModule is restricted to being instantiated once app wide. -This is to ensure that all services are treated as singletons. - -#### Using multiple OpenAPI files / APIs / ApiModules -In order to use multiple `ApiModules` generated from different OpenAPI files, -you can create an alias name when importing the modules -in order to avoid naming conflicts: -``` -import { ApiModule } from 'my-api-path'; -import { ApiModule as OtherApiModule } from 'my-other-api-path'; -import { HttpClientModule } from '@angular/common/http'; +If different from the generated base path, during app bootstrap, you can provide the base path to your service. -@NgModule({ - imports: [ - ApiModule, - OtherApiModule, - // make sure to import the HttpClientModule in the AppModule only, - // see https://github.com/angular/angular/issues/20575 - HttpClientModule - ] -}) -export class AppModule { +```typescript +import { ApplicationConfig } from '@angular/core'; +import { provideHttpClient } from '@angular/common/http'; +import { provideApi } from '@devolutions/gateway-client'; -} +export const appConfig: ApplicationConfig = { + providers: [ + // ... + provideHttpClient(), + provideApi('http://localhost:9999') + ], +}; ``` +```typescript +// with a custom configuration +import { ApplicationConfig } from '@angular/core'; +import { provideHttpClient } from '@angular/common/http'; +import { provideApi } from '@devolutions/gateway-client'; -### Set service base path -If different than the generated base path, during app bootstrap, you can provide the base path to your service. - -``` -import { BASE_PATH } from '@devolutions/gateway-client'; - -bootstrap(AppComponent, [ - { provide: BASE_PATH, useValue: 'https://your-web-service.com' }, -]); +export const appConfig: ApplicationConfig = { + providers: [ + // ... + provideHttpClient(), + provideApi({ + withCredentials: true, + username: 'user', + password: 'password' + }) + ], +}; ``` -or -``` -import { BASE_PATH } from '@devolutions/gateway-client'; +```typescript +// with factory building a custom configuration +import { ApplicationConfig } from '@angular/core'; +import { provideHttpClient } from '@angular/common/http'; +import { provideApi, Configuration } from '@devolutions/gateway-client'; -@NgModule({ - imports: [], - declarations: [ AppComponent ], - providers: [ provide: BASE_PATH, useValue: 'https://your-web-service.com' ], - bootstrap: [ AppComponent ] -}) -export class AppModule {} +export const appConfig: ApplicationConfig = { + providers: [ + // ... + provideHttpClient(), + { + provide: Configuration, + useFactory: (authService: AuthService) => new Configuration({ + basePath: 'http://localhost:9999', + withCredentials: true, + username: authService.getUsername(), + password: authService.getPassword(), + }), + deps: [AuthService], + multi: false + } + ], +}; ``` +### Using multiple OpenAPI files / APIs -#### Using @angular/cli -First extend your `src/environments/*.ts` files by adding the corresponding base path: - -``` -export const environment = { - production: false, - API_BASE_PATH: 'http://127.0.0.1:8080' -}; -``` +In order to use multiple APIs generated from different OpenAPI files, +you can create an alias name when importing the modules +in order to avoid naming conflicts: -In the src/app/app.module.ts: -``` -import { BASE_PATH } from '@devolutions/gateway-client'; +```typescript +import { provideApi as provideUserApi } from 'my-user-api-path'; +import { provideApi as provideAdminApi } from 'my-admin-api-path'; +import { HttpClientModule } from '@angular/common/http'; import { environment } from '../environments/environment'; -@NgModule({ - declarations: [ - AppComponent - ], - imports: [ ], - providers: [{ provide: BASE_PATH, useValue: environment.API_BASE_PATH }], - bootstrap: [ AppComponent ] -}) -export class AppModule { } +export const appConfig: ApplicationConfig = { + providers: [ + // ... + provideHttpClient(), + provideUserApi(environment.basePath), + provideAdminApi(environment.basePath), + ], +}; ``` ### Customizing path parameter encoding @@ -219,6 +173,7 @@ pass an arrow-function or method-reference to the `encodeParam` property of the (see [General Usage](#general-usage) above). Example value for use in your Configuration-Provider: + ```typescript new Configuration({ encodeParam: (param: Param) => myFancyParamEncoder(param), diff --git a/devolutions-gateway/openapi/ts-angular-client/api.base.service.ts b/devolutions-gateway/openapi/ts-angular-client/api.base.service.ts new file mode 100644 index 000000000..6d9b16fb1 --- /dev/null +++ b/devolutions-gateway/openapi/ts-angular-client/api.base.service.ts @@ -0,0 +1,96 @@ +/** + * devolutions-gateway + * + * Contact: infos@devolutions.net + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { HttpHeaders, HttpParams, HttpParameterCodec } from '@angular/common/http'; +import { CustomHttpParameterCodec } from './encoder'; +import { Configuration } from './configuration'; +import { OpenApiHttpParams, QueryParamStyle, concatHttpParamsObject} from './query.params'; + +export class BaseService { + protected basePath = 'http://localhost'; + public defaultHeaders = new HttpHeaders(); + public configuration: Configuration; + public encoder: HttpParameterCodec; + + constructor(basePath?: string|string[], configuration?: Configuration) { + this.configuration = configuration || new Configuration(); + if (typeof this.configuration.basePath !== 'string') { + const firstBasePath = Array.isArray(basePath) ? basePath[0] : undefined; + if (firstBasePath != undefined) { + basePath = firstBasePath; + } + + if (typeof basePath !== 'string') { + basePath = this.basePath; + } + this.configuration.basePath = basePath; + } + this.encoder = this.configuration.encoder || new CustomHttpParameterCodec(); + } + + protected canConsumeForm(consumes: string[]): boolean { + return consumes.indexOf('multipart/form-data') !== -1; + } + + protected addToHttpParams(httpParams: OpenApiHttpParams, key: string, value: any | null | undefined, paramStyle: QueryParamStyle, explode: boolean): OpenApiHttpParams { + if (value === null || value === undefined) { + return httpParams; + } + + if (paramStyle === QueryParamStyle.DeepObject) { + if (typeof value !== 'object') { + throw Error(`An object must be provided for key ${key} as it is a deep object`); + } + + return Object.keys(value as Record).reduce( + (hp, k) => hp.append(`${key}[${k}]`, value[k]), + httpParams, + ); + } else if (paramStyle === QueryParamStyle.Json) { + return httpParams.append(key, JSON.stringify(value)); + } else { + // Form-style, SpaceDelimited or PipeDelimited + + if (Object(value) !== value) { + // If it is a primitive type, add its string representation + return httpParams.append(key, value.toString()); + } else if (value instanceof Date) { + return httpParams.append(key, value.toISOString()); + } else if (Array.isArray(value) || value instanceof Set) { + // Otherwise, if it's an array or set, add each element. + const array = Array.isArray(value) ? value : Array.from(value); + if (paramStyle === QueryParamStyle.Form) { + return httpParams.set(key, array, {explode: explode, delimiter: ','}); + } else if (paramStyle === QueryParamStyle.SpaceDelimited) { + return httpParams.set(key, array, {explode: explode, delimiter: ' '}); + } else { + // PipeDelimited + return httpParams.set(key, array, {explode: explode, delimiter: '|'}); + } + } else { + // Otherwise, if it's an object, add each field. + if (paramStyle === QueryParamStyle.Form) { + if (explode) { + Object.keys(value).forEach(k => { + httpParams = this.addToHttpParams(httpParams, k, value[k], paramStyle, explode); + }); + return httpParams; + } else { + return concatHttpParamsObject(httpParams, key, value, ','); + } + } else if (paramStyle === QueryParamStyle.SpaceDelimited) { + return concatHttpParamsObject(httpParams, key, value, ' '); + } else { + // PipeDelimited + return concatHttpParamsObject(httpParams, key, value, '|'); + } + } + } + } +} diff --git a/devolutions-gateway/openapi/ts-angular-client/api/config.service.ts b/devolutions-gateway/openapi/ts-angular-client/api/config.service.ts index f2586e77e..b1bf49039 100644 --- a/devolutions-gateway/openapi/ts-angular-client/api/config.service.ts +++ b/devolutions-gateway/openapi/ts-angular-client/api/config.service.ts @@ -11,10 +11,10 @@ import { Inject, Injectable, Optional } from '@angular/core'; import { HttpClient, HttpHeaders, HttpParams, - HttpResponse, HttpEvent, HttpParameterCodec, HttpContext + HttpResponse, HttpEvent, HttpContext } from '@angular/common/http'; -import { CustomHttpParameterCodec } from '../encoder'; import { Observable } from 'rxjs'; +import { OpenApiHttpParams, QueryParamStyle } from '../query.params'; // @ts-ignore import { ConfigPatch } from '../model/configPatch'; @@ -22,79 +22,26 @@ import { ConfigPatch } from '../model/configPatch'; // @ts-ignore import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; import { Configuration } from '../configuration'; +import { BaseService } from '../api.base.service'; @Injectable({ providedIn: 'root' }) -export class ConfigService { +export class ConfigService extends BaseService { - protected basePath = 'http://localhost'; - public defaultHeaders = new HttpHeaders(); - public configuration = new Configuration(); - public encoder: HttpParameterCodec; - - constructor(protected httpClient: HttpClient, @Optional()@Inject(BASE_PATH) basePath: string|string[], @Optional() configuration: Configuration) { - if (configuration) { - this.configuration = configuration; - } - if (typeof this.configuration.basePath !== 'string') { - const firstBasePath = Array.isArray(basePath) ? basePath[0] : undefined; - if (firstBasePath != undefined) { - basePath = firstBasePath; - } - - if (typeof basePath !== 'string') { - basePath = this.basePath; - } - this.configuration.basePath = basePath; - } - this.encoder = this.configuration.encoder || new CustomHttpParameterCodec(); - } - - - // @ts-ignore - private addToHttpParams(httpParams: HttpParams, value: any, key?: string): HttpParams { - if (typeof value === "object" && value instanceof Date === false) { - httpParams = this.addToHttpParamsRecursive(httpParams, value); - } else { - httpParams = this.addToHttpParamsRecursive(httpParams, value, key); - } - return httpParams; - } - - private addToHttpParamsRecursive(httpParams: HttpParams, value?: any, key?: string): HttpParams { - if (value == null) { - return httpParams; - } - - if (typeof value === "object") { - if (Array.isArray(value)) { - (value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); - } else if (value instanceof Date) { - if (key != null) { - httpParams = httpParams.append(key, (value as Date).toISOString().substring(0, 10)); - } else { - throw Error("key may not be null if value is Date"); - } - } else { - Object.keys(value).forEach( k => httpParams = this.addToHttpParamsRecursive( - httpParams, value[k], key != null ? `${key}.${k}` : k)); - } - } else if (key != null) { - httpParams = httpParams.append(key, value); - } else { - throw Error("key may not be null if value is not object or array"); - } - return httpParams; + constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) { + super(basePath, configuration); } /** * Modifies configuration + * @endpoint patch /jet/config * @param configPatch JSON-encoded configuration patch * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. + * @param options additional options */ public patchConfig(configPatch: ConfigPatch, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable; public patchConfig(configPatch: ConfigPatch, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable>; @@ -106,33 +53,18 @@ export class ConfigService { let localVarHeaders = this.defaultHeaders; - let localVarCredential: string | undefined; // authentication (scope_token) required - localVarCredential = this.configuration.lookupCredential('scope_token'); - if (localVarCredential) { - localVarHeaders = localVarHeaders.set('Authorization', 'Bearer ' + localVarCredential); - } + localVarHeaders = this.configuration.addCredentialToHeaders('scope_token', 'Authorization', localVarHeaders, 'Bearer '); - let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; - if (localVarHttpHeaderAcceptSelected === undefined) { - // to determine the Accept header - const httpHeaderAccepts: string[] = [ - ]; - localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); - } + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + ]); if (localVarHttpHeaderAcceptSelected !== undefined) { localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); } - let localVarHttpContext: HttpContext | undefined = options && options.context; - if (localVarHttpContext === undefined) { - localVarHttpContext = new HttpContext(); - } + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - let localVarTransferCache: boolean | undefined = options && options.transferCache; - if (localVarTransferCache === undefined) { - localVarTransferCache = true; - } + const localVarTransferCache: boolean = options?.transferCache ?? true; // to determine the Content-Type header @@ -156,15 +88,16 @@ export class ConfigService { } let localVarPath = `/jet/config`; - return this.httpClient.request('patch', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('patch', `${basePath}${localVarPath}`, { context: localVarHttpContext, body: configPatch, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, - transferCache: localVarTransferCache, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), reportProgress: reportProgress } ); diff --git a/devolutions-gateway/openapi/ts-angular-client/api/diagnostics.service.ts b/devolutions-gateway/openapi/ts-angular-client/api/diagnostics.service.ts index 72b1d8da3..8b861c151 100644 --- a/devolutions-gateway/openapi/ts-angular-client/api/diagnostics.service.ts +++ b/devolutions-gateway/openapi/ts-angular-client/api/diagnostics.service.ts @@ -11,10 +11,10 @@ import { Inject, Injectable, Optional } from '@angular/core'; import { HttpClient, HttpHeaders, HttpParams, - HttpResponse, HttpEvent, HttpParameterCodec, HttpContext + HttpResponse, HttpEvent, HttpContext } from '@angular/common/http'; -import { CustomHttpParameterCodec } from '../encoder'; import { Observable } from 'rxjs'; +import { OpenApiHttpParams, QueryParamStyle } from '../query.params'; // @ts-ignore import { ClockDiagnostic } from '../model/clockDiagnostic'; @@ -24,79 +24,26 @@ import { ConfigDiagnostic } from '../model/configDiagnostic'; // @ts-ignore import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; import { Configuration } from '../configuration'; +import { BaseService } from '../api.base.service'; @Injectable({ providedIn: 'root' }) -export class DiagnosticsService { +export class DiagnosticsService extends BaseService { - protected basePath = 'http://localhost'; - public defaultHeaders = new HttpHeaders(); - public configuration = new Configuration(); - public encoder: HttpParameterCodec; - - constructor(protected httpClient: HttpClient, @Optional()@Inject(BASE_PATH) basePath: string|string[], @Optional() configuration: Configuration) { - if (configuration) { - this.configuration = configuration; - } - if (typeof this.configuration.basePath !== 'string') { - const firstBasePath = Array.isArray(basePath) ? basePath[0] : undefined; - if (firstBasePath != undefined) { - basePath = firstBasePath; - } - - if (typeof basePath !== 'string') { - basePath = this.basePath; - } - this.configuration.basePath = basePath; - } - this.encoder = this.configuration.encoder || new CustomHttpParameterCodec(); - } - - - // @ts-ignore - private addToHttpParams(httpParams: HttpParams, value: any, key?: string): HttpParams { - if (typeof value === "object" && value instanceof Date === false) { - httpParams = this.addToHttpParamsRecursive(httpParams, value); - } else { - httpParams = this.addToHttpParamsRecursive(httpParams, value, key); - } - return httpParams; - } - - private addToHttpParamsRecursive(httpParams: HttpParams, value?: any, key?: string): HttpParams { - if (value == null) { - return httpParams; - } - - if (typeof value === "object") { - if (Array.isArray(value)) { - (value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); - } else if (value instanceof Date) { - if (key != null) { - httpParams = httpParams.append(key, (value as Date).toISOString().substring(0, 10)); - } else { - throw Error("key may not be null if value is Date"); - } - } else { - Object.keys(value).forEach( k => httpParams = this.addToHttpParamsRecursive( - httpParams, value[k], key != null ? `${key}.${k}` : k)); - } - } else if (key != null) { - httpParams = httpParams.append(key, value); - } else { - throw Error("key may not be null if value is not object or array"); - } - return httpParams; + constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) { + super(basePath, configuration); } /** * Retrieves server\'s clock in order to diagnose clock drifting. * This route is not secured by access token. Indeed, this route is used to retrieve server\'s clock when diagnosing clock drifting. If there is clock drift, token validation will fail because claims such as `nbf` will then be invalid, and thus prevent the clock drift diagnosis. + * @endpoint get /jet/diagnostics/clock * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. + * @param options additional options */ public getClockDiagnostic(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; public getClockDiagnostic(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; @@ -105,27 +52,16 @@ export class DiagnosticsService { let localVarHeaders = this.defaultHeaders; - let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; - if (localVarHttpHeaderAcceptSelected === undefined) { - // to determine the Accept header - const httpHeaderAccepts: string[] = [ - 'application/json' - ]; - localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); - } + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); if (localVarHttpHeaderAcceptSelected !== undefined) { localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); } - let localVarHttpContext: HttpContext | undefined = options && options.context; - if (localVarHttpContext === undefined) { - localVarHttpContext = new HttpContext(); - } + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - let localVarTransferCache: boolean | undefined = options && options.transferCache; - if (localVarTransferCache === undefined) { - localVarTransferCache = true; - } + const localVarTransferCache: boolean = options?.transferCache ?? true; let responseType_: 'text' | 'json' | 'blob' = 'json'; @@ -140,14 +76,15 @@ export class DiagnosticsService { } let localVarPath = `/jet/diagnostics/clock`; - return this.httpClient.request('get', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, - transferCache: localVarTransferCache, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), reportProgress: reportProgress } ); @@ -156,8 +93,10 @@ export class DiagnosticsService { /** * Retrieves a subset of the configuration, for diagnosis purposes. * This route primary function is to help with configuration diagnosis (e.g.: ID mismatch, hostname mismatch, outdated version). In addition, it may be used to retrieve the listener URLs. This information can be used to provide configuration auto-filling, in order to assist the end user. It must be noted that this route will never return the whole configuration file as-is, for security reasons. For an exhaustive list of returned keys, refer to the `ConfigDiagnostic` component definition. + * @endpoint get /jet/diagnostics/configuration * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. + * @param options additional options */ public getConfigurationDiagnostic(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; public getConfigurationDiagnostic(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; @@ -166,34 +105,19 @@ export class DiagnosticsService { let localVarHeaders = this.defaultHeaders; - let localVarCredential: string | undefined; // authentication (scope_token) required - localVarCredential = this.configuration.lookupCredential('scope_token'); - if (localVarCredential) { - localVarHeaders = localVarHeaders.set('Authorization', 'Bearer ' + localVarCredential); - } + localVarHeaders = this.configuration.addCredentialToHeaders('scope_token', 'Authorization', localVarHeaders, 'Bearer '); - let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; - if (localVarHttpHeaderAcceptSelected === undefined) { - // to determine the Accept header - const httpHeaderAccepts: string[] = [ - 'application/json' - ]; - localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); - } + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); if (localVarHttpHeaderAcceptSelected !== undefined) { localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); } - let localVarHttpContext: HttpContext | undefined = options && options.context; - if (localVarHttpContext === undefined) { - localVarHttpContext = new HttpContext(); - } + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - let localVarTransferCache: boolean | undefined = options && options.transferCache; - if (localVarTransferCache === undefined) { - localVarTransferCache = true; - } + const localVarTransferCache: boolean = options?.transferCache ?? true; let responseType_: 'text' | 'json' | 'blob' = 'json'; @@ -208,14 +132,15 @@ export class DiagnosticsService { } let localVarPath = `/jet/diagnostics/configuration`; - return this.httpClient.request('get', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, - transferCache: localVarTransferCache, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), reportProgress: reportProgress } ); @@ -223,8 +148,10 @@ export class DiagnosticsService { /** * Retrieves latest logs. + * @endpoint get /jet/diagnostics/logs * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. + * @param options additional options */ public getLogs(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'text/plain', context?: HttpContext, transferCache?: boolean}): Observable; public getLogs(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'text/plain', context?: HttpContext, transferCache?: boolean}): Observable>; @@ -233,34 +160,19 @@ export class DiagnosticsService { let localVarHeaders = this.defaultHeaders; - let localVarCredential: string | undefined; // authentication (scope_token) required - localVarCredential = this.configuration.lookupCredential('scope_token'); - if (localVarCredential) { - localVarHeaders = localVarHeaders.set('Authorization', 'Bearer ' + localVarCredential); - } + localVarHeaders = this.configuration.addCredentialToHeaders('scope_token', 'Authorization', localVarHeaders, 'Bearer '); - let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; - if (localVarHttpHeaderAcceptSelected === undefined) { - // to determine the Accept header - const httpHeaderAccepts: string[] = [ - 'text/plain' - ]; - localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); - } + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'text/plain' + ]); if (localVarHttpHeaderAcceptSelected !== undefined) { localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); } - let localVarHttpContext: HttpContext | undefined = options && options.context; - if (localVarHttpContext === undefined) { - localVarHttpContext = new HttpContext(); - } + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - let localVarTransferCache: boolean | undefined = options && options.transferCache; - if (localVarTransferCache === undefined) { - localVarTransferCache = true; - } + const localVarTransferCache: boolean = options?.transferCache ?? true; let responseType_: 'text' | 'json' | 'blob' = 'json'; @@ -275,14 +187,15 @@ export class DiagnosticsService { } let localVarPath = `/jet/diagnostics/logs`; - return this.httpClient.request('get', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, - transferCache: localVarTransferCache, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), reportProgress: reportProgress } ); diff --git a/devolutions-gateway/openapi/ts-angular-client/api/health.service.ts b/devolutions-gateway/openapi/ts-angular-client/api/health.service.ts index 7c6e1fef3..b0e0be271 100644 --- a/devolutions-gateway/openapi/ts-angular-client/api/health.service.ts +++ b/devolutions-gateway/openapi/ts-angular-client/api/health.service.ts @@ -11,10 +11,10 @@ import { Inject, Injectable, Optional } from '@angular/core'; import { HttpClient, HttpHeaders, HttpParams, - HttpResponse, HttpEvent, HttpParameterCodec, HttpContext + HttpResponse, HttpEvent, HttpContext } from '@angular/common/http'; -import { CustomHttpParameterCodec } from '../encoder'; import { Observable } from 'rxjs'; +import { OpenApiHttpParams, QueryParamStyle } from '../query.params'; // @ts-ignore import { Identity } from '../model/identity'; @@ -22,78 +22,25 @@ import { Identity } from '../model/identity'; // @ts-ignore import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; import { Configuration } from '../configuration'; +import { BaseService } from '../api.base.service'; @Injectable({ providedIn: 'root' }) -export class HealthService { +export class HealthService extends BaseService { - protected basePath = 'http://localhost'; - public defaultHeaders = new HttpHeaders(); - public configuration = new Configuration(); - public encoder: HttpParameterCodec; - - constructor(protected httpClient: HttpClient, @Optional()@Inject(BASE_PATH) basePath: string|string[], @Optional() configuration: Configuration) { - if (configuration) { - this.configuration = configuration; - } - if (typeof this.configuration.basePath !== 'string') { - const firstBasePath = Array.isArray(basePath) ? basePath[0] : undefined; - if (firstBasePath != undefined) { - basePath = firstBasePath; - } - - if (typeof basePath !== 'string') { - basePath = this.basePath; - } - this.configuration.basePath = basePath; - } - this.encoder = this.configuration.encoder || new CustomHttpParameterCodec(); - } - - - // @ts-ignore - private addToHttpParams(httpParams: HttpParams, value: any, key?: string): HttpParams { - if (typeof value === "object" && value instanceof Date === false) { - httpParams = this.addToHttpParamsRecursive(httpParams, value); - } else { - httpParams = this.addToHttpParamsRecursive(httpParams, value, key); - } - return httpParams; - } - - private addToHttpParamsRecursive(httpParams: HttpParams, value?: any, key?: string): HttpParams { - if (value == null) { - return httpParams; - } - - if (typeof value === "object") { - if (Array.isArray(value)) { - (value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); - } else if (value instanceof Date) { - if (key != null) { - httpParams = httpParams.append(key, (value as Date).toISOString().substring(0, 10)); - } else { - throw Error("key may not be null if value is Date"); - } - } else { - Object.keys(value).forEach( k => httpParams = this.addToHttpParamsRecursive( - httpParams, value[k], key != null ? `${key}.${k}` : k)); - } - } else if (key != null) { - httpParams = httpParams.append(key, value); - } else { - throw Error("key may not be null if value is not object or array"); - } - return httpParams; + constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) { + super(basePath, configuration); } /** * Performs a health check + * @endpoint get /jet/health * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. + * @param options additional options */ public getHealth(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; public getHealth(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; @@ -102,27 +49,16 @@ export class HealthService { let localVarHeaders = this.defaultHeaders; - let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; - if (localVarHttpHeaderAcceptSelected === undefined) { - // to determine the Accept header - const httpHeaderAccepts: string[] = [ - 'application/json' - ]; - localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); - } + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); if (localVarHttpHeaderAcceptSelected !== undefined) { localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); } - let localVarHttpContext: HttpContext | undefined = options && options.context; - if (localVarHttpContext === undefined) { - localVarHttpContext = new HttpContext(); - } + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - let localVarTransferCache: boolean | undefined = options && options.transferCache; - if (localVarTransferCache === undefined) { - localVarTransferCache = true; - } + const localVarTransferCache: boolean = options?.transferCache ?? true; let responseType_: 'text' | 'json' | 'blob' = 'json'; @@ -137,14 +73,15 @@ export class HealthService { } let localVarPath = `/jet/health`; - return this.httpClient.request('get', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, - transferCache: localVarTransferCache, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), reportProgress: reportProgress } ); diff --git a/devolutions-gateway/openapi/ts-angular-client/api/heartbeat.service.ts b/devolutions-gateway/openapi/ts-angular-client/api/heartbeat.service.ts index 26040f863..8bf31cc95 100644 --- a/devolutions-gateway/openapi/ts-angular-client/api/heartbeat.service.ts +++ b/devolutions-gateway/openapi/ts-angular-client/api/heartbeat.service.ts @@ -11,10 +11,10 @@ import { Inject, Injectable, Optional } from '@angular/core'; import { HttpClient, HttpHeaders, HttpParams, - HttpResponse, HttpEvent, HttpParameterCodec, HttpContext + HttpResponse, HttpEvent, HttpContext } from '@angular/common/http'; -import { CustomHttpParameterCodec } from '../encoder'; import { Observable } from 'rxjs'; +import { OpenApiHttpParams, QueryParamStyle } from '../query.params'; // @ts-ignore import { Heartbeat } from '../model/heartbeat'; @@ -22,78 +22,25 @@ import { Heartbeat } from '../model/heartbeat'; // @ts-ignore import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; import { Configuration } from '../configuration'; +import { BaseService } from '../api.base.service'; @Injectable({ providedIn: 'root' }) -export class HeartbeatService { +export class HeartbeatService extends BaseService { - protected basePath = 'http://localhost'; - public defaultHeaders = new HttpHeaders(); - public configuration = new Configuration(); - public encoder: HttpParameterCodec; - - constructor(protected httpClient: HttpClient, @Optional()@Inject(BASE_PATH) basePath: string|string[], @Optional() configuration: Configuration) { - if (configuration) { - this.configuration = configuration; - } - if (typeof this.configuration.basePath !== 'string') { - const firstBasePath = Array.isArray(basePath) ? basePath[0] : undefined; - if (firstBasePath != undefined) { - basePath = firstBasePath; - } - - if (typeof basePath !== 'string') { - basePath = this.basePath; - } - this.configuration.basePath = basePath; - } - this.encoder = this.configuration.encoder || new CustomHttpParameterCodec(); - } - - - // @ts-ignore - private addToHttpParams(httpParams: HttpParams, value: any, key?: string): HttpParams { - if (typeof value === "object" && value instanceof Date === false) { - httpParams = this.addToHttpParamsRecursive(httpParams, value); - } else { - httpParams = this.addToHttpParamsRecursive(httpParams, value, key); - } - return httpParams; - } - - private addToHttpParamsRecursive(httpParams: HttpParams, value?: any, key?: string): HttpParams { - if (value == null) { - return httpParams; - } - - if (typeof value === "object") { - if (Array.isArray(value)) { - (value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); - } else if (value instanceof Date) { - if (key != null) { - httpParams = httpParams.append(key, (value as Date).toISOString().substring(0, 10)); - } else { - throw Error("key may not be null if value is Date"); - } - } else { - Object.keys(value).forEach( k => httpParams = this.addToHttpParamsRecursive( - httpParams, value[k], key != null ? `${key}.${k}` : k)); - } - } else if (key != null) { - httpParams = httpParams.append(key, value); - } else { - throw Error("key may not be null if value is not object or array"); - } - return httpParams; + constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) { + super(basePath, configuration); } /** * Performs a heartbeat check + * @endpoint get /jet/heartbeat * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. + * @param options additional options */ public getHeartbeat(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; public getHeartbeat(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; @@ -102,34 +49,19 @@ export class HeartbeatService { let localVarHeaders = this.defaultHeaders; - let localVarCredential: string | undefined; // authentication (scope_token) required - localVarCredential = this.configuration.lookupCredential('scope_token'); - if (localVarCredential) { - localVarHeaders = localVarHeaders.set('Authorization', 'Bearer ' + localVarCredential); - } + localVarHeaders = this.configuration.addCredentialToHeaders('scope_token', 'Authorization', localVarHeaders, 'Bearer '); - let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; - if (localVarHttpHeaderAcceptSelected === undefined) { - // to determine the Accept header - const httpHeaderAccepts: string[] = [ - 'application/json' - ]; - localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); - } + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); if (localVarHttpHeaderAcceptSelected !== undefined) { localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); } - let localVarHttpContext: HttpContext | undefined = options && options.context; - if (localVarHttpContext === undefined) { - localVarHttpContext = new HttpContext(); - } + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - let localVarTransferCache: boolean | undefined = options && options.transferCache; - if (localVarTransferCache === undefined) { - localVarTransferCache = true; - } + const localVarTransferCache: boolean = options?.transferCache ?? true; let responseType_: 'text' | 'json' | 'blob' = 'json'; @@ -144,14 +76,15 @@ export class HeartbeatService { } let localVarPath = `/jet/heartbeat`; - return this.httpClient.request('get', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, - transferCache: localVarTransferCache, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), reportProgress: reportProgress } ); diff --git a/devolutions-gateway/openapi/ts-angular-client/api/jrec.service.ts b/devolutions-gateway/openapi/ts-angular-client/api/jrec.service.ts index 208f6898b..877ef330b 100644 --- a/devolutions-gateway/openapi/ts-angular-client/api/jrec.service.ts +++ b/devolutions-gateway/openapi/ts-angular-client/api/jrec.service.ts @@ -11,10 +11,10 @@ import { Inject, Injectable, Optional } from '@angular/core'; import { HttpClient, HttpHeaders, HttpParams, - HttpResponse, HttpEvent, HttpParameterCodec, HttpContext + HttpResponse, HttpEvent, HttpContext } from '@angular/common/http'; -import { CustomHttpParameterCodec } from '../encoder'; import { Observable } from 'rxjs'; +import { OpenApiHttpParams, QueryParamStyle } from '../query.params'; // @ts-ignore import { DeleteManyResult } from '../model/deleteManyResult'; @@ -22,80 +22,27 @@ import { DeleteManyResult } from '../model/deleteManyResult'; // @ts-ignore import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; import { Configuration } from '../configuration'; +import { BaseService } from '../api.base.service'; @Injectable({ providedIn: 'root' }) -export class JrecService { +export class JrecService extends BaseService { - protected basePath = 'http://localhost'; - public defaultHeaders = new HttpHeaders(); - public configuration = new Configuration(); - public encoder: HttpParameterCodec; - - constructor(protected httpClient: HttpClient, @Optional()@Inject(BASE_PATH) basePath: string|string[], @Optional() configuration: Configuration) { - if (configuration) { - this.configuration = configuration; - } - if (typeof this.configuration.basePath !== 'string') { - const firstBasePath = Array.isArray(basePath) ? basePath[0] : undefined; - if (firstBasePath != undefined) { - basePath = firstBasePath; - } - - if (typeof basePath !== 'string') { - basePath = this.basePath; - } - this.configuration.basePath = basePath; - } - this.encoder = this.configuration.encoder || new CustomHttpParameterCodec(); - } - - - // @ts-ignore - private addToHttpParams(httpParams: HttpParams, value: any, key?: string): HttpParams { - if (typeof value === "object" && value instanceof Date === false) { - httpParams = this.addToHttpParamsRecursive(httpParams, value); - } else { - httpParams = this.addToHttpParamsRecursive(httpParams, value, key); - } - return httpParams; - } - - private addToHttpParamsRecursive(httpParams: HttpParams, value?: any, key?: string): HttpParams { - if (value == null) { - return httpParams; - } - - if (typeof value === "object") { - if (Array.isArray(value)) { - (value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); - } else if (value instanceof Date) { - if (key != null) { - httpParams = httpParams.append(key, (value as Date).toISOString().substring(0, 10)); - } else { - throw Error("key may not be null if value is Date"); - } - } else { - Object.keys(value).forEach( k => httpParams = this.addToHttpParamsRecursive( - httpParams, value[k], key != null ? `${key}.${k}` : k)); - } - } else if (key != null) { - httpParams = httpParams.append(key, value); - } else { - throw Error("key may not be null if value is not object or array"); - } - return httpParams; + constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) { + super(basePath, configuration); } /** * Mass-deletes recordings stored on this instance * If you try to delete more than 50,000 recordings at once, you should split the list into multiple requests. Bigger payloads will be rejected with 413 Payload Too Large. The request processing consist in 1) checking if one of the recording is active, 2) counting the number of recordings not found on this instance. When a recording is not found on this instance, a counter is incremented. This number is returned as part of the response. You may use this information to detect anomalies on your side. For instance, this suggests the list of recordings on your side is out of date, and you may want re-index. + * @endpoint delete /jet/jrec/delete * @param requestBody JSON-encoded list of session IDs * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. + * @param options additional options */ public deleteManyRecordings(requestBody: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; public deleteManyRecordings(requestBody: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; @@ -107,34 +54,19 @@ export class JrecService { let localVarHeaders = this.defaultHeaders; - let localVarCredential: string | undefined; // authentication (scope_token) required - localVarCredential = this.configuration.lookupCredential('scope_token'); - if (localVarCredential) { - localVarHeaders = localVarHeaders.set('Authorization', 'Bearer ' + localVarCredential); - } + localVarHeaders = this.configuration.addCredentialToHeaders('scope_token', 'Authorization', localVarHeaders, 'Bearer '); - let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; - if (localVarHttpHeaderAcceptSelected === undefined) { - // to determine the Accept header - const httpHeaderAccepts: string[] = [ - 'application/json' - ]; - localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); - } + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); if (localVarHttpHeaderAcceptSelected !== undefined) { localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); } - let localVarHttpContext: HttpContext | undefined = options && options.context; - if (localVarHttpContext === undefined) { - localVarHttpContext = new HttpContext(); - } + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - let localVarTransferCache: boolean | undefined = options && options.transferCache; - if (localVarTransferCache === undefined) { - localVarTransferCache = true; - } + const localVarTransferCache: boolean = options?.transferCache ?? true; // to determine the Content-Type header @@ -158,15 +90,16 @@ export class JrecService { } let localVarPath = `/jet/jrec/delete`; - return this.httpClient.request('delete', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('delete', `${basePath}${localVarPath}`, { context: localVarHttpContext, body: requestBody, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, - transferCache: localVarTransferCache, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), reportProgress: reportProgress } ); @@ -174,9 +107,11 @@ export class JrecService { /** * Deletes a recording stored on this instance + * @endpoint delete /jet/jrec/delete/{id} * @param id Recorded session ID * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. + * @param options additional options */ public deleteRecording(id: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable; public deleteRecording(id: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable>; @@ -188,33 +123,18 @@ export class JrecService { let localVarHeaders = this.defaultHeaders; - let localVarCredential: string | undefined; // authentication (scope_token) required - localVarCredential = this.configuration.lookupCredential('scope_token'); - if (localVarCredential) { - localVarHeaders = localVarHeaders.set('Authorization', 'Bearer ' + localVarCredential); - } + localVarHeaders = this.configuration.addCredentialToHeaders('scope_token', 'Authorization', localVarHeaders, 'Bearer '); - let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; - if (localVarHttpHeaderAcceptSelected === undefined) { - // to determine the Accept header - const httpHeaderAccepts: string[] = [ - ]; - localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); - } + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + ]); if (localVarHttpHeaderAcceptSelected !== undefined) { localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); } - let localVarHttpContext: HttpContext | undefined = options && options.context; - if (localVarHttpContext === undefined) { - localVarHttpContext = new HttpContext(); - } + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - let localVarTransferCache: boolean | undefined = options && options.transferCache; - if (localVarTransferCache === undefined) { - localVarTransferCache = true; - } + const localVarTransferCache: boolean = options?.transferCache ?? true; let responseType_: 'text' | 'json' | 'blob' = 'json'; @@ -229,14 +149,15 @@ export class JrecService { } let localVarPath = `/jet/jrec/delete/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: "uuid"})}`; - return this.httpClient.request('delete', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('delete', `${basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, - transferCache: localVarTransferCache, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), reportProgress: reportProgress } ); @@ -244,9 +165,11 @@ export class JrecService { /** * Lists all recordings stored on this instance + * @endpoint get /jet/jrec/list * @param active When true, only the active recordings are returned * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. + * @param options additional options */ public listRecordings(active: boolean, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; public listRecordings(active: boolean, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>>; @@ -256,42 +179,32 @@ export class JrecService { throw new Error('Required parameter active was null or undefined when calling listRecordings.'); } - let localVarQueryParameters = new HttpParams({encoder: this.encoder}); - if (active !== undefined && active !== null) { - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - active, 'active'); - } + let localVarQueryParameters = new OpenApiHttpParams(this.encoder); + + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + 'active', + active, + QueryParamStyle.Form, + true, + ); + let localVarHeaders = this.defaultHeaders; - let localVarCredential: string | undefined; // authentication (scope_token) required - localVarCredential = this.configuration.lookupCredential('scope_token'); - if (localVarCredential) { - localVarHeaders = localVarHeaders.set('Authorization', 'Bearer ' + localVarCredential); - } + localVarHeaders = this.configuration.addCredentialToHeaders('scope_token', 'Authorization', localVarHeaders, 'Bearer '); - let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; - if (localVarHttpHeaderAcceptSelected === undefined) { - // to determine the Accept header - const httpHeaderAccepts: string[] = [ - 'application/json' - ]; - localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); - } + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); if (localVarHttpHeaderAcceptSelected !== undefined) { localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); } - let localVarHttpContext: HttpContext | undefined = options && options.context; - if (localVarHttpContext === undefined) { - localVarHttpContext = new HttpContext(); - } + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - let localVarTransferCache: boolean | undefined = options && options.transferCache; - if (localVarTransferCache === undefined) { - localVarTransferCache = true; - } + const localVarTransferCache: boolean = options?.transferCache ?? true; let responseType_: 'text' | 'json' | 'blob' = 'json'; @@ -306,15 +219,16 @@ export class JrecService { } let localVarPath = `/jet/jrec/list`; - return this.httpClient.request>('get', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request>('get', `${basePath}${localVarPath}`, { context: localVarHttpContext, - params: localVarQueryParameters, + params: localVarQueryParameters.toHttpParams(), responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, - transferCache: localVarTransferCache, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), reportProgress: reportProgress } ); @@ -322,10 +236,12 @@ export class JrecService { /** * Retrieves a recording file for a given session + * @endpoint get /jet/jrec/pull/{id}/{filename} * @param id Recorded session ID * @param filename Name of recording file to retrieve * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. + * @param options additional options */ public pullRecordingFile(id: string, filename: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/octet-stream', context?: HttpContext, transferCache?: boolean}): Observable; public pullRecordingFile(id: string, filename: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/octet-stream', context?: HttpContext, transferCache?: boolean}): Observable>; @@ -340,45 +256,31 @@ export class JrecService { let localVarHeaders = this.defaultHeaders; - let localVarCredential: string | undefined; // authentication (jrec_token) required - localVarCredential = this.configuration.lookupCredential('jrec_token'); - if (localVarCredential) { - localVarHeaders = localVarHeaders.set('Authorization', 'Bearer ' + localVarCredential); - } + localVarHeaders = this.configuration.addCredentialToHeaders('jrec_token', 'Authorization', localVarHeaders, 'Bearer '); - let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; - if (localVarHttpHeaderAcceptSelected === undefined) { - // to determine the Accept header - const httpHeaderAccepts: string[] = [ - 'application/octet-stream' - ]; - localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); - } + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/octet-stream' + ]); if (localVarHttpHeaderAcceptSelected !== undefined) { localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); } - let localVarHttpContext: HttpContext | undefined = options && options.context; - if (localVarHttpContext === undefined) { - localVarHttpContext = new HttpContext(); - } + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - let localVarTransferCache: boolean | undefined = options && options.transferCache; - if (localVarTransferCache === undefined) { - localVarTransferCache = true; - } + const localVarTransferCache: boolean = options?.transferCache ?? true; let localVarPath = `/jet/jrec/pull/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: "uuid"})}/${this.configuration.encodeParam({name: "filename", value: filename, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`; - return this.httpClient.request('get', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, { context: localVarHttpContext, responseType: "blob", - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, - transferCache: localVarTransferCache, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), reportProgress: reportProgress } ); diff --git a/devolutions-gateway/openapi/ts-angular-client/api/jrl.service.ts b/devolutions-gateway/openapi/ts-angular-client/api/jrl.service.ts index 4063f75ae..c056de71d 100644 --- a/devolutions-gateway/openapi/ts-angular-client/api/jrl.service.ts +++ b/devolutions-gateway/openapi/ts-angular-client/api/jrl.service.ts @@ -11,10 +11,10 @@ import { Inject, Injectable, Optional } from '@angular/core'; import { HttpClient, HttpHeaders, HttpParams, - HttpResponse, HttpEvent, HttpParameterCodec, HttpContext + HttpResponse, HttpEvent, HttpContext } from '@angular/common/http'; -import { CustomHttpParameterCodec } from '../encoder'; import { Observable } from 'rxjs'; +import { OpenApiHttpParams, QueryParamStyle } from '../query.params'; // @ts-ignore import { JrlInfo } from '../model/jrlInfo'; @@ -22,78 +22,25 @@ import { JrlInfo } from '../model/jrlInfo'; // @ts-ignore import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; import { Configuration } from '../configuration'; +import { BaseService } from '../api.base.service'; @Injectable({ providedIn: 'root' }) -export class JrlService { +export class JrlService extends BaseService { - protected basePath = 'http://localhost'; - public defaultHeaders = new HttpHeaders(); - public configuration = new Configuration(); - public encoder: HttpParameterCodec; - - constructor(protected httpClient: HttpClient, @Optional()@Inject(BASE_PATH) basePath: string|string[], @Optional() configuration: Configuration) { - if (configuration) { - this.configuration = configuration; - } - if (typeof this.configuration.basePath !== 'string') { - const firstBasePath = Array.isArray(basePath) ? basePath[0] : undefined; - if (firstBasePath != undefined) { - basePath = firstBasePath; - } - - if (typeof basePath !== 'string') { - basePath = this.basePath; - } - this.configuration.basePath = basePath; - } - this.encoder = this.configuration.encoder || new CustomHttpParameterCodec(); - } - - - // @ts-ignore - private addToHttpParams(httpParams: HttpParams, value: any, key?: string): HttpParams { - if (typeof value === "object" && value instanceof Date === false) { - httpParams = this.addToHttpParamsRecursive(httpParams, value); - } else { - httpParams = this.addToHttpParamsRecursive(httpParams, value, key); - } - return httpParams; - } - - private addToHttpParamsRecursive(httpParams: HttpParams, value?: any, key?: string): HttpParams { - if (value == null) { - return httpParams; - } - - if (typeof value === "object") { - if (Array.isArray(value)) { - (value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); - } else if (value instanceof Date) { - if (key != null) { - httpParams = httpParams.append(key, (value as Date).toISOString().substring(0, 10)); - } else { - throw Error("key may not be null if value is Date"); - } - } else { - Object.keys(value).forEach( k => httpParams = this.addToHttpParamsRecursive( - httpParams, value[k], key != null ? `${key}.${k}` : k)); - } - } else if (key != null) { - httpParams = httpParams.append(key, value); - } else { - throw Error("key may not be null if value is not object or array"); - } - return httpParams; + constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) { + super(basePath, configuration); } /** * Retrieves current JRL (Json Revocation List) info + * @endpoint get /jet/jrl/info * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. + * @param options additional options */ public getJrlInfo(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; public getJrlInfo(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; @@ -102,34 +49,19 @@ export class JrlService { let localVarHeaders = this.defaultHeaders; - let localVarCredential: string | undefined; // authentication (scope_token) required - localVarCredential = this.configuration.lookupCredential('scope_token'); - if (localVarCredential) { - localVarHeaders = localVarHeaders.set('Authorization', 'Bearer ' + localVarCredential); - } + localVarHeaders = this.configuration.addCredentialToHeaders('scope_token', 'Authorization', localVarHeaders, 'Bearer '); - let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; - if (localVarHttpHeaderAcceptSelected === undefined) { - // to determine the Accept header - const httpHeaderAccepts: string[] = [ - 'application/json' - ]; - localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); - } + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); if (localVarHttpHeaderAcceptSelected !== undefined) { localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); } - let localVarHttpContext: HttpContext | undefined = options && options.context; - if (localVarHttpContext === undefined) { - localVarHttpContext = new HttpContext(); - } + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - let localVarTransferCache: boolean | undefined = options && options.transferCache; - if (localVarTransferCache === undefined) { - localVarTransferCache = true; - } + const localVarTransferCache: boolean = options?.transferCache ?? true; let responseType_: 'text' | 'json' | 'blob' = 'json'; @@ -144,14 +76,15 @@ export class JrlService { } let localVarPath = `/jet/jrl/info`; - return this.httpClient.request('get', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, - transferCache: localVarTransferCache, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), reportProgress: reportProgress } ); @@ -159,8 +92,10 @@ export class JrlService { /** * Updates JRL (Json Revocation List) using a JRL token + * @endpoint post /jet/jrl * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. + * @param options additional options */ public updateJrl(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable; public updateJrl(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable>; @@ -169,33 +104,18 @@ export class JrlService { let localVarHeaders = this.defaultHeaders; - let localVarCredential: string | undefined; // authentication (jrl_token) required - localVarCredential = this.configuration.lookupCredential('jrl_token'); - if (localVarCredential) { - localVarHeaders = localVarHeaders.set('Authorization', 'Bearer ' + localVarCredential); - } + localVarHeaders = this.configuration.addCredentialToHeaders('jrl_token', 'Authorization', localVarHeaders, 'Bearer '); - let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; - if (localVarHttpHeaderAcceptSelected === undefined) { - // to determine the Accept header - const httpHeaderAccepts: string[] = [ - ]; - localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); - } + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + ]); if (localVarHttpHeaderAcceptSelected !== undefined) { localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); } - let localVarHttpContext: HttpContext | undefined = options && options.context; - if (localVarHttpContext === undefined) { - localVarHttpContext = new HttpContext(); - } + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - let localVarTransferCache: boolean | undefined = options && options.transferCache; - if (localVarTransferCache === undefined) { - localVarTransferCache = true; - } + const localVarTransferCache: boolean = options?.transferCache ?? true; let responseType_: 'text' | 'json' | 'blob' = 'json'; @@ -210,14 +130,15 @@ export class JrlService { } let localVarPath = `/jet/jrl`; - return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('post', `${basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, - transferCache: localVarTransferCache, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), reportProgress: reportProgress } ); diff --git a/devolutions-gateway/openapi/ts-angular-client/api/net.service.ts b/devolutions-gateway/openapi/ts-angular-client/api/net.service.ts index a4d2e8b7e..549885486 100644 --- a/devolutions-gateway/openapi/ts-angular-client/api/net.service.ts +++ b/devolutions-gateway/openapi/ts-angular-client/api/net.service.ts @@ -11,125 +11,491 @@ import { Inject, Injectable, Optional } from '@angular/core'; import { HttpClient, HttpHeaders, HttpParams, - HttpResponse, HttpEvent, HttpParameterCodec, HttpContext + HttpResponse, HttpEvent, HttpContext } from '@angular/common/http'; -import { CustomHttpParameterCodec } from '../encoder'; import { Observable } from 'rxjs'; +import { OpenApiHttpParams, QueryParamStyle } from '../query.params'; // @ts-ignore import { InterfaceInfo } from '../model/interfaceInfo'; +// @ts-ignore +import { NetworkInterfacesResponse } from '../model/networkInterfacesResponse'; // @ts-ignore import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; import { Configuration } from '../configuration'; +import { BaseService } from '../api.base.service'; @Injectable({ providedIn: 'root' }) -export class NetService { +export class NetService extends BaseService { + + constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) { + super(basePath, configuration); + } - protected basePath = 'http://localhost'; - public defaultHeaders = new HttpHeaders(); - public configuration = new Configuration(); - public encoder: HttpParameterCodec; + /** + * Lists network interfaces + * @endpoint get /jet/net/config + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + * @param options additional options + */ + public getNetConfig(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; }>>; + public getNetConfig(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; }>>>; + public getNetConfig(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; }>>>; + public getNetConfig(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - constructor(protected httpClient: HttpClient, @Optional()@Inject(BASE_PATH) basePath: string|string[], @Optional() configuration: Configuration) { - if (configuration) { - this.configuration = configuration; + let localVarHeaders = this.defaultHeaders; + + // authentication (netscan_token) required + localVarHeaders = this.configuration.addCredentialToHeaders('netscan_token', 'Authorization', localVarHeaders, 'Bearer '); + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); } - if (typeof this.configuration.basePath !== 'string') { - const firstBasePath = Array.isArray(basePath) ? basePath[0] : undefined; - if (firstBasePath != undefined) { - basePath = firstBasePath; - } - if (typeof basePath !== 'string') { - basePath = this.basePath; + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; } - this.configuration.basePath = basePath; } - this.encoder = this.configuration.encoder || new CustomHttpParameterCodec(); + + let localVarPath = `/jet/net/config`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request; }>>('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); } + /** + * Lists Gateway network scan sources. + * @endpoint get /jet/net/interfaces + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + * @param options additional options + */ + public getNetInterfaces(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public getNetInterfaces(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getNetInterfaces(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getNetInterfaces(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - // @ts-ignore - private addToHttpParams(httpParams: HttpParams, value: any, key?: string): HttpParams { - if (typeof value === "object" && value instanceof Date === false) { - httpParams = this.addToHttpParamsRecursive(httpParams, value); - } else { - httpParams = this.addToHttpParamsRecursive(httpParams, value, key); - } - return httpParams; - } + let localVarHeaders = this.defaultHeaders; + + // authentication (netscan_token) required + localVarHeaders = this.configuration.addCredentialToHeaders('netscan_token', 'Authorization', localVarHeaders, 'Bearer '); - private addToHttpParamsRecursive(httpParams: HttpParams, value?: any, key?: string): HttpParams { - if (value == null) { - return httpParams; + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); } - if (typeof value === "object") { - if (Array.isArray(value)) { - (value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); - } else if (value instanceof Date) { - if (key != null) { - httpParams = httpParams.append(key, (value as Date).toISOString().substring(0, 10)); - } else { - throw Error("key may not be null if value is Date"); - } + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; } else { - Object.keys(value).forEach( k => httpParams = this.addToHttpParamsRecursive( - httpParams, value[k], key != null ? `${key}.${k}` : k)); + responseType_ = 'blob'; } - } else if (key != null) { - httpParams = httpParams.append(key, value); - } else { - throw Error("key may not be null if value is not object or array"); } - return httpParams; + + let localVarPath = `/jet/net/interfaces`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); } /** - * Lists network interfaces + * Stream network scan events over a websocket. + * The endpoint is upgraded from HTTP, so OpenAPI describes the **handshake**: the query parameters that drive the scan (validated before upgrade) and the legacy / v1 event payloads streamed back as JSON text frames. See `NetworkScanResultEvent` for the v1 shape and `LegacyScanEvent` for the legacy shape (selected via `response_format`). + * @endpoint get /jet/net/scan + * @param pingInterval Interval in milliseconds (default is 200) + * @param pingTimeout Timeout in milliseconds (default is 500) + * @param broadcastTimeout Timeout in milliseconds (default is 1000) + * @param portScanTimeout Timeout in milliseconds (default is 1000) + * @param netbiosTimeout Timeout in milliseconds (default is 1000) + * @param netbiosInterval Interval in milliseconds (default is 200) + * @param mdnsQueryTimeout The maximum time for each mdns query in milliseconds. (default is 5 * 1000) + * @param maxWait The maximum duration for whole networking scan in milliseconds. Highly suggested! + * @param range The start and end IP address of the range to scan. for example: 10.10.0.0-10.10.0.255 + * @param target Explicit single-host targets to scan. Each value must parse as an IPv4 or IPv6 address; invalid values yield a structured `{ error: \"invalid_target\", value: \"<raw>\" }` 400 rather than a generic serde rejection at extraction time (mirrors the `range=` / `probe=` validation path). + * @param interfaceId Gateway network interface IDs to use as scan sources. + * @param probe The probes to run. Each value is either `ping`, a port number (`22`), or a named service (`rdp`, `https`, ΓǪ). Validation is deferred to scan-time so failures can be surfaced as a structured 400 ΓÇö naming the offending value ΓÇö instead of a generic serde rejection at extraction time. + * @param enablePingStart **Legacy alias** for `report_ping_start`. Prefer the explicit name in new clients; kept so existing consumers don\'t break. + * @param enableBroadcast Enable the execution of broadcast scan + * @param enableSubnetScan Enable the ping scan on subnet + * @param enableZeroconf Enable ZeroConf/mDNS + * @param enableNetbios Enable NetBIOS name-service queries. Default `true` for backward compatibility. Set `false` (or pair with explicit `target=`) to keep NetBIOS from sweeping the surrounding subnet when the caller only wants results for the targets they listed. + * @param enableResolveDns Enable resolve dns + * @param includeHostResults Include host-only results. + * @param reportPingStart Emit ping queued/start host results. + * @param reportPingSuccess Emit ping success host results. + * @param reportPingFailure Emit ping failure host results. + * @param enableTcpProbes Enable TCP service probes. + * @param rangeInterfacePolicy Policy applied when `range=` and `interface_id=` are both provided. Accepted values: `intersect_selected_interfaces` (default) or `allow_cross_interface_range`. Invalid values yield a structured `{ error: \"invalid_range_interface_policy\", value: \"<raw>\" }` 400 instead of a generic serde rejection (mirrors the `range=` / `probe=` / `target=` validation path). + * @param allowCrossInterfaceRange **Legacy alias** for `range_interface_policy=allow_cross_interface_range`. Prefer the structured policy in new clients. + * @param responseFormat Response shape emitted on the websocket. Accepted values: `legacy` (default) or `network_scan_result_v1`. Invalid values yield a structured `{ error: \"invalid_response_format\", value: \"<raw>\" }` 400 instead of a generic serde rejection. + * @param maxConcurrency Maximum scanner concurrency. + * @param maxPingConcurrency Maximum ping probe concurrency. + * @param maxTcpProbeConcurrency Maximum TCP probe concurrency. + * @param enableFailure **Legacy alias** for `report_ping_failure`. `enable_failure=true` only opts into ping-failure events; TCP-probe failure events require the explicit `report_tcp_failure=true` and are not affected by this alias. **Behavior change:** historically this single flag controlled both ping-failure and TCP-probe-failure reporting. The two are now split: clients that want the old \"both at once\" semantics must send `enable_failure=true&report_tcp_failure=true` together. The split is intentional ΓÇö TCP-probe failures are typically high-volume noise that callers were filtering client-side anyway, so the two streams are independently gated. + * @param reportTcpFailure Enable TCP port knocking failure events. + * @param interfaceBindStrict When `true`, fail with HTTP 400 if a ping/TCP-probe socket cannot be bound to the planner-selected interface. Default `false` (warn and fall back to default routing). * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. + * @param options additional options */ - public getNetConfig(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; }>>; - public getNetConfig(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; }>>>; - public getNetConfig(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; }>>>; - public getNetConfig(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + public getNetScan(pingInterval?: number, pingTimeout?: number, broadcastTimeout?: number, portScanTimeout?: number, netbiosTimeout?: number, netbiosInterval?: number, mdnsQueryTimeout?: number, maxWait?: number, range?: Array, target?: Array, interfaceId?: Array, probe?: Array, enablePingStart?: boolean, enableBroadcast?: boolean, enableSubnetScan?: boolean, enableZeroconf?: boolean, enableNetbios?: boolean, enableResolveDns?: boolean, includeHostResults?: boolean, reportPingStart?: boolean, reportPingSuccess?: boolean, reportPingFailure?: boolean, enableTcpProbes?: boolean, rangeInterfacePolicy?: string, allowCrossInterfaceRange?: boolean, responseFormat?: string, maxConcurrency?: number, maxPingConcurrency?: number, maxTcpProbeConcurrency?: number, enableFailure?: boolean, reportTcpFailure?: boolean, interfaceBindStrict?: boolean, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable; + public getNetScan(pingInterval?: number, pingTimeout?: number, broadcastTimeout?: number, portScanTimeout?: number, netbiosTimeout?: number, netbiosInterval?: number, mdnsQueryTimeout?: number, maxWait?: number, range?: Array, target?: Array, interfaceId?: Array, probe?: Array, enablePingStart?: boolean, enableBroadcast?: boolean, enableSubnetScan?: boolean, enableZeroconf?: boolean, enableNetbios?: boolean, enableResolveDns?: boolean, includeHostResults?: boolean, reportPingStart?: boolean, reportPingSuccess?: boolean, reportPingFailure?: boolean, enableTcpProbes?: boolean, rangeInterfacePolicy?: string, allowCrossInterfaceRange?: boolean, responseFormat?: string, maxConcurrency?: number, maxPingConcurrency?: number, maxTcpProbeConcurrency?: number, enableFailure?: boolean, reportTcpFailure?: boolean, interfaceBindStrict?: boolean, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable>; + public getNetScan(pingInterval?: number, pingTimeout?: number, broadcastTimeout?: number, portScanTimeout?: number, netbiosTimeout?: number, netbiosInterval?: number, mdnsQueryTimeout?: number, maxWait?: number, range?: Array, target?: Array, interfaceId?: Array, probe?: Array, enablePingStart?: boolean, enableBroadcast?: boolean, enableSubnetScan?: boolean, enableZeroconf?: boolean, enableNetbios?: boolean, enableResolveDns?: boolean, includeHostResults?: boolean, reportPingStart?: boolean, reportPingSuccess?: boolean, reportPingFailure?: boolean, enableTcpProbes?: boolean, rangeInterfacePolicy?: string, allowCrossInterfaceRange?: boolean, responseFormat?: string, maxConcurrency?: number, maxPingConcurrency?: number, maxTcpProbeConcurrency?: number, enableFailure?: boolean, reportTcpFailure?: boolean, interfaceBindStrict?: boolean, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable>; + public getNetScan(pingInterval?: number, pingTimeout?: number, broadcastTimeout?: number, portScanTimeout?: number, netbiosTimeout?: number, netbiosInterval?: number, mdnsQueryTimeout?: number, maxWait?: number, range?: Array, target?: Array, interfaceId?: Array, probe?: Array, enablePingStart?: boolean, enableBroadcast?: boolean, enableSubnetScan?: boolean, enableZeroconf?: boolean, enableNetbios?: boolean, enableResolveDns?: boolean, includeHostResults?: boolean, reportPingStart?: boolean, reportPingSuccess?: boolean, reportPingFailure?: boolean, enableTcpProbes?: boolean, rangeInterfacePolicy?: string, allowCrossInterfaceRange?: boolean, responseFormat?: string, maxConcurrency?: number, maxPingConcurrency?: number, maxTcpProbeConcurrency?: number, enableFailure?: boolean, reportTcpFailure?: boolean, interfaceBindStrict?: boolean, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable { + + let localVarQueryParameters = new OpenApiHttpParams(this.encoder); + + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + 'ping_interval', + pingInterval, + QueryParamStyle.Form, + true, + ); + + + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + 'ping_timeout', + pingTimeout, + QueryParamStyle.Form, + true, + ); + + + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + 'broadcast_timeout', + broadcastTimeout, + QueryParamStyle.Form, + true, + ); + + + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + 'port_scan_timeout', + portScanTimeout, + QueryParamStyle.Form, + true, + ); + + + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + 'netbios_timeout', + netbiosTimeout, + QueryParamStyle.Form, + true, + ); + + + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + 'netbios_interval', + netbiosInterval, + QueryParamStyle.Form, + true, + ); + + + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + 'mdns_query_timeout', + mdnsQueryTimeout, + QueryParamStyle.Form, + true, + ); + + + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + 'max_wait', + maxWait, + QueryParamStyle.Form, + true, + ); + + + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + 'range', + range, + QueryParamStyle.Form, + true, + ); + + + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + 'target', + target, + QueryParamStyle.Form, + true, + ); + + + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + 'interface_id', + interfaceId, + QueryParamStyle.Form, + true, + ); + + + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + 'probe', + probe, + QueryParamStyle.Form, + true, + ); + + + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + 'enable_ping_start', + enablePingStart, + QueryParamStyle.Form, + true, + ); + + + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + 'enable_broadcast', + enableBroadcast, + QueryParamStyle.Form, + true, + ); + + + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + 'enable_subnet_scan', + enableSubnetScan, + QueryParamStyle.Form, + true, + ); + + + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + 'enable_zeroconf', + enableZeroconf, + QueryParamStyle.Form, + true, + ); + + + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + 'enable_netbios', + enableNetbios, + QueryParamStyle.Form, + true, + ); + + + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + 'enable_resolve_dns', + enableResolveDns, + QueryParamStyle.Form, + true, + ); + + + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + 'include_host_results', + includeHostResults, + QueryParamStyle.Form, + true, + ); + + + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + 'report_ping_start', + reportPingStart, + QueryParamStyle.Form, + true, + ); + + + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + 'report_ping_success', + reportPingSuccess, + QueryParamStyle.Form, + true, + ); + + + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + 'report_ping_failure', + reportPingFailure, + QueryParamStyle.Form, + true, + ); + + + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + 'enable_tcp_probes', + enableTcpProbes, + QueryParamStyle.Form, + true, + ); + + + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + 'range_interface_policy', + rangeInterfacePolicy, + QueryParamStyle.Form, + true, + ); + + + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + 'allow_cross_interface_range', + allowCrossInterfaceRange, + QueryParamStyle.Form, + true, + ); + + + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + 'response_format', + responseFormat, + QueryParamStyle.Form, + true, + ); + + + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + 'max_concurrency', + maxConcurrency, + QueryParamStyle.Form, + true, + ); + + + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + 'max_ping_concurrency', + maxPingConcurrency, + QueryParamStyle.Form, + true, + ); + + + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + 'max_tcp_probe_concurrency', + maxTcpProbeConcurrency, + QueryParamStyle.Form, + true, + ); + + + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + 'enable_failure', + enableFailure, + QueryParamStyle.Form, + true, + ); + + + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + 'report_tcp_failure', + reportTcpFailure, + QueryParamStyle.Form, + true, + ); + + + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + 'interface_bind_strict', + interfaceBindStrict, + QueryParamStyle.Form, + true, + ); + let localVarHeaders = this.defaultHeaders; - let localVarCredential: string | undefined; // authentication (netscan_token) required - localVarCredential = this.configuration.lookupCredential('netscan_token'); - if (localVarCredential) { - localVarHeaders = localVarHeaders.set('Authorization', 'Bearer ' + localVarCredential); - } + localVarHeaders = this.configuration.addCredentialToHeaders('netscan_token', 'Authorization', localVarHeaders, 'Bearer '); - let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; - if (localVarHttpHeaderAcceptSelected === undefined) { - // to determine the Accept header - const httpHeaderAccepts: string[] = [ - 'application/json' - ]; - localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); - } + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + ]); if (localVarHttpHeaderAcceptSelected !== undefined) { localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); } - let localVarHttpContext: HttpContext | undefined = options && options.context; - if (localVarHttpContext === undefined) { - localVarHttpContext = new HttpContext(); - } + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - let localVarTransferCache: boolean | undefined = options && options.transferCache; - if (localVarTransferCache === undefined) { - localVarTransferCache = true; - } + const localVarTransferCache: boolean = options?.transferCache ?? true; let responseType_: 'text' | 'json' | 'blob' = 'json'; @@ -143,15 +509,17 @@ export class NetService { } } - let localVarPath = `/jet/net/config`; - return this.httpClient.request; }>>('get', `${this.configuration.basePath}${localVarPath}`, + let localVarPath = `/jet/net/scan`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, { context: localVarHttpContext, + params: localVarQueryParameters.toHttpParams(), responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, - transferCache: localVarTransferCache, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), reportProgress: reportProgress } ); diff --git a/devolutions-gateway/openapi/ts-angular-client/api/networkMonitoring.service.ts b/devolutions-gateway/openapi/ts-angular-client/api/networkMonitoring.service.ts index 1bfa71085..254431739 100644 --- a/devolutions-gateway/openapi/ts-angular-client/api/networkMonitoring.service.ts +++ b/devolutions-gateway/openapi/ts-angular-client/api/networkMonitoring.service.ts @@ -11,10 +11,10 @@ import { Inject, Injectable, Optional } from '@angular/core'; import { HttpClient, HttpHeaders, HttpParams, - HttpResponse, HttpEvent, HttpParameterCodec, HttpContext + HttpResponse, HttpEvent, HttpContext } from '@angular/common/http'; -import { CustomHttpParameterCodec } from '../encoder'; import { Observable } from 'rxjs'; +import { OpenApiHttpParams, QueryParamStyle } from '../query.params'; // @ts-ignore import { MonitoringLogResponse } from '../model/monitoringLogResponse'; @@ -26,79 +26,26 @@ import { SetConfigResponse } from '../model/setConfigResponse'; // @ts-ignore import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; import { Configuration } from '../configuration'; +import { BaseService } from '../api.base.service'; @Injectable({ providedIn: 'root' }) -export class NetworkMonitoringService { +export class NetworkMonitoringService extends BaseService { - protected basePath = 'http://localhost'; - public defaultHeaders = new HttpHeaders(); - public configuration = new Configuration(); - public encoder: HttpParameterCodec; - - constructor(protected httpClient: HttpClient, @Optional()@Inject(BASE_PATH) basePath: string|string[], @Optional() configuration: Configuration) { - if (configuration) { - this.configuration = configuration; - } - if (typeof this.configuration.basePath !== 'string') { - const firstBasePath = Array.isArray(basePath) ? basePath[0] : undefined; - if (firstBasePath != undefined) { - basePath = firstBasePath; - } - - if (typeof basePath !== 'string') { - basePath = this.basePath; - } - this.configuration.basePath = basePath; - } - this.encoder = this.configuration.encoder || new CustomHttpParameterCodec(); - } - - - // @ts-ignore - private addToHttpParams(httpParams: HttpParams, value: any, key?: string): HttpParams { - if (typeof value === "object" && value instanceof Date === false) { - httpParams = this.addToHttpParamsRecursive(httpParams, value); - } else { - httpParams = this.addToHttpParamsRecursive(httpParams, value, key); - } - return httpParams; - } - - private addToHttpParamsRecursive(httpParams: HttpParams, value?: any, key?: string): HttpParams { - if (value == null) { - return httpParams; - } - - if (typeof value === "object") { - if (Array.isArray(value)) { - (value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); - } else if (value instanceof Date) { - if (key != null) { - httpParams = httpParams.append(key, (value as Date).toISOString().substring(0, 10)); - } else { - throw Error("key may not be null if value is Date"); - } - } else { - Object.keys(value).forEach( k => httpParams = this.addToHttpParamsRecursive( - httpParams, value[k], key != null ? `${key}.${k}` : k)); - } - } else if (key != null) { - httpParams = httpParams.append(key, value); - } else { - throw Error("key may not be null if value is not object or array"); - } - return httpParams; + constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) { + super(basePath, configuration); } /** * Monitors store their results in a temporary log, which is returned here. * Once the log is downloaded, gateway purges it from memory. + * @endpoint post /jet/net/monitor/log/drain * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. + * @param options additional options */ public drainMonitoringLog(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; public drainMonitoringLog(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; @@ -107,34 +54,19 @@ export class NetworkMonitoringService { let localVarHeaders = this.defaultHeaders; - let localVarCredential: string | undefined; // authentication (scope_token) required - localVarCredential = this.configuration.lookupCredential('scope_token'); - if (localVarCredential) { - localVarHeaders = localVarHeaders.set('Authorization', 'Bearer ' + localVarCredential); - } + localVarHeaders = this.configuration.addCredentialToHeaders('scope_token', 'Authorization', localVarHeaders, 'Bearer '); - let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; - if (localVarHttpHeaderAcceptSelected === undefined) { - // to determine the Accept header - const httpHeaderAccepts: string[] = [ - 'application/json' - ]; - localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); - } + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); if (localVarHttpHeaderAcceptSelected !== undefined) { localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); } - let localVarHttpContext: HttpContext | undefined = options && options.context; - if (localVarHttpContext === undefined) { - localVarHttpContext = new HttpContext(); - } + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - let localVarTransferCache: boolean | undefined = options && options.transferCache; - if (localVarTransferCache === undefined) { - localVarTransferCache = true; - } + const localVarTransferCache: boolean = options?.transferCache ?? true; let responseType_: 'text' | 'json' | 'blob' = 'json'; @@ -149,14 +81,15 @@ export class NetworkMonitoringService { } let localVarPath = `/jet/net/monitor/log/drain`; - return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('post', `${basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, - transferCache: localVarTransferCache, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), reportProgress: reportProgress } ); @@ -165,9 +98,11 @@ export class NetworkMonitoringService { /** * Replace the current monitoring configuration with the configuration in the request body. * Changes take effect immediately: - Starts any monitors newly defined in the payload. - Stops any currently running monitors that are omitted from the payload. A 200 status code is returned even if some or all of the probes in the configuration are not understood. The response body will in this case contain a list of probes that were unsupported or invalid. Note: The configuration is not persisted across process restarts. + * @endpoint post /jet/net/monitor/config * @param monitorsConfig JSON object containing a list of monitors * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. + * @param options additional options */ public setMonitoringConfig(monitorsConfig: MonitorsConfig, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; public setMonitoringConfig(monitorsConfig: MonitorsConfig, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; @@ -179,34 +114,19 @@ export class NetworkMonitoringService { let localVarHeaders = this.defaultHeaders; - let localVarCredential: string | undefined; // authentication (scope_token) required - localVarCredential = this.configuration.lookupCredential('scope_token'); - if (localVarCredential) { - localVarHeaders = localVarHeaders.set('Authorization', 'Bearer ' + localVarCredential); - } + localVarHeaders = this.configuration.addCredentialToHeaders('scope_token', 'Authorization', localVarHeaders, 'Bearer '); - let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; - if (localVarHttpHeaderAcceptSelected === undefined) { - // to determine the Accept header - const httpHeaderAccepts: string[] = [ - 'application/json' - ]; - localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); - } + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); if (localVarHttpHeaderAcceptSelected !== undefined) { localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); } - let localVarHttpContext: HttpContext | undefined = options && options.context; - if (localVarHttpContext === undefined) { - localVarHttpContext = new HttpContext(); - } + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - let localVarTransferCache: boolean | undefined = options && options.transferCache; - if (localVarTransferCache === undefined) { - localVarTransferCache = true; - } + const localVarTransferCache: boolean = options?.transferCache ?? true; // to determine the Content-Type header @@ -230,15 +150,16 @@ export class NetworkMonitoringService { } let localVarPath = `/jet/net/monitor/config`; - return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('post', `${basePath}${localVarPath}`, { context: localVarHttpContext, body: monitorsConfig, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, - transferCache: localVarTransferCache, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), reportProgress: reportProgress } ); diff --git a/devolutions-gateway/openapi/ts-angular-client/api/preflight.service.ts b/devolutions-gateway/openapi/ts-angular-client/api/preflight.service.ts index d49f63b20..50fe35530 100644 --- a/devolutions-gateway/openapi/ts-angular-client/api/preflight.service.ts +++ b/devolutions-gateway/openapi/ts-angular-client/api/preflight.service.ts @@ -11,10 +11,10 @@ import { Inject, Injectable, Optional } from '@angular/core'; import { HttpClient, HttpHeaders, HttpParams, - HttpResponse, HttpEvent, HttpParameterCodec, HttpContext + HttpResponse, HttpEvent, HttpContext } from '@angular/common/http'; -import { CustomHttpParameterCodec } from '../encoder'; import { Observable } from 'rxjs'; +import { OpenApiHttpParams, QueryParamStyle } from '../query.params'; // @ts-ignore import { PreflightOperation } from '../model/preflightOperation'; @@ -24,79 +24,26 @@ import { PreflightOutput } from '../model/preflightOutput'; // @ts-ignore import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; import { Configuration } from '../configuration'; +import { BaseService } from '../api.base.service'; @Injectable({ providedIn: 'root' }) -export class PreflightService { +export class PreflightService extends BaseService { - protected basePath = 'http://localhost'; - public defaultHeaders = new HttpHeaders(); - public configuration = new Configuration(); - public encoder: HttpParameterCodec; - - constructor(protected httpClient: HttpClient, @Optional()@Inject(BASE_PATH) basePath: string|string[], @Optional() configuration: Configuration) { - if (configuration) { - this.configuration = configuration; - } - if (typeof this.configuration.basePath !== 'string') { - const firstBasePath = Array.isArray(basePath) ? basePath[0] : undefined; - if (firstBasePath != undefined) { - basePath = firstBasePath; - } - - if (typeof basePath !== 'string') { - basePath = this.basePath; - } - this.configuration.basePath = basePath; - } - this.encoder = this.configuration.encoder || new CustomHttpParameterCodec(); - } - - - // @ts-ignore - private addToHttpParams(httpParams: HttpParams, value: any, key?: string): HttpParams { - if (typeof value === "object" && value instanceof Date === false) { - httpParams = this.addToHttpParamsRecursive(httpParams, value); - } else { - httpParams = this.addToHttpParamsRecursive(httpParams, value, key); - } - return httpParams; - } - - private addToHttpParamsRecursive(httpParams: HttpParams, value?: any, key?: string): HttpParams { - if (value == null) { - return httpParams; - } - - if (typeof value === "object") { - if (Array.isArray(value)) { - (value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); - } else if (value instanceof Date) { - if (key != null) { - httpParams = httpParams.append(key, (value as Date).toISOString().substring(0, 10)); - } else { - throw Error("key may not be null if value is Date"); - } - } else { - Object.keys(value).forEach( k => httpParams = this.addToHttpParamsRecursive( - httpParams, value[k], key != null ? `${key}.${k}` : k)); - } - } else if (key != null) { - httpParams = httpParams.append(key, value); - } else { - throw Error("key may not be null if value is not object or array"); - } - return httpParams; + constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) { + super(basePath, configuration); } /** * Performs a batch of preflight operations + * @endpoint post /jet/preflight * @param preflightOperation * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. + * @param options additional options */ public postPreflight(preflightOperation: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; public postPreflight(preflightOperation: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>>; @@ -108,34 +55,19 @@ export class PreflightService { let localVarHeaders = this.defaultHeaders; - let localVarCredential: string | undefined; // authentication (scope_token) required - localVarCredential = this.configuration.lookupCredential('scope_token'); - if (localVarCredential) { - localVarHeaders = localVarHeaders.set('Authorization', 'Bearer ' + localVarCredential); - } + localVarHeaders = this.configuration.addCredentialToHeaders('scope_token', 'Authorization', localVarHeaders, 'Bearer '); - let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; - if (localVarHttpHeaderAcceptSelected === undefined) { - // to determine the Accept header - const httpHeaderAccepts: string[] = [ - 'application/json' - ]; - localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); - } + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); if (localVarHttpHeaderAcceptSelected !== undefined) { localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); } - let localVarHttpContext: HttpContext | undefined = options && options.context; - if (localVarHttpContext === undefined) { - localVarHttpContext = new HttpContext(); - } + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - let localVarTransferCache: boolean | undefined = options && options.transferCache; - if (localVarTransferCache === undefined) { - localVarTransferCache = true; - } + const localVarTransferCache: boolean = options?.transferCache ?? true; // to determine the Content-Type header @@ -159,15 +91,16 @@ export class PreflightService { } let localVarPath = `/jet/preflight`; - return this.httpClient.request>('post', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request>('post', `${basePath}${localVarPath}`, { context: localVarHttpContext, body: preflightOperation, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, - transferCache: localVarTransferCache, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), reportProgress: reportProgress } ); diff --git a/devolutions-gateway/openapi/ts-angular-client/api/sessions.service.ts b/devolutions-gateway/openapi/ts-angular-client/api/sessions.service.ts index 4c2b60cc4..670940cef 100644 --- a/devolutions-gateway/openapi/ts-angular-client/api/sessions.service.ts +++ b/devolutions-gateway/openapi/ts-angular-client/api/sessions.service.ts @@ -11,10 +11,10 @@ import { Inject, Injectable, Optional } from '@angular/core'; import { HttpClient, HttpHeaders, HttpParams, - HttpResponse, HttpEvent, HttpParameterCodec, HttpContext + HttpResponse, HttpEvent, HttpContext } from '@angular/common/http'; -import { CustomHttpParameterCodec } from '../encoder'; import { Observable } from 'rxjs'; +import { OpenApiHttpParams, QueryParamStyle } from '../query.params'; // @ts-ignore import { SessionInfo } from '../model/sessionInfo'; @@ -22,78 +22,25 @@ import { SessionInfo } from '../model/sessionInfo'; // @ts-ignore import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; import { Configuration } from '../configuration'; +import { BaseService } from '../api.base.service'; @Injectable({ providedIn: 'root' }) -export class SessionsService { +export class SessionsService extends BaseService { - protected basePath = 'http://localhost'; - public defaultHeaders = new HttpHeaders(); - public configuration = new Configuration(); - public encoder: HttpParameterCodec; - - constructor(protected httpClient: HttpClient, @Optional()@Inject(BASE_PATH) basePath: string|string[], @Optional() configuration: Configuration) { - if (configuration) { - this.configuration = configuration; - } - if (typeof this.configuration.basePath !== 'string') { - const firstBasePath = Array.isArray(basePath) ? basePath[0] : undefined; - if (firstBasePath != undefined) { - basePath = firstBasePath; - } - - if (typeof basePath !== 'string') { - basePath = this.basePath; - } - this.configuration.basePath = basePath; - } - this.encoder = this.configuration.encoder || new CustomHttpParameterCodec(); - } - - - // @ts-ignore - private addToHttpParams(httpParams: HttpParams, value: any, key?: string): HttpParams { - if (typeof value === "object" && value instanceof Date === false) { - httpParams = this.addToHttpParamsRecursive(httpParams, value); - } else { - httpParams = this.addToHttpParamsRecursive(httpParams, value, key); - } - return httpParams; - } - - private addToHttpParamsRecursive(httpParams: HttpParams, value?: any, key?: string): HttpParams { - if (value == null) { - return httpParams; - } - - if (typeof value === "object") { - if (Array.isArray(value)) { - (value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); - } else if (value instanceof Date) { - if (key != null) { - httpParams = httpParams.append(key, (value as Date).toISOString().substring(0, 10)); - } else { - throw Error("key may not be null if value is Date"); - } - } else { - Object.keys(value).forEach( k => httpParams = this.addToHttpParamsRecursive( - httpParams, value[k], key != null ? `${key}.${k}` : k)); - } - } else if (key != null) { - httpParams = httpParams.append(key, value); - } else { - throw Error("key may not be null if value is not object or array"); - } - return httpParams; + constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) { + super(basePath, configuration); } /** * Lists running sessions + * @endpoint get /jet/sessions * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. + * @param options additional options */ public getSessions(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; public getSessions(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>>; @@ -102,34 +49,19 @@ export class SessionsService { let localVarHeaders = this.defaultHeaders; - let localVarCredential: string | undefined; // authentication (scope_token) required - localVarCredential = this.configuration.lookupCredential('scope_token'); - if (localVarCredential) { - localVarHeaders = localVarHeaders.set('Authorization', 'Bearer ' + localVarCredential); - } + localVarHeaders = this.configuration.addCredentialToHeaders('scope_token', 'Authorization', localVarHeaders, 'Bearer '); - let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; - if (localVarHttpHeaderAcceptSelected === undefined) { - // to determine the Accept header - const httpHeaderAccepts: string[] = [ - 'application/json' - ]; - localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); - } + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); if (localVarHttpHeaderAcceptSelected !== undefined) { localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); } - let localVarHttpContext: HttpContext | undefined = options && options.context; - if (localVarHttpContext === undefined) { - localVarHttpContext = new HttpContext(); - } + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - let localVarTransferCache: boolean | undefined = options && options.transferCache; - if (localVarTransferCache === undefined) { - localVarTransferCache = true; - } + const localVarTransferCache: boolean = options?.transferCache ?? true; let responseType_: 'text' | 'json' | 'blob' = 'json'; @@ -144,14 +76,15 @@ export class SessionsService { } let localVarPath = `/jet/sessions`; - return this.httpClient.request>('get', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request>('get', `${basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, - transferCache: localVarTransferCache, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), reportProgress: reportProgress } ); @@ -159,9 +92,11 @@ export class SessionsService { /** * Terminate forcefully a running session + * @endpoint post /jet/session/{id}/terminate * @param id Session / association ID of the session to terminate * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. + * @param options additional options */ public terminateSession(id: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable; public terminateSession(id: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable>; @@ -173,33 +108,18 @@ export class SessionsService { let localVarHeaders = this.defaultHeaders; - let localVarCredential: string | undefined; // authentication (scope_token) required - localVarCredential = this.configuration.lookupCredential('scope_token'); - if (localVarCredential) { - localVarHeaders = localVarHeaders.set('Authorization', 'Bearer ' + localVarCredential); - } + localVarHeaders = this.configuration.addCredentialToHeaders('scope_token', 'Authorization', localVarHeaders, 'Bearer '); - let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; - if (localVarHttpHeaderAcceptSelected === undefined) { - // to determine the Accept header - const httpHeaderAccepts: string[] = [ - ]; - localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); - } + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + ]); if (localVarHttpHeaderAcceptSelected !== undefined) { localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); } - let localVarHttpContext: HttpContext | undefined = options && options.context; - if (localVarHttpContext === undefined) { - localVarHttpContext = new HttpContext(); - } + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - let localVarTransferCache: boolean | undefined = options && options.transferCache; - if (localVarTransferCache === undefined) { - localVarTransferCache = true; - } + const localVarTransferCache: boolean = options?.transferCache ?? true; let responseType_: 'text' | 'json' | 'blob' = 'json'; @@ -214,14 +134,15 @@ export class SessionsService { } let localVarPath = `/jet/session/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: "uuid"})}/terminate`; - return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('post', `${basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, - transferCache: localVarTransferCache, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), reportProgress: reportProgress } ); diff --git a/devolutions-gateway/openapi/ts-angular-client/api/traffic.service.ts b/devolutions-gateway/openapi/ts-angular-client/api/traffic.service.ts index 981f61315..926b3b122 100644 --- a/devolutions-gateway/openapi/ts-angular-client/api/traffic.service.ts +++ b/devolutions-gateway/openapi/ts-angular-client/api/traffic.service.ts @@ -11,10 +11,10 @@ import { Inject, Injectable, Optional } from '@angular/core'; import { HttpClient, HttpHeaders, HttpParams, - HttpResponse, HttpEvent, HttpParameterCodec, HttpContext + HttpResponse, HttpEvent, HttpContext } from '@angular/common/http'; -import { CustomHttpParameterCodec } from '../encoder'; import { Observable } from 'rxjs'; +import { OpenApiHttpParams, QueryParamStyle } from '../query.params'; // @ts-ignore import { AckRequest } from '../model/ackRequest'; @@ -26,79 +26,26 @@ import { ClaimedTrafficEvent } from '../model/claimedTrafficEvent'; // @ts-ignore import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; import { Configuration } from '../configuration'; +import { BaseService } from '../api.base.service'; @Injectable({ providedIn: 'root' }) -export class TrafficService { +export class TrafficService extends BaseService { - protected basePath = 'http://localhost'; - public defaultHeaders = new HttpHeaders(); - public configuration = new Configuration(); - public encoder: HttpParameterCodec; - - constructor(protected httpClient: HttpClient, @Optional()@Inject(BASE_PATH) basePath: string|string[], @Optional() configuration: Configuration) { - if (configuration) { - this.configuration = configuration; - } - if (typeof this.configuration.basePath !== 'string') { - const firstBasePath = Array.isArray(basePath) ? basePath[0] : undefined; - if (firstBasePath != undefined) { - basePath = firstBasePath; - } - - if (typeof basePath !== 'string') { - basePath = this.basePath; - } - this.configuration.basePath = basePath; - } - this.encoder = this.configuration.encoder || new CustomHttpParameterCodec(); - } - - - // @ts-ignore - private addToHttpParams(httpParams: HttpParams, value: any, key?: string): HttpParams { - if (typeof value === "object" && value instanceof Date === false) { - httpParams = this.addToHttpParamsRecursive(httpParams, value); - } else { - httpParams = this.addToHttpParamsRecursive(httpParams, value, key); - } - return httpParams; - } - - private addToHttpParamsRecursive(httpParams: HttpParams, value?: any, key?: string): HttpParams { - if (value == null) { - return httpParams; - } - - if (typeof value === "object") { - if (Array.isArray(value)) { - (value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); - } else if (value instanceof Date) { - if (key != null) { - httpParams = httpParams.append(key, (value as Date).toISOString().substring(0, 10)); - } else { - throw Error("key may not be null if value is Date"); - } - } else { - Object.keys(value).forEach( k => httpParams = this.addToHttpParamsRecursive( - httpParams, value[k], key != null ? `${key}.${k}` : k)); - } - } else if (key != null) { - httpParams = httpParams.append(key, value); - } else { - throw Error("key may not be null if value is not object or array"); - } - return httpParams; + constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) { + super(basePath, configuration); } /** * Acknowledge traffic audit events and remove them from the queue + * @endpoint post /jet/traffic/ack * @param ackRequest Array of event IDs to acknowledge * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. + * @param options additional options */ public ackTrafficEvents(ackRequest: AckRequest, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; public ackTrafficEvents(ackRequest: AckRequest, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; @@ -110,34 +57,19 @@ export class TrafficService { let localVarHeaders = this.defaultHeaders; - let localVarCredential: string | undefined; // authentication (scope_token) required - localVarCredential = this.configuration.lookupCredential('scope_token'); - if (localVarCredential) { - localVarHeaders = localVarHeaders.set('Authorization', 'Bearer ' + localVarCredential); - } + localVarHeaders = this.configuration.addCredentialToHeaders('scope_token', 'Authorization', localVarHeaders, 'Bearer '); - let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; - if (localVarHttpHeaderAcceptSelected === undefined) { - // to determine the Accept header - const httpHeaderAccepts: string[] = [ - 'application/json' - ]; - localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); - } + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); if (localVarHttpHeaderAcceptSelected !== undefined) { localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); } - let localVarHttpContext: HttpContext | undefined = options && options.context; - if (localVarHttpContext === undefined) { - localVarHttpContext = new HttpContext(); - } + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - let localVarTransferCache: boolean | undefined = options && options.transferCache; - if (localVarTransferCache === undefined) { - localVarTransferCache = true; - } + const localVarTransferCache: boolean = options?.transferCache ?? true; // to determine the Content-Type header @@ -161,15 +93,16 @@ export class TrafficService { } let localVarPath = `/jet/traffic/ack`; - return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('post', `${basePath}${localVarPath}`, { context: localVarHttpContext, body: ackRequest, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, - transferCache: localVarTransferCache, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), reportProgress: reportProgress } ); @@ -177,10 +110,12 @@ export class TrafficService { /** * Claim traffic audit events for processing + * @endpoint post /jet/traffic/claim * @param leaseMs Lease duration in milliseconds (1000-3600000, default: 300000 = 5 minutes) * @param max Maximum number of events to claim (1-1000, default: 100) * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. + * @param options additional options */ public claimTrafficEvents(leaseMs: number, max: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; public claimTrafficEvents(leaseMs: number, max: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>>; @@ -193,46 +128,41 @@ export class TrafficService { throw new Error('Required parameter max was null or undefined when calling claimTrafficEvents.'); } - let localVarQueryParameters = new HttpParams({encoder: this.encoder}); - if (leaseMs !== undefined && leaseMs !== null) { - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - leaseMs, 'lease_ms'); - } - if (max !== undefined && max !== null) { - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - max, 'max'); - } + let localVarQueryParameters = new OpenApiHttpParams(this.encoder); + + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + 'lease_ms', + leaseMs, + QueryParamStyle.Form, + true, + ); + + + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + 'max', + max, + QueryParamStyle.Form, + true, + ); + let localVarHeaders = this.defaultHeaders; - let localVarCredential: string | undefined; // authentication (scope_token) required - localVarCredential = this.configuration.lookupCredential('scope_token'); - if (localVarCredential) { - localVarHeaders = localVarHeaders.set('Authorization', 'Bearer ' + localVarCredential); - } + localVarHeaders = this.configuration.addCredentialToHeaders('scope_token', 'Authorization', localVarHeaders, 'Bearer '); - let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; - if (localVarHttpHeaderAcceptSelected === undefined) { - // to determine the Accept header - const httpHeaderAccepts: string[] = [ - 'application/json' - ]; - localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); - } + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); if (localVarHttpHeaderAcceptSelected !== undefined) { localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); } - let localVarHttpContext: HttpContext | undefined = options && options.context; - if (localVarHttpContext === undefined) { - localVarHttpContext = new HttpContext(); - } + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - let localVarTransferCache: boolean | undefined = options && options.transferCache; - if (localVarTransferCache === undefined) { - localVarTransferCache = true; - } + const localVarTransferCache: boolean = options?.transferCache ?? true; let responseType_: 'text' | 'json' | 'blob' = 'json'; @@ -247,15 +177,16 @@ export class TrafficService { } let localVarPath = `/jet/traffic/claim`; - return this.httpClient.request>('post', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request>('post', `${basePath}${localVarPath}`, { context: localVarHttpContext, - params: localVarQueryParameters, + params: localVarQueryParameters.toHttpParams(), responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, - transferCache: localVarTransferCache, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), reportProgress: reportProgress } ); diff --git a/devolutions-gateway/openapi/ts-angular-client/api/update.service.ts b/devolutions-gateway/openapi/ts-angular-client/api/update.service.ts index 996357fd7..79d6040b8 100644 --- a/devolutions-gateway/openapi/ts-angular-client/api/update.service.ts +++ b/devolutions-gateway/openapi/ts-angular-client/api/update.service.ts @@ -11,135 +11,269 @@ import { Inject, Injectable, Optional } from '@angular/core'; import { HttpClient, HttpHeaders, HttpParams, - HttpResponse, HttpEvent, HttpParameterCodec, HttpContext + HttpResponse, HttpEvent, HttpContext } from '@angular/common/http'; -import { CustomHttpParameterCodec } from '../encoder'; import { Observable } from 'rxjs'; +import { OpenApiHttpParams, QueryParamStyle } from '../query.params'; +// @ts-ignore +import { GetUpdateProductsResponse } from '../model/getUpdateProductsResponse'; +// @ts-ignore +import { GetUpdateScheduleResponse } from '../model/getUpdateScheduleResponse'; +// @ts-ignore +import { SetUpdateScheduleRequest } from '../model/setUpdateScheduleRequest'; +// @ts-ignore +import { UpdateRequestSchema } from '../model/updateRequestSchema'; // @ts-ignore import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; import { Configuration } from '../configuration'; +import { BaseService } from '../api.base.service'; @Injectable({ providedIn: 'root' }) -export class UpdateService { +export class UpdateService extends BaseService { - protected basePath = 'http://localhost'; - public defaultHeaders = new HttpHeaders(); - public configuration = new Configuration(); - public encoder: HttpParameterCodec; + constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) { + super(basePath, configuration); + } - constructor(protected httpClient: HttpClient, @Optional()@Inject(BASE_PATH) basePath: string|string[], @Optional() configuration: Configuration) { - if (configuration) { - this.configuration = configuration; + /** + * Retrieve the currently installed version of each Devolutions product. + * Reads `update_status.json`, which is written by the Devolutions Agent on startup and refreshed after every update run. When the file does not exist (agent not installed or is an older version), the endpoint returns HTTP 503 because updater status is unavailable. + * @endpoint get /jet/update + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + * @param options additional options + */ + public getUpdateProducts(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public getUpdateProducts(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getUpdateProducts(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getUpdateProducts(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + + let localVarHeaders = this.defaultHeaders; + + // authentication (scope_token) required + localVarHeaders = this.configuration.addCredentialToHeaders('scope_token', 'Authorization', localVarHeaders, 'Bearer '); + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); } - if (typeof this.configuration.basePath !== 'string') { - const firstBasePath = Array.isArray(basePath) ? basePath[0] : undefined; - if (firstBasePath != undefined) { - basePath = firstBasePath; - } - if (typeof basePath !== 'string') { - basePath = this.basePath; + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; } - this.configuration.basePath = basePath; } - this.encoder = this.configuration.encoder || new CustomHttpParameterCodec(); + + let localVarPath = `/jet/update`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); } + /** + * Retrieve the current Devolutions Agent auto-update schedule. + * Reads the `Schedule` field from `update_status.json`. When the field is absent the response contains zeroed defaults (`Enabled: false`, interval `0`, window start `0`, no products). + * @endpoint get /jet/update/schedule + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + * @param options additional options + */ + public getUpdateSchedule(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public getUpdateSchedule(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getUpdateSchedule(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getUpdateSchedule(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - // @ts-ignore - private addToHttpParams(httpParams: HttpParams, value: any, key?: string): HttpParams { - if (typeof value === "object" && value instanceof Date === false) { - httpParams = this.addToHttpParamsRecursive(httpParams, value); - } else { - httpParams = this.addToHttpParamsRecursive(httpParams, value, key); - } - return httpParams; - } + let localVarHeaders = this.defaultHeaders; + + // authentication (scope_token) required + localVarHeaders = this.configuration.addCredentialToHeaders('scope_token', 'Authorization', localVarHeaders, 'Bearer '); - private addToHttpParamsRecursive(httpParams: HttpParams, value?: any, key?: string): HttpParams { - if (value == null) { - return httpParams; + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); } - if (typeof value === "object") { - if (Array.isArray(value)) { - (value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); - } else if (value instanceof Date) { - if (key != null) { - httpParams = httpParams.append(key, (value as Date).toISOString().substring(0, 10)); - } else { - throw Error("key may not be null if value is Date"); - } + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; } else { - Object.keys(value).forEach( k => httpParams = this.addToHttpParamsRecursive( - httpParams, value[k], key != null ? `${key}.${k}` : k)); + responseType_ = 'blob'; } - } else if (key != null) { - httpParams = httpParams.append(key, value); - } else { - throw Error("key may not be null if value is not object or array"); } - return httpParams; + + let localVarPath = `/jet/update/schedule`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); } /** - * Triggers Devolutions Gateway update process. - * This is done via updating `Agent/update.json` file, which is then read by Devolutions Agent when changes are detected. If the version written to `update.json` is indeed higher than the currently installed version, Devolutions Agent will proceed with the update process. - * @param version The version to install; use \'latest\' for the latest version, or \'w.x.y.z\' for a specific version + * Set the Devolutions Agent auto-update schedule. + * Writes the `Schedule` field into `update.json`. The agent watches this file and applies the new schedule immediately, then persists it to `agent.json`. All other fields in `update.json` are preserved; the `VersionMinor` field is reset to the minor version this gateway build understands so the agent does not see an unknown future version. + * @endpoint post /jet/update/schedule + * @param setUpdateScheduleRequest * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. + * @param options additional options */ - public triggerUpdate(version: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public triggerUpdate(version: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public triggerUpdate(version: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public triggerUpdate(version: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (version === null || version === undefined) { - throw new Error('Required parameter version was null or undefined when calling triggerUpdate.'); - } - - let localVarQueryParameters = new HttpParams({encoder: this.encoder}); - if (version !== undefined && version !== null) { - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - version, 'version'); + public setUpdateSchedule(setUpdateScheduleRequest: SetUpdateScheduleRequest, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public setUpdateSchedule(setUpdateScheduleRequest: SetUpdateScheduleRequest, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public setUpdateSchedule(setUpdateScheduleRequest: SetUpdateScheduleRequest, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public setUpdateSchedule(setUpdateScheduleRequest: SetUpdateScheduleRequest, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (setUpdateScheduleRequest === null || setUpdateScheduleRequest === undefined) { + throw new Error('Required parameter setUpdateScheduleRequest was null or undefined when calling setUpdateSchedule.'); } let localVarHeaders = this.defaultHeaders; - let localVarCredential: string | undefined; // authentication (scope_token) required - localVarCredential = this.configuration.lookupCredential('scope_token'); - if (localVarCredential) { - localVarHeaders = localVarHeaders.set('Authorization', 'Bearer ' + localVarCredential); - } + localVarHeaders = this.configuration.addCredentialToHeaders('scope_token', 'Authorization', localVarHeaders, 'Bearer '); - let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; - if (localVarHttpHeaderAcceptSelected === undefined) { - // to determine the Accept header - const httpHeaderAccepts: string[] = [ - 'application/json' - ]; - localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); - } + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); if (localVarHttpHeaderAcceptSelected !== undefined) { localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); } - let localVarHttpContext: HttpContext | undefined = options && options.context; - if (localVarHttpContext === undefined) { - localVarHttpContext = new HttpContext(); + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + // to determine the Content-Type header + const consumes: string[] = [ + 'application/json' + ]; + const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let localVarTransferCache: boolean | undefined = options && options.transferCache; - if (localVarTransferCache === undefined) { - localVarTransferCache = true; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } + let localVarPath = `/jet/update/schedule`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('post', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + body: setUpdateScheduleRequest, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); + } + + /** + * Trigger an update for one or more Devolutions products. + * Writes the requested version(s) into `Agent/update.json`, which is watched by Devolutions Agent. When a requested version is higher than the installed version the agent proceeds with the update. **Body form** (preferred): pass a JSON body with a `Products` map. **Query-param form** (legacy, gateway-only): `POST /jet/update?version=latest`. This form updates only the Gateway product and is kept for backward compatibility. Both forms cannot be used simultaneously; doing so returns HTTP 400. + * @endpoint post /jet/update + * @param version Gateway-only target version; use the request body for multi-product updates + * @param updateRequestSchema Products and target versions to update + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + * @param options additional options + */ + public triggerUpdate(version?: string, updateRequestSchema?: UpdateRequestSchema, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public triggerUpdate(version?: string, updateRequestSchema?: UpdateRequestSchema, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public triggerUpdate(version?: string, updateRequestSchema?: UpdateRequestSchema, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public triggerUpdate(version?: string, updateRequestSchema?: UpdateRequestSchema, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + + let localVarQueryParameters = new OpenApiHttpParams(this.encoder); + + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + 'version', + version, + QueryParamStyle.Form, + true, + ); + + + let localVarHeaders = this.defaultHeaders; + + // authentication (scope_token) required + localVarHeaders = this.configuration.addCredentialToHeaders('scope_token', 'Authorization', localVarHeaders, 'Bearer '); + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + // to determine the Content-Type header + const consumes: string[] = [ + 'application/json' + ]; + const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); + } let responseType_: 'text' | 'json' | 'blob' = 'json'; if (localVarHttpHeaderAcceptSelected) { @@ -153,15 +287,17 @@ export class UpdateService { } let localVarPath = `/jet/update`; - return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('post', `${basePath}${localVarPath}`, { context: localVarHttpContext, - params: localVarQueryParameters, + body: updateRequestSchema, + params: localVarQueryParameters.toHttpParams(), responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, - transferCache: localVarTransferCache, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), reportProgress: reportProgress } ); diff --git a/devolutions-gateway/openapi/ts-angular-client/api/webApp.service.ts b/devolutions-gateway/openapi/ts-angular-client/api/webApp.service.ts index e4e8e9cfb..5f4e4c0e1 100644 --- a/devolutions-gateway/openapi/ts-angular-client/api/webApp.service.ts +++ b/devolutions-gateway/openapi/ts-angular-client/api/webApp.service.ts @@ -11,10 +11,10 @@ import { Inject, Injectable, Optional } from '@angular/core'; import { HttpClient, HttpHeaders, HttpParams, - HttpResponse, HttpEvent, HttpParameterCodec, HttpContext + HttpResponse, HttpEvent, HttpContext } from '@angular/common/http'; -import { CustomHttpParameterCodec } from '../encoder'; import { Observable } from 'rxjs'; +import { OpenApiHttpParams, QueryParamStyle } from '../query.params'; // @ts-ignore import { AppTokenSignRequest } from '../model/appTokenSignRequest'; @@ -24,79 +24,26 @@ import { SessionTokenSignRequest } from '../model/sessionTokenSignRequest'; // @ts-ignore import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; import { Configuration } from '../configuration'; +import { BaseService } from '../api.base.service'; @Injectable({ providedIn: 'root' }) -export class WebAppService { +export class WebAppService extends BaseService { - protected basePath = 'http://localhost'; - public defaultHeaders = new HttpHeaders(); - public configuration = new Configuration(); - public encoder: HttpParameterCodec; - - constructor(protected httpClient: HttpClient, @Optional()@Inject(BASE_PATH) basePath: string|string[], @Optional() configuration: Configuration) { - if (configuration) { - this.configuration = configuration; - } - if (typeof this.configuration.basePath !== 'string') { - const firstBasePath = Array.isArray(basePath) ? basePath[0] : undefined; - if (firstBasePath != undefined) { - basePath = firstBasePath; - } - - if (typeof basePath !== 'string') { - basePath = this.basePath; - } - this.configuration.basePath = basePath; - } - this.encoder = this.configuration.encoder || new CustomHttpParameterCodec(); - } - - - // @ts-ignore - private addToHttpParams(httpParams: HttpParams, value: any, key?: string): HttpParams { - if (typeof value === "object" && value instanceof Date === false) { - httpParams = this.addToHttpParamsRecursive(httpParams, value); - } else { - httpParams = this.addToHttpParamsRecursive(httpParams, value, key); - } - return httpParams; - } - - private addToHttpParamsRecursive(httpParams: HttpParams, value?: any, key?: string): HttpParams { - if (value == null) { - return httpParams; - } - - if (typeof value === "object") { - if (Array.isArray(value)) { - (value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); - } else if (value instanceof Date) { - if (key != null) { - httpParams = httpParams.append(key, (value as Date).toISOString().substring(0, 10)); - } else { - throw Error("key may not be null if value is Date"); - } - } else { - Object.keys(value).forEach( k => httpParams = this.addToHttpParamsRecursive( - httpParams, value[k], key != null ? `${key}.${k}` : k)); - } - } else if (key != null) { - httpParams = httpParams.append(key, value); - } else { - throw Error("key may not be null if value is not object or array"); - } - return httpParams; + constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) { + super(basePath, configuration); } /** * Requests a web application token using the configured authorization method + * @endpoint post /jet/webapp/app-token * @param appTokenSignRequest JSON-encoded payload specifying the desired claims * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. + * @param options additional options */ public signAppToken(appTokenSignRequest: AppTokenSignRequest, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'text/plain', context?: HttpContext, transferCache?: boolean}): Observable; public signAppToken(appTokenSignRequest: AppTokenSignRequest, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'text/plain', context?: HttpContext, transferCache?: boolean}): Observable>; @@ -108,34 +55,19 @@ export class WebAppService { let localVarHeaders = this.defaultHeaders; - let localVarCredential: string | undefined; // authentication (web_app_custom_auth) required - localVarCredential = this.configuration.lookupCredential('web_app_custom_auth'); - if (localVarCredential) { - localVarHeaders = localVarHeaders.set('Authorization', 'Basic ' + localVarCredential); - } + localVarHeaders = this.configuration.addCredentialToHeaders('web_app_custom_auth', 'Authorization', localVarHeaders, 'Basic '); - let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; - if (localVarHttpHeaderAcceptSelected === undefined) { - // to determine the Accept header - const httpHeaderAccepts: string[] = [ - 'text/plain' - ]; - localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); - } + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'text/plain' + ]); if (localVarHttpHeaderAcceptSelected !== undefined) { localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); } - let localVarHttpContext: HttpContext | undefined = options && options.context; - if (localVarHttpContext === undefined) { - localVarHttpContext = new HttpContext(); - } + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - let localVarTransferCache: boolean | undefined = options && options.transferCache; - if (localVarTransferCache === undefined) { - localVarTransferCache = true; - } + const localVarTransferCache: boolean = options?.transferCache ?? true; // to determine the Content-Type header @@ -159,15 +91,16 @@ export class WebAppService { } let localVarPath = `/jet/webapp/app-token`; - return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('post', `${basePath}${localVarPath}`, { context: localVarHttpContext, body: appTokenSignRequest, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, - transferCache: localVarTransferCache, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), reportProgress: reportProgress } ); @@ -175,9 +108,11 @@ export class WebAppService { /** * Requests a session token using a web application token + * @endpoint post /jet/webapp/session-token * @param sessionTokenSignRequest JSON-encoded payload specifying the desired claims * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. + * @param options additional options */ public signSessionToken(sessionTokenSignRequest: SessionTokenSignRequest, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'text/plain', context?: HttpContext, transferCache?: boolean}): Observable; public signSessionToken(sessionTokenSignRequest: SessionTokenSignRequest, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'text/plain', context?: HttpContext, transferCache?: boolean}): Observable>; @@ -189,34 +124,19 @@ export class WebAppService { let localVarHeaders = this.defaultHeaders; - let localVarCredential: string | undefined; // authentication (web_app_token) required - localVarCredential = this.configuration.lookupCredential('web_app_token'); - if (localVarCredential) { - localVarHeaders = localVarHeaders.set('Authorization', 'Bearer ' + localVarCredential); - } + localVarHeaders = this.configuration.addCredentialToHeaders('web_app_token', 'Authorization', localVarHeaders, 'Bearer '); - let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; - if (localVarHttpHeaderAcceptSelected === undefined) { - // to determine the Accept header - const httpHeaderAccepts: string[] = [ - 'text/plain' - ]; - localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); - } + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'text/plain' + ]); if (localVarHttpHeaderAcceptSelected !== undefined) { localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); } - let localVarHttpContext: HttpContext | undefined = options && options.context; - if (localVarHttpContext === undefined) { - localVarHttpContext = new HttpContext(); - } + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - let localVarTransferCache: boolean | undefined = options && options.transferCache; - if (localVarTransferCache === undefined) { - localVarTransferCache = true; - } + const localVarTransferCache: boolean = options?.transferCache ?? true; // to determine the Content-Type header @@ -240,15 +160,16 @@ export class WebAppService { } let localVarPath = `/jet/webapp/session-token`; - return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('post', `${basePath}${localVarPath}`, { context: localVarHttpContext, body: sessionTokenSignRequest, responseType: responseType_, - withCredentials: this.configuration.withCredentials, + ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, - transferCache: localVarTransferCache, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), reportProgress: reportProgress } ); diff --git a/devolutions-gateway/openapi/ts-angular-client/configuration.ts b/devolutions-gateway/openapi/ts-angular-client/configuration.ts index 174134f4b..9ad4f9376 100644 --- a/devolutions-gateway/openapi/ts-angular-client/configuration.ts +++ b/devolutions-gateway/openapi/ts-angular-client/configuration.ts @@ -1,5 +1,6 @@ -import { HttpParameterCodec } from '@angular/common/http'; +import { HttpHeaders, HttpParameterCodec } from '@angular/common/http'; import { Param } from './param'; +import { OpenApiHttpParams } from './query.params'; export interface ConfigurationParameters { /** @@ -66,26 +67,30 @@ export class Configuration { */ credentials: {[ key: string ]: string | (() => string | undefined)}; - constructor(configurationParameters: ConfigurationParameters = {}) { - this.apiKeys = configurationParameters.apiKeys; - this.username = configurationParameters.username; - this.password = configurationParameters.password; - this.accessToken = configurationParameters.accessToken; - this.basePath = configurationParameters.basePath; - this.withCredentials = configurationParameters.withCredentials; - this.encoder = configurationParameters.encoder; - if (configurationParameters.encodeParam) { - this.encodeParam = configurationParameters.encodeParam; +constructor({ accessToken, apiKeys, basePath, credentials, encodeParam, encoder, password, username, withCredentials }: ConfigurationParameters = {}) { + if (apiKeys) { + this.apiKeys = apiKeys; } - else { - this.encodeParam = param => this.defaultEncodeParam(param); + if (username !== undefined) { + this.username = username; } - if (configurationParameters.credentials) { - this.credentials = configurationParameters.credentials; + if (password !== undefined) { + this.password = password; } - else { - this.credentials = {}; + if (accessToken !== undefined) { + this.accessToken = accessToken; } + if (basePath !== undefined) { + this.basePath = basePath; + } + if (withCredentials !== undefined) { + this.withCredentials = withCredentials; + } + if (encoder) { + this.encoder = encoder; + } + this.encodeParam = encodeParam ?? (param => this.defaultEncodeParam(param)); + this.credentials = credentials ?? {}; // init default jrec_token credential if (!this.credentials['jrec_token']) { @@ -191,8 +196,8 @@ export class Configuration { * @return True if the given MIME is JSON, false otherwise. */ public isJsonMime(mime: string): boolean { - const jsonMime: RegExp = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i'); - return mime !== null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json'); + const jsonMime: RegExp = /^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$/i; + return mime !== null && jsonMime.test(mime); } public lookupCredential(key: string): string | undefined { @@ -202,6 +207,20 @@ export class Configuration { : value; } + public addCredentialToHeaders(credentialKey: string, headerName: string, headers: HttpHeaders, prefix?: string): HttpHeaders { + const value = this.lookupCredential(credentialKey); + return value + ? headers.set(headerName, (prefix ?? '') + value) + : headers; + } + + public addCredentialToQuery(credentialKey: string, paramName: string, query: OpenApiHttpParams): OpenApiHttpParams { + const value = this.lookupCredential(credentialKey); + return value + ? query.set(paramName, value) + : query; + } + private defaultEncodeParam(param: Param): string { // This implementation exists as fallback for missing configuration // and for backwards compatibility to older typescript-angular generator versions. diff --git a/devolutions-gateway/openapi/ts-angular-client/encoder.ts b/devolutions-gateway/openapi/ts-angular-client/encoder.ts index 138c4d5cf..af4523543 100644 --- a/devolutions-gateway/openapi/ts-angular-client/encoder.ts +++ b/devolutions-gateway/openapi/ts-angular-client/encoder.ts @@ -18,3 +18,18 @@ export class CustomHttpParameterCodec implements HttpParameterCodec { return decodeURIComponent(v); } } + +export class IdentityHttpParameterCodec implements HttpParameterCodec { + encodeKey(k: string): string { + return k; + } + encodeValue(v: string): string { + return v; + } + decodeKey(k: string): string { + return k; + } + decodeValue(v: string): string { + return v; + } +} diff --git a/devolutions-gateway/openapi/ts-angular-client/index.ts b/devolutions-gateway/openapi/ts-angular-client/index.ts index 104dd3d21..02cb7d437 100644 --- a/devolutions-gateway/openapi/ts-angular-client/index.ts +++ b/devolutions-gateway/openapi/ts-angular-client/index.ts @@ -3,4 +3,5 @@ export * from './model/models'; export * from './variables'; export * from './configuration'; export * from './api.module'; +export * from './provide-api'; export * from './param'; diff --git a/devolutions-gateway/openapi/ts-angular-client/model/accessScope.ts b/devolutions-gateway/openapi/ts-angular-client/model/accessScope.ts index 982b4fd4a..af8e57f58 100644 --- a/devolutions-gateway/openapi/ts-angular-client/model/accessScope.ts +++ b/devolutions-gateway/openapi/ts-angular-client/model/accessScope.ts @@ -9,24 +9,26 @@ */ -export type AccessScope = '*' | 'gateway.sessions.read' | 'gateway.session.terminate' | 'gateway.associations.read' | 'gateway.diagnostics.read' | 'gateway.jrl.read' | 'gateway.config.write' | 'gateway.heartbeat.read' | 'gateway.recording.delete' | 'gateway.recordings.read' | 'gateway.update' | 'gateway.preflight' | 'gateway.traffic.claim' | 'gateway.traffic.ack' | 'gateway.net.monitor.config' | 'gateway.net.monitor.drain'; - export const AccessScope = { - Star: '*' as AccessScope, - GatewaySessionsRead: 'gateway.sessions.read' as AccessScope, - GatewaySessionTerminate: 'gateway.session.terminate' as AccessScope, - GatewayAssociationsRead: 'gateway.associations.read' as AccessScope, - GatewayDiagnosticsRead: 'gateway.diagnostics.read' as AccessScope, - GatewayJrlRead: 'gateway.jrl.read' as AccessScope, - GatewayConfigWrite: 'gateway.config.write' as AccessScope, - GatewayHeartbeatRead: 'gateway.heartbeat.read' as AccessScope, - GatewayRecordingDelete: 'gateway.recording.delete' as AccessScope, - GatewayRecordingsRead: 'gateway.recordings.read' as AccessScope, - GatewayUpdate: 'gateway.update' as AccessScope, - GatewayPreflight: 'gateway.preflight' as AccessScope, - GatewayTrafficClaim: 'gateway.traffic.claim' as AccessScope, - GatewayTrafficAck: 'gateway.traffic.ack' as AccessScope, - GatewayNetMonitorConfig: 'gateway.net.monitor.config' as AccessScope, - GatewayNetMonitorDrain: 'gateway.net.monitor.drain' as AccessScope -}; + Star: '*', + GatewaySessionsRead: 'gateway.sessions.read', + GatewaySessionTerminate: 'gateway.session.terminate', + GatewayAssociationsRead: 'gateway.associations.read', + GatewayDiagnosticsRead: 'gateway.diagnostics.read', + GatewayJrlRead: 'gateway.jrl.read', + GatewayConfigWrite: 'gateway.config.write', + GatewayHeartbeatRead: 'gateway.heartbeat.read', + GatewayRecordingDelete: 'gateway.recording.delete', + GatewayRecordingsRead: 'gateway.recordings.read', + GatewayUpdate: 'gateway.update', + GatewayUpdateRead: 'gateway.update.read', + GatewayPreflight: 'gateway.preflight', + GatewayTrafficClaim: 'gateway.traffic.claim', + GatewayTrafficAck: 'gateway.traffic.ack', + GatewayNetMonitorConfig: 'gateway.net.monitor.config', + GatewayNetMonitorDrain: 'gateway.net.monitor.drain', + GatewayAgentDelete: 'gateway.agent.delete', + GatewayAgentRead: 'gateway.agent.read' +} as const; +export type AccessScope = typeof AccessScope[keyof typeof AccessScope]; diff --git a/devolutions-gateway/openapi/ts-angular-client/model/addressFamily.ts b/devolutions-gateway/openapi/ts-angular-client/model/addressFamily.ts index 50244b33d..e732359a9 100644 --- a/devolutions-gateway/openapi/ts-angular-client/model/addressFamily.ts +++ b/devolutions-gateway/openapi/ts-angular-client/model/addressFamily.ts @@ -9,10 +9,9 @@ */ -export type AddressFamily = 'IPv4' | 'IPv6'; - export const AddressFamily = { - Ipv4: 'IPv4' as AddressFamily, - Ipv6: 'IPv6' as AddressFamily -}; + Ipv4: 'IPv4', + Ipv6: 'IPv6' +} as const; +export type AddressFamily = typeof AddressFamily[keyof typeof AddressFamily]; diff --git a/devolutions-gateway/openapi/ts-angular-client/model/appCredentialKind.ts b/devolutions-gateway/openapi/ts-angular-client/model/appCredentialKind.ts index c572b3535..2a9ebd300 100644 --- a/devolutions-gateway/openapi/ts-angular-client/model/appCredentialKind.ts +++ b/devolutions-gateway/openapi/ts-angular-client/model/appCredentialKind.ts @@ -9,9 +9,8 @@ */ -export type AppCredentialKind = 'username-password'; - export const AppCredentialKind = { - UsernamePassword: 'username-password' as AppCredentialKind -}; + UsernamePassword: 'username-password' +} as const; +export type AppCredentialKind = typeof AppCredentialKind[keyof typeof AppCredentialKind]; diff --git a/devolutions-gateway/openapi/ts-angular-client/model/appTokenContentType.ts b/devolutions-gateway/openapi/ts-angular-client/model/appTokenContentType.ts index ebf1749b8..3a35fc4d8 100644 --- a/devolutions-gateway/openapi/ts-angular-client/model/appTokenContentType.ts +++ b/devolutions-gateway/openapi/ts-angular-client/model/appTokenContentType.ts @@ -9,9 +9,8 @@ */ -export type AppTokenContentType = 'WEBAPP'; - export const AppTokenContentType = { - Webapp: 'WEBAPP' as AppTokenContentType -}; + Webapp: 'WEBAPP' +} as const; +export type AppTokenContentType = typeof AppTokenContentType[keyof typeof AppTokenContentType]; diff --git a/devolutions-gateway/openapi/ts-angular-client/model/connectionMode.ts b/devolutions-gateway/openapi/ts-angular-client/model/connectionMode.ts index b55dcd928..0072fe9de 100644 --- a/devolutions-gateway/openapi/ts-angular-client/model/connectionMode.ts +++ b/devolutions-gateway/openapi/ts-angular-client/model/connectionMode.ts @@ -9,10 +9,9 @@ */ -export type ConnectionMode = 'rdv' | 'fwd'; - export const ConnectionMode = { - Rdv: 'rdv' as ConnectionMode, - Fwd: 'fwd' as ConnectionMode -}; + Rdv: 'rdv', + Fwd: 'fwd' +} as const; +export type ConnectionMode = typeof ConnectionMode[keyof typeof ConnectionMode]; diff --git a/devolutions-gateway/openapi/ts-angular-client/model/dataEncoding.ts b/devolutions-gateway/openapi/ts-angular-client/model/dataEncoding.ts index e8d17a401..f8d924a5f 100644 --- a/devolutions-gateway/openapi/ts-angular-client/model/dataEncoding.ts +++ b/devolutions-gateway/openapi/ts-angular-client/model/dataEncoding.ts @@ -9,13 +9,12 @@ */ -export type DataEncoding = 'Multibase' | 'Base64' | 'Base64Pad' | 'Base64Url' | 'Base64UrlPad'; - export const DataEncoding = { - Multibase: 'Multibase' as DataEncoding, - Base64: 'Base64' as DataEncoding, - Base64Pad: 'Base64Pad' as DataEncoding, - Base64Url: 'Base64Url' as DataEncoding, - Base64UrlPad: 'Base64UrlPad' as DataEncoding -}; + Multibase: 'Multibase', + Base64: 'Base64', + Base64Pad: 'Base64Pad', + Base64Url: 'Base64Url', + Base64UrlPad: 'Base64UrlPad' +} as const; +export type DataEncoding = typeof DataEncoding[keyof typeof DataEncoding]; diff --git a/devolutions-gateway/openapi/ts-angular-client/model/eventOutcomeResponse.ts b/devolutions-gateway/openapi/ts-angular-client/model/eventOutcomeResponse.ts index e6b8b1d0d..a78031aa6 100644 --- a/devolutions-gateway/openapi/ts-angular-client/model/eventOutcomeResponse.ts +++ b/devolutions-gateway/openapi/ts-angular-client/model/eventOutcomeResponse.ts @@ -9,11 +9,10 @@ */ -export type EventOutcomeResponse = 'connect_failure' | 'normal_termination' | 'abnormal_termination'; - export const EventOutcomeResponse = { - ConnectFailure: 'connect_failure' as EventOutcomeResponse, - NormalTermination: 'normal_termination' as EventOutcomeResponse, - AbnormalTermination: 'abnormal_termination' as EventOutcomeResponse -}; + ConnectFailure: 'connect_failure', + NormalTermination: 'normal_termination', + AbnormalTermination: 'abnormal_termination' +} as const; +export type EventOutcomeResponse = typeof EventOutcomeResponse[keyof typeof EventOutcomeResponse]; diff --git a/devolutions-gateway/openapi/ts-angular-client/model/getUpdateProductsResponse.ts b/devolutions-gateway/openapi/ts-angular-client/model/getUpdateProductsResponse.ts new file mode 100644 index 000000000..ee9be047e --- /dev/null +++ b/devolutions-gateway/openapi/ts-angular-client/model/getUpdateProductsResponse.ts @@ -0,0 +1,26 @@ +/** + * devolutions-gateway + * + * Contact: infos@devolutions.net + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { UpdateProductInfo } from './updateProductInfo'; + + +/** + * Installed version of each product, as reported by Devolutions Agent. + */ +export interface GetUpdateProductsResponse { + /** + * Version of the `update_status.json` format in `\"major.minor\"` form (e.g. `\"1.1\"`). + */ + ManifestVersion: string; + /** + * Map of product name to API-specific product info. + */ + Products?: { [key: string]: UpdateProductInfo; }; +} + diff --git a/devolutions-gateway/openapi/ts-angular-client/model/getUpdateScheduleResponse.ts b/devolutions-gateway/openapi/ts-angular-client/model/getUpdateScheduleResponse.ts new file mode 100644 index 000000000..e83fc6ebf --- /dev/null +++ b/devolutions-gateway/openapi/ts-angular-client/model/getUpdateScheduleResponse.ts @@ -0,0 +1,41 @@ +/** + * devolutions-gateway + * + * Contact: infos@devolutions.net + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +/** + * Current auto-update schedule for Devolutions Agent. + */ +export interface GetUpdateScheduleResponse { + /** + * Enable periodic Devolutions Agent self-update checks. + */ + Enabled: boolean; + /** + * Minimum interval between auto-update checks, in seconds. `0` means check once at `UpdateWindowStart`. + */ + Interval: number; + /** + * Version of the `update_status.json` format in `\"major.minor\"` form (e.g. `\"1.1\"`). + */ + ManifestVersion: string; + /** + * Products the agent autonomously polls for new versions. + */ + Products?: Array; + /** + * End of the maintenance window as seconds past midnight (local time, exclusive). `None` means no upper bound (single check at `UpdateWindowStart`). + */ + UpdateWindowEnd?: number | null; + /** + * Start of the maintenance window as seconds past midnight (local time). + */ + UpdateWindowStart: number; +} + diff --git a/devolutions-gateway/openapi/ts-angular-client/model/hostScanStateDto.ts b/devolutions-gateway/openapi/ts-angular-client/model/hostScanStateDto.ts new file mode 100644 index 000000000..5a022bd8a --- /dev/null +++ b/devolutions-gateway/openapi/ts-angular-client/model/hostScanStateDto.ts @@ -0,0 +1,19 @@ +/** + * devolutions-gateway + * + * Contact: infos@devolutions.net + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export const HostScanStateDto = { + Queued: 'queued', + Probing: 'probing', + Reachable: 'reachable', + Unreachable: 'unreachable' +} as const; +export type HostScanStateDto = typeof HostScanStateDto[keyof typeof HostScanStateDto]; + diff --git a/devolutions-gateway/openapi/ts-angular-client/model/models.ts b/devolutions-gateway/openapi/ts-angular-client/model/models.ts index 652b6b61f..02f338e50 100644 --- a/devolutions-gateway/openapi/ts-angular-client/model/models.ts +++ b/devolutions-gateway/openapi/ts-angular-client/model/models.ts @@ -14,7 +14,10 @@ export * from './connectionMode'; export * from './dataEncoding'; export * from './deleteManyResult'; export * from './eventOutcomeResponse'; +export * from './getUpdateProductsResponse'; +export * from './getUpdateScheduleResponse'; export * from './heartbeat'; +export * from './hostScanStateDto'; export * from './identity'; export * from './interfaceInfo'; export * from './jrlInfo'; @@ -26,17 +29,28 @@ export * from './monitoringLogResponse'; export * from './monitoringProbeType'; export * from './monitoringProbeTypeOneOf'; export * from './monitorsConfig'; +export * from './networkInterfaceDto'; +export * from './networkInterfacesResponse'; +export * from './networkScanResultEventDto'; +export * from './networkScanResultKindDto'; +export * from './networkScanSourceCapabilitiesDto'; +export * from './networkScanSourceDto'; export * from './preflightAlertStatus'; export * from './preflightOperation'; export * from './preflightOperationKind'; export * from './preflightOutput'; export * from './preflightOutputKind'; export * from './pubKeyFormat'; +export * from './scanOriginDto'; +export * from './scanResultSourceDto'; export * from './sessionInfo'; export * from './sessionTokenContentType'; export * from './sessionTokenSignRequest'; export * from './setConfigResponse'; +export * from './setUpdateScheduleRequest'; export * from './subProvisionerKey'; export * from './subscriber'; export * from './trafficEventResponse'; export * from './transportProtocolResponse'; +export * from './updateProductInfo'; +export * from './updateRequestSchema'; diff --git a/devolutions-gateway/openapi/ts-angular-client/model/networkInterfaceDto.ts b/devolutions-gateway/openapi/ts-angular-client/model/networkInterfaceDto.ts new file mode 100644 index 000000000..aa43757eb --- /dev/null +++ b/devolutions-gateway/openapi/ts-angular-client/model/networkInterfaceDto.ts @@ -0,0 +1,32 @@ +/** + * devolutions-gateway + * + * Contact: infos@devolutions.net + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export interface NetworkInterfaceDto { + description?: string | null; + id: string; + index?: number | null; + isUp?: boolean | null; + /** + * Coarse link type: `ethernet`, `wifi`, `loopback`, `virtual`, `unknown`. + */ + linkType?: string | null; + macAddress?: string | null; + /** + * MTU in bytes when known. + */ + mtu?: number | null; + name: string; + /** + * Link speed in megabits per second when reported by the OS. + */ + speedMbps?: number | null; +} + diff --git a/devolutions-gateway/openapi/ts-angular-client/model/networkInterfacesResponse.ts b/devolutions-gateway/openapi/ts-angular-client/model/networkInterfacesResponse.ts new file mode 100644 index 000000000..cb55fe021 --- /dev/null +++ b/devolutions-gateway/openapi/ts-angular-client/model/networkInterfacesResponse.ts @@ -0,0 +1,16 @@ +/** + * devolutions-gateway + * + * Contact: infos@devolutions.net + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { NetworkScanSourceDto } from './networkScanSourceDto'; + + +export interface NetworkInterfacesResponse { + interfaces: Array; +} + diff --git a/devolutions-gateway/openapi/ts-angular-client/model/networkScanResultEventDto.ts b/devolutions-gateway/openapi/ts-angular-client/model/networkScanResultEventDto.ts new file mode 100644 index 000000000..cd2796570 --- /dev/null +++ b/devolutions-gateway/openapi/ts-angular-client/model/networkScanResultEventDto.ts @@ -0,0 +1,35 @@ +/** + * devolutions-gateway + * + * Contact: infos@devolutions.net + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { HostScanStateDto } from './hostScanStateDto'; +import { ScanOriginDto } from './scanOriginDto'; +import { ScanResultSourceDto } from './scanResultSourceDto'; +import { NetworkScanResultKindDto } from './networkScanResultKindDto'; + + +export interface NetworkScanResultEventDto { + address: string; + discoverySource: ScanResultSourceDto; + hostName?: string | null; + hostScanState?: HostScanStateDto | null; + interfaceId?: string | null; + interfaceName?: string | null; + isReachable?: boolean | null; + kind: NetworkScanResultKindDto; + macAddress?: string | null; + port?: number | null; + responseTimeMs?: number | null; + serviceLabel?: string | null; + serviceType?: string | null; + source: ScanOriginDto; +} +export namespace NetworkScanResultEventDto { +} + + diff --git a/devolutions-gateway/openapi/ts-angular-client/model/networkScanResultKindDto.ts b/devolutions-gateway/openapi/ts-angular-client/model/networkScanResultKindDto.ts new file mode 100644 index 000000000..eba40eac0 --- /dev/null +++ b/devolutions-gateway/openapi/ts-angular-client/model/networkScanResultKindDto.ts @@ -0,0 +1,17 @@ +/** + * devolutions-gateway + * + * Contact: infos@devolutions.net + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export const NetworkScanResultKindDto = { + Host: 'host', + Service: 'service' +} as const; +export type NetworkScanResultKindDto = typeof NetworkScanResultKindDto[keyof typeof NetworkScanResultKindDto]; + diff --git a/devolutions-gateway/openapi/ts-angular-client/model/networkScanSourceCapabilitiesDto.ts b/devolutions-gateway/openapi/ts-angular-client/model/networkScanSourceCapabilitiesDto.ts new file mode 100644 index 000000000..60ece37ac --- /dev/null +++ b/devolutions-gateway/openapi/ts-angular-client/model/networkScanSourceCapabilitiesDto.ts @@ -0,0 +1,21 @@ +/** + * devolutions-gateway + * + * Contact: infos@devolutions.net + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export interface NetworkScanSourceCapabilitiesDto { + broadcast: boolean; + dnsResolve: boolean; + ipv4: boolean; + ipv6: boolean; + subnet: boolean; + tcpProbe: boolean; + zeroConf: boolean; +} + diff --git a/devolutions-gateway/openapi/ts-angular-client/model/networkScanSourceDto.ts b/devolutions-gateway/openapi/ts-angular-client/model/networkScanSourceDto.ts new file mode 100644 index 000000000..934bc9f49 --- /dev/null +++ b/devolutions-gateway/openapi/ts-angular-client/model/networkScanSourceDto.ts @@ -0,0 +1,23 @@ +/** + * devolutions-gateway + * + * Contact: infos@devolutions.net + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { NetworkInterfaceDto } from './networkInterfaceDto'; +import { NetworkScanSourceCapabilitiesDto } from './networkScanSourceCapabilitiesDto'; + + +export interface NetworkScanSourceDto { + address: string; + broadcastAddress?: string | null; + capabilities: NetworkScanSourceCapabilitiesDto; + endAddress: string; + 'interface': NetworkInterfaceDto; + prefixLength?: number | null; + startAddress: string; +} + diff --git a/devolutions-gateway/openapi/ts-angular-client/model/preflightAlertStatus.ts b/devolutions-gateway/openapi/ts-angular-client/model/preflightAlertStatus.ts index 04a315b83..5e6241f46 100644 --- a/devolutions-gateway/openapi/ts-angular-client/model/preflightAlertStatus.ts +++ b/devolutions-gateway/openapi/ts-angular-client/model/preflightAlertStatus.ts @@ -9,16 +9,15 @@ */ -export type PreflightAlertStatus = 'general-failure' | 'info' | 'warn' | 'unsupported-operation' | 'invalid-parameters' | 'internal-server-error' | 'host-resolution-failure' | 'agent-version-lookup-failure'; - export const PreflightAlertStatus = { - GeneralFailure: 'general-failure' as PreflightAlertStatus, - Info: 'info' as PreflightAlertStatus, - Warn: 'warn' as PreflightAlertStatus, - UnsupportedOperation: 'unsupported-operation' as PreflightAlertStatus, - InvalidParameters: 'invalid-parameters' as PreflightAlertStatus, - InternalServerError: 'internal-server-error' as PreflightAlertStatus, - HostResolutionFailure: 'host-resolution-failure' as PreflightAlertStatus, - AgentVersionLookupFailure: 'agent-version-lookup-failure' as PreflightAlertStatus -}; + GeneralFailure: 'general-failure', + Info: 'info', + Warn: 'warn', + UnsupportedOperation: 'unsupported-operation', + InvalidParameters: 'invalid-parameters', + InternalServerError: 'internal-server-error', + HostResolutionFailure: 'host-resolution-failure', + AgentVersionLookupFailure: 'agent-version-lookup-failure' +} as const; +export type PreflightAlertStatus = typeof PreflightAlertStatus[keyof typeof PreflightAlertStatus]; diff --git a/devolutions-gateway/openapi/ts-angular-client/model/preflightOperation.ts b/devolutions-gateway/openapi/ts-angular-client/model/preflightOperation.ts index 440e61c4a..cf208ff87 100644 --- a/devolutions-gateway/openapi/ts-angular-client/model/preflightOperation.ts +++ b/devolutions-gateway/openapi/ts-angular-client/model/preflightOperation.ts @@ -24,7 +24,7 @@ export interface PreflightOperation { proxy_credential?: AppCredential | null; target_credential?: AppCredential | null; /** - * Minimum persistance duration in seconds for the data provisioned via this operation. Optional parameter for \"provision-token\" and \"provision-credentials\" kinds. + * Minimum persistence duration in seconds for the data provisioned via this operation. Optional parameter for \"provision-token\" and \"provision-credentials\" kinds. */ time_to_live?: number | null; /** diff --git a/devolutions-gateway/openapi/ts-angular-client/model/preflightOperationKind.ts b/devolutions-gateway/openapi/ts-angular-client/model/preflightOperationKind.ts index 235e78a37..cb5cb3a33 100644 --- a/devolutions-gateway/openapi/ts-angular-client/model/preflightOperationKind.ts +++ b/devolutions-gateway/openapi/ts-angular-client/model/preflightOperationKind.ts @@ -9,15 +9,14 @@ */ -export type PreflightOperationKind = 'get-version' | 'get-agent-version' | 'get-running-session-count' | 'get-recording-storage-health' | 'provision-token' | 'provision-credentials' | 'resolve-host'; - export const PreflightOperationKind = { - GetVersion: 'get-version' as PreflightOperationKind, - GetAgentVersion: 'get-agent-version' as PreflightOperationKind, - GetRunningSessionCount: 'get-running-session-count' as PreflightOperationKind, - GetRecordingStorageHealth: 'get-recording-storage-health' as PreflightOperationKind, - ProvisionToken: 'provision-token' as PreflightOperationKind, - ProvisionCredentials: 'provision-credentials' as PreflightOperationKind, - ResolveHost: 'resolve-host' as PreflightOperationKind -}; + GetVersion: 'get-version', + GetAgentVersion: 'get-agent-version', + GetRunningSessionCount: 'get-running-session-count', + GetRecordingStorageHealth: 'get-recording-storage-health', + ProvisionToken: 'provision-token', + ProvisionCredentials: 'provision-credentials', + ResolveHost: 'resolve-host' +} as const; +export type PreflightOperationKind = typeof PreflightOperationKind[keyof typeof PreflightOperationKind]; diff --git a/devolutions-gateway/openapi/ts-angular-client/model/preflightOutputKind.ts b/devolutions-gateway/openapi/ts-angular-client/model/preflightOutputKind.ts index 30da6d05e..cd5c16ca8 100644 --- a/devolutions-gateway/openapi/ts-angular-client/model/preflightOutputKind.ts +++ b/devolutions-gateway/openapi/ts-angular-client/model/preflightOutputKind.ts @@ -9,14 +9,13 @@ */ -export type PreflightOutputKind = 'version' | 'agent-version' | 'running-session-count' | 'recording-storage-health' | 'resolved-host' | 'alert'; - export const PreflightOutputKind = { - Version: 'version' as PreflightOutputKind, - AgentVersion: 'agent-version' as PreflightOutputKind, - RunningSessionCount: 'running-session-count' as PreflightOutputKind, - RecordingStorageHealth: 'recording-storage-health' as PreflightOutputKind, - ResolvedHost: 'resolved-host' as PreflightOutputKind, - Alert: 'alert' as PreflightOutputKind -}; + Version: 'version', + AgentVersion: 'agent-version', + RunningSessionCount: 'running-session-count', + RecordingStorageHealth: 'recording-storage-health', + ResolvedHost: 'resolved-host', + Alert: 'alert' +} as const; +export type PreflightOutputKind = typeof PreflightOutputKind[keyof typeof PreflightOutputKind]; diff --git a/devolutions-gateway/openapi/ts-angular-client/model/pubKeyFormat.ts b/devolutions-gateway/openapi/ts-angular-client/model/pubKeyFormat.ts index 71dcbf3fd..75cd284af 100644 --- a/devolutions-gateway/openapi/ts-angular-client/model/pubKeyFormat.ts +++ b/devolutions-gateway/openapi/ts-angular-client/model/pubKeyFormat.ts @@ -9,10 +9,9 @@ */ -export type PubKeyFormat = 'Spki' | 'Pkcs1'; - export const PubKeyFormat = { - Spki: 'Spki' as PubKeyFormat, - Pkcs1: 'Pkcs1' as PubKeyFormat -}; + Spki: 'Spki', + Pkcs1: 'Pkcs1' +} as const; +export type PubKeyFormat = typeof PubKeyFormat[keyof typeof PubKeyFormat]; diff --git a/devolutions-gateway/openapi/ts-angular-client/model/scanOriginDto.ts b/devolutions-gateway/openapi/ts-angular-client/model/scanOriginDto.ts new file mode 100644 index 000000000..48293cb19 --- /dev/null +++ b/devolutions-gateway/openapi/ts-angular-client/model/scanOriginDto.ts @@ -0,0 +1,16 @@ +/** + * devolutions-gateway + * + * Contact: infos@devolutions.net + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export const ScanOriginDto = { + Gateway: 'gateway' +} as const; +export type ScanOriginDto = typeof ScanOriginDto[keyof typeof ScanOriginDto]; + diff --git a/devolutions-gateway/openapi/ts-angular-client/model/scanResultSourceDto.ts b/devolutions-gateway/openapi/ts-angular-client/model/scanResultSourceDto.ts new file mode 100644 index 000000000..ef35e851a --- /dev/null +++ b/devolutions-gateway/openapi/ts-angular-client/model/scanResultSourceDto.ts @@ -0,0 +1,20 @@ +/** + * devolutions-gateway + * + * Contact: infos@devolutions.net + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export const ScanResultSourceDto = { + Subnet: 'subnet', + Broadcast: 'broadcast', + TcpProbe: 'tcp_probe', + Gateway: 'gateway', + ZeroConf: 'zero_conf' +} as const; +export type ScanResultSourceDto = typeof ScanResultSourceDto[keyof typeof ScanResultSourceDto]; + diff --git a/devolutions-gateway/openapi/ts-angular-client/model/sessionTokenContentType.ts b/devolutions-gateway/openapi/ts-angular-client/model/sessionTokenContentType.ts index d430214a6..87aa970f8 100644 --- a/devolutions-gateway/openapi/ts-angular-client/model/sessionTokenContentType.ts +++ b/devolutions-gateway/openapi/ts-angular-client/model/sessionTokenContentType.ts @@ -9,11 +9,10 @@ */ -export type SessionTokenContentType = 'ASSOCIATION' | 'JMUX' | 'KDC'; - export const SessionTokenContentType = { - Association: 'ASSOCIATION' as SessionTokenContentType, - Jmux: 'JMUX' as SessionTokenContentType, - Kdc: 'KDC' as SessionTokenContentType -}; + Association: 'ASSOCIATION', + Jmux: 'JMUX', + Kdc: 'KDC' +} as const; +export type SessionTokenContentType = typeof SessionTokenContentType[keyof typeof SessionTokenContentType]; diff --git a/devolutions-gateway/openapi/ts-angular-client/model/setUpdateScheduleRequest.ts b/devolutions-gateway/openapi/ts-angular-client/model/setUpdateScheduleRequest.ts new file mode 100644 index 000000000..49e2ffaa9 --- /dev/null +++ b/devolutions-gateway/openapi/ts-angular-client/model/setUpdateScheduleRequest.ts @@ -0,0 +1,37 @@ +/** + * devolutions-gateway + * + * Contact: infos@devolutions.net + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +/** + * Desired auto-update schedule to apply to Devolutions Agent. + */ +export interface SetUpdateScheduleRequest { + /** + * Enable periodic Devolutions Agent self-update checks. + */ + Enabled: boolean; + /** + * Minimum interval between auto-update checks, in seconds. `0` means check once at `UpdateWindowStart` (default). + */ + Interval?: number; + /** + * Products the agent autonomously polls for new versions (default: empty). + */ + Products?: Array; + /** + * End of the maintenance window as seconds past midnight in local time, exclusive. `null` (default) means no upper bound - a single check fires at `UpdateWindowStart`. When end < start the window crosses midnight. + */ + UpdateWindowEnd?: number | null; + /** + * Start of the maintenance window as seconds past midnight in local time (default: `7200` = 02:00). + */ + UpdateWindowStart?: number; +} + diff --git a/devolutions-gateway/openapi/ts-angular-client/model/transportProtocolResponse.ts b/devolutions-gateway/openapi/ts-angular-client/model/transportProtocolResponse.ts index f4945fffb..ee91750b9 100644 --- a/devolutions-gateway/openapi/ts-angular-client/model/transportProtocolResponse.ts +++ b/devolutions-gateway/openapi/ts-angular-client/model/transportProtocolResponse.ts @@ -9,10 +9,9 @@ */ -export type TransportProtocolResponse = 'tcp' | 'udp'; - export const TransportProtocolResponse = { - Tcp: 'tcp' as TransportProtocolResponse, - Udp: 'udp' as TransportProtocolResponse -}; + Tcp: 'tcp', + Udp: 'udp' +} as const; +export type TransportProtocolResponse = typeof TransportProtocolResponse[keyof typeof TransportProtocolResponse]; diff --git a/devolutions-gateway/openapi/ts-angular-client/model/updateProductInfo.ts b/devolutions-gateway/openapi/ts-angular-client/model/updateProductInfo.ts new file mode 100644 index 000000000..bde42e7b6 --- /dev/null +++ b/devolutions-gateway/openapi/ts-angular-client/model/updateProductInfo.ts @@ -0,0 +1,21 @@ +/** + * devolutions-gateway + * + * Contact: infos@devolutions.net + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +/** + * Per-product update information. + */ +export interface UpdateProductInfo { + /** + * Requested or installed version: `\"latest\"` or `\"YYYY.M.D\"` / `\"YYYY.M.D.R\"`. + */ + Version: string; +} + diff --git a/devolutions-gateway/openapi/ts-angular-client/model/updateRequestSchema.ts b/devolutions-gateway/openapi/ts-angular-client/model/updateRequestSchema.ts new file mode 100644 index 000000000..2994294f2 --- /dev/null +++ b/devolutions-gateway/openapi/ts-angular-client/model/updateRequestSchema.ts @@ -0,0 +1,22 @@ +/** + * devolutions-gateway + * + * Contact: infos@devolutions.net + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { UpdateProductInfo } from './updateProductInfo'; + + +/** + * OpenAPI schema for the update request body. The API accepts an object containing a `Products` map, whose keys are product names and whose values are update information. + */ +export interface UpdateRequestSchema { + /** + * Map of product name to update information. + */ + Products?: { [key: string]: UpdateProductInfo; }; +} + diff --git a/devolutions-gateway/openapi/ts-angular-client/package.json b/devolutions-gateway/openapi/ts-angular-client/package.json index 92749fbfe..237da7890 100644 --- a/devolutions-gateway/openapi/ts-angular-client/package.json +++ b/devolutions-gateway/openapi/ts-angular-client/package.json @@ -16,18 +16,18 @@ "build": "ng-packagr -p ng-package.json" }, "peerDependencies": { - "@angular/core": "^18.0.0", + "@angular/core": "^21.0.0", "rxjs": "^7.4.0" }, "devDependencies": { - "@angular/common": "^18.0.0", - "@angular/compiler": "^18.0.0", - "@angular/compiler-cli": "^18.0.0", - "@angular/core": "^18.0.0", - "@angular/platform-browser": "^18.0.0", - "ng-packagr": "^18.0.0", + "@angular/common": "^21.0.0", + "@angular/compiler": "^21.0.0", + "@angular/compiler-cli": "^21.0.0", + "@angular/core": "^21.0.0", + "@angular/platform-browser": "^21.0.0", + "ng-packagr": "^21.0.0", "reflect-metadata": "^0.1.3", "rxjs": "^7.4.0", - "typescript": ">=5.4.0 <5.5.0", - "zone.js": "^0.14.7" + "typescript": ">=5.9.0 <6.0.0", + "zone.js": "^0.15.0" }} diff --git a/devolutions-gateway/openapi/ts-angular-client/provide-api.ts b/devolutions-gateway/openapi/ts-angular-client/provide-api.ts new file mode 100644 index 000000000..19c762acd --- /dev/null +++ b/devolutions-gateway/openapi/ts-angular-client/provide-api.ts @@ -0,0 +1,15 @@ +import { EnvironmentProviders, makeEnvironmentProviders } from "@angular/core"; +import { Configuration, ConfigurationParameters } from './configuration'; +import { BASE_PATH } from './variables'; + +// Returns the service class providers, to be used in the [ApplicationConfig](https://angular.dev/api/core/ApplicationConfig). +export function provideApi(configOrBasePath: string | ConfigurationParameters): EnvironmentProviders { + return makeEnvironmentProviders([ + typeof configOrBasePath === "string" + ? { provide: BASE_PATH, useValue: configOrBasePath } + : { + provide: Configuration, + useValue: new Configuration({ ...configOrBasePath }), + }, + ]); +} \ No newline at end of file diff --git a/devolutions-gateway/openapi/ts-angular-client/query.params.ts b/devolutions-gateway/openapi/ts-angular-client/query.params.ts new file mode 100644 index 000000000..4076c1140 --- /dev/null +++ b/devolutions-gateway/openapi/ts-angular-client/query.params.ts @@ -0,0 +1,160 @@ +import { HttpParams, HttpParameterCodec } from '@angular/common/http'; +import { CustomHttpParameterCodec, IdentityHttpParameterCodec } from './encoder'; + +export enum QueryParamStyle { + Json, + Form, + DeepObject, + SpaceDelimited, + PipeDelimited, +} + +export type Delimiter = "," | " " | "|" | "\t"; + +export interface ParamOptions { + /** When true, serialized as multiple repeated key=value pairs. When false, serialized as a single key with joined values using `delimiter`. */ + explode?: boolean; + /** Delimiter used when explode=false. The delimiter itself is inserted unencoded between encoded values. */ + delimiter?: Delimiter; +} + +interface ParamEntry { + values: string[]; + options: Required; +} + +export class OpenApiHttpParams { + private params: Map = new Map(); + private defaults: Required; + private encoder: HttpParameterCodec; + + /** + * @param encoder Parameter serializer + * @param defaults Global defaults used when a specific parameter has no explicit options. + * By OpenAPI default, explode is true for query params with style=form. + */ + constructor(encoder?: HttpParameterCodec, defaults?: { explode?: boolean; delimiter?: Delimiter }) { + this.encoder = encoder || new CustomHttpParameterCodec(); + this.defaults = { + explode: defaults?.explode ?? true, + delimiter: defaults?.delimiter ?? ",", + }; + } + + private resolveOptions(local?: ParamOptions): Required { + return { + explode: local?.explode ?? this.defaults.explode, + delimiter: local?.delimiter ?? this.defaults.delimiter, + }; + } + + /** + * Replace the parameter's values and (optionally) its options. + * Options are stored per-parameter (not global). + */ + set(key: string, values: string[] | string, options?: ParamOptions): this { + const arr = Array.isArray(values) ? values.slice() : [values]; + const opts = this.resolveOptions(options); + this.params.set(key, {values: arr, options: opts}); + return this; + } + + /** + * Append a single value to the parameter. If the parameter didn't exist it will be created + * and use resolved options (global defaults merged with any provided options). + */ + append(key: string, value: string, options?: ParamOptions): this { + const entry = this.params.get(key); + if (entry) { + // If new options provided, override the stored options for subsequent serialization + if (options) { + entry.options = this.resolveOptions({...entry.options, ...options}); + } + entry.values.push(value); + } else { + this.set(key, [value], options); + } + return this; + } + + /** + * Serialize to a query string according to per-parameter OpenAPI options. + * - If explode=true for that parameter → repeated key=value pairs (each value encoded). + * - If explode=false for that parameter → single key=value where values are individually encoded + * and joined using the configured delimiter. The delimiter character is inserted AS-IS + * (not percent-encoded). + */ + toString(): string { + const records = this.toRecord(); + const parts: string[] = []; + + for (const key in records) { + parts.push(`${key}=${records[key]}`); + } + + return parts.join("&"); + } + + /** + * Return parameters as a plain record. + * - If a parameter has exactly one value, returns that value directly. + * - If a parameter has multiple values, returns a readonly array of values. + */ + toRecord(): Record> { + const parts: Record> = {}; + + for (const [key, entry] of this.params.entries()) { + const encodedKey = this.encoder.encodeKey(key); + + if (entry.options.explode) { + parts[encodedKey] = entry.values.map((v) => this.encoder.encodeValue(v)); + } else { + const encodedValues = entry.values.map((v) => this.encoder.encodeValue(v)); + + // join with the delimiter *unencoded* + parts[encodedKey] = encodedValues.join(entry.options.delimiter); + } + } + + return parts; + } + + /** + * Return an Angular's HttpParams with an identity parameter codec as the parameters are already encoded. + */ + toHttpParams(): HttpParams { + const records = this.toRecord(); + + let httpParams = new HttpParams({encoder: new IdentityHttpParameterCodec()}); + + return httpParams.appendAll(records); + } +} + +export function concatHttpParamsObject(httpParams: OpenApiHttpParams, key: string, item: { + [index: string]: any +}, delimiter: Delimiter): OpenApiHttpParams { + let keyAndValues: string[] = []; + + for (const k in item) { + keyAndValues.push(k); + + const value = item[k]; + + if (Array.isArray(value)) { + keyAndValues.push(...value.map(convertToString)); + } else { + keyAndValues.push(convertToString(value)); + } + } + + return httpParams.set(key, keyAndValues, {explode: false, delimiter: delimiter}); +} + +function convertToString(value: any): string { + if (value instanceof Date) { + return value.toISOString(); + } else { + return value.toString(); + } +} diff --git a/devolutions-gateway/openapi/ts-angular-client/tsconfig.json b/devolutions-gateway/openapi/ts-angular-client/tsconfig.json index 89cdedb1c..eb405ea0e 100644 --- a/devolutions-gateway/openapi/ts-angular-client/tsconfig.json +++ b/devolutions-gateway/openapi/ts-angular-client/tsconfig.json @@ -5,8 +5,11 @@ "noImplicitAny": false, "target": "es5", "module": "commonjs", + "downlevelIteration": true, "moduleResolution": "node", "removeComments": true, + "strictNullChecks": true, + "exactOptionalPropertyTypes": true, "sourceMap": true, "outDir": "./dist", "noLib": false, diff --git a/openapitools.json b/openapitools.json new file mode 100644 index 000000000..936223a5d --- /dev/null +++ b/openapitools.json @@ -0,0 +1,7 @@ +{ + "$schema": "./node_modules/@openapitools/openapi-generator-cli/config.schema.json", + "spaces": 2, + "generator-cli": { + "version": "7.24.0" + } +} From 1650a1f60c2d3d40f5b7db3d74126aa4cd125270 Mon Sep 17 00:00:00 2001 From: Junyi Ou Date: Wed, 29 Jul 2026 13:01:49 -0400 Subject: [PATCH 4/4] chore(openapi): regenerate clients with the pinned generator The previous run used openapi-generator 7.24.0 instead of the 7.9.0 pinned in devolutions-gateway/openapi/openapitools.json. That churned every generated file and bumped the Angular peer dependency from 18 to 21. Also drops the stray openapitools.json that the generator wrapper left at the repository root, and restores the UTF-8 punctuation in the generated gateway document. --- .../openapi/doc/.openapi-generator/VERSION | 2 +- devolutions-gateway/openapi/doc/index.adoc | 69 +- .../dotnet-client/.openapi-generator/VERSION | 2 +- .../openapi/dotnet-client/README.md | 2 +- .../openapi/dotnet-client/docs/NetApi.md | 8 +- .../Api/ConfigApi.cs | 8 +- .../Api/DiagnosticsApi.cs | 24 +- .../Api/HealthApi.cs | 8 +- .../Api/HeartbeatApi.cs | 8 +- .../Devolutions.Gateway.Client/Api/JrecApi.cs | 32 +- .../Devolutions.Gateway.Client/Api/JrlApi.cs | 16 +- .../Devolutions.Gateway.Client/Api/NetApi.cs | 64 +- .../Api/NetworkMonitoringApi.cs | 16 +- .../Api/PreflightApi.cs | 8 +- .../Api/SessionsApi.cs | 16 +- .../Api/TrafficApi.cs | 16 +- .../Api/UpdateApi.cs | 40 +- .../Api/WebAppApi.cs | 16 +- .../Client/ApiClient.cs | 50 +- .../Client/IAsynchronousClient.cs | 14 +- .../Client/IReadableConfiguration.cs | 4 +- .../Client/RetryConfiguration.cs | 4 +- .../Model/AckRequest.cs | 2 +- .../Model/AckResponse.cs | 2 +- .../Model/AppCredential.cs | 2 +- .../Model/AppTokenSignRequest.cs | 2 +- .../Model/ClaimedTrafficEvent.cs | 2 +- .../Model/ClockDiagnostic.cs | 2 +- .../Model/ConfigDiagnostic.cs | 2 +- .../Model/ConfigPatch.cs | 2 +- .../Model/DeleteManyResult.cs | 2 +- .../Model/GetUpdateProductsResponse.cs | 2 +- .../Model/GetUpdateScheduleResponse.cs | 2 +- .../Model/Heartbeat.cs | 2 +- .../Model/Identity.cs | 2 +- .../Model/InterfaceInfo.cs | 2 +- .../Model/JrlInfo.cs | 2 +- .../Model/ListenerUrls.cs | 2 +- .../Model/MonitorDefinition.cs | 2 +- .../Model/MonitorDefinitionProbeTypeError.cs | 2 +- .../Model/MonitorResult.cs | 2 +- .../Model/MonitoringLogResponse.cs | 2 +- .../Model/MonitoringProbeTypeOneOf.cs | 2 +- .../Model/MonitorsConfig.cs | 2 +- .../Model/NetworkInterfaceDto.cs | 2 +- .../Model/NetworkInterfacesResponse.cs | 2 +- .../Model/NetworkScanResultEventDto.cs | 2 +- .../Model/NetworkScanSourceCapabilitiesDto.cs | 2 +- .../Model/NetworkScanSourceDto.cs | 2 +- .../Model/PreflightOperation.cs | 2 +- .../Model/PreflightOutput.cs | 2 +- .../Model/SessionInfo.cs | 2 +- .../Model/SessionTokenSignRequest.cs | 2 +- .../Model/SetConfigResponse.cs | 2 +- .../Model/SetUpdateScheduleRequest.cs | 2 +- .../Model/SubProvisionerKey.cs | 2 +- .../Model/Subscriber.cs | 2 +- .../Model/TrafficEventResponse.cs | 2 +- .../Model/UpdateProductInfo.cs | 2 +- .../Model/UpdateRequestSchema.cs | 2 +- .../.openapi-generator/VERSION | 2 +- .../Devolutions.Gateway.Subscriber.csproj | 50 +- .../Models/SubscriberMessageKind.cs | 12 +- .../.openapi-generator/FILES | 3 - .../.openapi-generator/VERSION | 2 +- .../openapi/ts-angular-client/README.md | 235 ++++--- .../ts-angular-client/api.base.service.ts | 96 --- .../ts-angular-client/api/config.service.ts | 101 ++- .../api/diagnostics.service.ts | 169 +++-- .../ts-angular-client/api/health.service.ts | 97 ++- .../api/heartbeat.service.ts | 103 ++- .../ts-angular-client/api/jrec.service.ts | 226 +++++-- .../ts-angular-client/api/jrl.service.ts | 137 +++- .../ts-angular-client/api/net.service.ts | 605 ++++++++---------- .../api/networkMonitoring.service.ts | 139 +++- .../api/preflight.service.ts | 103 ++- .../ts-angular-client/api/sessions.service.ts | 137 +++- .../ts-angular-client/api/traffic.service.ts | 169 +++-- .../ts-angular-client/api/update.service.ts | 228 +++++-- .../ts-angular-client/api/webApp.service.ts | 139 +++- .../ts-angular-client/configuration.ts | 57 +- .../openapi/ts-angular-client/encoder.ts | 15 - .../openapi/ts-angular-client/index.ts | 1 - .../ts-angular-client/model/accessScope.ts | 43 +- .../ts-angular-client/model/addressFamily.ts | 9 +- .../model/appCredentialKind.ts | 7 +- .../model/appTokenContentType.ts | 7 +- .../ts-angular-client/model/connectionMode.ts | 9 +- .../ts-angular-client/model/dataEncoding.ts | 15 +- .../model/eventOutcomeResponse.ts | 11 +- .../model/hostScanStateDto.ts | 13 +- .../model/networkScanResultKindDto.ts | 9 +- .../model/preflightAlertStatus.ts | 21 +- .../model/preflightOperationKind.ts | 19 +- .../model/preflightOutputKind.ts | 17 +- .../ts-angular-client/model/pubKeyFormat.ts | 9 +- .../ts-angular-client/model/scanOriginDto.ts | 7 +- .../model/scanResultSourceDto.ts | 15 +- .../model/sessionTokenContentType.ts | 11 +- .../model/transportProtocolResponse.ts | 9 +- .../openapi/ts-angular-client/package.json | 18 +- .../openapi/ts-angular-client/provide-api.ts | 15 - .../openapi/ts-angular-client/query.params.ts | 160 ----- .../openapi/ts-angular-client/tsconfig.json | 3 - openapitools.json | 7 - 105 files changed, 2220 insertions(+), 1543 deletions(-) delete mode 100644 devolutions-gateway/openapi/ts-angular-client/api.base.service.ts delete mode 100644 devolutions-gateway/openapi/ts-angular-client/provide-api.ts delete mode 100644 devolutions-gateway/openapi/ts-angular-client/query.params.ts delete mode 100644 openapitools.json diff --git a/devolutions-gateway/openapi/doc/.openapi-generator/VERSION b/devolutions-gateway/openapi/doc/.openapi-generator/VERSION index 07832195c..4bc5d6181 100644 --- a/devolutions-gateway/openapi/doc/.openapi-generator/VERSION +++ b/devolutions-gateway/openapi/doc/.openapi-generator/VERSION @@ -1 +1 @@ -7.24.0 +7.9.0 diff --git a/devolutions-gateway/openapi/doc/index.adoc b/devolutions-gateway/openapi/doc/index.adoc index 7f53b7eb0..7bc10742c 100644 --- a/devolutions-gateway/openapi/doc/index.adoc +++ b/devolutions-gateway/openapi/doc/index.adoc @@ -102,11 +102,13 @@ Modifies configuration | X | | + |=== + ===== Return Type @@ -562,11 +564,13 @@ If you try to delete more than 50,000 recordings at once, you should split the l | X | | + |=== + ===== Return Type <> @@ -665,12 +669,14 @@ Deletes a recording stored on this instance | X | null | + |=== + ===== Return Type @@ -771,8 +777,10 @@ Lists all recordings stored on this instance | X | null | + |=== + ===== Return Type @@ -862,17 +870,20 @@ Retrieves a recording file for a given session | X | null | + | filename | Name of recording file to retrieve | X | null | + |=== + ===== Return Type @@ -1302,163 +1313,196 @@ The endpoint is upgraded from HTTP, so OpenAPI describes the **handshake**: the | - | null | + | ping_timeout | Timeout in milliseconds (default is 500) | - | null | + | broadcast_timeout | Timeout in milliseconds (default is 1000) | - | null | + | port_scan_timeout | Timeout in milliseconds (default is 1000) | - | null | + | netbios_timeout | Timeout in milliseconds (default is 1000) | - | null | + | netbios_interval | Interval in milliseconds (default is 200) | - | null | + | mdns_query_timeout | The maximum time for each mdns query in milliseconds. (default is 5 * 1000) | - | null | + | max_wait | The maximum duration for whole networking scan in milliseconds. Highly suggested! | - | null | + | range | The start and end IP address of the range to scan. for example: 10.10.0.0-10.10.0.255 <> | - | null | + | target | Explicit single-host targets to scan. Each value must parse as an IPv4 or IPv6 address; invalid values yield a structured `{ error: \"invalid_target\", value: \"\" }` 400 rather than a generic serde rejection at extraction time (mirrors the `range=` / `probe=` validation path). <> | - | null | + | interface_id | Gateway network interface IDs to use as scan sources. <> | - | null | + | probe -| The probes to run. Each value is either `ping`, a port number (`22`), or a named service (`rdp`, `https`, ΓǪ). Validation is deferred to scan-time so failures can be surfaced as a structured 400 ΓÇö naming the offending value ΓÇö instead of a generic serde rejection at extraction time. <> +| The probes to run. Each value is either `ping`, a port number (`22`), or a named service (`rdp`, `https`, …). Validation is deferred to scan-time so failures can be surfaced as a structured 400 — naming the offending value — instead of a generic serde rejection at extraction time. <> | - | null | + | enable_ping_start | **Legacy alias** for `report_ping_start`. Prefer the explicit name in new clients; kept so existing consumers don't break. | - | null | + | enable_broadcast | Enable the execution of broadcast scan | - | null | + | enable_subnet_scan | Enable the ping scan on subnet | - | null | + | enable_zeroconf | Enable ZeroConf/mDNS | - | null | + | enable_netbios | Enable NetBIOS name-service queries. Default `true` for backward compatibility. Set `false` (or pair with explicit `target=`) to keep NetBIOS from sweeping the surrounding subnet when the caller only wants results for the targets they listed. | - | null | + | enable_resolve_dns | Enable resolve dns | - | null | + | include_host_results | Include host-only results. | - | null | + | report_ping_start | Emit ping queued/start host results. | - | null | + | report_ping_success | Emit ping success host results. | - | null | + | report_ping_failure | Emit ping failure host results. | - | null | + | enable_tcp_probes | Enable TCP service probes. | - | null | + | range_interface_policy | Policy applied when `range=` and `interface_id=` are both provided. Accepted values: `intersect_selected_interfaces` (default) or `allow_cross_interface_range`. Invalid values yield a structured `{ error: \"invalid_range_interface_policy\", value: \"\" }` 400 instead of a generic serde rejection (mirrors the `range=` / `probe=` / `target=` validation path). | - | null | + | allow_cross_interface_range | **Legacy alias** for `range_interface_policy=allow_cross_interface_range`. Prefer the structured policy in new clients. | - | null | + | response_format | Response shape emitted on the websocket. Accepted values: `legacy` (default) or `network_scan_result_v1`. Invalid values yield a structured `{ error: \"invalid_response_format\", value: \"\" }` 400 instead of a generic serde rejection. | - | null | + | max_concurrency | Maximum scanner concurrency. | - | null | + | max_ping_concurrency | Maximum ping probe concurrency. | - | null | + | max_tcp_probe_concurrency | Maximum TCP probe concurrency. | - | null | + | enable_failure -| **Legacy alias** for `report_ping_failure`. `enable_failure=true` only opts into ping-failure events; TCP-probe failure events require the explicit `report_tcp_failure=true` and are not affected by this alias. **Behavior change:** historically this single flag controlled both ping-failure and TCP-probe-failure reporting. The two are now split: clients that want the old \"both at once\" semantics must send `enable_failure=true&report_tcp_failure=true` together. The split is intentional ΓÇö TCP-probe failures are typically high-volume noise that callers were filtering client-side anyway, so the two streams are independently gated. +| **Legacy alias** for `report_ping_failure`. `enable_failure=true` only opts into ping-failure events; TCP-probe failure events require the explicit `report_tcp_failure=true` and are not affected by this alias. **Behavior change:** historically this single flag controlled both ping-failure and TCP-probe-failure reporting. The two are now split: clients that want the old \"both at once\" semantics must send `enable_failure=true&report_tcp_failure=true` together. The split is intentional — TCP-probe failures are typically high-volume noise that callers were filtering client-side anyway, so the two streams are independently gated. | - | null | + | report_tcp_failure | Enable TCP port knocking failure events. | - | null | + | interface_bind_strict | When `true`, fail with HTTP 400 if a ping/TCP-probe socket cannot be bound to the planner-selected interface. Default `false` (warn and fall back to default routing). | - | null | + |=== + ===== Return Type @@ -1636,11 +1680,13 @@ Changes take effect immediately: - Starts any monitors newly defined in the payl | X | | + |=== + ===== Return Type <> @@ -1739,11 +1785,13 @@ Performs a batch of preflight operations | X | | + |=== + ===== Return Type array[<>] @@ -1917,12 +1965,14 @@ Terminate forcefully a running session | X | null | + |=== + ===== Return Type @@ -2024,11 +2074,13 @@ Acknowledge traffic audit events and remove them from the queue | X | | + |=== + ===== Return Type <> @@ -2131,13 +2183,16 @@ Claim traffic audit events for processing | X | null | + | max | Maximum number of events to claim (1-1000, default: 100) | X | null | + |=== + ===== Return Type array[<>] @@ -2398,11 +2453,13 @@ Writes the `Schedule` field into `update.json`. The agent watches this file and | X | | + |=== + ===== Return Type @@ -2503,6 +2560,7 @@ Writes the requested version(s) into `Agent/update.json`, which is watched by De | - | | + |=== @@ -2518,8 +2576,10 @@ Writes the requested version(s) into `Agent/update.json`, which is watched by De | - | null | + |=== + ===== Return Type @@ -2624,11 +2684,13 @@ Requests a web application token using the configured authorization method | X | | + |=== + ===== Return Type @@ -2724,11 +2786,13 @@ Requests a session token using a web application token | X | | + |=== + ===== Return Type @@ -4947,3 +5011,4 @@ and whose values are update information. |=== + diff --git a/devolutions-gateway/openapi/dotnet-client/.openapi-generator/VERSION b/devolutions-gateway/openapi/dotnet-client/.openapi-generator/VERSION index 07832195c..4bc5d6181 100644 --- a/devolutions-gateway/openapi/dotnet-client/.openapi-generator/VERSION +++ b/devolutions-gateway/openapi/dotnet-client/.openapi-generator/VERSION @@ -1 +1 @@ -7.24.0 +7.9.0 diff --git a/devolutions-gateway/openapi/dotnet-client/README.md b/devolutions-gateway/openapi/dotnet-client/README.md index 1b88aca9f..38bc4d138 100644 --- a/devolutions-gateway/openapi/dotnet-client/README.md +++ b/devolutions-gateway/openapi/dotnet-client/README.md @@ -6,7 +6,7 @@ This C# SDK is automatically generated by the [OpenAPI Generator](https://openap - API version: 2026.2.4 - SDK version: 2025.12.2 -- Generator version: 7.24.0 +- Generator version: 7.9.0 - Build package: org.openapitools.codegen.languages.CSharpClientCodegen diff --git a/devolutions-gateway/openapi/dotnet-client/docs/NetApi.md b/devolutions-gateway/openapi/dotnet-client/docs/NetApi.md index 4dead2e60..b3e5663e9 100644 --- a/devolutions-gateway/openapi/dotnet-client/docs/NetApi.md +++ b/devolutions-gateway/openapi/dotnet-client/docs/NetApi.md @@ -241,7 +241,7 @@ namespace Example var range = new List?(); // List? | The start and end IP address of the range to scan. for example: 10.10.0.0-10.10.0.255 (optional) var target = new List?(); // List? | Explicit single-host targets to scan. Each value must parse as an IPv4 or IPv6 address; invalid values yield a structured `{ error: \"invalid_target\", value: \"\" }` 400 rather than a generic serde rejection at extraction time (mirrors the `range=` / `probe=` validation path). (optional) var interfaceId = new List?(); // List? | Gateway network interface IDs to use as scan sources. (optional) - var probe = new List?(); // List? | The probes to run. Each value is either `ping`, a port number (`22`), or a named service (`rdp`, `https`, ΓǪ). Validation is deferred to scan-time so failures can be surfaced as a structured 400 ΓÇö naming the offending value ΓÇö instead of a generic serde rejection at extraction time. (optional) + var probe = new List?(); // List? | The probes to run. Each value is either `ping`, a port number (`22`), or a named service (`rdp`, `https`, …). Validation is deferred to scan-time so failures can be surfaced as a structured 400 — naming the offending value — instead of a generic serde rejection at extraction time. (optional) var enablePingStart = true; // bool? | **Legacy alias** for `report_ping_start`. Prefer the explicit name in new clients; kept so existing consumers don't break. (optional) var enableBroadcast = true; // bool? | Enable the execution of broadcast scan (optional) var enableSubnetScan = true; // bool? | Enable the ping scan on subnet (optional) @@ -259,7 +259,7 @@ namespace Example var maxConcurrency = 56; // int? | Maximum scanner concurrency. (optional) var maxPingConcurrency = 56; // int? | Maximum ping probe concurrency. (optional) var maxTcpProbeConcurrency = 56; // int? | Maximum TCP probe concurrency. (optional) - var enableFailure = true; // bool? | **Legacy alias** for `report_ping_failure`. `enable_failure=true` only opts into ping-failure events; TCP-probe failure events require the explicit `report_tcp_failure=true` and are not affected by this alias. **Behavior change:** historically this single flag controlled both ping-failure and TCP-probe-failure reporting. The two are now split: clients that want the old \"both at once\" semantics must send `enable_failure=true&report_tcp_failure=true` together. The split is intentional ΓÇö TCP-probe failures are typically high-volume noise that callers were filtering client-side anyway, so the two streams are independently gated. (optional) + var enableFailure = true; // bool? | **Legacy alias** for `report_ping_failure`. `enable_failure=true` only opts into ping-failure events; TCP-probe failure events require the explicit `report_tcp_failure=true` and are not affected by this alias. **Behavior change:** historically this single flag controlled both ping-failure and TCP-probe-failure reporting. The two are now split: clients that want the old \"both at once\" semantics must send `enable_failure=true&report_tcp_failure=true` together. The split is intentional — TCP-probe failures are typically high-volume noise that callers were filtering client-side anyway, so the two streams are independently gated. (optional) var reportTcpFailure = true; // bool? | Enable TCP port knocking failure events. (optional) var interfaceBindStrict = true; // bool? | When `true`, fail with HTTP 400 if a ping/TCP-probe socket cannot be bound to the planner-selected interface. Default `false` (warn and fall back to default routing). (optional) @@ -311,7 +311,7 @@ catch (ApiException e) | **range** | [**List<string>?**](string.md) | The start and end IP address of the range to scan. for example: 10.10.0.0-10.10.0.255 | [optional] | | **target** | [**List<string>?**](string.md) | Explicit single-host targets to scan. Each value must parse as an IPv4 or IPv6 address; invalid values yield a structured `{ error: \"invalid_target\", value: \"<raw>\" }` 400 rather than a generic serde rejection at extraction time (mirrors the `range=` / `probe=` validation path). | [optional] | | **interfaceId** | [**List<string>?**](string.md) | Gateway network interface IDs to use as scan sources. | [optional] | -| **probe** | [**List<string>?**](string.md) | The probes to run. Each value is either `ping`, a port number (`22`), or a named service (`rdp`, `https`, ΓǪ). Validation is deferred to scan-time so failures can be surfaced as a structured 400 ΓÇö naming the offending value ΓÇö instead of a generic serde rejection at extraction time. | [optional] | +| **probe** | [**List<string>?**](string.md) | The probes to run. Each value is either `ping`, a port number (`22`), or a named service (`rdp`, `https`, …). Validation is deferred to scan-time so failures can be surfaced as a structured 400 — naming the offending value — instead of a generic serde rejection at extraction time. | [optional] | | **enablePingStart** | **bool?** | **Legacy alias** for `report_ping_start`. Prefer the explicit name in new clients; kept so existing consumers don't break. | [optional] | | **enableBroadcast** | **bool?** | Enable the execution of broadcast scan | [optional] | | **enableSubnetScan** | **bool?** | Enable the ping scan on subnet | [optional] | @@ -329,7 +329,7 @@ catch (ApiException e) | **maxConcurrency** | **int?** | Maximum scanner concurrency. | [optional] | | **maxPingConcurrency** | **int?** | Maximum ping probe concurrency. | [optional] | | **maxTcpProbeConcurrency** | **int?** | Maximum TCP probe concurrency. | [optional] | -| **enableFailure** | **bool?** | **Legacy alias** for `report_ping_failure`. `enable_failure=true` only opts into ping-failure events; TCP-probe failure events require the explicit `report_tcp_failure=true` and are not affected by this alias. **Behavior change:** historically this single flag controlled both ping-failure and TCP-probe-failure reporting. The two are now split: clients that want the old \"both at once\" semantics must send `enable_failure=true&report_tcp_failure=true` together. The split is intentional ΓÇö TCP-probe failures are typically high-volume noise that callers were filtering client-side anyway, so the two streams are independently gated. | [optional] | +| **enableFailure** | **bool?** | **Legacy alias** for `report_ping_failure`. `enable_failure=true` only opts into ping-failure events; TCP-probe failure events require the explicit `report_tcp_failure=true` and are not affected by this alias. **Behavior change:** historically this single flag controlled both ping-failure and TCP-probe-failure reporting. The two are now split: clients that want the old \"both at once\" semantics must send `enable_failure=true&report_tcp_failure=true` together. The split is intentional — TCP-probe failures are typically high-volume noise that callers were filtering client-side anyway, so the two streams are independently gated. | [optional] | | **reportTcpFailure** | **bool?** | Enable TCP port knocking failure events. | [optional] | | **interfaceBindStrict** | **bool?** | When `true`, fail with HTTP 400 if a ping/TCP-probe socket cannot be bound to the planner-selected interface. Default `false` (warn and fall back to default routing). | [optional] | diff --git a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Api/ConfigApi.cs b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Api/ConfigApi.cs index 0472c53c2..49012f143 100644 --- a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Api/ConfigApi.cs +++ b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Api/ConfigApi.cs @@ -65,7 +65,7 @@ public interface IConfigApiAsync : IApiAccessor /// JSON-encoded configuration patch /// Cancellation Token to cancel the request. /// Task of void - System.Threading.Tasks.Task PatchConfigAsync(ConfigPatch configPatch, System.Threading.CancellationToken cancellationToken = default); + System.Threading.Tasks.Task PatchConfigAsync(ConfigPatch configPatch, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Modifies configuration @@ -77,7 +77,7 @@ public interface IConfigApiAsync : IApiAccessor /// JSON-encoded configuration patch /// Cancellation Token to cancel the request. /// Task of ApiResponse - System.Threading.Tasks.Task> PatchConfigWithHttpInfoAsync(ConfigPatch configPatch, System.Threading.CancellationToken cancellationToken = default); + System.Threading.Tasks.Task> PatchConfigWithHttpInfoAsync(ConfigPatch configPatch, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); #endregion Asynchronous Operations } @@ -358,7 +358,7 @@ public Devolutions.Gateway.Client.Client.ApiResponse PatchConfigWithHttp /// JSON-encoded configuration patch /// Cancellation Token to cancel the request. /// Task of void - public async System.Threading.Tasks.Task PatchConfigAsync(ConfigPatch configPatch, System.Threading.CancellationToken cancellationToken = default) + public async System.Threading.Tasks.Task PatchConfigAsync(ConfigPatch configPatch, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { await PatchConfigWithHttpInfoAsync(configPatch, cancellationToken).ConfigureAwait(false); } @@ -370,7 +370,7 @@ public async System.Threading.Tasks.Task PatchConfigAsync(ConfigPatch configPatc /// JSON-encoded configuration patch /// Cancellation Token to cancel the request. /// Task of ApiResponse - public async System.Threading.Tasks.Task> PatchConfigWithHttpInfoAsync(ConfigPatch configPatch, System.Threading.CancellationToken cancellationToken = default) + public async System.Threading.Tasks.Task> PatchConfigWithHttpInfoAsync(ConfigPatch configPatch, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { // verify the required parameter 'configPatch' is set if (configPatch == null) diff --git a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Api/DiagnosticsApi.cs b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Api/DiagnosticsApi.cs index f551f173a..9d9540715 100644 --- a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Api/DiagnosticsApi.cs +++ b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Api/DiagnosticsApi.cs @@ -100,7 +100,7 @@ public interface IDiagnosticsApiAsync : IApiAccessor /// Thrown when fails to make API call /// Cancellation Token to cancel the request. /// Task of ClockDiagnostic - System.Threading.Tasks.Task GetClockDiagnosticAsync(System.Threading.CancellationToken cancellationToken = default); + System.Threading.Tasks.Task GetClockDiagnosticAsync(System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Retrieves server's clock in order to diagnose clock drifting. @@ -111,7 +111,7 @@ public interface IDiagnosticsApiAsync : IApiAccessor /// Thrown when fails to make API call /// Cancellation Token to cancel the request. /// Task of ApiResponse (ClockDiagnostic) - System.Threading.Tasks.Task> GetClockDiagnosticWithHttpInfoAsync(System.Threading.CancellationToken cancellationToken = default); + System.Threading.Tasks.Task> GetClockDiagnosticWithHttpInfoAsync(System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Retrieves a subset of the configuration, for diagnosis purposes. /// @@ -121,7 +121,7 @@ public interface IDiagnosticsApiAsync : IApiAccessor /// Thrown when fails to make API call /// Cancellation Token to cancel the request. /// Task of ConfigDiagnostic - System.Threading.Tasks.Task GetConfigurationDiagnosticAsync(System.Threading.CancellationToken cancellationToken = default); + System.Threading.Tasks.Task GetConfigurationDiagnosticAsync(System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Retrieves a subset of the configuration, for diagnosis purposes. @@ -132,7 +132,7 @@ public interface IDiagnosticsApiAsync : IApiAccessor /// Thrown when fails to make API call /// Cancellation Token to cancel the request. /// Task of ApiResponse (ConfigDiagnostic) - System.Threading.Tasks.Task> GetConfigurationDiagnosticWithHttpInfoAsync(System.Threading.CancellationToken cancellationToken = default); + System.Threading.Tasks.Task> GetConfigurationDiagnosticWithHttpInfoAsync(System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Retrieves latest logs. /// @@ -142,7 +142,7 @@ public interface IDiagnosticsApiAsync : IApiAccessor /// Thrown when fails to make API call /// Cancellation Token to cancel the request. /// Task of string - System.Threading.Tasks.Task GetLogsAsync(System.Threading.CancellationToken cancellationToken = default); + System.Threading.Tasks.Task GetLogsAsync(System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Retrieves latest logs. @@ -153,7 +153,7 @@ public interface IDiagnosticsApiAsync : IApiAccessor /// Thrown when fails to make API call /// Cancellation Token to cancel the request. /// Task of ApiResponse (string) - System.Threading.Tasks.Task> GetLogsWithHttpInfoAsync(System.Threading.CancellationToken cancellationToken = default); + System.Threading.Tasks.Task> GetLogsWithHttpInfoAsync(System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); #endregion Asynchronous Operations } @@ -421,7 +421,7 @@ public Devolutions.Gateway.Client.Client.ApiResponse GetClockDi /// Thrown when fails to make API call /// Cancellation Token to cancel the request. /// Task of ClockDiagnostic - public async System.Threading.Tasks.Task GetClockDiagnosticAsync(System.Threading.CancellationToken cancellationToken = default) + public async System.Threading.Tasks.Task GetClockDiagnosticAsync(System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { Devolutions.Gateway.Client.Client.ApiResponse localVarResponse = await GetClockDiagnosticWithHttpInfoAsync(cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -433,7 +433,7 @@ public async System.Threading.Tasks.Task GetClockDiagnosticAsyn /// Thrown when fails to make API call /// Cancellation Token to cancel the request. /// Task of ApiResponse (ClockDiagnostic) - public async System.Threading.Tasks.Task> GetClockDiagnosticWithHttpInfoAsync(System.Threading.CancellationToken cancellationToken = default) + public async System.Threading.Tasks.Task> GetClockDiagnosticWithHttpInfoAsync(System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { Devolutions.Gateway.Client.Client.RequestOptions localVarRequestOptions = new Devolutions.Gateway.Client.Client.RequestOptions(); @@ -528,7 +528,7 @@ public Devolutions.Gateway.Client.Client.ApiResponse GetConfig /// Thrown when fails to make API call /// Cancellation Token to cancel the request. /// Task of ConfigDiagnostic - public async System.Threading.Tasks.Task GetConfigurationDiagnosticAsync(System.Threading.CancellationToken cancellationToken = default) + public async System.Threading.Tasks.Task GetConfigurationDiagnosticAsync(System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { Devolutions.Gateway.Client.Client.ApiResponse localVarResponse = await GetConfigurationDiagnosticWithHttpInfoAsync(cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -540,7 +540,7 @@ public async System.Threading.Tasks.Task GetConfigurationDiagn /// Thrown when fails to make API call /// Cancellation Token to cancel the request. /// Task of ApiResponse (ConfigDiagnostic) - public async System.Threading.Tasks.Task> GetConfigurationDiagnosticWithHttpInfoAsync(System.Threading.CancellationToken cancellationToken = default) + public async System.Threading.Tasks.Task> GetConfigurationDiagnosticWithHttpInfoAsync(System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { Devolutions.Gateway.Client.Client.RequestOptions localVarRequestOptions = new Devolutions.Gateway.Client.Client.RequestOptions(); @@ -641,7 +641,7 @@ public Devolutions.Gateway.Client.Client.ApiResponse GetLogsWithHttpInfo /// Thrown when fails to make API call /// Cancellation Token to cancel the request. /// Task of string - public async System.Threading.Tasks.Task GetLogsAsync(System.Threading.CancellationToken cancellationToken = default) + public async System.Threading.Tasks.Task GetLogsAsync(System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { Devolutions.Gateway.Client.Client.ApiResponse localVarResponse = await GetLogsWithHttpInfoAsync(cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -653,7 +653,7 @@ public async System.Threading.Tasks.Task GetLogsAsync(System.Threading.C /// Thrown when fails to make API call /// Cancellation Token to cancel the request. /// Task of ApiResponse (string) - public async System.Threading.Tasks.Task> GetLogsWithHttpInfoAsync(System.Threading.CancellationToken cancellationToken = default) + public async System.Threading.Tasks.Task> GetLogsWithHttpInfoAsync(System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { Devolutions.Gateway.Client.Client.RequestOptions localVarRequestOptions = new Devolutions.Gateway.Client.Client.RequestOptions(); diff --git a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Api/HealthApi.cs b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Api/HealthApi.cs index 0343b33d4..328a0ba4a 100644 --- a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Api/HealthApi.cs +++ b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Api/HealthApi.cs @@ -62,7 +62,7 @@ public interface IHealthApiAsync : IApiAccessor /// Thrown when fails to make API call /// Cancellation Token to cancel the request. /// Task of Identity - System.Threading.Tasks.Task GetHealthAsync(System.Threading.CancellationToken cancellationToken = default); + System.Threading.Tasks.Task GetHealthAsync(System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Performs a health check @@ -73,7 +73,7 @@ public interface IHealthApiAsync : IApiAccessor /// Thrown when fails to make API call /// Cancellation Token to cancel the request. /// Task of ApiResponse (Identity) - System.Threading.Tasks.Task> GetHealthWithHttpInfoAsync(System.Threading.CancellationToken cancellationToken = default); + System.Threading.Tasks.Task> GetHealthWithHttpInfoAsync(System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); #endregion Asynchronous Operations } @@ -341,7 +341,7 @@ public Devolutions.Gateway.Client.Client.ApiResponse GetHealthWithHttp /// Thrown when fails to make API call /// Cancellation Token to cancel the request. /// Task of Identity - public async System.Threading.Tasks.Task GetHealthAsync(System.Threading.CancellationToken cancellationToken = default) + public async System.Threading.Tasks.Task GetHealthAsync(System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { Devolutions.Gateway.Client.Client.ApiResponse localVarResponse = await GetHealthWithHttpInfoAsync(cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -353,7 +353,7 @@ public async System.Threading.Tasks.Task GetHealthAsync(System.Threadi /// Thrown when fails to make API call /// Cancellation Token to cancel the request. /// Task of ApiResponse (Identity) - public async System.Threading.Tasks.Task> GetHealthWithHttpInfoAsync(System.Threading.CancellationToken cancellationToken = default) + public async System.Threading.Tasks.Task> GetHealthWithHttpInfoAsync(System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { Devolutions.Gateway.Client.Client.RequestOptions localVarRequestOptions = new Devolutions.Gateway.Client.Client.RequestOptions(); diff --git a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Api/HeartbeatApi.cs b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Api/HeartbeatApi.cs index 9cb6163b5..5a5a67302 100644 --- a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Api/HeartbeatApi.cs +++ b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Api/HeartbeatApi.cs @@ -62,7 +62,7 @@ public interface IHeartbeatApiAsync : IApiAccessor /// Thrown when fails to make API call /// Cancellation Token to cancel the request. /// Task of Heartbeat - System.Threading.Tasks.Task GetHeartbeatAsync(System.Threading.CancellationToken cancellationToken = default); + System.Threading.Tasks.Task GetHeartbeatAsync(System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Performs a heartbeat check @@ -73,7 +73,7 @@ public interface IHeartbeatApiAsync : IApiAccessor /// Thrown when fails to make API call /// Cancellation Token to cancel the request. /// Task of ApiResponse (Heartbeat) - System.Threading.Tasks.Task> GetHeartbeatWithHttpInfoAsync(System.Threading.CancellationToken cancellationToken = default); + System.Threading.Tasks.Task> GetHeartbeatWithHttpInfoAsync(System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); #endregion Asynchronous Operations } @@ -347,7 +347,7 @@ public Devolutions.Gateway.Client.Client.ApiResponse GetHeartbeatWith /// Thrown when fails to make API call /// Cancellation Token to cancel the request. /// Task of Heartbeat - public async System.Threading.Tasks.Task GetHeartbeatAsync(System.Threading.CancellationToken cancellationToken = default) + public async System.Threading.Tasks.Task GetHeartbeatAsync(System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { Devolutions.Gateway.Client.Client.ApiResponse localVarResponse = await GetHeartbeatWithHttpInfoAsync(cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -359,7 +359,7 @@ public async System.Threading.Tasks.Task GetHeartbeatAsync(System.Thr /// Thrown when fails to make API call /// Cancellation Token to cancel the request. /// Task of ApiResponse (Heartbeat) - public async System.Threading.Tasks.Task> GetHeartbeatWithHttpInfoAsync(System.Threading.CancellationToken cancellationToken = default) + public async System.Threading.Tasks.Task> GetHeartbeatWithHttpInfoAsync(System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { Devolutions.Gateway.Client.Client.RequestOptions localVarRequestOptions = new Devolutions.Gateway.Client.Client.RequestOptions(); diff --git a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Api/JrecApi.cs b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Api/JrecApi.cs index 228de55ec..dd2fe3342 100644 --- a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Api/JrecApi.cs +++ b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Api/JrecApi.cs @@ -124,7 +124,7 @@ public interface IJrecApiAsync : IApiAccessor /// JSON-encoded list of session IDs /// Cancellation Token to cancel the request. /// Task of DeleteManyResult - System.Threading.Tasks.Task DeleteManyRecordingsAsync(List requestBody, System.Threading.CancellationToken cancellationToken = default); + System.Threading.Tasks.Task DeleteManyRecordingsAsync(List requestBody, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Mass-deletes recordings stored on this instance @@ -136,7 +136,7 @@ public interface IJrecApiAsync : IApiAccessor /// JSON-encoded list of session IDs /// Cancellation Token to cancel the request. /// Task of ApiResponse (DeleteManyResult) - System.Threading.Tasks.Task> DeleteManyRecordingsWithHttpInfoAsync(List requestBody, System.Threading.CancellationToken cancellationToken = default); + System.Threading.Tasks.Task> DeleteManyRecordingsWithHttpInfoAsync(List requestBody, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Deletes a recording stored on this instance /// @@ -147,7 +147,7 @@ public interface IJrecApiAsync : IApiAccessor /// Recorded session ID /// Cancellation Token to cancel the request. /// Task of void - System.Threading.Tasks.Task DeleteRecordingAsync(Guid id, System.Threading.CancellationToken cancellationToken = default); + System.Threading.Tasks.Task DeleteRecordingAsync(Guid id, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Deletes a recording stored on this instance @@ -159,7 +159,7 @@ public interface IJrecApiAsync : IApiAccessor /// Recorded session ID /// Cancellation Token to cancel the request. /// Task of ApiResponse - System.Threading.Tasks.Task> DeleteRecordingWithHttpInfoAsync(Guid id, System.Threading.CancellationToken cancellationToken = default); + System.Threading.Tasks.Task> DeleteRecordingWithHttpInfoAsync(Guid id, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Lists all recordings stored on this instance /// @@ -170,7 +170,7 @@ public interface IJrecApiAsync : IApiAccessor /// When true, only the active recordings are returned /// Cancellation Token to cancel the request. /// Task of List<Guid> - System.Threading.Tasks.Task> ListRecordingsAsync(bool active, System.Threading.CancellationToken cancellationToken = default); + System.Threading.Tasks.Task> ListRecordingsAsync(bool active, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Lists all recordings stored on this instance @@ -182,7 +182,7 @@ public interface IJrecApiAsync : IApiAccessor /// When true, only the active recordings are returned /// Cancellation Token to cancel the request. /// Task of ApiResponse (List<Guid>) - System.Threading.Tasks.Task>> ListRecordingsWithHttpInfoAsync(bool active, System.Threading.CancellationToken cancellationToken = default); + System.Threading.Tasks.Task>> ListRecordingsWithHttpInfoAsync(bool active, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Retrieves a recording file for a given session /// @@ -194,7 +194,7 @@ public interface IJrecApiAsync : IApiAccessor /// Name of recording file to retrieve /// Cancellation Token to cancel the request. /// Task of FileParameter - System.Threading.Tasks.Task PullRecordingFileAsync(Guid id, string filename, System.Threading.CancellationToken cancellationToken = default); + System.Threading.Tasks.Task PullRecordingFileAsync(Guid id, string filename, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Retrieves a recording file for a given session @@ -207,7 +207,7 @@ public interface IJrecApiAsync : IApiAccessor /// Name of recording file to retrieve /// Cancellation Token to cancel the request. /// Task of ApiResponse (FileParameter) - System.Threading.Tasks.Task> PullRecordingFileWithHttpInfoAsync(Guid id, string filename, System.Threading.CancellationToken cancellationToken = default); + System.Threading.Tasks.Task> PullRecordingFileWithHttpInfoAsync(Guid id, string filename, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); #endregion Asynchronous Operations } @@ -490,7 +490,7 @@ public Devolutions.Gateway.Client.Client.ApiResponse DeleteMan /// JSON-encoded list of session IDs /// Cancellation Token to cancel the request. /// Task of DeleteManyResult - public async System.Threading.Tasks.Task DeleteManyRecordingsAsync(List requestBody, System.Threading.CancellationToken cancellationToken = default) + public async System.Threading.Tasks.Task DeleteManyRecordingsAsync(List requestBody, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { Devolutions.Gateway.Client.Client.ApiResponse localVarResponse = await DeleteManyRecordingsWithHttpInfoAsync(requestBody, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -503,7 +503,7 @@ public async System.Threading.Tasks.Task DeleteManyRecordingsA /// JSON-encoded list of session IDs /// Cancellation Token to cancel the request. /// Task of ApiResponse (DeleteManyResult) - public async System.Threading.Tasks.Task> DeleteManyRecordingsWithHttpInfoAsync(List requestBody, System.Threading.CancellationToken cancellationToken = default) + public async System.Threading.Tasks.Task> DeleteManyRecordingsWithHttpInfoAsync(List requestBody, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { // verify the required parameter 'requestBody' is set if (requestBody == null) @@ -612,7 +612,7 @@ public Devolutions.Gateway.Client.Client.ApiResponse DeleteRecordingWith /// Recorded session ID /// Cancellation Token to cancel the request. /// Task of void - public async System.Threading.Tasks.Task DeleteRecordingAsync(Guid id, System.Threading.CancellationToken cancellationToken = default) + public async System.Threading.Tasks.Task DeleteRecordingAsync(Guid id, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { await DeleteRecordingWithHttpInfoAsync(id, cancellationToken).ConfigureAwait(false); } @@ -624,7 +624,7 @@ public async System.Threading.Tasks.Task DeleteRecordingAsync(Guid id, System.Th /// Recorded session ID /// Cancellation Token to cancel the request. /// Task of ApiResponse - public async System.Threading.Tasks.Task> DeleteRecordingWithHttpInfoAsync(Guid id, System.Threading.CancellationToken cancellationToken = default) + public async System.Threading.Tasks.Task> DeleteRecordingWithHttpInfoAsync(Guid id, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { Devolutions.Gateway.Client.Client.RequestOptions localVarRequestOptions = new Devolutions.Gateway.Client.Client.RequestOptions(); @@ -729,7 +729,7 @@ public Devolutions.Gateway.Client.Client.ApiResponse> ListRecordingsW /// When true, only the active recordings are returned /// Cancellation Token to cancel the request. /// Task of List<Guid> - public async System.Threading.Tasks.Task> ListRecordingsAsync(bool active, System.Threading.CancellationToken cancellationToken = default) + public async System.Threading.Tasks.Task> ListRecordingsAsync(bool active, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { Devolutions.Gateway.Client.Client.ApiResponse> localVarResponse = await ListRecordingsWithHttpInfoAsync(active, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -742,7 +742,7 @@ public async System.Threading.Tasks.Task> ListRecordingsAsync(bool ac /// When true, only the active recordings are returned /// Cancellation Token to cancel the request. /// Task of ApiResponse (List<Guid>) - public async System.Threading.Tasks.Task>> ListRecordingsWithHttpInfoAsync(bool active, System.Threading.CancellationToken cancellationToken = default) + public async System.Threading.Tasks.Task>> ListRecordingsWithHttpInfoAsync(bool active, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { Devolutions.Gateway.Client.Client.RequestOptions localVarRequestOptions = new Devolutions.Gateway.Client.Client.RequestOptions(); @@ -856,7 +856,7 @@ public Devolutions.Gateway.Client.Client.ApiResponse PullRecordin /// Name of recording file to retrieve /// Cancellation Token to cancel the request. /// Task of FileParameter - public async System.Threading.Tasks.Task PullRecordingFileAsync(Guid id, string filename, System.Threading.CancellationToken cancellationToken = default) + public async System.Threading.Tasks.Task PullRecordingFileAsync(Guid id, string filename, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { Devolutions.Gateway.Client.Client.ApiResponse localVarResponse = await PullRecordingFileWithHttpInfoAsync(id, filename, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -870,7 +870,7 @@ public async System.Threading.Tasks.Task PullRecordingFileAsync(G /// Name of recording file to retrieve /// Cancellation Token to cancel the request. /// Task of ApiResponse (FileParameter) - public async System.Threading.Tasks.Task> PullRecordingFileWithHttpInfoAsync(Guid id, string filename, System.Threading.CancellationToken cancellationToken = default) + public async System.Threading.Tasks.Task> PullRecordingFileWithHttpInfoAsync(Guid id, string filename, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { // verify the required parameter 'filename' is set if (filename == null) diff --git a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Api/JrlApi.cs b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Api/JrlApi.cs index 62f71a93d..79c8443e5 100644 --- a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Api/JrlApi.cs +++ b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Api/JrlApi.cs @@ -78,7 +78,7 @@ public interface IJrlApiAsync : IApiAccessor /// Thrown when fails to make API call /// Cancellation Token to cancel the request. /// Task of JrlInfo - System.Threading.Tasks.Task GetJrlInfoAsync(System.Threading.CancellationToken cancellationToken = default); + System.Threading.Tasks.Task GetJrlInfoAsync(System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Retrieves current JRL (Json Revocation List) info @@ -89,7 +89,7 @@ public interface IJrlApiAsync : IApiAccessor /// Thrown when fails to make API call /// Cancellation Token to cancel the request. /// Task of ApiResponse (JrlInfo) - System.Threading.Tasks.Task> GetJrlInfoWithHttpInfoAsync(System.Threading.CancellationToken cancellationToken = default); + System.Threading.Tasks.Task> GetJrlInfoWithHttpInfoAsync(System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Updates JRL (Json Revocation List) using a JRL token /// @@ -99,7 +99,7 @@ public interface IJrlApiAsync : IApiAccessor /// Thrown when fails to make API call /// Cancellation Token to cancel the request. /// Task of void - System.Threading.Tasks.Task UpdateJrlAsync(System.Threading.CancellationToken cancellationToken = default); + System.Threading.Tasks.Task UpdateJrlAsync(System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Updates JRL (Json Revocation List) using a JRL token @@ -110,7 +110,7 @@ public interface IJrlApiAsync : IApiAccessor /// Thrown when fails to make API call /// Cancellation Token to cancel the request. /// Task of ApiResponse - System.Threading.Tasks.Task> UpdateJrlWithHttpInfoAsync(System.Threading.CancellationToken cancellationToken = default); + System.Threading.Tasks.Task> UpdateJrlWithHttpInfoAsync(System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); #endregion Asynchronous Operations } @@ -384,7 +384,7 @@ public Devolutions.Gateway.Client.Client.ApiResponse GetJrlInfoWithHttp /// Thrown when fails to make API call /// Cancellation Token to cancel the request. /// Task of JrlInfo - public async System.Threading.Tasks.Task GetJrlInfoAsync(System.Threading.CancellationToken cancellationToken = default) + public async System.Threading.Tasks.Task GetJrlInfoAsync(System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { Devolutions.Gateway.Client.Client.ApiResponse localVarResponse = await GetJrlInfoWithHttpInfoAsync(cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -396,7 +396,7 @@ public async System.Threading.Tasks.Task GetJrlInfoAsync(System.Threadi /// Thrown when fails to make API call /// Cancellation Token to cancel the request. /// Task of ApiResponse (JrlInfo) - public async System.Threading.Tasks.Task> GetJrlInfoWithHttpInfoAsync(System.Threading.CancellationToken cancellationToken = default) + public async System.Threading.Tasks.Task> GetJrlInfoWithHttpInfoAsync(System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { Devolutions.Gateway.Client.Client.RequestOptions localVarRequestOptions = new Devolutions.Gateway.Client.Client.RequestOptions(); @@ -495,7 +495,7 @@ public Devolutions.Gateway.Client.Client.ApiResponse UpdateJrlWithHttpIn /// Thrown when fails to make API call /// Cancellation Token to cancel the request. /// Task of void - public async System.Threading.Tasks.Task UpdateJrlAsync(System.Threading.CancellationToken cancellationToken = default) + public async System.Threading.Tasks.Task UpdateJrlAsync(System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { await UpdateJrlWithHttpInfoAsync(cancellationToken).ConfigureAwait(false); } @@ -506,7 +506,7 @@ public async System.Threading.Tasks.Task UpdateJrlAsync(System.Threading.Cancell /// Thrown when fails to make API call /// Cancellation Token to cancel the request. /// Task of ApiResponse - public async System.Threading.Tasks.Task> UpdateJrlWithHttpInfoAsync(System.Threading.CancellationToken cancellationToken = default) + public async System.Threading.Tasks.Task> UpdateJrlWithHttpInfoAsync(System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { Devolutions.Gateway.Client.Client.RequestOptions localVarRequestOptions = new Devolutions.Gateway.Client.Client.RequestOptions(); diff --git a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Api/NetApi.cs b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Api/NetApi.cs index 60d71230a..265d086e9 100644 --- a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Api/NetApi.cs +++ b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Api/NetApi.cs @@ -78,7 +78,7 @@ public interface INetApiSync : IApiAccessor /// The start and end IP address of the range to scan. for example: 10.10.0.0-10.10.0.255 (optional) /// Explicit single-host targets to scan. Each value must parse as an IPv4 or IPv6 address; invalid values yield a structured `{ error: \"invalid_target\", value: \"<raw>\" }` 400 rather than a generic serde rejection at extraction time (mirrors the `range=` / `probe=` validation path). (optional) /// Gateway network interface IDs to use as scan sources. (optional) - /// The probes to run. Each value is either `ping`, a port number (`22`), or a named service (`rdp`, `https`, ΓǪ). Validation is deferred to scan-time so failures can be surfaced as a structured 400 ΓÇö naming the offending value ΓÇö instead of a generic serde rejection at extraction time. (optional) + /// The probes to run. Each value is either `ping`, a port number (`22`), or a named service (`rdp`, `https`, …). Validation is deferred to scan-time so failures can be surfaced as a structured 400 — naming the offending value — instead of a generic serde rejection at extraction time. (optional) /// **Legacy alias** for `report_ping_start`. Prefer the explicit name in new clients; kept so existing consumers don't break. (optional) (deprecated) /// Enable the execution of broadcast scan (optional) /// Enable the ping scan on subnet (optional) @@ -96,11 +96,11 @@ public interface INetApiSync : IApiAccessor /// Maximum scanner concurrency. (optional) /// Maximum ping probe concurrency. (optional) /// Maximum TCP probe concurrency. (optional) - /// **Legacy alias** for `report_ping_failure`. `enable_failure=true` only opts into ping-failure events; TCP-probe failure events require the explicit `report_tcp_failure=true` and are not affected by this alias. **Behavior change:** historically this single flag controlled both ping-failure and TCP-probe-failure reporting. The two are now split: clients that want the old \"both at once\" semantics must send `enable_failure=true&report_tcp_failure=true` together. The split is intentional ΓÇö TCP-probe failures are typically high-volume noise that callers were filtering client-side anyway, so the two streams are independently gated. (optional) (deprecated) + /// **Legacy alias** for `report_ping_failure`. `enable_failure=true` only opts into ping-failure events; TCP-probe failure events require the explicit `report_tcp_failure=true` and are not affected by this alias. **Behavior change:** historically this single flag controlled both ping-failure and TCP-probe-failure reporting. The two are now split: clients that want the old \"both at once\" semantics must send `enable_failure=true&report_tcp_failure=true` together. The split is intentional — TCP-probe failures are typically high-volume noise that callers were filtering client-side anyway, so the two streams are independently gated. (optional) (deprecated) /// Enable TCP port knocking failure events. (optional) /// When `true`, fail with HTTP 400 if a ping/TCP-probe socket cannot be bound to the planner-selected interface. Default `false` (warn and fall back to default routing). (optional) /// - void GetNetScan(long? pingInterval = default, long? pingTimeout = default, long? broadcastTimeout = default, long? portScanTimeout = default, long? netbiosTimeout = default, long? netbiosInterval = default, long? mdnsQueryTimeout = default, long? maxWait = default, List? range = default, List? target = default, List? interfaceId = default, List? probe = default, bool? enablePingStart = default, bool? enableBroadcast = default, bool? enableSubnetScan = default, bool? enableZeroconf = default, bool? enableNetbios = default, bool? enableResolveDns = default, bool? includeHostResults = default, bool? reportPingStart = default, bool? reportPingSuccess = default, bool? reportPingFailure = default, bool? enableTcpProbes = default, string? rangeInterfacePolicy = default, bool? allowCrossInterfaceRange = default, string? responseFormat = default, int? maxConcurrency = default, int? maxPingConcurrency = default, int? maxTcpProbeConcurrency = default, bool? enableFailure = default, bool? reportTcpFailure = default, bool? interfaceBindStrict = default); + void GetNetScan(long? pingInterval = default(long?), long? pingTimeout = default(long?), long? broadcastTimeout = default(long?), long? portScanTimeout = default(long?), long? netbiosTimeout = default(long?), long? netbiosInterval = default(long?), long? mdnsQueryTimeout = default(long?), long? maxWait = default(long?), List? range = default(List?), List? target = default(List?), List? interfaceId = default(List?), List? probe = default(List?), bool? enablePingStart = default(bool?), bool? enableBroadcast = default(bool?), bool? enableSubnetScan = default(bool?), bool? enableZeroconf = default(bool?), bool? enableNetbios = default(bool?), bool? enableResolveDns = default(bool?), bool? includeHostResults = default(bool?), bool? reportPingStart = default(bool?), bool? reportPingSuccess = default(bool?), bool? reportPingFailure = default(bool?), bool? enableTcpProbes = default(bool?), string? rangeInterfacePolicy = default(string?), bool? allowCrossInterfaceRange = default(bool?), string? responseFormat = default(string?), int? maxConcurrency = default(int?), int? maxPingConcurrency = default(int?), int? maxTcpProbeConcurrency = default(int?), bool? enableFailure = default(bool?), bool? reportTcpFailure = default(bool?), bool? interfaceBindStrict = default(bool?)); /// /// Stream network scan events over a websocket. @@ -120,7 +120,7 @@ public interface INetApiSync : IApiAccessor /// The start and end IP address of the range to scan. for example: 10.10.0.0-10.10.0.255 (optional) /// Explicit single-host targets to scan. Each value must parse as an IPv4 or IPv6 address; invalid values yield a structured `{ error: \"invalid_target\", value: \"<raw>\" }` 400 rather than a generic serde rejection at extraction time (mirrors the `range=` / `probe=` validation path). (optional) /// Gateway network interface IDs to use as scan sources. (optional) - /// The probes to run. Each value is either `ping`, a port number (`22`), or a named service (`rdp`, `https`, ΓǪ). Validation is deferred to scan-time so failures can be surfaced as a structured 400 ΓÇö naming the offending value ΓÇö instead of a generic serde rejection at extraction time. (optional) + /// The probes to run. Each value is either `ping`, a port number (`22`), or a named service (`rdp`, `https`, …). Validation is deferred to scan-time so failures can be surfaced as a structured 400 — naming the offending value — instead of a generic serde rejection at extraction time. (optional) /// **Legacy alias** for `report_ping_start`. Prefer the explicit name in new clients; kept so existing consumers don't break. (optional) (deprecated) /// Enable the execution of broadcast scan (optional) /// Enable the ping scan on subnet (optional) @@ -138,11 +138,11 @@ public interface INetApiSync : IApiAccessor /// Maximum scanner concurrency. (optional) /// Maximum ping probe concurrency. (optional) /// Maximum TCP probe concurrency. (optional) - /// **Legacy alias** for `report_ping_failure`. `enable_failure=true` only opts into ping-failure events; TCP-probe failure events require the explicit `report_tcp_failure=true` and are not affected by this alias. **Behavior change:** historically this single flag controlled both ping-failure and TCP-probe-failure reporting. The two are now split: clients that want the old \"both at once\" semantics must send `enable_failure=true&report_tcp_failure=true` together. The split is intentional ΓÇö TCP-probe failures are typically high-volume noise that callers were filtering client-side anyway, so the two streams are independently gated. (optional) (deprecated) + /// **Legacy alias** for `report_ping_failure`. `enable_failure=true` only opts into ping-failure events; TCP-probe failure events require the explicit `report_tcp_failure=true` and are not affected by this alias. **Behavior change:** historically this single flag controlled both ping-failure and TCP-probe-failure reporting. The two are now split: clients that want the old \"both at once\" semantics must send `enable_failure=true&report_tcp_failure=true` together. The split is intentional — TCP-probe failures are typically high-volume noise that callers were filtering client-side anyway, so the two streams are independently gated. (optional) (deprecated) /// Enable TCP port knocking failure events. (optional) /// When `true`, fail with HTTP 400 if a ping/TCP-probe socket cannot be bound to the planner-selected interface. Default `false` (warn and fall back to default routing). (optional) /// ApiResponse of Object(void) - ApiResponse GetNetScanWithHttpInfo(long? pingInterval = default, long? pingTimeout = default, long? broadcastTimeout = default, long? portScanTimeout = default, long? netbiosTimeout = default, long? netbiosInterval = default, long? mdnsQueryTimeout = default, long? maxWait = default, List? range = default, List? target = default, List? interfaceId = default, List? probe = default, bool? enablePingStart = default, bool? enableBroadcast = default, bool? enableSubnetScan = default, bool? enableZeroconf = default, bool? enableNetbios = default, bool? enableResolveDns = default, bool? includeHostResults = default, bool? reportPingStart = default, bool? reportPingSuccess = default, bool? reportPingFailure = default, bool? enableTcpProbes = default, string? rangeInterfacePolicy = default, bool? allowCrossInterfaceRange = default, string? responseFormat = default, int? maxConcurrency = default, int? maxPingConcurrency = default, int? maxTcpProbeConcurrency = default, bool? enableFailure = default, bool? reportTcpFailure = default, bool? interfaceBindStrict = default); + ApiResponse GetNetScanWithHttpInfo(long? pingInterval = default(long?), long? pingTimeout = default(long?), long? broadcastTimeout = default(long?), long? portScanTimeout = default(long?), long? netbiosTimeout = default(long?), long? netbiosInterval = default(long?), long? mdnsQueryTimeout = default(long?), long? maxWait = default(long?), List? range = default(List?), List? target = default(List?), List? interfaceId = default(List?), List? probe = default(List?), bool? enablePingStart = default(bool?), bool? enableBroadcast = default(bool?), bool? enableSubnetScan = default(bool?), bool? enableZeroconf = default(bool?), bool? enableNetbios = default(bool?), bool? enableResolveDns = default(bool?), bool? includeHostResults = default(bool?), bool? reportPingStart = default(bool?), bool? reportPingSuccess = default(bool?), bool? reportPingFailure = default(bool?), bool? enableTcpProbes = default(bool?), string? rangeInterfacePolicy = default(string?), bool? allowCrossInterfaceRange = default(bool?), string? responseFormat = default(string?), int? maxConcurrency = default(int?), int? maxPingConcurrency = default(int?), int? maxTcpProbeConcurrency = default(int?), bool? enableFailure = default(bool?), bool? reportTcpFailure = default(bool?), bool? interfaceBindStrict = default(bool?)); #endregion Synchronous Operations } @@ -161,7 +161,7 @@ public interface INetApiAsync : IApiAccessor /// Thrown when fails to make API call /// Cancellation Token to cancel the request. /// Task of List<Dictionary<string, List<InterfaceInfo>>> - System.Threading.Tasks.Task>>> GetNetConfigAsync(System.Threading.CancellationToken cancellationToken = default); + System.Threading.Tasks.Task>>> GetNetConfigAsync(System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Lists network interfaces @@ -172,7 +172,7 @@ public interface INetApiAsync : IApiAccessor /// Thrown when fails to make API call /// Cancellation Token to cancel the request. /// Task of ApiResponse (List<Dictionary<string, List<InterfaceInfo>>>) - System.Threading.Tasks.Task>>>> GetNetConfigWithHttpInfoAsync(System.Threading.CancellationToken cancellationToken = default); + System.Threading.Tasks.Task>>>> GetNetConfigWithHttpInfoAsync(System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Lists Gateway network scan sources. /// @@ -182,7 +182,7 @@ public interface INetApiAsync : IApiAccessor /// Thrown when fails to make API call /// Cancellation Token to cancel the request. /// Task of NetworkInterfacesResponse - System.Threading.Tasks.Task GetNetInterfacesAsync(System.Threading.CancellationToken cancellationToken = default); + System.Threading.Tasks.Task GetNetInterfacesAsync(System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Lists Gateway network scan sources. @@ -193,7 +193,7 @@ public interface INetApiAsync : IApiAccessor /// Thrown when fails to make API call /// Cancellation Token to cancel the request. /// Task of ApiResponse (NetworkInterfacesResponse) - System.Threading.Tasks.Task> GetNetInterfacesWithHttpInfoAsync(System.Threading.CancellationToken cancellationToken = default); + System.Threading.Tasks.Task> GetNetInterfacesWithHttpInfoAsync(System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Stream network scan events over a websocket. /// @@ -212,7 +212,7 @@ public interface INetApiAsync : IApiAccessor /// The start and end IP address of the range to scan. for example: 10.10.0.0-10.10.0.255 (optional) /// Explicit single-host targets to scan. Each value must parse as an IPv4 or IPv6 address; invalid values yield a structured `{ error: \"invalid_target\", value: \"<raw>\" }` 400 rather than a generic serde rejection at extraction time (mirrors the `range=` / `probe=` validation path). (optional) /// Gateway network interface IDs to use as scan sources. (optional) - /// The probes to run. Each value is either `ping`, a port number (`22`), or a named service (`rdp`, `https`, ΓǪ). Validation is deferred to scan-time so failures can be surfaced as a structured 400 ΓÇö naming the offending value ΓÇö instead of a generic serde rejection at extraction time. (optional) + /// The probes to run. Each value is either `ping`, a port number (`22`), or a named service (`rdp`, `https`, …). Validation is deferred to scan-time so failures can be surfaced as a structured 400 — naming the offending value — instead of a generic serde rejection at extraction time. (optional) /// **Legacy alias** for `report_ping_start`. Prefer the explicit name in new clients; kept so existing consumers don't break. (optional) (deprecated) /// Enable the execution of broadcast scan (optional) /// Enable the ping scan on subnet (optional) @@ -230,12 +230,12 @@ public interface INetApiAsync : IApiAccessor /// Maximum scanner concurrency. (optional) /// Maximum ping probe concurrency. (optional) /// Maximum TCP probe concurrency. (optional) - /// **Legacy alias** for `report_ping_failure`. `enable_failure=true` only opts into ping-failure events; TCP-probe failure events require the explicit `report_tcp_failure=true` and are not affected by this alias. **Behavior change:** historically this single flag controlled both ping-failure and TCP-probe-failure reporting. The two are now split: clients that want the old \"both at once\" semantics must send `enable_failure=true&report_tcp_failure=true` together. The split is intentional ΓÇö TCP-probe failures are typically high-volume noise that callers were filtering client-side anyway, so the two streams are independently gated. (optional) (deprecated) + /// **Legacy alias** for `report_ping_failure`. `enable_failure=true` only opts into ping-failure events; TCP-probe failure events require the explicit `report_tcp_failure=true` and are not affected by this alias. **Behavior change:** historically this single flag controlled both ping-failure and TCP-probe-failure reporting. The two are now split: clients that want the old \"both at once\" semantics must send `enable_failure=true&report_tcp_failure=true` together. The split is intentional — TCP-probe failures are typically high-volume noise that callers were filtering client-side anyway, so the two streams are independently gated. (optional) (deprecated) /// Enable TCP port knocking failure events. (optional) /// When `true`, fail with HTTP 400 if a ping/TCP-probe socket cannot be bound to the planner-selected interface. Default `false` (warn and fall back to default routing). (optional) /// Cancellation Token to cancel the request. /// Task of void - System.Threading.Tasks.Task GetNetScanAsync(long? pingInterval = default, long? pingTimeout = default, long? broadcastTimeout = default, long? portScanTimeout = default, long? netbiosTimeout = default, long? netbiosInterval = default, long? mdnsQueryTimeout = default, long? maxWait = default, List? range = default, List? target = default, List? interfaceId = default, List? probe = default, bool? enablePingStart = default, bool? enableBroadcast = default, bool? enableSubnetScan = default, bool? enableZeroconf = default, bool? enableNetbios = default, bool? enableResolveDns = default, bool? includeHostResults = default, bool? reportPingStart = default, bool? reportPingSuccess = default, bool? reportPingFailure = default, bool? enableTcpProbes = default, string? rangeInterfacePolicy = default, bool? allowCrossInterfaceRange = default, string? responseFormat = default, int? maxConcurrency = default, int? maxPingConcurrency = default, int? maxTcpProbeConcurrency = default, bool? enableFailure = default, bool? reportTcpFailure = default, bool? interfaceBindStrict = default, System.Threading.CancellationToken cancellationToken = default); + System.Threading.Tasks.Task GetNetScanAsync(long? pingInterval = default(long?), long? pingTimeout = default(long?), long? broadcastTimeout = default(long?), long? portScanTimeout = default(long?), long? netbiosTimeout = default(long?), long? netbiosInterval = default(long?), long? mdnsQueryTimeout = default(long?), long? maxWait = default(long?), List? range = default(List?), List? target = default(List?), List? interfaceId = default(List?), List? probe = default(List?), bool? enablePingStart = default(bool?), bool? enableBroadcast = default(bool?), bool? enableSubnetScan = default(bool?), bool? enableZeroconf = default(bool?), bool? enableNetbios = default(bool?), bool? enableResolveDns = default(bool?), bool? includeHostResults = default(bool?), bool? reportPingStart = default(bool?), bool? reportPingSuccess = default(bool?), bool? reportPingFailure = default(bool?), bool? enableTcpProbes = default(bool?), string? rangeInterfacePolicy = default(string?), bool? allowCrossInterfaceRange = default(bool?), string? responseFormat = default(string?), int? maxConcurrency = default(int?), int? maxPingConcurrency = default(int?), int? maxTcpProbeConcurrency = default(int?), bool? enableFailure = default(bool?), bool? reportTcpFailure = default(bool?), bool? interfaceBindStrict = default(bool?), System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Stream network scan events over a websocket. @@ -255,7 +255,7 @@ public interface INetApiAsync : IApiAccessor /// The start and end IP address of the range to scan. for example: 10.10.0.0-10.10.0.255 (optional) /// Explicit single-host targets to scan. Each value must parse as an IPv4 or IPv6 address; invalid values yield a structured `{ error: \"invalid_target\", value: \"<raw>\" }` 400 rather than a generic serde rejection at extraction time (mirrors the `range=` / `probe=` validation path). (optional) /// Gateway network interface IDs to use as scan sources. (optional) - /// The probes to run. Each value is either `ping`, a port number (`22`), or a named service (`rdp`, `https`, ΓǪ). Validation is deferred to scan-time so failures can be surfaced as a structured 400 ΓÇö naming the offending value ΓÇö instead of a generic serde rejection at extraction time. (optional) + /// The probes to run. Each value is either `ping`, a port number (`22`), or a named service (`rdp`, `https`, …). Validation is deferred to scan-time so failures can be surfaced as a structured 400 — naming the offending value — instead of a generic serde rejection at extraction time. (optional) /// **Legacy alias** for `report_ping_start`. Prefer the explicit name in new clients; kept so existing consumers don't break. (optional) (deprecated) /// Enable the execution of broadcast scan (optional) /// Enable the ping scan on subnet (optional) @@ -273,12 +273,12 @@ public interface INetApiAsync : IApiAccessor /// Maximum scanner concurrency. (optional) /// Maximum ping probe concurrency. (optional) /// Maximum TCP probe concurrency. (optional) - /// **Legacy alias** for `report_ping_failure`. `enable_failure=true` only opts into ping-failure events; TCP-probe failure events require the explicit `report_tcp_failure=true` and are not affected by this alias. **Behavior change:** historically this single flag controlled both ping-failure and TCP-probe-failure reporting. The two are now split: clients that want the old \"both at once\" semantics must send `enable_failure=true&report_tcp_failure=true` together. The split is intentional ΓÇö TCP-probe failures are typically high-volume noise that callers were filtering client-side anyway, so the two streams are independently gated. (optional) (deprecated) + /// **Legacy alias** for `report_ping_failure`. `enable_failure=true` only opts into ping-failure events; TCP-probe failure events require the explicit `report_tcp_failure=true` and are not affected by this alias. **Behavior change:** historically this single flag controlled both ping-failure and TCP-probe-failure reporting. The two are now split: clients that want the old \"both at once\" semantics must send `enable_failure=true&report_tcp_failure=true` together. The split is intentional — TCP-probe failures are typically high-volume noise that callers were filtering client-side anyway, so the two streams are independently gated. (optional) (deprecated) /// Enable TCP port knocking failure events. (optional) /// When `true`, fail with HTTP 400 if a ping/TCP-probe socket cannot be bound to the planner-selected interface. Default `false` (warn and fall back to default routing). (optional) /// Cancellation Token to cancel the request. /// Task of ApiResponse - System.Threading.Tasks.Task> GetNetScanWithHttpInfoAsync(long? pingInterval = default, long? pingTimeout = default, long? broadcastTimeout = default, long? portScanTimeout = default, long? netbiosTimeout = default, long? netbiosInterval = default, long? mdnsQueryTimeout = default, long? maxWait = default, List? range = default, List? target = default, List? interfaceId = default, List? probe = default, bool? enablePingStart = default, bool? enableBroadcast = default, bool? enableSubnetScan = default, bool? enableZeroconf = default, bool? enableNetbios = default, bool? enableResolveDns = default, bool? includeHostResults = default, bool? reportPingStart = default, bool? reportPingSuccess = default, bool? reportPingFailure = default, bool? enableTcpProbes = default, string? rangeInterfacePolicy = default, bool? allowCrossInterfaceRange = default, string? responseFormat = default, int? maxConcurrency = default, int? maxPingConcurrency = default, int? maxTcpProbeConcurrency = default, bool? enableFailure = default, bool? reportTcpFailure = default, bool? interfaceBindStrict = default, System.Threading.CancellationToken cancellationToken = default); + System.Threading.Tasks.Task> GetNetScanWithHttpInfoAsync(long? pingInterval = default(long?), long? pingTimeout = default(long?), long? broadcastTimeout = default(long?), long? portScanTimeout = default(long?), long? netbiosTimeout = default(long?), long? netbiosInterval = default(long?), long? mdnsQueryTimeout = default(long?), long? maxWait = default(long?), List? range = default(List?), List? target = default(List?), List? interfaceId = default(List?), List? probe = default(List?), bool? enablePingStart = default(bool?), bool? enableBroadcast = default(bool?), bool? enableSubnetScan = default(bool?), bool? enableZeroconf = default(bool?), bool? enableNetbios = default(bool?), bool? enableResolveDns = default(bool?), bool? includeHostResults = default(bool?), bool? reportPingStart = default(bool?), bool? reportPingSuccess = default(bool?), bool? reportPingFailure = default(bool?), bool? enableTcpProbes = default(bool?), string? rangeInterfacePolicy = default(string?), bool? allowCrossInterfaceRange = default(bool?), string? responseFormat = default(string?), int? maxConcurrency = default(int?), int? maxPingConcurrency = default(int?), int? maxTcpProbeConcurrency = default(int?), bool? enableFailure = default(bool?), bool? reportTcpFailure = default(bool?), bool? interfaceBindStrict = default(bool?), System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); #endregion Asynchronous Operations } @@ -552,7 +552,7 @@ public Devolutions.Gateway.Client.Client.ApiResponseThrown when fails to make API call /// Cancellation Token to cancel the request. /// Task of List<Dictionary<string, List<InterfaceInfo>>> - public async System.Threading.Tasks.Task>>> GetNetConfigAsync(System.Threading.CancellationToken cancellationToken = default) + public async System.Threading.Tasks.Task>>> GetNetConfigAsync(System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { Devolutions.Gateway.Client.Client.ApiResponse>>> localVarResponse = await GetNetConfigWithHttpInfoAsync(cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -564,7 +564,7 @@ public async System.Threading.Tasks.TaskThrown when fails to make API call /// Cancellation Token to cancel the request. /// Task of ApiResponse (List<Dictionary<string, List<InterfaceInfo>>>) - public async System.Threading.Tasks.Task>>>> GetNetConfigWithHttpInfoAsync(System.Threading.CancellationToken cancellationToken = default) + public async System.Threading.Tasks.Task>>>> GetNetConfigWithHttpInfoAsync(System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { Devolutions.Gateway.Client.Client.RequestOptions localVarRequestOptions = new Devolutions.Gateway.Client.Client.RequestOptions(); @@ -665,7 +665,7 @@ public Devolutions.Gateway.Client.Client.ApiResponse /// Thrown when fails to make API call /// Cancellation Token to cancel the request. /// Task of NetworkInterfacesResponse - public async System.Threading.Tasks.Task GetNetInterfacesAsync(System.Threading.CancellationToken cancellationToken = default) + public async System.Threading.Tasks.Task GetNetInterfacesAsync(System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { Devolutions.Gateway.Client.Client.ApiResponse localVarResponse = await GetNetInterfacesWithHttpInfoAsync(cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -677,7 +677,7 @@ public async System.Threading.Tasks.Task GetNetInterf /// Thrown when fails to make API call /// Cancellation Token to cancel the request. /// Task of ApiResponse (NetworkInterfacesResponse) - public async System.Threading.Tasks.Task> GetNetInterfacesWithHttpInfoAsync(System.Threading.CancellationToken cancellationToken = default) + public async System.Threading.Tasks.Task> GetNetInterfacesWithHttpInfoAsync(System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { Devolutions.Gateway.Client.Client.RequestOptions localVarRequestOptions = new Devolutions.Gateway.Client.Client.RequestOptions(); @@ -733,7 +733,7 @@ public async System.Threading.Tasks.Task GetNetInterf /// The start and end IP address of the range to scan. for example: 10.10.0.0-10.10.0.255 (optional) /// Explicit single-host targets to scan. Each value must parse as an IPv4 or IPv6 address; invalid values yield a structured `{ error: \"invalid_target\", value: \"<raw>\" }` 400 rather than a generic serde rejection at extraction time (mirrors the `range=` / `probe=` validation path). (optional) /// Gateway network interface IDs to use as scan sources. (optional) - /// The probes to run. Each value is either `ping`, a port number (`22`), or a named service (`rdp`, `https`, ΓǪ). Validation is deferred to scan-time so failures can be surfaced as a structured 400 ΓÇö naming the offending value ΓÇö instead of a generic serde rejection at extraction time. (optional) + /// The probes to run. Each value is either `ping`, a port number (`22`), or a named service (`rdp`, `https`, …). Validation is deferred to scan-time so failures can be surfaced as a structured 400 — naming the offending value — instead of a generic serde rejection at extraction time. (optional) /// **Legacy alias** for `report_ping_start`. Prefer the explicit name in new clients; kept so existing consumers don't break. (optional) (deprecated) /// Enable the execution of broadcast scan (optional) /// Enable the ping scan on subnet (optional) @@ -751,11 +751,11 @@ public async System.Threading.Tasks.Task GetNetInterf /// Maximum scanner concurrency. (optional) /// Maximum ping probe concurrency. (optional) /// Maximum TCP probe concurrency. (optional) - /// **Legacy alias** for `report_ping_failure`. `enable_failure=true` only opts into ping-failure events; TCP-probe failure events require the explicit `report_tcp_failure=true` and are not affected by this alias. **Behavior change:** historically this single flag controlled both ping-failure and TCP-probe-failure reporting. The two are now split: clients that want the old \"both at once\" semantics must send `enable_failure=true&report_tcp_failure=true` together. The split is intentional ΓÇö TCP-probe failures are typically high-volume noise that callers were filtering client-side anyway, so the two streams are independently gated. (optional) (deprecated) + /// **Legacy alias** for `report_ping_failure`. `enable_failure=true` only opts into ping-failure events; TCP-probe failure events require the explicit `report_tcp_failure=true` and are not affected by this alias. **Behavior change:** historically this single flag controlled both ping-failure and TCP-probe-failure reporting. The two are now split: clients that want the old \"both at once\" semantics must send `enable_failure=true&report_tcp_failure=true` together. The split is intentional — TCP-probe failures are typically high-volume noise that callers were filtering client-side anyway, so the two streams are independently gated. (optional) (deprecated) /// Enable TCP port knocking failure events. (optional) /// When `true`, fail with HTTP 400 if a ping/TCP-probe socket cannot be bound to the planner-selected interface. Default `false` (warn and fall back to default routing). (optional) /// - public void GetNetScan(long? pingInterval = default, long? pingTimeout = default, long? broadcastTimeout = default, long? portScanTimeout = default, long? netbiosTimeout = default, long? netbiosInterval = default, long? mdnsQueryTimeout = default, long? maxWait = default, List? range = default, List? target = default, List? interfaceId = default, List? probe = default, bool? enablePingStart = default, bool? enableBroadcast = default, bool? enableSubnetScan = default, bool? enableZeroconf = default, bool? enableNetbios = default, bool? enableResolveDns = default, bool? includeHostResults = default, bool? reportPingStart = default, bool? reportPingSuccess = default, bool? reportPingFailure = default, bool? enableTcpProbes = default, string? rangeInterfacePolicy = default, bool? allowCrossInterfaceRange = default, string? responseFormat = default, int? maxConcurrency = default, int? maxPingConcurrency = default, int? maxTcpProbeConcurrency = default, bool? enableFailure = default, bool? reportTcpFailure = default, bool? interfaceBindStrict = default) + public void GetNetScan(long? pingInterval = default(long?), long? pingTimeout = default(long?), long? broadcastTimeout = default(long?), long? portScanTimeout = default(long?), long? netbiosTimeout = default(long?), long? netbiosInterval = default(long?), long? mdnsQueryTimeout = default(long?), long? maxWait = default(long?), List? range = default(List?), List? target = default(List?), List? interfaceId = default(List?), List? probe = default(List?), bool? enablePingStart = default(bool?), bool? enableBroadcast = default(bool?), bool? enableSubnetScan = default(bool?), bool? enableZeroconf = default(bool?), bool? enableNetbios = default(bool?), bool? enableResolveDns = default(bool?), bool? includeHostResults = default(bool?), bool? reportPingStart = default(bool?), bool? reportPingSuccess = default(bool?), bool? reportPingFailure = default(bool?), bool? enableTcpProbes = default(bool?), string? rangeInterfacePolicy = default(string?), bool? allowCrossInterfaceRange = default(bool?), string? responseFormat = default(string?), int? maxConcurrency = default(int?), int? maxPingConcurrency = default(int?), int? maxTcpProbeConcurrency = default(int?), bool? enableFailure = default(bool?), bool? reportTcpFailure = default(bool?), bool? interfaceBindStrict = default(bool?)) { GetNetScanWithHttpInfo(pingInterval, pingTimeout, broadcastTimeout, portScanTimeout, netbiosTimeout, netbiosInterval, mdnsQueryTimeout, maxWait, range, target, interfaceId, probe, enablePingStart, enableBroadcast, enableSubnetScan, enableZeroconf, enableNetbios, enableResolveDns, includeHostResults, reportPingStart, reportPingSuccess, reportPingFailure, enableTcpProbes, rangeInterfacePolicy, allowCrossInterfaceRange, responseFormat, maxConcurrency, maxPingConcurrency, maxTcpProbeConcurrency, enableFailure, reportTcpFailure, interfaceBindStrict); } @@ -775,7 +775,7 @@ public void GetNetScan(long? pingInterval = default, long? pingTimeout = default /// The start and end IP address of the range to scan. for example: 10.10.0.0-10.10.0.255 (optional) /// Explicit single-host targets to scan. Each value must parse as an IPv4 or IPv6 address; invalid values yield a structured `{ error: \"invalid_target\", value: \"<raw>\" }` 400 rather than a generic serde rejection at extraction time (mirrors the `range=` / `probe=` validation path). (optional) /// Gateway network interface IDs to use as scan sources. (optional) - /// The probes to run. Each value is either `ping`, a port number (`22`), or a named service (`rdp`, `https`, ΓǪ). Validation is deferred to scan-time so failures can be surfaced as a structured 400 ΓÇö naming the offending value ΓÇö instead of a generic serde rejection at extraction time. (optional) + /// The probes to run. Each value is either `ping`, a port number (`22`), or a named service (`rdp`, `https`, …). Validation is deferred to scan-time so failures can be surfaced as a structured 400 — naming the offending value — instead of a generic serde rejection at extraction time. (optional) /// **Legacy alias** for `report_ping_start`. Prefer the explicit name in new clients; kept so existing consumers don't break. (optional) (deprecated) /// Enable the execution of broadcast scan (optional) /// Enable the ping scan on subnet (optional) @@ -793,11 +793,11 @@ public void GetNetScan(long? pingInterval = default, long? pingTimeout = default /// Maximum scanner concurrency. (optional) /// Maximum ping probe concurrency. (optional) /// Maximum TCP probe concurrency. (optional) - /// **Legacy alias** for `report_ping_failure`. `enable_failure=true` only opts into ping-failure events; TCP-probe failure events require the explicit `report_tcp_failure=true` and are not affected by this alias. **Behavior change:** historically this single flag controlled both ping-failure and TCP-probe-failure reporting. The two are now split: clients that want the old \"both at once\" semantics must send `enable_failure=true&report_tcp_failure=true` together. The split is intentional ΓÇö TCP-probe failures are typically high-volume noise that callers were filtering client-side anyway, so the two streams are independently gated. (optional) (deprecated) + /// **Legacy alias** for `report_ping_failure`. `enable_failure=true` only opts into ping-failure events; TCP-probe failure events require the explicit `report_tcp_failure=true` and are not affected by this alias. **Behavior change:** historically this single flag controlled both ping-failure and TCP-probe-failure reporting. The two are now split: clients that want the old \"both at once\" semantics must send `enable_failure=true&report_tcp_failure=true` together. The split is intentional — TCP-probe failures are typically high-volume noise that callers were filtering client-side anyway, so the two streams are independently gated. (optional) (deprecated) /// Enable TCP port knocking failure events. (optional) /// When `true`, fail with HTTP 400 if a ping/TCP-probe socket cannot be bound to the planner-selected interface. Default `false` (warn and fall back to default routing). (optional) /// ApiResponse of Object(void) - public Devolutions.Gateway.Client.Client.ApiResponse GetNetScanWithHttpInfo(long? pingInterval = default, long? pingTimeout = default, long? broadcastTimeout = default, long? portScanTimeout = default, long? netbiosTimeout = default, long? netbiosInterval = default, long? mdnsQueryTimeout = default, long? maxWait = default, List? range = default, List? target = default, List? interfaceId = default, List? probe = default, bool? enablePingStart = default, bool? enableBroadcast = default, bool? enableSubnetScan = default, bool? enableZeroconf = default, bool? enableNetbios = default, bool? enableResolveDns = default, bool? includeHostResults = default, bool? reportPingStart = default, bool? reportPingSuccess = default, bool? reportPingFailure = default, bool? enableTcpProbes = default, string? rangeInterfacePolicy = default, bool? allowCrossInterfaceRange = default, string? responseFormat = default, int? maxConcurrency = default, int? maxPingConcurrency = default, int? maxTcpProbeConcurrency = default, bool? enableFailure = default, bool? reportTcpFailure = default, bool? interfaceBindStrict = default) + public Devolutions.Gateway.Client.Client.ApiResponse GetNetScanWithHttpInfo(long? pingInterval = default(long?), long? pingTimeout = default(long?), long? broadcastTimeout = default(long?), long? portScanTimeout = default(long?), long? netbiosTimeout = default(long?), long? netbiosInterval = default(long?), long? mdnsQueryTimeout = default(long?), long? maxWait = default(long?), List? range = default(List?), List? target = default(List?), List? interfaceId = default(List?), List? probe = default(List?), bool? enablePingStart = default(bool?), bool? enableBroadcast = default(bool?), bool? enableSubnetScan = default(bool?), bool? enableZeroconf = default(bool?), bool? enableNetbios = default(bool?), bool? enableResolveDns = default(bool?), bool? includeHostResults = default(bool?), bool? reportPingStart = default(bool?), bool? reportPingSuccess = default(bool?), bool? reportPingFailure = default(bool?), bool? enableTcpProbes = default(bool?), string? rangeInterfacePolicy = default(string?), bool? allowCrossInterfaceRange = default(bool?), string? responseFormat = default(string?), int? maxConcurrency = default(int?), int? maxPingConcurrency = default(int?), int? maxTcpProbeConcurrency = default(int?), bool? enableFailure = default(bool?), bool? reportTcpFailure = default(bool?), bool? interfaceBindStrict = default(bool?)) { Devolutions.Gateway.Client.Client.RequestOptions localVarRequestOptions = new Devolutions.Gateway.Client.Client.RequestOptions(); @@ -977,7 +977,7 @@ public Devolutions.Gateway.Client.Client.ApiResponse GetNetScanWithHttpI /// The start and end IP address of the range to scan. for example: 10.10.0.0-10.10.0.255 (optional) /// Explicit single-host targets to scan. Each value must parse as an IPv4 or IPv6 address; invalid values yield a structured `{ error: \"invalid_target\", value: \"<raw>\" }` 400 rather than a generic serde rejection at extraction time (mirrors the `range=` / `probe=` validation path). (optional) /// Gateway network interface IDs to use as scan sources. (optional) - /// The probes to run. Each value is either `ping`, a port number (`22`), or a named service (`rdp`, `https`, ΓǪ). Validation is deferred to scan-time so failures can be surfaced as a structured 400 ΓÇö naming the offending value ΓÇö instead of a generic serde rejection at extraction time. (optional) + /// The probes to run. Each value is either `ping`, a port number (`22`), or a named service (`rdp`, `https`, …). Validation is deferred to scan-time so failures can be surfaced as a structured 400 — naming the offending value — instead of a generic serde rejection at extraction time. (optional) /// **Legacy alias** for `report_ping_start`. Prefer the explicit name in new clients; kept so existing consumers don't break. (optional) (deprecated) /// Enable the execution of broadcast scan (optional) /// Enable the ping scan on subnet (optional) @@ -995,12 +995,12 @@ public Devolutions.Gateway.Client.Client.ApiResponse GetNetScanWithHttpI /// Maximum scanner concurrency. (optional) /// Maximum ping probe concurrency. (optional) /// Maximum TCP probe concurrency. (optional) - /// **Legacy alias** for `report_ping_failure`. `enable_failure=true` only opts into ping-failure events; TCP-probe failure events require the explicit `report_tcp_failure=true` and are not affected by this alias. **Behavior change:** historically this single flag controlled both ping-failure and TCP-probe-failure reporting. The two are now split: clients that want the old \"both at once\" semantics must send `enable_failure=true&report_tcp_failure=true` together. The split is intentional ΓÇö TCP-probe failures are typically high-volume noise that callers were filtering client-side anyway, so the two streams are independently gated. (optional) (deprecated) + /// **Legacy alias** for `report_ping_failure`. `enable_failure=true` only opts into ping-failure events; TCP-probe failure events require the explicit `report_tcp_failure=true` and are not affected by this alias. **Behavior change:** historically this single flag controlled both ping-failure and TCP-probe-failure reporting. The two are now split: clients that want the old \"both at once\" semantics must send `enable_failure=true&report_tcp_failure=true` together. The split is intentional — TCP-probe failures are typically high-volume noise that callers were filtering client-side anyway, so the two streams are independently gated. (optional) (deprecated) /// Enable TCP port knocking failure events. (optional) /// When `true`, fail with HTTP 400 if a ping/TCP-probe socket cannot be bound to the planner-selected interface. Default `false` (warn and fall back to default routing). (optional) /// Cancellation Token to cancel the request. /// Task of void - public async System.Threading.Tasks.Task GetNetScanAsync(long? pingInterval = default, long? pingTimeout = default, long? broadcastTimeout = default, long? portScanTimeout = default, long? netbiosTimeout = default, long? netbiosInterval = default, long? mdnsQueryTimeout = default, long? maxWait = default, List? range = default, List? target = default, List? interfaceId = default, List? probe = default, bool? enablePingStart = default, bool? enableBroadcast = default, bool? enableSubnetScan = default, bool? enableZeroconf = default, bool? enableNetbios = default, bool? enableResolveDns = default, bool? includeHostResults = default, bool? reportPingStart = default, bool? reportPingSuccess = default, bool? reportPingFailure = default, bool? enableTcpProbes = default, string? rangeInterfacePolicy = default, bool? allowCrossInterfaceRange = default, string? responseFormat = default, int? maxConcurrency = default, int? maxPingConcurrency = default, int? maxTcpProbeConcurrency = default, bool? enableFailure = default, bool? reportTcpFailure = default, bool? interfaceBindStrict = default, System.Threading.CancellationToken cancellationToken = default) + public async System.Threading.Tasks.Task GetNetScanAsync(long? pingInterval = default(long?), long? pingTimeout = default(long?), long? broadcastTimeout = default(long?), long? portScanTimeout = default(long?), long? netbiosTimeout = default(long?), long? netbiosInterval = default(long?), long? mdnsQueryTimeout = default(long?), long? maxWait = default(long?), List? range = default(List?), List? target = default(List?), List? interfaceId = default(List?), List? probe = default(List?), bool? enablePingStart = default(bool?), bool? enableBroadcast = default(bool?), bool? enableSubnetScan = default(bool?), bool? enableZeroconf = default(bool?), bool? enableNetbios = default(bool?), bool? enableResolveDns = default(bool?), bool? includeHostResults = default(bool?), bool? reportPingStart = default(bool?), bool? reportPingSuccess = default(bool?), bool? reportPingFailure = default(bool?), bool? enableTcpProbes = default(bool?), string? rangeInterfacePolicy = default(string?), bool? allowCrossInterfaceRange = default(bool?), string? responseFormat = default(string?), int? maxConcurrency = default(int?), int? maxPingConcurrency = default(int?), int? maxTcpProbeConcurrency = default(int?), bool? enableFailure = default(bool?), bool? reportTcpFailure = default(bool?), bool? interfaceBindStrict = default(bool?), System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { await GetNetScanWithHttpInfoAsync(pingInterval, pingTimeout, broadcastTimeout, portScanTimeout, netbiosTimeout, netbiosInterval, mdnsQueryTimeout, maxWait, range, target, interfaceId, probe, enablePingStart, enableBroadcast, enableSubnetScan, enableZeroconf, enableNetbios, enableResolveDns, includeHostResults, reportPingStart, reportPingSuccess, reportPingFailure, enableTcpProbes, rangeInterfacePolicy, allowCrossInterfaceRange, responseFormat, maxConcurrency, maxPingConcurrency, maxTcpProbeConcurrency, enableFailure, reportTcpFailure, interfaceBindStrict, cancellationToken).ConfigureAwait(false); } @@ -1020,7 +1020,7 @@ public async System.Threading.Tasks.Task GetNetScanAsync(long? pingInterval = de /// The start and end IP address of the range to scan. for example: 10.10.0.0-10.10.0.255 (optional) /// Explicit single-host targets to scan. Each value must parse as an IPv4 or IPv6 address; invalid values yield a structured `{ error: \"invalid_target\", value: \"<raw>\" }` 400 rather than a generic serde rejection at extraction time (mirrors the `range=` / `probe=` validation path). (optional) /// Gateway network interface IDs to use as scan sources. (optional) - /// The probes to run. Each value is either `ping`, a port number (`22`), or a named service (`rdp`, `https`, ΓǪ). Validation is deferred to scan-time so failures can be surfaced as a structured 400 ΓÇö naming the offending value ΓÇö instead of a generic serde rejection at extraction time. (optional) + /// The probes to run. Each value is either `ping`, a port number (`22`), or a named service (`rdp`, `https`, …). Validation is deferred to scan-time so failures can be surfaced as a structured 400 — naming the offending value — instead of a generic serde rejection at extraction time. (optional) /// **Legacy alias** for `report_ping_start`. Prefer the explicit name in new clients; kept so existing consumers don't break. (optional) (deprecated) /// Enable the execution of broadcast scan (optional) /// Enable the ping scan on subnet (optional) @@ -1038,12 +1038,12 @@ public async System.Threading.Tasks.Task GetNetScanAsync(long? pingInterval = de /// Maximum scanner concurrency. (optional) /// Maximum ping probe concurrency. (optional) /// Maximum TCP probe concurrency. (optional) - /// **Legacy alias** for `report_ping_failure`. `enable_failure=true` only opts into ping-failure events; TCP-probe failure events require the explicit `report_tcp_failure=true` and are not affected by this alias. **Behavior change:** historically this single flag controlled both ping-failure and TCP-probe-failure reporting. The two are now split: clients that want the old \"both at once\" semantics must send `enable_failure=true&report_tcp_failure=true` together. The split is intentional ΓÇö TCP-probe failures are typically high-volume noise that callers were filtering client-side anyway, so the two streams are independently gated. (optional) (deprecated) + /// **Legacy alias** for `report_ping_failure`. `enable_failure=true` only opts into ping-failure events; TCP-probe failure events require the explicit `report_tcp_failure=true` and are not affected by this alias. **Behavior change:** historically this single flag controlled both ping-failure and TCP-probe-failure reporting. The two are now split: clients that want the old \"both at once\" semantics must send `enable_failure=true&report_tcp_failure=true` together. The split is intentional — TCP-probe failures are typically high-volume noise that callers were filtering client-side anyway, so the two streams are independently gated. (optional) (deprecated) /// Enable TCP port knocking failure events. (optional) /// When `true`, fail with HTTP 400 if a ping/TCP-probe socket cannot be bound to the planner-selected interface. Default `false` (warn and fall back to default routing). (optional) /// Cancellation Token to cancel the request. /// Task of ApiResponse - public async System.Threading.Tasks.Task> GetNetScanWithHttpInfoAsync(long? pingInterval = default, long? pingTimeout = default, long? broadcastTimeout = default, long? portScanTimeout = default, long? netbiosTimeout = default, long? netbiosInterval = default, long? mdnsQueryTimeout = default, long? maxWait = default, List? range = default, List? target = default, List? interfaceId = default, List? probe = default, bool? enablePingStart = default, bool? enableBroadcast = default, bool? enableSubnetScan = default, bool? enableZeroconf = default, bool? enableNetbios = default, bool? enableResolveDns = default, bool? includeHostResults = default, bool? reportPingStart = default, bool? reportPingSuccess = default, bool? reportPingFailure = default, bool? enableTcpProbes = default, string? rangeInterfacePolicy = default, bool? allowCrossInterfaceRange = default, string? responseFormat = default, int? maxConcurrency = default, int? maxPingConcurrency = default, int? maxTcpProbeConcurrency = default, bool? enableFailure = default, bool? reportTcpFailure = default, bool? interfaceBindStrict = default, System.Threading.CancellationToken cancellationToken = default) + public async System.Threading.Tasks.Task> GetNetScanWithHttpInfoAsync(long? pingInterval = default(long?), long? pingTimeout = default(long?), long? broadcastTimeout = default(long?), long? portScanTimeout = default(long?), long? netbiosTimeout = default(long?), long? netbiosInterval = default(long?), long? mdnsQueryTimeout = default(long?), long? maxWait = default(long?), List? range = default(List?), List? target = default(List?), List? interfaceId = default(List?), List? probe = default(List?), bool? enablePingStart = default(bool?), bool? enableBroadcast = default(bool?), bool? enableSubnetScan = default(bool?), bool? enableZeroconf = default(bool?), bool? enableNetbios = default(bool?), bool? enableResolveDns = default(bool?), bool? includeHostResults = default(bool?), bool? reportPingStart = default(bool?), bool? reportPingSuccess = default(bool?), bool? reportPingFailure = default(bool?), bool? enableTcpProbes = default(bool?), string? rangeInterfacePolicy = default(string?), bool? allowCrossInterfaceRange = default(bool?), string? responseFormat = default(string?), int? maxConcurrency = default(int?), int? maxPingConcurrency = default(int?), int? maxTcpProbeConcurrency = default(int?), bool? enableFailure = default(bool?), bool? reportTcpFailure = default(bool?), bool? interfaceBindStrict = default(bool?), System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { Devolutions.Gateway.Client.Client.RequestOptions localVarRequestOptions = new Devolutions.Gateway.Client.Client.RequestOptions(); diff --git a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Api/NetworkMonitoringApi.cs b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Api/NetworkMonitoringApi.cs index e2a79a49c..cb7415dc3 100644 --- a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Api/NetworkMonitoringApi.cs +++ b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Api/NetworkMonitoringApi.cs @@ -86,7 +86,7 @@ public interface INetworkMonitoringApiAsync : IApiAccessor /// Thrown when fails to make API call /// Cancellation Token to cancel the request. /// Task of MonitoringLogResponse - System.Threading.Tasks.Task DrainMonitoringLogAsync(System.Threading.CancellationToken cancellationToken = default); + System.Threading.Tasks.Task DrainMonitoringLogAsync(System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Monitors store their results in a temporary log, which is returned here. @@ -97,7 +97,7 @@ public interface INetworkMonitoringApiAsync : IApiAccessor /// Thrown when fails to make API call /// Cancellation Token to cancel the request. /// Task of ApiResponse (MonitoringLogResponse) - System.Threading.Tasks.Task> DrainMonitoringLogWithHttpInfoAsync(System.Threading.CancellationToken cancellationToken = default); + System.Threading.Tasks.Task> DrainMonitoringLogWithHttpInfoAsync(System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Replace the current monitoring configuration with the configuration in the request body. /// @@ -108,7 +108,7 @@ public interface INetworkMonitoringApiAsync : IApiAccessor /// JSON object containing a list of monitors /// Cancellation Token to cancel the request. /// Task of SetConfigResponse - System.Threading.Tasks.Task SetMonitoringConfigAsync(MonitorsConfig monitorsConfig, System.Threading.CancellationToken cancellationToken = default); + System.Threading.Tasks.Task SetMonitoringConfigAsync(MonitorsConfig monitorsConfig, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Replace the current monitoring configuration with the configuration in the request body. @@ -120,7 +120,7 @@ public interface INetworkMonitoringApiAsync : IApiAccessor /// JSON object containing a list of monitors /// Cancellation Token to cancel the request. /// Task of ApiResponse (SetConfigResponse) - System.Threading.Tasks.Task> SetMonitoringConfigWithHttpInfoAsync(MonitorsConfig monitorsConfig, System.Threading.CancellationToken cancellationToken = default); + System.Threading.Tasks.Task> SetMonitoringConfigWithHttpInfoAsync(MonitorsConfig monitorsConfig, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); #endregion Asynchronous Operations } @@ -394,7 +394,7 @@ public Devolutions.Gateway.Client.Client.ApiResponse Drai /// Thrown when fails to make API call /// Cancellation Token to cancel the request. /// Task of MonitoringLogResponse - public async System.Threading.Tasks.Task DrainMonitoringLogAsync(System.Threading.CancellationToken cancellationToken = default) + public async System.Threading.Tasks.Task DrainMonitoringLogAsync(System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { Devolutions.Gateway.Client.Client.ApiResponse localVarResponse = await DrainMonitoringLogWithHttpInfoAsync(cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -406,7 +406,7 @@ public async System.Threading.Tasks.Task DrainMonitoringL /// Thrown when fails to make API call /// Cancellation Token to cancel the request. /// Task of ApiResponse (MonitoringLogResponse) - public async System.Threading.Tasks.Task> DrainMonitoringLogWithHttpInfoAsync(System.Threading.CancellationToken cancellationToken = default) + public async System.Threading.Tasks.Task> DrainMonitoringLogWithHttpInfoAsync(System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { Devolutions.Gateway.Client.Client.RequestOptions localVarRequestOptions = new Devolutions.Gateway.Client.Client.RequestOptions(); @@ -516,7 +516,7 @@ public Devolutions.Gateway.Client.Client.ApiResponse SetMonit /// JSON object containing a list of monitors /// Cancellation Token to cancel the request. /// Task of SetConfigResponse - public async System.Threading.Tasks.Task SetMonitoringConfigAsync(MonitorsConfig monitorsConfig, System.Threading.CancellationToken cancellationToken = default) + public async System.Threading.Tasks.Task SetMonitoringConfigAsync(MonitorsConfig monitorsConfig, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { Devolutions.Gateway.Client.Client.ApiResponse localVarResponse = await SetMonitoringConfigWithHttpInfoAsync(monitorsConfig, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -529,7 +529,7 @@ public async System.Threading.Tasks.Task SetMonitoringConfigA /// JSON object containing a list of monitors /// Cancellation Token to cancel the request. /// Task of ApiResponse (SetConfigResponse) - public async System.Threading.Tasks.Task> SetMonitoringConfigWithHttpInfoAsync(MonitorsConfig monitorsConfig, System.Threading.CancellationToken cancellationToken = default) + public async System.Threading.Tasks.Task> SetMonitoringConfigWithHttpInfoAsync(MonitorsConfig monitorsConfig, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { // verify the required parameter 'monitorsConfig' is set if (monitorsConfig == null) diff --git a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Api/PreflightApi.cs b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Api/PreflightApi.cs index facdf0d00..03f20799b 100644 --- a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Api/PreflightApi.cs +++ b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Api/PreflightApi.cs @@ -65,7 +65,7 @@ public interface IPreflightApiAsync : IApiAccessor /// /// Cancellation Token to cancel the request. /// Task of List<PreflightOutput> - System.Threading.Tasks.Task> PostPreflightAsync(List preflightOperation, System.Threading.CancellationToken cancellationToken = default); + System.Threading.Tasks.Task> PostPreflightAsync(List preflightOperation, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Performs a batch of preflight operations @@ -77,7 +77,7 @@ public interface IPreflightApiAsync : IApiAccessor /// /// Cancellation Token to cancel the request. /// Task of ApiResponse (List<PreflightOutput>) - System.Threading.Tasks.Task>> PostPreflightWithHttpInfoAsync(List preflightOperation, System.Threading.CancellationToken cancellationToken = default); + System.Threading.Tasks.Task>> PostPreflightWithHttpInfoAsync(List preflightOperation, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); #endregion Asynchronous Operations } @@ -360,7 +360,7 @@ public Devolutions.Gateway.Client.Client.ApiResponse> Post /// /// Cancellation Token to cancel the request. /// Task of List<PreflightOutput> - public async System.Threading.Tasks.Task> PostPreflightAsync(List preflightOperation, System.Threading.CancellationToken cancellationToken = default) + public async System.Threading.Tasks.Task> PostPreflightAsync(List preflightOperation, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { Devolutions.Gateway.Client.Client.ApiResponse> localVarResponse = await PostPreflightWithHttpInfoAsync(preflightOperation, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -373,7 +373,7 @@ public async System.Threading.Tasks.Task> PostPreflightAsy /// /// Cancellation Token to cancel the request. /// Task of ApiResponse (List<PreflightOutput>) - public async System.Threading.Tasks.Task>> PostPreflightWithHttpInfoAsync(List preflightOperation, System.Threading.CancellationToken cancellationToken = default) + public async System.Threading.Tasks.Task>> PostPreflightWithHttpInfoAsync(List preflightOperation, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { // verify the required parameter 'preflightOperation' is set if (preflightOperation == null) diff --git a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Api/SessionsApi.cs b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Api/SessionsApi.cs index ca5096320..f08d09dc1 100644 --- a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Api/SessionsApi.cs +++ b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Api/SessionsApi.cs @@ -80,7 +80,7 @@ public interface ISessionsApiAsync : IApiAccessor /// Thrown when fails to make API call /// Cancellation Token to cancel the request. /// Task of List<SessionInfo> - System.Threading.Tasks.Task> GetSessionsAsync(System.Threading.CancellationToken cancellationToken = default); + System.Threading.Tasks.Task> GetSessionsAsync(System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Lists running sessions @@ -91,7 +91,7 @@ public interface ISessionsApiAsync : IApiAccessor /// Thrown when fails to make API call /// Cancellation Token to cancel the request. /// Task of ApiResponse (List<SessionInfo>) - System.Threading.Tasks.Task>> GetSessionsWithHttpInfoAsync(System.Threading.CancellationToken cancellationToken = default); + System.Threading.Tasks.Task>> GetSessionsWithHttpInfoAsync(System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Terminate forcefully a running session /// @@ -102,7 +102,7 @@ public interface ISessionsApiAsync : IApiAccessor /// Session / association ID of the session to terminate /// Cancellation Token to cancel the request. /// Task of void - System.Threading.Tasks.Task TerminateSessionAsync(Guid id, System.Threading.CancellationToken cancellationToken = default); + System.Threading.Tasks.Task TerminateSessionAsync(Guid id, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Terminate forcefully a running session @@ -114,7 +114,7 @@ public interface ISessionsApiAsync : IApiAccessor /// Session / association ID of the session to terminate /// Cancellation Token to cancel the request. /// Task of ApiResponse - System.Threading.Tasks.Task> TerminateSessionWithHttpInfoAsync(Guid id, System.Threading.CancellationToken cancellationToken = default); + System.Threading.Tasks.Task> TerminateSessionWithHttpInfoAsync(Guid id, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); #endregion Asynchronous Operations } @@ -388,7 +388,7 @@ public Devolutions.Gateway.Client.Client.ApiResponse> GetSessi /// Thrown when fails to make API call /// Cancellation Token to cancel the request. /// Task of List<SessionInfo> - public async System.Threading.Tasks.Task> GetSessionsAsync(System.Threading.CancellationToken cancellationToken = default) + public async System.Threading.Tasks.Task> GetSessionsAsync(System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { Devolutions.Gateway.Client.Client.ApiResponse> localVarResponse = await GetSessionsWithHttpInfoAsync(cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -400,7 +400,7 @@ public async System.Threading.Tasks.Task> GetSessionsAsync(Sys /// Thrown when fails to make API call /// Cancellation Token to cancel the request. /// Task of ApiResponse (List<SessionInfo>) - public async System.Threading.Tasks.Task>> GetSessionsWithHttpInfoAsync(System.Threading.CancellationToken cancellationToken = default) + public async System.Threading.Tasks.Task>> GetSessionsWithHttpInfoAsync(System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { Devolutions.Gateway.Client.Client.RequestOptions localVarRequestOptions = new Devolutions.Gateway.Client.Client.RequestOptions(); @@ -503,7 +503,7 @@ public Devolutions.Gateway.Client.Client.ApiResponse TerminateSessionWit /// Session / association ID of the session to terminate /// Cancellation Token to cancel the request. /// Task of void - public async System.Threading.Tasks.Task TerminateSessionAsync(Guid id, System.Threading.CancellationToken cancellationToken = default) + public async System.Threading.Tasks.Task TerminateSessionAsync(Guid id, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { await TerminateSessionWithHttpInfoAsync(id, cancellationToken).ConfigureAwait(false); } @@ -515,7 +515,7 @@ public async System.Threading.Tasks.Task TerminateSessionAsync(Guid id, System.T /// Session / association ID of the session to terminate /// Cancellation Token to cancel the request. /// Task of ApiResponse - public async System.Threading.Tasks.Task> TerminateSessionWithHttpInfoAsync(Guid id, System.Threading.CancellationToken cancellationToken = default) + public async System.Threading.Tasks.Task> TerminateSessionWithHttpInfoAsync(Guid id, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { Devolutions.Gateway.Client.Client.RequestOptions localVarRequestOptions = new Devolutions.Gateway.Client.Client.RequestOptions(); diff --git a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Api/TrafficApi.cs b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Api/TrafficApi.cs index af919a199..127ae622a 100644 --- a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Api/TrafficApi.cs +++ b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Api/TrafficApi.cs @@ -85,7 +85,7 @@ public interface ITrafficApiAsync : IApiAccessor /// Array of event IDs to acknowledge /// Cancellation Token to cancel the request. /// Task of AckResponse - System.Threading.Tasks.Task AckTrafficEventsAsync(AckRequest ackRequest, System.Threading.CancellationToken cancellationToken = default); + System.Threading.Tasks.Task AckTrafficEventsAsync(AckRequest ackRequest, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Acknowledge traffic audit events and remove them from the queue @@ -97,7 +97,7 @@ public interface ITrafficApiAsync : IApiAccessor /// Array of event IDs to acknowledge /// Cancellation Token to cancel the request. /// Task of ApiResponse (AckResponse) - System.Threading.Tasks.Task> AckTrafficEventsWithHttpInfoAsync(AckRequest ackRequest, System.Threading.CancellationToken cancellationToken = default); + System.Threading.Tasks.Task> AckTrafficEventsWithHttpInfoAsync(AckRequest ackRequest, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Claim traffic audit events for processing /// @@ -109,7 +109,7 @@ public interface ITrafficApiAsync : IApiAccessor /// Maximum number of events to claim (1-1000, default: 100) /// Cancellation Token to cancel the request. /// Task of List<ClaimedTrafficEvent> - System.Threading.Tasks.Task> ClaimTrafficEventsAsync(int leaseMs, int max, System.Threading.CancellationToken cancellationToken = default); + System.Threading.Tasks.Task> ClaimTrafficEventsAsync(int leaseMs, int max, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Claim traffic audit events for processing @@ -122,7 +122,7 @@ public interface ITrafficApiAsync : IApiAccessor /// Maximum number of events to claim (1-1000, default: 100) /// Cancellation Token to cancel the request. /// Task of ApiResponse (List<ClaimedTrafficEvent>) - System.Threading.Tasks.Task>> ClaimTrafficEventsWithHttpInfoAsync(int leaseMs, int max, System.Threading.CancellationToken cancellationToken = default); + System.Threading.Tasks.Task>> ClaimTrafficEventsWithHttpInfoAsync(int leaseMs, int max, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); #endregion Asynchronous Operations } @@ -405,7 +405,7 @@ public Devolutions.Gateway.Client.Client.ApiResponse AckTrafficEven /// Array of event IDs to acknowledge /// Cancellation Token to cancel the request. /// Task of AckResponse - public async System.Threading.Tasks.Task AckTrafficEventsAsync(AckRequest ackRequest, System.Threading.CancellationToken cancellationToken = default) + public async System.Threading.Tasks.Task AckTrafficEventsAsync(AckRequest ackRequest, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { Devolutions.Gateway.Client.Client.ApiResponse localVarResponse = await AckTrafficEventsWithHttpInfoAsync(ackRequest, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -418,7 +418,7 @@ public async System.Threading.Tasks.Task AckTrafficEventsAsync(AckR /// Array of event IDs to acknowledge /// Cancellation Token to cancel the request. /// Task of ApiResponse (AckResponse) - public async System.Threading.Tasks.Task> AckTrafficEventsWithHttpInfoAsync(AckRequest ackRequest, System.Threading.CancellationToken cancellationToken = default) + public async System.Threading.Tasks.Task> AckTrafficEventsWithHttpInfoAsync(AckRequest ackRequest, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { // verify the required parameter 'ackRequest' is set if (ackRequest == null) @@ -533,7 +533,7 @@ public Devolutions.Gateway.Client.Client.ApiResponse> /// Maximum number of events to claim (1-1000, default: 100) /// Cancellation Token to cancel the request. /// Task of List<ClaimedTrafficEvent> - public async System.Threading.Tasks.Task> ClaimTrafficEventsAsync(int leaseMs, int max, System.Threading.CancellationToken cancellationToken = default) + public async System.Threading.Tasks.Task> ClaimTrafficEventsAsync(int leaseMs, int max, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { Devolutions.Gateway.Client.Client.ApiResponse> localVarResponse = await ClaimTrafficEventsWithHttpInfoAsync(leaseMs, max, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -547,7 +547,7 @@ public async System.Threading.Tasks.Task> ClaimTraffic /// Maximum number of events to claim (1-1000, default: 100) /// Cancellation Token to cancel the request. /// Task of ApiResponse (List<ClaimedTrafficEvent>) - public async System.Threading.Tasks.Task>> ClaimTrafficEventsWithHttpInfoAsync(int leaseMs, int max, System.Threading.CancellationToken cancellationToken = default) + public async System.Threading.Tasks.Task>> ClaimTrafficEventsWithHttpInfoAsync(int leaseMs, int max, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { Devolutions.Gateway.Client.Client.RequestOptions localVarRequestOptions = new Devolutions.Gateway.Client.Client.RequestOptions(); diff --git a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Api/UpdateApi.cs b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Api/UpdateApi.cs index 59ead0b85..0eb72c187 100644 --- a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Api/UpdateApi.cs +++ b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Api/UpdateApi.cs @@ -97,7 +97,7 @@ public interface IUpdateApiSync : IApiAccessor /// Gateway-only target version; use the request body for multi-product updates (optional) (deprecated) /// Products and target versions to update (optional) /// Object - Object TriggerUpdate(string? version = default, UpdateRequestSchema? updateRequestSchema = default); + Object TriggerUpdate(string? version = default(string?), UpdateRequestSchema? updateRequestSchema = default(UpdateRequestSchema?)); /// /// Trigger an update for one or more Devolutions products. @@ -109,7 +109,7 @@ public interface IUpdateApiSync : IApiAccessor /// Gateway-only target version; use the request body for multi-product updates (optional) (deprecated) /// Products and target versions to update (optional) /// ApiResponse of Object - ApiResponse TriggerUpdateWithHttpInfo(string? version = default, UpdateRequestSchema? updateRequestSchema = default); + ApiResponse TriggerUpdateWithHttpInfo(string? version = default(string?), UpdateRequestSchema? updateRequestSchema = default(UpdateRequestSchema?)); #endregion Synchronous Operations } @@ -128,7 +128,7 @@ public interface IUpdateApiAsync : IApiAccessor /// Thrown when fails to make API call /// Cancellation Token to cancel the request. /// Task of GetUpdateProductsResponse - System.Threading.Tasks.Task GetUpdateProductsAsync(System.Threading.CancellationToken cancellationToken = default); + System.Threading.Tasks.Task GetUpdateProductsAsync(System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Retrieve the currently installed version of each Devolutions product. @@ -139,7 +139,7 @@ public interface IUpdateApiAsync : IApiAccessor /// Thrown when fails to make API call /// Cancellation Token to cancel the request. /// Task of ApiResponse (GetUpdateProductsResponse) - System.Threading.Tasks.Task> GetUpdateProductsWithHttpInfoAsync(System.Threading.CancellationToken cancellationToken = default); + System.Threading.Tasks.Task> GetUpdateProductsWithHttpInfoAsync(System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Retrieve the current Devolutions Agent auto-update schedule. /// @@ -149,7 +149,7 @@ public interface IUpdateApiAsync : IApiAccessor /// Thrown when fails to make API call /// Cancellation Token to cancel the request. /// Task of GetUpdateScheduleResponse - System.Threading.Tasks.Task GetUpdateScheduleAsync(System.Threading.CancellationToken cancellationToken = default); + System.Threading.Tasks.Task GetUpdateScheduleAsync(System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Retrieve the current Devolutions Agent auto-update schedule. @@ -160,7 +160,7 @@ public interface IUpdateApiAsync : IApiAccessor /// Thrown when fails to make API call /// Cancellation Token to cancel the request. /// Task of ApiResponse (GetUpdateScheduleResponse) - System.Threading.Tasks.Task> GetUpdateScheduleWithHttpInfoAsync(System.Threading.CancellationToken cancellationToken = default); + System.Threading.Tasks.Task> GetUpdateScheduleWithHttpInfoAsync(System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Set the Devolutions Agent auto-update schedule. /// @@ -171,7 +171,7 @@ public interface IUpdateApiAsync : IApiAccessor /// /// Cancellation Token to cancel the request. /// Task of Object - System.Threading.Tasks.Task SetUpdateScheduleAsync(SetUpdateScheduleRequest setUpdateScheduleRequest, System.Threading.CancellationToken cancellationToken = default); + System.Threading.Tasks.Task SetUpdateScheduleAsync(SetUpdateScheduleRequest setUpdateScheduleRequest, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Set the Devolutions Agent auto-update schedule. @@ -183,7 +183,7 @@ public interface IUpdateApiAsync : IApiAccessor /// /// Cancellation Token to cancel the request. /// Task of ApiResponse (Object) - System.Threading.Tasks.Task> SetUpdateScheduleWithHttpInfoAsync(SetUpdateScheduleRequest setUpdateScheduleRequest, System.Threading.CancellationToken cancellationToken = default); + System.Threading.Tasks.Task> SetUpdateScheduleWithHttpInfoAsync(SetUpdateScheduleRequest setUpdateScheduleRequest, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Trigger an update for one or more Devolutions products. /// @@ -195,7 +195,7 @@ public interface IUpdateApiAsync : IApiAccessor /// Products and target versions to update (optional) /// Cancellation Token to cancel the request. /// Task of Object - System.Threading.Tasks.Task TriggerUpdateAsync(string? version = default, UpdateRequestSchema? updateRequestSchema = default, System.Threading.CancellationToken cancellationToken = default); + System.Threading.Tasks.Task TriggerUpdateAsync(string? version = default(string?), UpdateRequestSchema? updateRequestSchema = default(UpdateRequestSchema?), System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Trigger an update for one or more Devolutions products. @@ -208,7 +208,7 @@ public interface IUpdateApiAsync : IApiAccessor /// Products and target versions to update (optional) /// Cancellation Token to cancel the request. /// Task of ApiResponse (Object) - System.Threading.Tasks.Task> TriggerUpdateWithHttpInfoAsync(string? version = default, UpdateRequestSchema? updateRequestSchema = default, System.Threading.CancellationToken cancellationToken = default); + System.Threading.Tasks.Task> TriggerUpdateWithHttpInfoAsync(string? version = default(string?), UpdateRequestSchema? updateRequestSchema = default(UpdateRequestSchema?), System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); #endregion Asynchronous Operations } @@ -482,7 +482,7 @@ public Devolutions.Gateway.Client.Client.ApiResponse /// Thrown when fails to make API call /// Cancellation Token to cancel the request. /// Task of GetUpdateProductsResponse - public async System.Threading.Tasks.Task GetUpdateProductsAsync(System.Threading.CancellationToken cancellationToken = default) + public async System.Threading.Tasks.Task GetUpdateProductsAsync(System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { Devolutions.Gateway.Client.Client.ApiResponse localVarResponse = await GetUpdateProductsWithHttpInfoAsync(cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -494,7 +494,7 @@ public async System.Threading.Tasks.Task GetUpdatePro /// Thrown when fails to make API call /// Cancellation Token to cancel the request. /// Task of ApiResponse (GetUpdateProductsResponse) - public async System.Threading.Tasks.Task> GetUpdateProductsWithHttpInfoAsync(System.Threading.CancellationToken cancellationToken = default) + public async System.Threading.Tasks.Task> GetUpdateProductsWithHttpInfoAsync(System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { Devolutions.Gateway.Client.Client.RequestOptions localVarRequestOptions = new Devolutions.Gateway.Client.Client.RequestOptions(); @@ -595,7 +595,7 @@ public Devolutions.Gateway.Client.Client.ApiResponse /// Thrown when fails to make API call /// Cancellation Token to cancel the request. /// Task of GetUpdateScheduleResponse - public async System.Threading.Tasks.Task GetUpdateScheduleAsync(System.Threading.CancellationToken cancellationToken = default) + public async System.Threading.Tasks.Task GetUpdateScheduleAsync(System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { Devolutions.Gateway.Client.Client.ApiResponse localVarResponse = await GetUpdateScheduleWithHttpInfoAsync(cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -607,7 +607,7 @@ public async System.Threading.Tasks.Task GetUpdateSch /// Thrown when fails to make API call /// Cancellation Token to cancel the request. /// Task of ApiResponse (GetUpdateScheduleResponse) - public async System.Threading.Tasks.Task> GetUpdateScheduleWithHttpInfoAsync(System.Threading.CancellationToken cancellationToken = default) + public async System.Threading.Tasks.Task> GetUpdateScheduleWithHttpInfoAsync(System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { Devolutions.Gateway.Client.Client.RequestOptions localVarRequestOptions = new Devolutions.Gateway.Client.Client.RequestOptions(); @@ -717,7 +717,7 @@ public Devolutions.Gateway.Client.Client.ApiResponse SetUpdateScheduleWi /// /// Cancellation Token to cancel the request. /// Task of Object - public async System.Threading.Tasks.Task SetUpdateScheduleAsync(SetUpdateScheduleRequest setUpdateScheduleRequest, System.Threading.CancellationToken cancellationToken = default) + public async System.Threading.Tasks.Task SetUpdateScheduleAsync(SetUpdateScheduleRequest setUpdateScheduleRequest, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { Devolutions.Gateway.Client.Client.ApiResponse localVarResponse = await SetUpdateScheduleWithHttpInfoAsync(setUpdateScheduleRequest, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -730,7 +730,7 @@ public async System.Threading.Tasks.Task SetUpdateScheduleAsync(SetUpdat /// /// Cancellation Token to cancel the request. /// Task of ApiResponse (Object) - public async System.Threading.Tasks.Task> SetUpdateScheduleWithHttpInfoAsync(SetUpdateScheduleRequest setUpdateScheduleRequest, System.Threading.CancellationToken cancellationToken = default) + public async System.Threading.Tasks.Task> SetUpdateScheduleWithHttpInfoAsync(SetUpdateScheduleRequest setUpdateScheduleRequest, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { // verify the required parameter 'setUpdateScheduleRequest' is set if (setUpdateScheduleRequest == null) @@ -784,7 +784,7 @@ public async System.Threading.Tasks.Task SetUpdateScheduleAsync(SetUpdat /// Gateway-only target version; use the request body for multi-product updates (optional) (deprecated) /// Products and target versions to update (optional) /// Object - public Object TriggerUpdate(string? version = default, UpdateRequestSchema? updateRequestSchema = default) + public Object TriggerUpdate(string? version = default(string?), UpdateRequestSchema? updateRequestSchema = default(UpdateRequestSchema?)) { Devolutions.Gateway.Client.Client.ApiResponse localVarResponse = TriggerUpdateWithHttpInfo(version, updateRequestSchema); return localVarResponse.Data; @@ -797,7 +797,7 @@ public Object TriggerUpdate(string? version = default, UpdateRequestSchema? upda /// Gateway-only target version; use the request body for multi-product updates (optional) (deprecated) /// Products and target versions to update (optional) /// ApiResponse of Object - public Devolutions.Gateway.Client.Client.ApiResponse TriggerUpdateWithHttpInfo(string? version = default, UpdateRequestSchema? updateRequestSchema = default) + public Devolutions.Gateway.Client.Client.ApiResponse TriggerUpdateWithHttpInfo(string? version = default(string?), UpdateRequestSchema? updateRequestSchema = default(UpdateRequestSchema?)) { Devolutions.Gateway.Client.Client.RequestOptions localVarRequestOptions = new Devolutions.Gateway.Client.Client.RequestOptions(); @@ -849,7 +849,7 @@ public Devolutions.Gateway.Client.Client.ApiResponse TriggerUpdateWithHt /// Products and target versions to update (optional) /// Cancellation Token to cancel the request. /// Task of Object - public async System.Threading.Tasks.Task TriggerUpdateAsync(string? version = default, UpdateRequestSchema? updateRequestSchema = default, System.Threading.CancellationToken cancellationToken = default) + public async System.Threading.Tasks.Task TriggerUpdateAsync(string? version = default(string?), UpdateRequestSchema? updateRequestSchema = default(UpdateRequestSchema?), System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { Devolutions.Gateway.Client.Client.ApiResponse localVarResponse = await TriggerUpdateWithHttpInfoAsync(version, updateRequestSchema, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -863,7 +863,7 @@ public async System.Threading.Tasks.Task TriggerUpdateAsync(string? vers /// Products and target versions to update (optional) /// Cancellation Token to cancel the request. /// Task of ApiResponse (Object) - public async System.Threading.Tasks.Task> TriggerUpdateWithHttpInfoAsync(string? version = default, UpdateRequestSchema? updateRequestSchema = default, System.Threading.CancellationToken cancellationToken = default) + public async System.Threading.Tasks.Task> TriggerUpdateWithHttpInfoAsync(string? version = default(string?), UpdateRequestSchema? updateRequestSchema = default(UpdateRequestSchema?), System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { Devolutions.Gateway.Client.Client.RequestOptions localVarRequestOptions = new Devolutions.Gateway.Client.Client.RequestOptions(); diff --git a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Api/WebAppApi.cs b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Api/WebAppApi.cs index 201cf1d9c..ae2be8539 100644 --- a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Api/WebAppApi.cs +++ b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Api/WebAppApi.cs @@ -83,7 +83,7 @@ public interface IWebAppApiAsync : IApiAccessor /// JSON-encoded payload specifying the desired claims /// Cancellation Token to cancel the request. /// Task of string - System.Threading.Tasks.Task SignAppTokenAsync(AppTokenSignRequest appTokenSignRequest, System.Threading.CancellationToken cancellationToken = default); + System.Threading.Tasks.Task SignAppTokenAsync(AppTokenSignRequest appTokenSignRequest, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Requests a web application token using the configured authorization method @@ -95,7 +95,7 @@ public interface IWebAppApiAsync : IApiAccessor /// JSON-encoded payload specifying the desired claims /// Cancellation Token to cancel the request. /// Task of ApiResponse (string) - System.Threading.Tasks.Task> SignAppTokenWithHttpInfoAsync(AppTokenSignRequest appTokenSignRequest, System.Threading.CancellationToken cancellationToken = default); + System.Threading.Tasks.Task> SignAppTokenWithHttpInfoAsync(AppTokenSignRequest appTokenSignRequest, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Requests a session token using a web application token /// @@ -106,7 +106,7 @@ public interface IWebAppApiAsync : IApiAccessor /// JSON-encoded payload specifying the desired claims /// Cancellation Token to cancel the request. /// Task of string - System.Threading.Tasks.Task SignSessionTokenAsync(SessionTokenSignRequest sessionTokenSignRequest, System.Threading.CancellationToken cancellationToken = default); + System.Threading.Tasks.Task SignSessionTokenAsync(SessionTokenSignRequest sessionTokenSignRequest, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Requests a session token using a web application token @@ -118,7 +118,7 @@ public interface IWebAppApiAsync : IApiAccessor /// JSON-encoded payload specifying the desired claims /// Cancellation Token to cancel the request. /// Task of ApiResponse (string) - System.Threading.Tasks.Task> SignSessionTokenWithHttpInfoAsync(SessionTokenSignRequest sessionTokenSignRequest, System.Threading.CancellationToken cancellationToken = default); + System.Threading.Tasks.Task> SignSessionTokenWithHttpInfoAsync(SessionTokenSignRequest sessionTokenSignRequest, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); #endregion Asynchronous Operations } @@ -401,7 +401,7 @@ public Devolutions.Gateway.Client.Client.ApiResponse SignAppTokenWithHtt /// JSON-encoded payload specifying the desired claims /// Cancellation Token to cancel the request. /// Task of string - public async System.Threading.Tasks.Task SignAppTokenAsync(AppTokenSignRequest appTokenSignRequest, System.Threading.CancellationToken cancellationToken = default) + public async System.Threading.Tasks.Task SignAppTokenAsync(AppTokenSignRequest appTokenSignRequest, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { Devolutions.Gateway.Client.Client.ApiResponse localVarResponse = await SignAppTokenWithHttpInfoAsync(appTokenSignRequest, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -414,7 +414,7 @@ public async System.Threading.Tasks.Task SignAppTokenAsync(AppTokenSignR /// JSON-encoded payload specifying the desired claims /// Cancellation Token to cancel the request. /// Task of ApiResponse (string) - public async System.Threading.Tasks.Task> SignAppTokenWithHttpInfoAsync(AppTokenSignRequest appTokenSignRequest, System.Threading.CancellationToken cancellationToken = default) + public async System.Threading.Tasks.Task> SignAppTokenWithHttpInfoAsync(AppTokenSignRequest appTokenSignRequest, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { // verify the required parameter 'appTokenSignRequest' is set if (appTokenSignRequest == null) @@ -530,7 +530,7 @@ public Devolutions.Gateway.Client.Client.ApiResponse SignSessionTokenWit /// JSON-encoded payload specifying the desired claims /// Cancellation Token to cancel the request. /// Task of string - public async System.Threading.Tasks.Task SignSessionTokenAsync(SessionTokenSignRequest sessionTokenSignRequest, System.Threading.CancellationToken cancellationToken = default) + public async System.Threading.Tasks.Task SignSessionTokenAsync(SessionTokenSignRequest sessionTokenSignRequest, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { Devolutions.Gateway.Client.Client.ApiResponse localVarResponse = await SignSessionTokenWithHttpInfoAsync(sessionTokenSignRequest, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -543,7 +543,7 @@ public async System.Threading.Tasks.Task SignSessionTokenAsync(SessionTo /// JSON-encoded payload specifying the desired claims /// Cancellation Token to cancel the request. /// Task of ApiResponse (string) - public async System.Threading.Tasks.Task> SignSessionTokenWithHttpInfoAsync(SessionTokenSignRequest sessionTokenSignRequest, System.Threading.CancellationToken cancellationToken = default) + public async System.Threading.Tasks.Task> SignSessionTokenWithHttpInfoAsync(SessionTokenSignRequest sessionTokenSignRequest, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { // verify the required parameter 'sessionTokenSignRequest' is set if (sessionTokenSignRequest == null) diff --git a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Client/ApiClient.cs b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Client/ApiClient.cs index 33b488361..4d77365cc 100644 --- a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Client/ApiClient.cs +++ b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Client/ApiClient.cs @@ -84,7 +84,7 @@ public string Serialize(object obj) public async Task Deserialize(HttpResponseMessage response) { - var result = (T)await Deserialize(response, typeof(T)).ConfigureAwait(false); + var result = (T) await Deserialize(response, typeof(T)).ConfigureAwait(false); return result; } @@ -100,13 +100,13 @@ internal async Task Deserialize(HttpResponseMessage response, Type type) // process response headers, e.g. Access-Control-Allow-Methods foreach (var responseHeader in response.Headers) { - headers.Add(responseHeader.Key + "=" + ClientUtils.ParameterToString(responseHeader.Value)); + headers.Add(responseHeader.Key + "=" + ClientUtils.ParameterToString(responseHeader.Value)); } // process response content headers, e.g. Content-Type foreach (var responseHeader in response.Content.Headers) { - headers.Add(responseHeader.Key + "=" + ClientUtils.ParameterToString(responseHeader.Value)); + headers.Add(responseHeader.Key + "=" + ClientUtils.ParameterToString(responseHeader.Value)); } // RFC 2183 & RFC 2616 @@ -117,8 +117,7 @@ internal async Task Deserialize(HttpResponseMessage response, Type type) } else if (type == typeof(FileParameter)) { - if (headers != null) - { + if (headers != null) { foreach (var header in headers) { var match = fileNameRegex.Match(header.ToString()); @@ -197,7 +196,6 @@ public string ContentType /// public partial class ApiClient : IDisposable, ISynchronousClient, IAsynchronousClient { - private static readonly HttpRequestOptionsKey> _httpOptionsCookieContainerKey = new("CookieContainer"); private readonly string _baseUrl; private readonly HttpClientHandler _httpClientHandler; @@ -290,8 +288,7 @@ public ApiClient(HttpClient client, string basePath, HttpClientHandler handler = /// public void Dispose() { - if(_disposeClient) - { + if(_disposeClient) { _httpClient.Dispose(); } } @@ -419,7 +416,7 @@ private HttpRequestMessage NewRequest( // TODO provide an alternative that allows cookies per request instead of per API client if (options.Cookies != null && options.Cookies.Count > 0) { - request.Options.Set(_httpOptionsCookieContainerKey, options.Cookies); + request.Properties["CookieContainer"] = options.Cookies; } return request; @@ -430,7 +427,7 @@ private HttpRequestMessage NewRequest( private async Task> ToApiResponse(HttpResponseMessage response, object responseData, Uri uri) { - T result = (T)responseData; + T result = (T) responseData; string rawContent = await response.Content.ReadAsStringAsync().ConfigureAwait(false); var transformed = new ApiResponse(response.StatusCode, new Multimap(), result, rawContent) @@ -465,7 +462,7 @@ private async Task> ToApiResponse(HttpResponseMessage response transformed.Cookies.Add(cookie); } } - catch (PlatformNotSupportedException) { } + catch (PlatformNotSupportedException) {} } return transformed; @@ -478,7 +475,7 @@ private ApiResponse Exec(HttpRequestMessage req, IReadableConfiguration co private async Task> ExecAsync(HttpRequestMessage req, IReadableConfiguration configuration, - System.Threading.CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { CancellationTokenSource timeoutTokenSource = null; CancellationTokenSource finalTokenSource = null; @@ -487,7 +484,7 @@ private async Task> ExecAsync(HttpRequestMessage req, try { - if (configuration.Timeout > TimeSpan.Zero) + if (configuration.Timeout > 0) { timeoutTokenSource = new CancellationTokenSource(configuration.Timeout); finalTokenSource = CancellationTokenSource.CreateLinkedTokenSource(finalToken, timeoutTokenSource.Token); @@ -502,14 +499,15 @@ private async Task> ExecAsync(HttpRequestMessage req, if (configuration.ClientCertificates != null) { - if (_httpClientHandler == null) throw new InvalidOperationException("Configuration `ClientCertificates` not supported when the client is explicitly created without an HttpClientHandler, use the proper constructor."); + if(_httpClientHandler == null) throw new InvalidOperationException("Configuration `ClientCertificates` not supported when the client is explicitly created without an HttpClientHandler, use the proper constructor."); _httpClientHandler.ClientCertificates.AddRange(configuration.ClientCertificates); } + var cookieContainer = req.Properties.ContainsKey("CookieContainer") ? req.Properties["CookieContainer"] as List : null; - if (req.Options.TryGetValue(_httpOptionsCookieContainerKey, out var cookieContainer)) + if (cookieContainer != null) { - if (_httpClientHandler == null) throw new InvalidOperationException("Request property `CookieContainer` not supported when the client is explicitly created without an HttpClientHandler, use the proper constructor."); + if(_httpClientHandler == null) throw new InvalidOperationException("Request property `CookieContainer` not supported when the client is explicitly created without an HttpClientHandler, use the proper constructor."); foreach (var cookie in cookieContainer) { _httpClientHandler.CookieContainer.Add(cookie); @@ -539,7 +537,7 @@ private async Task> ExecAsync(HttpRequestMessage req, if (!response.IsSuccessStatusCode) { - return await ToApiResponse(response, default, req.RequestUri).ConfigureAwait(false); + return await ToApiResponse(response, default(T), req.RequestUri).ConfigureAwait(false); } object responseData = await deserializer.Deserialize(response).ConfigureAwait(false); @@ -547,11 +545,11 @@ private async Task> ExecAsync(HttpRequestMessage req, // if the response type is oneOf/anyOf, call FromJSON to deserialize the data if (typeof(Devolutions.Gateway.Client.Model.AbstractOpenAPISchema).IsAssignableFrom(typeof(T))) { - responseData = (T)typeof(T).GetMethod("FromJson").Invoke(null, new object[] { response.Content }); + responseData = (T) typeof(T).GetMethod("FromJson").Invoke(null, new object[] { response.Content }); } else if (typeof(T).Name == "Stream") // for binary response { - responseData = (T)(object) await response.Content.ReadAsStreamAsync().ConfigureAwait(false); + responseData = (T) (object) await response.Content.ReadAsStreamAsync().ConfigureAwait(false); } InterceptResponse(req, response); @@ -591,7 +589,7 @@ private async Task> ExecAsync(HttpRequestMessage req, /// GlobalConfiguration has been done before calling this method. /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> GetAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default) + public Task> GetAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { var config = configuration ?? GlobalConfiguration.Instance; return ExecAsync(NewRequest(HttpMethod.Get, path, options, config), config, cancellationToken); @@ -606,7 +604,7 @@ public Task> GetAsync(string path, RequestOptions options, IRe /// GlobalConfiguration has been done before calling this method. /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> PostAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default) + public Task> PostAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { var config = configuration ?? GlobalConfiguration.Instance; return ExecAsync(NewRequest(HttpMethod.Post, path, options, config), config, cancellationToken); @@ -621,7 +619,7 @@ public Task> PostAsync(string path, RequestOptions options, IR /// GlobalConfiguration has been done before calling this method. /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> PutAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default) + public Task> PutAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { var config = configuration ?? GlobalConfiguration.Instance; return ExecAsync(NewRequest(HttpMethod.Put, path, options, config), config, cancellationToken); @@ -636,7 +634,7 @@ public Task> PutAsync(string path, RequestOptions options, IRe /// GlobalConfiguration has been done before calling this method. /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> DeleteAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default) + public Task> DeleteAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { var config = configuration ?? GlobalConfiguration.Instance; return ExecAsync(NewRequest(HttpMethod.Delete, path, options, config), config, cancellationToken); @@ -651,7 +649,7 @@ public Task> DeleteAsync(string path, RequestOptions options, /// GlobalConfiguration has been done before calling this method. /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> HeadAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default) + public Task> HeadAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { var config = configuration ?? GlobalConfiguration.Instance; return ExecAsync(NewRequest(HttpMethod.Head, path, options, config), config, cancellationToken); @@ -666,7 +664,7 @@ public Task> HeadAsync(string path, RequestOptions options, IR /// GlobalConfiguration has been done before calling this method. /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> OptionsAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default) + public Task> OptionsAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { var config = configuration ?? GlobalConfiguration.Instance; return ExecAsync(NewRequest(HttpMethod.Options, path, options, config), config, cancellationToken); @@ -681,7 +679,7 @@ public Task> OptionsAsync(string path, RequestOptions options, /// GlobalConfiguration has been done before calling this method. /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> PatchAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default) + public Task> PatchAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { var config = configuration ?? GlobalConfiguration.Instance; return ExecAsync(NewRequest(new HttpMethod("PATCH"), path, options, config), config, cancellationToken); diff --git a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Client/IAsynchronousClient.cs b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Client/IAsynchronousClient.cs index bd15e394b..81c81f40c 100644 --- a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Client/IAsynchronousClient.cs +++ b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Client/IAsynchronousClient.cs @@ -30,7 +30,7 @@ public interface IAsynchronousClient /// Cancellation Token to cancel the request. /// The return type. /// A task eventually representing the response data, decorated with - Task> GetAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default); + Task> GetAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Executes a non-blocking call to some using the POST http verb. @@ -41,7 +41,7 @@ public interface IAsynchronousClient /// Cancellation Token to cancel the request. /// The return type. /// A task eventually representing the response data, decorated with - Task> PostAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default); + Task> PostAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Executes a non-blocking call to some using the PUT http verb. @@ -52,7 +52,7 @@ public interface IAsynchronousClient /// Cancellation Token to cancel the request. /// The return type. /// A task eventually representing the response data, decorated with - Task> PutAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default); + Task> PutAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Executes a non-blocking call to some using the DELETE http verb. @@ -63,7 +63,7 @@ public interface IAsynchronousClient /// Cancellation Token to cancel the request. /// The return type. /// A task eventually representing the response data, decorated with - Task> DeleteAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default); + Task> DeleteAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Executes a non-blocking call to some using the HEAD http verb. @@ -74,7 +74,7 @@ public interface IAsynchronousClient /// Cancellation Token to cancel the request. /// The return type. /// A task eventually representing the response data, decorated with - Task> HeadAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default); + Task> HeadAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Executes a non-blocking call to some using the OPTIONS http verb. @@ -85,7 +85,7 @@ public interface IAsynchronousClient /// Cancellation Token to cancel the request. /// The return type. /// A task eventually representing the response data, decorated with - Task> OptionsAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default); + Task> OptionsAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Executes a non-blocking call to some using the PATCH http verb. @@ -96,6 +96,6 @@ public interface IAsynchronousClient /// Cancellation Token to cancel the request. /// The return type. /// A task eventually representing the response data, decorated with - Task> PatchAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default); + Task> PatchAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); } } diff --git a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Client/IReadableConfiguration.cs b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Client/IReadableConfiguration.cs index bc96f0a28..5ad5279b4 100644 --- a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Client/IReadableConfiguration.cs +++ b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Client/IReadableConfiguration.cs @@ -72,10 +72,10 @@ public interface IReadableConfiguration string TempFolderPath { get; } /// - /// Gets the HTTP connection timeout. + /// Gets the HTTP connection timeout (in milliseconds) /// /// HTTP connection timeout. - TimeSpan Timeout { get; } + int Timeout { get; } /// /// Gets the proxy. diff --git a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Client/RetryConfiguration.cs b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Client/RetryConfiguration.cs index 788ea50c0..5a7dad315 100644 --- a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Client/RetryConfiguration.cs +++ b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Client/RetryConfiguration.cs @@ -22,11 +22,11 @@ public static class RetryConfiguration /// /// Retry policy /// - public static ISyncPolicy RetryPolicy { get; set; } + public static Policy RetryPolicy { get; set; } /// /// Async retry policy /// - public static IAsyncPolicy AsyncRetryPolicy { get; set; } + public static AsyncPolicy AsyncRetryPolicy { get; set; } } } diff --git a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/AckRequest.cs b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/AckRequest.cs index 12511c20c..453b72fea 100644 --- a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/AckRequest.cs +++ b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/AckRequest.cs @@ -42,7 +42,7 @@ protected AckRequest() { } /// Initializes a new instance of the class. /// /// Array of event IDs to acknowledge (1-10000 items, ULID format) (required). - public AckRequest(List ids = default) + public AckRequest(List ids = default(List)) { // to ensure "ids" is required (not null) if (ids == null) diff --git a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/AckResponse.cs b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/AckResponse.cs index 8c3ddb44e..217abd069 100644 --- a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/AckResponse.cs +++ b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/AckResponse.cs @@ -42,7 +42,7 @@ protected AckResponse() { } /// Initializes a new instance of the class. /// /// Number of events that were acknowledged and deleted (required). - public AckResponse(long deletedCount = default) + public AckResponse(long deletedCount = default(long)) { this.DeletedCount = deletedCount; } diff --git a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/AppCredential.cs b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/AppCredential.cs index 7e312acab..37d90237b 100644 --- a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/AppCredential.cs +++ b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/AppCredential.cs @@ -50,7 +50,7 @@ protected AppCredential() { } /// kind (required). /// Password for the credential. Required for \"username-password\" kind.. /// Username for the credential. Required for \"username-password\" kind.. - public AppCredential(AppCredentialKind kind = default, string password = default, string username = default) + public AppCredential(AppCredentialKind kind = default(AppCredentialKind), string password = default(string), string username = default(string)) { this.Kind = kind; this.Password = password; diff --git a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/AppTokenSignRequest.cs b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/AppTokenSignRequest.cs index 465bcb456..fb54ffa0d 100644 --- a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/AppTokenSignRequest.cs +++ b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/AppTokenSignRequest.cs @@ -50,7 +50,7 @@ protected AppTokenSignRequest() { } /// contentType (required). /// The validity duration in seconds for the app token. This value cannot exceed the configured maximum lifetime. If no value is provided, the configured maximum lifetime will be granted.. /// The username used to request the app token. (required). - public AppTokenSignRequest(AppTokenContentType contentType = default, long? lifetime = default, string subject = default) + public AppTokenSignRequest(AppTokenContentType contentType = default(AppTokenContentType), long? lifetime = default(long?), string subject = default(string)) { this.ContentType = contentType; // to ensure "subject" is required (not null) diff --git a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/ClaimedTrafficEvent.cs b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/ClaimedTrafficEvent.cs index 0ab8b5428..a69d86bda 100644 --- a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/ClaimedTrafficEvent.cs +++ b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/ClaimedTrafficEvent.cs @@ -65,7 +65,7 @@ protected ClaimedTrafficEvent() { } /// Concrete target IP address after resolution (required). /// Target port number for the connection (required). /// Database ID of the claimed event (used for acknowledgment, ULID format) (required). - public ClaimedTrafficEvent(long activeDurationMs = default, long bytesRx = default, long bytesTx = default, long connectAtMs = default, long disconnectAtMs = default, EventOutcomeResponse outcome = default, TransportProtocolResponse protocol = default, Guid sessionId = default, string targetHost = default, string targetIp = default, int targetPort = default, string id = default) + public ClaimedTrafficEvent(long activeDurationMs = default(long), long bytesRx = default(long), long bytesTx = default(long), long connectAtMs = default(long), long disconnectAtMs = default(long), EventOutcomeResponse outcome = default(EventOutcomeResponse), TransportProtocolResponse protocol = default(TransportProtocolResponse), Guid sessionId = default(Guid), string targetHost = default(string), string targetIp = default(string), int targetPort = default(int), string id = default(string)) { this.ActiveDurationMs = activeDurationMs; this.BytesRx = bytesRx; diff --git a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/ClockDiagnostic.cs b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/ClockDiagnostic.cs index aac39db87..119d37def 100644 --- a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/ClockDiagnostic.cs +++ b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/ClockDiagnostic.cs @@ -43,7 +43,7 @@ protected ClockDiagnostic() { } /// /// Current time in milliseconds (required). /// Current time in seconds (required). - public ClockDiagnostic(long timestampMillis = default, long timestampSecs = default) + public ClockDiagnostic(long timestampMillis = default(long), long timestampSecs = default(long)) { this.TimestampMillis = timestampMillis; this.TimestampSecs = timestampSecs; diff --git a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/ConfigDiagnostic.cs b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/ConfigDiagnostic.cs index 718211b7e..b5c6c4a98 100644 --- a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/ConfigDiagnostic.cs +++ b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/ConfigDiagnostic.cs @@ -45,7 +45,7 @@ protected ConfigDiagnostic() { } /// This Gateway's unique ID. /// Listeners configured on this instance (required). /// Gateway service version (required). - public ConfigDiagnostic(string hostname = default, Guid? id = default, List listeners = default, string varVersion = default) + public ConfigDiagnostic(string hostname = default(string), Guid? id = default(Guid?), List listeners = default(List), string varVersion = default(string)) { // to ensure "hostname" is required (not null) if (hostname == null) diff --git a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/ConfigPatch.cs b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/ConfigPatch.cs index bcd54f115..b23cdace1 100644 --- a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/ConfigPatch.cs +++ b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/ConfigPatch.cs @@ -39,7 +39,7 @@ public partial class ConfigPatch : IValidatableObject /// This Gateway's unique ID. /// subProvisionerPublicKey. /// subscriber. - public ConfigPatch(Guid? id = default, SubProvisionerKey subProvisionerPublicKey = default, Subscriber subscriber = default) + public ConfigPatch(Guid? id = default(Guid?), SubProvisionerKey subProvisionerPublicKey = default(SubProvisionerKey), Subscriber subscriber = default(Subscriber)) { this.Id = id; this.SubProvisionerPublicKey = subProvisionerPublicKey; diff --git a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/DeleteManyResult.cs b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/DeleteManyResult.cs index 2c63501bc..d0c3420bc 100644 --- a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/DeleteManyResult.cs +++ b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/DeleteManyResult.cs @@ -43,7 +43,7 @@ protected DeleteManyResult() { } /// /// Number of recordings found (required). /// Number of recordings not found (required). - public DeleteManyResult(int foundCount = default, int notFoundCount = default) + public DeleteManyResult(int foundCount = default(int), int notFoundCount = default(int)) { this.FoundCount = foundCount; this.NotFoundCount = notFoundCount; diff --git a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/GetUpdateProductsResponse.cs b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/GetUpdateProductsResponse.cs index 3c8b97814..e45b5346a 100644 --- a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/GetUpdateProductsResponse.cs +++ b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/GetUpdateProductsResponse.cs @@ -43,7 +43,7 @@ protected GetUpdateProductsResponse() { } /// /// Version of the `update_status.json` format in `\"major.minor\"` form (e.g. `\"1.1\"`). (required). /// Map of product name to API-specific product info.. - public GetUpdateProductsResponse(string manifestVersion = default, Dictionary products = default) + public GetUpdateProductsResponse(string manifestVersion = default(string), Dictionary products = default(Dictionary)) { // to ensure "manifestVersion" is required (not null) if (manifestVersion == null) diff --git a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/GetUpdateScheduleResponse.cs b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/GetUpdateScheduleResponse.cs index c37bab87c..214610d2c 100644 --- a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/GetUpdateScheduleResponse.cs +++ b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/GetUpdateScheduleResponse.cs @@ -47,7 +47,7 @@ protected GetUpdateScheduleResponse() { } /// Products the agent autonomously polls for new versions.. /// End of the maintenance window as seconds past midnight (local time, exclusive). `None` means no upper bound (single check at `UpdateWindowStart`).. /// Start of the maintenance window as seconds past midnight (local time). (required). - public GetUpdateScheduleResponse(bool enabled = default, long interval = default, string manifestVersion = default, List products = default, int? updateWindowEnd = default, int updateWindowStart = default) + public GetUpdateScheduleResponse(bool enabled = default(bool), long interval = default(long), string manifestVersion = default(string), List products = default(List), int? updateWindowEnd = default(int?), int updateWindowStart = default(int)) { this.Enabled = enabled; this.Interval = interval; diff --git a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/Heartbeat.cs b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/Heartbeat.cs index 70f3803b9..70e8d5fce 100644 --- a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/Heartbeat.cs +++ b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/Heartbeat.cs @@ -49,7 +49,7 @@ protected Heartbeat() { } /// The total space of the disk used to store recordings, in bytes. Since v2024.1.6.. /// Number of running sessions. (required). /// Gateway service version. (required). - public Heartbeat(string agentVersion = default, string hostname = default, Guid? id = default, long? recordingStorageAvailableSpace = default, bool? recordingStorageIsWriteable = default, long? recordingStorageTotalSpace = default, int runningSessionCount = default, string varVersion = default) + public Heartbeat(string agentVersion = default(string), string hostname = default(string), Guid? id = default(Guid?), long? recordingStorageAvailableSpace = default(long?), bool? recordingStorageIsWriteable = default(bool?), long? recordingStorageTotalSpace = default(long?), int runningSessionCount = default(int), string varVersion = default(string)) { // to ensure "hostname" is required (not null) if (hostname == null) diff --git a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/Identity.cs b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/Identity.cs index 3ad970405..f27bb51dc 100644 --- a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/Identity.cs +++ b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/Identity.cs @@ -44,7 +44,7 @@ protected Identity() { } /// This Gateway's hostname (required). /// This Gateway's unique ID. /// Gateway service version. - public Identity(string hostname = default, Guid? id = default, string varVersion = default) + public Identity(string hostname = default(string), Guid? id = default(Guid?), string varVersion = default(string)) { // to ensure "hostname" is required (not null) if (hostname == null) diff --git a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/InterfaceInfo.cs b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/InterfaceInfo.cs index 94118d65c..9acb50e90 100644 --- a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/InterfaceInfo.cs +++ b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/InterfaceInfo.cs @@ -52,7 +52,7 @@ protected InterfaceInfo() { } /// family (required). /// mac. /// netmask. - public InterfaceInfo(string address = default, string broadcast = default, AddressFamily family = default, string mac = default, string netmask = default) + public InterfaceInfo(string address = default(string), string broadcast = default(string), AddressFamily family = default(AddressFamily), string mac = default(string), string netmask = default(string)) { // to ensure "address" is required (not null) if (address == null) diff --git a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/JrlInfo.cs b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/JrlInfo.cs index 3ddb60602..44ae29e6b 100644 --- a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/JrlInfo.cs +++ b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/JrlInfo.cs @@ -43,7 +43,7 @@ protected JrlInfo() { } /// /// JWT \"Issued At\" claim of JRL (required). /// Unique ID for current JRL (required). - public JrlInfo(long iat = default, Guid jti = default) + public JrlInfo(long iat = default(long), Guid jti = default(Guid)) { this.Iat = iat; this.Jti = jti; diff --git a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/ListenerUrls.cs b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/ListenerUrls.cs index 98e9e5501..ccd051a68 100644 --- a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/ListenerUrls.cs +++ b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/ListenerUrls.cs @@ -43,7 +43,7 @@ protected ListenerUrls() { } /// /// URL to use from external networks (required). /// URL to use on local network (required). - public ListenerUrls(string externalUrl = default, string internalUrl = default) + public ListenerUrls(string externalUrl = default(string), string internalUrl = default(string)) { // to ensure "externalUrl" is required (not null) if (externalUrl == null) diff --git a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/MonitorDefinition.cs b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/MonitorDefinition.cs index b22c9fd97..1c5ced8de 100644 --- a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/MonitorDefinition.cs +++ b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/MonitorDefinition.cs @@ -47,7 +47,7 @@ protected MonitorDefinition() { } /// port. /// probe (required). /// timeout (required). - public MonitorDefinition(string address = default, string id = default, long interval = default, int? port = default, MonitoringProbeType probe = default, long timeout = default) + public MonitorDefinition(string address = default(string), string id = default(string), long interval = default(long), int? port = default(int?), MonitoringProbeType probe = default(MonitoringProbeType), long timeout = default(long)) { // to ensure "address" is required (not null) if (address == null) diff --git a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/MonitorDefinitionProbeTypeError.cs b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/MonitorDefinitionProbeTypeError.cs index d6f3bb49e..e6319f7fb 100644 --- a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/MonitorDefinitionProbeTypeError.cs +++ b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/MonitorDefinitionProbeTypeError.cs @@ -43,7 +43,7 @@ protected MonitorDefinitionProbeTypeError() { } /// /// The ID of the monitor definition in the client-provided config (required). /// The monitor type that was not supported (required). - public MonitorDefinitionProbeTypeError(string id = default, string probe = default) + public MonitorDefinitionProbeTypeError(string id = default(string), string probe = default(string)) { // to ensure "id" is required (not null) if (id == null) diff --git a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/MonitorResult.cs b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/MonitorResult.cs index 04a2ac4e9..3d326db43 100644 --- a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/MonitorResult.cs +++ b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/MonitorResult.cs @@ -46,7 +46,7 @@ protected MonitorResult() { } /// responseMessage. /// responseSuccess (required). /// Duration it took for the response to be received, in seconds. On error, this value is set to f64::INFINITY. (required). - public MonitorResult(string monitorId = default, DateTime requestStartTime = default, string responseMessage = default, bool responseSuccess = default, double responseTime = default) + public MonitorResult(string monitorId = default(string), DateTime requestStartTime = default(DateTime), string responseMessage = default(string), bool responseSuccess = default(bool), double responseTime = default(double)) { // to ensure "monitorId" is required (not null) if (monitorId == null) diff --git a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/MonitoringLogResponse.cs b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/MonitoringLogResponse.cs index 2451450c9..5178361b7 100644 --- a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/MonitoringLogResponse.cs +++ b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/MonitoringLogResponse.cs @@ -42,7 +42,7 @@ protected MonitoringLogResponse() { } /// Initializes a new instance of the class. /// /// entries (required). - public MonitoringLogResponse(List entries = default) + public MonitoringLogResponse(List entries = default(List)) { // to ensure "entries" is required (not null) if (entries == null) diff --git a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/MonitoringProbeTypeOneOf.cs b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/MonitoringProbeTypeOneOf.cs index 2022d7fde..c54f19afd 100644 --- a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/MonitoringProbeTypeOneOf.cs +++ b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/MonitoringProbeTypeOneOf.cs @@ -42,7 +42,7 @@ protected MonitoringProbeTypeOneOf() { } /// Initializes a new instance of the class. /// /// unknown (required). - public MonitoringProbeTypeOneOf(string unknown = default) + public MonitoringProbeTypeOneOf(string unknown = default(string)) { // to ensure "unknown" is required (not null) if (unknown == null) diff --git a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/MonitorsConfig.cs b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/MonitorsConfig.cs index 45cde3395..e2023b36e 100644 --- a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/MonitorsConfig.cs +++ b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/MonitorsConfig.cs @@ -42,7 +42,7 @@ protected MonitorsConfig() { } /// Initializes a new instance of the class. /// /// monitors (required). - public MonitorsConfig(List monitors = default) + public MonitorsConfig(List monitors = default(List)) { // to ensure "monitors" is required (not null) if (monitors == null) diff --git a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/NetworkInterfaceDto.cs b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/NetworkInterfaceDto.cs index ab3cb0370..82dd1c5ee 100644 --- a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/NetworkInterfaceDto.cs +++ b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/NetworkInterfaceDto.cs @@ -50,7 +50,7 @@ protected NetworkInterfaceDto() { } /// MTU in bytes when known.. /// name (required). /// Link speed in megabits per second when reported by the OS.. - public NetworkInterfaceDto(string description = default, string id = default, int? index = default, bool? isUp = default, string linkType = default, string macAddress = default, int? mtu = default, string name = default, long? speedMbps = default) + public NetworkInterfaceDto(string description = default(string), string id = default(string), int? index = default(int?), bool? isUp = default(bool?), string linkType = default(string), string macAddress = default(string), int? mtu = default(int?), string name = default(string), long? speedMbps = default(long?)) { // to ensure "id" is required (not null) if (id == null) diff --git a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/NetworkInterfacesResponse.cs b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/NetworkInterfacesResponse.cs index bac886efc..35cdcf5e7 100644 --- a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/NetworkInterfacesResponse.cs +++ b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/NetworkInterfacesResponse.cs @@ -42,7 +42,7 @@ protected NetworkInterfacesResponse() { } /// Initializes a new instance of the class. /// /// interfaces (required). - public NetworkInterfacesResponse(List interfaces = default) + public NetworkInterfacesResponse(List interfaces = default(List)) { // to ensure "interfaces" is required (not null) if (interfaces == null) diff --git a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/NetworkScanResultEventDto.cs b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/NetworkScanResultEventDto.cs index 908480894..b55c29445 100644 --- a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/NetworkScanResultEventDto.cs +++ b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/NetworkScanResultEventDto.cs @@ -79,7 +79,7 @@ protected NetworkScanResultEventDto() { } /// serviceLabel. /// serviceType. /// source (required). - public NetworkScanResultEventDto(string address = default, ScanResultSourceDto discoverySource = default, string hostName = default, HostScanStateDto? hostScanState = default, string interfaceId = default, string interfaceName = default, bool? isReachable = default, NetworkScanResultKindDto kind = default, string macAddress = default, int? port = default, int? responseTimeMs = default, string serviceLabel = default, string serviceType = default, ScanOriginDto source = default) + public NetworkScanResultEventDto(string address = default(string), ScanResultSourceDto discoverySource = default(ScanResultSourceDto), string hostName = default(string), HostScanStateDto? hostScanState = default(HostScanStateDto?), string interfaceId = default(string), string interfaceName = default(string), bool? isReachable = default(bool?), NetworkScanResultKindDto kind = default(NetworkScanResultKindDto), string macAddress = default(string), int? port = default(int?), int? responseTimeMs = default(int?), string serviceLabel = default(string), string serviceType = default(string), ScanOriginDto source = default(ScanOriginDto)) { // to ensure "address" is required (not null) if (address == null) diff --git a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/NetworkScanSourceCapabilitiesDto.cs b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/NetworkScanSourceCapabilitiesDto.cs index b317fda19..5a67d2b4f 100644 --- a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/NetworkScanSourceCapabilitiesDto.cs +++ b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/NetworkScanSourceCapabilitiesDto.cs @@ -48,7 +48,7 @@ protected NetworkScanSourceCapabilitiesDto() { } /// subnet (required). /// tcpProbe (required). /// zeroConf (required). - public NetworkScanSourceCapabilitiesDto(bool broadcast = default, bool dnsResolve = default, bool ipv4 = default, bool ipv6 = default, bool subnet = default, bool tcpProbe = default, bool zeroConf = default) + public NetworkScanSourceCapabilitiesDto(bool broadcast = default(bool), bool dnsResolve = default(bool), bool ipv4 = default(bool), bool ipv6 = default(bool), bool subnet = default(bool), bool tcpProbe = default(bool), bool zeroConf = default(bool)) { this.Broadcast = broadcast; this.DnsResolve = dnsResolve; diff --git a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/NetworkScanSourceDto.cs b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/NetworkScanSourceDto.cs index 99dcfd2c8..5c10a9c6d 100644 --- a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/NetworkScanSourceDto.cs +++ b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/NetworkScanSourceDto.cs @@ -48,7 +48,7 @@ protected NetworkScanSourceDto() { } /// varInterface (required). /// prefixLength. /// startAddress (required). - public NetworkScanSourceDto(string address = default, string broadcastAddress = default, NetworkScanSourceCapabilitiesDto capabilities = default, string endAddress = default, NetworkInterfaceDto varInterface = default, int? prefixLength = default, string startAddress = default) + public NetworkScanSourceDto(string address = default(string), string broadcastAddress = default(string), NetworkScanSourceCapabilitiesDto capabilities = default(NetworkScanSourceCapabilitiesDto), string endAddress = default(string), NetworkInterfaceDto varInterface = default(NetworkInterfaceDto), int? prefixLength = default(int?), string startAddress = default(string)) { // to ensure "address" is required (not null) if (address == null) diff --git a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/PreflightOperation.cs b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/PreflightOperation.cs index 667640ed7..295d042dd 100644 --- a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/PreflightOperation.cs +++ b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/PreflightOperation.cs @@ -54,7 +54,7 @@ protected PreflightOperation() { } /// targetCredential. /// Minimum persistence duration in seconds for the data provisioned via this operation. Optional parameter for \"provision-token\" and \"provision-credentials\" kinds.. /// The token to be stored on the proxy-side. Required for \"provision-token\" and \"provision-credentials\" kinds.. - public PreflightOperation(string hostToResolve = default, Guid id = default, PreflightOperationKind kind = default, AppCredential proxyCredential = default, AppCredential targetCredential = default, int? timeToLive = default, string token = default) + public PreflightOperation(string hostToResolve = default(string), Guid id = default(Guid), PreflightOperationKind kind = default(PreflightOperationKind), AppCredential proxyCredential = default(AppCredential), AppCredential targetCredential = default(AppCredential), int? timeToLive = default(int?), string token = default(string)) { this.Id = id; this.Kind = kind; diff --git a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/PreflightOutput.cs b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/PreflightOutput.cs index 8fb5ca9ed..35b5cd057 100644 --- a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/PreflightOutput.cs +++ b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/PreflightOutput.cs @@ -65,7 +65,7 @@ protected PreflightOutput() { } /// Hostname that was resolved. Set for \"resolved-host\" kind.. /// Number of running sessions. Set for \"running-session-count\" kind.. /// Service version. Set for \"version\" kind.. - public PreflightOutput(string agentVersion = default, string alertMessage = default, PreflightAlertStatus? alertStatus = default, PreflightOutputKind kind = default, Guid operationId = default, long? recordingStorageAvailableSpace = default, bool? recordingStorageIsWriteable = default, long? recordingStorageTotalSpace = default, List resolvedAddresses = default, string resolvedHost = default, int? runningSessionCount = default, string varVersion = default) + public PreflightOutput(string agentVersion = default(string), string alertMessage = default(string), PreflightAlertStatus? alertStatus = default(PreflightAlertStatus?), PreflightOutputKind kind = default(PreflightOutputKind), Guid operationId = default(Guid), long? recordingStorageAvailableSpace = default(long?), bool? recordingStorageIsWriteable = default(bool?), long? recordingStorageTotalSpace = default(long?), List resolvedAddresses = default(List), string resolvedHost = default(string), int? runningSessionCount = default(int?), string varVersion = default(string)) { this.Kind = kind; this.OperationId = operationId; diff --git a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/SessionInfo.cs b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/SessionInfo.cs index f5dd1beb9..a63021619 100644 --- a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/SessionInfo.cs +++ b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/SessionInfo.cs @@ -55,7 +55,7 @@ protected SessionInfo() { } /// Recording Policy (required). /// Date this session was started (required). /// Maximum session duration in minutes (0 is used for the infinite duration). - public SessionInfo(string applicationProtocol = default, Guid associationId = default, ConnectionMode connectionMode = default, string destinationHost = default, bool filteringPolicy = default, bool recordingPolicy = default, DateTime startTimestamp = default, long? timeToLive = default) + public SessionInfo(string applicationProtocol = default(string), Guid associationId = default(Guid), ConnectionMode connectionMode = default(ConnectionMode), string destinationHost = default(string), bool filteringPolicy = default(bool), bool recordingPolicy = default(bool), DateTime startTimestamp = default(DateTime), long? timeToLive = default(long?)) { // to ensure "applicationProtocol" is required (not null) if (applicationProtocol == null) diff --git a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/SessionTokenSignRequest.cs b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/SessionTokenSignRequest.cs index f8874e6a3..611233691 100644 --- a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/SessionTokenSignRequest.cs +++ b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/SessionTokenSignRequest.cs @@ -54,7 +54,7 @@ protected SessionTokenSignRequest() { } /// The validity duration in seconds for the session token. This value cannot exceed 2 hours. (required). /// Protocol for the session (e.g.: \"rdp\").. /// Unique ID for this session.. - public SessionTokenSignRequest(SessionTokenContentType contentType = default, string destination = default, string krbKdc = default, string krbRealm = default, long lifetime = default, string protocol = default, Guid? sessionId = default) + public SessionTokenSignRequest(SessionTokenContentType contentType = default(SessionTokenContentType), string destination = default(string), string krbKdc = default(string), string krbRealm = default(string), long lifetime = default(long), string protocol = default(string), Guid? sessionId = default(Guid?)) { this.ContentType = contentType; this.Lifetime = lifetime; diff --git a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/SetConfigResponse.cs b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/SetConfigResponse.cs index a71fbbc2e..1914cf188 100644 --- a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/SetConfigResponse.cs +++ b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/SetConfigResponse.cs @@ -37,7 +37,7 @@ public partial class SetConfigResponse : IValidatableObject /// Initializes a new instance of the class. /// /// An optional list of probes that this server could not parse.. - public SetConfigResponse(List probeTypeErrors = default) + public SetConfigResponse(List probeTypeErrors = default(List)) { this.ProbeTypeErrors = probeTypeErrors; } diff --git a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/SetUpdateScheduleRequest.cs b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/SetUpdateScheduleRequest.cs index 2f69cf3db..e12658b41 100644 --- a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/SetUpdateScheduleRequest.cs +++ b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/SetUpdateScheduleRequest.cs @@ -46,7 +46,7 @@ protected SetUpdateScheduleRequest() { } /// Products the agent autonomously polls for new versions (default: empty).. /// End of the maintenance window as seconds past midnight in local time, exclusive. `null` (default) means no upper bound - a single check fires at `UpdateWindowStart`. When end < start the window crosses midnight.. /// Start of the maintenance window as seconds past midnight in local time (default: `7200` = 02:00).. - public SetUpdateScheduleRequest(bool enabled = default, long interval = default, List products = default, int? updateWindowEnd = default, int updateWindowStart = default) + public SetUpdateScheduleRequest(bool enabled = default(bool), long interval = default(long), List products = default(List), int? updateWindowEnd = default(int?), int updateWindowStart = default(int)) { this.Enabled = enabled; this.Interval = interval; diff --git a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/SubProvisionerKey.cs b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/SubProvisionerKey.cs index e2e3a9d24..404ab0fed 100644 --- a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/SubProvisionerKey.cs +++ b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/SubProvisionerKey.cs @@ -57,7 +57,7 @@ protected SubProvisionerKey() { } /// format. /// The key ID for this subkey (required). /// The binary-to-text-encoded key data (required). - public SubProvisionerKey(DataEncoding? encoding = default, PubKeyFormat? format = default, string id = default, string value = default) + public SubProvisionerKey(DataEncoding? encoding = default(DataEncoding?), PubKeyFormat? format = default(PubKeyFormat?), string id = default(string), string value = default(string)) { // to ensure "id" is required (not null) if (id == null) diff --git a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/Subscriber.cs b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/Subscriber.cs index 8569a35d5..ac570f147 100644 --- a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/Subscriber.cs +++ b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/Subscriber.cs @@ -43,7 +43,7 @@ protected Subscriber() { } /// /// Bearer token to use when making HTTP requests (required). /// HTTP URL where notification messages are to be sent (required). - public Subscriber(string token = default, string url = default) + public Subscriber(string token = default(string), string url = default(string)) { // to ensure "token" is required (not null) if (token == null) diff --git a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/TrafficEventResponse.cs b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/TrafficEventResponse.cs index 0919f9606..317a12c35 100644 --- a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/TrafficEventResponse.cs +++ b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/TrafficEventResponse.cs @@ -64,7 +64,7 @@ protected TrafficEventResponse() { } /// Original target host string before DNS resolution (required). /// Concrete target IP address after resolution (required). /// Target port number for the connection (required). - public TrafficEventResponse(long activeDurationMs = default, long bytesRx = default, long bytesTx = default, long connectAtMs = default, long disconnectAtMs = default, EventOutcomeResponse outcome = default, TransportProtocolResponse protocol = default, Guid sessionId = default, string targetHost = default, string targetIp = default, int targetPort = default) + public TrafficEventResponse(long activeDurationMs = default(long), long bytesRx = default(long), long bytesTx = default(long), long connectAtMs = default(long), long disconnectAtMs = default(long), EventOutcomeResponse outcome = default(EventOutcomeResponse), TransportProtocolResponse protocol = default(TransportProtocolResponse), Guid sessionId = default(Guid), string targetHost = default(string), string targetIp = default(string), int targetPort = default(int)) { this.ActiveDurationMs = activeDurationMs; this.BytesRx = bytesRx; diff --git a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/UpdateProductInfo.cs b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/UpdateProductInfo.cs index eb30a0200..30008605c 100644 --- a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/UpdateProductInfo.cs +++ b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/UpdateProductInfo.cs @@ -42,7 +42,7 @@ protected UpdateProductInfo() { } /// Initializes a new instance of the class. /// /// Requested or installed version: `\"latest\"` or `\"YYYY.M.D\"` / `\"YYYY.M.D.R\"`. (required). - public UpdateProductInfo(string varVersion = default) + public UpdateProductInfo(string varVersion = default(string)) { // to ensure "varVersion" is required (not null) if (varVersion == null) diff --git a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/UpdateRequestSchema.cs b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/UpdateRequestSchema.cs index ebf70abbb..8adad30c1 100644 --- a/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/UpdateRequestSchema.cs +++ b/devolutions-gateway/openapi/dotnet-client/src/Devolutions.Gateway.Client/Model/UpdateRequestSchema.cs @@ -37,7 +37,7 @@ public partial class UpdateRequestSchema : IValidatableObject /// Initializes a new instance of the class. /// /// Map of product name to update information.. - public UpdateRequestSchema(Dictionary products = default) + public UpdateRequestSchema(Dictionary products = default(Dictionary)) { this.Products = products; } diff --git a/devolutions-gateway/openapi/dotnet-subscriber/.openapi-generator/VERSION b/devolutions-gateway/openapi/dotnet-subscriber/.openapi-generator/VERSION index 07832195c..4bc5d6181 100644 --- a/devolutions-gateway/openapi/dotnet-subscriber/.openapi-generator/VERSION +++ b/devolutions-gateway/openapi/dotnet-subscriber/.openapi-generator/VERSION @@ -1 +1 @@ -7.24.0 +7.9.0 diff --git a/devolutions-gateway/openapi/dotnet-subscriber/src/Devolutions.Gateway.Subscriber/Devolutions.Gateway.Subscriber.csproj b/devolutions-gateway/openapi/dotnet-subscriber/src/Devolutions.Gateway.Subscriber/Devolutions.Gateway.Subscriber.csproj index 1e5709596..ba24e79f7 100644 --- a/devolutions-gateway/openapi/dotnet-subscriber/src/Devolutions.Gateway.Subscriber/Devolutions.Gateway.Subscriber.csproj +++ b/devolutions-gateway/openapi/dotnet-subscriber/src/Devolutions.Gateway.Subscriber/Devolutions.Gateway.Subscriber.csproj @@ -1,27 +1,27 @@ - - C# interface to implement Devolutions Gateway Subscriber API - No Copyright - Devolutions Inc. - net6.0 - true - true - 2023.2.22.0 - annotations - Library - Devolutions.Gateway.Subscriber - Devolutions.Gateway.Subscriber - 06fa9777-a859-4fe6-a84c-cd853e072b44 - Linux - ..\.. - - - - - - - - - - + + C# interface to implement Devolutions Gateway Subscriber API + No Copyright + Devolutions Inc. + net6.0 + true + true + 2023.2.22.0 + annotations + Library + Devolutions.Gateway.Subscriber + Devolutions.Gateway.Subscriber + 06fa9777-a859-4fe6-a84c-cd853e072b44 + Linux + ..\.. + + + + + + + + + + diff --git a/devolutions-gateway/openapi/dotnet-subscriber/src/Devolutions.Gateway.Subscriber/Models/SubscriberMessageKind.cs b/devolutions-gateway/openapi/dotnet-subscriber/src/Devolutions.Gateway.Subscriber/Models/SubscriberMessageKind.cs index f4ae016ea..c1ca4cafb 100644 --- a/devolutions-gateway/openapi/dotnet-subscriber/src/Devolutions.Gateway.Subscriber/Models/SubscriberMessageKind.cs +++ b/devolutions-gateway/openapi/dotnet-subscriber/src/Devolutions.Gateway.Subscriber/Models/SubscriberMessageKind.cs @@ -30,21 +30,21 @@ public enum SubscriberMessageKind { /// - /// Enum SessionStarted for session.started + /// Enum Started for session.started /// [EnumMember(Value = "session.started")] - SessionStarted = 1, + Started = 1, /// - /// Enum SessionEnded for session.ended + /// Enum Ended for session.ended /// [EnumMember(Value = "session.ended")] - SessionEnded = 2, + Ended = 2, /// - /// Enum SessionList for session.list + /// Enum List for session.list /// [EnumMember(Value = "session.list")] - SessionList = 3 + List = 3 } } diff --git a/devolutions-gateway/openapi/ts-angular-client/.openapi-generator/FILES b/devolutions-gateway/openapi/ts-angular-client/.openapi-generator/FILES index 789664fdb..56df90448 100644 --- a/devolutions-gateway/openapi/ts-angular-client/.openapi-generator/FILES +++ b/devolutions-gateway/openapi/ts-angular-client/.openapi-generator/FILES @@ -1,6 +1,5 @@ .gitignore README.md -api.base.service.ts api.module.ts api/api.ts api/config.service.ts @@ -79,7 +78,5 @@ model/updateRequestSchema.ts ng-package.json package.json param.ts -provide-api.ts -query.params.ts tsconfig.json variables.ts diff --git a/devolutions-gateway/openapi/ts-angular-client/.openapi-generator/VERSION b/devolutions-gateway/openapi/ts-angular-client/.openapi-generator/VERSION index 07832195c..4bc5d6181 100644 --- a/devolutions-gateway/openapi/ts-angular-client/.openapi-generator/VERSION +++ b/devolutions-gateway/openapi/ts-angular-client/.openapi-generator/VERSION @@ -1 +1 @@ -7.24.0 +7.9.0 diff --git a/devolutions-gateway/openapi/ts-angular-client/README.md b/devolutions-gateway/openapi/ts-angular-client/README.md index 680a063da..eb9e333c5 100644 --- a/devolutions-gateway/openapi/ts-angular-client/README.md +++ b/devolutions-gateway/openapi/ts-angular-client/README.md @@ -1,35 +1,34 @@ -# @devolutions/gateway-client@0.15.0 +## @devolutions/gateway-client@0.15.0 Protocol-aware fine-grained relay server The version of the OpenAPI document: 2026.2.4 -## Building +### Building To install the required dependencies and to build the typescript sources run: - -```console +``` npm install npm run build ``` -## Publishing +### publishing -First build the package then run `npm publish dist` (don't forget to specify the `dist` folder!) +First build the package then run ```npm publish dist``` (don't forget to specify the `dist` folder!) -## Consuming +### consuming Navigate to the folder of your consuming project and run one of next commands. _published:_ -```console +``` npm install @devolutions/gateway-client@0.15.0 --save ``` _without publishing (not recommended):_ -```console +``` npm install PATH_TO_GENERATED_PACKAGE/dist.tgz --save ``` @@ -38,128 +37,175 @@ _It's important to take the tgz file, otherwise you'll get trouble with links on _using `npm link`:_ In PATH_TO_GENERATED_PACKAGE/dist: - -```console +``` npm link ``` In your project: - -```console +``` npm link @devolutions/gateway-client ``` __Note for Windows users:__ The Angular CLI has troubles to use linked npm packages. -Please refer to this issue for a solution / workaround. +Please refer to this issue https://github.com/angular/angular-cli/issues/8284 for a solution / workaround. Published packages are not effected by this issue. -### General usage + +#### General usage In your Angular project: -```typescript -import { ApplicationConfig } from '@angular/core'; -import { provideHttpClient } from '@angular/common/http'; -import { provideApi } from '@devolutions/gateway-client'; +``` +// without configuring providers +import { ApiModule } from '@devolutions/gateway-client'; +import { HttpClientModule } from '@angular/common/http'; -export const appConfig: ApplicationConfig = { - providers: [ - // ... - provideHttpClient(), - provideApi() +@NgModule({ + imports: [ + ApiModule, + // make sure to import the HttpClientModule in the AppModule only, + // see https://github.com/angular/angular/issues/20575 + HttpClientModule ], -}; + declarations: [ AppComponent ], + providers: [], + bootstrap: [ AppComponent ] +}) +export class AppModule {} ``` -**NOTE** -If you're still using `AppModule` and haven't [migrated](https://angular.dev/reference/migrations/standalone) yet, you can still import an Angular module: -```typescript -import { ApiModule } from '@devolutions/gateway-client'; ``` - -If different from the generated base path, during app bootstrap, you can provide the base path to your service. - -```typescript -import { ApplicationConfig } from '@angular/core'; -import { provideHttpClient } from '@angular/common/http'; -import { provideApi } from '@devolutions/gateway-client'; - -export const appConfig: ApplicationConfig = { - providers: [ - // ... - provideHttpClient(), - provideApi('http://localhost:9999') - ], -}; +// configuring providers +import { ApiModule, Configuration, ConfigurationParameters } from '@devolutions/gateway-client'; + +export function apiConfigFactory (): Configuration { + const params: ConfigurationParameters = { + // set configuration parameters here. + } + return new Configuration(params); +} + +@NgModule({ + imports: [ ApiModule.forRoot(apiConfigFactory) ], + declarations: [ AppComponent ], + providers: [], + bootstrap: [ AppComponent ] +}) +export class AppModule {} ``` -```typescript -// with a custom configuration -import { ApplicationConfig } from '@angular/core'; -import { provideHttpClient } from '@angular/common/http'; -import { provideApi } from '@devolutions/gateway-client'; +``` +// configuring providers with an authentication service that manages your access tokens +import { ApiModule, Configuration } from '@devolutions/gateway-client'; -export const appConfig: ApplicationConfig = { +@NgModule({ + imports: [ ApiModule ], + declarations: [ AppComponent ], providers: [ - // ... - provideHttpClient(), - provideApi({ - withCredentials: true, - username: 'user', - password: 'password' - }) + { + provide: Configuration, + useFactory: (authService: AuthService) => new Configuration( + { + basePath: environment.apiUrl, + accessToken: authService.getAccessToken.bind(authService) + } + ), + deps: [AuthService], + multi: false + } ], -}; + bootstrap: [ AppComponent ] +}) +export class AppModule {} ``` -```typescript -// with factory building a custom configuration -import { ApplicationConfig } from '@angular/core'; -import { provideHttpClient } from '@angular/common/http'; -import { provideApi, Configuration } from '@devolutions/gateway-client'; +``` +import { DefaultApi } from '@devolutions/gateway-client'; -export const appConfig: ApplicationConfig = { - providers: [ - // ... - provideHttpClient(), - { - provide: Configuration, - useFactory: (authService: AuthService) => new Configuration({ - basePath: 'http://localhost:9999', - withCredentials: true, - username: authService.getUsername(), - password: authService.getPassword(), - }), - deps: [AuthService], - multi: false - } - ], -}; +export class AppComponent { + constructor(private apiGateway: DefaultApi) { } +} ``` -### Using multiple OpenAPI files / APIs +Note: The ApiModule is restricted to being instantiated once app wide. +This is to ensure that all services are treated as singletons. -In order to use multiple APIs generated from different OpenAPI files, +#### Using multiple OpenAPI files / APIs / ApiModules +In order to use multiple `ApiModules` generated from different OpenAPI files, you can create an alias name when importing the modules in order to avoid naming conflicts: - -```typescript -import { provideApi as provideUserApi } from 'my-user-api-path'; -import { provideApi as provideAdminApi } from 'my-admin-api-path'; +``` +import { ApiModule } from 'my-api-path'; +import { ApiModule as OtherApiModule } from 'my-other-api-path'; import { HttpClientModule } from '@angular/common/http'; -import { environment } from '../environments/environment'; -export const appConfig: ApplicationConfig = { - providers: [ - // ... - provideHttpClient(), - provideUserApi(environment.basePath), - provideAdminApi(environment.basePath), - ], +@NgModule({ + imports: [ + ApiModule, + OtherApiModule, + // make sure to import the HttpClientModule in the AppModule only, + // see https://github.com/angular/angular/issues/20575 + HttpClientModule + ] +}) +export class AppModule { + +} +``` + + +### Set service base path +If different than the generated base path, during app bootstrap, you can provide the base path to your service. + +``` +import { BASE_PATH } from '@devolutions/gateway-client'; + +bootstrap(AppComponent, [ + { provide: BASE_PATH, useValue: 'https://your-web-service.com' }, +]); +``` +or + +``` +import { BASE_PATH } from '@devolutions/gateway-client'; + +@NgModule({ + imports: [], + declarations: [ AppComponent ], + providers: [ provide: BASE_PATH, useValue: 'https://your-web-service.com' ], + bootstrap: [ AppComponent ] +}) +export class AppModule {} +``` + + +#### Using @angular/cli +First extend your `src/environments/*.ts` files by adding the corresponding base path: + +``` +export const environment = { + production: false, + API_BASE_PATH: 'http://127.0.0.1:8080' }; ``` +In the src/app/app.module.ts: +``` +import { BASE_PATH } from '@devolutions/gateway-client'; +import { environment } from '../environments/environment'; + +@NgModule({ + declarations: [ + AppComponent + ], + imports: [ ], + providers: [{ provide: BASE_PATH, useValue: environment.API_BASE_PATH }], + bootstrap: [ AppComponent ] +}) +export class AppModule { } +``` + ### Customizing path parameter encoding Without further customization, only [path-parameters][parameter-locations-url] of [style][style-values-url] 'simple' @@ -173,7 +219,6 @@ pass an arrow-function or method-reference to the `encodeParam` property of the (see [General Usage](#general-usage) above). Example value for use in your Configuration-Provider: - ```typescript new Configuration({ encodeParam: (param: Param) => myFancyParamEncoder(param), diff --git a/devolutions-gateway/openapi/ts-angular-client/api.base.service.ts b/devolutions-gateway/openapi/ts-angular-client/api.base.service.ts deleted file mode 100644 index 6d9b16fb1..000000000 --- a/devolutions-gateway/openapi/ts-angular-client/api.base.service.ts +++ /dev/null @@ -1,96 +0,0 @@ -/** - * devolutions-gateway - * - * Contact: infos@devolutions.net - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ -import { HttpHeaders, HttpParams, HttpParameterCodec } from '@angular/common/http'; -import { CustomHttpParameterCodec } from './encoder'; -import { Configuration } from './configuration'; -import { OpenApiHttpParams, QueryParamStyle, concatHttpParamsObject} from './query.params'; - -export class BaseService { - protected basePath = 'http://localhost'; - public defaultHeaders = new HttpHeaders(); - public configuration: Configuration; - public encoder: HttpParameterCodec; - - constructor(basePath?: string|string[], configuration?: Configuration) { - this.configuration = configuration || new Configuration(); - if (typeof this.configuration.basePath !== 'string') { - const firstBasePath = Array.isArray(basePath) ? basePath[0] : undefined; - if (firstBasePath != undefined) { - basePath = firstBasePath; - } - - if (typeof basePath !== 'string') { - basePath = this.basePath; - } - this.configuration.basePath = basePath; - } - this.encoder = this.configuration.encoder || new CustomHttpParameterCodec(); - } - - protected canConsumeForm(consumes: string[]): boolean { - return consumes.indexOf('multipart/form-data') !== -1; - } - - protected addToHttpParams(httpParams: OpenApiHttpParams, key: string, value: any | null | undefined, paramStyle: QueryParamStyle, explode: boolean): OpenApiHttpParams { - if (value === null || value === undefined) { - return httpParams; - } - - if (paramStyle === QueryParamStyle.DeepObject) { - if (typeof value !== 'object') { - throw Error(`An object must be provided for key ${key} as it is a deep object`); - } - - return Object.keys(value as Record).reduce( - (hp, k) => hp.append(`${key}[${k}]`, value[k]), - httpParams, - ); - } else if (paramStyle === QueryParamStyle.Json) { - return httpParams.append(key, JSON.stringify(value)); - } else { - // Form-style, SpaceDelimited or PipeDelimited - - if (Object(value) !== value) { - // If it is a primitive type, add its string representation - return httpParams.append(key, value.toString()); - } else if (value instanceof Date) { - return httpParams.append(key, value.toISOString()); - } else if (Array.isArray(value) || value instanceof Set) { - // Otherwise, if it's an array or set, add each element. - const array = Array.isArray(value) ? value : Array.from(value); - if (paramStyle === QueryParamStyle.Form) { - return httpParams.set(key, array, {explode: explode, delimiter: ','}); - } else if (paramStyle === QueryParamStyle.SpaceDelimited) { - return httpParams.set(key, array, {explode: explode, delimiter: ' '}); - } else { - // PipeDelimited - return httpParams.set(key, array, {explode: explode, delimiter: '|'}); - } - } else { - // Otherwise, if it's an object, add each field. - if (paramStyle === QueryParamStyle.Form) { - if (explode) { - Object.keys(value).forEach(k => { - httpParams = this.addToHttpParams(httpParams, k, value[k], paramStyle, explode); - }); - return httpParams; - } else { - return concatHttpParamsObject(httpParams, key, value, ','); - } - } else if (paramStyle === QueryParamStyle.SpaceDelimited) { - return concatHttpParamsObject(httpParams, key, value, ' '); - } else { - // PipeDelimited - return concatHttpParamsObject(httpParams, key, value, '|'); - } - } - } - } -} diff --git a/devolutions-gateway/openapi/ts-angular-client/api/config.service.ts b/devolutions-gateway/openapi/ts-angular-client/api/config.service.ts index b1bf49039..f2586e77e 100644 --- a/devolutions-gateway/openapi/ts-angular-client/api/config.service.ts +++ b/devolutions-gateway/openapi/ts-angular-client/api/config.service.ts @@ -11,10 +11,10 @@ import { Inject, Injectable, Optional } from '@angular/core'; import { HttpClient, HttpHeaders, HttpParams, - HttpResponse, HttpEvent, HttpContext + HttpResponse, HttpEvent, HttpParameterCodec, HttpContext } from '@angular/common/http'; +import { CustomHttpParameterCodec } from '../encoder'; import { Observable } from 'rxjs'; -import { OpenApiHttpParams, QueryParamStyle } from '../query.params'; // @ts-ignore import { ConfigPatch } from '../model/configPatch'; @@ -22,26 +22,79 @@ import { ConfigPatch } from '../model/configPatch'; // @ts-ignore import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; import { Configuration } from '../configuration'; -import { BaseService } from '../api.base.service'; @Injectable({ providedIn: 'root' }) -export class ConfigService extends BaseService { +export class ConfigService { - constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) { - super(basePath, configuration); + protected basePath = 'http://localhost'; + public defaultHeaders = new HttpHeaders(); + public configuration = new Configuration(); + public encoder: HttpParameterCodec; + + constructor(protected httpClient: HttpClient, @Optional()@Inject(BASE_PATH) basePath: string|string[], @Optional() configuration: Configuration) { + if (configuration) { + this.configuration = configuration; + } + if (typeof this.configuration.basePath !== 'string') { + const firstBasePath = Array.isArray(basePath) ? basePath[0] : undefined; + if (firstBasePath != undefined) { + basePath = firstBasePath; + } + + if (typeof basePath !== 'string') { + basePath = this.basePath; + } + this.configuration.basePath = basePath; + } + this.encoder = this.configuration.encoder || new CustomHttpParameterCodec(); + } + + + // @ts-ignore + private addToHttpParams(httpParams: HttpParams, value: any, key?: string): HttpParams { + if (typeof value === "object" && value instanceof Date === false) { + httpParams = this.addToHttpParamsRecursive(httpParams, value); + } else { + httpParams = this.addToHttpParamsRecursive(httpParams, value, key); + } + return httpParams; + } + + private addToHttpParamsRecursive(httpParams: HttpParams, value?: any, key?: string): HttpParams { + if (value == null) { + return httpParams; + } + + if (typeof value === "object") { + if (Array.isArray(value)) { + (value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); + } else if (value instanceof Date) { + if (key != null) { + httpParams = httpParams.append(key, (value as Date).toISOString().substring(0, 10)); + } else { + throw Error("key may not be null if value is Date"); + } + } else { + Object.keys(value).forEach( k => httpParams = this.addToHttpParamsRecursive( + httpParams, value[k], key != null ? `${key}.${k}` : k)); + } + } else if (key != null) { + httpParams = httpParams.append(key, value); + } else { + throw Error("key may not be null if value is not object or array"); + } + return httpParams; } /** * Modifies configuration - * @endpoint patch /jet/config * @param configPatch JSON-encoded configuration patch * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. - * @param options additional options */ public patchConfig(configPatch: ConfigPatch, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable; public patchConfig(configPatch: ConfigPatch, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable>; @@ -53,18 +106,33 @@ export class ConfigService extends BaseService { let localVarHeaders = this.defaultHeaders; + let localVarCredential: string | undefined; // authentication (scope_token) required - localVarHeaders = this.configuration.addCredentialToHeaders('scope_token', 'Authorization', localVarHeaders, 'Bearer '); + localVarCredential = this.configuration.lookupCredential('scope_token'); + if (localVarCredential) { + localVarHeaders = localVarHeaders.set('Authorization', 'Bearer ' + localVarCredential); + } - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - ]); + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } if (localVarHttpHeaderAcceptSelected !== undefined) { localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); } - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } - const localVarTransferCache: boolean = options?.transferCache ?? true; + let localVarTransferCache: boolean | undefined = options && options.transferCache; + if (localVarTransferCache === undefined) { + localVarTransferCache = true; + } // to determine the Content-Type header @@ -88,16 +156,15 @@ export class ConfigService extends BaseService { } let localVarPath = `/jet/config`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('patch', `${basePath}${localVarPath}`, + return this.httpClient.request('patch', `${this.configuration.basePath}${localVarPath}`, { context: localVarHttpContext, body: configPatch, responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), + withCredentials: this.configuration.withCredentials, headers: localVarHeaders, observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + transferCache: localVarTransferCache, reportProgress: reportProgress } ); diff --git a/devolutions-gateway/openapi/ts-angular-client/api/diagnostics.service.ts b/devolutions-gateway/openapi/ts-angular-client/api/diagnostics.service.ts index 8b861c151..72b1d8da3 100644 --- a/devolutions-gateway/openapi/ts-angular-client/api/diagnostics.service.ts +++ b/devolutions-gateway/openapi/ts-angular-client/api/diagnostics.service.ts @@ -11,10 +11,10 @@ import { Inject, Injectable, Optional } from '@angular/core'; import { HttpClient, HttpHeaders, HttpParams, - HttpResponse, HttpEvent, HttpContext + HttpResponse, HttpEvent, HttpParameterCodec, HttpContext } from '@angular/common/http'; +import { CustomHttpParameterCodec } from '../encoder'; import { Observable } from 'rxjs'; -import { OpenApiHttpParams, QueryParamStyle } from '../query.params'; // @ts-ignore import { ClockDiagnostic } from '../model/clockDiagnostic'; @@ -24,26 +24,79 @@ import { ConfigDiagnostic } from '../model/configDiagnostic'; // @ts-ignore import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; import { Configuration } from '../configuration'; -import { BaseService } from '../api.base.service'; @Injectable({ providedIn: 'root' }) -export class DiagnosticsService extends BaseService { +export class DiagnosticsService { - constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) { - super(basePath, configuration); + protected basePath = 'http://localhost'; + public defaultHeaders = new HttpHeaders(); + public configuration = new Configuration(); + public encoder: HttpParameterCodec; + + constructor(protected httpClient: HttpClient, @Optional()@Inject(BASE_PATH) basePath: string|string[], @Optional() configuration: Configuration) { + if (configuration) { + this.configuration = configuration; + } + if (typeof this.configuration.basePath !== 'string') { + const firstBasePath = Array.isArray(basePath) ? basePath[0] : undefined; + if (firstBasePath != undefined) { + basePath = firstBasePath; + } + + if (typeof basePath !== 'string') { + basePath = this.basePath; + } + this.configuration.basePath = basePath; + } + this.encoder = this.configuration.encoder || new CustomHttpParameterCodec(); + } + + + // @ts-ignore + private addToHttpParams(httpParams: HttpParams, value: any, key?: string): HttpParams { + if (typeof value === "object" && value instanceof Date === false) { + httpParams = this.addToHttpParamsRecursive(httpParams, value); + } else { + httpParams = this.addToHttpParamsRecursive(httpParams, value, key); + } + return httpParams; + } + + private addToHttpParamsRecursive(httpParams: HttpParams, value?: any, key?: string): HttpParams { + if (value == null) { + return httpParams; + } + + if (typeof value === "object") { + if (Array.isArray(value)) { + (value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); + } else if (value instanceof Date) { + if (key != null) { + httpParams = httpParams.append(key, (value as Date).toISOString().substring(0, 10)); + } else { + throw Error("key may not be null if value is Date"); + } + } else { + Object.keys(value).forEach( k => httpParams = this.addToHttpParamsRecursive( + httpParams, value[k], key != null ? `${key}.${k}` : k)); + } + } else if (key != null) { + httpParams = httpParams.append(key, value); + } else { + throw Error("key may not be null if value is not object or array"); + } + return httpParams; } /** * Retrieves server\'s clock in order to diagnose clock drifting. * This route is not secured by access token. Indeed, this route is used to retrieve server\'s clock when diagnosing clock drifting. If there is clock drift, token validation will fail because claims such as `nbf` will then be invalid, and thus prevent the clock drift diagnosis. - * @endpoint get /jet/diagnostics/clock * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. - * @param options additional options */ public getClockDiagnostic(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; public getClockDiagnostic(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; @@ -52,16 +105,27 @@ export class DiagnosticsService extends BaseService { let localVarHeaders = this.defaultHeaders; - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/json' + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } if (localVarHttpHeaderAcceptSelected !== undefined) { localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); } - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } - const localVarTransferCache: boolean = options?.transferCache ?? true; + let localVarTransferCache: boolean | undefined = options && options.transferCache; + if (localVarTransferCache === undefined) { + localVarTransferCache = true; + } let responseType_: 'text' | 'json' | 'blob' = 'json'; @@ -76,15 +140,14 @@ export class DiagnosticsService extends BaseService { } let localVarPath = `/jet/diagnostics/clock`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, + return this.httpClient.request('get', `${this.configuration.basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), + withCredentials: this.configuration.withCredentials, headers: localVarHeaders, observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + transferCache: localVarTransferCache, reportProgress: reportProgress } ); @@ -93,10 +156,8 @@ export class DiagnosticsService extends BaseService { /** * Retrieves a subset of the configuration, for diagnosis purposes. * This route primary function is to help with configuration diagnosis (e.g.: ID mismatch, hostname mismatch, outdated version). In addition, it may be used to retrieve the listener URLs. This information can be used to provide configuration auto-filling, in order to assist the end user. It must be noted that this route will never return the whole configuration file as-is, for security reasons. For an exhaustive list of returned keys, refer to the `ConfigDiagnostic` component definition. - * @endpoint get /jet/diagnostics/configuration * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. - * @param options additional options */ public getConfigurationDiagnostic(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; public getConfigurationDiagnostic(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; @@ -105,19 +166,34 @@ export class DiagnosticsService extends BaseService { let localVarHeaders = this.defaultHeaders; + let localVarCredential: string | undefined; // authentication (scope_token) required - localVarHeaders = this.configuration.addCredentialToHeaders('scope_token', 'Authorization', localVarHeaders, 'Bearer '); + localVarCredential = this.configuration.lookupCredential('scope_token'); + if (localVarCredential) { + localVarHeaders = localVarHeaders.set('Authorization', 'Bearer ' + localVarCredential); + } - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/json' + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } if (localVarHttpHeaderAcceptSelected !== undefined) { localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); } - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } - const localVarTransferCache: boolean = options?.transferCache ?? true; + let localVarTransferCache: boolean | undefined = options && options.transferCache; + if (localVarTransferCache === undefined) { + localVarTransferCache = true; + } let responseType_: 'text' | 'json' | 'blob' = 'json'; @@ -132,15 +208,14 @@ export class DiagnosticsService extends BaseService { } let localVarPath = `/jet/diagnostics/configuration`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, + return this.httpClient.request('get', `${this.configuration.basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), + withCredentials: this.configuration.withCredentials, headers: localVarHeaders, observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + transferCache: localVarTransferCache, reportProgress: reportProgress } ); @@ -148,10 +223,8 @@ export class DiagnosticsService extends BaseService { /** * Retrieves latest logs. - * @endpoint get /jet/diagnostics/logs * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. - * @param options additional options */ public getLogs(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'text/plain', context?: HttpContext, transferCache?: boolean}): Observable; public getLogs(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'text/plain', context?: HttpContext, transferCache?: boolean}): Observable>; @@ -160,19 +233,34 @@ export class DiagnosticsService extends BaseService { let localVarHeaders = this.defaultHeaders; + let localVarCredential: string | undefined; // authentication (scope_token) required - localVarHeaders = this.configuration.addCredentialToHeaders('scope_token', 'Authorization', localVarHeaders, 'Bearer '); + localVarCredential = this.configuration.lookupCredential('scope_token'); + if (localVarCredential) { + localVarHeaders = localVarHeaders.set('Authorization', 'Bearer ' + localVarCredential); + } - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'text/plain' - ]); + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'text/plain' + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } if (localVarHttpHeaderAcceptSelected !== undefined) { localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); } - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } - const localVarTransferCache: boolean = options?.transferCache ?? true; + let localVarTransferCache: boolean | undefined = options && options.transferCache; + if (localVarTransferCache === undefined) { + localVarTransferCache = true; + } let responseType_: 'text' | 'json' | 'blob' = 'json'; @@ -187,15 +275,14 @@ export class DiagnosticsService extends BaseService { } let localVarPath = `/jet/diagnostics/logs`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, + return this.httpClient.request('get', `${this.configuration.basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), + withCredentials: this.configuration.withCredentials, headers: localVarHeaders, observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + transferCache: localVarTransferCache, reportProgress: reportProgress } ); diff --git a/devolutions-gateway/openapi/ts-angular-client/api/health.service.ts b/devolutions-gateway/openapi/ts-angular-client/api/health.service.ts index b0e0be271..7c6e1fef3 100644 --- a/devolutions-gateway/openapi/ts-angular-client/api/health.service.ts +++ b/devolutions-gateway/openapi/ts-angular-client/api/health.service.ts @@ -11,10 +11,10 @@ import { Inject, Injectable, Optional } from '@angular/core'; import { HttpClient, HttpHeaders, HttpParams, - HttpResponse, HttpEvent, HttpContext + HttpResponse, HttpEvent, HttpParameterCodec, HttpContext } from '@angular/common/http'; +import { CustomHttpParameterCodec } from '../encoder'; import { Observable } from 'rxjs'; -import { OpenApiHttpParams, QueryParamStyle } from '../query.params'; // @ts-ignore import { Identity } from '../model/identity'; @@ -22,25 +22,78 @@ import { Identity } from '../model/identity'; // @ts-ignore import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; import { Configuration } from '../configuration'; -import { BaseService } from '../api.base.service'; @Injectable({ providedIn: 'root' }) -export class HealthService extends BaseService { +export class HealthService { - constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) { - super(basePath, configuration); + protected basePath = 'http://localhost'; + public defaultHeaders = new HttpHeaders(); + public configuration = new Configuration(); + public encoder: HttpParameterCodec; + + constructor(protected httpClient: HttpClient, @Optional()@Inject(BASE_PATH) basePath: string|string[], @Optional() configuration: Configuration) { + if (configuration) { + this.configuration = configuration; + } + if (typeof this.configuration.basePath !== 'string') { + const firstBasePath = Array.isArray(basePath) ? basePath[0] : undefined; + if (firstBasePath != undefined) { + basePath = firstBasePath; + } + + if (typeof basePath !== 'string') { + basePath = this.basePath; + } + this.configuration.basePath = basePath; + } + this.encoder = this.configuration.encoder || new CustomHttpParameterCodec(); + } + + + // @ts-ignore + private addToHttpParams(httpParams: HttpParams, value: any, key?: string): HttpParams { + if (typeof value === "object" && value instanceof Date === false) { + httpParams = this.addToHttpParamsRecursive(httpParams, value); + } else { + httpParams = this.addToHttpParamsRecursive(httpParams, value, key); + } + return httpParams; + } + + private addToHttpParamsRecursive(httpParams: HttpParams, value?: any, key?: string): HttpParams { + if (value == null) { + return httpParams; + } + + if (typeof value === "object") { + if (Array.isArray(value)) { + (value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); + } else if (value instanceof Date) { + if (key != null) { + httpParams = httpParams.append(key, (value as Date).toISOString().substring(0, 10)); + } else { + throw Error("key may not be null if value is Date"); + } + } else { + Object.keys(value).forEach( k => httpParams = this.addToHttpParamsRecursive( + httpParams, value[k], key != null ? `${key}.${k}` : k)); + } + } else if (key != null) { + httpParams = httpParams.append(key, value); + } else { + throw Error("key may not be null if value is not object or array"); + } + return httpParams; } /** * Performs a health check - * @endpoint get /jet/health * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. - * @param options additional options */ public getHealth(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; public getHealth(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; @@ -49,16 +102,27 @@ export class HealthService extends BaseService { let localVarHeaders = this.defaultHeaders; - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/json' + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } if (localVarHttpHeaderAcceptSelected !== undefined) { localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); } - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } - const localVarTransferCache: boolean = options?.transferCache ?? true; + let localVarTransferCache: boolean | undefined = options && options.transferCache; + if (localVarTransferCache === undefined) { + localVarTransferCache = true; + } let responseType_: 'text' | 'json' | 'blob' = 'json'; @@ -73,15 +137,14 @@ export class HealthService extends BaseService { } let localVarPath = `/jet/health`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, + return this.httpClient.request('get', `${this.configuration.basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), + withCredentials: this.configuration.withCredentials, headers: localVarHeaders, observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + transferCache: localVarTransferCache, reportProgress: reportProgress } ); diff --git a/devolutions-gateway/openapi/ts-angular-client/api/heartbeat.service.ts b/devolutions-gateway/openapi/ts-angular-client/api/heartbeat.service.ts index 8bf31cc95..26040f863 100644 --- a/devolutions-gateway/openapi/ts-angular-client/api/heartbeat.service.ts +++ b/devolutions-gateway/openapi/ts-angular-client/api/heartbeat.service.ts @@ -11,10 +11,10 @@ import { Inject, Injectable, Optional } from '@angular/core'; import { HttpClient, HttpHeaders, HttpParams, - HttpResponse, HttpEvent, HttpContext + HttpResponse, HttpEvent, HttpParameterCodec, HttpContext } from '@angular/common/http'; +import { CustomHttpParameterCodec } from '../encoder'; import { Observable } from 'rxjs'; -import { OpenApiHttpParams, QueryParamStyle } from '../query.params'; // @ts-ignore import { Heartbeat } from '../model/heartbeat'; @@ -22,25 +22,78 @@ import { Heartbeat } from '../model/heartbeat'; // @ts-ignore import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; import { Configuration } from '../configuration'; -import { BaseService } from '../api.base.service'; @Injectable({ providedIn: 'root' }) -export class HeartbeatService extends BaseService { +export class HeartbeatService { - constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) { - super(basePath, configuration); + protected basePath = 'http://localhost'; + public defaultHeaders = new HttpHeaders(); + public configuration = new Configuration(); + public encoder: HttpParameterCodec; + + constructor(protected httpClient: HttpClient, @Optional()@Inject(BASE_PATH) basePath: string|string[], @Optional() configuration: Configuration) { + if (configuration) { + this.configuration = configuration; + } + if (typeof this.configuration.basePath !== 'string') { + const firstBasePath = Array.isArray(basePath) ? basePath[0] : undefined; + if (firstBasePath != undefined) { + basePath = firstBasePath; + } + + if (typeof basePath !== 'string') { + basePath = this.basePath; + } + this.configuration.basePath = basePath; + } + this.encoder = this.configuration.encoder || new CustomHttpParameterCodec(); + } + + + // @ts-ignore + private addToHttpParams(httpParams: HttpParams, value: any, key?: string): HttpParams { + if (typeof value === "object" && value instanceof Date === false) { + httpParams = this.addToHttpParamsRecursive(httpParams, value); + } else { + httpParams = this.addToHttpParamsRecursive(httpParams, value, key); + } + return httpParams; + } + + private addToHttpParamsRecursive(httpParams: HttpParams, value?: any, key?: string): HttpParams { + if (value == null) { + return httpParams; + } + + if (typeof value === "object") { + if (Array.isArray(value)) { + (value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); + } else if (value instanceof Date) { + if (key != null) { + httpParams = httpParams.append(key, (value as Date).toISOString().substring(0, 10)); + } else { + throw Error("key may not be null if value is Date"); + } + } else { + Object.keys(value).forEach( k => httpParams = this.addToHttpParamsRecursive( + httpParams, value[k], key != null ? `${key}.${k}` : k)); + } + } else if (key != null) { + httpParams = httpParams.append(key, value); + } else { + throw Error("key may not be null if value is not object or array"); + } + return httpParams; } /** * Performs a heartbeat check - * @endpoint get /jet/heartbeat * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. - * @param options additional options */ public getHeartbeat(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; public getHeartbeat(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; @@ -49,19 +102,34 @@ export class HeartbeatService extends BaseService { let localVarHeaders = this.defaultHeaders; + let localVarCredential: string | undefined; // authentication (scope_token) required - localVarHeaders = this.configuration.addCredentialToHeaders('scope_token', 'Authorization', localVarHeaders, 'Bearer '); + localVarCredential = this.configuration.lookupCredential('scope_token'); + if (localVarCredential) { + localVarHeaders = localVarHeaders.set('Authorization', 'Bearer ' + localVarCredential); + } - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/json' + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } if (localVarHttpHeaderAcceptSelected !== undefined) { localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); } - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } - const localVarTransferCache: boolean = options?.transferCache ?? true; + let localVarTransferCache: boolean | undefined = options && options.transferCache; + if (localVarTransferCache === undefined) { + localVarTransferCache = true; + } let responseType_: 'text' | 'json' | 'blob' = 'json'; @@ -76,15 +144,14 @@ export class HeartbeatService extends BaseService { } let localVarPath = `/jet/heartbeat`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, + return this.httpClient.request('get', `${this.configuration.basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), + withCredentials: this.configuration.withCredentials, headers: localVarHeaders, observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + transferCache: localVarTransferCache, reportProgress: reportProgress } ); diff --git a/devolutions-gateway/openapi/ts-angular-client/api/jrec.service.ts b/devolutions-gateway/openapi/ts-angular-client/api/jrec.service.ts index 877ef330b..208f6898b 100644 --- a/devolutions-gateway/openapi/ts-angular-client/api/jrec.service.ts +++ b/devolutions-gateway/openapi/ts-angular-client/api/jrec.service.ts @@ -11,10 +11,10 @@ import { Inject, Injectable, Optional } from '@angular/core'; import { HttpClient, HttpHeaders, HttpParams, - HttpResponse, HttpEvent, HttpContext + HttpResponse, HttpEvent, HttpParameterCodec, HttpContext } from '@angular/common/http'; +import { CustomHttpParameterCodec } from '../encoder'; import { Observable } from 'rxjs'; -import { OpenApiHttpParams, QueryParamStyle } from '../query.params'; // @ts-ignore import { DeleteManyResult } from '../model/deleteManyResult'; @@ -22,27 +22,80 @@ import { DeleteManyResult } from '../model/deleteManyResult'; // @ts-ignore import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; import { Configuration } from '../configuration'; -import { BaseService } from '../api.base.service'; @Injectable({ providedIn: 'root' }) -export class JrecService extends BaseService { +export class JrecService { - constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) { - super(basePath, configuration); + protected basePath = 'http://localhost'; + public defaultHeaders = new HttpHeaders(); + public configuration = new Configuration(); + public encoder: HttpParameterCodec; + + constructor(protected httpClient: HttpClient, @Optional()@Inject(BASE_PATH) basePath: string|string[], @Optional() configuration: Configuration) { + if (configuration) { + this.configuration = configuration; + } + if (typeof this.configuration.basePath !== 'string') { + const firstBasePath = Array.isArray(basePath) ? basePath[0] : undefined; + if (firstBasePath != undefined) { + basePath = firstBasePath; + } + + if (typeof basePath !== 'string') { + basePath = this.basePath; + } + this.configuration.basePath = basePath; + } + this.encoder = this.configuration.encoder || new CustomHttpParameterCodec(); + } + + + // @ts-ignore + private addToHttpParams(httpParams: HttpParams, value: any, key?: string): HttpParams { + if (typeof value === "object" && value instanceof Date === false) { + httpParams = this.addToHttpParamsRecursive(httpParams, value); + } else { + httpParams = this.addToHttpParamsRecursive(httpParams, value, key); + } + return httpParams; + } + + private addToHttpParamsRecursive(httpParams: HttpParams, value?: any, key?: string): HttpParams { + if (value == null) { + return httpParams; + } + + if (typeof value === "object") { + if (Array.isArray(value)) { + (value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); + } else if (value instanceof Date) { + if (key != null) { + httpParams = httpParams.append(key, (value as Date).toISOString().substring(0, 10)); + } else { + throw Error("key may not be null if value is Date"); + } + } else { + Object.keys(value).forEach( k => httpParams = this.addToHttpParamsRecursive( + httpParams, value[k], key != null ? `${key}.${k}` : k)); + } + } else if (key != null) { + httpParams = httpParams.append(key, value); + } else { + throw Error("key may not be null if value is not object or array"); + } + return httpParams; } /** * Mass-deletes recordings stored on this instance * If you try to delete more than 50,000 recordings at once, you should split the list into multiple requests. Bigger payloads will be rejected with 413 Payload Too Large. The request processing consist in 1) checking if one of the recording is active, 2) counting the number of recordings not found on this instance. When a recording is not found on this instance, a counter is incremented. This number is returned as part of the response. You may use this information to detect anomalies on your side. For instance, this suggests the list of recordings on your side is out of date, and you may want re-index. - * @endpoint delete /jet/jrec/delete * @param requestBody JSON-encoded list of session IDs * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. - * @param options additional options */ public deleteManyRecordings(requestBody: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; public deleteManyRecordings(requestBody: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; @@ -54,19 +107,34 @@ export class JrecService extends BaseService { let localVarHeaders = this.defaultHeaders; + let localVarCredential: string | undefined; // authentication (scope_token) required - localVarHeaders = this.configuration.addCredentialToHeaders('scope_token', 'Authorization', localVarHeaders, 'Bearer '); + localVarCredential = this.configuration.lookupCredential('scope_token'); + if (localVarCredential) { + localVarHeaders = localVarHeaders.set('Authorization', 'Bearer ' + localVarCredential); + } - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/json' + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } if (localVarHttpHeaderAcceptSelected !== undefined) { localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); } - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } - const localVarTransferCache: boolean = options?.transferCache ?? true; + let localVarTransferCache: boolean | undefined = options && options.transferCache; + if (localVarTransferCache === undefined) { + localVarTransferCache = true; + } // to determine the Content-Type header @@ -90,16 +158,15 @@ export class JrecService extends BaseService { } let localVarPath = `/jet/jrec/delete`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('delete', `${basePath}${localVarPath}`, + return this.httpClient.request('delete', `${this.configuration.basePath}${localVarPath}`, { context: localVarHttpContext, body: requestBody, responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), + withCredentials: this.configuration.withCredentials, headers: localVarHeaders, observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + transferCache: localVarTransferCache, reportProgress: reportProgress } ); @@ -107,11 +174,9 @@ export class JrecService extends BaseService { /** * Deletes a recording stored on this instance - * @endpoint delete /jet/jrec/delete/{id} * @param id Recorded session ID * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. - * @param options additional options */ public deleteRecording(id: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable; public deleteRecording(id: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable>; @@ -123,18 +188,33 @@ export class JrecService extends BaseService { let localVarHeaders = this.defaultHeaders; + let localVarCredential: string | undefined; // authentication (scope_token) required - localVarHeaders = this.configuration.addCredentialToHeaders('scope_token', 'Authorization', localVarHeaders, 'Bearer '); + localVarCredential = this.configuration.lookupCredential('scope_token'); + if (localVarCredential) { + localVarHeaders = localVarHeaders.set('Authorization', 'Bearer ' + localVarCredential); + } - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - ]); + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } if (localVarHttpHeaderAcceptSelected !== undefined) { localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); } - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } - const localVarTransferCache: boolean = options?.transferCache ?? true; + let localVarTransferCache: boolean | undefined = options && options.transferCache; + if (localVarTransferCache === undefined) { + localVarTransferCache = true; + } let responseType_: 'text' | 'json' | 'blob' = 'json'; @@ -149,15 +229,14 @@ export class JrecService extends BaseService { } let localVarPath = `/jet/jrec/delete/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: "uuid"})}`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('delete', `${basePath}${localVarPath}`, + return this.httpClient.request('delete', `${this.configuration.basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), + withCredentials: this.configuration.withCredentials, headers: localVarHeaders, observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + transferCache: localVarTransferCache, reportProgress: reportProgress } ); @@ -165,11 +244,9 @@ export class JrecService extends BaseService { /** * Lists all recordings stored on this instance - * @endpoint get /jet/jrec/list * @param active When true, only the active recordings are returned * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. - * @param options additional options */ public listRecordings(active: boolean, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; public listRecordings(active: boolean, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>>; @@ -179,32 +256,42 @@ export class JrecService extends BaseService { throw new Error('Required parameter active was null or undefined when calling listRecordings.'); } - let localVarQueryParameters = new OpenApiHttpParams(this.encoder); - - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - 'active', - active, - QueryParamStyle.Form, - true, - ); - + let localVarQueryParameters = new HttpParams({encoder: this.encoder}); + if (active !== undefined && active !== null) { + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + active, 'active'); + } let localVarHeaders = this.defaultHeaders; + let localVarCredential: string | undefined; // authentication (scope_token) required - localVarHeaders = this.configuration.addCredentialToHeaders('scope_token', 'Authorization', localVarHeaders, 'Bearer '); + localVarCredential = this.configuration.lookupCredential('scope_token'); + if (localVarCredential) { + localVarHeaders = localVarHeaders.set('Authorization', 'Bearer ' + localVarCredential); + } - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/json' + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } if (localVarHttpHeaderAcceptSelected !== undefined) { localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); } - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } - const localVarTransferCache: boolean = options?.transferCache ?? true; + let localVarTransferCache: boolean | undefined = options && options.transferCache; + if (localVarTransferCache === undefined) { + localVarTransferCache = true; + } let responseType_: 'text' | 'json' | 'blob' = 'json'; @@ -219,16 +306,15 @@ export class JrecService extends BaseService { } let localVarPath = `/jet/jrec/list`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request>('get', `${basePath}${localVarPath}`, + return this.httpClient.request>('get', `${this.configuration.basePath}${localVarPath}`, { context: localVarHttpContext, - params: localVarQueryParameters.toHttpParams(), + params: localVarQueryParameters, responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), + withCredentials: this.configuration.withCredentials, headers: localVarHeaders, observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + transferCache: localVarTransferCache, reportProgress: reportProgress } ); @@ -236,12 +322,10 @@ export class JrecService extends BaseService { /** * Retrieves a recording file for a given session - * @endpoint get /jet/jrec/pull/{id}/{filename} * @param id Recorded session ID * @param filename Name of recording file to retrieve * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. - * @param options additional options */ public pullRecordingFile(id: string, filename: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/octet-stream', context?: HttpContext, transferCache?: boolean}): Observable; public pullRecordingFile(id: string, filename: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/octet-stream', context?: HttpContext, transferCache?: boolean}): Observable>; @@ -256,31 +340,45 @@ export class JrecService extends BaseService { let localVarHeaders = this.defaultHeaders; + let localVarCredential: string | undefined; // authentication (jrec_token) required - localVarHeaders = this.configuration.addCredentialToHeaders('jrec_token', 'Authorization', localVarHeaders, 'Bearer '); + localVarCredential = this.configuration.lookupCredential('jrec_token'); + if (localVarCredential) { + localVarHeaders = localVarHeaders.set('Authorization', 'Bearer ' + localVarCredential); + } - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/octet-stream' - ]); + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/octet-stream' + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } if (localVarHttpHeaderAcceptSelected !== undefined) { localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); } - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } - const localVarTransferCache: boolean = options?.transferCache ?? true; + let localVarTransferCache: boolean | undefined = options && options.transferCache; + if (localVarTransferCache === undefined) { + localVarTransferCache = true; + } let localVarPath = `/jet/jrec/pull/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: "uuid"})}/${this.configuration.encodeParam({name: "filename", value: filename, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, + return this.httpClient.request('get', `${this.configuration.basePath}${localVarPath}`, { context: localVarHttpContext, responseType: "blob", - ...(withCredentials ? { withCredentials } : {}), + withCredentials: this.configuration.withCredentials, headers: localVarHeaders, observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + transferCache: localVarTransferCache, reportProgress: reportProgress } ); diff --git a/devolutions-gateway/openapi/ts-angular-client/api/jrl.service.ts b/devolutions-gateway/openapi/ts-angular-client/api/jrl.service.ts index c056de71d..4063f75ae 100644 --- a/devolutions-gateway/openapi/ts-angular-client/api/jrl.service.ts +++ b/devolutions-gateway/openapi/ts-angular-client/api/jrl.service.ts @@ -11,10 +11,10 @@ import { Inject, Injectable, Optional } from '@angular/core'; import { HttpClient, HttpHeaders, HttpParams, - HttpResponse, HttpEvent, HttpContext + HttpResponse, HttpEvent, HttpParameterCodec, HttpContext } from '@angular/common/http'; +import { CustomHttpParameterCodec } from '../encoder'; import { Observable } from 'rxjs'; -import { OpenApiHttpParams, QueryParamStyle } from '../query.params'; // @ts-ignore import { JrlInfo } from '../model/jrlInfo'; @@ -22,25 +22,78 @@ import { JrlInfo } from '../model/jrlInfo'; // @ts-ignore import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; import { Configuration } from '../configuration'; -import { BaseService } from '../api.base.service'; @Injectable({ providedIn: 'root' }) -export class JrlService extends BaseService { +export class JrlService { - constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) { - super(basePath, configuration); + protected basePath = 'http://localhost'; + public defaultHeaders = new HttpHeaders(); + public configuration = new Configuration(); + public encoder: HttpParameterCodec; + + constructor(protected httpClient: HttpClient, @Optional()@Inject(BASE_PATH) basePath: string|string[], @Optional() configuration: Configuration) { + if (configuration) { + this.configuration = configuration; + } + if (typeof this.configuration.basePath !== 'string') { + const firstBasePath = Array.isArray(basePath) ? basePath[0] : undefined; + if (firstBasePath != undefined) { + basePath = firstBasePath; + } + + if (typeof basePath !== 'string') { + basePath = this.basePath; + } + this.configuration.basePath = basePath; + } + this.encoder = this.configuration.encoder || new CustomHttpParameterCodec(); + } + + + // @ts-ignore + private addToHttpParams(httpParams: HttpParams, value: any, key?: string): HttpParams { + if (typeof value === "object" && value instanceof Date === false) { + httpParams = this.addToHttpParamsRecursive(httpParams, value); + } else { + httpParams = this.addToHttpParamsRecursive(httpParams, value, key); + } + return httpParams; + } + + private addToHttpParamsRecursive(httpParams: HttpParams, value?: any, key?: string): HttpParams { + if (value == null) { + return httpParams; + } + + if (typeof value === "object") { + if (Array.isArray(value)) { + (value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); + } else if (value instanceof Date) { + if (key != null) { + httpParams = httpParams.append(key, (value as Date).toISOString().substring(0, 10)); + } else { + throw Error("key may not be null if value is Date"); + } + } else { + Object.keys(value).forEach( k => httpParams = this.addToHttpParamsRecursive( + httpParams, value[k], key != null ? `${key}.${k}` : k)); + } + } else if (key != null) { + httpParams = httpParams.append(key, value); + } else { + throw Error("key may not be null if value is not object or array"); + } + return httpParams; } /** * Retrieves current JRL (Json Revocation List) info - * @endpoint get /jet/jrl/info * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. - * @param options additional options */ public getJrlInfo(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; public getJrlInfo(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; @@ -49,19 +102,34 @@ export class JrlService extends BaseService { let localVarHeaders = this.defaultHeaders; + let localVarCredential: string | undefined; // authentication (scope_token) required - localVarHeaders = this.configuration.addCredentialToHeaders('scope_token', 'Authorization', localVarHeaders, 'Bearer '); + localVarCredential = this.configuration.lookupCredential('scope_token'); + if (localVarCredential) { + localVarHeaders = localVarHeaders.set('Authorization', 'Bearer ' + localVarCredential); + } - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/json' + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } if (localVarHttpHeaderAcceptSelected !== undefined) { localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); } - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } - const localVarTransferCache: boolean = options?.transferCache ?? true; + let localVarTransferCache: boolean | undefined = options && options.transferCache; + if (localVarTransferCache === undefined) { + localVarTransferCache = true; + } let responseType_: 'text' | 'json' | 'blob' = 'json'; @@ -76,15 +144,14 @@ export class JrlService extends BaseService { } let localVarPath = `/jet/jrl/info`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, + return this.httpClient.request('get', `${this.configuration.basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), + withCredentials: this.configuration.withCredentials, headers: localVarHeaders, observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + transferCache: localVarTransferCache, reportProgress: reportProgress } ); @@ -92,10 +159,8 @@ export class JrlService extends BaseService { /** * Updates JRL (Json Revocation List) using a JRL token - * @endpoint post /jet/jrl * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. - * @param options additional options */ public updateJrl(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable; public updateJrl(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable>; @@ -104,18 +169,33 @@ export class JrlService extends BaseService { let localVarHeaders = this.defaultHeaders; + let localVarCredential: string | undefined; // authentication (jrl_token) required - localVarHeaders = this.configuration.addCredentialToHeaders('jrl_token', 'Authorization', localVarHeaders, 'Bearer '); + localVarCredential = this.configuration.lookupCredential('jrl_token'); + if (localVarCredential) { + localVarHeaders = localVarHeaders.set('Authorization', 'Bearer ' + localVarCredential); + } - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - ]); + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } if (localVarHttpHeaderAcceptSelected !== undefined) { localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); } - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } - const localVarTransferCache: boolean = options?.transferCache ?? true; + let localVarTransferCache: boolean | undefined = options && options.transferCache; + if (localVarTransferCache === undefined) { + localVarTransferCache = true; + } let responseType_: 'text' | 'json' | 'blob' = 'json'; @@ -130,15 +210,14 @@ export class JrlService extends BaseService { } let localVarPath = `/jet/jrl`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('post', `${basePath}${localVarPath}`, + return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), + withCredentials: this.configuration.withCredentials, headers: localVarHeaders, observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + transferCache: localVarTransferCache, reportProgress: reportProgress } ); diff --git a/devolutions-gateway/openapi/ts-angular-client/api/net.service.ts b/devolutions-gateway/openapi/ts-angular-client/api/net.service.ts index 549885486..f34155875 100644 --- a/devolutions-gateway/openapi/ts-angular-client/api/net.service.ts +++ b/devolutions-gateway/openapi/ts-angular-client/api/net.service.ts @@ -11,10 +11,10 @@ import { Inject, Injectable, Optional } from '@angular/core'; import { HttpClient, HttpHeaders, HttpParams, - HttpResponse, HttpEvent, HttpContext + HttpResponse, HttpEvent, HttpParameterCodec, HttpContext } from '@angular/common/http'; +import { CustomHttpParameterCodec } from '../encoder'; import { Observable } from 'rxjs'; -import { OpenApiHttpParams, QueryParamStyle } from '../query.params'; // @ts-ignore import { InterfaceInfo } from '../model/interfaceInfo'; @@ -24,25 +24,78 @@ import { NetworkInterfacesResponse } from '../model/networkInterfacesResponse'; // @ts-ignore import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; import { Configuration } from '../configuration'; -import { BaseService } from '../api.base.service'; @Injectable({ providedIn: 'root' }) -export class NetService extends BaseService { +export class NetService { - constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) { - super(basePath, configuration); + protected basePath = 'http://localhost'; + public defaultHeaders = new HttpHeaders(); + public configuration = new Configuration(); + public encoder: HttpParameterCodec; + + constructor(protected httpClient: HttpClient, @Optional()@Inject(BASE_PATH) basePath: string|string[], @Optional() configuration: Configuration) { + if (configuration) { + this.configuration = configuration; + } + if (typeof this.configuration.basePath !== 'string') { + const firstBasePath = Array.isArray(basePath) ? basePath[0] : undefined; + if (firstBasePath != undefined) { + basePath = firstBasePath; + } + + if (typeof basePath !== 'string') { + basePath = this.basePath; + } + this.configuration.basePath = basePath; + } + this.encoder = this.configuration.encoder || new CustomHttpParameterCodec(); + } + + + // @ts-ignore + private addToHttpParams(httpParams: HttpParams, value: any, key?: string): HttpParams { + if (typeof value === "object" && value instanceof Date === false) { + httpParams = this.addToHttpParamsRecursive(httpParams, value); + } else { + httpParams = this.addToHttpParamsRecursive(httpParams, value, key); + } + return httpParams; + } + + private addToHttpParamsRecursive(httpParams: HttpParams, value?: any, key?: string): HttpParams { + if (value == null) { + return httpParams; + } + + if (typeof value === "object") { + if (Array.isArray(value)) { + (value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); + } else if (value instanceof Date) { + if (key != null) { + httpParams = httpParams.append(key, (value as Date).toISOString().substring(0, 10)); + } else { + throw Error("key may not be null if value is Date"); + } + } else { + Object.keys(value).forEach( k => httpParams = this.addToHttpParamsRecursive( + httpParams, value[k], key != null ? `${key}.${k}` : k)); + } + } else if (key != null) { + httpParams = httpParams.append(key, value); + } else { + throw Error("key may not be null if value is not object or array"); + } + return httpParams; } /** * Lists network interfaces - * @endpoint get /jet/net/config * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. - * @param options additional options */ public getNetConfig(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; }>>; public getNetConfig(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; }>>>; @@ -51,19 +104,34 @@ export class NetService extends BaseService { let localVarHeaders = this.defaultHeaders; + let localVarCredential: string | undefined; // authentication (netscan_token) required - localVarHeaders = this.configuration.addCredentialToHeaders('netscan_token', 'Authorization', localVarHeaders, 'Bearer '); + localVarCredential = this.configuration.lookupCredential('netscan_token'); + if (localVarCredential) { + localVarHeaders = localVarHeaders.set('Authorization', 'Bearer ' + localVarCredential); + } - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/json' + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } if (localVarHttpHeaderAcceptSelected !== undefined) { localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); } - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } - const localVarTransferCache: boolean = options?.transferCache ?? true; + let localVarTransferCache: boolean | undefined = options && options.transferCache; + if (localVarTransferCache === undefined) { + localVarTransferCache = true; + } let responseType_: 'text' | 'json' | 'blob' = 'json'; @@ -78,15 +146,14 @@ export class NetService extends BaseService { } let localVarPath = `/jet/net/config`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request; }>>('get', `${basePath}${localVarPath}`, + return this.httpClient.request; }>>('get', `${this.configuration.basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), + withCredentials: this.configuration.withCredentials, headers: localVarHeaders, observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + transferCache: localVarTransferCache, reportProgress: reportProgress } ); @@ -94,10 +161,8 @@ export class NetService extends BaseService { /** * Lists Gateway network scan sources. - * @endpoint get /jet/net/interfaces * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. - * @param options additional options */ public getNetInterfaces(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; public getNetInterfaces(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; @@ -106,19 +171,34 @@ export class NetService extends BaseService { let localVarHeaders = this.defaultHeaders; + let localVarCredential: string | undefined; // authentication (netscan_token) required - localVarHeaders = this.configuration.addCredentialToHeaders('netscan_token', 'Authorization', localVarHeaders, 'Bearer '); + localVarCredential = this.configuration.lookupCredential('netscan_token'); + if (localVarCredential) { + localVarHeaders = localVarHeaders.set('Authorization', 'Bearer ' + localVarCredential); + } - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/json' + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } if (localVarHttpHeaderAcceptSelected !== undefined) { localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); } - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } - const localVarTransferCache: boolean = options?.transferCache ?? true; + let localVarTransferCache: boolean | undefined = options && options.transferCache; + if (localVarTransferCache === undefined) { + localVarTransferCache = true; + } let responseType_: 'text' | 'json' | 'blob' = 'json'; @@ -133,15 +213,14 @@ export class NetService extends BaseService { } let localVarPath = `/jet/net/interfaces`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, + return this.httpClient.request('get', `${this.configuration.basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), + withCredentials: this.configuration.withCredentials, headers: localVarHeaders, observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + transferCache: localVarTransferCache, reportProgress: reportProgress } ); @@ -150,7 +229,6 @@ export class NetService extends BaseService { /** * Stream network scan events over a websocket. * The endpoint is upgraded from HTTP, so OpenAPI describes the **handshake**: the query parameters that drive the scan (validated before upgrade) and the legacy / v1 event payloads streamed back as JSON text frames. See `NetworkScanResultEvent` for the v1 shape and `LegacyScanEvent` for the legacy shape (selected via `response_format`). - * @endpoint get /jet/net/scan * @param pingInterval Interval in milliseconds (default is 200) * @param pingTimeout Timeout in milliseconds (default is 500) * @param broadcastTimeout Timeout in milliseconds (default is 1000) @@ -162,7 +240,7 @@ export class NetService extends BaseService { * @param range The start and end IP address of the range to scan. for example: 10.10.0.0-10.10.0.255 * @param target Explicit single-host targets to scan. Each value must parse as an IPv4 or IPv6 address; invalid values yield a structured `{ error: \"invalid_target\", value: \"<raw>\" }` 400 rather than a generic serde rejection at extraction time (mirrors the `range=` / `probe=` validation path). * @param interfaceId Gateway network interface IDs to use as scan sources. - * @param probe The probes to run. Each value is either `ping`, a port number (`22`), or a named service (`rdp`, `https`, ΓǪ). Validation is deferred to scan-time so failures can be surfaced as a structured 400 ΓÇö naming the offending value ΓÇö instead of a generic serde rejection at extraction time. + * @param probe The probes to run. Each value is either `ping`, a port number (`22`), or a named service (`rdp`, `https`, …). Validation is deferred to scan-time so failures can be surfaced as a structured 400 — naming the offending value — instead of a generic serde rejection at extraction time. * @param enablePingStart **Legacy alias** for `report_ping_start`. Prefer the explicit name in new clients; kept so existing consumers don\'t break. * @param enableBroadcast Enable the execution of broadcast scan * @param enableSubnetScan Enable the ping scan on subnet @@ -180,322 +258,184 @@ export class NetService extends BaseService { * @param maxConcurrency Maximum scanner concurrency. * @param maxPingConcurrency Maximum ping probe concurrency. * @param maxTcpProbeConcurrency Maximum TCP probe concurrency. - * @param enableFailure **Legacy alias** for `report_ping_failure`. `enable_failure=true` only opts into ping-failure events; TCP-probe failure events require the explicit `report_tcp_failure=true` and are not affected by this alias. **Behavior change:** historically this single flag controlled both ping-failure and TCP-probe-failure reporting. The two are now split: clients that want the old \"both at once\" semantics must send `enable_failure=true&report_tcp_failure=true` together. The split is intentional ΓÇö TCP-probe failures are typically high-volume noise that callers were filtering client-side anyway, so the two streams are independently gated. + * @param enableFailure **Legacy alias** for `report_ping_failure`. `enable_failure=true` only opts into ping-failure events; TCP-probe failure events require the explicit `report_tcp_failure=true` and are not affected by this alias. **Behavior change:** historically this single flag controlled both ping-failure and TCP-probe-failure reporting. The two are now split: clients that want the old \"both at once\" semantics must send `enable_failure=true&report_tcp_failure=true` together. The split is intentional — TCP-probe failures are typically high-volume noise that callers were filtering client-side anyway, so the two streams are independently gated. * @param reportTcpFailure Enable TCP port knocking failure events. * @param interfaceBindStrict When `true`, fail with HTTP 400 if a ping/TCP-probe socket cannot be bound to the planner-selected interface. Default `false` (warn and fall back to default routing). * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. - * @param options additional options */ public getNetScan(pingInterval?: number, pingTimeout?: number, broadcastTimeout?: number, portScanTimeout?: number, netbiosTimeout?: number, netbiosInterval?: number, mdnsQueryTimeout?: number, maxWait?: number, range?: Array, target?: Array, interfaceId?: Array, probe?: Array, enablePingStart?: boolean, enableBroadcast?: boolean, enableSubnetScan?: boolean, enableZeroconf?: boolean, enableNetbios?: boolean, enableResolveDns?: boolean, includeHostResults?: boolean, reportPingStart?: boolean, reportPingSuccess?: boolean, reportPingFailure?: boolean, enableTcpProbes?: boolean, rangeInterfacePolicy?: string, allowCrossInterfaceRange?: boolean, responseFormat?: string, maxConcurrency?: number, maxPingConcurrency?: number, maxTcpProbeConcurrency?: number, enableFailure?: boolean, reportTcpFailure?: boolean, interfaceBindStrict?: boolean, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable; public getNetScan(pingInterval?: number, pingTimeout?: number, broadcastTimeout?: number, portScanTimeout?: number, netbiosTimeout?: number, netbiosInterval?: number, mdnsQueryTimeout?: number, maxWait?: number, range?: Array, target?: Array, interfaceId?: Array, probe?: Array, enablePingStart?: boolean, enableBroadcast?: boolean, enableSubnetScan?: boolean, enableZeroconf?: boolean, enableNetbios?: boolean, enableResolveDns?: boolean, includeHostResults?: boolean, reportPingStart?: boolean, reportPingSuccess?: boolean, reportPingFailure?: boolean, enableTcpProbes?: boolean, rangeInterfacePolicy?: string, allowCrossInterfaceRange?: boolean, responseFormat?: string, maxConcurrency?: number, maxPingConcurrency?: number, maxTcpProbeConcurrency?: number, enableFailure?: boolean, reportTcpFailure?: boolean, interfaceBindStrict?: boolean, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable>; public getNetScan(pingInterval?: number, pingTimeout?: number, broadcastTimeout?: number, portScanTimeout?: number, netbiosTimeout?: number, netbiosInterval?: number, mdnsQueryTimeout?: number, maxWait?: number, range?: Array, target?: Array, interfaceId?: Array, probe?: Array, enablePingStart?: boolean, enableBroadcast?: boolean, enableSubnetScan?: boolean, enableZeroconf?: boolean, enableNetbios?: boolean, enableResolveDns?: boolean, includeHostResults?: boolean, reportPingStart?: boolean, reportPingSuccess?: boolean, reportPingFailure?: boolean, enableTcpProbes?: boolean, rangeInterfacePolicy?: string, allowCrossInterfaceRange?: boolean, responseFormat?: string, maxConcurrency?: number, maxPingConcurrency?: number, maxTcpProbeConcurrency?: number, enableFailure?: boolean, reportTcpFailure?: boolean, interfaceBindStrict?: boolean, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable>; public getNetScan(pingInterval?: number, pingTimeout?: number, broadcastTimeout?: number, portScanTimeout?: number, netbiosTimeout?: number, netbiosInterval?: number, mdnsQueryTimeout?: number, maxWait?: number, range?: Array, target?: Array, interfaceId?: Array, probe?: Array, enablePingStart?: boolean, enableBroadcast?: boolean, enableSubnetScan?: boolean, enableZeroconf?: boolean, enableNetbios?: boolean, enableResolveDns?: boolean, includeHostResults?: boolean, reportPingStart?: boolean, reportPingSuccess?: boolean, reportPingFailure?: boolean, enableTcpProbes?: boolean, rangeInterfacePolicy?: string, allowCrossInterfaceRange?: boolean, responseFormat?: string, maxConcurrency?: number, maxPingConcurrency?: number, maxTcpProbeConcurrency?: number, enableFailure?: boolean, reportTcpFailure?: boolean, interfaceBindStrict?: boolean, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable { - let localVarQueryParameters = new OpenApiHttpParams(this.encoder); - - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - 'ping_interval', - pingInterval, - QueryParamStyle.Form, - true, - ); - - - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - 'ping_timeout', - pingTimeout, - QueryParamStyle.Form, - true, - ); - - - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - 'broadcast_timeout', - broadcastTimeout, - QueryParamStyle.Form, - true, - ); - - - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - 'port_scan_timeout', - portScanTimeout, - QueryParamStyle.Form, - true, - ); - - - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - 'netbios_timeout', - netbiosTimeout, - QueryParamStyle.Form, - true, - ); - - - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - 'netbios_interval', - netbiosInterval, - QueryParamStyle.Form, - true, - ); - - - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - 'mdns_query_timeout', - mdnsQueryTimeout, - QueryParamStyle.Form, - true, - ); - - - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - 'max_wait', - maxWait, - QueryParamStyle.Form, - true, - ); - - - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - 'range', - range, - QueryParamStyle.Form, - true, - ); - - - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - 'target', - target, - QueryParamStyle.Form, - true, - ); - - - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - 'interface_id', - interfaceId, - QueryParamStyle.Form, - true, - ); - - - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - 'probe', - probe, - QueryParamStyle.Form, - true, - ); - - - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - 'enable_ping_start', - enablePingStart, - QueryParamStyle.Form, - true, - ); - - - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - 'enable_broadcast', - enableBroadcast, - QueryParamStyle.Form, - true, - ); - - - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - 'enable_subnet_scan', - enableSubnetScan, - QueryParamStyle.Form, - true, - ); - - - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - 'enable_zeroconf', - enableZeroconf, - QueryParamStyle.Form, - true, - ); - - - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - 'enable_netbios', - enableNetbios, - QueryParamStyle.Form, - true, - ); - - - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - 'enable_resolve_dns', - enableResolveDns, - QueryParamStyle.Form, - true, - ); - - - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - 'include_host_results', - includeHostResults, - QueryParamStyle.Form, - true, - ); - - - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - 'report_ping_start', - reportPingStart, - QueryParamStyle.Form, - true, - ); - - - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - 'report_ping_success', - reportPingSuccess, - QueryParamStyle.Form, - true, - ); - - - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - 'report_ping_failure', - reportPingFailure, - QueryParamStyle.Form, - true, - ); - - - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - 'enable_tcp_probes', - enableTcpProbes, - QueryParamStyle.Form, - true, - ); - - - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - 'range_interface_policy', - rangeInterfacePolicy, - QueryParamStyle.Form, - true, - ); - - - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - 'allow_cross_interface_range', - allowCrossInterfaceRange, - QueryParamStyle.Form, - true, - ); - - - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - 'response_format', - responseFormat, - QueryParamStyle.Form, - true, - ); - - - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - 'max_concurrency', - maxConcurrency, - QueryParamStyle.Form, - true, - ); - - - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - 'max_ping_concurrency', - maxPingConcurrency, - QueryParamStyle.Form, - true, - ); - - - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - 'max_tcp_probe_concurrency', - maxTcpProbeConcurrency, - QueryParamStyle.Form, - true, - ); - - - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - 'enable_failure', - enableFailure, - QueryParamStyle.Form, - true, - ); - - - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - 'report_tcp_failure', - reportTcpFailure, - QueryParamStyle.Form, - true, - ); - - - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - 'interface_bind_strict', - interfaceBindStrict, - QueryParamStyle.Form, - true, - ); - + let localVarQueryParameters = new HttpParams({encoder: this.encoder}); + if (pingInterval !== undefined && pingInterval !== null) { + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + pingInterval, 'ping_interval'); + } + if (pingTimeout !== undefined && pingTimeout !== null) { + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + pingTimeout, 'ping_timeout'); + } + if (broadcastTimeout !== undefined && broadcastTimeout !== null) { + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + broadcastTimeout, 'broadcast_timeout'); + } + if (portScanTimeout !== undefined && portScanTimeout !== null) { + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + portScanTimeout, 'port_scan_timeout'); + } + if (netbiosTimeout !== undefined && netbiosTimeout !== null) { + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + netbiosTimeout, 'netbios_timeout'); + } + if (netbiosInterval !== undefined && netbiosInterval !== null) { + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + netbiosInterval, 'netbios_interval'); + } + if (mdnsQueryTimeout !== undefined && mdnsQueryTimeout !== null) { + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + mdnsQueryTimeout, 'mdns_query_timeout'); + } + if (maxWait !== undefined && maxWait !== null) { + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + maxWait, 'max_wait'); + } + if (range) { + range.forEach((element) => { + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + element, 'range'); + }) + } + if (target) { + target.forEach((element) => { + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + element, 'target'); + }) + } + if (interfaceId) { + interfaceId.forEach((element) => { + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + element, 'interface_id'); + }) + } + if (probe) { + probe.forEach((element) => { + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + element, 'probe'); + }) + } + if (enablePingStart !== undefined && enablePingStart !== null) { + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + enablePingStart, 'enable_ping_start'); + } + if (enableBroadcast !== undefined && enableBroadcast !== null) { + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + enableBroadcast, 'enable_broadcast'); + } + if (enableSubnetScan !== undefined && enableSubnetScan !== null) { + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + enableSubnetScan, 'enable_subnet_scan'); + } + if (enableZeroconf !== undefined && enableZeroconf !== null) { + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + enableZeroconf, 'enable_zeroconf'); + } + if (enableNetbios !== undefined && enableNetbios !== null) { + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + enableNetbios, 'enable_netbios'); + } + if (enableResolveDns !== undefined && enableResolveDns !== null) { + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + enableResolveDns, 'enable_resolve_dns'); + } + if (includeHostResults !== undefined && includeHostResults !== null) { + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + includeHostResults, 'include_host_results'); + } + if (reportPingStart !== undefined && reportPingStart !== null) { + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + reportPingStart, 'report_ping_start'); + } + if (reportPingSuccess !== undefined && reportPingSuccess !== null) { + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + reportPingSuccess, 'report_ping_success'); + } + if (reportPingFailure !== undefined && reportPingFailure !== null) { + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + reportPingFailure, 'report_ping_failure'); + } + if (enableTcpProbes !== undefined && enableTcpProbes !== null) { + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + enableTcpProbes, 'enable_tcp_probes'); + } + if (rangeInterfacePolicy !== undefined && rangeInterfacePolicy !== null) { + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + rangeInterfacePolicy, 'range_interface_policy'); + } + if (allowCrossInterfaceRange !== undefined && allowCrossInterfaceRange !== null) { + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + allowCrossInterfaceRange, 'allow_cross_interface_range'); + } + if (responseFormat !== undefined && responseFormat !== null) { + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + responseFormat, 'response_format'); + } + if (maxConcurrency !== undefined && maxConcurrency !== null) { + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + maxConcurrency, 'max_concurrency'); + } + if (maxPingConcurrency !== undefined && maxPingConcurrency !== null) { + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + maxPingConcurrency, 'max_ping_concurrency'); + } + if (maxTcpProbeConcurrency !== undefined && maxTcpProbeConcurrency !== null) { + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + maxTcpProbeConcurrency, 'max_tcp_probe_concurrency'); + } + if (enableFailure !== undefined && enableFailure !== null) { + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + enableFailure, 'enable_failure'); + } + if (reportTcpFailure !== undefined && reportTcpFailure !== null) { + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + reportTcpFailure, 'report_tcp_failure'); + } + if (interfaceBindStrict !== undefined && interfaceBindStrict !== null) { + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + interfaceBindStrict, 'interface_bind_strict'); + } let localVarHeaders = this.defaultHeaders; + let localVarCredential: string | undefined; // authentication (netscan_token) required - localVarHeaders = this.configuration.addCredentialToHeaders('netscan_token', 'Authorization', localVarHeaders, 'Bearer '); + localVarCredential = this.configuration.lookupCredential('netscan_token'); + if (localVarCredential) { + localVarHeaders = localVarHeaders.set('Authorization', 'Bearer ' + localVarCredential); + } - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - ]); + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } if (localVarHttpHeaderAcceptSelected !== undefined) { localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); } - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } - const localVarTransferCache: boolean = options?.transferCache ?? true; + let localVarTransferCache: boolean | undefined = options && options.transferCache; + if (localVarTransferCache === undefined) { + localVarTransferCache = true; + } let responseType_: 'text' | 'json' | 'blob' = 'json'; @@ -510,16 +450,15 @@ export class NetService extends BaseService { } let localVarPath = `/jet/net/scan`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, + return this.httpClient.request('get', `${this.configuration.basePath}${localVarPath}`, { context: localVarHttpContext, - params: localVarQueryParameters.toHttpParams(), + params: localVarQueryParameters, responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), + withCredentials: this.configuration.withCredentials, headers: localVarHeaders, observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + transferCache: localVarTransferCache, reportProgress: reportProgress } ); diff --git a/devolutions-gateway/openapi/ts-angular-client/api/networkMonitoring.service.ts b/devolutions-gateway/openapi/ts-angular-client/api/networkMonitoring.service.ts index 254431739..1bfa71085 100644 --- a/devolutions-gateway/openapi/ts-angular-client/api/networkMonitoring.service.ts +++ b/devolutions-gateway/openapi/ts-angular-client/api/networkMonitoring.service.ts @@ -11,10 +11,10 @@ import { Inject, Injectable, Optional } from '@angular/core'; import { HttpClient, HttpHeaders, HttpParams, - HttpResponse, HttpEvent, HttpContext + HttpResponse, HttpEvent, HttpParameterCodec, HttpContext } from '@angular/common/http'; +import { CustomHttpParameterCodec } from '../encoder'; import { Observable } from 'rxjs'; -import { OpenApiHttpParams, QueryParamStyle } from '../query.params'; // @ts-ignore import { MonitoringLogResponse } from '../model/monitoringLogResponse'; @@ -26,26 +26,79 @@ import { SetConfigResponse } from '../model/setConfigResponse'; // @ts-ignore import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; import { Configuration } from '../configuration'; -import { BaseService } from '../api.base.service'; @Injectable({ providedIn: 'root' }) -export class NetworkMonitoringService extends BaseService { +export class NetworkMonitoringService { - constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) { - super(basePath, configuration); + protected basePath = 'http://localhost'; + public defaultHeaders = new HttpHeaders(); + public configuration = new Configuration(); + public encoder: HttpParameterCodec; + + constructor(protected httpClient: HttpClient, @Optional()@Inject(BASE_PATH) basePath: string|string[], @Optional() configuration: Configuration) { + if (configuration) { + this.configuration = configuration; + } + if (typeof this.configuration.basePath !== 'string') { + const firstBasePath = Array.isArray(basePath) ? basePath[0] : undefined; + if (firstBasePath != undefined) { + basePath = firstBasePath; + } + + if (typeof basePath !== 'string') { + basePath = this.basePath; + } + this.configuration.basePath = basePath; + } + this.encoder = this.configuration.encoder || new CustomHttpParameterCodec(); + } + + + // @ts-ignore + private addToHttpParams(httpParams: HttpParams, value: any, key?: string): HttpParams { + if (typeof value === "object" && value instanceof Date === false) { + httpParams = this.addToHttpParamsRecursive(httpParams, value); + } else { + httpParams = this.addToHttpParamsRecursive(httpParams, value, key); + } + return httpParams; + } + + private addToHttpParamsRecursive(httpParams: HttpParams, value?: any, key?: string): HttpParams { + if (value == null) { + return httpParams; + } + + if (typeof value === "object") { + if (Array.isArray(value)) { + (value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); + } else if (value instanceof Date) { + if (key != null) { + httpParams = httpParams.append(key, (value as Date).toISOString().substring(0, 10)); + } else { + throw Error("key may not be null if value is Date"); + } + } else { + Object.keys(value).forEach( k => httpParams = this.addToHttpParamsRecursive( + httpParams, value[k], key != null ? `${key}.${k}` : k)); + } + } else if (key != null) { + httpParams = httpParams.append(key, value); + } else { + throw Error("key may not be null if value is not object or array"); + } + return httpParams; } /** * Monitors store their results in a temporary log, which is returned here. * Once the log is downloaded, gateway purges it from memory. - * @endpoint post /jet/net/monitor/log/drain * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. - * @param options additional options */ public drainMonitoringLog(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; public drainMonitoringLog(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; @@ -54,19 +107,34 @@ export class NetworkMonitoringService extends BaseService { let localVarHeaders = this.defaultHeaders; + let localVarCredential: string | undefined; // authentication (scope_token) required - localVarHeaders = this.configuration.addCredentialToHeaders('scope_token', 'Authorization', localVarHeaders, 'Bearer '); + localVarCredential = this.configuration.lookupCredential('scope_token'); + if (localVarCredential) { + localVarHeaders = localVarHeaders.set('Authorization', 'Bearer ' + localVarCredential); + } - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/json' + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } if (localVarHttpHeaderAcceptSelected !== undefined) { localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); } - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } - const localVarTransferCache: boolean = options?.transferCache ?? true; + let localVarTransferCache: boolean | undefined = options && options.transferCache; + if (localVarTransferCache === undefined) { + localVarTransferCache = true; + } let responseType_: 'text' | 'json' | 'blob' = 'json'; @@ -81,15 +149,14 @@ export class NetworkMonitoringService extends BaseService { } let localVarPath = `/jet/net/monitor/log/drain`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('post', `${basePath}${localVarPath}`, + return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), + withCredentials: this.configuration.withCredentials, headers: localVarHeaders, observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + transferCache: localVarTransferCache, reportProgress: reportProgress } ); @@ -98,11 +165,9 @@ export class NetworkMonitoringService extends BaseService { /** * Replace the current monitoring configuration with the configuration in the request body. * Changes take effect immediately: - Starts any monitors newly defined in the payload. - Stops any currently running monitors that are omitted from the payload. A 200 status code is returned even if some or all of the probes in the configuration are not understood. The response body will in this case contain a list of probes that were unsupported or invalid. Note: The configuration is not persisted across process restarts. - * @endpoint post /jet/net/monitor/config * @param monitorsConfig JSON object containing a list of monitors * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. - * @param options additional options */ public setMonitoringConfig(monitorsConfig: MonitorsConfig, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; public setMonitoringConfig(monitorsConfig: MonitorsConfig, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; @@ -114,19 +179,34 @@ export class NetworkMonitoringService extends BaseService { let localVarHeaders = this.defaultHeaders; + let localVarCredential: string | undefined; // authentication (scope_token) required - localVarHeaders = this.configuration.addCredentialToHeaders('scope_token', 'Authorization', localVarHeaders, 'Bearer '); + localVarCredential = this.configuration.lookupCredential('scope_token'); + if (localVarCredential) { + localVarHeaders = localVarHeaders.set('Authorization', 'Bearer ' + localVarCredential); + } - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/json' + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } if (localVarHttpHeaderAcceptSelected !== undefined) { localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); } - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } - const localVarTransferCache: boolean = options?.transferCache ?? true; + let localVarTransferCache: boolean | undefined = options && options.transferCache; + if (localVarTransferCache === undefined) { + localVarTransferCache = true; + } // to determine the Content-Type header @@ -150,16 +230,15 @@ export class NetworkMonitoringService extends BaseService { } let localVarPath = `/jet/net/monitor/config`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('post', `${basePath}${localVarPath}`, + return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, { context: localVarHttpContext, body: monitorsConfig, responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), + withCredentials: this.configuration.withCredentials, headers: localVarHeaders, observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + transferCache: localVarTransferCache, reportProgress: reportProgress } ); diff --git a/devolutions-gateway/openapi/ts-angular-client/api/preflight.service.ts b/devolutions-gateway/openapi/ts-angular-client/api/preflight.service.ts index 50fe35530..d49f63b20 100644 --- a/devolutions-gateway/openapi/ts-angular-client/api/preflight.service.ts +++ b/devolutions-gateway/openapi/ts-angular-client/api/preflight.service.ts @@ -11,10 +11,10 @@ import { Inject, Injectable, Optional } from '@angular/core'; import { HttpClient, HttpHeaders, HttpParams, - HttpResponse, HttpEvent, HttpContext + HttpResponse, HttpEvent, HttpParameterCodec, HttpContext } from '@angular/common/http'; +import { CustomHttpParameterCodec } from '../encoder'; import { Observable } from 'rxjs'; -import { OpenApiHttpParams, QueryParamStyle } from '../query.params'; // @ts-ignore import { PreflightOperation } from '../model/preflightOperation'; @@ -24,26 +24,79 @@ import { PreflightOutput } from '../model/preflightOutput'; // @ts-ignore import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; import { Configuration } from '../configuration'; -import { BaseService } from '../api.base.service'; @Injectable({ providedIn: 'root' }) -export class PreflightService extends BaseService { +export class PreflightService { - constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) { - super(basePath, configuration); + protected basePath = 'http://localhost'; + public defaultHeaders = new HttpHeaders(); + public configuration = new Configuration(); + public encoder: HttpParameterCodec; + + constructor(protected httpClient: HttpClient, @Optional()@Inject(BASE_PATH) basePath: string|string[], @Optional() configuration: Configuration) { + if (configuration) { + this.configuration = configuration; + } + if (typeof this.configuration.basePath !== 'string') { + const firstBasePath = Array.isArray(basePath) ? basePath[0] : undefined; + if (firstBasePath != undefined) { + basePath = firstBasePath; + } + + if (typeof basePath !== 'string') { + basePath = this.basePath; + } + this.configuration.basePath = basePath; + } + this.encoder = this.configuration.encoder || new CustomHttpParameterCodec(); + } + + + // @ts-ignore + private addToHttpParams(httpParams: HttpParams, value: any, key?: string): HttpParams { + if (typeof value === "object" && value instanceof Date === false) { + httpParams = this.addToHttpParamsRecursive(httpParams, value); + } else { + httpParams = this.addToHttpParamsRecursive(httpParams, value, key); + } + return httpParams; + } + + private addToHttpParamsRecursive(httpParams: HttpParams, value?: any, key?: string): HttpParams { + if (value == null) { + return httpParams; + } + + if (typeof value === "object") { + if (Array.isArray(value)) { + (value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); + } else if (value instanceof Date) { + if (key != null) { + httpParams = httpParams.append(key, (value as Date).toISOString().substring(0, 10)); + } else { + throw Error("key may not be null if value is Date"); + } + } else { + Object.keys(value).forEach( k => httpParams = this.addToHttpParamsRecursive( + httpParams, value[k], key != null ? `${key}.${k}` : k)); + } + } else if (key != null) { + httpParams = httpParams.append(key, value); + } else { + throw Error("key may not be null if value is not object or array"); + } + return httpParams; } /** * Performs a batch of preflight operations - * @endpoint post /jet/preflight * @param preflightOperation * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. - * @param options additional options */ public postPreflight(preflightOperation: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; public postPreflight(preflightOperation: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>>; @@ -55,19 +108,34 @@ export class PreflightService extends BaseService { let localVarHeaders = this.defaultHeaders; + let localVarCredential: string | undefined; // authentication (scope_token) required - localVarHeaders = this.configuration.addCredentialToHeaders('scope_token', 'Authorization', localVarHeaders, 'Bearer '); + localVarCredential = this.configuration.lookupCredential('scope_token'); + if (localVarCredential) { + localVarHeaders = localVarHeaders.set('Authorization', 'Bearer ' + localVarCredential); + } - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/json' + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } if (localVarHttpHeaderAcceptSelected !== undefined) { localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); } - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } - const localVarTransferCache: boolean = options?.transferCache ?? true; + let localVarTransferCache: boolean | undefined = options && options.transferCache; + if (localVarTransferCache === undefined) { + localVarTransferCache = true; + } // to determine the Content-Type header @@ -91,16 +159,15 @@ export class PreflightService extends BaseService { } let localVarPath = `/jet/preflight`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request>('post', `${basePath}${localVarPath}`, + return this.httpClient.request>('post', `${this.configuration.basePath}${localVarPath}`, { context: localVarHttpContext, body: preflightOperation, responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), + withCredentials: this.configuration.withCredentials, headers: localVarHeaders, observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + transferCache: localVarTransferCache, reportProgress: reportProgress } ); diff --git a/devolutions-gateway/openapi/ts-angular-client/api/sessions.service.ts b/devolutions-gateway/openapi/ts-angular-client/api/sessions.service.ts index 670940cef..4c2b60cc4 100644 --- a/devolutions-gateway/openapi/ts-angular-client/api/sessions.service.ts +++ b/devolutions-gateway/openapi/ts-angular-client/api/sessions.service.ts @@ -11,10 +11,10 @@ import { Inject, Injectable, Optional } from '@angular/core'; import { HttpClient, HttpHeaders, HttpParams, - HttpResponse, HttpEvent, HttpContext + HttpResponse, HttpEvent, HttpParameterCodec, HttpContext } from '@angular/common/http'; +import { CustomHttpParameterCodec } from '../encoder'; import { Observable } from 'rxjs'; -import { OpenApiHttpParams, QueryParamStyle } from '../query.params'; // @ts-ignore import { SessionInfo } from '../model/sessionInfo'; @@ -22,25 +22,78 @@ import { SessionInfo } from '../model/sessionInfo'; // @ts-ignore import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; import { Configuration } from '../configuration'; -import { BaseService } from '../api.base.service'; @Injectable({ providedIn: 'root' }) -export class SessionsService extends BaseService { +export class SessionsService { - constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) { - super(basePath, configuration); + protected basePath = 'http://localhost'; + public defaultHeaders = new HttpHeaders(); + public configuration = new Configuration(); + public encoder: HttpParameterCodec; + + constructor(protected httpClient: HttpClient, @Optional()@Inject(BASE_PATH) basePath: string|string[], @Optional() configuration: Configuration) { + if (configuration) { + this.configuration = configuration; + } + if (typeof this.configuration.basePath !== 'string') { + const firstBasePath = Array.isArray(basePath) ? basePath[0] : undefined; + if (firstBasePath != undefined) { + basePath = firstBasePath; + } + + if (typeof basePath !== 'string') { + basePath = this.basePath; + } + this.configuration.basePath = basePath; + } + this.encoder = this.configuration.encoder || new CustomHttpParameterCodec(); + } + + + // @ts-ignore + private addToHttpParams(httpParams: HttpParams, value: any, key?: string): HttpParams { + if (typeof value === "object" && value instanceof Date === false) { + httpParams = this.addToHttpParamsRecursive(httpParams, value); + } else { + httpParams = this.addToHttpParamsRecursive(httpParams, value, key); + } + return httpParams; + } + + private addToHttpParamsRecursive(httpParams: HttpParams, value?: any, key?: string): HttpParams { + if (value == null) { + return httpParams; + } + + if (typeof value === "object") { + if (Array.isArray(value)) { + (value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); + } else if (value instanceof Date) { + if (key != null) { + httpParams = httpParams.append(key, (value as Date).toISOString().substring(0, 10)); + } else { + throw Error("key may not be null if value is Date"); + } + } else { + Object.keys(value).forEach( k => httpParams = this.addToHttpParamsRecursive( + httpParams, value[k], key != null ? `${key}.${k}` : k)); + } + } else if (key != null) { + httpParams = httpParams.append(key, value); + } else { + throw Error("key may not be null if value is not object or array"); + } + return httpParams; } /** * Lists running sessions - * @endpoint get /jet/sessions * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. - * @param options additional options */ public getSessions(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; public getSessions(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>>; @@ -49,19 +102,34 @@ export class SessionsService extends BaseService { let localVarHeaders = this.defaultHeaders; + let localVarCredential: string | undefined; // authentication (scope_token) required - localVarHeaders = this.configuration.addCredentialToHeaders('scope_token', 'Authorization', localVarHeaders, 'Bearer '); + localVarCredential = this.configuration.lookupCredential('scope_token'); + if (localVarCredential) { + localVarHeaders = localVarHeaders.set('Authorization', 'Bearer ' + localVarCredential); + } - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/json' + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } if (localVarHttpHeaderAcceptSelected !== undefined) { localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); } - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } - const localVarTransferCache: boolean = options?.transferCache ?? true; + let localVarTransferCache: boolean | undefined = options && options.transferCache; + if (localVarTransferCache === undefined) { + localVarTransferCache = true; + } let responseType_: 'text' | 'json' | 'blob' = 'json'; @@ -76,15 +144,14 @@ export class SessionsService extends BaseService { } let localVarPath = `/jet/sessions`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request>('get', `${basePath}${localVarPath}`, + return this.httpClient.request>('get', `${this.configuration.basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), + withCredentials: this.configuration.withCredentials, headers: localVarHeaders, observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + transferCache: localVarTransferCache, reportProgress: reportProgress } ); @@ -92,11 +159,9 @@ export class SessionsService extends BaseService { /** * Terminate forcefully a running session - * @endpoint post /jet/session/{id}/terminate * @param id Session / association ID of the session to terminate * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. - * @param options additional options */ public terminateSession(id: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable; public terminateSession(id: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable>; @@ -108,18 +173,33 @@ export class SessionsService extends BaseService { let localVarHeaders = this.defaultHeaders; + let localVarCredential: string | undefined; // authentication (scope_token) required - localVarHeaders = this.configuration.addCredentialToHeaders('scope_token', 'Authorization', localVarHeaders, 'Bearer '); + localVarCredential = this.configuration.lookupCredential('scope_token'); + if (localVarCredential) { + localVarHeaders = localVarHeaders.set('Authorization', 'Bearer ' + localVarCredential); + } - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - ]); + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } if (localVarHttpHeaderAcceptSelected !== undefined) { localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); } - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } - const localVarTransferCache: boolean = options?.transferCache ?? true; + let localVarTransferCache: boolean | undefined = options && options.transferCache; + if (localVarTransferCache === undefined) { + localVarTransferCache = true; + } let responseType_: 'text' | 'json' | 'blob' = 'json'; @@ -134,15 +214,14 @@ export class SessionsService extends BaseService { } let localVarPath = `/jet/session/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: "uuid"})}/terminate`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('post', `${basePath}${localVarPath}`, + return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), + withCredentials: this.configuration.withCredentials, headers: localVarHeaders, observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + transferCache: localVarTransferCache, reportProgress: reportProgress } ); diff --git a/devolutions-gateway/openapi/ts-angular-client/api/traffic.service.ts b/devolutions-gateway/openapi/ts-angular-client/api/traffic.service.ts index 926b3b122..981f61315 100644 --- a/devolutions-gateway/openapi/ts-angular-client/api/traffic.service.ts +++ b/devolutions-gateway/openapi/ts-angular-client/api/traffic.service.ts @@ -11,10 +11,10 @@ import { Inject, Injectable, Optional } from '@angular/core'; import { HttpClient, HttpHeaders, HttpParams, - HttpResponse, HttpEvent, HttpContext + HttpResponse, HttpEvent, HttpParameterCodec, HttpContext } from '@angular/common/http'; +import { CustomHttpParameterCodec } from '../encoder'; import { Observable } from 'rxjs'; -import { OpenApiHttpParams, QueryParamStyle } from '../query.params'; // @ts-ignore import { AckRequest } from '../model/ackRequest'; @@ -26,26 +26,79 @@ import { ClaimedTrafficEvent } from '../model/claimedTrafficEvent'; // @ts-ignore import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; import { Configuration } from '../configuration'; -import { BaseService } from '../api.base.service'; @Injectable({ providedIn: 'root' }) -export class TrafficService extends BaseService { +export class TrafficService { - constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) { - super(basePath, configuration); + protected basePath = 'http://localhost'; + public defaultHeaders = new HttpHeaders(); + public configuration = new Configuration(); + public encoder: HttpParameterCodec; + + constructor(protected httpClient: HttpClient, @Optional()@Inject(BASE_PATH) basePath: string|string[], @Optional() configuration: Configuration) { + if (configuration) { + this.configuration = configuration; + } + if (typeof this.configuration.basePath !== 'string') { + const firstBasePath = Array.isArray(basePath) ? basePath[0] : undefined; + if (firstBasePath != undefined) { + basePath = firstBasePath; + } + + if (typeof basePath !== 'string') { + basePath = this.basePath; + } + this.configuration.basePath = basePath; + } + this.encoder = this.configuration.encoder || new CustomHttpParameterCodec(); + } + + + // @ts-ignore + private addToHttpParams(httpParams: HttpParams, value: any, key?: string): HttpParams { + if (typeof value === "object" && value instanceof Date === false) { + httpParams = this.addToHttpParamsRecursive(httpParams, value); + } else { + httpParams = this.addToHttpParamsRecursive(httpParams, value, key); + } + return httpParams; + } + + private addToHttpParamsRecursive(httpParams: HttpParams, value?: any, key?: string): HttpParams { + if (value == null) { + return httpParams; + } + + if (typeof value === "object") { + if (Array.isArray(value)) { + (value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); + } else if (value instanceof Date) { + if (key != null) { + httpParams = httpParams.append(key, (value as Date).toISOString().substring(0, 10)); + } else { + throw Error("key may not be null if value is Date"); + } + } else { + Object.keys(value).forEach( k => httpParams = this.addToHttpParamsRecursive( + httpParams, value[k], key != null ? `${key}.${k}` : k)); + } + } else if (key != null) { + httpParams = httpParams.append(key, value); + } else { + throw Error("key may not be null if value is not object or array"); + } + return httpParams; } /** * Acknowledge traffic audit events and remove them from the queue - * @endpoint post /jet/traffic/ack * @param ackRequest Array of event IDs to acknowledge * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. - * @param options additional options */ public ackTrafficEvents(ackRequest: AckRequest, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; public ackTrafficEvents(ackRequest: AckRequest, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; @@ -57,19 +110,34 @@ export class TrafficService extends BaseService { let localVarHeaders = this.defaultHeaders; + let localVarCredential: string | undefined; // authentication (scope_token) required - localVarHeaders = this.configuration.addCredentialToHeaders('scope_token', 'Authorization', localVarHeaders, 'Bearer '); + localVarCredential = this.configuration.lookupCredential('scope_token'); + if (localVarCredential) { + localVarHeaders = localVarHeaders.set('Authorization', 'Bearer ' + localVarCredential); + } - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/json' + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } if (localVarHttpHeaderAcceptSelected !== undefined) { localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); } - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } - const localVarTransferCache: boolean = options?.transferCache ?? true; + let localVarTransferCache: boolean | undefined = options && options.transferCache; + if (localVarTransferCache === undefined) { + localVarTransferCache = true; + } // to determine the Content-Type header @@ -93,16 +161,15 @@ export class TrafficService extends BaseService { } let localVarPath = `/jet/traffic/ack`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('post', `${basePath}${localVarPath}`, + return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, { context: localVarHttpContext, body: ackRequest, responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), + withCredentials: this.configuration.withCredentials, headers: localVarHeaders, observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + transferCache: localVarTransferCache, reportProgress: reportProgress } ); @@ -110,12 +177,10 @@ export class TrafficService extends BaseService { /** * Claim traffic audit events for processing - * @endpoint post /jet/traffic/claim * @param leaseMs Lease duration in milliseconds (1000-3600000, default: 300000 = 5 minutes) * @param max Maximum number of events to claim (1-1000, default: 100) * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. - * @param options additional options */ public claimTrafficEvents(leaseMs: number, max: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; public claimTrafficEvents(leaseMs: number, max: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>>; @@ -128,41 +193,46 @@ export class TrafficService extends BaseService { throw new Error('Required parameter max was null or undefined when calling claimTrafficEvents.'); } - let localVarQueryParameters = new OpenApiHttpParams(this.encoder); - - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - 'lease_ms', - leaseMs, - QueryParamStyle.Form, - true, - ); - - - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - 'max', - max, - QueryParamStyle.Form, - true, - ); - + let localVarQueryParameters = new HttpParams({encoder: this.encoder}); + if (leaseMs !== undefined && leaseMs !== null) { + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + leaseMs, 'lease_ms'); + } + if (max !== undefined && max !== null) { + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + max, 'max'); + } let localVarHeaders = this.defaultHeaders; + let localVarCredential: string | undefined; // authentication (scope_token) required - localVarHeaders = this.configuration.addCredentialToHeaders('scope_token', 'Authorization', localVarHeaders, 'Bearer '); + localVarCredential = this.configuration.lookupCredential('scope_token'); + if (localVarCredential) { + localVarHeaders = localVarHeaders.set('Authorization', 'Bearer ' + localVarCredential); + } - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/json' + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } if (localVarHttpHeaderAcceptSelected !== undefined) { localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); } - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } - const localVarTransferCache: boolean = options?.transferCache ?? true; + let localVarTransferCache: boolean | undefined = options && options.transferCache; + if (localVarTransferCache === undefined) { + localVarTransferCache = true; + } let responseType_: 'text' | 'json' | 'blob' = 'json'; @@ -177,16 +247,15 @@ export class TrafficService extends BaseService { } let localVarPath = `/jet/traffic/claim`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request>('post', `${basePath}${localVarPath}`, + return this.httpClient.request>('post', `${this.configuration.basePath}${localVarPath}`, { context: localVarHttpContext, - params: localVarQueryParameters.toHttpParams(), + params: localVarQueryParameters, responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), + withCredentials: this.configuration.withCredentials, headers: localVarHeaders, observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + transferCache: localVarTransferCache, reportProgress: reportProgress } ); diff --git a/devolutions-gateway/openapi/ts-angular-client/api/update.service.ts b/devolutions-gateway/openapi/ts-angular-client/api/update.service.ts index 79d6040b8..446252e56 100644 --- a/devolutions-gateway/openapi/ts-angular-client/api/update.service.ts +++ b/devolutions-gateway/openapi/ts-angular-client/api/update.service.ts @@ -11,10 +11,10 @@ import { Inject, Injectable, Optional } from '@angular/core'; import { HttpClient, HttpHeaders, HttpParams, - HttpResponse, HttpEvent, HttpContext + HttpResponse, HttpEvent, HttpParameterCodec, HttpContext } from '@angular/common/http'; +import { CustomHttpParameterCodec } from '../encoder'; import { Observable } from 'rxjs'; -import { OpenApiHttpParams, QueryParamStyle } from '../query.params'; // @ts-ignore import { GetUpdateProductsResponse } from '../model/getUpdateProductsResponse'; @@ -28,26 +28,79 @@ import { UpdateRequestSchema } from '../model/updateRequestSchema'; // @ts-ignore import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; import { Configuration } from '../configuration'; -import { BaseService } from '../api.base.service'; @Injectable({ providedIn: 'root' }) -export class UpdateService extends BaseService { +export class UpdateService { - constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) { - super(basePath, configuration); + protected basePath = 'http://localhost'; + public defaultHeaders = new HttpHeaders(); + public configuration = new Configuration(); + public encoder: HttpParameterCodec; + + constructor(protected httpClient: HttpClient, @Optional()@Inject(BASE_PATH) basePath: string|string[], @Optional() configuration: Configuration) { + if (configuration) { + this.configuration = configuration; + } + if (typeof this.configuration.basePath !== 'string') { + const firstBasePath = Array.isArray(basePath) ? basePath[0] : undefined; + if (firstBasePath != undefined) { + basePath = firstBasePath; + } + + if (typeof basePath !== 'string') { + basePath = this.basePath; + } + this.configuration.basePath = basePath; + } + this.encoder = this.configuration.encoder || new CustomHttpParameterCodec(); + } + + + // @ts-ignore + private addToHttpParams(httpParams: HttpParams, value: any, key?: string): HttpParams { + if (typeof value === "object" && value instanceof Date === false) { + httpParams = this.addToHttpParamsRecursive(httpParams, value); + } else { + httpParams = this.addToHttpParamsRecursive(httpParams, value, key); + } + return httpParams; + } + + private addToHttpParamsRecursive(httpParams: HttpParams, value?: any, key?: string): HttpParams { + if (value == null) { + return httpParams; + } + + if (typeof value === "object") { + if (Array.isArray(value)) { + (value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); + } else if (value instanceof Date) { + if (key != null) { + httpParams = httpParams.append(key, (value as Date).toISOString().substring(0, 10)); + } else { + throw Error("key may not be null if value is Date"); + } + } else { + Object.keys(value).forEach( k => httpParams = this.addToHttpParamsRecursive( + httpParams, value[k], key != null ? `${key}.${k}` : k)); + } + } else if (key != null) { + httpParams = httpParams.append(key, value); + } else { + throw Error("key may not be null if value is not object or array"); + } + return httpParams; } /** * Retrieve the currently installed version of each Devolutions product. * Reads `update_status.json`, which is written by the Devolutions Agent on startup and refreshed after every update run. When the file does not exist (agent not installed or is an older version), the endpoint returns HTTP 503 because updater status is unavailable. - * @endpoint get /jet/update * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. - * @param options additional options */ public getUpdateProducts(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; public getUpdateProducts(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; @@ -56,19 +109,34 @@ export class UpdateService extends BaseService { let localVarHeaders = this.defaultHeaders; + let localVarCredential: string | undefined; // authentication (scope_token) required - localVarHeaders = this.configuration.addCredentialToHeaders('scope_token', 'Authorization', localVarHeaders, 'Bearer '); + localVarCredential = this.configuration.lookupCredential('scope_token'); + if (localVarCredential) { + localVarHeaders = localVarHeaders.set('Authorization', 'Bearer ' + localVarCredential); + } - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/json' + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } if (localVarHttpHeaderAcceptSelected !== undefined) { localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); } - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } - const localVarTransferCache: boolean = options?.transferCache ?? true; + let localVarTransferCache: boolean | undefined = options && options.transferCache; + if (localVarTransferCache === undefined) { + localVarTransferCache = true; + } let responseType_: 'text' | 'json' | 'blob' = 'json'; @@ -83,15 +151,14 @@ export class UpdateService extends BaseService { } let localVarPath = `/jet/update`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, + return this.httpClient.request('get', `${this.configuration.basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), + withCredentials: this.configuration.withCredentials, headers: localVarHeaders, observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + transferCache: localVarTransferCache, reportProgress: reportProgress } ); @@ -100,10 +167,8 @@ export class UpdateService extends BaseService { /** * Retrieve the current Devolutions Agent auto-update schedule. * Reads the `Schedule` field from `update_status.json`. When the field is absent the response contains zeroed defaults (`Enabled: false`, interval `0`, window start `0`, no products). - * @endpoint get /jet/update/schedule * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. - * @param options additional options */ public getUpdateSchedule(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; public getUpdateSchedule(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; @@ -112,19 +177,34 @@ export class UpdateService extends BaseService { let localVarHeaders = this.defaultHeaders; + let localVarCredential: string | undefined; // authentication (scope_token) required - localVarHeaders = this.configuration.addCredentialToHeaders('scope_token', 'Authorization', localVarHeaders, 'Bearer '); + localVarCredential = this.configuration.lookupCredential('scope_token'); + if (localVarCredential) { + localVarHeaders = localVarHeaders.set('Authorization', 'Bearer ' + localVarCredential); + } - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/json' + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } if (localVarHttpHeaderAcceptSelected !== undefined) { localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); } - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } - const localVarTransferCache: boolean = options?.transferCache ?? true; + let localVarTransferCache: boolean | undefined = options && options.transferCache; + if (localVarTransferCache === undefined) { + localVarTransferCache = true; + } let responseType_: 'text' | 'json' | 'blob' = 'json'; @@ -139,15 +219,14 @@ export class UpdateService extends BaseService { } let localVarPath = `/jet/update/schedule`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, + return this.httpClient.request('get', `${this.configuration.basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), + withCredentials: this.configuration.withCredentials, headers: localVarHeaders, observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + transferCache: localVarTransferCache, reportProgress: reportProgress } ); @@ -156,11 +235,9 @@ export class UpdateService extends BaseService { /** * Set the Devolutions Agent auto-update schedule. * Writes the `Schedule` field into `update.json`. The agent watches this file and applies the new schedule immediately, then persists it to `agent.json`. All other fields in `update.json` are preserved; the `VersionMinor` field is reset to the minor version this gateway build understands so the agent does not see an unknown future version. - * @endpoint post /jet/update/schedule * @param setUpdateScheduleRequest * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. - * @param options additional options */ public setUpdateSchedule(setUpdateScheduleRequest: SetUpdateScheduleRequest, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; public setUpdateSchedule(setUpdateScheduleRequest: SetUpdateScheduleRequest, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; @@ -172,19 +249,34 @@ export class UpdateService extends BaseService { let localVarHeaders = this.defaultHeaders; + let localVarCredential: string | undefined; // authentication (scope_token) required - localVarHeaders = this.configuration.addCredentialToHeaders('scope_token', 'Authorization', localVarHeaders, 'Bearer '); + localVarCredential = this.configuration.lookupCredential('scope_token'); + if (localVarCredential) { + localVarHeaders = localVarHeaders.set('Authorization', 'Bearer ' + localVarCredential); + } - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/json' + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } if (localVarHttpHeaderAcceptSelected !== undefined) { localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); } - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } - const localVarTransferCache: boolean = options?.transferCache ?? true; + let localVarTransferCache: boolean | undefined = options && options.transferCache; + if (localVarTransferCache === undefined) { + localVarTransferCache = true; + } // to determine the Content-Type header @@ -208,16 +300,15 @@ export class UpdateService extends BaseService { } let localVarPath = `/jet/update/schedule`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('post', `${basePath}${localVarPath}`, + return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, { context: localVarHttpContext, body: setUpdateScheduleRequest, responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), + withCredentials: this.configuration.withCredentials, headers: localVarHeaders, observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + transferCache: localVarTransferCache, reportProgress: reportProgress } ); @@ -226,44 +317,52 @@ export class UpdateService extends BaseService { /** * Trigger an update for one or more Devolutions products. * Writes the requested version(s) into `Agent/update.json`, which is watched by Devolutions Agent. When a requested version is higher than the installed version the agent proceeds with the update. **Body form** (preferred): pass a JSON body with a `Products` map. **Query-param form** (legacy, gateway-only): `POST /jet/update?version=latest`. This form updates only the Gateway product and is kept for backward compatibility. Both forms cannot be used simultaneously; doing so returns HTTP 400. - * @endpoint post /jet/update * @param version Gateway-only target version; use the request body for multi-product updates * @param updateRequestSchema Products and target versions to update * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. - * @param options additional options */ public triggerUpdate(version?: string, updateRequestSchema?: UpdateRequestSchema, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; public triggerUpdate(version?: string, updateRequestSchema?: UpdateRequestSchema, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; public triggerUpdate(version?: string, updateRequestSchema?: UpdateRequestSchema, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; public triggerUpdate(version?: string, updateRequestSchema?: UpdateRequestSchema, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - let localVarQueryParameters = new OpenApiHttpParams(this.encoder); - - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - 'version', - version, - QueryParamStyle.Form, - true, - ); - + let localVarQueryParameters = new HttpParams({encoder: this.encoder}); + if (version !== undefined && version !== null) { + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + version, 'version'); + } let localVarHeaders = this.defaultHeaders; + let localVarCredential: string | undefined; // authentication (scope_token) required - localVarHeaders = this.configuration.addCredentialToHeaders('scope_token', 'Authorization', localVarHeaders, 'Bearer '); + localVarCredential = this.configuration.lookupCredential('scope_token'); + if (localVarCredential) { + localVarHeaders = localVarHeaders.set('Authorization', 'Bearer ' + localVarCredential); + } - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/json' + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } if (localVarHttpHeaderAcceptSelected !== undefined) { localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); } - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } - const localVarTransferCache: boolean = options?.transferCache ?? true; + let localVarTransferCache: boolean | undefined = options && options.transferCache; + if (localVarTransferCache === undefined) { + localVarTransferCache = true; + } // to determine the Content-Type header @@ -287,17 +386,16 @@ export class UpdateService extends BaseService { } let localVarPath = `/jet/update`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('post', `${basePath}${localVarPath}`, + return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, { context: localVarHttpContext, body: updateRequestSchema, - params: localVarQueryParameters.toHttpParams(), + params: localVarQueryParameters, responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), + withCredentials: this.configuration.withCredentials, headers: localVarHeaders, observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + transferCache: localVarTransferCache, reportProgress: reportProgress } ); diff --git a/devolutions-gateway/openapi/ts-angular-client/api/webApp.service.ts b/devolutions-gateway/openapi/ts-angular-client/api/webApp.service.ts index 5f4e4c0e1..e4e8e9cfb 100644 --- a/devolutions-gateway/openapi/ts-angular-client/api/webApp.service.ts +++ b/devolutions-gateway/openapi/ts-angular-client/api/webApp.service.ts @@ -11,10 +11,10 @@ import { Inject, Injectable, Optional } from '@angular/core'; import { HttpClient, HttpHeaders, HttpParams, - HttpResponse, HttpEvent, HttpContext + HttpResponse, HttpEvent, HttpParameterCodec, HttpContext } from '@angular/common/http'; +import { CustomHttpParameterCodec } from '../encoder'; import { Observable } from 'rxjs'; -import { OpenApiHttpParams, QueryParamStyle } from '../query.params'; // @ts-ignore import { AppTokenSignRequest } from '../model/appTokenSignRequest'; @@ -24,26 +24,79 @@ import { SessionTokenSignRequest } from '../model/sessionTokenSignRequest'; // @ts-ignore import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; import { Configuration } from '../configuration'; -import { BaseService } from '../api.base.service'; @Injectable({ providedIn: 'root' }) -export class WebAppService extends BaseService { +export class WebAppService { - constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) { - super(basePath, configuration); + protected basePath = 'http://localhost'; + public defaultHeaders = new HttpHeaders(); + public configuration = new Configuration(); + public encoder: HttpParameterCodec; + + constructor(protected httpClient: HttpClient, @Optional()@Inject(BASE_PATH) basePath: string|string[], @Optional() configuration: Configuration) { + if (configuration) { + this.configuration = configuration; + } + if (typeof this.configuration.basePath !== 'string') { + const firstBasePath = Array.isArray(basePath) ? basePath[0] : undefined; + if (firstBasePath != undefined) { + basePath = firstBasePath; + } + + if (typeof basePath !== 'string') { + basePath = this.basePath; + } + this.configuration.basePath = basePath; + } + this.encoder = this.configuration.encoder || new CustomHttpParameterCodec(); + } + + + // @ts-ignore + private addToHttpParams(httpParams: HttpParams, value: any, key?: string): HttpParams { + if (typeof value === "object" && value instanceof Date === false) { + httpParams = this.addToHttpParamsRecursive(httpParams, value); + } else { + httpParams = this.addToHttpParamsRecursive(httpParams, value, key); + } + return httpParams; + } + + private addToHttpParamsRecursive(httpParams: HttpParams, value?: any, key?: string): HttpParams { + if (value == null) { + return httpParams; + } + + if (typeof value === "object") { + if (Array.isArray(value)) { + (value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); + } else if (value instanceof Date) { + if (key != null) { + httpParams = httpParams.append(key, (value as Date).toISOString().substring(0, 10)); + } else { + throw Error("key may not be null if value is Date"); + } + } else { + Object.keys(value).forEach( k => httpParams = this.addToHttpParamsRecursive( + httpParams, value[k], key != null ? `${key}.${k}` : k)); + } + } else if (key != null) { + httpParams = httpParams.append(key, value); + } else { + throw Error("key may not be null if value is not object or array"); + } + return httpParams; } /** * Requests a web application token using the configured authorization method - * @endpoint post /jet/webapp/app-token * @param appTokenSignRequest JSON-encoded payload specifying the desired claims * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. - * @param options additional options */ public signAppToken(appTokenSignRequest: AppTokenSignRequest, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'text/plain', context?: HttpContext, transferCache?: boolean}): Observable; public signAppToken(appTokenSignRequest: AppTokenSignRequest, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'text/plain', context?: HttpContext, transferCache?: boolean}): Observable>; @@ -55,19 +108,34 @@ export class WebAppService extends BaseService { let localVarHeaders = this.defaultHeaders; + let localVarCredential: string | undefined; // authentication (web_app_custom_auth) required - localVarHeaders = this.configuration.addCredentialToHeaders('web_app_custom_auth', 'Authorization', localVarHeaders, 'Basic '); + localVarCredential = this.configuration.lookupCredential('web_app_custom_auth'); + if (localVarCredential) { + localVarHeaders = localVarHeaders.set('Authorization', 'Basic ' + localVarCredential); + } - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'text/plain' - ]); + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'text/plain' + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } if (localVarHttpHeaderAcceptSelected !== undefined) { localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); } - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } - const localVarTransferCache: boolean = options?.transferCache ?? true; + let localVarTransferCache: boolean | undefined = options && options.transferCache; + if (localVarTransferCache === undefined) { + localVarTransferCache = true; + } // to determine the Content-Type header @@ -91,16 +159,15 @@ export class WebAppService extends BaseService { } let localVarPath = `/jet/webapp/app-token`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('post', `${basePath}${localVarPath}`, + return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, { context: localVarHttpContext, body: appTokenSignRequest, responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), + withCredentials: this.configuration.withCredentials, headers: localVarHeaders, observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + transferCache: localVarTransferCache, reportProgress: reportProgress } ); @@ -108,11 +175,9 @@ export class WebAppService extends BaseService { /** * Requests a session token using a web application token - * @endpoint post /jet/webapp/session-token * @param sessionTokenSignRequest JSON-encoded payload specifying the desired claims * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. - * @param options additional options */ public signSessionToken(sessionTokenSignRequest: SessionTokenSignRequest, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'text/plain', context?: HttpContext, transferCache?: boolean}): Observable; public signSessionToken(sessionTokenSignRequest: SessionTokenSignRequest, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'text/plain', context?: HttpContext, transferCache?: boolean}): Observable>; @@ -124,19 +189,34 @@ export class WebAppService extends BaseService { let localVarHeaders = this.defaultHeaders; + let localVarCredential: string | undefined; // authentication (web_app_token) required - localVarHeaders = this.configuration.addCredentialToHeaders('web_app_token', 'Authorization', localVarHeaders, 'Bearer '); + localVarCredential = this.configuration.lookupCredential('web_app_token'); + if (localVarCredential) { + localVarHeaders = localVarHeaders.set('Authorization', 'Bearer ' + localVarCredential); + } - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'text/plain' - ]); + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'text/plain' + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } if (localVarHttpHeaderAcceptSelected !== undefined) { localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); } - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } - const localVarTransferCache: boolean = options?.transferCache ?? true; + let localVarTransferCache: boolean | undefined = options && options.transferCache; + if (localVarTransferCache === undefined) { + localVarTransferCache = true; + } // to determine the Content-Type header @@ -160,16 +240,15 @@ export class WebAppService extends BaseService { } let localVarPath = `/jet/webapp/session-token`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('post', `${basePath}${localVarPath}`, + return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, { context: localVarHttpContext, body: sessionTokenSignRequest, responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), + withCredentials: this.configuration.withCredentials, headers: localVarHeaders, observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + transferCache: localVarTransferCache, reportProgress: reportProgress } ); diff --git a/devolutions-gateway/openapi/ts-angular-client/configuration.ts b/devolutions-gateway/openapi/ts-angular-client/configuration.ts index 9ad4f9376..174134f4b 100644 --- a/devolutions-gateway/openapi/ts-angular-client/configuration.ts +++ b/devolutions-gateway/openapi/ts-angular-client/configuration.ts @@ -1,6 +1,5 @@ -import { HttpHeaders, HttpParameterCodec } from '@angular/common/http'; +import { HttpParameterCodec } from '@angular/common/http'; import { Param } from './param'; -import { OpenApiHttpParams } from './query.params'; export interface ConfigurationParameters { /** @@ -67,30 +66,26 @@ export class Configuration { */ credentials: {[ key: string ]: string | (() => string | undefined)}; -constructor({ accessToken, apiKeys, basePath, credentials, encodeParam, encoder, password, username, withCredentials }: ConfigurationParameters = {}) { - if (apiKeys) { - this.apiKeys = apiKeys; + constructor(configurationParameters: ConfigurationParameters = {}) { + this.apiKeys = configurationParameters.apiKeys; + this.username = configurationParameters.username; + this.password = configurationParameters.password; + this.accessToken = configurationParameters.accessToken; + this.basePath = configurationParameters.basePath; + this.withCredentials = configurationParameters.withCredentials; + this.encoder = configurationParameters.encoder; + if (configurationParameters.encodeParam) { + this.encodeParam = configurationParameters.encodeParam; } - if (username !== undefined) { - this.username = username; + else { + this.encodeParam = param => this.defaultEncodeParam(param); } - if (password !== undefined) { - this.password = password; + if (configurationParameters.credentials) { + this.credentials = configurationParameters.credentials; } - if (accessToken !== undefined) { - this.accessToken = accessToken; + else { + this.credentials = {}; } - if (basePath !== undefined) { - this.basePath = basePath; - } - if (withCredentials !== undefined) { - this.withCredentials = withCredentials; - } - if (encoder) { - this.encoder = encoder; - } - this.encodeParam = encodeParam ?? (param => this.defaultEncodeParam(param)); - this.credentials = credentials ?? {}; // init default jrec_token credential if (!this.credentials['jrec_token']) { @@ -196,8 +191,8 @@ constructor({ accessToken, apiKeys, basePath, credentials, encodeParam, encoder, * @return True if the given MIME is JSON, false otherwise. */ public isJsonMime(mime: string): boolean { - const jsonMime: RegExp = /^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$/i; - return mime !== null && jsonMime.test(mime); + const jsonMime: RegExp = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i'); + return mime !== null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json'); } public lookupCredential(key: string): string | undefined { @@ -207,20 +202,6 @@ constructor({ accessToken, apiKeys, basePath, credentials, encodeParam, encoder, : value; } - public addCredentialToHeaders(credentialKey: string, headerName: string, headers: HttpHeaders, prefix?: string): HttpHeaders { - const value = this.lookupCredential(credentialKey); - return value - ? headers.set(headerName, (prefix ?? '') + value) - : headers; - } - - public addCredentialToQuery(credentialKey: string, paramName: string, query: OpenApiHttpParams): OpenApiHttpParams { - const value = this.lookupCredential(credentialKey); - return value - ? query.set(paramName, value) - : query; - } - private defaultEncodeParam(param: Param): string { // This implementation exists as fallback for missing configuration // and for backwards compatibility to older typescript-angular generator versions. diff --git a/devolutions-gateway/openapi/ts-angular-client/encoder.ts b/devolutions-gateway/openapi/ts-angular-client/encoder.ts index af4523543..138c4d5cf 100644 --- a/devolutions-gateway/openapi/ts-angular-client/encoder.ts +++ b/devolutions-gateway/openapi/ts-angular-client/encoder.ts @@ -18,18 +18,3 @@ export class CustomHttpParameterCodec implements HttpParameterCodec { return decodeURIComponent(v); } } - -export class IdentityHttpParameterCodec implements HttpParameterCodec { - encodeKey(k: string): string { - return k; - } - encodeValue(v: string): string { - return v; - } - decodeKey(k: string): string { - return k; - } - decodeValue(v: string): string { - return v; - } -} diff --git a/devolutions-gateway/openapi/ts-angular-client/index.ts b/devolutions-gateway/openapi/ts-angular-client/index.ts index 02cb7d437..104dd3d21 100644 --- a/devolutions-gateway/openapi/ts-angular-client/index.ts +++ b/devolutions-gateway/openapi/ts-angular-client/index.ts @@ -3,5 +3,4 @@ export * from './model/models'; export * from './variables'; export * from './configuration'; export * from './api.module'; -export * from './provide-api'; export * from './param'; diff --git a/devolutions-gateway/openapi/ts-angular-client/model/accessScope.ts b/devolutions-gateway/openapi/ts-angular-client/model/accessScope.ts index af8e57f58..0827c35b7 100644 --- a/devolutions-gateway/openapi/ts-angular-client/model/accessScope.ts +++ b/devolutions-gateway/openapi/ts-angular-client/model/accessScope.ts @@ -9,26 +9,27 @@ */ +export type AccessScope = '*' | 'gateway.sessions.read' | 'gateway.session.terminate' | 'gateway.associations.read' | 'gateway.diagnostics.read' | 'gateway.jrl.read' | 'gateway.config.write' | 'gateway.heartbeat.read' | 'gateway.recording.delete' | 'gateway.recordings.read' | 'gateway.update' | 'gateway.update.read' | 'gateway.preflight' | 'gateway.traffic.claim' | 'gateway.traffic.ack' | 'gateway.net.monitor.config' | 'gateway.net.monitor.drain' | 'gateway.agent.delete' | 'gateway.agent.read'; + export const AccessScope = { - Star: '*', - GatewaySessionsRead: 'gateway.sessions.read', - GatewaySessionTerminate: 'gateway.session.terminate', - GatewayAssociationsRead: 'gateway.associations.read', - GatewayDiagnosticsRead: 'gateway.diagnostics.read', - GatewayJrlRead: 'gateway.jrl.read', - GatewayConfigWrite: 'gateway.config.write', - GatewayHeartbeatRead: 'gateway.heartbeat.read', - GatewayRecordingDelete: 'gateway.recording.delete', - GatewayRecordingsRead: 'gateway.recordings.read', - GatewayUpdate: 'gateway.update', - GatewayUpdateRead: 'gateway.update.read', - GatewayPreflight: 'gateway.preflight', - GatewayTrafficClaim: 'gateway.traffic.claim', - GatewayTrafficAck: 'gateway.traffic.ack', - GatewayNetMonitorConfig: 'gateway.net.monitor.config', - GatewayNetMonitorDrain: 'gateway.net.monitor.drain', - GatewayAgentDelete: 'gateway.agent.delete', - GatewayAgentRead: 'gateway.agent.read' -} as const; -export type AccessScope = typeof AccessScope[keyof typeof AccessScope]; + Star: '*' as AccessScope, + GatewaySessionsRead: 'gateway.sessions.read' as AccessScope, + GatewaySessionTerminate: 'gateway.session.terminate' as AccessScope, + GatewayAssociationsRead: 'gateway.associations.read' as AccessScope, + GatewayDiagnosticsRead: 'gateway.diagnostics.read' as AccessScope, + GatewayJrlRead: 'gateway.jrl.read' as AccessScope, + GatewayConfigWrite: 'gateway.config.write' as AccessScope, + GatewayHeartbeatRead: 'gateway.heartbeat.read' as AccessScope, + GatewayRecordingDelete: 'gateway.recording.delete' as AccessScope, + GatewayRecordingsRead: 'gateway.recordings.read' as AccessScope, + GatewayUpdate: 'gateway.update' as AccessScope, + GatewayUpdateRead: 'gateway.update.read' as AccessScope, + GatewayPreflight: 'gateway.preflight' as AccessScope, + GatewayTrafficClaim: 'gateway.traffic.claim' as AccessScope, + GatewayTrafficAck: 'gateway.traffic.ack' as AccessScope, + GatewayNetMonitorConfig: 'gateway.net.monitor.config' as AccessScope, + GatewayNetMonitorDrain: 'gateway.net.monitor.drain' as AccessScope, + GatewayAgentDelete: 'gateway.agent.delete' as AccessScope, + GatewayAgentRead: 'gateway.agent.read' as AccessScope +}; diff --git a/devolutions-gateway/openapi/ts-angular-client/model/addressFamily.ts b/devolutions-gateway/openapi/ts-angular-client/model/addressFamily.ts index e732359a9..50244b33d 100644 --- a/devolutions-gateway/openapi/ts-angular-client/model/addressFamily.ts +++ b/devolutions-gateway/openapi/ts-angular-client/model/addressFamily.ts @@ -9,9 +9,10 @@ */ +export type AddressFamily = 'IPv4' | 'IPv6'; + export const AddressFamily = { - Ipv4: 'IPv4', - Ipv6: 'IPv6' -} as const; -export type AddressFamily = typeof AddressFamily[keyof typeof AddressFamily]; + Ipv4: 'IPv4' as AddressFamily, + Ipv6: 'IPv6' as AddressFamily +}; diff --git a/devolutions-gateway/openapi/ts-angular-client/model/appCredentialKind.ts b/devolutions-gateway/openapi/ts-angular-client/model/appCredentialKind.ts index 2a9ebd300..c572b3535 100644 --- a/devolutions-gateway/openapi/ts-angular-client/model/appCredentialKind.ts +++ b/devolutions-gateway/openapi/ts-angular-client/model/appCredentialKind.ts @@ -9,8 +9,9 @@ */ +export type AppCredentialKind = 'username-password'; + export const AppCredentialKind = { - UsernamePassword: 'username-password' -} as const; -export type AppCredentialKind = typeof AppCredentialKind[keyof typeof AppCredentialKind]; + UsernamePassword: 'username-password' as AppCredentialKind +}; diff --git a/devolutions-gateway/openapi/ts-angular-client/model/appTokenContentType.ts b/devolutions-gateway/openapi/ts-angular-client/model/appTokenContentType.ts index 3a35fc4d8..ebf1749b8 100644 --- a/devolutions-gateway/openapi/ts-angular-client/model/appTokenContentType.ts +++ b/devolutions-gateway/openapi/ts-angular-client/model/appTokenContentType.ts @@ -9,8 +9,9 @@ */ +export type AppTokenContentType = 'WEBAPP'; + export const AppTokenContentType = { - Webapp: 'WEBAPP' -} as const; -export type AppTokenContentType = typeof AppTokenContentType[keyof typeof AppTokenContentType]; + Webapp: 'WEBAPP' as AppTokenContentType +}; diff --git a/devolutions-gateway/openapi/ts-angular-client/model/connectionMode.ts b/devolutions-gateway/openapi/ts-angular-client/model/connectionMode.ts index 0072fe9de..b55dcd928 100644 --- a/devolutions-gateway/openapi/ts-angular-client/model/connectionMode.ts +++ b/devolutions-gateway/openapi/ts-angular-client/model/connectionMode.ts @@ -9,9 +9,10 @@ */ +export type ConnectionMode = 'rdv' | 'fwd'; + export const ConnectionMode = { - Rdv: 'rdv', - Fwd: 'fwd' -} as const; -export type ConnectionMode = typeof ConnectionMode[keyof typeof ConnectionMode]; + Rdv: 'rdv' as ConnectionMode, + Fwd: 'fwd' as ConnectionMode +}; diff --git a/devolutions-gateway/openapi/ts-angular-client/model/dataEncoding.ts b/devolutions-gateway/openapi/ts-angular-client/model/dataEncoding.ts index f8d924a5f..e8d17a401 100644 --- a/devolutions-gateway/openapi/ts-angular-client/model/dataEncoding.ts +++ b/devolutions-gateway/openapi/ts-angular-client/model/dataEncoding.ts @@ -9,12 +9,13 @@ */ +export type DataEncoding = 'Multibase' | 'Base64' | 'Base64Pad' | 'Base64Url' | 'Base64UrlPad'; + export const DataEncoding = { - Multibase: 'Multibase', - Base64: 'Base64', - Base64Pad: 'Base64Pad', - Base64Url: 'Base64Url', - Base64UrlPad: 'Base64UrlPad' -} as const; -export type DataEncoding = typeof DataEncoding[keyof typeof DataEncoding]; + Multibase: 'Multibase' as DataEncoding, + Base64: 'Base64' as DataEncoding, + Base64Pad: 'Base64Pad' as DataEncoding, + Base64Url: 'Base64Url' as DataEncoding, + Base64UrlPad: 'Base64UrlPad' as DataEncoding +}; diff --git a/devolutions-gateway/openapi/ts-angular-client/model/eventOutcomeResponse.ts b/devolutions-gateway/openapi/ts-angular-client/model/eventOutcomeResponse.ts index a78031aa6..e6b8b1d0d 100644 --- a/devolutions-gateway/openapi/ts-angular-client/model/eventOutcomeResponse.ts +++ b/devolutions-gateway/openapi/ts-angular-client/model/eventOutcomeResponse.ts @@ -9,10 +9,11 @@ */ +export type EventOutcomeResponse = 'connect_failure' | 'normal_termination' | 'abnormal_termination'; + export const EventOutcomeResponse = { - ConnectFailure: 'connect_failure', - NormalTermination: 'normal_termination', - AbnormalTermination: 'abnormal_termination' -} as const; -export type EventOutcomeResponse = typeof EventOutcomeResponse[keyof typeof EventOutcomeResponse]; + ConnectFailure: 'connect_failure' as EventOutcomeResponse, + NormalTermination: 'normal_termination' as EventOutcomeResponse, + AbnormalTermination: 'abnormal_termination' as EventOutcomeResponse +}; diff --git a/devolutions-gateway/openapi/ts-angular-client/model/hostScanStateDto.ts b/devolutions-gateway/openapi/ts-angular-client/model/hostScanStateDto.ts index 5a022bd8a..5e168fb29 100644 --- a/devolutions-gateway/openapi/ts-angular-client/model/hostScanStateDto.ts +++ b/devolutions-gateway/openapi/ts-angular-client/model/hostScanStateDto.ts @@ -9,11 +9,12 @@ */ +export type HostScanStateDto = 'queued' | 'probing' | 'reachable' | 'unreachable'; + export const HostScanStateDto = { - Queued: 'queued', - Probing: 'probing', - Reachable: 'reachable', - Unreachable: 'unreachable' -} as const; -export type HostScanStateDto = typeof HostScanStateDto[keyof typeof HostScanStateDto]; + Queued: 'queued' as HostScanStateDto, + Probing: 'probing' as HostScanStateDto, + Reachable: 'reachable' as HostScanStateDto, + Unreachable: 'unreachable' as HostScanStateDto +}; diff --git a/devolutions-gateway/openapi/ts-angular-client/model/networkScanResultKindDto.ts b/devolutions-gateway/openapi/ts-angular-client/model/networkScanResultKindDto.ts index eba40eac0..c81eecbf1 100644 --- a/devolutions-gateway/openapi/ts-angular-client/model/networkScanResultKindDto.ts +++ b/devolutions-gateway/openapi/ts-angular-client/model/networkScanResultKindDto.ts @@ -9,9 +9,10 @@ */ +export type NetworkScanResultKindDto = 'host' | 'service'; + export const NetworkScanResultKindDto = { - Host: 'host', - Service: 'service' -} as const; -export type NetworkScanResultKindDto = typeof NetworkScanResultKindDto[keyof typeof NetworkScanResultKindDto]; + Host: 'host' as NetworkScanResultKindDto, + Service: 'service' as NetworkScanResultKindDto +}; diff --git a/devolutions-gateway/openapi/ts-angular-client/model/preflightAlertStatus.ts b/devolutions-gateway/openapi/ts-angular-client/model/preflightAlertStatus.ts index 5e6241f46..04a315b83 100644 --- a/devolutions-gateway/openapi/ts-angular-client/model/preflightAlertStatus.ts +++ b/devolutions-gateway/openapi/ts-angular-client/model/preflightAlertStatus.ts @@ -9,15 +9,16 @@ */ +export type PreflightAlertStatus = 'general-failure' | 'info' | 'warn' | 'unsupported-operation' | 'invalid-parameters' | 'internal-server-error' | 'host-resolution-failure' | 'agent-version-lookup-failure'; + export const PreflightAlertStatus = { - GeneralFailure: 'general-failure', - Info: 'info', - Warn: 'warn', - UnsupportedOperation: 'unsupported-operation', - InvalidParameters: 'invalid-parameters', - InternalServerError: 'internal-server-error', - HostResolutionFailure: 'host-resolution-failure', - AgentVersionLookupFailure: 'agent-version-lookup-failure' -} as const; -export type PreflightAlertStatus = typeof PreflightAlertStatus[keyof typeof PreflightAlertStatus]; + GeneralFailure: 'general-failure' as PreflightAlertStatus, + Info: 'info' as PreflightAlertStatus, + Warn: 'warn' as PreflightAlertStatus, + UnsupportedOperation: 'unsupported-operation' as PreflightAlertStatus, + InvalidParameters: 'invalid-parameters' as PreflightAlertStatus, + InternalServerError: 'internal-server-error' as PreflightAlertStatus, + HostResolutionFailure: 'host-resolution-failure' as PreflightAlertStatus, + AgentVersionLookupFailure: 'agent-version-lookup-failure' as PreflightAlertStatus +}; diff --git a/devolutions-gateway/openapi/ts-angular-client/model/preflightOperationKind.ts b/devolutions-gateway/openapi/ts-angular-client/model/preflightOperationKind.ts index cb5cb3a33..235e78a37 100644 --- a/devolutions-gateway/openapi/ts-angular-client/model/preflightOperationKind.ts +++ b/devolutions-gateway/openapi/ts-angular-client/model/preflightOperationKind.ts @@ -9,14 +9,15 @@ */ +export type PreflightOperationKind = 'get-version' | 'get-agent-version' | 'get-running-session-count' | 'get-recording-storage-health' | 'provision-token' | 'provision-credentials' | 'resolve-host'; + export const PreflightOperationKind = { - GetVersion: 'get-version', - GetAgentVersion: 'get-agent-version', - GetRunningSessionCount: 'get-running-session-count', - GetRecordingStorageHealth: 'get-recording-storage-health', - ProvisionToken: 'provision-token', - ProvisionCredentials: 'provision-credentials', - ResolveHost: 'resolve-host' -} as const; -export type PreflightOperationKind = typeof PreflightOperationKind[keyof typeof PreflightOperationKind]; + GetVersion: 'get-version' as PreflightOperationKind, + GetAgentVersion: 'get-agent-version' as PreflightOperationKind, + GetRunningSessionCount: 'get-running-session-count' as PreflightOperationKind, + GetRecordingStorageHealth: 'get-recording-storage-health' as PreflightOperationKind, + ProvisionToken: 'provision-token' as PreflightOperationKind, + ProvisionCredentials: 'provision-credentials' as PreflightOperationKind, + ResolveHost: 'resolve-host' as PreflightOperationKind +}; diff --git a/devolutions-gateway/openapi/ts-angular-client/model/preflightOutputKind.ts b/devolutions-gateway/openapi/ts-angular-client/model/preflightOutputKind.ts index cd5c16ca8..30da6d05e 100644 --- a/devolutions-gateway/openapi/ts-angular-client/model/preflightOutputKind.ts +++ b/devolutions-gateway/openapi/ts-angular-client/model/preflightOutputKind.ts @@ -9,13 +9,14 @@ */ +export type PreflightOutputKind = 'version' | 'agent-version' | 'running-session-count' | 'recording-storage-health' | 'resolved-host' | 'alert'; + export const PreflightOutputKind = { - Version: 'version', - AgentVersion: 'agent-version', - RunningSessionCount: 'running-session-count', - RecordingStorageHealth: 'recording-storage-health', - ResolvedHost: 'resolved-host', - Alert: 'alert' -} as const; -export type PreflightOutputKind = typeof PreflightOutputKind[keyof typeof PreflightOutputKind]; + Version: 'version' as PreflightOutputKind, + AgentVersion: 'agent-version' as PreflightOutputKind, + RunningSessionCount: 'running-session-count' as PreflightOutputKind, + RecordingStorageHealth: 'recording-storage-health' as PreflightOutputKind, + ResolvedHost: 'resolved-host' as PreflightOutputKind, + Alert: 'alert' as PreflightOutputKind +}; diff --git a/devolutions-gateway/openapi/ts-angular-client/model/pubKeyFormat.ts b/devolutions-gateway/openapi/ts-angular-client/model/pubKeyFormat.ts index 75cd284af..71dcbf3fd 100644 --- a/devolutions-gateway/openapi/ts-angular-client/model/pubKeyFormat.ts +++ b/devolutions-gateway/openapi/ts-angular-client/model/pubKeyFormat.ts @@ -9,9 +9,10 @@ */ +export type PubKeyFormat = 'Spki' | 'Pkcs1'; + export const PubKeyFormat = { - Spki: 'Spki', - Pkcs1: 'Pkcs1' -} as const; -export type PubKeyFormat = typeof PubKeyFormat[keyof typeof PubKeyFormat]; + Spki: 'Spki' as PubKeyFormat, + Pkcs1: 'Pkcs1' as PubKeyFormat +}; diff --git a/devolutions-gateway/openapi/ts-angular-client/model/scanOriginDto.ts b/devolutions-gateway/openapi/ts-angular-client/model/scanOriginDto.ts index 48293cb19..79b6b8d4c 100644 --- a/devolutions-gateway/openapi/ts-angular-client/model/scanOriginDto.ts +++ b/devolutions-gateway/openapi/ts-angular-client/model/scanOriginDto.ts @@ -9,8 +9,9 @@ */ +export type ScanOriginDto = 'gateway'; + export const ScanOriginDto = { - Gateway: 'gateway' -} as const; -export type ScanOriginDto = typeof ScanOriginDto[keyof typeof ScanOriginDto]; + Gateway: 'gateway' as ScanOriginDto +}; diff --git a/devolutions-gateway/openapi/ts-angular-client/model/scanResultSourceDto.ts b/devolutions-gateway/openapi/ts-angular-client/model/scanResultSourceDto.ts index ef35e851a..420ce5f56 100644 --- a/devolutions-gateway/openapi/ts-angular-client/model/scanResultSourceDto.ts +++ b/devolutions-gateway/openapi/ts-angular-client/model/scanResultSourceDto.ts @@ -9,12 +9,13 @@ */ +export type ScanResultSourceDto = 'subnet' | 'broadcast' | 'tcp_probe' | 'gateway' | 'zero_conf'; + export const ScanResultSourceDto = { - Subnet: 'subnet', - Broadcast: 'broadcast', - TcpProbe: 'tcp_probe', - Gateway: 'gateway', - ZeroConf: 'zero_conf' -} as const; -export type ScanResultSourceDto = typeof ScanResultSourceDto[keyof typeof ScanResultSourceDto]; + Subnet: 'subnet' as ScanResultSourceDto, + Broadcast: 'broadcast' as ScanResultSourceDto, + TcpProbe: 'tcp_probe' as ScanResultSourceDto, + Gateway: 'gateway' as ScanResultSourceDto, + ZeroConf: 'zero_conf' as ScanResultSourceDto +}; diff --git a/devolutions-gateway/openapi/ts-angular-client/model/sessionTokenContentType.ts b/devolutions-gateway/openapi/ts-angular-client/model/sessionTokenContentType.ts index 87aa970f8..d430214a6 100644 --- a/devolutions-gateway/openapi/ts-angular-client/model/sessionTokenContentType.ts +++ b/devolutions-gateway/openapi/ts-angular-client/model/sessionTokenContentType.ts @@ -9,10 +9,11 @@ */ +export type SessionTokenContentType = 'ASSOCIATION' | 'JMUX' | 'KDC'; + export const SessionTokenContentType = { - Association: 'ASSOCIATION', - Jmux: 'JMUX', - Kdc: 'KDC' -} as const; -export type SessionTokenContentType = typeof SessionTokenContentType[keyof typeof SessionTokenContentType]; + Association: 'ASSOCIATION' as SessionTokenContentType, + Jmux: 'JMUX' as SessionTokenContentType, + Kdc: 'KDC' as SessionTokenContentType +}; diff --git a/devolutions-gateway/openapi/ts-angular-client/model/transportProtocolResponse.ts b/devolutions-gateway/openapi/ts-angular-client/model/transportProtocolResponse.ts index ee91750b9..f4945fffb 100644 --- a/devolutions-gateway/openapi/ts-angular-client/model/transportProtocolResponse.ts +++ b/devolutions-gateway/openapi/ts-angular-client/model/transportProtocolResponse.ts @@ -9,9 +9,10 @@ */ +export type TransportProtocolResponse = 'tcp' | 'udp'; + export const TransportProtocolResponse = { - Tcp: 'tcp', - Udp: 'udp' -} as const; -export type TransportProtocolResponse = typeof TransportProtocolResponse[keyof typeof TransportProtocolResponse]; + Tcp: 'tcp' as TransportProtocolResponse, + Udp: 'udp' as TransportProtocolResponse +}; diff --git a/devolutions-gateway/openapi/ts-angular-client/package.json b/devolutions-gateway/openapi/ts-angular-client/package.json index 237da7890..92749fbfe 100644 --- a/devolutions-gateway/openapi/ts-angular-client/package.json +++ b/devolutions-gateway/openapi/ts-angular-client/package.json @@ -16,18 +16,18 @@ "build": "ng-packagr -p ng-package.json" }, "peerDependencies": { - "@angular/core": "^21.0.0", + "@angular/core": "^18.0.0", "rxjs": "^7.4.0" }, "devDependencies": { - "@angular/common": "^21.0.0", - "@angular/compiler": "^21.0.0", - "@angular/compiler-cli": "^21.0.0", - "@angular/core": "^21.0.0", - "@angular/platform-browser": "^21.0.0", - "ng-packagr": "^21.0.0", + "@angular/common": "^18.0.0", + "@angular/compiler": "^18.0.0", + "@angular/compiler-cli": "^18.0.0", + "@angular/core": "^18.0.0", + "@angular/platform-browser": "^18.0.0", + "ng-packagr": "^18.0.0", "reflect-metadata": "^0.1.3", "rxjs": "^7.4.0", - "typescript": ">=5.9.0 <6.0.0", - "zone.js": "^0.15.0" + "typescript": ">=5.4.0 <5.5.0", + "zone.js": "^0.14.7" }} diff --git a/devolutions-gateway/openapi/ts-angular-client/provide-api.ts b/devolutions-gateway/openapi/ts-angular-client/provide-api.ts deleted file mode 100644 index 19c762acd..000000000 --- a/devolutions-gateway/openapi/ts-angular-client/provide-api.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { EnvironmentProviders, makeEnvironmentProviders } from "@angular/core"; -import { Configuration, ConfigurationParameters } from './configuration'; -import { BASE_PATH } from './variables'; - -// Returns the service class providers, to be used in the [ApplicationConfig](https://angular.dev/api/core/ApplicationConfig). -export function provideApi(configOrBasePath: string | ConfigurationParameters): EnvironmentProviders { - return makeEnvironmentProviders([ - typeof configOrBasePath === "string" - ? { provide: BASE_PATH, useValue: configOrBasePath } - : { - provide: Configuration, - useValue: new Configuration({ ...configOrBasePath }), - }, - ]); -} \ No newline at end of file diff --git a/devolutions-gateway/openapi/ts-angular-client/query.params.ts b/devolutions-gateway/openapi/ts-angular-client/query.params.ts deleted file mode 100644 index 4076c1140..000000000 --- a/devolutions-gateway/openapi/ts-angular-client/query.params.ts +++ /dev/null @@ -1,160 +0,0 @@ -import { HttpParams, HttpParameterCodec } from '@angular/common/http'; -import { CustomHttpParameterCodec, IdentityHttpParameterCodec } from './encoder'; - -export enum QueryParamStyle { - Json, - Form, - DeepObject, - SpaceDelimited, - PipeDelimited, -} - -export type Delimiter = "," | " " | "|" | "\t"; - -export interface ParamOptions { - /** When true, serialized as multiple repeated key=value pairs. When false, serialized as a single key with joined values using `delimiter`. */ - explode?: boolean; - /** Delimiter used when explode=false. The delimiter itself is inserted unencoded between encoded values. */ - delimiter?: Delimiter; -} - -interface ParamEntry { - values: string[]; - options: Required; -} - -export class OpenApiHttpParams { - private params: Map = new Map(); - private defaults: Required; - private encoder: HttpParameterCodec; - - /** - * @param encoder Parameter serializer - * @param defaults Global defaults used when a specific parameter has no explicit options. - * By OpenAPI default, explode is true for query params with style=form. - */ - constructor(encoder?: HttpParameterCodec, defaults?: { explode?: boolean; delimiter?: Delimiter }) { - this.encoder = encoder || new CustomHttpParameterCodec(); - this.defaults = { - explode: defaults?.explode ?? true, - delimiter: defaults?.delimiter ?? ",", - }; - } - - private resolveOptions(local?: ParamOptions): Required { - return { - explode: local?.explode ?? this.defaults.explode, - delimiter: local?.delimiter ?? this.defaults.delimiter, - }; - } - - /** - * Replace the parameter's values and (optionally) its options. - * Options are stored per-parameter (not global). - */ - set(key: string, values: string[] | string, options?: ParamOptions): this { - const arr = Array.isArray(values) ? values.slice() : [values]; - const opts = this.resolveOptions(options); - this.params.set(key, {values: arr, options: opts}); - return this; - } - - /** - * Append a single value to the parameter. If the parameter didn't exist it will be created - * and use resolved options (global defaults merged with any provided options). - */ - append(key: string, value: string, options?: ParamOptions): this { - const entry = this.params.get(key); - if (entry) { - // If new options provided, override the stored options for subsequent serialization - if (options) { - entry.options = this.resolveOptions({...entry.options, ...options}); - } - entry.values.push(value); - } else { - this.set(key, [value], options); - } - return this; - } - - /** - * Serialize to a query string according to per-parameter OpenAPI options. - * - If explode=true for that parameter → repeated key=value pairs (each value encoded). - * - If explode=false for that parameter → single key=value where values are individually encoded - * and joined using the configured delimiter. The delimiter character is inserted AS-IS - * (not percent-encoded). - */ - toString(): string { - const records = this.toRecord(); - const parts: string[] = []; - - for (const key in records) { - parts.push(`${key}=${records[key]}`); - } - - return parts.join("&"); - } - - /** - * Return parameters as a plain record. - * - If a parameter has exactly one value, returns that value directly. - * - If a parameter has multiple values, returns a readonly array of values. - */ - toRecord(): Record> { - const parts: Record> = {}; - - for (const [key, entry] of this.params.entries()) { - const encodedKey = this.encoder.encodeKey(key); - - if (entry.options.explode) { - parts[encodedKey] = entry.values.map((v) => this.encoder.encodeValue(v)); - } else { - const encodedValues = entry.values.map((v) => this.encoder.encodeValue(v)); - - // join with the delimiter *unencoded* - parts[encodedKey] = encodedValues.join(entry.options.delimiter); - } - } - - return parts; - } - - /** - * Return an Angular's HttpParams with an identity parameter codec as the parameters are already encoded. - */ - toHttpParams(): HttpParams { - const records = this.toRecord(); - - let httpParams = new HttpParams({encoder: new IdentityHttpParameterCodec()}); - - return httpParams.appendAll(records); - } -} - -export function concatHttpParamsObject(httpParams: OpenApiHttpParams, key: string, item: { - [index: string]: any -}, delimiter: Delimiter): OpenApiHttpParams { - let keyAndValues: string[] = []; - - for (const k in item) { - keyAndValues.push(k); - - const value = item[k]; - - if (Array.isArray(value)) { - keyAndValues.push(...value.map(convertToString)); - } else { - keyAndValues.push(convertToString(value)); - } - } - - return httpParams.set(key, keyAndValues, {explode: false, delimiter: delimiter}); -} - -function convertToString(value: any): string { - if (value instanceof Date) { - return value.toISOString(); - } else { - return value.toString(); - } -} diff --git a/devolutions-gateway/openapi/ts-angular-client/tsconfig.json b/devolutions-gateway/openapi/ts-angular-client/tsconfig.json index eb405ea0e..89cdedb1c 100644 --- a/devolutions-gateway/openapi/ts-angular-client/tsconfig.json +++ b/devolutions-gateway/openapi/ts-angular-client/tsconfig.json @@ -5,11 +5,8 @@ "noImplicitAny": false, "target": "es5", "module": "commonjs", - "downlevelIteration": true, "moduleResolution": "node", "removeComments": true, - "strictNullChecks": true, - "exactOptionalPropertyTypes": true, "sourceMap": true, "outDir": "./dist", "noLib": false, diff --git a/openapitools.json b/openapitools.json deleted file mode 100644 index 936223a5d..000000000 --- a/openapitools.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "$schema": "./node_modules/@openapitools/openapi-generator-cli/config.schema.json", - "spaces": 2, - "generator-cli": { - "version": "7.24.0" - } -}