diff --git a/validation/Cargo.lock b/validation/Cargo.lock index 481cf65..023df70 100644 --- a/validation/Cargo.lock +++ b/validation/Cargo.lock @@ -960,7 +960,6 @@ version = "0.1.0" dependencies = [ "async-nats", "futures", - "openapi", "rbx_asset", "rbx_binary", "rbx_dom_weak", @@ -1084,18 +1083,6 @@ version = "1.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" -[[package]] -name = "openapi" -version = "0.1.0" -dependencies = [ - "reqwest", - "serde", - "serde_json", - "serde_repr", - "url", - "uuid", -] - [[package]] name = "openssl" version = "0.10.68" @@ -2113,16 +2100,6 @@ version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" -[[package]] -name = "uuid" -version = "1.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8c5f0a0af699448548ad1a2fbf920fb4bee257eae39953ba95cb84891a0446a" -dependencies = [ - "getrandom", - "serde", -] - [[package]] name = "vcpkg" version = "0.2.15" diff --git a/validation/Cargo.toml b/validation/Cargo.toml index d22c79b..d3dc5c9 100644 --- a/validation/Cargo.toml +++ b/validation/Cargo.toml @@ -6,7 +6,6 @@ edition = "2021" [dependencies] async-nats = "0.38.0" futures = "0.3.31" -openapi = { path = "api" } rbx_asset = { version = "0.2.3", registry = "strafesnet" } rbx_binary = { version = "0.7.4", registry = "strafesnet"} rbx_dom_weak = { version = "2.9.0", registry = "strafesnet"} diff --git a/validation/api/.gitignore b/validation/api/.gitignore deleted file mode 100644 index 6aa1064..0000000 --- a/validation/api/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -/target/ -**/*.rs.bk -Cargo.lock diff --git a/validation/api/.openapi-generator-ignore b/validation/api/.openapi-generator-ignore deleted file mode 100644 index 7484ee5..0000000 --- a/validation/api/.openapi-generator-ignore +++ /dev/null @@ -1,23 +0,0 @@ -# OpenAPI Generator Ignore -# Generated by openapi-generator https://github.com/openapitools/openapi-generator - -# Use this file to prevent files from being overwritten by the generator. -# The patterns follow closely to .gitignore or .dockerignore. - -# As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: -#ApiClient.cs - -# You can match any string of characters against a directory, file or extension with a single asterisk (*): -#foo/*/qux -# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux - -# You can recursively match patterns against a directory, file or extension with a double asterisk (**): -#foo/**/qux -# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux - -# You can also negate patterns with an exclamation (!). -# For example, you can ignore all files in a docs folder with the file extension .md: -#docs/*.md -# Then explicitly reverse the ignore rule for a single file: -#!docs/README.md diff --git a/validation/api/.openapi-generator/FILES b/validation/api/.openapi-generator/FILES deleted file mode 100644 index 96a7ff9..0000000 --- a/validation/api/.openapi-generator/FILES +++ /dev/null @@ -1,26 +0,0 @@ -.gitignore -.openapi-generator-ignore -.travis.yml -Cargo.toml -README.md -docs/Error.md -docs/Id.md -docs/Pagination.md -docs/Submission.md -docs/SubmissionCreate.md -docs/SubmissionFilter.md -docs/SubmissionsApi.md -docs/User.md -git_push.sh -src/apis/configuration.rs -src/apis/mod.rs -src/apis/submissions_api.rs -src/lib.rs -src/models/error.rs -src/models/id.rs -src/models/mod.rs -src/models/pagination.rs -src/models/submission.rs -src/models/submission_create.rs -src/models/submission_filter.rs -src/models/user.rs diff --git a/validation/api/.openapi-generator/VERSION b/validation/api/.openapi-generator/VERSION deleted file mode 100644 index 758bb9c..0000000 --- a/validation/api/.openapi-generator/VERSION +++ /dev/null @@ -1 +0,0 @@ -7.10.0 diff --git a/validation/api/.travis.yml b/validation/api/.travis.yml deleted file mode 100644 index 22761ba..0000000 --- a/validation/api/.travis.yml +++ /dev/null @@ -1 +0,0 @@ -language: rust diff --git a/validation/api/Cargo.toml b/validation/api/Cargo.toml deleted file mode 100644 index 0b760ce..0000000 --- a/validation/api/Cargo.toml +++ /dev/null @@ -1,16 +0,0 @@ -[package] -name = "openapi" -version = "0.1.0" -authors = ["OpenAPI Generator team and contributors"] -description = "Browse and manage map submissions in the staging pipeline." -# Override this license by providing a License Object in the OpenAPI. -license = "Unlicense" -edition = "2021" - -[dependencies] -serde = { version = "^1.0", features = ["derive"] } -serde_json = "^1.0" -serde_repr = "^0.1" -url = "^2.5" -uuid = { version = "^1.8", features = ["serde", "v4"] } -reqwest = { version = "^0.12", features = ["json", "multipart"] } diff --git a/validation/api/README.md b/validation/api/README.md deleted file mode 100644 index 3d7c737..0000000 --- a/validation/api/README.md +++ /dev/null @@ -1,64 +0,0 @@ -# Rust API client for openapi - -Browse and manage map submissions in the staging pipeline. - - -## Overview - -This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [openapi-spec](https://openapis.org) from a remote server, you can easily generate an API client. - -- API version: 0.1.0 -- Package version: 0.1.0 -- Generator version: 7.10.0 -- Build package: `org.openapitools.codegen.languages.RustClientCodegen` - -## Installation - -Put the package under your project folder in a directory named `openapi` and add the following to `Cargo.toml` under `[dependencies]`: - -``` -openapi = { path = "./openapi" } -``` - -## Documentation for API Endpoints - -All URIs are relative to *https://submissions.strafes.net/v1* - -Class | Method | HTTP request | Description ------------- | ------------- | ------------- | ------------- -*SubmissionsApi* | [**action_submission_publish**](docs/SubmissionsApi.md#action_submission_publish) | **PATCH** /submissions/{SubmissionID}/status/publish | Role Validator changes status from Publishing -> Published -*SubmissionsApi* | [**action_submission_reject**](docs/SubmissionsApi.md#action_submission_reject) | **PATCH** /submissions/{SubmissionID}/status/reject | Role Reviewer changes status from Submitted -> Rejected -*SubmissionsApi* | [**action_submission_request_changes**](docs/SubmissionsApi.md#action_submission_request_changes) | **PATCH** /submissions/{SubmissionID}/status/request-changes | Role Reviewer changes status from Validated|Accepted|Submitted -> ChangesRequested -*SubmissionsApi* | [**action_submission_revoke**](docs/SubmissionsApi.md#action_submission_revoke) | **PATCH** /submissions/{SubmissionID}/status/revoke | Role Submitter changes status from Submitted|ChangesRequested -> UnderConstruction -*SubmissionsApi* | [**action_submission_submit**](docs/SubmissionsApi.md#action_submission_submit) | **PATCH** /submissions/{SubmissionID}/status/submit | Role Submitter changes status from UnderConstruction|ChangesRequested -> Submitted -*SubmissionsApi* | [**action_submission_trigger_publish**](docs/SubmissionsApi.md#action_submission_trigger_publish) | **PATCH** /submissions/{SubmissionID}/status/trigger-publish | Role Admin changes status from Validated -> Publishing -*SubmissionsApi* | [**action_submission_trigger_validate**](docs/SubmissionsApi.md#action_submission_trigger_validate) | **PATCH** /submissions/{SubmissionID}/status/trigger-validate | Role Reviewer triggers validation and changes status from Submitted|Accepted -> Validating -*SubmissionsApi* | [**action_submission_validate**](docs/SubmissionsApi.md#action_submission_validate) | **PATCH** /submissions/{SubmissionID}/status/validate | Role Validator changes status from Validating -> Validated -*SubmissionsApi* | [**create_submission**](docs/SubmissionsApi.md#create_submission) | **POST** /submissions | Create new submission -*SubmissionsApi* | [**get_submission**](docs/SubmissionsApi.md#get_submission) | **GET** /submissions/{SubmissionID} | Retrieve map with ID -*SubmissionsApi* | [**list_submissions**](docs/SubmissionsApi.md#list_submissions) | **GET** /submissions | Get list of submissions -*SubmissionsApi* | [**patch_submission_completed**](docs/SubmissionsApi.md#patch_submission_completed) | **PATCH** /submissions/{SubmissionID}/completed | Retrieve map with ID -*SubmissionsApi* | [**patch_submission_model**](docs/SubmissionsApi.md#patch_submission_model) | **PATCH** /submissions/{SubmissionID}/model | Update model following role restrictions - - -## Documentation For Models - - - [Error](docs/Error.md) - - [Id](docs/Id.md) - - [Pagination](docs/Pagination.md) - - [Submission](docs/Submission.md) - - [SubmissionCreate](docs/SubmissionCreate.md) - - [SubmissionFilter](docs/SubmissionFilter.md) - - [User](docs/User.md) - - -To get access to the crate's generated documentation, use: - -``` -cargo doc --open -``` - -## Author - - - diff --git a/validation/api/docs/Error.md b/validation/api/docs/Error.md deleted file mode 100644 index 7f3b617..0000000 --- a/validation/api/docs/Error.md +++ /dev/null @@ -1,12 +0,0 @@ -# Error - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**code** | **i64** | | -**message** | **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/validation/api/docs/Id.md b/validation/api/docs/Id.md deleted file mode 100644 index 96f5445..0000000 --- a/validation/api/docs/Id.md +++ /dev/null @@ -1,11 +0,0 @@ -# Id - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | Option<**i64**> | | [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/validation/api/docs/Pagination.md b/validation/api/docs/Pagination.md deleted file mode 100644 index c20a154..0000000 --- a/validation/api/docs/Pagination.md +++ /dev/null @@ -1,12 +0,0 @@ -# Pagination - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**page** | **i32** | | -**limit** | **i32** | | - -[[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/validation/api/docs/Submission.md b/validation/api/docs/Submission.md deleted file mode 100644 index 9a5c387..0000000 --- a/validation/api/docs/Submission.md +++ /dev/null @@ -1,22 +0,0 @@ -# Submission - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | Option<**i64**> | | [optional] -**display_name** | Option<**String**> | | [optional] -**creator** | Option<**String**> | | [optional] -**game_id** | Option<**i32**> | | [optional] -**date** | Option<**i64**> | | [optional] -**submitter** | Option<**i64**> | | [optional] -**asset_id** | Option<**i64**> | | [optional] -**asset_version** | Option<**i64**> | | [optional] -**completed** | Option<**bool**> | | [optional] -**submission_type** | Option<**i32**> | | [optional] -**target_asset_id** | Option<**i64**> | | [optional] -**status_id** | Option<**i32**> | | [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/validation/api/docs/SubmissionCreate.md b/validation/api/docs/SubmissionCreate.md deleted file mode 100644 index 42975e7..0000000 --- a/validation/api/docs/SubmissionCreate.md +++ /dev/null @@ -1,18 +0,0 @@ -# SubmissionCreate - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**display_name** | Option<**String**> | | [optional] -**creator** | Option<**String**> | | [optional] -**game_id** | Option<**i32**> | | [optional] -**submitter** | Option<**i64**> | | [optional] -**asset_id** | Option<**i64**> | | [optional] -**asset_version** | Option<**i64**> | | [optional] -**submission_type** | Option<**i32**> | | [optional] -**target_asset_id** | Option<**i64**> | | [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/validation/api/docs/SubmissionFilter.md b/validation/api/docs/SubmissionFilter.md deleted file mode 100644 index 7c7ebf0..0000000 --- a/validation/api/docs/SubmissionFilter.md +++ /dev/null @@ -1,15 +0,0 @@ -# SubmissionFilter - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | Option<**i64**> | | [optional] -**display_name** | Option<**String**> | | [optional] -**creator** | Option<**String**> | | [optional] -**game_id** | Option<**i32**> | | [optional] -**date** | Option<**i64**> | | [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/validation/api/docs/SubmissionsApi.md b/validation/api/docs/SubmissionsApi.md deleted file mode 100644 index 6f64f3a..0000000 --- a/validation/api/docs/SubmissionsApi.md +++ /dev/null @@ -1,388 +0,0 @@ -# \SubmissionsApi - -All URIs are relative to *https://submissions.strafes.net/v1* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**action_submission_publish**](SubmissionsApi.md#action_submission_publish) | **PATCH** /submissions/{SubmissionID}/status/publish | Role Validator changes status from Publishing -> Published -[**action_submission_reject**](SubmissionsApi.md#action_submission_reject) | **PATCH** /submissions/{SubmissionID}/status/reject | Role Reviewer changes status from Submitted -> Rejected -[**action_submission_request_changes**](SubmissionsApi.md#action_submission_request_changes) | **PATCH** /submissions/{SubmissionID}/status/request-changes | Role Reviewer changes status from Validated|Accepted|Submitted -> ChangesRequested -[**action_submission_revoke**](SubmissionsApi.md#action_submission_revoke) | **PATCH** /submissions/{SubmissionID}/status/revoke | Role Submitter changes status from Submitted|ChangesRequested -> UnderConstruction -[**action_submission_submit**](SubmissionsApi.md#action_submission_submit) | **PATCH** /submissions/{SubmissionID}/status/submit | Role Submitter changes status from UnderConstruction|ChangesRequested -> Submitted -[**action_submission_trigger_publish**](SubmissionsApi.md#action_submission_trigger_publish) | **PATCH** /submissions/{SubmissionID}/status/trigger-publish | Role Admin changes status from Validated -> Publishing -[**action_submission_trigger_validate**](SubmissionsApi.md#action_submission_trigger_validate) | **PATCH** /submissions/{SubmissionID}/status/trigger-validate | Role Reviewer triggers validation and changes status from Submitted|Accepted -> Validating -[**action_submission_validate**](SubmissionsApi.md#action_submission_validate) | **PATCH** /submissions/{SubmissionID}/status/validate | Role Validator changes status from Validating -> Validated -[**create_submission**](SubmissionsApi.md#create_submission) | **POST** /submissions | Create new submission -[**get_submission**](SubmissionsApi.md#get_submission) | **GET** /submissions/{SubmissionID} | Retrieve map with ID -[**list_submissions**](SubmissionsApi.md#list_submissions) | **GET** /submissions | Get list of submissions -[**patch_submission_completed**](SubmissionsApi.md#patch_submission_completed) | **PATCH** /submissions/{SubmissionID}/completed | Retrieve map with ID -[**patch_submission_model**](SubmissionsApi.md#patch_submission_model) | **PATCH** /submissions/{SubmissionID}/model | Update model following role restrictions - - - -## action_submission_publish - -> action_submission_publish(submission_id) -Role Validator changes status from Publishing -> Published - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**submission_id** | **i64** | | [required] | - -### Return type - - (empty response body) - -### Authorization - -[cookieAuth](../README.md#cookieAuth) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/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) - - -## action_submission_reject - -> action_submission_reject(submission_id) -Role Reviewer changes status from Submitted -> Rejected - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**submission_id** | **i64** | | [required] | - -### Return type - - (empty response body) - -### Authorization - -[cookieAuth](../README.md#cookieAuth) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/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) - - -## action_submission_request_changes - -> action_submission_request_changes(submission_id) -Role Reviewer changes status from Validated|Accepted|Submitted -> ChangesRequested - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**submission_id** | **i64** | | [required] | - -### Return type - - (empty response body) - -### Authorization - -[cookieAuth](../README.md#cookieAuth) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/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) - - -## action_submission_revoke - -> action_submission_revoke(submission_id) -Role Submitter changes status from Submitted|ChangesRequested -> UnderConstruction - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**submission_id** | **i64** | | [required] | - -### Return type - - (empty response body) - -### Authorization - -[cookieAuth](../README.md#cookieAuth) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/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) - - -## action_submission_submit - -> action_submission_submit(submission_id) -Role Submitter changes status from UnderConstruction|ChangesRequested -> Submitted - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**submission_id** | **i64** | | [required] | - -### Return type - - (empty response body) - -### Authorization - -[cookieAuth](../README.md#cookieAuth) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/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) - - -## action_submission_trigger_publish - -> action_submission_trigger_publish(submission_id) -Role Admin changes status from Validated -> Publishing - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**submission_id** | **i64** | | [required] | - -### Return type - - (empty response body) - -### Authorization - -[cookieAuth](../README.md#cookieAuth) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/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) - - -## action_submission_trigger_validate - -> action_submission_trigger_validate(submission_id) -Role Reviewer triggers validation and changes status from Submitted|Accepted -> Validating - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**submission_id** | **i64** | | [required] | - -### Return type - - (empty response body) - -### Authorization - -[cookieAuth](../README.md#cookieAuth) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/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) - - -## action_submission_validate - -> action_submission_validate(submission_id) -Role Validator changes status from Validating -> Validated - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**submission_id** | **i64** | | [required] | - -### Return type - - (empty response body) - -### Authorization - -[cookieAuth](../README.md#cookieAuth) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/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) - - -## create_submission - -> models::Id create_submission(submission_create) -Create new submission - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**submission_create** | Option<[**SubmissionCreate**](SubmissionCreate.md)> | | | - -### Return type - -[**models::Id**](Id.md) - -### Authorization - -[cookieAuth](../README.md#cookieAuth) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/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) - - -## get_submission - -> models::Submission get_submission(submission_id) -Retrieve map with ID - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**submission_id** | **i64** | | [required] | - -### Return type - -[**models::Submission**](Submission.md) - -### Authorization - -[cookieAuth](../README.md#cookieAuth) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/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) - - -## list_submissions - -> Vec list_submissions(page, filter) -Get list of submissions - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**page** | [**Pagination**](.md) | | [required] | -**filter** | Option<[**SubmissionFilter**](.md)> | | | - -### Return type - -[**Vec**](Submission.md) - -### Authorization - -[cookieAuth](../README.md#cookieAuth) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/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) - - -## patch_submission_completed - -> patch_submission_completed(submission_id) -Retrieve map with ID - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**submission_id** | **i64** | | [required] | - -### Return type - - (empty response body) - -### Authorization - -[cookieAuth](../README.md#cookieAuth) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/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) - - -## patch_submission_model - -> patch_submission_model(submission_id, model_id, version_id) -Update model following role restrictions - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**submission_id** | **i64** | | [required] | -**model_id** | **i64** | | [required] | -**version_id** | **i64** | | [required] | - -### Return type - - (empty response body) - -### Authorization - -[cookieAuth](../README.md#cookieAuth) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/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) - diff --git a/validation/api/docs/User.md b/validation/api/docs/User.md deleted file mode 100644 index 23b72cb..0000000 --- a/validation/api/docs/User.md +++ /dev/null @@ -1,13 +0,0 @@ -# User - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | Option<**i64**> | | [optional] -**username** | Option<**String**> | | [optional] -**state_id** | Option<**i32**> | | [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/validation/api/git_push.sh b/validation/api/git_push.sh deleted file mode 100644 index f53a75d..0000000 --- a/validation/api/git_push.sh +++ /dev/null @@ -1,57 +0,0 @@ -#!/bin/sh -# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ -# -# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" - -git_user_id=$1 -git_repo_id=$2 -release_note=$3 -git_host=$4 - -if [ "$git_host" = "" ]; then - git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" -fi - -if [ "$git_user_id" = "" ]; then - git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" -fi - -if [ "$git_repo_id" = "" ]; then - git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" -fi - -if [ "$release_note" = "" ]; then - release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" -fi - -# Initialize the local directory as a Git repository -git init - -# Adds the files in the local repository and stages them for commit. -git add . - -# Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" - -# Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git - else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git - fi - -fi - -git pull origin master - -# Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" -git push origin master 2>&1 | grep -v 'To https' diff --git a/validation/api/src/apis/configuration.rs b/validation/api/src/apis/configuration.rs deleted file mode 100644 index 7aa9658..0000000 --- a/validation/api/src/apis/configuration.rs +++ /dev/null @@ -1,51 +0,0 @@ -/* - * StrafesNET Submissions - OpenAPI 3.1 - * - * Browse and manage map submissions in the staging pipeline. - * - * The version of the OpenAPI document: 0.1.0 - * - * Generated by: https://openapi-generator.tech - */ - - - -#[derive(Debug, Clone)] -pub struct Configuration { - pub base_path: String, - pub user_agent: Option, - pub client: reqwest::Client, - pub basic_auth: Option, - pub oauth_access_token: Option, - pub bearer_access_token: Option, - pub api_key: Option, -} - -pub type BasicAuth = (String, Option); - -#[derive(Debug, Clone)] -pub struct ApiKey { - pub prefix: Option, - pub key: String, -} - - -impl Configuration { - pub fn new() -> Configuration { - Configuration::default() - } -} - -impl Default for Configuration { - fn default() -> Self { - Configuration { - base_path: "https://submissions.strafes.net/v1".to_owned(), - user_agent: Some("OpenAPI-Generator/0.1.0/rust".to_owned()), - client: reqwest::Client::new(), - basic_auth: None, - oauth_access_token: None, - bearer_access_token: None, - api_key: None, - } - } -} diff --git a/validation/api/src/apis/mod.rs b/validation/api/src/apis/mod.rs deleted file mode 100644 index 2931a60..0000000 --- a/validation/api/src/apis/mod.rs +++ /dev/null @@ -1,95 +0,0 @@ -use std::error; -use std::fmt; - -#[derive(Debug, Clone)] -pub struct ResponseContent { - pub status: reqwest::StatusCode, - pub content: String, - pub entity: Option, -} - -#[derive(Debug)] -pub enum Error { - Reqwest(reqwest::Error), - Serde(serde_json::Error), - Io(std::io::Error), - ResponseError(ResponseContent), -} - -impl fmt::Display for Error { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - let (module, e) = match self { - Error::Reqwest(e) => ("reqwest", e.to_string()), - Error::Serde(e) => ("serde", e.to_string()), - Error::Io(e) => ("IO", e.to_string()), - Error::ResponseError(e) => ("response", format!("status code {}", e.status)), - }; - write!(f, "error in {}: {}", module, e) - } -} - -impl error::Error for Error { - fn source(&self) -> Option<&(dyn error::Error + 'static)> { - Some(match self { - Error::Reqwest(e) => e, - Error::Serde(e) => e, - Error::Io(e) => e, - Error::ResponseError(_) => return None, - }) - } -} - -impl From for Error { - fn from(e: reqwest::Error) -> Self { - Error::Reqwest(e) - } -} - -impl From for Error { - fn from(e: serde_json::Error) -> Self { - Error::Serde(e) - } -} - -impl From for Error { - fn from(e: std::io::Error) -> Self { - Error::Io(e) - } -} - -pub fn urlencode>(s: T) -> String { - ::url::form_urlencoded::byte_serialize(s.as_ref().as_bytes()).collect() -} - -pub fn parse_deep_object(prefix: &str, value: &serde_json::Value) -> Vec<(String, String)> { - if let serde_json::Value::Object(object) = value { - let mut params = vec![]; - - for (key, value) in object { - match value { - serde_json::Value::Object(_) => params.append(&mut parse_deep_object( - &format!("{}[{}]", prefix, key), - value, - )), - serde_json::Value::Array(array) => { - for (i, value) in array.iter().enumerate() { - params.append(&mut parse_deep_object( - &format!("{}[{}][{}]", prefix, key, i), - value, - )); - } - }, - serde_json::Value::String(s) => params.push((format!("{}[{}]", prefix, key), s.clone())), - _ => params.push((format!("{}[{}]", prefix, key), value.to_string())), - } - } - - return params; - } - - unimplemented!("Only objects are supported with style=deepObject") -} - -pub mod submissions_api; - -pub mod configuration; diff --git a/validation/api/src/apis/submissions_api.rs b/validation/api/src/apis/submissions_api.rs deleted file mode 100644 index 929bdb5..0000000 --- a/validation/api/src/apis/submissions_api.rs +++ /dev/null @@ -1,480 +0,0 @@ -/* - * StrafesNET Submissions - OpenAPI 3.1 - * - * Browse and manage map submissions in the staging pipeline. - * - * The version of the OpenAPI document: 0.1.0 - * - * Generated by: https://openapi-generator.tech - */ - - -use reqwest; -use serde::{Deserialize, Serialize}; -use crate::{apis::ResponseContent, models}; -use super::{Error, configuration}; - - -/// struct for typed errors of method [`action_submission_publish`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ActionSubmissionPublishError { - DefaultResponse(models::Error), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`action_submission_reject`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ActionSubmissionRejectError { - DefaultResponse(models::Error), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`action_submission_request_changes`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ActionSubmissionRequestChangesError { - DefaultResponse(models::Error), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`action_submission_revoke`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ActionSubmissionRevokeError { - DefaultResponse(models::Error), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`action_submission_submit`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ActionSubmissionSubmitError { - DefaultResponse(models::Error), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`action_submission_trigger_publish`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ActionSubmissionTriggerPublishError { - DefaultResponse(models::Error), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`action_submission_trigger_validate`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ActionSubmissionTriggerValidateError { - DefaultResponse(models::Error), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`action_submission_validate`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ActionSubmissionValidateError { - DefaultResponse(models::Error), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`create_submission`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum CreateSubmissionError { - DefaultResponse(models::Error), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`get_submission`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum GetSubmissionError { - DefaultResponse(models::Error), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`list_submissions`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ListSubmissionsError { - DefaultResponse(models::Error), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`patch_submission_completed`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PatchSubmissionCompletedError { - DefaultResponse(models::Error), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`patch_submission_model`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PatchSubmissionModelError { - DefaultResponse(models::Error), - UnknownValue(serde_json::Value), -} - - -pub async fn action_submission_publish(configuration: &configuration::Configuration, submission_id: i64) -> Result<(), Error> { - let local_var_configuration = configuration; - - let local_var_client = &local_var_configuration.client; - - let local_var_uri_str = format!("{}/submissions/{SubmissionID}/status/publish", local_var_configuration.base_path, SubmissionID=submission_id); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::PATCH, local_var_uri_str.as_str()); - - if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); - } - - let local_var_req = local_var_req_builder.build()?; - let local_var_resp = local_var_client.execute(local_var_req).await?; - - let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; - - if !local_var_status.is_client_error() && !local_var_status.is_server_error() { - Ok(()) - } else { - let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); - let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; - Err(Error::ResponseError(local_var_error)) - } -} - -pub async fn action_submission_reject(configuration: &configuration::Configuration, submission_id: i64) -> Result<(), Error> { - let local_var_configuration = configuration; - - let local_var_client = &local_var_configuration.client; - - let local_var_uri_str = format!("{}/submissions/{SubmissionID}/status/reject", local_var_configuration.base_path, SubmissionID=submission_id); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::PATCH, local_var_uri_str.as_str()); - - if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); - } - - let local_var_req = local_var_req_builder.build()?; - let local_var_resp = local_var_client.execute(local_var_req).await?; - - let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; - - if !local_var_status.is_client_error() && !local_var_status.is_server_error() { - Ok(()) - } else { - let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); - let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; - Err(Error::ResponseError(local_var_error)) - } -} - -pub async fn action_submission_request_changes(configuration: &configuration::Configuration, submission_id: i64) -> Result<(), Error> { - let local_var_configuration = configuration; - - let local_var_client = &local_var_configuration.client; - - let local_var_uri_str = format!("{}/submissions/{SubmissionID}/status/request-changes", local_var_configuration.base_path, SubmissionID=submission_id); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::PATCH, local_var_uri_str.as_str()); - - if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); - } - - let local_var_req = local_var_req_builder.build()?; - let local_var_resp = local_var_client.execute(local_var_req).await?; - - let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; - - if !local_var_status.is_client_error() && !local_var_status.is_server_error() { - Ok(()) - } else { - let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); - let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; - Err(Error::ResponseError(local_var_error)) - } -} - -pub async fn action_submission_revoke(configuration: &configuration::Configuration, submission_id: i64) -> Result<(), Error> { - let local_var_configuration = configuration; - - let local_var_client = &local_var_configuration.client; - - let local_var_uri_str = format!("{}/submissions/{SubmissionID}/status/revoke", local_var_configuration.base_path, SubmissionID=submission_id); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::PATCH, local_var_uri_str.as_str()); - - if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); - } - - let local_var_req = local_var_req_builder.build()?; - let local_var_resp = local_var_client.execute(local_var_req).await?; - - let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; - - if !local_var_status.is_client_error() && !local_var_status.is_server_error() { - Ok(()) - } else { - let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); - let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; - Err(Error::ResponseError(local_var_error)) - } -} - -pub async fn action_submission_submit(configuration: &configuration::Configuration, submission_id: i64) -> Result<(), Error> { - let local_var_configuration = configuration; - - let local_var_client = &local_var_configuration.client; - - let local_var_uri_str = format!("{}/submissions/{SubmissionID}/status/submit", local_var_configuration.base_path, SubmissionID=submission_id); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::PATCH, local_var_uri_str.as_str()); - - if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); - } - - let local_var_req = local_var_req_builder.build()?; - let local_var_resp = local_var_client.execute(local_var_req).await?; - - let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; - - if !local_var_status.is_client_error() && !local_var_status.is_server_error() { - Ok(()) - } else { - let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); - let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; - Err(Error::ResponseError(local_var_error)) - } -} - -pub async fn action_submission_trigger_publish(configuration: &configuration::Configuration, submission_id: i64) -> Result<(), Error> { - let local_var_configuration = configuration; - - let local_var_client = &local_var_configuration.client; - - let local_var_uri_str = format!("{}/submissions/{SubmissionID}/status/trigger-publish", local_var_configuration.base_path, SubmissionID=submission_id); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::PATCH, local_var_uri_str.as_str()); - - if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); - } - - let local_var_req = local_var_req_builder.build()?; - let local_var_resp = local_var_client.execute(local_var_req).await?; - - let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; - - if !local_var_status.is_client_error() && !local_var_status.is_server_error() { - Ok(()) - } else { - let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); - let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; - Err(Error::ResponseError(local_var_error)) - } -} - -pub async fn action_submission_trigger_validate(configuration: &configuration::Configuration, submission_id: i64) -> Result<(), Error> { - let local_var_configuration = configuration; - - let local_var_client = &local_var_configuration.client; - - let local_var_uri_str = format!("{}/submissions/{SubmissionID}/status/trigger-validate", local_var_configuration.base_path, SubmissionID=submission_id); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::PATCH, local_var_uri_str.as_str()); - - if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); - } - - let local_var_req = local_var_req_builder.build()?; - let local_var_resp = local_var_client.execute(local_var_req).await?; - - let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; - - if !local_var_status.is_client_error() && !local_var_status.is_server_error() { - Ok(()) - } else { - let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); - let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; - Err(Error::ResponseError(local_var_error)) - } -} - -pub async fn action_submission_validate(configuration: &configuration::Configuration, submission_id: i64) -> Result<(), Error> { - let local_var_configuration = configuration; - - let local_var_client = &local_var_configuration.client; - - let local_var_uri_str = format!("{}/submissions/{SubmissionID}/status/validate", local_var_configuration.base_path, SubmissionID=submission_id); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::PATCH, local_var_uri_str.as_str()); - - if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); - } - - let local_var_req = local_var_req_builder.build()?; - let local_var_resp = local_var_client.execute(local_var_req).await?; - - let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; - - if !local_var_status.is_client_error() && !local_var_status.is_server_error() { - Ok(()) - } else { - let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); - let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; - Err(Error::ResponseError(local_var_error)) - } -} - -pub async fn create_submission(configuration: &configuration::Configuration, submission_create: Option) -> Result> { - let local_var_configuration = configuration; - - let local_var_client = &local_var_configuration.client; - - let local_var_uri_str = format!("{}/submissions", local_var_configuration.base_path); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); - - if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); - } - local_var_req_builder = local_var_req_builder.json(&submission_create); - - let local_var_req = local_var_req_builder.build()?; - let local_var_resp = local_var_client.execute(local_var_req).await?; - - let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; - - if !local_var_status.is_client_error() && !local_var_status.is_server_error() { - serde_json::from_str(&local_var_content).map_err(Error::from) - } else { - let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); - let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; - Err(Error::ResponseError(local_var_error)) - } -} - -pub async fn get_submission(configuration: &configuration::Configuration, submission_id: i64) -> Result> { - let local_var_configuration = configuration; - - let local_var_client = &local_var_configuration.client; - - let local_var_uri_str = format!("{}/submissions/{SubmissionID}", local_var_configuration.base_path, SubmissionID=submission_id); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); - - if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); - } - - let local_var_req = local_var_req_builder.build()?; - let local_var_resp = local_var_client.execute(local_var_req).await?; - - let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; - - if !local_var_status.is_client_error() && !local_var_status.is_server_error() { - serde_json::from_str(&local_var_content).map_err(Error::from) - } else { - let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); - let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; - Err(Error::ResponseError(local_var_error)) - } -} - -pub async fn list_submissions(configuration: &configuration::Configuration, page: models::Pagination, filter: Option) -> Result, Error> { - let local_var_configuration = configuration; - - let local_var_client = &local_var_configuration.client; - - let local_var_uri_str = format!("{}/submissions", local_var_configuration.base_path); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); - - local_var_req_builder = local_var_req_builder.query(&[("page", &page.to_string())]); - if let Some(ref local_var_str) = filter { - local_var_req_builder = local_var_req_builder.query(&[("filter", &local_var_str.to_string())]); - } - if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); - } - - let local_var_req = local_var_req_builder.build()?; - let local_var_resp = local_var_client.execute(local_var_req).await?; - - let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; - - if !local_var_status.is_client_error() && !local_var_status.is_server_error() { - serde_json::from_str(&local_var_content).map_err(Error::from) - } else { - let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); - let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; - Err(Error::ResponseError(local_var_error)) - } -} - -pub async fn patch_submission_completed(configuration: &configuration::Configuration, submission_id: i64) -> Result<(), Error> { - let local_var_configuration = configuration; - - let local_var_client = &local_var_configuration.client; - - let local_var_uri_str = format!("{}/submissions/{SubmissionID}/completed", local_var_configuration.base_path, SubmissionID=submission_id); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::PATCH, local_var_uri_str.as_str()); - - if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); - } - - let local_var_req = local_var_req_builder.build()?; - let local_var_resp = local_var_client.execute(local_var_req).await?; - - let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; - - if !local_var_status.is_client_error() && !local_var_status.is_server_error() { - Ok(()) - } else { - let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); - let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; - Err(Error::ResponseError(local_var_error)) - } -} - -pub async fn patch_submission_model(configuration: &configuration::Configuration, submission_id: i64, model_id: i64, version_id: i64) -> Result<(), Error> { - let local_var_configuration = configuration; - - let local_var_client = &local_var_configuration.client; - - let local_var_uri_str = format!("{}/submissions/{SubmissionID}/model", local_var_configuration.base_path, SubmissionID=submission_id); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::PATCH, local_var_uri_str.as_str()); - - local_var_req_builder = local_var_req_builder.query(&[("ModelID", &model_id.to_string())]); - local_var_req_builder = local_var_req_builder.query(&[("VersionID", &version_id.to_string())]); - if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); - } - - let local_var_req = local_var_req_builder.build()?; - let local_var_resp = local_var_client.execute(local_var_req).await?; - - let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; - - if !local_var_status.is_client_error() && !local_var_status.is_server_error() { - Ok(()) - } else { - let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); - let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; - Err(Error::ResponseError(local_var_error)) - } -} - diff --git a/validation/api/src/lib.rs b/validation/api/src/lib.rs deleted file mode 100644 index e152062..0000000 --- a/validation/api/src/lib.rs +++ /dev/null @@ -1,11 +0,0 @@ -#![allow(unused_imports)] -#![allow(clippy::too_many_arguments)] - -extern crate serde_repr; -extern crate serde; -extern crate serde_json; -extern crate url; -extern crate reqwest; - -pub mod apis; -pub mod models; diff --git a/validation/api/src/models/error.rs b/validation/api/src/models/error.rs deleted file mode 100644 index d15c676..0000000 --- a/validation/api/src/models/error.rs +++ /dev/null @@ -1,32 +0,0 @@ -/* - * StrafesNET Submissions - OpenAPI 3.1 - * - * Browse and manage map submissions in the staging pipeline. - * - * The version of the OpenAPI document: 0.1.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// Error : Represents error object -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct Error { - #[serde(rename = "code")] - pub code: i64, - #[serde(rename = "message")] - pub message: String, -} - -impl Error { - /// Represents error object - pub fn new(code: i64, message: String) -> Error { - Error { - code, - message, - } - } -} - diff --git a/validation/api/src/models/id.rs b/validation/api/src/models/id.rs deleted file mode 100644 index 02e8996..0000000 --- a/validation/api/src/models/id.rs +++ /dev/null @@ -1,27 +0,0 @@ -/* - * StrafesNET Submissions - OpenAPI 3.1 - * - * Browse and manage map submissions in the staging pipeline. - * - * The version of the OpenAPI document: 0.1.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct Id { - #[serde(rename = "ID", skip_serializing_if = "Option::is_none")] - pub id: Option, -} - -impl Id { - pub fn new() -> Id { - Id { - id: None, - } - } -} - diff --git a/validation/api/src/models/mod.rs b/validation/api/src/models/mod.rs deleted file mode 100644 index 6bfd3d4..0000000 --- a/validation/api/src/models/mod.rs +++ /dev/null @@ -1,14 +0,0 @@ -pub mod error; -pub use self::error::Error; -pub mod id; -pub use self::id::Id; -pub mod pagination; -pub use self::pagination::Pagination; -pub mod submission; -pub use self::submission::Submission; -pub mod submission_create; -pub use self::submission_create::SubmissionCreate; -pub mod submission_filter; -pub use self::submission_filter::SubmissionFilter; -pub mod user; -pub use self::user::User; diff --git a/validation/api/src/models/pagination.rs b/validation/api/src/models/pagination.rs deleted file mode 100644 index 21d4236..0000000 --- a/validation/api/src/models/pagination.rs +++ /dev/null @@ -1,30 +0,0 @@ -/* - * StrafesNET Submissions - OpenAPI 3.1 - * - * Browse and manage map submissions in the staging pipeline. - * - * The version of the OpenAPI document: 0.1.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct Pagination { - #[serde(rename = "Page")] - pub page: i32, - #[serde(rename = "Limit")] - pub limit: i32, -} - -impl Pagination { - pub fn new(page: i32, limit: i32) -> Pagination { - Pagination { - page, - limit, - } - } -} - diff --git a/validation/api/src/models/submission.rs b/validation/api/src/models/submission.rs deleted file mode 100644 index a15092a..0000000 --- a/validation/api/src/models/submission.rs +++ /dev/null @@ -1,60 +0,0 @@ -/* - * StrafesNET Submissions - OpenAPI 3.1 - * - * Browse and manage map submissions in the staging pipeline. - * - * The version of the OpenAPI document: 0.1.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct Submission { - #[serde(rename = "ID", skip_serializing_if = "Option::is_none")] - pub id: Option, - #[serde(rename = "DisplayName", skip_serializing_if = "Option::is_none")] - pub display_name: Option, - #[serde(rename = "Creator", skip_serializing_if = "Option::is_none")] - pub creator: Option, - #[serde(rename = "GameID", skip_serializing_if = "Option::is_none")] - pub game_id: Option, - #[serde(rename = "Date", skip_serializing_if = "Option::is_none")] - pub date: Option, - #[serde(rename = "Submitter", skip_serializing_if = "Option::is_none")] - pub submitter: Option, - #[serde(rename = "AssetID", skip_serializing_if = "Option::is_none")] - pub asset_id: Option, - #[serde(rename = "AssetVersion", skip_serializing_if = "Option::is_none")] - pub asset_version: Option, - #[serde(rename = "Completed", skip_serializing_if = "Option::is_none")] - pub completed: Option, - #[serde(rename = "SubmissionType", skip_serializing_if = "Option::is_none")] - pub submission_type: Option, - #[serde(rename = "TargetAssetID", skip_serializing_if = "Option::is_none")] - pub target_asset_id: Option, - #[serde(rename = "StatusID", skip_serializing_if = "Option::is_none")] - pub status_id: Option, -} - -impl Submission { - pub fn new() -> Submission { - Submission { - id: None, - display_name: None, - creator: None, - game_id: None, - date: None, - submitter: None, - asset_id: None, - asset_version: None, - completed: None, - submission_type: None, - target_asset_id: None, - status_id: None, - } - } -} - diff --git a/validation/api/src/models/submission_create.rs b/validation/api/src/models/submission_create.rs deleted file mode 100644 index 2ed12c9..0000000 --- a/validation/api/src/models/submission_create.rs +++ /dev/null @@ -1,48 +0,0 @@ -/* - * StrafesNET Submissions - OpenAPI 3.1 - * - * Browse and manage map submissions in the staging pipeline. - * - * The version of the OpenAPI document: 0.1.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct SubmissionCreate { - #[serde(rename = "DisplayName", skip_serializing_if = "Option::is_none")] - pub display_name: Option, - #[serde(rename = "Creator", skip_serializing_if = "Option::is_none")] - pub creator: Option, - #[serde(rename = "GameID", skip_serializing_if = "Option::is_none")] - pub game_id: Option, - #[serde(rename = "Submitter", skip_serializing_if = "Option::is_none")] - pub submitter: Option, - #[serde(rename = "AssetID", skip_serializing_if = "Option::is_none")] - pub asset_id: Option, - #[serde(rename = "AssetVersion", skip_serializing_if = "Option::is_none")] - pub asset_version: Option, - #[serde(rename = "SubmissionType", skip_serializing_if = "Option::is_none")] - pub submission_type: Option, - #[serde(rename = "TargetAssetID", skip_serializing_if = "Option::is_none")] - pub target_asset_id: Option, -} - -impl SubmissionCreate { - pub fn new() -> SubmissionCreate { - SubmissionCreate { - display_name: None, - creator: None, - game_id: None, - submitter: None, - asset_id: None, - asset_version: None, - submission_type: None, - target_asset_id: None, - } - } -} - diff --git a/validation/api/src/models/submission_filter.rs b/validation/api/src/models/submission_filter.rs deleted file mode 100644 index 6222994..0000000 --- a/validation/api/src/models/submission_filter.rs +++ /dev/null @@ -1,39 +0,0 @@ -/* - * StrafesNET Submissions - OpenAPI 3.1 - * - * Browse and manage map submissions in the staging pipeline. - * - * The version of the OpenAPI document: 0.1.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct SubmissionFilter { - #[serde(rename = "ID", skip_serializing_if = "Option::is_none")] - pub id: Option, - #[serde(rename = "DisplayName", skip_serializing_if = "Option::is_none")] - pub display_name: Option, - #[serde(rename = "Creator", skip_serializing_if = "Option::is_none")] - pub creator: Option, - #[serde(rename = "GameID", skip_serializing_if = "Option::is_none")] - pub game_id: Option, - #[serde(rename = "Date", skip_serializing_if = "Option::is_none")] - pub date: Option, -} - -impl SubmissionFilter { - pub fn new() -> SubmissionFilter { - SubmissionFilter { - id: None, - display_name: None, - creator: None, - game_id: None, - date: None, - } - } -} - diff --git a/validation/api/src/models/user.rs b/validation/api/src/models/user.rs deleted file mode 100644 index 92e6459..0000000 --- a/validation/api/src/models/user.rs +++ /dev/null @@ -1,33 +0,0 @@ -/* - * StrafesNET Submissions - OpenAPI 3.1 - * - * Browse and manage map submissions in the staging pipeline. - * - * The version of the OpenAPI document: 0.1.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct User { - #[serde(rename = "ID", skip_serializing_if = "Option::is_none")] - pub id: Option, - #[serde(rename = "Username", skip_serializing_if = "Option::is_none")] - pub username: Option, - #[serde(rename = "StateID", skip_serializing_if = "Option::is_none")] - pub state_id: Option, -} - -impl User { - pub fn new() -> User { - User { - id: None, - username: None, - state_id: None, - } - } -} -