/*
* GameBrain API
*
* GameBrain API
*
* The version of the OpenAPI document: 1.0.1
* Contact: mail@gamebrain.co
* Generated by: https://github.com/openapitools/openapi-generator.git
*/
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Net;
using System.Net.Mime;
using gamebrain.Client;
using gamebrain.Model;
namespace gamebrain.Api
{
/// <summary>
/// Represents a collection of functions to interact with the API endpoints
/// </summary>
public interface IDefaultApiSync : IApiAccessor
{
#region Synchronous Operations
/// <summary>
/// Get Game Details
/// </summary>
/// <remarks>
/// Get all the details about a game given its id. Details include screenshots, ratings, release dates, videos, description, tags, and much more.
/// </remarks>
/// <exception cref="gamebrain.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="id">The unique identifier of the game.</param>
/// <param name="apiKey">Your API key for authentication.</param>
/// <param name="operationIndex">Index associated with the operation.</param>
/// <returns>GameResponse</returns>
GameResponse Detail(int id, string apiKey, int operationIndex = 0);
/// <summary>
/// Get Game Details
/// </summary>
/// <remarks>
/// Get all the details about a game given its id. Details include screenshots, ratings, release dates, videos, description, tags, and much more.
/// </remarks>
/// <exception cref="gamebrain.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="id">The unique identifier of the game.</param>
/// <param name="apiKey">Your API key for authentication.</param>
/// <param name="operationIndex">Index associated with the operation.</param>
/// <returns>ApiResponse of GameResponse</returns>
ApiResponse<GameResponse> DetailWithHttpInfo(int id, string apiKey, int operationIndex = 0);
/// <summary>
/// Get Game News
/// </summary>
/// <remarks>
/// Get news related to the given game.
/// </remarks>
/// <exception cref="gamebrain.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="id"></param>
/// <param name="offset"></param>
/// <param name="limit"></param>
/// <param name="apiKey"></param>
/// <param name="operationIndex">Index associated with the operation.</param>
/// <returns>GameNewsResponse</returns>
GameNewsResponse News(int id, int offset, int limit, string apiKey, int operationIndex = 0);
/// <summary>
/// Get Game News
/// </summary>
/// <remarks>
/// Get news related to the given game.
/// </remarks>
/// <exception cref="gamebrain.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="id"></param>
/// <param name="offset"></param>
/// <param name="limit"></param>
/// <param name="apiKey"></param>
/// <param name="operationIndex">Index associated with the operation.</param>
/// <returns>ApiResponse of GameNewsResponse</returns>
ApiResponse<GameNewsResponse> NewsWithHttpInfo(int id, int offset, int limit, string apiKey, int operationIndex = 0);
/// <summary>
/// Search Games
/// </summary>
/// <remarks>
/// Search hundreds of thousands of video games from over 70 platforms. The query can be a game name, a platform, a genre, or any combination
/// </remarks>
/// <exception cref="gamebrain.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="query">The search query, e.g., game name, platform, genre, or any combination.</param>
/// <param name="offset">The number of results to skip before starting to collect the result set. Between 0 and 1000.</param>
/// <param name="limit">The maximum number of results to return between 1 and 10.</param>
/// <param name="filters">JSON array of filter objects to apply to the search.</param>
/// <param name="sort">The field by which to sort the results, either computed_rating, price, or release_date</param>
/// <param name="sortOrder">The sort order: 'asc' for ascending or 'desc' for descending.</param>
/// <param name="generateFilterOptions">Whether to generate filter options in the response.</param>
/// <param name="apiKey">Your API key for authentication.</param>
/// <param name="operationIndex">Index associated with the operation.</param>
/// <returns>SearchResponse</returns>
SearchResponse Search(string query, int offset, int limit, string filters, string sort, string sortOrder, bool generateFilterOptions, string apiKey, int operationIndex = 0);
/// <summary>
/// Search Games
/// </summary>
/// <remarks>
/// Search hundreds of thousands of video games from over 70 platforms. The query can be a game name, a platform, a genre, or any combination
/// </remarks>
/// <exception cref="gamebrain.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="query">The search query, e.g., game name, platform, genre, or any combination.</param>
/// <param name="offset">The number of results to skip before starting to collect the result set. Between 0 and 1000.</param>
/// <param name="limit">The maximum number of results to return between 1 and 10.</param>
/// <param name="filters">JSON array of filter objects to apply to the search.</param>
/// <param name="sort">The field by which to sort the results, either computed_rating, price, or release_date</param>
/// <param name="sortOrder">The sort order: 'asc' for ascending or 'desc' for descending.</param>
/// <param name="generateFilterOptions">Whether to generate filter options in the response.</param>
/// <param name="apiKey">Your API key for authentication.</param>
/// <param name="operationIndex">Index associated with the operation.</param>
/// <returns>ApiResponse of SearchResponse</returns>
ApiResponse<SearchResponse> SearchWithHttpInfo(string query, int offset, int limit, string filters, string sort, string sortOrder, bool generateFilterOptions, string apiKey, int operationIndex = 0);
/// <summary>
/// Get Similar Games
/// </summary>
/// <remarks>
/// Get games that are similar to the given one.
/// </remarks>
/// <exception cref="gamebrain.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="id"></param>
/// <param name="limit"></param>
/// <param name="apiKey"></param>
/// <param name="operationIndex">Index associated with the operation.</param>
/// <returns>SimilarGamesResponse</returns>
SimilarGamesResponse Similar(int id, int limit, string apiKey, int operationIndex = 0);
/// <summary>
/// Get Similar Games
/// </summary>
/// <remarks>
/// Get games that are similar to the given one.
/// </remarks>
/// <exception cref="gamebrain.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="id"></param>
/// <param name="limit"></param>
/// <param name="apiKey"></param>
/// <param name="operationIndex">Index associated with the operation.</param>
/// <returns>ApiResponse of SimilarGamesResponse</returns>
ApiResponse<SimilarGamesResponse> SimilarWithHttpInfo(int id, int limit, string apiKey, int operationIndex = 0);
/// <summary>
/// Get Game Suggestions
/// </summary>
/// <remarks>
/// Get game suggestions based on (partial) search queries. For example, the query 'gt' will return games like GTA.
/// </remarks>
/// <exception cref="gamebrain.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="query">The partial search query to get suggestions for.</param>
/// <param name="limit">The maximum number of suggestions to return.</param>
/// <param name="apiKey">Your API key for authentication.</param>
/// <param name="operationIndex">Index associated with the operation.</param>
/// <returns>SearchSuggestionResponse</returns>
SearchSuggestionResponse Suggest(string query, int limit, string apiKey, int operationIndex = 0);
/// <summary>
/// Get Game Suggestions
/// </summary>
/// <remarks>
/// Get game suggestions based on (partial) search queries. For example, the query 'gt' will return games like GTA.
/// </remarks>
/// <exception cref="gamebrain.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="query">The partial search query to get suggestions for.</param>
/// <param name="limit">The maximum number of suggestions to return.</param>
/// <param name="apiKey">Your API key for authentication.</param>
/// <param name="operationIndex">Index associated with the operation.</param>
/// <returns>ApiResponse of SearchSuggestionResponse</returns>
ApiResponse<SearchSuggestionResponse> SuggestWithHttpInfo(string query, int limit, string apiKey, int operationIndex = 0);
#endregion Synchronous Operations
}
/// <summary>
/// Represents a collection of functions to interact with the API endpoints
/// </summary>
public interface IDefaultApiAsync : IApiAccessor
{
#region Asynchronous Operations
/// <summary>
/// Get Game Details
/// </summary>
/// <remarks>
/// Get all the details about a game given its id. Details include screenshots, ratings, release dates, videos, description, tags, and much more.
/// </remarks>
/// <exception cref="gamebrain.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="id">The unique identifier of the game.</param>
/// <param name="apiKey">Your API key for authentication.</param>
/// <param name="operationIndex">Index associated with the operation.</param>
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
/// <returns>Task of GameResponse</returns>
System.Threading.Tasks.Task<GameResponse> DetailAsync(int id, string apiKey, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
/// <summary>
/// Get Game Details
/// </summary>
/// <remarks>
/// Get all the details about a game given its id. Details include screenshots, ratings, release dates, videos, description, tags, and much more.
/// </remarks>
/// <exception cref="gamebrain.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="id">The unique identifier of the game.</param>
/// <param name="apiKey">Your API key for authentication.</param>
/// <param name="operationIndex">Index associated with the operation.</param>
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
/// <returns>Task of ApiResponse (GameResponse)</returns>
System.Threading.Tasks.Task<ApiResponse<GameResponse>> DetailWithHttpInfoAsync(int id, string apiKey, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
/// <summary>
/// Get Game News
/// </summary>
/// <remarks>
/// Get news related to the given game.
/// </remarks>
/// <exception cref="gamebrain.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="id"></param>
/// <param name="offset"></param>
/// <param name="limit"></param>
/// <param name="apiKey"></param>
/// <param name="operationIndex">Index associated with the operation.</param>
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
/// <returns>Task of GameNewsResponse</returns>
System.Threading.Tasks.Task<GameNewsResponse> NewsAsync(int id, int offset, int limit, string apiKey, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
/// <summary>
/// Get Game News
/// </summary>
/// <remarks>
/// Get news related to the given game.
/// </remarks>
/// <exception cref="gamebrain.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="id"></param>
/// <param name="offset"></param>
/// <param name="limit"></param>
/// <param name="apiKey"></param>
/// <param name="operationIndex">Index associated with the operation.</param>
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
/// <returns>Task of ApiResponse (GameNewsResponse)</returns>
System.Threading.Tasks.Task<ApiResponse<GameNewsResponse>> NewsWithHttpInfoAsync(int id, int offset, int limit, string apiKey, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
/// <summary>
/// Search Games
/// </summary>
/// <remarks>
/// Search hundreds of thousands of video games from over 70 platforms. The query can be a game name, a platform, a genre, or any combination
/// </remarks>
/// <exception cref="gamebrain.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="query">The search query, e.g., game name, platform, genre, or any combination.</param>
/// <param name="offset">The number of results to skip before starting to collect the result set. Between 0 and 1000.</param>
/// <param name="limit">The maximum number of results to return between 1 and 10.</param>
/// <param name="filters">JSON array of filter objects to apply to the search.</param>
/// <param name="sort">The field by which to sort the results, either computed_rating, price, or release_date</param>
/// <param name="sortOrder">The sort order: 'asc' for ascending or 'desc' for descending.</param>
/// <param name="generateFilterOptions">Whether to generate filter options in the response.</param>
/// <param name="apiKey">Your API key for authentication.</param>
/// <param name="operationIndex">Index associated with the operation.</param>
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
/// <returns>Task of SearchResponse</returns>
System.Threading.Tasks.Task<SearchResponse> SearchAsync(string query, int offset, int limit, string filters, string sort, string sortOrder, bool generateFilterOptions, string apiKey, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
/// <summary>
/// Search Games
/// </summary>
/// <remarks>
/// Search hundreds of thousands of video games from over 70 platforms. The query can be a game name, a platform, a genre, or any combination
/// </remarks>
/// <exception cref="gamebrain.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="query">The search query, e.g., game name, platform, genre, or any combination.</param>
/// <param name="offset">The number of results to skip before starting to collect the result set. Between 0 and 1000.</param>
/// <param name="limit">The maximum number of results to return between 1 and 10.</param>
/// <param name="filters">JSON array of filter objects to apply to the search.</param>
/// <param name="sort">The field by which to sort the results, either computed_rating, price, or release_date</param>
/// <param name="sortOrder">The sort order: 'asc' for ascending or 'desc' for descending.</param>
/// <param name="generateFilterOptions">Whether to generate filter options in the response.</param>
/// <param name="apiKey">Your API key for authentication.</param>
/// <param name="operationIndex">Index associated with the operation.</param>
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
/// <returns>Task of ApiResponse (SearchResponse)</returns>
System.Threading.Tasks.Task<ApiResponse<SearchResponse>> SearchWithHttpInfoAsync(string query, int offset, int limit, string filters, string sort, string sortOrder, bool generateFilterOptions, string apiKey, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
/// <summary>
/// Get Similar Games
/// </summary>
/// <remarks>
/// Get games that are similar to the given one.
/// </remarks>
/// <exception cref="gamebrain.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="id"></param>
/// <param name="limit"></param>
/// <param name="apiKey"></param>
/// <param name="operationIndex">Index associated with the operation.</param>
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
/// <returns>Task of SimilarGamesResponse</returns>
System.Threading.Tasks.Task<SimilarGamesResponse> SimilarAsync(int id, int limit, string apiKey, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
/// <summary>
/// Get Similar Games
/// </summary>
/// <remarks>
/// Get games that are similar to the given one.
/// </remarks>
/// <exception cref="gamebrain.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="id"></param>
/// <param name="limit"></param>
/// <param name="apiKey"></param>
/// <param name="operationIndex">Index associated with the operation.</param>
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
/// <returns>Task of ApiResponse (SimilarGamesResponse)</returns>
System.Threading.Tasks.Task<ApiResponse<SimilarGamesResponse>> SimilarWithHttpInfoAsync(int id, int limit, string apiKey, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
/// <summary>
/// Get Game Suggestions
/// </summary>
/// <remarks>
/// Get game suggestions based on (partial) search queries. For example, the query 'gt' will return games like GTA.
/// </remarks>
/// <exception cref="gamebrain.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="query">The partial search query to get suggestions for.</param>
/// <param name="limit">The maximum number of suggestions to return.</param>
/// <param name="apiKey">Your API key for authentication.</param>
/// <param name="operationIndex">Index associated with the operation.</param>
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
/// <returns>Task of SearchSuggestionResponse</returns>
System.Threading.Tasks.Task<SearchSuggestionResponse> SuggestAsync(string query, int limit, string apiKey, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
/// <summary>
/// Get Game Suggestions
/// </summary>
/// <remarks>
/// Get game suggestions based on (partial) search queries. For example, the query 'gt' will return games like GTA.
/// </remarks>
/// <exception cref="gamebrain.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="query">The partial search query to get suggestions for.</param>
/// <param name="limit">The maximum number of suggestions to return.</param>
/// <param name="apiKey">Your API key for authentication.</param>
/// <param name="operationIndex">Index associated with the operation.</param>
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
/// <returns>Task of ApiResponse (SearchSuggestionResponse)</returns>
System.Threading.Tasks.Task<ApiResponse<SearchSuggestionResponse>> SuggestWithHttpInfoAsync(string query, int limit, string apiKey, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
#endregion Asynchronous Operations
}
/// <summary>
/// Represents a collection of functions to interact with the API endpoints
/// </summary>
public interface IDefaultApi : IDefaultApiSync, IDefaultApiAsync
{
}
/// <summary>
/// Represents a collection of functions to interact with the API endpoints
/// </summary>
public partial class DefaultApi : IDefaultApi
{
private gamebrain.Client.ExceptionFactory _exceptionFactory = (name, response) => null;
/// <summary>
/// Initializes a new instance of the <see cref="DefaultApi"/> class.
/// </summary>
/// <returns></returns>
public DefaultApi() : this((string)null)
{
}
/// <summary>
/// Initializes a new instance of the <see cref="DefaultApi"/> class.
/// </summary>
/// <returns></returns>
public DefaultApi(string basePath)
{
this.Configuration = gamebrain.Client.Configuration.MergeConfigurations(
gamebrain.Client.GlobalConfiguration.Instance,
new gamebrain.Client.Configuration { BasePath = basePath }
);
this.Client = new gamebrain.Client.ApiClient(this.Configuration.BasePath);
this.AsynchronousClient = new gamebrain.Client.ApiClient(this.Configuration.BasePath);
this.ExceptionFactory = gamebrain.Client.Configuration.DefaultExceptionFactory;
}
/// <summary>
/// Initializes a new instance of the <see cref="DefaultApi"/> class
/// using Configuration object
/// </summary>
/// <param name="configuration">An instance of Configuration</param>
/// <returns></returns>
public DefaultApi(gamebrain.Client.Configuration configuration)
{
if (configuration == null) throw new ArgumentNullException("configuration");
this.Configuration = gamebrain.Client.Configuration.MergeConfigurations(
gamebrain.Client.GlobalConfiguration.Instance,
configuration
);
this.Client = new gamebrain.Client.ApiClient(this.Configuration.BasePath);
this.AsynchronousClient = new gamebrain.Client.ApiClient(this.Configuration.BasePath);
ExceptionFactory = gamebrain.Client.Configuration.DefaultExceptionFactory;
}
/// <summary>
/// Initializes a new instance of the <see cref="DefaultApi"/> class
/// using a Configuration object and client instance.
/// </summary>
/// <param name="client">The client interface for synchronous API access.</param>
/// <param name="asyncClient">The client interface for asynchronous API access.</param>
/// <param name="configuration">The configuration object.</param>
public DefaultApi(gamebrain.Client.ISynchronousClient client, gamebrain.Client.IAsynchronousClient asyncClient, gamebrain.Client.IReadableConfiguration configuration)
{
if (client == null) throw new ArgumentNullException("client");
if (asyncClient == null) throw new ArgumentNullException("asyncClient");
if (configuration == null) throw new ArgumentNullException("configuration");
this.Client = client;
this.AsynchronousClient = asyncClient;
this.Configuration = configuration;
this.ExceptionFactory = gamebrain.Client.Configuration.DefaultExceptionFactory;
}
/// <summary>
/// The client for accessing this underlying API asynchronously.
/// </summary>
public gamebrain.Client.IAsynchronousClient AsynchronousClient { get; set; }
/// <summary>
/// The client for accessing this underlying API synchronously.
/// </summary>
public gamebrain.Client.ISynchronousClient Client { get; set; }
/// <summary>
/// Gets the base path of the API client.
/// </summary>
/// <value>The base path</value>
public string GetBasePath()
{
return this.Configuration.BasePath;
}
/// <summary>
/// Gets or sets the configuration object
/// </summary>
/// <value>An instance of the Configuration</value>
public gamebrain.Client.IReadableConfiguration Configuration { get; set; }
/// <summary>
/// Provides a factory method hook for the creation of exceptions.
/// </summary>
public gamebrain.Client.ExceptionFactory ExceptionFactory
{
get
{
if (_exceptionFactory != null && _exceptionFactory.GetInvocationList().Length > 1)
{
throw new InvalidOperationException("Multicast delegate for ExceptionFactory is unsupported.");
}
return _exceptionFactory;
}
set { _exceptionFactory = value; }
}
/// <summary>
/// Get Game Details Get all the details about a game given its id. Details include screenshots, ratings, release dates, videos, description, tags, and much more.
/// </summary>
/// <exception cref="gamebrain.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="id">The unique identifier of the game.</param>
/// <param name="apiKey">Your API key for authentication.</param>
/// <param name="operationIndex">Index associated with the operation.</param>
/// <returns>GameResponse</returns>
public GameResponse Detail(int id, string apiKey, int operationIndex = 0)
{
gamebrain.Client.ApiResponse<GameResponse> localVarResponse = DetailWithHttpInfo(id, apiKey);
return localVarResponse.Data;
}
/// <summary>
/// Get Game Details Get all the details about a game given its id. Details include screenshots, ratings, release dates, videos, description, tags, and much more.
/// </summary>
/// <exception cref="gamebrain.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="id">The unique identifier of the game.</param>
/// <param name="apiKey">Your API key for authentication.</param>
/// <param name="operationIndex">Index associated with the operation.</param>
/// <returns>ApiResponse of GameResponse</returns>
public gamebrain.Client.ApiResponse<GameResponse> DetailWithHttpInfo(int id, string apiKey, int operationIndex = 0)
{
// verify the required parameter 'apiKey' is set
if (apiKey == null)
{
throw new gamebrain.Client.ApiException(400, "Missing required parameter 'apiKey' when calling DefaultApi->Detail");
}
gamebrain.Client.RequestOptions localVarRequestOptions = new gamebrain.Client.RequestOptions();
string[] _contentTypes = new string[] {
};
// to determine the Accept header
string[] _accepts = new string[] {
"application/json"
};
var localVarContentType = gamebrain.Client.ClientUtils.SelectHeaderContentType(_contentTypes);
if (localVarContentType != null)
{
localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType);
}
var localVarAccept = gamebrain.Client.ClientUtils.SelectHeaderAccept(_accepts);
if (localVarAccept != null)
{
localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept);
}
localVarRequestOptions.PathParameters.Add("id", gamebrain.Client.ClientUtils.ParameterToString(id)); // path parameter
localVarRequestOptions.QueryParameters.Add(gamebrain.Client.ClientUtils.ParameterToMultiMap("", "api-key", apiKey));
localVarRequestOptions.Operation = "DefaultApi.Detail";
localVarRequestOptions.OperationIndex = operationIndex;
// authentication (apiKey) required
if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key")))
{
localVarRequestOptions.QueryParameters.Add(gamebrain.Client.ClientUtils.ParameterToMultiMap("", "api-key", this.Configuration.GetApiKeyWithPrefix("api-key")));
}
// authentication (headerApiKey) required
if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("x-api-key")))
{
localVarRequestOptions.HeaderParameters.Add("x-api-key", this.Configuration.GetApiKeyWithPrefix("x-api-key"));
}
// make the HTTP request
var localVarResponse = this.Client.Get<GameResponse>("/games/{id}", localVarRequestOptions, this.Configuration);
if (this.ExceptionFactory != null)
{
Exception _exception = this.ExceptionFactory("Detail", localVarResponse);
if (_exception != null)
{
throw _exception;
}
}
return localVarResponse;
}
/// <summary>
/// Get Game Details Get all the details about a game given its id. Details include screenshots, ratings, release dates, videos, description, tags, and much more.
/// </summary>
/// <exception cref="gamebrain.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="id">The unique identifier of the game.</param>
/// <param name="apiKey">Your API key for authentication.</param>
/// <param name="operationIndex">Index associated with the operation.</param>
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
/// <returns>Task of GameResponse</returns>
public async System.Threading.Tasks.Task<GameResponse> DetailAsync(int id, string apiKey, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
{
gamebrain.Client.ApiResponse<GameResponse> localVarResponse = await DetailWithHttpInfoAsync(id, apiKey, operationIndex, cancellationToken).ConfigureAwait(false);
return localVarResponse.Data;
}
/// <summary>
/// Get Game Details Get all the details about a game given its id. Details include screenshots, ratings, release dates, videos, description, tags, and much more.
/// </summary>
/// <exception cref="gamebrain.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="id">The unique identifier of the game.</param>
/// <param name="apiKey">Your API key for authentication.</param>
/// <param name="operationIndex">Index associated with the operation.</param>
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
/// <returns>Task of ApiResponse (GameResponse)</returns>
public async System.Threading.Tasks.Task<gamebrain.Client.ApiResponse<GameResponse>> DetailWithHttpInfoAsync(int id, string apiKey, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
{
// verify the required parameter 'apiKey' is set
if (apiKey == null)
{
throw new gamebrain.Client.ApiException(400, "Missing required parameter 'apiKey' when calling DefaultApi->Detail");
}
gamebrain.Client.RequestOptions localVarRequestOptions = new gamebrain.Client.RequestOptions();
string[] _contentTypes = new string[] {
};
// to determine the Accept header
string[] _accepts = new string[] {
"application/json"
};
var localVarContentType = gamebrain.Client.ClientUtils.SelectHeaderContentType(_contentTypes);
if (localVarContentType != null)
{
localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType);
}
var localVarAccept = gamebrain.Client.ClientUtils.SelectHeaderAccept(_accepts);
if (localVarAccept != null)
{
localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept);
}
localVarRequestOptions.PathParameters.Add("id", gamebrain.Client.ClientUtils.ParameterToString(id)); // path parameter
localVarRequestOptions.QueryParameters.Add(gamebrain.Client.ClientUtils.ParameterToMultiMap("", "api-key", apiKey));
localVarRequestOptions.Operation = "DefaultApi.Detail";
localVarRequestOptions.OperationIndex = operationIndex;
// authentication (apiKey) required
if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key")))
{
localVarRequestOptions.QueryParameters.Add(gamebrain.Client.ClientUtils.ParameterToMultiMap("", "api-key", this.Configuration.GetApiKeyWithPrefix("api-key")));
}
// authentication (headerApiKey) required
if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("x-api-key")))
{
localVarRequestOptions.HeaderParameters.Add("x-api-key", this.Configuration.GetApiKeyWithPrefix("x-api-key"));
}
// make the HTTP request
var localVarResponse = await this.AsynchronousClient.GetAsync<GameResponse>("/games/{id}", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false);
if (this.ExceptionFactory != null)
{
Exception _exception = this.ExceptionFactory("Detail", localVarResponse);
if (_exception != null)
{
throw _exception;
}
}
return localVarResponse;
}
/// <summary>
/// Get Game News Get news related to the given game.
/// </summary>
/// <exception cref="gamebrain.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="id"></param>
/// <param name="offset"></param>
/// <param name="limit"></param>
/// <param name="apiKey"></param>
/// <param name="operationIndex">Index associated with the operation.</param>
/// <returns>GameNewsResponse</returns>
public GameNewsResponse News(int id, int offset, int limit, string apiKey, int operationIndex = 0)
{
gamebrain.Client.ApiResponse<GameNewsResponse> localVarResponse = NewsWithHttpInfo(id, offset, limit, apiKey);
return localVarResponse.Data;
}
/// <summary>
/// Get Game News Get news related to the given game.
/// </summary>
/// <exception cref="gamebrain.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="id"></param>
/// <param name="offset"></param>
/// <param name="limit"></param>
/// <param name="apiKey"></param>
/// <param name="operationIndex">Index associated with the operation.</param>
/// <returns>ApiResponse of GameNewsResponse</returns>
public gamebrain.Client.ApiResponse<GameNewsResponse> NewsWithHttpInfo(int id, int offset, int limit, string apiKey, int operationIndex = 0)
{
// verify the required parameter 'apiKey' is set
if (apiKey == null)
{
throw new gamebrain.Client.ApiException(400, "Missing required parameter 'apiKey' when calling DefaultApi->News");
}
gamebrain.Client.RequestOptions localVarRequestOptions = new gamebrain.Client.RequestOptions();
string[] _contentTypes = new string[] {
};
// to determine the Accept header
string[] _accepts = new string[] {
"application/json"
};
var localVarContentType = gamebrain.Client.ClientUtils.SelectHeaderContentType(_contentTypes);
if (localVarContentType != null)
{
localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType);
}
var localVarAccept = gamebrain.Client.ClientUtils.SelectHeaderAccept(_accepts);
if (localVarAccept != null)
{
localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept);
}
localVarRequestOptions.PathParameters.Add("id", gamebrain.Client.ClientUtils.ParameterToString(id)); // path parameter
localVarRequestOptions.QueryParameters.Add(gamebrain.Client.ClientUtils.ParameterToMultiMap("", "offset", offset));
localVarRequestOptions.QueryParameters.Add(gamebrain.Client.ClientUtils.ParameterToMultiMap("", "limit", limit));
localVarRequestOptions.QueryParameters.Add(gamebrain.Client.ClientUtils.ParameterToMultiMap("", "api-key", apiKey));
localVarRequestOptions.Operation = "DefaultApi.News";
localVarRequestOptions.OperationIndex = operationIndex;
// authentication (apiKey) required
if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key")))
{
localVarRequestOptions.QueryParameters.Add(gamebrain.Client.ClientUtils.ParameterToMultiMap("", "api-key", this.Configuration.GetApiKeyWithPrefix("api-key")));
}
// authentication (headerApiKey) required
if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("x-api-key")))
{
localVarRequestOptions.HeaderParameters.Add("x-api-key", this.Configuration.GetApiKeyWithPrefix("x-api-key"));
}
// make the HTTP request
var localVarResponse = this.Client.Get<GameNewsResponse>("/games/{id}/news", localVarRequestOptions, this.Configuration);
if (this.ExceptionFactory != null)
{
Exception _exception = this.ExceptionFactory("News", localVarResponse);
if (_exception != null)
{
throw _exception;
}
}
return localVarResponse;
}
/// <summary>
/// Get Game News Get news related to the given game.
/// </summary>
/// <exception cref="gamebrain.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="id"></param>
/// <param name="offset"></param>
/// <param name="limit"></param>
/// <param name="apiKey"></param>
/// <param name="operationIndex">Index associated with the operation.</param>
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
/// <returns>Task of GameNewsResponse</returns>
public async System.Threading.Tasks.Task<GameNewsResponse> NewsAsync(int id, int offset, int limit, string apiKey, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
{
gamebrain.Client.ApiResponse<GameNewsResponse> localVarResponse = await NewsWithHttpInfoAsync(id, offset, limit, apiKey, operationIndex, cancellationToken).ConfigureAwait(false);
return localVarResponse.Data;
}
/// <summary>
/// Get Game News Get news related to the given game.
/// </summary>
/// <exception cref="gamebrain.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="id"></param>
/// <param name="offset"></param>
/// <param name="limit"></param>
/// <param name="apiKey"></param>
/// <param name="operationIndex">Index associated with the operation.</param>
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
/// <returns>Task of ApiResponse (GameNewsResponse)</returns>
public async System.Threading.Tasks.Task<gamebrain.Client.ApiResponse<GameNewsResponse>> NewsWithHttpInfoAsync(int id, int offset, int limit, string apiKey, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
{
// verify the required parameter 'apiKey' is set
if (apiKey == null)
{
throw new gamebrain.Client.ApiException(400, "Missing required parameter 'apiKey' when calling DefaultApi->News");
}
gamebrain.Client.RequestOptions localVarRequestOptions = new gamebrain.Client.RequestOptions();
string[] _contentTypes = new string[] {
};
// to determine the Accept header
string[] _accepts = new string[] {
"application/json"
};
var localVarContentType = gamebrain.Client.ClientUtils.SelectHeaderContentType(_contentTypes);
if (localVarContentType != null)
{
localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType);
}
var localVarAccept = gamebrain.Client.ClientUtils.SelectHeaderAccept(_accepts);
if (localVarAccept != null)
{
localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept);
}
localVarRequestOptions.PathParameters.Add("id", gamebrain.Client.ClientUtils.ParameterToString(id)); // path parameter
localVarRequestOptions.QueryParameters.Add(gamebrain.Client.ClientUtils.ParameterToMultiMap("", "offset", offset));
localVarRequestOptions.QueryParameters.Add(gamebrain.Client.ClientUtils.ParameterToMultiMap("", "limit", limit));
localVarRequestOptions.QueryParameters.Add(gamebrain.Client.ClientUtils.ParameterToMultiMap("", "api-key", apiKey));
localVarRequestOptions.Operation = "DefaultApi.News";
localVarRequestOptions.OperationIndex = operationIndex;
// authentication (apiKey) required
if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key")))
{
localVarRequestOptions.QueryParameters.Add(gamebrain.Client.ClientUtils.ParameterToMultiMap("", "api-key", this.Configuration.GetApiKeyWithPrefix("api-key")));
}
// authentication (headerApiKey) required
if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("x-api-key")))
{
localVarRequestOptions.HeaderParameters.Add("x-api-key", this.Configuration.GetApiKeyWithPrefix("x-api-key"));
}
// make the HTTP request
var localVarResponse = await this.AsynchronousClient.GetAsync<GameNewsResponse>("/games/{id}/news", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false);
if (this.ExceptionFactory != null)
{
Exception _exception = this.ExceptionFactory("News", localVarResponse);
if (_exception != null)
{
throw _exception;
}
}
return localVarResponse;
}
/// <summary>
/// Search Games Search hundreds of thousands of video games from over 70 platforms. The query can be a game name, a platform, a genre, or any combination
/// </summary>
/// <exception cref="gamebrain.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="query">The search query, e.g., game name, platform, genre, or any combination.</param>
/// <param name="offset">The number of results to skip before starting to collect the result set. Between 0 and 1000.</param>
/// <param name="limit">The maximum number of results to return between 1 and 10.</param>
/// <param name="filters">JSON array of filter objects to apply to the search.</param>
/// <param name="sort">The field by which to sort the results, either computed_rating, price, or release_date</param>
/// <param name="sortOrder">The sort order: 'asc' for ascending or 'desc' for descending.</param>
/// <param name="generateFilterOptions">Whether to generate filter options in the response.</param>
/// <param name="apiKey">Your API key for authentication.</param>
/// <param name="operationIndex">Index associated with the operation.</param>
/// <returns>SearchResponse</returns>
public SearchResponse Search(string query, int offset, int limit, string filters, string sort, string sortOrder, bool generateFilterOptions, string apiKey, int operationIndex = 0)
{
gamebrain.Client.ApiResponse<SearchResponse> localVarResponse = SearchWithHttpInfo(query, offset, limit, filters, sort, sortOrder, generateFilterOptions, apiKey);
return localVarResponse.Data;
}
/// <summary>
/// Search Games Search hundreds of thousands of video games from over 70 platforms. The query can be a game name, a platform, a genre, or any combination
/// </summary>
/// <exception cref="gamebrain.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="query">The search query, e.g., game name, platform, genre, or any combination.</param>
/// <param name="offset">The number of results to skip before starting to collect the result set. Between 0 and 1000.</param>
/// <param name="limit">The maximum number of results to return between 1 and 10.</param>
/// <param name="filters">JSON array of filter objects to apply to the search.</param>
/// <param name="sort">The field by which to sort the results, either computed_rating, price, or release_date</param>
/// <param name="sortOrder">The sort order: 'asc' for ascending or 'desc' for descending.</param>
/// <param name="generateFilterOptions">Whether to generate filter options in the response.</param>
/// <param name="apiKey">Your API key for authentication.</param>
/// <param name="operationIndex">Index associated with the operation.</param>
/// <returns>ApiResponse of SearchResponse</returns>
public gamebrain.Client.ApiResponse<SearchResponse> SearchWithHttpInfo(string query, int offset, int limit, string filters, string sort, string sortOrder, bool generateFilterOptions, string apiKey, int operationIndex = 0)
{
// verify the required parameter 'query' is set
if (query == null)
{
throw new gamebrain.Client.ApiException(400, "Missing required parameter 'query' when calling DefaultApi->Search");
}
// verify the required parameter 'filters' is set
if (filters == null)
{
throw new gamebrain.Client.ApiException(400, "Missing required parameter 'filters' when calling DefaultApi->Search");
}
// verify the required parameter 'sort' is set
if (sort == null)
{
throw new gamebrain.Client.ApiException(400, "Missing required parameter 'sort' when calling DefaultApi->Search");
}
// verify the required parameter 'sortOrder' is set
if (sortOrder == null)
{
throw new gamebrain.Client.ApiException(400, "Missing required parameter 'sortOrder' when calling DefaultApi->Search");
}
// verify the required parameter 'apiKey' is set
if (apiKey == null)
{
throw new gamebrain.Client.ApiException(400, "Missing required parameter 'apiKey' when calling DefaultApi->Search");
}
gamebrain.Client.RequestOptions localVarRequestOptions = new gamebrain.Client.RequestOptions();
string[] _contentTypes = new string[] {
};
// to determine the Accept header
string[] _accepts = new string[] {
"application/json"
};
var localVarContentType = gamebrain.Client.ClientUtils.SelectHeaderContentType(_contentTypes);
if (localVarContentType != null)
{
localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType);
}
var localVarAccept = gamebrain.Client.ClientUtils.SelectHeaderAccept(_accepts);
if (localVarAccept != null)
{
localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept);
}
localVarRequestOptions.QueryParameters.Add(gamebrain.Client.ClientUtils.ParameterToMultiMap("", "query", query));
localVarRequestOptions.QueryParameters.Add(gamebrain.Client.ClientUtils.ParameterToMultiMap("", "offset", offset));
localVarRequestOptions.QueryParameters.Add(gamebrain.Client.ClientUtils.ParameterToMultiMap("", "limit", limit));
localVarRequestOptions.QueryParameters.Add(gamebrain.Client.ClientUtils.ParameterToMultiMap("", "filters", filters));
localVarRequestOptions.QueryParameters.Add(gamebrain.Client.ClientUtils.ParameterToMultiMap("", "sort", sort));
localVarRequestOptions.QueryParameters.Add(gamebrain.Client.ClientUtils.ParameterToMultiMap("", "sort-order", sortOrder));
localVarRequestOptions.QueryParameters.Add(gamebrain.Client.ClientUtils.ParameterToMultiMap("", "generate-filter-options", generateFilterOptions));
localVarRequestOptions.QueryParameters.Add(gamebrain.Client.ClientUtils.ParameterToMultiMap("", "api-key", apiKey));
localVarRequestOptions.Operation = "DefaultApi.Search";
localVarRequestOptions.OperationIndex = operationIndex;
// authentication (apiKey) required
if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key")))
{
localVarRequestOptions.QueryParameters.Add(gamebrain.Client.ClientUtils.ParameterToMultiMap("", "api-key", this.Configuration.GetApiKeyWithPrefix("api-key")));
}
// authentication (headerApiKey) required
if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("x-api-key")))
{
localVarRequestOptions.HeaderParameters.Add("x-api-key", this.Configuration.GetApiKeyWithPrefix("x-api-key"));
}
// make the HTTP request
var localVarResponse = this.Client.Get<SearchResponse>("/games", localVarRequestOptions, this.Configuration);
if (this.ExceptionFactory != null)
{
Exception _exception = this.ExceptionFactory("Search", localVarResponse);
if (_exception != null)
{
throw _exception;
}
}
return localVarResponse;
}
/// <summary>
/// Search Games Search hundreds of thousands of video games from over 70 platforms. The query can be a game name, a platform, a genre, or any combination
/// </summary>
/// <exception cref="gamebrain.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="query">The search query, e.g., game name, platform, genre, or any combination.</param>
/// <param name="offset">The number of results to skip before starting to collect the result set. Between 0 and 1000.</param>
/// <param name="limit">The maximum number of results to return between 1 and 10.</param>
/// <param name="filters">JSON array of filter objects to apply to the search.</param>
/// <param name="sort">The field by which to sort the results, either computed_rating, price, or release_date</param>
/// <param name="sortOrder">The sort order: 'asc' for ascending or 'desc' for descending.</param>
/// <param name="generateFilterOptions">Whether to generate filter options in the response.</param>
/// <param name="apiKey">Your API key for authentication.</param>
/// <param name="operationIndex">Index associated with the operation.</param>
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
/// <returns>Task of SearchResponse</returns>
public async System.Threading.Tasks.Task<SearchResponse> SearchAsync(string query, int offset, int limit, string filters, string sort, string sortOrder, bool generateFilterOptions, string apiKey, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
{
gamebrain.Client.ApiResponse<SearchResponse> localVarResponse = await SearchWithHttpInfoAsync(query, offset, limit, filters, sort, sortOrder, generateFilterOptions, apiKey, operationIndex, cancellationToken).ConfigureAwait(false);
return localVarResponse.Data;
}
/// <summary>
/// Search Games Search hundreds of thousands of video games from over 70 platforms. The query can be a game name, a platform, a genre, or any combination
/// </summary>
/// <exception cref="gamebrain.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="query">The search query, e.g., game name, platform, genre, or any combination.</param>
/// <param name="offset">The number of results to skip before starting to collect the result set. Between 0 and 1000.</param>
/// <param name="limit">The maximum number of results to return between 1 and 10.</param>
/// <param name="filters">JSON array of filter objects to apply to the search.</param>
/// <param name="sort">The field by which to sort the results, either computed_rating, price, or release_date</param>
/// <param name="sortOrder">The sort order: 'asc' for ascending or 'desc' for descending.</param>
/// <param name="generateFilterOptions">Whether to generate filter options in the response.</param>
/// <param name="apiKey">Your API key for authentication.</param>
/// <param name="operationIndex">Index associated with the operation.</param>
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
/// <returns>Task of ApiResponse (SearchResponse)</returns>
public async System.Threading.Tasks.Task<gamebrain.Client.ApiResponse<SearchResponse>> SearchWithHttpInfoAsync(string query, int offset, int limit, string filters, string sort, string sortOrder, bool generateFilterOptions, string apiKey, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
{
// verify the required parameter 'query' is set
if (query == null)
{
throw new gamebrain.Client.ApiException(400, "Missing required parameter 'query' when calling DefaultApi->Search");
}
// verify the required parameter 'filters' is set
if (filters == null)
{
throw new gamebrain.Client.ApiException(400, "Missing required parameter 'filters' when calling DefaultApi->Search");
}
// verify the required parameter 'sort' is set
if (sort == null)
{
throw new gamebrain.Client.ApiException(400, "Missing required parameter 'sort' when calling DefaultApi->Search");
}
// verify the required parameter 'sortOrder' is set
if (sortOrder == null)
{
throw new gamebrain.Client.ApiException(400, "Missing required parameter 'sortOrder' when calling DefaultApi->Search");
}
// verify the required parameter 'apiKey' is set
if (apiKey == null)
{
throw new gamebrain.Client.ApiException(400, "Missing required parameter 'apiKey' when calling DefaultApi->Search");
}
gamebrain.Client.RequestOptions localVarRequestOptions = new gamebrain.Client.RequestOptions();
string[] _contentTypes = new string[] {
};
// to determine the Accept header
string[] _accepts = new string[] {
"application/json"
};
var localVarContentType = gamebrain.Client.ClientUtils.SelectHeaderContentType(_contentTypes);
if (localVarContentType != null)
{
localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType);
}
var localVarAccept = gamebrain.Client.ClientUtils.SelectHeaderAccept(_accepts);
if (localVarAccept != null)
{
localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept);
}
localVarRequestOptions.QueryParameters.Add(gamebrain.Client.ClientUtils.ParameterToMultiMap("", "query", query));
localVarRequestOptions.QueryParameters.Add(gamebrain.Client.ClientUtils.ParameterToMultiMap("", "offset", offset));
localVarRequestOptions.QueryParameters.Add(gamebrain.Client.ClientUtils.ParameterToMultiMap("", "limit", limit));
localVarRequestOptions.QueryParameters.Add(gamebrain.Client.ClientUtils.ParameterToMultiMap("", "filters", filters));
localVarRequestOptions.QueryParameters.Add(gamebrain.Client.ClientUtils.ParameterToMultiMap("", "sort", sort));
localVarRequestOptions.QueryParameters.Add(gamebrain.Client.ClientUtils.ParameterToMultiMap("", "sort-order", sortOrder));
localVarRequestOptions.QueryParameters.Add(gamebrain.Client.ClientUtils.ParameterToMultiMap("", "generate-filter-options", generateFilterOptions));
localVarRequestOptions.QueryParameters.Add(gamebrain.Client.ClientUtils.ParameterToMultiMap("", "api-key", apiKey));
localVarRequestOptions.Operation = "DefaultApi.Search";
localVarRequestOptions.OperationIndex = operationIndex;
// authentication (apiKey) required
if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key")))
{
localVarRequestOptions.QueryParameters.Add(gamebrain.Client.ClientUtils.ParameterToMultiMap("", "api-key", this.Configuration.GetApiKeyWithPrefix("api-key")));
}
// authentication (headerApiKey) required
if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("x-api-key")))
{
localVarRequestOptions.HeaderParameters.Add("x-api-key", this.Configuration.GetApiKeyWithPrefix("x-api-key"));
}
// make the HTTP request
var localVarResponse = await this.AsynchronousClient.GetAsync<SearchResponse>("/games", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false);
if (this.ExceptionFactory != null)
{
Exception _exception = this.ExceptionFactory("Search", localVarResponse);
if (_exception != null)
{
throw _exception;
}
}
return localVarResponse;
}
/// <summary>
/// Get Similar Games Get games that are similar to the given one.
/// </summary>
/// <exception cref="gamebrain.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="id"></param>
/// <param name="limit"></param>
/// <param name="apiKey"></param>
/// <param name="operationIndex">Index associated with the operation.</param>
/// <returns>SimilarGamesResponse</returns>
public SimilarGamesResponse Similar(int id, int limit, string apiKey, int operationIndex = 0)
{
gamebrain.Client.ApiResponse<SimilarGamesResponse> localVarResponse = SimilarWithHttpInfo(id, limit, apiKey);
return localVarResponse.Data;
}
/// <summary>
/// Get Similar Games Get games that are similar to the given one.
/// </summary>
/// <exception cref="gamebrain.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="id"></param>
/// <param name="limit"></param>
/// <param name="apiKey"></param>
/// <param name="operationIndex">Index associated with the operation.</param>
/// <returns>ApiResponse of SimilarGamesResponse</returns>
public gamebrain.Client.ApiResponse<SimilarGamesResponse> SimilarWithHttpInfo(int id, int limit, string apiKey, int operationIndex = 0)
{
// verify the required parameter 'apiKey' is set
if (apiKey == null)
{
throw new gamebrain.Client.ApiException(400, "Missing required parameter 'apiKey' when calling DefaultApi->Similar");
}
gamebrain.Client.RequestOptions localVarRequestOptions = new gamebrain.Client.RequestOptions();
string[] _contentTypes = new string[] {
};
// to determine the Accept header
string[] _accepts = new string[] {
"application/json"
};
var localVarContentType = gamebrain.Client.ClientUtils.SelectHeaderContentType(_contentTypes);
if (localVarContentType != null)
{
localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType);
}
var localVarAccept = gamebrain.Client.ClientUtils.SelectHeaderAccept(_accepts);
if (localVarAccept != null)
{
localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept);
}
localVarRequestOptions.PathParameters.Add("id", gamebrain.Client.ClientUtils.ParameterToString(id)); // path parameter
localVarRequestOptions.QueryParameters.Add(gamebrain.Client.ClientUtils.ParameterToMultiMap("", "limit", limit));
localVarRequestOptions.QueryParameters.Add(gamebrain.Client.ClientUtils.ParameterToMultiMap("", "api-key", apiKey));
localVarRequestOptions.Operation = "DefaultApi.Similar";
localVarRequestOptions.OperationIndex = operationIndex;
// authentication (apiKey) required
if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key")))
{
localVarRequestOptions.QueryParameters.Add(gamebrain.Client.ClientUtils.ParameterToMultiMap("", "api-key", this.Configuration.GetApiKeyWithPrefix("api-key")));
}
// authentication (headerApiKey) required
if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("x-api-key")))
{
localVarRequestOptions.HeaderParameters.Add("x-api-key", this.Configuration.GetApiKeyWithPrefix("x-api-key"));
}
// make the HTTP request
var localVarResponse = this.Client.Get<SimilarGamesResponse>("/games/{id}/similar", localVarRequestOptions, this.Configuration);
if (this.ExceptionFactory != null)
{
Exception _exception = this.ExceptionFactory("Similar", localVarResponse);
if (_exception != null)
{
throw _exception;
}
}
return localVarResponse;
}
/// <summary>
/// Get Similar Games Get games that are similar to the given one.
/// </summary>
/// <exception cref="gamebrain.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="id"></param>
/// <param name="limit"></param>
/// <param name="apiKey"></param>
/// <param name="operationIndex">Index associated with the operation.</param>
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
/// <returns>Task of SimilarGamesResponse</returns>
public async System.Threading.Tasks.Task<SimilarGamesResponse> SimilarAsync(int id, int limit, string apiKey, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
{
gamebrain.Client.ApiResponse<SimilarGamesResponse> localVarResponse = await SimilarWithHttpInfoAsync(id, limit, apiKey, operationIndex, cancellationToken).ConfigureAwait(false);
return localVarResponse.Data;
}
/// <summary>
/// Get Similar Games Get games that are similar to the given one.
/// </summary>
/// <exception cref="gamebrain.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="id"></param>
/// <param name="limit"></param>
/// <param name="apiKey"></param>
/// <param name="operationIndex">Index associated with the operation.</param>
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
/// <returns>Task of ApiResponse (SimilarGamesResponse)</returns>
public async System.Threading.Tasks.Task<gamebrain.Client.ApiResponse<SimilarGamesResponse>> SimilarWithHttpInfoAsync(int id, int limit, string apiKey, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
{
// verify the required parameter 'apiKey' is set
if (apiKey == null)
{
throw new gamebrain.Client.ApiException(400, "Missing required parameter 'apiKey' when calling DefaultApi->Similar");
}
gamebrain.Client.RequestOptions localVarRequestOptions = new gamebrain.Client.RequestOptions();
string[] _contentTypes = new string[] {
};
// to determine the Accept header
string[] _accepts = new string[] {
"application/json"
};
var localVarContentType = gamebrain.Client.ClientUtils.SelectHeaderContentType(_contentTypes);
if (localVarContentType != null)
{
localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType);
}
var localVarAccept = gamebrain.Client.ClientUtils.SelectHeaderAccept(_accepts);
if (localVarAccept != null)
{
localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept);
}
localVarRequestOptions.PathParameters.Add("id", gamebrain.Client.ClientUtils.ParameterToString(id)); // path parameter
localVarRequestOptions.QueryParameters.Add(gamebrain.Client.ClientUtils.ParameterToMultiMap("", "limit", limit));
localVarRequestOptions.QueryParameters.Add(gamebrain.Client.ClientUtils.ParameterToMultiMap("", "api-key", apiKey));
localVarRequestOptions.Operation = "DefaultApi.Similar";
localVarRequestOptions.OperationIndex = operationIndex;
// authentication (apiKey) required
if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key")))
{
localVarRequestOptions.QueryParameters.Add(gamebrain.Client.ClientUtils.ParameterToMultiMap("", "api-key", this.Configuration.GetApiKeyWithPrefix("api-key")));
}
// authentication (headerApiKey) required
if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("x-api-key")))
{
localVarRequestOptions.HeaderParameters.Add("x-api-key", this.Configuration.GetApiKeyWithPrefix("x-api-key"));
}
// make the HTTP request
var localVarResponse = await this.AsynchronousClient.GetAsync<SimilarGamesResponse>("/games/{id}/similar", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false);
if (this.ExceptionFactory != null)
{
Exception _exception = this.ExceptionFactory("Similar", localVarResponse);
if (_exception != null)
{
throw _exception;
}
}
return localVarResponse;
}
/// <summary>
/// Get Game Suggestions Get game suggestions based on (partial) search queries. For example, the query 'gt' will return games like GTA.
/// </summary>
/// <exception cref="gamebrain.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="query">The partial search query to get suggestions for.</param>
/// <param name="limit">The maximum number of suggestions to return.</param>
/// <param name="apiKey">Your API key for authentication.</param>
/// <param name="operationIndex">Index associated with the operation.</param>
/// <returns>SearchSuggestionResponse</returns>
public SearchSuggestionResponse Suggest(string query, int limit, string apiKey, int operationIndex = 0)
{
gamebrain.Client.ApiResponse<SearchSuggestionResponse> localVarResponse = SuggestWithHttpInfo(query, limit, apiKey);
return localVarResponse.Data;
}
/// <summary>
/// Get Game Suggestions Get game suggestions based on (partial) search queries. For example, the query 'gt' will return games like GTA.
/// </summary>
/// <exception cref="gamebrain.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="query">The partial search query to get suggestions for.</param>
/// <param name="limit">The maximum number of suggestions to return.</param>
/// <param name="apiKey">Your API key for authentication.</param>
/// <param name="operationIndex">Index associated with the operation.</param>
/// <returns>ApiResponse of SearchSuggestionResponse</returns>
public gamebrain.Client.ApiResponse<SearchSuggestionResponse> SuggestWithHttpInfo(string query, int limit, string apiKey, int operationIndex = 0)
{
// verify the required parameter 'query' is set
if (query == null)
{
throw new gamebrain.Client.ApiException(400, "Missing required parameter 'query' when calling DefaultApi->Suggest");
}
// verify the required parameter 'apiKey' is set
if (apiKey == null)
{
throw new gamebrain.Client.ApiException(400, "Missing required parameter 'apiKey' when calling DefaultApi->Suggest");
}
gamebrain.Client.RequestOptions localVarRequestOptions = new gamebrain.Client.RequestOptions();
string[] _contentTypes = new string[] {
};
// to determine the Accept header
string[] _accepts = new string[] {
"application/json"
};
var localVarContentType = gamebrain.Client.ClientUtils.SelectHeaderContentType(_contentTypes);
if (localVarContentType != null)
{
localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType);
}
var localVarAccept = gamebrain.Client.ClientUtils.SelectHeaderAccept(_accepts);
if (localVarAccept != null)
{
localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept);
}
localVarRequestOptions.QueryParameters.Add(gamebrain.Client.ClientUtils.ParameterToMultiMap("", "query", query));
localVarRequestOptions.QueryParameters.Add(gamebrain.Client.ClientUtils.ParameterToMultiMap("", "limit", limit));
localVarRequestOptions.QueryParameters.Add(gamebrain.Client.ClientUtils.ParameterToMultiMap("", "api-key", apiKey));
localVarRequestOptions.Operation = "DefaultApi.Suggest";
localVarRequestOptions.OperationIndex = operationIndex;
// authentication (apiKey) required
if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key")))
{
localVarRequestOptions.QueryParameters.Add(gamebrain.Client.ClientUtils.ParameterToMultiMap("", "api-key", this.Configuration.GetApiKeyWithPrefix("api-key")));
}
// authentication (headerApiKey) required
if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("x-api-key")))
{
localVarRequestOptions.HeaderParameters.Add("x-api-key", this.Configuration.GetApiKeyWithPrefix("x-api-key"));
}
// make the HTTP request
var localVarResponse = this.Client.Get<SearchSuggestionResponse>("/games/suggestions", localVarRequestOptions, this.Configuration);
if (this.ExceptionFactory != null)
{
Exception _exception = this.ExceptionFactory("Suggest", localVarResponse);
if (_exception != null)
{
throw _exception;
}
}
return localVarResponse;
}
/// <summary>
/// Get Game Suggestions Get game suggestions based on (partial) search queries. For example, the query 'gt' will return games like GTA.
/// </summary>
/// <exception cref="gamebrain.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="query">The partial search query to get suggestions for.</param>
/// <param name="limit">The maximum number of suggestions to return.</param>
/// <param name="apiKey">Your API key for authentication.</param>
/// <param name="operationIndex">Index associated with the operation.</param>
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
/// <returns>Task of SearchSuggestionResponse</returns>
public async System.Threading.Tasks.Task<SearchSuggestionResponse> SuggestAsync(string query, int limit, string apiKey, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
{
gamebrain.Client.ApiResponse<SearchSuggestionResponse> localVarResponse = await SuggestWithHttpInfoAsync(query, limit, apiKey, operationIndex, cancellationToken).ConfigureAwait(false);
return localVarResponse.Data;
}
/// <summary>
/// Get Game Suggestions Get game suggestions based on (partial) search queries. For example, the query 'gt' will return games like GTA.
/// </summary>
/// <exception cref="gamebrain.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="query">The partial search query to get suggestions for.</param>
/// <param name="limit">The maximum number of suggestions to return.</param>
/// <param name="apiKey">Your API key for authentication.</param>
/// <param name="operationIndex">Index associated with the operation.</param>
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
/// <returns>Task of ApiResponse (SearchSuggestionResponse)</returns>
public async System.Threading.Tasks.Task<gamebrain.Client.ApiResponse<SearchSuggestionResponse>> SuggestWithHttpInfoAsync(string query, int limit, string apiKey, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
{
// verify the required parameter 'query' is set
if (query == null)
{
throw new gamebrain.Client.ApiException(400, "Missing required parameter 'query' when calling DefaultApi->Suggest");
}
// verify the required parameter 'apiKey' is set
if (apiKey == null)
{
throw new gamebrain.Client.ApiException(400, "Missing required parameter 'apiKey' when calling DefaultApi->Suggest");
}
gamebrain.Client.RequestOptions localVarRequestOptions = new gamebrain.Client.RequestOptions();
string[] _contentTypes = new string[] {
};
// to determine the Accept header
string[] _accepts = new string[] {
"application/json"
};
var localVarContentType = gamebrain.Client.ClientUtils.SelectHeaderContentType(_contentTypes);
if (localVarContentType != null)
{
localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType);
}
var localVarAccept = gamebrain.Client.ClientUtils.SelectHeaderAccept(_accepts);
if (localVarAccept != null)
{
localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept);
}
localVarRequestOptions.QueryParameters.Add(gamebrain.Client.ClientUtils.ParameterToMultiMap("", "query", query));
localVarRequestOptions.QueryParameters.Add(gamebrain.Client.ClientUtils.ParameterToMultiMap("", "limit", limit));
localVarRequestOptions.QueryParameters.Add(gamebrain.Client.ClientUtils.ParameterToMultiMap("", "api-key", apiKey));
localVarRequestOptions.Operation = "DefaultApi.Suggest";
localVarRequestOptions.OperationIndex = operationIndex;
// authentication (apiKey) required
if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key")))
{
localVarRequestOptions.QueryParameters.Add(gamebrain.Client.ClientUtils.ParameterToMultiMap("", "api-key", this.Configuration.GetApiKeyWithPrefix("api-key")));
}
// authentication (headerApiKey) required
if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("x-api-key")))
{
localVarRequestOptions.HeaderParameters.Add("x-api-key", this.Configuration.GetApiKeyWithPrefix("x-api-key"));
}
// make the HTTP request
var localVarResponse = await this.AsynchronousClient.GetAsync<SearchSuggestionResponse>("/games/suggestions", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false);
if (this.ExceptionFactory != null)
{
Exception _exception = this.ExceptionFactory("Suggest", localVarResponse);
if (_exception != null)
{
throw _exception;
}
}
return localVarResponse;
}
}
}