travel.wink.sdk.affiliate.api.DiscoverApi Maven / Gradle / Ivy
Show all versions of affiliate-sdk-java Show documentation
package travel.wink.sdk.affiliate.api;
import travel.wink.sdk.affiliate.invoker.ApiClient;
import travel.wink.sdk.affiliate.model.CountryAffiliate;
import travel.wink.sdk.affiliate.model.DynamicSellerListRequestAffiliate;
import travel.wink.sdk.affiliate.model.GenericErrorMessage;
import travel.wink.sdk.affiliate.model.GeoNameAffiliate;
import travel.wink.sdk.affiliate.model.InventoryViewAffiliate;
import travel.wink.sdk.affiliate.model.PageInventoryViewAffiliate;
import travel.wink.sdk.affiliate.model.ShowSellerUrl400Response;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.stream.Collectors;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.LinkedMultiValueMap;
import org.springframework.util.MultiValueMap;
import org.springframework.core.ParameterizedTypeReference;
import org.springframework.web.reactive.function.client.WebClient.ResponseSpec;
import org.springframework.web.reactive.function.client.WebClientResponseException;
import org.springframework.core.io.FileSystemResource;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpMethod;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import reactor.core.publisher.Mono;
import reactor.core.publisher.Flux;
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-03-06T16:56:30.815925180+07:00[Asia/Bangkok]")
public class DiscoverApi {
private ApiClient apiClient;
public DiscoverApi() {
this(new ApiClient());
}
@Autowired
public DiscoverApi(ApiClient apiClient) {
this.apiClient = apiClient;
}
public ApiClient getApiClient() {
return apiClient;
}
public void setApiClient(ApiClient apiClient) {
this.apiClient = apiClient;
}
/**
* Show Inventory Cities
* Retrieve list of cities affiliate has access to.
* 503 - Service Unavailable
*
400 - Bad Request
*
405 - Method Not Allowed
*
415 - Unsupported Media Type
*
500 - Internal Server Error
*
404 - Not Found
*
403 - Forbidden
*
401 - Unauthorized
*
200 - OK
* @param companyIdentifier List cities for inventory on behalf of this owner identifier.
* @param winkVersion The winkVersion parameter
* @return List<GeoNameAffiliate>
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
private ResponseSpec showCitiesForInventoryRequestCreation(String companyIdentifier, String winkVersion) throws WebClientResponseException {
Object postBody = null;
// verify the required parameter 'companyIdentifier' is set
if (companyIdentifier == null) {
throw new WebClientResponseException("Missing the required parameter 'companyIdentifier' when calling showCitiesForInventory", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null);
}
// create path and map variables
final Map pathParams = new HashMap();
pathParams.put("companyIdentifier", companyIdentifier);
final MultiValueMap queryParams = new LinkedMultiValueMap();
final HttpHeaders headerParams = new HttpHeaders();
final MultiValueMap cookieParams = new LinkedMultiValueMap();
final MultiValueMap formParams = new LinkedMultiValueMap();
if (winkVersion != null)
headerParams.add("Wink-Version", apiClient.parameterToString(winkVersion));
final String[] localVarAccepts = {
"*/*", "application/json", "application/xml", "text/xml", "text/plain"
};
final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
final String[] localVarContentTypes = { };
final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
String[] localVarAuthNames = new String[] { "oauth2ClientCredentials" };
ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {};
return apiClient.invokeAPI("/api/company/{companyIdentifier}/inventory/city/list", HttpMethod.GET, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
}
/**
* Show Inventory Cities
* Retrieve list of cities affiliate has access to.
* 503 - Service Unavailable
*
400 - Bad Request
*
405 - Method Not Allowed
*
415 - Unsupported Media Type
*
500 - Internal Server Error
*
404 - Not Found
*
403 - Forbidden
*
401 - Unauthorized
*
200 - OK
* @param companyIdentifier List cities for inventory on behalf of this owner identifier.
* @param winkVersion The winkVersion parameter
* @return List<GeoNameAffiliate>
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
public Flux showCitiesForInventory(String companyIdentifier, String winkVersion) throws WebClientResponseException {
ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {};
return showCitiesForInventoryRequestCreation(companyIdentifier, winkVersion).bodyToFlux(localVarReturnType);
}
public Mono>> showCitiesForInventoryWithHttpInfo(String companyIdentifier, String winkVersion) throws WebClientResponseException {
ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {};
return showCitiesForInventoryRequestCreation(companyIdentifier, winkVersion).toEntityList(localVarReturnType);
}
/**
* Show Inventory Countries
* Retrieve list of countries affiliate has access to.
* 503 - Service Unavailable
*
400 - Bad Request
*
405 - Method Not Allowed
*
415 - Unsupported Media Type
*
500 - Internal Server Error
*
404 - Not Found
*
403 - Forbidden
*
401 - Unauthorized
*
200 - OK
* @param companyIdentifier List countries for inventory on behalf of this owner identifier.
* @param winkVersion The winkVersion parameter
* @return List<CountryAffiliate>
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
private ResponseSpec showCountriesForInventoryRequestCreation(String companyIdentifier, String winkVersion) throws WebClientResponseException {
Object postBody = null;
// verify the required parameter 'companyIdentifier' is set
if (companyIdentifier == null) {
throw new WebClientResponseException("Missing the required parameter 'companyIdentifier' when calling showCountriesForInventory", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null);
}
// create path and map variables
final Map pathParams = new HashMap();
pathParams.put("companyIdentifier", companyIdentifier);
final MultiValueMap queryParams = new LinkedMultiValueMap();
final HttpHeaders headerParams = new HttpHeaders();
final MultiValueMap cookieParams = new LinkedMultiValueMap();
final MultiValueMap formParams = new LinkedMultiValueMap();
if (winkVersion != null)
headerParams.add("Wink-Version", apiClient.parameterToString(winkVersion));
final String[] localVarAccepts = {
"*/*", "application/json", "application/xml", "text/xml", "text/plain"
};
final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
final String[] localVarContentTypes = { };
final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
String[] localVarAuthNames = new String[] { "oauth2ClientCredentials" };
ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {};
return apiClient.invokeAPI("/api/company/{companyIdentifier}/inventory/country/list", HttpMethod.GET, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
}
/**
* Show Inventory Countries
* Retrieve list of countries affiliate has access to.
* 503 - Service Unavailable
*
400 - Bad Request
*
405 - Method Not Allowed
*
415 - Unsupported Media Type
*
500 - Internal Server Error
*
404 - Not Found
*
403 - Forbidden
*
401 - Unauthorized
*
200 - OK
* @param companyIdentifier List countries for inventory on behalf of this owner identifier.
* @param winkVersion The winkVersion parameter
* @return List<CountryAffiliate>
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
public Flux showCountriesForInventory(String companyIdentifier, String winkVersion) throws WebClientResponseException {
ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {};
return showCountriesForInventoryRequestCreation(companyIdentifier, winkVersion).bodyToFlux(localVarReturnType);
}
public Mono>> showCountriesForInventoryWithHttpInfo(String companyIdentifier, String winkVersion) throws WebClientResponseException {
ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {};
return showCountriesForInventoryRequestCreation(companyIdentifier, winkVersion).toEntityList(localVarReturnType);
}
/**
* Inventory Search
* Retrieves a paginated result set based on the search criteria of the caller.
* 503 - Service Unavailable
*
400 - Bad Request
*
405 - Method Not Allowed
*
415 - Unsupported Media Type
*
500 - Internal Server Error
*
404 - Not Found
*
403 - Forbidden
*
401 - Unauthorized
*
200 - OK
* @param companyIdentifier Browse inventory on behalf of this owner identifier.
* @param dynamicSellerListRequestAffiliate The dynamicSellerListRequestAffiliate parameter
* @param winkVersion The winkVersion parameter
* @return PageInventoryViewAffiliate
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
private ResponseSpec showDynamicSellerInventoryRequestCreation(String companyIdentifier, DynamicSellerListRequestAffiliate dynamicSellerListRequestAffiliate, String winkVersion) throws WebClientResponseException {
Object postBody = dynamicSellerListRequestAffiliate;
// verify the required parameter 'companyIdentifier' is set
if (companyIdentifier == null) {
throw new WebClientResponseException("Missing the required parameter 'companyIdentifier' when calling showDynamicSellerInventory", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null);
}
// verify the required parameter 'dynamicSellerListRequestAffiliate' is set
if (dynamicSellerListRequestAffiliate == null) {
throw new WebClientResponseException("Missing the required parameter 'dynamicSellerListRequestAffiliate' when calling showDynamicSellerInventory", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null);
}
// create path and map variables
final Map pathParams = new HashMap();
pathParams.put("companyIdentifier", companyIdentifier);
final MultiValueMap queryParams = new LinkedMultiValueMap();
final HttpHeaders headerParams = new HttpHeaders();
final MultiValueMap cookieParams = new LinkedMultiValueMap();
final MultiValueMap formParams = new LinkedMultiValueMap();
if (winkVersion != null)
headerParams.add("Wink-Version", apiClient.parameterToString(winkVersion));
final String[] localVarAccepts = {
"*/*", "application/json", "application/xml", "text/xml", "text/plain"
};
final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
final String[] localVarContentTypes = {
"application/json"
};
final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
String[] localVarAuthNames = new String[] { "oauth2ClientCredentials" };
ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {};
return apiClient.invokeAPI("/api/company/{companyIdentifier}/inventory/grid", HttpMethod.POST, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
}
/**
* Inventory Search
* Retrieves a paginated result set based on the search criteria of the caller.
* 503 - Service Unavailable
*
400 - Bad Request
*
405 - Method Not Allowed
*
415 - Unsupported Media Type
*
500 - Internal Server Error
*
404 - Not Found
*
403 - Forbidden
*
401 - Unauthorized
*
200 - OK
* @param companyIdentifier Browse inventory on behalf of this owner identifier.
* @param dynamicSellerListRequestAffiliate The dynamicSellerListRequestAffiliate parameter
* @param winkVersion The winkVersion parameter
* @return PageInventoryViewAffiliate
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
public Mono showDynamicSellerInventory(String companyIdentifier, DynamicSellerListRequestAffiliate dynamicSellerListRequestAffiliate, String winkVersion) throws WebClientResponseException {
ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {};
return showDynamicSellerInventoryRequestCreation(companyIdentifier, dynamicSellerListRequestAffiliate, winkVersion).bodyToMono(localVarReturnType);
}
public Mono> showDynamicSellerInventoryWithHttpInfo(String companyIdentifier, DynamicSellerListRequestAffiliate dynamicSellerListRequestAffiliate, String winkVersion) throws WebClientResponseException {
ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {};
return showDynamicSellerInventoryRequestCreation(companyIdentifier, dynamicSellerListRequestAffiliate, winkVersion).toEntity(localVarReturnType);
}
/**
* Inventory Search by List
* Retrieves a paginated result set based on the given list identifier.
* 503 - Service Unavailable
*
400 - Bad Request
*
405 - Method Not Allowed
*
415 - Unsupported Media Type
*
500 - Internal Server Error
*
404 - Not Found
*
403 - Forbidden
*
401 - Unauthorized
*
200 - OK
* @param companyIdentifier Browse inventory on behalf of this owner identifier.
* @param dynamicListIdentifier Browse inventory on behalf of this dynamic list identifier.
* @param page Skip to page.
* @param size Skip to page.
* @param winkVersion The winkVersion parameter
* @return PageInventoryViewAffiliate
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
private ResponseSpec showDynamicSellerInventoryByIdRequestCreation(String companyIdentifier, String dynamicListIdentifier, Integer page, Integer size, String winkVersion) throws WebClientResponseException {
Object postBody = null;
// verify the required parameter 'companyIdentifier' is set
if (companyIdentifier == null) {
throw new WebClientResponseException("Missing the required parameter 'companyIdentifier' when calling showDynamicSellerInventoryById", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null);
}
// verify the required parameter 'dynamicListIdentifier' is set
if (dynamicListIdentifier == null) {
throw new WebClientResponseException("Missing the required parameter 'dynamicListIdentifier' when calling showDynamicSellerInventoryById", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null);
}
// create path and map variables
final Map pathParams = new HashMap();
pathParams.put("companyIdentifier", companyIdentifier);
pathParams.put("dynamicListIdentifier", dynamicListIdentifier);
final MultiValueMap queryParams = new LinkedMultiValueMap();
final HttpHeaders headerParams = new HttpHeaders();
final MultiValueMap cookieParams = new LinkedMultiValueMap();
final MultiValueMap formParams = new LinkedMultiValueMap();
queryParams.putAll(apiClient.parameterToMultiValueMap(null, "page", page));
queryParams.putAll(apiClient.parameterToMultiValueMap(null, "size", size));
if (winkVersion != null)
headerParams.add("Wink-Version", apiClient.parameterToString(winkVersion));
final String[] localVarAccepts = {
"*/*", "application/json", "application/xml", "text/xml", "text/plain"
};
final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
final String[] localVarContentTypes = { };
final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
String[] localVarAuthNames = new String[] { "oauth2ClientCredentials" };
ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {};
return apiClient.invokeAPI("/api/company/{companyIdentifier}/inventory/grid/{dynamicListIdentifier}", HttpMethod.GET, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
}
/**
* Inventory Search by List
* Retrieves a paginated result set based on the given list identifier.
* 503 - Service Unavailable
*
400 - Bad Request
*
405 - Method Not Allowed
*
415 - Unsupported Media Type
*
500 - Internal Server Error
*
404 - Not Found
*
403 - Forbidden
*
401 - Unauthorized
*
200 - OK
* @param companyIdentifier Browse inventory on behalf of this owner identifier.
* @param dynamicListIdentifier Browse inventory on behalf of this dynamic list identifier.
* @param page Skip to page.
* @param size Skip to page.
* @param winkVersion The winkVersion parameter
* @return PageInventoryViewAffiliate
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
public Mono showDynamicSellerInventoryById(String companyIdentifier, String dynamicListIdentifier, Integer page, Integer size, String winkVersion) throws WebClientResponseException {
ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {};
return showDynamicSellerInventoryByIdRequestCreation(companyIdentifier, dynamicListIdentifier, page, size, winkVersion).bodyToMono(localVarReturnType);
}
public Mono> showDynamicSellerInventoryByIdWithHttpInfo(String companyIdentifier, String dynamicListIdentifier, Integer page, Integer size, String winkVersion) throws WebClientResponseException {
ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {};
return showDynamicSellerInventoryByIdRequestCreation(companyIdentifier, dynamicListIdentifier, page, size, winkVersion).toEntity(localVarReturnType);
}
/**
* Latest Inventory
* Retrieves a list of latest available inventory.
* 503 - Service Unavailable
*
400 - Bad Request
*
405 - Method Not Allowed
*
415 - Unsupported Media Type
*
500 - Internal Server Error
*
404 - Not Found
*
403 - Forbidden
*
401 - Unauthorized
*
200 - OK
* @param companyIdentifier Browse inventory on behalf of this owner identifier.
* @param page Skip to page.
* @param size Skip to page.
* @param winkVersion The winkVersion parameter
* @return List<InventoryViewAffiliate>
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
private ResponseSpec showLatestInventoryRequestCreation(String companyIdentifier, Integer page, Integer size, String winkVersion) throws WebClientResponseException {
Object postBody = null;
// verify the required parameter 'companyIdentifier' is set
if (companyIdentifier == null) {
throw new WebClientResponseException("Missing the required parameter 'companyIdentifier' when calling showLatestInventory", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null);
}
// create path and map variables
final Map pathParams = new HashMap();
pathParams.put("companyIdentifier", companyIdentifier);
final MultiValueMap queryParams = new LinkedMultiValueMap();
final HttpHeaders headerParams = new HttpHeaders();
final MultiValueMap cookieParams = new LinkedMultiValueMap();
final MultiValueMap formParams = new LinkedMultiValueMap();
queryParams.putAll(apiClient.parameterToMultiValueMap(null, "page", page));
queryParams.putAll(apiClient.parameterToMultiValueMap(null, "size", size));
if (winkVersion != null)
headerParams.add("Wink-Version", apiClient.parameterToString(winkVersion));
final String[] localVarAccepts = {
"*/*", "application/json", "application/xml", "text/xml", "text/plain"
};
final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
final String[] localVarContentTypes = { };
final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
String[] localVarAuthNames = new String[] { "oauth2ClientCredentials" };
ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {};
return apiClient.invokeAPI("/api/company/{companyIdentifier}/inventory/list", HttpMethod.GET, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
}
/**
* Latest Inventory
* Retrieves a list of latest available inventory.
* 503 - Service Unavailable
*
400 - Bad Request
*
405 - Method Not Allowed
*
415 - Unsupported Media Type
*
500 - Internal Server Error
*
404 - Not Found
*
403 - Forbidden
*
401 - Unauthorized
*
200 - OK
* @param companyIdentifier Browse inventory on behalf of this owner identifier.
* @param page Skip to page.
* @param size Skip to page.
* @param winkVersion The winkVersion parameter
* @return List<InventoryViewAffiliate>
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
public Flux showLatestInventory(String companyIdentifier, Integer page, Integer size, String winkVersion) throws WebClientResponseException {
ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {};
return showLatestInventoryRequestCreation(companyIdentifier, page, size, winkVersion).bodyToFlux(localVarReturnType);
}
public Mono>> showLatestInventoryWithHttpInfo(String companyIdentifier, Integer page, Integer size, String winkVersion) throws WebClientResponseException {
ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {};
return showLatestInventoryRequestCreation(companyIdentifier, page, size, winkVersion).toEntityList(localVarReturnType);
}
}