Skip to content

Commit

Permalink
Generate models for Task API
Browse files Browse the repository at this point in the history
  • Loading branch information
4Ply committed Jan 2, 2024
1 parent 1ab6654 commit 336dd7c
Show file tree
Hide file tree
Showing 11 changed files with 791 additions and 8 deletions.
8 changes: 8 additions & 0 deletions .openapi-generator/FILES
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,13 @@ docs/EventsGet200Response.md
docs/EventsPostRequest.md
docs/InventoryApi.md
docs/InventoryCardsGet200Response.md
docs/Task.md
docs/TasksApi.md
docs/TasksGet200Response.md
docs/TasksIdPatchRequest.md
src/main/kotlin/org/trackedout/client/apis/EventsApi.kt
src/main/kotlin/org/trackedout/client/apis/InventoryApi.kt
src/main/kotlin/org/trackedout/client/apis/TasksApi.kt
src/main/kotlin/org/trackedout/client/infrastructure/ApiAbstractions.kt
src/main/kotlin/org/trackedout/client/infrastructure/ApiClient.kt
src/main/kotlin/org/trackedout/client/infrastructure/ApiResponse.kt
Expand All @@ -31,3 +36,6 @@ src/main/kotlin/org/trackedout/client/models/Event.kt
src/main/kotlin/org/trackedout/client/models/EventsGet200Response.kt
src/main/kotlin/org/trackedout/client/models/EventsPostRequest.kt
src/main/kotlin/org/trackedout/client/models/InventoryCardsGet200Response.kt
src/main/kotlin/org/trackedout/client/models/Task.kt
src/main/kotlin/org/trackedout/client/models/TasksGet200Response.kt
src/main/kotlin/org/trackedout/client/models/TasksIdPatchRequest.kt
8 changes: 2 additions & 6 deletions docs/EventsApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,7 @@ Name | Type | Description | Notes

### Authorization


Configure bearerAuth:
ApiClient.accessToken = ""
No authorization required

### HTTP request headers

Expand Down Expand Up @@ -107,9 +105,7 @@ Name | Type | Description | Notes

### Authorization


Configure bearerAuth:
ApiClient.accessToken = ""
No authorization required

### HTTP request headers

Expand Down
15 changes: 15 additions & 0 deletions docs/Task.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@

# Task

## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**id** | **kotlin.String** | | [optional]
**type** | **kotlin.String** | | [optional]
**arguments** | **kotlin.collections.List<kotlin.String>** | | [optional]
**targetPlayer** | **kotlin.String** | | [optional]
**server** | **kotlin.String** | | [optional]
**sourceIP** | **kotlin.String** | | [optional]



214 changes: 214 additions & 0 deletions docs/TasksApi.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,214 @@
# TasksApi

All URIs are relative to *http://localhost:3000/v1*

