Skip to content

Commit

Permalink
Use reqwest-trait and mock out the client.
Browse files Browse the repository at this point in the history
  • Loading branch information
RobbieMcKinstry committed Feb 26, 2025
1 parent b8e23c2 commit 5708e13
Show file tree
Hide file tree
Showing 63 changed files with 969 additions and 704 deletions.
2 changes: 1 addition & 1 deletion .openapi-generator/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
7.4.0
7.11.0
22 changes: 12 additions & 10 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
[package]
name = "openapi"
name = "multitool-sdk"
version = "0.1.0"
authors = ["OpenAPI Generator team and contributors"]
description = "MultiTool backend API"
license = "All Rights Reserved"
edition = "2018"
edition = "2021"

[dependencies]
serde = "^1.0"
serde_derive = "^1.0"
async-trait = "^0.1"
mockall = { version = "^0.13", optional = true }
reqwest = { version = "^0.12", features = ["json", "multipart"] }
serde = { version = "^1.0", features = ["derive"] }
serde_json = "^1.0"
serde_with = "^2.0"
url = "^2.2"
uuid = { version = "^1.0", features = ["serde", "v4"] }
[dependencies.reqwest]
version = "^0.11"
features = ["json", "multipart"]
serde_repr = "^0.1"
serde_with = { version = "^3.8", default-features = false, features = ["base64", "std", "macros"] }
url = "^2.5"
uuid = { version = "^1.8", features = ["serde", "v4"] }
[features]
mockall = ["dep:mockall"]
9 changes: 8 additions & 1 deletion Makefile.toml
Original file line number Diff line number Diff line change
Expand Up @@ -74,15 +74,22 @@ dependencies = [
]


# TODO: Consider piping in the package version from Cargo.toml
# if the generator is producing the wrong library version.
[tasks.generate-sdk]
description = "Generate the SDK. Does not fmt or sort the output. Use `cargo make generate` instead."
private = true
script = [
'''
docker run --rm -v "$PWD:/local" \
openapitools/openapi-generator-cli:v7.4.0 generate \
openapitools/openapi-generator-cli:v7.11.0 generate \
-i /local/openapi.json \
-g rust \
--additional-properties library=reqwest-trait \
--additional-properties mockall=true \
--additional-properties packageName=multitool-sdk \
--additional-properties preferUnsignedInt=true \
-o /local/
'''
]
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Rust API client for openapi
# Rust API client for multitool-sdk

MultiTool backend API

Expand All @@ -9,15 +9,15 @@ This API client was generated by the [OpenAPI Generator](https://openapi-generat

- API version: 0.1.0
- Package version: 0.1.0
- Generator version: 7.4.0
- Generator version: 7.11.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]`:
Put the package under your project folder in a directory named `multitool-sdk` and add the following to `Cargo.toml` under `[dependencies]`:

```
openapi = { path = "./openapi" }
multitool-sdk = { path = "./multitool-sdk" }
```

## Documentation for API Endpoints
Expand Down
2 changes: 1 addition & 1 deletion docs/Deployment.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Name | Type | Description | Notes
**app_id** | [**uuid::Uuid**](uuid::Uuid.md) | |
**created_at** | **String** | |
**events** | [**Vec<models::DeploymentEvent>**](DeploymentEvent.md) | |
**id** | **i64** | |
**id** | **u64** | |
**status** | [**models::DeploymentStatus**](DeploymentStatus.md) | |
**updated_at** | **String** | |

Expand Down
2 changes: 1 addition & 1 deletion docs/DeploymentEvent.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**created_at** | **String** | |
**event_type** | [**models::DeploymentEventType**](DeploymentEventType.md) | |
**id** | **i64** | |
**id** | **u64** | |
**updated_at** | **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)
Expand Down
2 changes: 1 addition & 1 deletion docs/DeploymentsApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ Name | Type | Description | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**workspace_id** | **uuid::Uuid** | The workspace's id | [required] |
**application_id** | **uuid::Uuid** | The application's id | [required] |
**deployment_id** | **i64** | The deployment's id | [required] |
**deployment_id** | **u64** | The deployment's id | [required] |

### Return type

Expand Down
2 changes: 1 addition & 1 deletion docs/ResponseCodeMetrics.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**app_class** | [**models::ApplicationGroup**](ApplicationGroup.md) | |
**created_at** | **String** | |
**deployment_id** | **i64** | |
**deployment_id** | **u64** | |
**status_2xx_count** | **i32** | |
**status_4xx_count** | **i32** | |
**status_5xx_count** | **i32** | |
Expand Down
2 changes: 1 addition & 1 deletion docs/ResponseCodeMetricsApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Name | Type | Description | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**workspace_id** | **uuid::Uuid** | The workspace's id | [required] |
**application_id** | **uuid::Uuid** | The application's id | [required] |
**deployment_id** | **i64** | The deployment's id | [required] |
**deployment_id** | **u64** | The deployment's id | [required] |
**create_response_code_metrics_request** | [**CreateResponseCodeMetricsRequest**](CreateResponseCodeMetricsRequest.md) | | [required] |

### Return type
Expand Down
Loading

0 comments on commit 5708e13

Please sign in to comment.