README.md•6.04 kB
# java-client
GameBrain API
- API version: 1.0.1
- Generator version: 7.8.0-SNAPSHOT
GameBrain API
*Automatically generated by the [OpenAPI Generator](https://openapi-generator.tech)*
## Requirements
Building the API client library requires:
1. Java 1.8+
2. Maven (3.8.3+)/Gradle (7.2+)
## Installation
To install the API client library to your local Maven repository, simply execute:
```shell
mvn clean install
```
To deploy it to a remote Maven repository instead, configure the settings of the repository and execute:
```shell
mvn clean deploy
```
Refer to the [OSSRH Guide](http://central.sonatype.org/pages/ossrh-guide.html) for more information.
### Maven users
Add this dependency to your project's POM:
```xml
<dependency>
<groupId>co.gamebrain</groupId>
<artifactId>java-client</artifactId>
<version>1.0.2</version>
<scope>compile</scope>
</dependency>
```
### Gradle users
Add this dependency to your project's build file:
```groovy
repositories {
mavenCentral() // Needed if the 'java-client' jar has been published to maven central.
mavenLocal() // Needed if the 'java-client' jar has been published to the local maven repo.
}
dependencies {
implementation "co.gamebrain:java-client:1.0.2"
}
```
### Others
At first generate the JAR by executing:
```shell
mvn clean package
```
Then manually install the following JARs:
* `target/java-client-1.0.2.jar`
* `target/lib/*.jar`
## Getting Started
Please follow the [installation](#installation) instruction and execute the following Java code:
```java
// Import classes:
import co.gamebrain.client.ApiClient;
import co.gamebrain.client.ApiException;
import co.gamebrain.client.Configuration;
import co.gamebrain.client.auth.*;
import co.gamebrain.client.models.*;
import co.gamebrain.DefaultApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gamebrain.co/v1");
// Configure API key authorization: apiKey
ApiKeyAuth apiKey = (ApiKeyAuth) defaultClient.getAuthentication("apiKey");
apiKey.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//apiKey.setApiKeyPrefix("Token");
// Configure API key authorization: headerApiKey
ApiKeyAuth headerApiKey = (ApiKeyAuth) defaultClient.getAuthentication("headerApiKey");
headerApiKey.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//headerApiKey.setApiKeyPrefix("Token");
DefaultApi apiInstance = new DefaultApi(defaultClient);
Integer id = 56; // Integer | The unique identifier of the game.
String apiKey = "abc123"; // String | Your API key for authentication.
try {
GameResponse result = apiInstance.detail(id, apiKey);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling DefaultApi#detail");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
```
## Documentation for API Endpoints
All URIs are relative to *https://api.gamebrain.co/v1*
Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
*DefaultApi* | [**detail**](docs/DefaultApi.md#detail) | **GET** /games/{id} | Get Game Details
*DefaultApi* | [**news**](docs/DefaultApi.md#news) | **GET** /games/{id}/news | Get Game News
*DefaultApi* | [**search**](docs/DefaultApi.md#search) | **GET** /games | Search Games
*DefaultApi* | [**similar**](docs/DefaultApi.md#similar) | **GET** /games/{id}/similar | Get Similar Games
*DefaultApi* | [**suggest**](docs/DefaultApi.md#suggest) | **GET** /games/suggestions | Get Game Suggestions
## Documentation for Models
- [GameNewsItem](docs/GameNewsItem.md)
- [GameNewsResponse](docs/GameNewsResponse.md)
- [GameResponse](docs/GameResponse.md)
- [GameResponseOffersInner](docs/GameResponseOffersInner.md)
- [GameResponseOffersInnerPrice](docs/GameResponseOffersInnerPrice.md)
- [GameResponseOfficialStoresInner](docs/GameResponseOfficialStoresInner.md)
- [GameResponsePlatformsInner](docs/GameResponsePlatformsInner.md)
- [GameResponsePlaytime](docs/GameResponsePlaytime.md)
- [GameResponseRating](docs/GameResponseRating.md)
- [SearchResponse](docs/SearchResponse.md)
- [SearchResponseActiveFilterOptionsInner](docs/SearchResponseActiveFilterOptionsInner.md)
- [SearchResponseActiveFilterOptionsInnerValuesInner](docs/SearchResponseActiveFilterOptionsInnerValuesInner.md)
- [SearchResponseFilterOptionsInner](docs/SearchResponseFilterOptionsInner.md)
- [SearchResponseFilterOptionsInnerValuesInner](docs/SearchResponseFilterOptionsInnerValuesInner.md)
- [SearchResponseResultsInner](docs/SearchResponseResultsInner.md)
- [SearchResponseResultsInnerRating](docs/SearchResponseResultsInnerRating.md)
- [SearchResponseSorting](docs/SearchResponseSorting.md)
- [SearchResponseSortingOptionsInner](docs/SearchResponseSortingOptionsInner.md)
- [SearchSuggestionResponse](docs/SearchSuggestionResponse.md)
- [SearchSuggestionResponseResultsInner](docs/SearchSuggestionResponseResultsInner.md)
- [SimilarGamesResponse](docs/SimilarGamesResponse.md)
<a id="documentation-for-authorization"></a>
## Documentation for Authorization
Authentication schemes defined for the API:
<a id="apiKey"></a>
### apiKey
- **Type**: API key
- **API key parameter name**: api-key
- **Location**: URL query string
<a id="headerApiKey"></a>
### headerApiKey
- **Type**: API key
- **API key parameter name**: x-api-key
- **Location**: HTTP header
## Recommendation
It's recommended to create an instance of `ApiClient` per thread in a multithreaded environment to avoid any potential issues.
## Author
mail@gamebrain.co