Class WebAPI
- java.lang.Object
-
- in.dragonbra.javasteam.steam.webapi.WebAPI
-
public class WebAPI extends java.lang.ObjectRepresents a single interface that exists within the Web API.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classWebAPI.WebAPIRequestExceptionThrown when WebAPI request fails (non success response code).
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringDEFAULT_BASE_ADDRESS
-
Constructor Summary
Constructors Constructor Description WebAPI(okhttp3.OkHttpClient httpClient, java.lang.String baseAddress, java.lang.String _interface, java.lang.String webAPIKey)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description KeyValuecall(java.lang.String function)Manually calls the specified Web API function with the provided details.KeyValuecall(java.lang.String function, int version)Manually calls the specified Web API function with the provided details.voidcall(java.lang.String function, int version, Consumer<KeyValue> callback, Consumer<WebAPI.WebAPIRequestException> error)Manually calls the specified Web API function with the provided details.KeyValuecall(java.lang.String function, int version, java.util.Map<java.lang.String,java.lang.String> parameters)Manually calls the specified Web API function with the provided details.voidcall(java.lang.String function, Consumer<KeyValue> callback, Consumer<WebAPI.WebAPIRequestException> error)Manually calls the specified Web API function with the provided details.KeyValuecall(java.lang.String httpMethod, java.lang.String function)Manually calls the specified Web API function with the provided details.KeyValuecall(java.lang.String httpMethod, java.lang.String function, int version)Manually calls the specified Web API function with the provided details.voidcall(java.lang.String httpMethod, java.lang.String function, int version, Consumer<KeyValue> callback, Consumer<WebAPI.WebAPIRequestException> error)Manually calls the specified Web API function with the provided details.KeyValuecall(java.lang.String httpMethod, java.lang.String function, int version, java.util.Map<java.lang.String,java.lang.String> parameters)Manually calls the specified Web API function with the provided details.voidcall(java.lang.String httpMethod, java.lang.String function, int version, java.util.Map<java.lang.String,java.lang.String> parameters, Consumer<KeyValue> callback, Consumer<WebAPI.WebAPIRequestException> error)Manually calls the specified Web API function with the provided details.voidcall(java.lang.String httpMethod, java.lang.String function, Consumer<KeyValue> callback, Consumer<WebAPI.WebAPIRequestException> error)Manually calls the specified Web API function with the provided details.KeyValuecall(java.lang.String httpMethod, java.lang.String function, java.util.Map<java.lang.String,java.lang.String> parameters)Manually calls the specified Web API function with the provided details.voidcall(java.lang.String httpMethod, java.lang.String function, java.util.Map<java.lang.String,java.lang.String> parameters, Consumer<KeyValue> callback, Consumer<WebAPI.WebAPIRequestException> error)Manually calls the specified Web API function with the provided details.KeyValuecall(java.lang.String function, java.util.Map<java.lang.String,java.lang.String> parameters)Manually calls the specified Web API function with the provided details.voidcall(java.lang.String function, java.util.Map<java.lang.String,java.lang.String> parameters, Consumer<KeyValue> callback, Consumer<WebAPI.WebAPIRequestException> error)Manually calls the specified Web API function with the provided details.okhttp3.HttpUrlgetBaseAddress()java.lang.StringgetInterface()java.lang.StringgetWebAPIKey()
-
-
-
Field Detail
-
DEFAULT_BASE_ADDRESS
public static final java.lang.String DEFAULT_BASE_ADDRESS
- See Also:
- Constant Field Values
-
-
Method Detail
-
call
public KeyValue call(java.lang.String httpMethod, java.lang.String function, int version, java.util.Map<java.lang.String,java.lang.String> parameters) throws java.io.IOException, WebAPI.WebAPIRequestException
Manually calls the specified Web API function with the provided details. This method is synchronous.- Parameters:
httpMethod- The http request method. Either "POST" or "GET".function- The function name to call.version- The version of the function to call.parameters- A map of string key value pairs representing arguments to be passed to the API.- Returns:
- A
KeyValueobject representing the results of the Web API call. - Throws:
java.io.IOException- if the request could not be executedWebAPI.WebAPIRequestException- the request was successful but returned a non success response code
-
call
public KeyValue call(java.lang.String function, int version, java.util.Map<java.lang.String,java.lang.String> parameters) throws java.io.IOException
Manually calls the specified Web API function with the provided details. This method is synchronous.- Parameters:
function- The function name to call.version- The version of the function to call.parameters- A map of string key value pairs representing arguments to be passed to the API.- Returns:
- A
KeyValueobject representing the results of the Web API call. - Throws:
java.io.IOException- if the request could not be executed
-
call
public KeyValue call(java.lang.String httpMethod, java.lang.String function, java.util.Map<java.lang.String,java.lang.String> parameters) throws java.io.IOException
Manually calls the specified Web API function with the provided details. This method is synchronous.- Parameters:
httpMethod- The http request method. Either "POST" or "GET".function- The function name to call.parameters- A map of string key value pairs representing arguments to be passed to the API.- Returns:
- A
KeyValueobject representing the results of the Web API call. - Throws:
java.io.IOException- if the request could not be executed
-
call
public KeyValue call(java.lang.String function, java.util.Map<java.lang.String,java.lang.String> parameters) throws java.io.IOException
Manually calls the specified Web API function with the provided details. This method is synchronous.- Parameters:
function- The function name to call.parameters- A map of string key value pairs representing arguments to be passed to the API.- Returns:
- A
KeyValueobject representing the results of the Web API call. - Throws:
java.io.IOException- if the request could not be executed
-
call
public KeyValue call(java.lang.String httpMethod, java.lang.String function, int version) throws java.io.IOException
Manually calls the specified Web API function with the provided details. This method is synchronous.- Parameters:
httpMethod- The http request method. Either "POST" or "GET".function- The function name to call.version- The version of the function to call.- Returns:
- A
KeyValueobject representing the results of the Web API call. - Throws:
java.io.IOException- if the request could not be executed
-
call
public KeyValue call(java.lang.String function, int version) throws java.io.IOException
Manually calls the specified Web API function with the provided details. This method is synchronous.- Parameters:
function- The function name to call.version- The version of the function to call.- Returns:
- A
KeyValueobject representing the results of the Web API call. - Throws:
java.io.IOException- if the request could not be executed
-
call
public KeyValue call(java.lang.String httpMethod, java.lang.String function) throws java.io.IOException
Manually calls the specified Web API function with the provided details. This method is synchronous.- Parameters:
httpMethod- The http request method. Either "POST" or "GET".function- The function name to call.- Returns:
- A
KeyValueobject representing the results of the Web API call. - Throws:
java.io.IOException- if the request could not be executed
-
call
public KeyValue call(java.lang.String function) throws java.io.IOException
Manually calls the specified Web API function with the provided details. This method is synchronous.- Parameters:
function- The function name to call.- Returns:
- A
KeyValueobject representing the results of the Web API call. - Throws:
java.io.IOException- if the request could not be executed
-
call
public void call(java.lang.String httpMethod, java.lang.String function, int version, java.util.Map<java.lang.String,java.lang.String> parameters, Consumer<KeyValue> callback, Consumer<WebAPI.WebAPIRequestException> error)Manually calls the specified Web API function with the provided details. This method is asynchronous.- Parameters:
httpMethod- The http request method. Either "POST" or "GET".function- The function name to call.version- The version of the function to call.parameters- A map of string key value pairs representing arguments to be passed to the API.callback- the callback that will be called with the resultingKeyValueobject.error- the callback for handling response errors.
-
call
public void call(java.lang.String httpMethod, java.lang.String function, int version, Consumer<KeyValue> callback, Consumer<WebAPI.WebAPIRequestException> error) throws java.io.IOExceptionManually calls the specified Web API function with the provided details. This method is asynchronous.- Parameters:
httpMethod- The http request method. Either "POST" or "GET".function- The function name to call.version- The version of the function to call.callback- the callback that will be called with the resultingKeyValueobject.error- the callback for handling response errors.- Throws:
java.io.IOException- if the request could not be executed
-
call
public void call(java.lang.String httpMethod, java.lang.String function, java.util.Map<java.lang.String,java.lang.String> parameters, Consumer<KeyValue> callback, Consumer<WebAPI.WebAPIRequestException> error) throws java.io.IOExceptionManually calls the specified Web API function with the provided details. This method is asynchronous.- Parameters:
httpMethod- The http request method. Either "POST" or "GET".function- The function name to call.parameters- A map of string key value pairs representing arguments to be passed to the API.callback- the callback that will be called with the resultingKeyValueobject.error- the callback for handling response errors.- Throws:
java.io.IOException- if the request could not be executed
-
call
public void call(java.lang.String httpMethod, java.lang.String function, Consumer<KeyValue> callback, Consumer<WebAPI.WebAPIRequestException> error) throws java.io.IOExceptionManually calls the specified Web API function with the provided details. This method is asynchronous.- Parameters:
httpMethod- The http request method. Either "POST" or "GET".function- The function name to call.callback- the callback that will be called with the resultingKeyValueobject.error- the callback for handling response errors.- Throws:
java.io.IOException- if the request could not be executed
-
call
public void call(java.lang.String function, int version, Consumer<KeyValue> callback, Consumer<WebAPI.WebAPIRequestException> error) throws java.io.IOExceptionManually calls the specified Web API function with the provided details. This method is asynchronous.- Parameters:
function- The function name to call.version- The version of the function to call.callback- the callback that will be called with the resultingKeyValueobject.error- the callback for handling response errors.- Throws:
java.io.IOException- if the request could not be executed
-
call
public void call(java.lang.String function, java.util.Map<java.lang.String,java.lang.String> parameters, Consumer<KeyValue> callback, Consumer<WebAPI.WebAPIRequestException> error) throws java.io.IOExceptionManually calls the specified Web API function with the provided details. This method is asynchronous.- Parameters:
function- The function name to call.parameters- A map of string key value pairs representing arguments to be passed to the API.callback- the callback that will be called with the resultingKeyValueobject.error- the callback for handling response errors.- Throws:
java.io.IOException- if the request could not be executed
-
call
public void call(java.lang.String function, Consumer<KeyValue> callback, Consumer<WebAPI.WebAPIRequestException> error) throws java.io.IOExceptionManually calls the specified Web API function with the provided details. This method is asynchronous.- Parameters:
function- The function name to call.callback- the callback that will be called with the resultingKeyValueobject.error- the callback for handling response errors.- Throws:
java.io.IOException- if the request could not be executed
-
getBaseAddress
public okhttp3.HttpUrl getBaseAddress()
-
getInterface
public java.lang.String getInterface()
-
getWebAPIKey
public java.lang.String getWebAPIKey()
-
-