From f44d38f434a580e2b20ed7ecbf53bd78dfafd65d Mon Sep 17 00:00:00 2001 From: Mewmba <115157536+mewmba@users.noreply.github.com> Date: Fri, 5 Jul 2024 09:01:22 -0700 Subject: [PATCH] Update Connect Swagger (#1706) Co-authored-by: geel9 Co-authored-by: mewmba --- connect/dart/.openapi-generator/FILES | 3 - connect/dart/README.md | 3 +- connect/dart/doc/ListSessionsRequest.md | 18 -- connect/dart/doc/SessionsApi.md | 20 +- connect/dart/lib/api.dart | 1 - connect/dart/lib/api/sessions_api.dart | 79 +++++--- connect/dart/lib/api_client.dart | 2 - .../dart/lib/model/list_sessions_request.dart | 185 ------------------ .../dart/test/list_sessions_request_test.dart | 39 ---- connect/dart/test/sessions_api_test.dart | 4 +- connect/dotnet/.openapi-generator/FILES | 3 - connect/dotnet/README.md | 3 +- connect/dotnet/api/openapi.yaml | 88 ++++----- connect/dotnet/docs/ListSessionsRequest.md | 13 -- connect/dotnet/docs/SessionsApi.md | 26 ++- .../Api/SessionsApiTests.cs | 9 +- .../Model/ListSessionsRequestTests.cs | 83 -------- .../src/Trinsic.Connect/Api/SessionsApi.cs | 163 ++++++++++----- .../Model/ListSessionsRequest.cs | 84 -------- connect/swagger_api.json | 110 +++++------ connect/typescript/.openapi-generator/FILES | 1 - connect/typescript/src/apis/SessionsApi.ts | 62 ++++-- .../typescript/src/models/IDVSessionState.ts | 3 +- .../src/models/ListSessionsRequest.ts | 107 ---------- .../typescript/src/models/OrderDirection.ts | 5 +- .../typescript/src/models/SessionFailCode.ts | 3 +- .../typescript/src/models/SessionOrdering.ts | 3 +- .../src/models/VerificationFailCode.ts | 4 +- .../src/models/VerificationState.ts | 5 +- connect/typescript/src/models/index.ts | 1 - 30 files changed, 341 insertions(+), 789 deletions(-) delete mode 100644 connect/dart/doc/ListSessionsRequest.md delete mode 100644 connect/dart/lib/model/list_sessions_request.dart delete mode 100644 connect/dart/test/list_sessions_request_test.dart delete mode 100644 connect/dotnet/docs/ListSessionsRequest.md delete mode 100644 connect/dotnet/src/Trinsic.Connect.Test/Model/ListSessionsRequestTests.cs delete mode 100644 connect/dotnet/src/Trinsic.Connect/Model/ListSessionsRequest.cs delete mode 100644 connect/typescript/src/models/ListSessionsRequest.ts diff --git a/connect/dart/.openapi-generator/FILES b/connect/dart/.openapi-generator/FILES index 640c53d82..d53a726b3 100644 --- a/connect/dart/.openapi-generator/FILES +++ b/connect/dart/.openapi-generator/FILES @@ -11,7 +11,6 @@ doc/GetSessionResponseV1.md doc/GovernmentIDOptions.md doc/GovernmentIDOptionsRequest.md doc/IDVSessionState.md -doc/ListSessionsRequest.md doc/ListSessionsResponse.md doc/NormalizedIdentityData.md doc/OrderDirection.md @@ -42,7 +41,6 @@ lib/model/get_session_response_v1.dart lib/model/government_id_options.dart lib/model/government_id_options_request.dart lib/model/idv_session_state.dart -lib/model/list_sessions_request.dart lib/model/list_sessions_response.dart lib/model/normalized_identity_data.dart lib/model/order_direction.dart @@ -62,7 +60,6 @@ test/get_session_response_v1_test.dart test/government_id_options_request_test.dart test/government_id_options_test.dart test/idv_session_state_test.dart -test/list_sessions_request_test.dart test/list_sessions_response_test.dart test/normalized_identity_data_test.dart test/order_direction_test.dart diff --git a/connect/dart/README.md b/connect/dart/README.md index a9b9d7273..810f89d5d 100644 --- a/connect/dart/README.md +++ b/connect/dart/README.md @@ -69,7 +69,7 @@ Class | Method | HTTP request | Description *SessionsApi* | [**createSession**](doc//SessionsApi.md#createsession) | **POST** /api/v1/sessions | *SessionsApi* | [**getSession**](doc//SessionsApi.md#getsession) | **GET** /api/v1/sessions/{sessionId} | *SessionsApi* | [**listSessions**](doc//SessionsApi.md#listsessions) | **GET** /api/v1/sessions | -*SessionsApi* | [**redactSession**](doc//SessionsApi.md#redactsession) | **POST** /api/v1/sessions/redact | +*SessionsApi* | [**redactSession**](doc//SessionsApi.md#redactsession) | **POST** /api/v1/sessions/{sessionId}/redact | ## Documentation For Models @@ -82,7 +82,6 @@ Class | Method | HTTP request | Description - [GovernmentIDOptions](doc//GovernmentIDOptions.md) - [GovernmentIDOptionsRequest](doc//GovernmentIDOptionsRequest.md) - [IDVSessionState](doc//IDVSessionState.md) - - [ListSessionsRequest](doc//ListSessionsRequest.md) - [ListSessionsResponse](doc//ListSessionsResponse.md) - [NormalizedIdentityData](doc//NormalizedIdentityData.md) - [OrderDirection](doc//OrderDirection.md) diff --git a/connect/dart/doc/ListSessionsRequest.md b/connect/dart/doc/ListSessionsRequest.md deleted file mode 100644 index 605dd7309..000000000 --- a/connect/dart/doc/ListSessionsRequest.md +++ /dev/null @@ -1,18 +0,0 @@ -# TrinsicConnect.model.ListSessionsRequest - -## Load the model package -```dart -import 'package:TrinsicConnect/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**orderBy** | [**SessionOrdering**](SessionOrdering.md) | | [optional] -**orderDirection** | [**OrderDirection**](OrderDirection.md) | | [optional] -**pageSize** | **int** | | [optional] -**page** | **int** | | [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/connect/dart/doc/SessionsApi.md b/connect/dart/doc/SessionsApi.md index eb768e6f5..32afd9ebf 100644 --- a/connect/dart/doc/SessionsApi.md +++ b/connect/dart/doc/SessionsApi.md @@ -13,7 +13,7 @@ Method | HTTP request | Description [**createSession**](SessionsApi.md#createsession) | **POST** /api/v1/sessions | [**getSession**](SessionsApi.md#getsession) | **GET** /api/v1/sessions/{sessionId} | [**listSessions**](SessionsApi.md#listsessions) | **GET** /api/v1/sessions | -[**redactSession**](SessionsApi.md#redactsession) | **POST** /api/v1/sessions/redact | +[**redactSession**](SessionsApi.md#redactsession) | **POST** /api/v1/sessions/{sessionId}/redact | # **cancelSession** @@ -158,7 +158,7 @@ Name | Type | Description | Notes [[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) # **listSessions** -> ListSessionsResponse listSessions(listSessionsRequest) +> ListSessionsResponse listSessions(orderBy, orderDirection, pageSize, page) @@ -173,10 +173,13 @@ import 'package:TrinsicConnect/api.dart'; //defaultApiClient.getAuthentication('Bearer').setAccessToken(yourTokenGeneratorFunction); final api_instance = SessionsApi(); -final listSessionsRequest = ListSessionsRequest(); // ListSessionsRequest | +final orderBy = ; // SessionOrdering | +final orderDirection = ; // OrderDirection | +final pageSize = 56; // int | +final page = 56; // int | try { - final result = api_instance.listSessions(listSessionsRequest); + final result = api_instance.listSessions(orderBy, orderDirection, pageSize, page); print(result); } catch (e) { print('Exception when calling SessionsApi->listSessions: $e\n'); @@ -187,7 +190,10 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **listSessionsRequest** | [**ListSessionsRequest**](ListSessionsRequest.md)| | [optional] + **orderBy** | [**SessionOrdering**](.md)| | [optional] + **orderDirection** | [**OrderDirection**](.md)| | [optional] + **pageSize** | **int**| | [optional] + **page** | **int**| | [optional] ### Return type @@ -199,7 +205,7 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json, text/json, application/*+json + - **Content-Type**: Not defined - **Accept**: text/plain, application/json, text/json [[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) @@ -233,7 +239,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **sessionId** | **String**| | [optional] + **sessionId** | **String**| | ### Return type diff --git a/connect/dart/lib/api.dart b/connect/dart/lib/api.dart index 7165f7d8f..a6af1be90 100644 --- a/connect/dart/lib/api.dart +++ b/connect/dart/lib/api.dart @@ -38,7 +38,6 @@ part 'model/get_session_response_v1.dart'; part 'model/government_id_options.dart'; part 'model/government_id_options_request.dart'; part 'model/idv_session_state.dart'; -part 'model/list_sessions_request.dart'; part 'model/list_sessions_response.dart'; part 'model/normalized_identity_data.dart'; part 'model/order_direction.dart'; diff --git a/connect/dart/lib/api/sessions_api.dart b/connect/dart/lib/api/sessions_api.dart index a11570275..6a463f712 100644 --- a/connect/dart/lib/api/sessions_api.dart +++ b/connect/dart/lib/api/sessions_api.dart @@ -190,25 +190,43 @@ class SessionsApi { /// Performs an HTTP 'GET /api/v1/sessions' operation and returns the [Response]. /// Parameters: /// - /// * [ListSessionsRequest] listSessionsRequest: + /// * [SessionOrdering] orderBy: + /// + /// * [OrderDirection] orderDirection: + /// + /// * [int] pageSize: + /// + /// * [int] page: Future listSessionsWithHttpInfo({ - ListSessionsRequest? listSessionsRequest, + SessionOrdering? orderBy, + OrderDirection? orderDirection, + int? pageSize, + int? page, }) async { // ignore: prefer_const_declarations final path = r'/api/v1/sessions'; // ignore: prefer_final_locals - Object? postBody = listSessionsRequest; + Object? postBody; final queryParams = []; final headerParams = {}; final formParams = {}; - const contentTypes = [ - 'application/json', - 'text/json', - 'application/*+json' - ]; + if (orderBy != null) { + queryParams.addAll(_queryParams('', 'OrderBy', orderBy)); + } + if (orderDirection != null) { + queryParams.addAll(_queryParams('', 'OrderDirection', orderDirection)); + } + if (pageSize != null) { + queryParams.addAll(_queryParams('', 'PageSize', pageSize)); + } + if (page != null) { + queryParams.addAll(_queryParams('', 'Page', page)); + } + + const contentTypes = []; return apiClient.invokeAPI( path, @@ -223,12 +241,24 @@ class SessionsApi { /// Parameters: /// - /// * [ListSessionsRequest] listSessionsRequest: + /// * [SessionOrdering] orderBy: + /// + /// * [OrderDirection] orderDirection: + /// + /// * [int] pageSize: + /// + /// * [int] page: Future listSessions({ - ListSessionsRequest? listSessionsRequest, + SessionOrdering? orderBy, + OrderDirection? orderDirection, + int? pageSize, + int? page, }) async { final response = await listSessionsWithHttpInfo( - listSessionsRequest: listSessionsRequest, + orderBy: orderBy, + orderDirection: orderDirection, + pageSize: pageSize, + page: page, ); if (response.statusCode >= HttpStatus.badRequest) { throw ApiException(response.statusCode, await _decodeBodyBytes(response)); @@ -246,15 +276,16 @@ class SessionsApi { return null; } - /// Performs an HTTP 'POST /api/v1/sessions/redact' operation and returns the [Response]. + /// Performs an HTTP 'POST /api/v1/sessions/{sessionId}/redact' operation and returns the [Response]. /// Parameters: /// - /// * [String] sessionId: - Future redactSessionWithHttpInfo({ - String? sessionId, - }) async { + /// * [String] sessionId (required): + Future redactSessionWithHttpInfo( + String sessionId, + ) async { // ignore: prefer_const_declarations - final path = r'/api/v1/sessions/redact'; + final path = r'/api/v1/sessions/{sessionId}/redact' + .replaceAll('{sessionId}', sessionId); // ignore: prefer_final_locals Object? postBody; @@ -263,10 +294,6 @@ class SessionsApi { final headerParams = {}; final formParams = {}; - if (sessionId != null) { - queryParams.addAll(_queryParams('', 'sessionId', sessionId)); - } - const contentTypes = []; return apiClient.invokeAPI( @@ -282,12 +309,12 @@ class SessionsApi { /// Parameters: /// - /// * [String] sessionId: - Future redactSession({ - String? sessionId, - }) async { + /// * [String] sessionId (required): + Future redactSession( + String sessionId, + ) async { final response = await redactSessionWithHttpInfo( - sessionId: sessionId, + sessionId, ); if (response.statusCode >= HttpStatus.badRequest) { throw ApiException(response.statusCode, await _decodeBodyBytes(response)); diff --git a/connect/dart/lib/api_client.dart b/connect/dart/lib/api_client.dart index f16a86928..5a71b32a0 100644 --- a/connect/dart/lib/api_client.dart +++ b/connect/dart/lib/api_client.dart @@ -245,8 +245,6 @@ class ApiClient { return GovernmentIDOptionsRequest.fromJson(value); case 'IDVSessionState': return IDVSessionStateTypeTransformer().decode(value); - case 'ListSessionsRequest': - return ListSessionsRequest.fromJson(value); case 'ListSessionsResponse': return ListSessionsResponse.fromJson(value); case 'NormalizedIdentityData': diff --git a/connect/dart/lib/model/list_sessions_request.dart b/connect/dart/lib/model/list_sessions_request.dart deleted file mode 100644 index 8e9450cd8..000000000 --- a/connect/dart/lib/model/list_sessions_request.dart +++ /dev/null @@ -1,185 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// -// @dart=2.18 - -// ignore_for_file: unused_element, unused_import -// ignore_for_file: always_put_required_named_parameters_first -// ignore_for_file: constant_identifier_names -// ignore_for_file: lines_longer_than_80_chars - -part of openapi.api; - -class ListSessionsRequest { - /// Returns a new [ListSessionsRequest] instance. - ListSessionsRequest({ - this.orderBy, - this.orderDirection, - this.pageSize, - this.page, - }); - - /// - /// Please note: This property should have been non-nullable! Since the specification file - /// does not include a default value (using the "default:" property), however, the generated - /// source code must fall back to having a nullable type. - /// Consider adding a "default:" property in the specification file to hide this note. - /// - SessionOrdering? orderBy; - - /// - /// Please note: This property should have been non-nullable! Since the specification file - /// does not include a default value (using the "default:" property), however, the generated - /// source code must fall back to having a nullable type. - /// Consider adding a "default:" property in the specification file to hide this note. - /// - OrderDirection? orderDirection; - - /// Minimum value: 1 - /// Maximum value: 10 - /// - /// Please note: This property should have been non-nullable! Since the specification file - /// does not include a default value (using the "default:" property), however, the generated - /// source code must fall back to having a nullable type. - /// Consider adding a "default:" property in the specification file to hide this note. - /// - int? pageSize; - - /// Minimum value: 1 - /// Maximum value: 2147483647 - /// - /// Please note: This property should have been non-nullable! Since the specification file - /// does not include a default value (using the "default:" property), however, the generated - /// source code must fall back to having a nullable type. - /// Consider adding a "default:" property in the specification file to hide this note. - /// - int? page; - - @override - bool operator ==(Object other) => - identical(this, other) || - other is ListSessionsRequest && - other.orderBy == orderBy && - other.orderDirection == orderDirection && - other.pageSize == pageSize && - other.page == page; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (orderBy == null ? 0 : orderBy!.hashCode) + - (orderDirection == null ? 0 : orderDirection!.hashCode) + - (pageSize == null ? 0 : pageSize!.hashCode) + - (page == null ? 0 : page!.hashCode); - - @override - String toString() => - 'ListSessionsRequest[orderBy=$orderBy, orderDirection=$orderDirection, pageSize=$pageSize, page=$page]'; - - Map toJson() { - final json = {}; - if (this.orderBy != null) { - json[r'orderBy'] = this.orderBy; - } else { - json[r'orderBy'] = null; - } - if (this.orderDirection != null) { - json[r'orderDirection'] = this.orderDirection; - } else { - json[r'orderDirection'] = null; - } - if (this.pageSize != null) { - json[r'pageSize'] = this.pageSize; - } else { - json[r'pageSize'] = null; - } - if (this.page != null) { - json[r'page'] = this.page; - } else { - json[r'page'] = null; - } - return json; - } - - /// Returns a new [ListSessionsRequest] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static ListSessionsRequest? fromJson(dynamic value) { - if (value is Map) { - final json = value.cast(); - - // Ensure that the map contains the required keys. - // Note 1: the values aren't checked for validity beyond being non-null. - // Note 2: this code is stripped in release mode! - assert(() { - requiredKeys.forEach((key) { - assert(json.containsKey(key), - 'Required key "ListSessionsRequest[$key]" is missing from JSON.'); - assert(json[key] != null, - 'Required key "ListSessionsRequest[$key]" has a null value in JSON.'); - }); - return true; - }()); - - return ListSessionsRequest( - orderBy: SessionOrdering.fromJson(json[r'orderBy']), - orderDirection: OrderDirection.fromJson(json[r'orderDirection']), - pageSize: mapValueOfType(json, r'pageSize'), - page: mapValueOfType(json, r'page'), - ); - } - return null; - } - - static List listFromJson( - dynamic json, { - bool growable = false, - }) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = ListSessionsRequest.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = ListSessionsRequest.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of ListSessionsRequest-objects as value to a dart map - static Map> mapListFromJson( - dynamic json, { - bool growable = false, - }) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = ListSessionsRequest.listFromJson( - entry.value, - growable: growable, - ); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = {}; -} diff --git a/connect/dart/test/list_sessions_request_test.dart b/connect/dart/test/list_sessions_request_test.dart deleted file mode 100644 index 35908b726..000000000 --- a/connect/dart/test/list_sessions_request_test.dart +++ /dev/null @@ -1,39 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// -// @dart=2.18 - -// ignore_for_file: unused_element, unused_import -// ignore_for_file: always_put_required_named_parameters_first -// ignore_for_file: constant_identifier_names -// ignore_for_file: lines_longer_than_80_chars - -import 'package:TrinsicConnect/api.dart'; -import 'package:test/test.dart'; - -// tests for ListSessionsRequest -void main() { - // final instance = ListSessionsRequest(); - - group('test ListSessionsRequest', () { - // SessionOrdering orderBy - test('to test the property `orderBy`', () async { - // TODO - }); - - // OrderDirection orderDirection - test('to test the property `orderDirection`', () async { - // TODO - }); - - // int pageSize - test('to test the property `pageSize`', () async { - // TODO - }); - - // int page - test('to test the property `page`', () async { - // TODO - }); - }); -} diff --git a/connect/dart/test/sessions_api_test.dart b/connect/dart/test/sessions_api_test.dart index 5a44eb5fd..43a874b66 100644 --- a/connect/dart/test/sessions_api_test.dart +++ b/connect/dart/test/sessions_api_test.dart @@ -31,12 +31,12 @@ void main() { // TODO }); - //Future listSessions({ ListSessionsRequest listSessionsRequest }) async + //Future listSessions({ SessionOrdering orderBy, OrderDirection orderDirection, int pageSize, int page }) async test('test listSessions', () async { // TODO }); - //Future redactSession({ String sessionId }) async + //Future redactSession(String sessionId) async test('test redactSession', () async { // TODO }); diff --git a/connect/dotnet/.openapi-generator/FILES b/connect/dotnet/.openapi-generator/FILES index 20511b835..7b6f1ec7d 100644 --- a/connect/dotnet/.openapi-generator/FILES +++ b/connect/dotnet/.openapi-generator/FILES @@ -12,7 +12,6 @@ docs/GetSessionResponseV1.md docs/GovernmentIDOptions.md docs/GovernmentIDOptionsRequest.md docs/IDVSessionState.md -docs/ListSessionsRequest.md docs/ListSessionsResponse.md docs/NormalizedIdentityData.md docs/OrderDirection.md @@ -34,7 +33,6 @@ src/Trinsic.Connect.Test/Model/GetSessionResponseV1Tests.cs src/Trinsic.Connect.Test/Model/GovernmentIDOptionsRequestTests.cs src/Trinsic.Connect.Test/Model/GovernmentIDOptionsTests.cs src/Trinsic.Connect.Test/Model/IDVSessionStateTests.cs -src/Trinsic.Connect.Test/Model/ListSessionsRequestTests.cs src/Trinsic.Connect.Test/Model/ListSessionsResponseTests.cs src/Trinsic.Connect.Test/Model/NormalizedIdentityDataTests.cs src/Trinsic.Connect.Test/Model/OrderDirectionTests.cs @@ -73,7 +71,6 @@ src/Trinsic.Connect/Model/GetSessionResponseV1.cs src/Trinsic.Connect/Model/GovernmentIDOptions.cs src/Trinsic.Connect/Model/GovernmentIDOptionsRequest.cs src/Trinsic.Connect/Model/IDVSessionState.cs -src/Trinsic.Connect/Model/ListSessionsRequest.cs src/Trinsic.Connect/Model/ListSessionsResponse.cs src/Trinsic.Connect/Model/NormalizedIdentityData.cs src/Trinsic.Connect/Model/OrderDirection.cs diff --git a/connect/dotnet/README.md b/connect/dotnet/README.md index c787d64f2..e17f0904c 100644 --- a/connect/dotnet/README.md +++ b/connect/dotnet/README.md @@ -143,7 +143,7 @@ Class | Method | HTTP request | Description *SessionsApi* | [**CreateSession**](docs/SessionsApi.md#createsession) | **POST** /api/v1/sessions | *SessionsApi* | [**GetSession**](docs/SessionsApi.md#getsession) | **GET** /api/v1/sessions/{sessionId} | *SessionsApi* | [**ListSessions**](docs/SessionsApi.md#listsessions) | **GET** /api/v1/sessions | -*SessionsApi* | [**RedactSession**](docs/SessionsApi.md#redactsession) | **POST** /api/v1/sessions/redact | +*SessionsApi* | [**RedactSession**](docs/SessionsApi.md#redactsession) | **POST** /api/v1/sessions/{sessionId}/redact | @@ -157,7 +157,6 @@ Class | Method | HTTP request | Description - [Model.GovernmentIDOptions](docs/GovernmentIDOptions.md) - [Model.GovernmentIDOptionsRequest](docs/GovernmentIDOptionsRequest.md) - [Model.IDVSessionState](docs/IDVSessionState.md) - - [Model.ListSessionsRequest](docs/ListSessionsRequest.md) - [Model.ListSessionsResponse](docs/ListSessionsResponse.md) - [Model.NormalizedIdentityData](docs/NormalizedIdentityData.md) - [Model.OrderDirection](docs/OrderDirection.md) diff --git a/connect/dotnet/api/openapi.yaml b/connect/dotnet/api/openapi.yaml index 93636c95e..d0009727f 100644 --- a/connect/dotnet/api/openapi.yaml +++ b/connect/dotnet/api/openapi.yaml @@ -12,20 +12,43 @@ paths: /api/v1/sessions: get: operationId: ListSessions - requestBody: - content: - application/json: - schema: - allOf: - - $ref: '#/components/schemas/ListSessionsRequest' - text/json: - schema: - allOf: - - $ref: '#/components/schemas/ListSessionsRequest' - application/*+json: - schema: - allOf: - - $ref: '#/components/schemas/ListSessionsRequest' + parameters: + - explode: true + in: query + name: OrderBy + required: false + schema: + allOf: + - $ref: '#/components/schemas/SessionOrdering' + style: form + - explode: true + in: query + name: OrderDirection + required: false + schema: + allOf: + - $ref: '#/components/schemas/OrderDirection' + style: form + - explode: true + in: query + name: PageSize + required: false + schema: + format: int32 + maximum: 10 + minimum: 1 + type: integer + style: form + - explode: true + in: query + name: Page + required: false + schema: + format: int32 + maximum: 2147483647 + minimum: 1 + type: integer + style: form responses: "200": content: @@ -196,19 +219,17 @@ paths: description: Internal Server Error tags: - Sessions - /api/v1/sessions/redact: + /api/v1/sessions/{sessionId}/redact: post: operationId: RedactSession parameters: - - explode: true - in: query + - explode: false + in: path name: sessionId - required: false + required: true schema: - maxLength: 100 - minLength: 5 type: string - style: form + style: simple responses: "200": description: OK @@ -343,31 +364,6 @@ components: - IdvSuccess - IdvFailed type: string - ListSessionsRequest: - additionalProperties: false - example: - orderBy: "" - orderDirection: "" - pageSize: 1 - page: 1294386359 - properties: - orderBy: - allOf: - - $ref: '#/components/schemas/SessionOrdering' - orderDirection: - allOf: - - $ref: '#/components/schemas/OrderDirection' - pageSize: - format: int32 - maximum: 10 - minimum: 1 - type: integer - page: - format: int32 - maximum: 2147483647 - minimum: 1 - type: integer - type: object ListSessionsResponse: additionalProperties: false example: diff --git a/connect/dotnet/docs/ListSessionsRequest.md b/connect/dotnet/docs/ListSessionsRequest.md deleted file mode 100644 index be5d901e2..000000000 --- a/connect/dotnet/docs/ListSessionsRequest.md +++ /dev/null @@ -1,13 +0,0 @@ -# Trinsic.Connect.Model.ListSessionsRequest - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**OrderBy** | **SessionOrdering** | | [optional] -**OrderDirection** | **OrderDirection** | | [optional] -**PageSize** | **int** | | [optional] -**Page** | **int** | | [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/connect/dotnet/docs/SessionsApi.md b/connect/dotnet/docs/SessionsApi.md index fa71c85eb..ac786f279 100644 --- a/connect/dotnet/docs/SessionsApi.md +++ b/connect/dotnet/docs/SessionsApi.md @@ -8,7 +8,7 @@ All URIs are relative to *https://connect.trinsic.id* | [**CreateSession**](SessionsApi.md#createsession) | **POST** /api/v1/sessions | | | [**GetSession**](SessionsApi.md#getsession) | **GET** /api/v1/sessions/{sessionId} | | | [**ListSessions**](SessionsApi.md#listsessions) | **GET** /api/v1/sessions | | -| [**RedactSession**](SessionsApi.md#redactsession) | **POST** /api/v1/sessions/redact | | +| [**RedactSession**](SessionsApi.md#redactsession) | **POST** /api/v1/sessions/{sessionId}/redact | | # **CancelSession** @@ -306,7 +306,7 @@ catch (ApiException e) # **ListSessions** -> ListSessionsResponse ListSessions (ListSessionsRequest? listSessionsRequest = null) +> ListSessionsResponse ListSessions (SessionOrdering? orderBy = null, OrderDirection? orderDirection = null, int? pageSize = null, int? page = null) @@ -334,11 +334,14 @@ namespace Example HttpClient httpClient = new HttpClient(); HttpClientHandler httpClientHandler = new HttpClientHandler(); var apiInstance = new SessionsApi(httpClient, config, httpClientHandler); - var listSessionsRequest = new ListSessionsRequest?(); // ListSessionsRequest? | (optional) + var orderBy = new SessionOrdering?(); // SessionOrdering? | (optional) + var orderDirection = new OrderDirection?(); // OrderDirection? | (optional) + var pageSize = 56; // int? | (optional) + var page = 56; // int? | (optional) try { - ListSessionsResponse result = apiInstance.ListSessions(listSessionsRequest); + ListSessionsResponse result = apiInstance.ListSessions(orderBy, orderDirection, pageSize, page); Debug.WriteLine(result); } catch (ApiException e) @@ -358,7 +361,7 @@ This returns an ApiResponse object which contains the response data, status code ```csharp try { - ApiResponse response = apiInstance.ListSessionsWithHttpInfo(listSessionsRequest); + ApiResponse response = apiInstance.ListSessionsWithHttpInfo(orderBy, orderDirection, pageSize, page); Debug.Write("Status Code: " + response.StatusCode); Debug.Write("Response Headers: " + response.Headers); Debug.Write("Response Body: " + response.Data); @@ -375,7 +378,10 @@ catch (ApiException e) | Name | Type | Description | Notes | |------|------|-------------|-------| -| **listSessionsRequest** | [**ListSessionsRequest?**](ListSessionsRequest?.md) | | [optional] | +| **orderBy** | [**SessionOrdering?**](SessionOrdering?.md) | | [optional] | +| **orderDirection** | [**OrderDirection?**](OrderDirection?.md) | | [optional] | +| **pageSize** | **int?** | | [optional] | +| **page** | **int?** | | [optional] | ### Return type @@ -387,7 +393,7 @@ catch (ApiException e) ### HTTP request headers - - **Content-Type**: application/json, text/json, application/*+json + - **Content-Type**: Not defined - **Accept**: text/plain, application/json, text/json @@ -404,7 +410,7 @@ catch (ApiException e) # **RedactSession** -> void RedactSession (string? sessionId = null) +> void RedactSession (string sessionId) @@ -432,7 +438,7 @@ namespace Example HttpClient httpClient = new HttpClient(); HttpClientHandler httpClientHandler = new HttpClientHandler(); var apiInstance = new SessionsApi(httpClient, config, httpClientHandler); - var sessionId = "sessionId_example"; // string? | (optional) + var sessionId = "sessionId_example"; // string | try { @@ -469,7 +475,7 @@ catch (ApiException e) | Name | Type | Description | Notes | |------|------|-------------|-------| -| **sessionId** | **string?** | | [optional] | +| **sessionId** | **string** | | | ### Return type diff --git a/connect/dotnet/src/Trinsic.Connect.Test/Api/SessionsApiTests.cs b/connect/dotnet/src/Trinsic.Connect.Test/Api/SessionsApiTests.cs index 5d9deaeef..3682a328e 100644 --- a/connect/dotnet/src/Trinsic.Connect.Test/Api/SessionsApiTests.cs +++ b/connect/dotnet/src/Trinsic.Connect.Test/Api/SessionsApiTests.cs @@ -89,8 +89,11 @@ public void GetSessionTest() public void ListSessionsTest() { // TODO uncomment below to test the method and replace null with proper value - //ListSessionsRequest? listSessionsRequest = null; - //var response = instance.ListSessions(listSessionsRequest); + //SessionOrdering? orderBy = null; + //OrderDirection? orderDirection = null; + //int? pageSize = null; + //int? page = null; + //var response = instance.ListSessions(orderBy, orderDirection, pageSize, page); //Assert.IsType(response); } @@ -101,7 +104,7 @@ public void ListSessionsTest() public void RedactSessionTest() { // TODO uncomment below to test the method and replace null with proper value - //string? sessionId = null; + //string sessionId = null; //instance.RedactSession(sessionId); } } diff --git a/connect/dotnet/src/Trinsic.Connect.Test/Model/ListSessionsRequestTests.cs b/connect/dotnet/src/Trinsic.Connect.Test/Model/ListSessionsRequestTests.cs deleted file mode 100644 index e8c20fae1..000000000 --- a/connect/dotnet/src/Trinsic.Connect.Test/Model/ListSessionsRequestTests.cs +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Connect API - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ - -using System; -using Xunit; - -namespace Trinsic.Connect.Test.Model; - -/// -/// Class for testing ListSessionsRequest -/// -/// -/// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). -/// Please update the test case below to test the model. -/// -public class ListSessionsRequestTests : IDisposable -{ - // TODO uncomment below to declare an instance variable for ListSessionsRequest - //private ListSessionsRequest instance; - - public ListSessionsRequestTests() - { - // TODO uncomment below to create an instance of ListSessionsRequest - //instance = new ListSessionsRequest(); - } - - public void Dispose() - { - // Cleanup when everything is done. - } - - /// - /// Test an instance of ListSessionsRequest - /// - [Fact] - public void ListSessionsRequestInstanceTest() - { - // TODO uncomment below to test "IsType" ListSessionsRequest - //Assert.IsType(instance); - } - - /// - /// Test the property 'OrderBy' - /// - [Fact] - public void OrderByTest() - { - // TODO unit test for the property 'OrderBy' - } - - /// - /// Test the property 'OrderDirection' - /// - [Fact] - public void OrderDirectionTest() - { - // TODO unit test for the property 'OrderDirection' - } - - /// - /// Test the property 'PageSize' - /// - [Fact] - public void PageSizeTest() - { - // TODO unit test for the property 'PageSize' - } - - /// - /// Test the property 'Page' - /// - [Fact] - public void PageTest() - { - // TODO unit test for the property 'Page' - } -} diff --git a/connect/dotnet/src/Trinsic.Connect/Api/SessionsApi.cs b/connect/dotnet/src/Trinsic.Connect/Api/SessionsApi.cs index a1ea815e1..a9cc31e05 100644 --- a/connect/dotnet/src/Trinsic.Connect/Api/SessionsApi.cs +++ b/connect/dotnet/src/Trinsic.Connect/Api/SessionsApi.cs @@ -78,9 +78,12 @@ public interface ISessionsApiSync : IApiAccessor /// /// /// Thrown when fails to make API call - /// (optional) + /// (optional) + /// (optional) + /// (optional) + /// (optional) /// ListSessionsResponse - ListSessionsResponse ListSessions(ListSessionsRequest? listSessionsRequest = default(ListSessionsRequest?)); + ListSessionsResponse ListSessions(SessionOrdering? orderBy = default(SessionOrdering?), OrderDirection? orderDirection = default(OrderDirection?), int? pageSize = default(int?), int? page = default(int?)); /// /// @@ -89,16 +92,19 @@ public interface ISessionsApiSync : IApiAccessor /// /// /// Thrown when fails to make API call - /// (optional) + /// (optional) + /// (optional) + /// (optional) + /// (optional) /// ApiResponse of ListSessionsResponse - ApiResponse ListSessionsWithHttpInfo(ListSessionsRequest? listSessionsRequest = default(ListSessionsRequest?)); + ApiResponse ListSessionsWithHttpInfo(SessionOrdering? orderBy = default(SessionOrdering?), OrderDirection? orderDirection = default(OrderDirection?), int? pageSize = default(int?), int? page = default(int?)); /// /// /// /// Thrown when fails to make API call - /// (optional) + /// /// - void RedactSession(string? sessionId = default(string?)); + void RedactSession(string sessionId); /// /// @@ -107,9 +113,9 @@ public interface ISessionsApiSync : IApiAccessor /// /// /// Thrown when fails to make API call - /// (optional) + /// /// ApiResponse of Object(void) - ApiResponse RedactSessionWithHttpInfo(string? sessionId = default(string?)); + ApiResponse RedactSessionWithHttpInfo(string sessionId); #endregion Synchronous Operations } @@ -195,10 +201,13 @@ public interface ISessionsApiAsync : IApiAccessor /// /// /// Thrown when fails to make API call - /// (optional) + /// (optional) + /// (optional) + /// (optional) + /// (optional) /// Cancellation Token to cancel the request. /// Task of ListSessionsResponse - System.Threading.Tasks.Task ListSessionsAsync(ListSessionsRequest? listSessionsRequest = default(ListSessionsRequest?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task ListSessionsAsync(SessionOrdering? orderBy = default(SessionOrdering?), OrderDirection? orderDirection = default(OrderDirection?), int? pageSize = default(int?), int? page = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// @@ -207,10 +216,13 @@ public interface ISessionsApiAsync : IApiAccessor /// /// /// Thrown when fails to make API call - /// (optional) + /// (optional) + /// (optional) + /// (optional) + /// (optional) /// Cancellation Token to cancel the request. /// Task of ApiResponse (ListSessionsResponse) - System.Threading.Tasks.Task> ListSessionsWithHttpInfoAsync(ListSessionsRequest? listSessionsRequest = default(ListSessionsRequest?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> ListSessionsWithHttpInfoAsync(SessionOrdering? orderBy = default(SessionOrdering?), OrderDirection? orderDirection = default(OrderDirection?), int? pageSize = default(int?), int? page = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// /// @@ -218,10 +230,10 @@ public interface ISessionsApiAsync : IApiAccessor /// /// /// Thrown when fails to make API call - /// (optional) + /// /// Cancellation Token to cancel the request. /// Task of void - System.Threading.Tasks.Task RedactSessionAsync(string? sessionId = default(string?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task RedactSessionAsync(string sessionId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// @@ -230,10 +242,10 @@ public interface ISessionsApiAsync : IApiAccessor /// /// /// Thrown when fails to make API call - /// (optional) + /// /// Cancellation Token to cancel the request. /// Task of ApiResponse - System.Threading.Tasks.Task> RedactSessionWithHttpInfoAsync(string? sessionId = default(string?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> RedactSessionWithHttpInfoAsync(string sessionId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); #endregion Asynchronous Operations } @@ -909,11 +921,14 @@ public Trinsic.Connect.Client.ApiResponse GetSessionWithHt /// /// /// Thrown when fails to make API call - /// (optional) + /// (optional) + /// (optional) + /// (optional) + /// (optional) /// ListSessionsResponse - public ListSessionsResponse ListSessions(ListSessionsRequest? listSessionsRequest = default(ListSessionsRequest?)) + public ListSessionsResponse ListSessions(SessionOrdering? orderBy = default(SessionOrdering?), OrderDirection? orderDirection = default(OrderDirection?), int? pageSize = default(int?), int? page = default(int?)) { - var localVarResponse = ListSessionsWithHttpInfo(listSessionsRequest); + var localVarResponse = ListSessionsWithHttpInfo(orderBy, orderDirection, pageSize, page); return localVarResponse.Data; } @@ -921,16 +936,16 @@ public Trinsic.Connect.Client.ApiResponse GetSessionWithHt /// /// /// Thrown when fails to make API call - /// (optional) + /// (optional) + /// (optional) + /// (optional) + /// (optional) /// ApiResponse of ListSessionsResponse - public Trinsic.Connect.Client.ApiResponse ListSessionsWithHttpInfo(ListSessionsRequest? listSessionsRequest = default(ListSessionsRequest?)) + public Trinsic.Connect.Client.ApiResponse ListSessionsWithHttpInfo(SessionOrdering? orderBy = default(SessionOrdering?), OrderDirection? orderDirection = default(OrderDirection?), int? pageSize = default(int?), int? page = default(int?)) { var localVarRequestOptions = new Trinsic.Connect.Client.RequestOptions(); var _contentTypes = new string[] { - "application/json", - "text/json", - "application/*+json" }; // to determine the Accept header @@ -952,7 +967,25 @@ public Trinsic.Connect.Client.ApiResponse GetSessionWithHt localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); } - localVarRequestOptions.Data = listSessionsRequest; + if (orderBy != null) + { + localVarRequestOptions.QueryParameters.Add(Trinsic.Connect.Client.ClientUtils.ParameterToMultiMap("", "OrderBy", orderBy)); + } + + if (orderDirection != null) + { + localVarRequestOptions.QueryParameters.Add(Trinsic.Connect.Client.ClientUtils.ParameterToMultiMap("", "OrderDirection", orderDirection)); + } + + if (pageSize != null) + { + localVarRequestOptions.QueryParameters.Add(Trinsic.Connect.Client.ClientUtils.ParameterToMultiMap("", "PageSize", pageSize)); + } + + if (page != null) + { + localVarRequestOptions.QueryParameters.Add(Trinsic.Connect.Client.ClientUtils.ParameterToMultiMap("", "Page", page)); + } // authentication (Bearer) required // bearer authentication required @@ -980,12 +1013,15 @@ public Trinsic.Connect.Client.ApiResponse GetSessionWithHt /// /// /// Thrown when fails to make API call - /// (optional) + /// (optional) + /// (optional) + /// (optional) + /// (optional) /// Cancellation Token to cancel the request. /// Task of ListSessionsResponse - public async System.Threading.Tasks.Task ListSessionsAsync(ListSessionsRequest? listSessionsRequest = default(ListSessionsRequest?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task ListSessionsAsync(SessionOrdering? orderBy = default(SessionOrdering?), OrderDirection? orderDirection = default(OrderDirection?), int? pageSize = default(int?), int? page = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - var localVarResponse = await ListSessionsWithHttpInfoAsync(listSessionsRequest, cancellationToken).ConfigureAwait(false); + var localVarResponse = await ListSessionsWithHttpInfoAsync(orderBy, orderDirection, pageSize, page, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; } @@ -993,18 +1029,18 @@ public Trinsic.Connect.Client.ApiResponse GetSessionWithHt /// /// /// Thrown when fails to make API call - /// (optional) + /// (optional) + /// (optional) + /// (optional) + /// (optional) /// Cancellation Token to cancel the request. /// Task of ApiResponse (ListSessionsResponse) - public async System.Threading.Tasks.Task> ListSessionsWithHttpInfoAsync(ListSessionsRequest? listSessionsRequest = default(ListSessionsRequest?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> ListSessionsWithHttpInfoAsync(SessionOrdering? orderBy = default(SessionOrdering?), OrderDirection? orderDirection = default(OrderDirection?), int? pageSize = default(int?), int? page = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { var localVarRequestOptions = new Trinsic.Connect.Client.RequestOptions(); var _contentTypes = new string[] { - "application/json", - "text/json", - "application/*+json" }; // to determine the Accept header @@ -1026,7 +1062,25 @@ public Trinsic.Connect.Client.ApiResponse GetSessionWithHt localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); } - localVarRequestOptions.Data = listSessionsRequest; + if (orderBy != null) + { + localVarRequestOptions.QueryParameters.Add(Trinsic.Connect.Client.ClientUtils.ParameterToMultiMap("", "OrderBy", orderBy)); + } + + if (orderDirection != null) + { + localVarRequestOptions.QueryParameters.Add(Trinsic.Connect.Client.ClientUtils.ParameterToMultiMap("", "OrderDirection", orderDirection)); + } + + if (pageSize != null) + { + localVarRequestOptions.QueryParameters.Add(Trinsic.Connect.Client.ClientUtils.ParameterToMultiMap("", "PageSize", pageSize)); + } + + if (page != null) + { + localVarRequestOptions.QueryParameters.Add(Trinsic.Connect.Client.ClientUtils.ParameterToMultiMap("", "Page", page)); + } // authentication (Bearer) required // bearer authentication required @@ -1055,9 +1109,9 @@ public Trinsic.Connect.Client.ApiResponse GetSessionWithHt /// /// /// Thrown when fails to make API call - /// (optional) + /// /// - public void RedactSession(string? sessionId = default(string?)) + public void RedactSession(string sessionId) { RedactSessionWithHttpInfo(sessionId); } @@ -1066,10 +1120,16 @@ public Trinsic.Connect.Client.ApiResponse GetSessionWithHt /// /// /// Thrown when fails to make API call - /// (optional) + /// /// ApiResponse of Object(void) - public Trinsic.Connect.Client.ApiResponse RedactSessionWithHttpInfo(string? sessionId = default(string?)) + public Trinsic.Connect.Client.ApiResponse RedactSessionWithHttpInfo(string sessionId) { + // verify the required parameter 'sessionId' is set + if (sessionId == null) + { + throw new Trinsic.Connect.Client.ApiException(400, "Missing required parameter 'sessionId' when calling SessionsApi->RedactSession"); + } + var localVarRequestOptions = new Trinsic.Connect.Client.RequestOptions(); var _contentTypes = new string[] { @@ -1092,10 +1152,7 @@ public Trinsic.Connect.Client.ApiResponse GetSessionWithHt localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); } - if (sessionId != null) - { - localVarRequestOptions.QueryParameters.Add(Trinsic.Connect.Client.ClientUtils.ParameterToMultiMap("", "sessionId", sessionId)); - } + localVarRequestOptions.PathParameters.Add("sessionId", Trinsic.Connect.Client.ClientUtils.ParameterToString(sessionId)); // path parameter // authentication (Bearer) required // bearer authentication required @@ -1105,7 +1162,7 @@ public Trinsic.Connect.Client.ApiResponse GetSessionWithHt } // make the HTTP request - var localVarResponse = Client.Post("/api/v1/sessions/redact", localVarRequestOptions, Configuration); + var localVarResponse = Client.Post("/api/v1/sessions/{sessionId}/redact", localVarRequestOptions, Configuration); if (ExceptionFactory != null) { @@ -1123,10 +1180,10 @@ public Trinsic.Connect.Client.ApiResponse GetSessionWithHt /// /// /// Thrown when fails to make API call - /// (optional) + /// /// Cancellation Token to cancel the request. /// Task of void - public async System.Threading.Tasks.Task RedactSessionAsync(string? sessionId = default(string?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task RedactSessionAsync(string sessionId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { await RedactSessionWithHttpInfoAsync(sessionId, cancellationToken).ConfigureAwait(false); } @@ -1135,11 +1192,16 @@ public Trinsic.Connect.Client.ApiResponse GetSessionWithHt /// /// /// Thrown when fails to make API call - /// (optional) + /// /// Cancellation Token to cancel the request. /// Task of ApiResponse - public async System.Threading.Tasks.Task> RedactSessionWithHttpInfoAsync(string? sessionId = default(string?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> RedactSessionWithHttpInfoAsync(string sessionId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + // verify the required parameter 'sessionId' is set + if (sessionId == null) + { + throw new Trinsic.Connect.Client.ApiException(400, "Missing required parameter 'sessionId' when calling SessionsApi->RedactSession"); + } var localVarRequestOptions = new Trinsic.Connect.Client.RequestOptions(); @@ -1163,10 +1225,7 @@ public Trinsic.Connect.Client.ApiResponse GetSessionWithHt localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); } - if (sessionId != null) - { - localVarRequestOptions.QueryParameters.Add(Trinsic.Connect.Client.ClientUtils.ParameterToMultiMap("", "sessionId", sessionId)); - } + localVarRequestOptions.PathParameters.Add("sessionId", Trinsic.Connect.Client.ClientUtils.ParameterToString(sessionId)); // path parameter // authentication (Bearer) required // bearer authentication required @@ -1177,7 +1236,7 @@ public Trinsic.Connect.Client.ApiResponse GetSessionWithHt // make the HTTP request - var localVarResponse = await AsynchronousClient.PostAsync("/api/v1/sessions/redact", localVarRequestOptions, Configuration, cancellationToken).ConfigureAwait(false); + var localVarResponse = await AsynchronousClient.PostAsync("/api/v1/sessions/{sessionId}/redact", localVarRequestOptions, Configuration, cancellationToken).ConfigureAwait(false); if (ExceptionFactory != null) { diff --git a/connect/dotnet/src/Trinsic.Connect/Model/ListSessionsRequest.cs b/connect/dotnet/src/Trinsic.Connect/Model/ListSessionsRequest.cs deleted file mode 100644 index 1d08e3772..000000000 --- a/connect/dotnet/src/Trinsic.Connect/Model/ListSessionsRequest.cs +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Connect API - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ - -using System.Runtime.Serialization; -using System.Text; - -namespace Trinsic.Connect.Model; - -/// -/// ListSessionsRequest -/// -[DataContract(Name = "ListSessionsRequest")] -public partial class ListSessionsRequest -{ - - /// - /// Gets or Sets OrderBy - /// - [DataMember(Name = "orderBy", EmitDefaultValue = false)] - public SessionOrdering? OrderBy { get; set; } - - /// - /// Gets or Sets OrderDirection - /// - [DataMember(Name = "orderDirection", EmitDefaultValue = false)] - public OrderDirection? OrderDirection { get; set; } - /// - /// Initializes a new instance of the class. - /// - /// orderBy. - /// orderDirection. - /// pageSize. - /// page. - public ListSessionsRequest(SessionOrdering? orderBy = default(SessionOrdering?), OrderDirection? orderDirection = default(OrderDirection?), int pageSize = default(int), int page = default(int)) - { - OrderBy = orderBy; - OrderDirection = orderDirection; - PageSize = pageSize; - Page = page; - } - - /// - /// Gets or Sets PageSize - /// - [DataMember(Name = "pageSize", EmitDefaultValue = false)] - public int PageSize { get; set; } - - /// - /// Gets or Sets Page - /// - [DataMember(Name = "page", EmitDefaultValue = false)] - public int Page { get; set; } - - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class ListSessionsRequest {\n"); - sb.Append(" OrderBy: ").Append(OrderBy).Append("\n"); - sb.Append(" OrderDirection: ").Append(OrderDirection).Append("\n"); - sb.Append(" PageSize: ").Append(PageSize).Append("\n"); - sb.Append(" Page: ").Append(Page).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); - } -} diff --git a/connect/swagger_api.json b/connect/swagger_api.json index ba30615f5..ee7b11e86 100644 --- a/connect/swagger_api.json +++ b/connect/swagger_api.json @@ -18,37 +18,50 @@ "Sessions" ], "operationId": "ListSessions", - "requestBody": { - "content": { - "application/json": { - "schema": { - "allOf": [ - { - "$ref": "#/components/schemas/ListSessionsRequest" - } - ] - } - }, - "text/json": { - "schema": { - "allOf": [ - { - "$ref": "#/components/schemas/ListSessionsRequest" - } - ] - } - }, - "application/*+json": { - "schema": { - "allOf": [ - { - "$ref": "#/components/schemas/ListSessionsRequest" - } - ] - } + "parameters": [ + { + "name": "OrderBy", + "in": "query", + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/SessionOrdering" + } + ] + } + }, + { + "name": "OrderDirection", + "in": "query", + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/OrderDirection" + } + ] + } + }, + { + "name": "PageSize", + "in": "query", + "schema": { + "maximum": 10, + "minimum": 1, + "type": "integer", + "format": "int32" + } + }, + { + "name": "Page", + "in": "query", + "schema": { + "maximum": 2147483647, + "minimum": 1, + "type": "integer", + "format": "int32" } } - }, + ], "responses": { "200": { "description": "OK", @@ -328,7 +341,7 @@ } } }, - "/api/v1/sessions/redact": { + "/api/v1/sessions/{sessionId}/redact": { "post": { "tags": [ "Sessions" @@ -337,10 +350,9 @@ "parameters": [ { "name": "sessionId", - "in": "query", + "in": "path", + "required": true, "schema": { - "maxLength": 100, - "minLength": 5, "type": "string" } } @@ -537,38 +549,6 @@ ], "type": "string" }, - "ListSessionsRequest": { - "type": "object", - "properties": { - "orderBy": { - "allOf": [ - { - "$ref": "#/components/schemas/SessionOrdering" - } - ] - }, - "orderDirection": { - "allOf": [ - { - "$ref": "#/components/schemas/OrderDirection" - } - ] - }, - "pageSize": { - "maximum": 10, - "minimum": 1, - "type": "integer", - "format": "int32" - }, - "page": { - "maximum": 2147483647, - "minimum": 1, - "type": "integer", - "format": "int32" - } - }, - "additionalProperties": false - }, "ListSessionsResponse": { "required": [ "more", diff --git a/connect/typescript/.openapi-generator/FILES b/connect/typescript/.openapi-generator/FILES index 8523c7a06..ff3f3a12d 100644 --- a/connect/typescript/.openapi-generator/FILES +++ b/connect/typescript/.openapi-generator/FILES @@ -14,7 +14,6 @@ src/models/GetSessionResponseV1.ts src/models/GovernmentIDOptions.ts src/models/GovernmentIDOptionsRequest.ts src/models/IDVSessionState.ts -src/models/ListSessionsRequest.ts src/models/ListSessionsResponse.ts src/models/NormalizedIdentityData.ts src/models/OrderDirection.ts diff --git a/connect/typescript/src/apis/SessionsApi.ts b/connect/typescript/src/apis/SessionsApi.ts index 8b2045c68..51464f594 100644 --- a/connect/typescript/src/apis/SessionsApi.ts +++ b/connect/typescript/src/apis/SessionsApi.ts @@ -19,8 +19,9 @@ import type { CreateSessionResponse, FailureMessage, GetSessionResponseV1, - ListSessionsRequest, ListSessionsResponse, + OrderDirection, + SessionOrdering, ValidationResult, } from "../models/index"; import { @@ -34,10 +35,12 @@ import { FailureMessageToJSON, GetSessionResponseV1FromJSON, GetSessionResponseV1ToJSON, - ListSessionsRequestFromJSON, - ListSessionsRequestToJSON, ListSessionsResponseFromJSON, ListSessionsResponseToJSON, + OrderDirectionFromJSON, + OrderDirectionToJSON, + SessionOrderingFromJSON, + SessionOrderingToJSON, ValidationResultFromJSON, ValidationResultToJSON, } from "../models/index"; @@ -54,12 +57,15 @@ export interface GetSessionRequest { sessionId: string; } -export interface ListSessionsOperationRequest { - listSessionsRequest?: ListSessionsRequest; +export interface ListSessionsRequest { + orderBy?: SessionOrdering; + orderDirection?: OrderDirection; + pageSize?: number; + page?: number; } export interface RedactSessionRequest { - sessionId?: string; + sessionId: string; } /** @@ -232,14 +238,29 @@ export class SessionsApi extends runtime.BaseAPI { /** */ async listSessionsRaw( - requestParameters: ListSessionsOperationRequest, + requestParameters: ListSessionsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction, ): Promise> { const queryParameters: any = {}; - const headerParameters: runtime.HTTPHeaders = {}; + if (requestParameters["orderBy"] != null) { + queryParameters["OrderBy"] = requestParameters["orderBy"]; + } - headerParameters["Content-Type"] = "application/json"; + if (requestParameters["orderDirection"] != null) { + queryParameters["OrderDirection"] = + requestParameters["orderDirection"]; + } + + if (requestParameters["pageSize"] != null) { + queryParameters["PageSize"] = requestParameters["pageSize"]; + } + + if (requestParameters["page"] != null) { + queryParameters["Page"] = requestParameters["page"]; + } + + const headerParameters: runtime.HTTPHeaders = {}; if (this.configuration && this.configuration.accessToken) { const token = this.configuration.accessToken; @@ -255,9 +276,6 @@ export class SessionsApi extends runtime.BaseAPI { method: "GET", headers: headerParameters, query: queryParameters, - body: ListSessionsRequestToJSON( - requestParameters["listSessionsRequest"], - ), }, initOverrides, ); @@ -270,7 +288,7 @@ export class SessionsApi extends runtime.BaseAPI { /** */ async listSessions( - requestParameters: ListSessionsOperationRequest = {}, + requestParameters: ListSessionsRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction, ): Promise { const response = await this.listSessionsRaw( @@ -286,12 +304,15 @@ export class SessionsApi extends runtime.BaseAPI { requestParameters: RedactSessionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction, ): Promise> { - const queryParameters: any = {}; - - if (requestParameters["sessionId"] != null) { - queryParameters["sessionId"] = requestParameters["sessionId"]; + if (requestParameters["sessionId"] == null) { + throw new runtime.RequiredError( + "sessionId", + 'Required parameter "sessionId" was null or undefined when calling redactSession().', + ); } + const queryParameters: any = {}; + const headerParameters: runtime.HTTPHeaders = {}; if (this.configuration && this.configuration.accessToken) { @@ -304,7 +325,10 @@ export class SessionsApi extends runtime.BaseAPI { } const response = await this.request( { - path: `/api/v1/sessions/redact`, + path: `/api/v1/sessions/{sessionId}/redact`.replace( + `{${"sessionId"}}`, + encodeURIComponent(String(requestParameters["sessionId"])), + ), method: "POST", headers: headerParameters, query: queryParameters, @@ -318,7 +342,7 @@ export class SessionsApi extends runtime.BaseAPI { /** */ async redactSession( - requestParameters: RedactSessionRequest = {}, + requestParameters: RedactSessionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction, ): Promise { await this.redactSessionRaw(requestParameters, initOverrides); diff --git a/connect/typescript/src/models/IDVSessionState.ts b/connect/typescript/src/models/IDVSessionState.ts index 50ae305b2..d2e1a2ae9 100644 --- a/connect/typescript/src/models/IDVSessionState.ts +++ b/connect/typescript/src/models/IDVSessionState.ts @@ -31,8 +31,7 @@ export function instanceOfIDVSessionState(value: any): boolean { for (const key in IDVSessionState) { if (Object.prototype.hasOwnProperty.call(IDVSessionState, key)) { if ( - (IDVSessionState as Record)[key] === - value + IDVSessionState[key as keyof typeof IDVSessionState] === value ) { return true; } diff --git a/connect/typescript/src/models/ListSessionsRequest.ts b/connect/typescript/src/models/ListSessionsRequest.ts deleted file mode 100644 index 1ed0c1e9e..000000000 --- a/connect/typescript/src/models/ListSessionsRequest.ts +++ /dev/null @@ -1,107 +0,0 @@ -/* tslint:disable */ -/* eslint-disable */ -/** - * Connect API - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: v1 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { mapValues } from "../runtime"; -import type { SessionOrdering } from "./SessionOrdering"; -import { - SessionOrderingFromJSON, - SessionOrderingFromJSONTyped, - SessionOrderingToJSON, -} from "./SessionOrdering"; -import type { OrderDirection } from "./OrderDirection"; -import { - OrderDirectionFromJSON, - OrderDirectionFromJSONTyped, - OrderDirectionToJSON, -} from "./OrderDirection"; - -/** - * - * @export - * @interface ListSessionsRequest - */ -export interface ListSessionsRequest { - /** - * - * @type {SessionOrdering} - * @memberof ListSessionsRequest - */ - orderBy?: SessionOrdering; - /** - * - * @type {OrderDirection} - * @memberof ListSessionsRequest - */ - orderDirection?: OrderDirection; - /** - * - * @type {number} - * @memberof ListSessionsRequest - */ - pageSize?: number; - /** - * - * @type {number} - * @memberof ListSessionsRequest - */ - page?: number; -} - -/** - * Check if a given object implements the ListSessionsRequest interface. - */ -export function instanceOfListSessionsRequest( - value: object, -): value is ListSessionsRequest { - return true; -} - -export function ListSessionsRequestFromJSON(json: any): ListSessionsRequest { - return ListSessionsRequestFromJSONTyped(json, false); -} - -export function ListSessionsRequestFromJSONTyped( - json: any, - ignoreDiscriminator: boolean, -): ListSessionsRequest { - if (json == null) { - return json; - } - return { - orderBy: - json["orderBy"] == null - ? undefined - : SessionOrderingFromJSON(json["orderBy"]), - orderDirection: - json["orderDirection"] == null - ? undefined - : OrderDirectionFromJSON(json["orderDirection"]), - pageSize: json["pageSize"] == null ? undefined : json["pageSize"], - page: json["page"] == null ? undefined : json["page"], - }; -} - -export function ListSessionsRequestToJSON( - value?: ListSessionsRequest | null, -): any { - if (value == null) { - return value; - } - return { - orderBy: SessionOrderingToJSON(value["orderBy"]), - orderDirection: OrderDirectionToJSON(value["orderDirection"]), - pageSize: value["pageSize"], - page: value["page"], - }; -} diff --git a/connect/typescript/src/models/OrderDirection.ts b/connect/typescript/src/models/OrderDirection.ts index 55ccfc170..ddbb2a82b 100644 --- a/connect/typescript/src/models/OrderDirection.ts +++ b/connect/typescript/src/models/OrderDirection.ts @@ -26,10 +26,7 @@ export type OrderDirection = export function instanceOfOrderDirection(value: any): boolean { for (const key in OrderDirection) { if (Object.prototype.hasOwnProperty.call(OrderDirection, key)) { - if ( - (OrderDirection as Record)[key] === - value - ) { + if (OrderDirection[key as keyof typeof OrderDirection] === value) { return true; } } diff --git a/connect/typescript/src/models/SessionFailCode.ts b/connect/typescript/src/models/SessionFailCode.ts index d6640846a..eac2f6b9d 100644 --- a/connect/typescript/src/models/SessionFailCode.ts +++ b/connect/typescript/src/models/SessionFailCode.ts @@ -32,8 +32,7 @@ export function instanceOfSessionFailCode(value: any): boolean { for (const key in SessionFailCode) { if (Object.prototype.hasOwnProperty.call(SessionFailCode, key)) { if ( - (SessionFailCode as Record)[key] === - value + SessionFailCode[key as keyof typeof SessionFailCode] === value ) { return true; } diff --git a/connect/typescript/src/models/SessionOrdering.ts b/connect/typescript/src/models/SessionOrdering.ts index c05351e4e..07ec3133e 100644 --- a/connect/typescript/src/models/SessionOrdering.ts +++ b/connect/typescript/src/models/SessionOrdering.ts @@ -28,8 +28,7 @@ export function instanceOfSessionOrdering(value: any): boolean { for (const key in SessionOrdering) { if (Object.prototype.hasOwnProperty.call(SessionOrdering, key)) { if ( - (SessionOrdering as Record)[key] === - value + SessionOrdering[key as keyof typeof SessionOrdering] === value ) { return true; } diff --git a/connect/typescript/src/models/VerificationFailCode.ts b/connect/typescript/src/models/VerificationFailCode.ts index c492a73af..943731152 100644 --- a/connect/typescript/src/models/VerificationFailCode.ts +++ b/connect/typescript/src/models/VerificationFailCode.ts @@ -30,8 +30,8 @@ export function instanceOfVerificationFailCode(value: any): boolean { for (const key in VerificationFailCode) { if (Object.prototype.hasOwnProperty.call(VerificationFailCode, key)) { if ( - (VerificationFailCode as Record)[ - key + VerificationFailCode[ + key as keyof typeof VerificationFailCode ] === value ) { return true; diff --git a/connect/typescript/src/models/VerificationState.ts b/connect/typescript/src/models/VerificationState.ts index 4e6cc7780..69f2a9331 100644 --- a/connect/typescript/src/models/VerificationState.ts +++ b/connect/typescript/src/models/VerificationState.ts @@ -28,9 +28,8 @@ export function instanceOfVerificationState(value: any): boolean { for (const key in VerificationState) { if (Object.prototype.hasOwnProperty.call(VerificationState, key)) { if ( - (VerificationState as Record)[ - key - ] === value + VerificationState[key as keyof typeof VerificationState] === + value ) { return true; } diff --git a/connect/typescript/src/models/index.ts b/connect/typescript/src/models/index.ts index 8e245bc90..42a1c4df0 100644 --- a/connect/typescript/src/models/index.ts +++ b/connect/typescript/src/models/index.ts @@ -8,7 +8,6 @@ export * from "./GetSessionResponseV1"; export * from "./GovernmentIDOptions"; export * from "./GovernmentIDOptionsRequest"; export * from "./IDVSessionState"; -export * from "./ListSessionsRequest"; export * from "./ListSessionsResponse"; export * from "./NormalizedIdentityData"; export * from "./OrderDirection";