Method | HTTP request | Description
------------- | ------------- | -------------
[**tasksGet**](TasksApi.md#tasksGet) | **GET** /tasks | Get all tasks
[**tasksIdGet**](TasksApi.md#tasksIdGet) | **GET** /tasks/{id} | Get a task
[**tasksIdPatch**](TasksApi.md#tasksIdPatch) | **PATCH** /tasks/{id} | Update a task
[**tasksPost**](TasksApi.md#tasksPost) | **POST** /tasks | Create a task


<a id="tasksGet"></a>
# **tasksGet**
> TasksGet200Response tasksGet(server, type, state, sortBy, projectBy, limit, page)
Get all tasks

Retrieve tasks, typically filtered for a specific server for it to action.

### Example
```kotlin
// Import classes:
//import org.trackedout.client.infrastructure.*
//import org.trackedout.client.models.*

val apiInstance = TasksApi()
val server : kotlin.String = server_example // kotlin.String | Server name
val type : kotlin.String = type_example // kotlin.String | Task type
val state : kotlin.String = state_example // kotlin.String | Task state
val sortBy : kotlin.String = sortBy_example // kotlin.String | sort by query in the form of field:desc/asc (ex. name:asc)
val projectBy : kotlin.String = projectBy_example // kotlin.String | project by query in the form of field:hide/include (ex. name:hide)
val limit : kotlin.Int = 56 // kotlin.Int | Maximum number of tasks
val page : kotlin.Int = 56 // kotlin.Int | Page number
try {
val result : TasksGet200Response = apiInstance.tasksGet(server, type, state, sortBy, projectBy, limit, page)
println(result)
} catch (e: ClientException) {
println("4xx response calling TasksApi#tasksGet")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling TasksApi#tasksGet")
e.printStackTrace()
}
```

### Parameters

Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**server** | **kotlin.String**| Server name | [optional]
**type** | **kotlin.String**| Task type | [optional]
**state** | **kotlin.String**| Task state | [optional]
**sortBy** | **kotlin.String**| sort by query in the form of field:desc/asc (ex. name:asc) | [optional]
**projectBy** | **kotlin.String**| project by query in the form of field:hide/include (ex. name:hide) | [optional]
**limit** | **kotlin.Int**| Maximum number of tasks | [optional]
**page** | **kotlin.Int**| Page number | [optional] [default to 1]

### Return type

[**TasksGet200Response**](TasksGet200Response.md)

### Authorization

No authorization required

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json

<a id="tasksIdGet"></a>
# **tasksIdGet**
> Task tasksIdGet(id)
Get a task

Get a task by ID

### Example
```kotlin
// Import classes:
//import org.trackedout.client.infrastructure.*
//import org.trackedout.client.models.*

val apiInstance = TasksApi()
val id : kotlin.String = id_example // kotlin.String | Task ID
try {
val result : Task = apiInstance.tasksIdGet(id)
println(result)
} catch (e: ClientException) {
println("4xx response calling TasksApi#tasksIdGet")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling TasksApi#tasksIdGet")
e.printStackTrace()
}
```

### Parameters

Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**id** | **kotlin.String**| Task ID |

### Return type

[**Task**](Task.md)

### Authorization

No authorization required

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json

<a id="tasksIdPatch"></a>
# **tasksIdPatch**
> Task tasksIdPatch(id, tasksIdPatchRequest)
Update a task

Update a task&#39;s state to one of [ \&quot;SCHEDULED\&quot;, \&quot;IN_PROGRESS\&quot;, \&quot;SUCCEEDED\&quot;, \&quot;FAILED\&quot; ]

### Example
```kotlin
// Import classes:
//import org.trackedout.client.infrastructure.*
//import org.trackedout.client.models.*

val apiInstance = TasksApi()
val id : kotlin.String = id_example // kotlin.String | Task id
val tasksIdPatchRequest : TasksIdPatchRequest = // TasksIdPatchRequest |
try {
val result : Task = apiInstance.tasksIdPatch(id, tasksIdPatchRequest)
println(result)
} catch (e: ClientException) {
println("4xx response calling TasksApi#tasksIdPatch")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling TasksApi#tasksIdPatch")
e.printStackTrace()
}
```

### Parameters

Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**id** | **kotlin.String**| Task id |
**tasksIdPatchRequest** | [**TasksIdPatchRequest**](TasksIdPatchRequest.md)| |

### Return type

[**Task**](Task.md)

### Authorization

No authorization required

### HTTP request headers

- **Content-Type**: application/json
- **Accept**: application/json

<a id="tasksPost"></a>
# **tasksPost**
> Task tasksPost(task)
Create a task

Schedule a remote task for one of the Decked Out 2 instances.

### Example
```kotlin
// Import classes:
//import org.trackedout.client.infrastructure.*
//import org.trackedout.client.models.*

val apiInstance = TasksApi()
val task : Task = // Task |
try {
val result : Task = apiInstance.tasksPost(task)
println(result)
} catch (e: ClientException) {
println("4xx response calling TasksApi#tasksPost")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling TasksApi#tasksPost")
e.printStackTrace()
}
```

### Parameters

Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**task** | [**Task**](Task.md)| |

### Return type

[**Task**](Task.md)

### Authorization

No authorization required

### HTTP request headers

- **Content-Type**: application/json
- **Accept**: application/json

14 changes: 14 additions & 0 deletions docs/TasksGet200Response.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@

# TasksGet200Response

## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**results** | [**kotlin.collections.List&lt;Task&gt;**](Task.md) | | [optional]
**page** | **kotlin.Int** | | [optional]
**limit** | **kotlin.Int** | | [optional]
**totalPages** | **kotlin.Int** | | [optional]
**totalResults** | **kotlin.Int** | | [optional]



10 changes: 10 additions & 0 deletions docs/TasksIdPatchRequest.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@

# TasksIdPatchRequest

## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**state** | **kotlin.String** | | [optional]



4 changes: 2 additions & 2 deletions src/main/kotlin/org/trackedout/client/apis/EventsApi.kt
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ class EventsApi(basePath: kotlin.String = defaultBasePath, client: OkHttpClient
path = "/events",
query = localVariableQuery,
headers = localVariableHeaders,
requiresAuthentication = true,
requiresAuthentication = false,
body = localVariableBody
)
}
Expand Down Expand Up @@ -221,7 +221,7 @@ class EventsApi(basePath: kotlin.String = defaultBasePath, client: OkHttpClient
path = "/events",
query = localVariableQuery,
headers = localVariableHeaders,
requiresAuthentication = true,
requiresAuthentication = false,
body = localVariableBody
)
}
Expand Down
Loading

0 comments on commit 336dd7c

Please sign in to comment.