travel.wink.sdk.extranet.distribution.api.AffiliateApi Maven / Gradle / Ivy
package travel.wink.sdk.extranet.distribution.api;
import travel.wink.sdk.extranet.distribution.invoker.ApiClient;
import travel.wink.sdk.extranet.distribution.model.CompanyDetailsBookingSalesMetricsSupplier;
import travel.wink.sdk.extranet.distribution.model.GenericErrorMessage;
import travel.wink.sdk.extranet.distribution.model.KeyValuePairSupplier;
import travel.wink.sdk.extranet.distribution.model.PageDisplayCompanyWithSalesMetricsSupplier;
import travel.wink.sdk.extranet.distribution.model.ShowInventory400Response;
import travel.wink.sdk.extranet.distribution.model.StateSupplier;
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;
@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-09-15T11:58:01.003340498+07:00[Asia/Bangkok]")
public class AffiliateApi {
private ApiClient apiClient;
public AffiliateApi() {
this(new ApiClient());
}
@Autowired
public AffiliateApi(ApiClient apiClient) {
this.apiClient = apiClient;
}
public ApiClient getApiClient() {
return apiClient;
}
public void setApiClient(ApiClient apiClient) {
this.apiClient = apiClient;
}
/**
* Show Affiliates
* Retrieve page of affiliates.
* 500 - Internal Server Error
*
403 - Forbidden
*
401 - Unauthorized
*
400 - Bad Request
*
200 - OK
* @param propertyIdentifier Display affiliates to this specified property
* @param stateSupplier The stateSupplier parameter
* @param winkVersion The winkVersion parameter
* @return PageDisplayCompanyWithSalesMetricsSupplier
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
private ResponseSpec browseAffiliatesRequestCreation(String propertyIdentifier, StateSupplier stateSupplier, String winkVersion) throws WebClientResponseException {
Object postBody = stateSupplier;
// verify the required parameter 'propertyIdentifier' is set
if (propertyIdentifier == null) {
throw new WebClientResponseException("Missing the required parameter 'propertyIdentifier' when calling browseAffiliates", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null);
}
// verify the required parameter 'stateSupplier' is set
if (stateSupplier == null) {
throw new WebClientResponseException("Missing the required parameter 'stateSupplier' when calling browseAffiliates", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null);
}
// create path and map variables
final Map pathParams = new HashMap();
pathParams.put("propertyIdentifier", propertyIdentifier);
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/property/{propertyIdentifier}/sales/affiliate/grid", HttpMethod.POST, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
}
/**
* Show Affiliates
* Retrieve page of affiliates.
* 500 - Internal Server Error
*
403 - Forbidden
*
401 - Unauthorized
*
400 - Bad Request
*
200 - OK
* @param propertyIdentifier Display affiliates to this specified property
* @param stateSupplier The stateSupplier parameter
* @param winkVersion The winkVersion parameter
* @return PageDisplayCompanyWithSalesMetricsSupplier
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
public Mono browseAffiliates(String propertyIdentifier, StateSupplier stateSupplier, String winkVersion) throws WebClientResponseException {
ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {};
return browseAffiliatesRequestCreation(propertyIdentifier, stateSupplier, winkVersion).bodyToMono(localVarReturnType);
}
/**
* Show Affiliates
* Retrieve page of affiliates.
* 500 - Internal Server Error
*
403 - Forbidden
*
401 - Unauthorized
*
400 - Bad Request
*
200 - OK
* @param propertyIdentifier Display affiliates to this specified property
* @param stateSupplier The stateSupplier parameter
* @param winkVersion The winkVersion parameter
* @return ResponseEntity<PageDisplayCompanyWithSalesMetricsSupplier>
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
public Mono> browseAffiliatesWithHttpInfo(String propertyIdentifier, StateSupplier stateSupplier, String winkVersion) throws WebClientResponseException {
ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {};
return browseAffiliatesRequestCreation(propertyIdentifier, stateSupplier, winkVersion).toEntity(localVarReturnType);
}
/**
* Show Affiliates
* Retrieve page of affiliates.
* 500 - Internal Server Error
*
403 - Forbidden
*
401 - Unauthorized
*
400 - Bad Request
*
200 - OK
* @param propertyIdentifier Display affiliates to this specified property
* @param stateSupplier The stateSupplier parameter
* @param winkVersion The winkVersion parameter
* @return ResponseSpec
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
public ResponseSpec browseAffiliatesWithResponseSpec(String propertyIdentifier, StateSupplier stateSupplier, String winkVersion) throws WebClientResponseException {
return browseAffiliatesRequestCreation(propertyIdentifier, stateSupplier, winkVersion);
}
/**
* Show Affiliate
* Retrieve affiliate information specified by identifier
*
500 - Internal Server Error
*
403 - Forbidden
*
401 - Unauthorized
*
400 - Bad Request
*
200 - OK
* @param propertyIdentifier Display affiliate to this specified property
* @param companyIdentifier Display affiliate by specified company
* @param winkVersion The winkVersion parameter
* @param accept The accept parameter
* @return CompanyDetailsBookingSalesMetricsSupplier
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
private ResponseSpec showAffiliateRequestCreation(String propertyIdentifier, String companyIdentifier, String winkVersion, String accept) throws WebClientResponseException {
Object postBody = null;
// verify the required parameter 'propertyIdentifier' is set
if (propertyIdentifier == null) {
throw new WebClientResponseException("Missing the required parameter 'propertyIdentifier' when calling showAffiliate", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null);
}
// verify the required parameter 'companyIdentifier' is set
if (companyIdentifier == null) {
throw new WebClientResponseException("Missing the required parameter 'companyIdentifier' when calling showAffiliate", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null);
}
// create path and map variables
final Map pathParams = new HashMap();
pathParams.put("propertyIdentifier", propertyIdentifier);
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));
if (accept != null)
headerParams.add("Accept", apiClient.parameterToString(accept));
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/property/{propertyIdentifier}/sales/affiliate/{companyIdentifier}", HttpMethod.GET, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
}
/**
* Show Affiliate
* Retrieve affiliate information specified by identifier
* 500 - Internal Server Error
*
403 - Forbidden
*
401 - Unauthorized
*
400 - Bad Request
*
200 - OK
* @param propertyIdentifier Display affiliate to this specified property
* @param companyIdentifier Display affiliate by specified company
* @param winkVersion The winkVersion parameter
* @param accept The accept parameter
* @return CompanyDetailsBookingSalesMetricsSupplier
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
public Mono showAffiliate(String propertyIdentifier, String companyIdentifier, String winkVersion, String accept) throws WebClientResponseException {
ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {};
return showAffiliateRequestCreation(propertyIdentifier, companyIdentifier, winkVersion, accept).bodyToMono(localVarReturnType);
}
/**
* Show Affiliate
* Retrieve affiliate information specified by identifier
* 500 - Internal Server Error
*
403 - Forbidden
*
401 - Unauthorized
*
400 - Bad Request
*
200 - OK
* @param propertyIdentifier Display affiliate to this specified property
* @param companyIdentifier Display affiliate by specified company
* @param winkVersion The winkVersion parameter
* @param accept The accept parameter
* @return ResponseEntity<CompanyDetailsBookingSalesMetricsSupplier>
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
public Mono> showAffiliateWithHttpInfo(String propertyIdentifier, String companyIdentifier, String winkVersion, String accept) throws WebClientResponseException {
ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {};
return showAffiliateRequestCreation(propertyIdentifier, companyIdentifier, winkVersion, accept).toEntity(localVarReturnType);
}
/**
* Show Affiliate
* Retrieve affiliate information specified by identifier
* 500 - Internal Server Error
*
403 - Forbidden
*
401 - Unauthorized
*
400 - Bad Request
*
200 - OK
* @param propertyIdentifier Display affiliate to this specified property
* @param companyIdentifier Display affiliate by specified company
* @param winkVersion The winkVersion parameter
* @param accept The accept parameter
* @return ResponseSpec
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
public ResponseSpec showAffiliateWithResponseSpec(String propertyIdentifier, String companyIdentifier, String winkVersion, String accept) throws WebClientResponseException {
return showAffiliateRequestCreation(propertyIdentifier, companyIdentifier, winkVersion, accept);
}
/**
* Show Unique Affiliate Cities
* Retrieve a list of unique cities where affiliates live
*
500 - Internal Server Error
*
403 - Forbidden
*
401 - Unauthorized
*
400 - Bad Request
*
200 - OK
* @param propertyIdentifier Display unique cities of affiliate to this specified property
* @param winkVersion The winkVersion parameter
* @param accept The accept parameter
* @return List<KeyValuePairSupplier>
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
private ResponseSpec showUniqueCityListRequestCreation(String propertyIdentifier, String winkVersion, String accept) throws WebClientResponseException {
Object postBody = null;
// verify the required parameter 'propertyIdentifier' is set
if (propertyIdentifier == null) {
throw new WebClientResponseException("Missing the required parameter 'propertyIdentifier' when calling showUniqueCityList", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null);
}
// create path and map variables
final Map pathParams = new HashMap();
pathParams.put("propertyIdentifier", propertyIdentifier);
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));
if (accept != null)
headerParams.add("Accept", apiClient.parameterToString(accept));
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/property/{propertyIdentifier}/sales/affiliate/city/list", HttpMethod.GET, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
}
/**
* Show Unique Affiliate Cities
* Retrieve a list of unique cities where affiliates live
* 500 - Internal Server Error
*
403 - Forbidden
*
401 - Unauthorized
*
400 - Bad Request
*
200 - OK
* @param propertyIdentifier Display unique cities of affiliate to this specified property
* @param winkVersion The winkVersion parameter
* @param accept The accept parameter
* @return List<KeyValuePairSupplier>
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
public Flux showUniqueCityList(String propertyIdentifier, String winkVersion, String accept) throws WebClientResponseException {
ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {};
return showUniqueCityListRequestCreation(propertyIdentifier, winkVersion, accept).bodyToFlux(localVarReturnType);
}
/**
* Show Unique Affiliate Cities
* Retrieve a list of unique cities where affiliates live
* 500 - Internal Server Error
*
403 - Forbidden
*
401 - Unauthorized
*
400 - Bad Request
*
200 - OK
* @param propertyIdentifier Display unique cities of affiliate to this specified property
* @param winkVersion The winkVersion parameter
* @param accept The accept parameter
* @return ResponseEntity<List<KeyValuePairSupplier>>
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
public Mono>> showUniqueCityListWithHttpInfo(String propertyIdentifier, String winkVersion, String accept) throws WebClientResponseException {
ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {};
return showUniqueCityListRequestCreation(propertyIdentifier, winkVersion, accept).toEntityList(localVarReturnType);
}
/**
* Show Unique Affiliate Cities
* Retrieve a list of unique cities where affiliates live
* 500 - Internal Server Error
*
403 - Forbidden
*
401 - Unauthorized
*
400 - Bad Request
*
200 - OK
* @param propertyIdentifier Display unique cities of affiliate to this specified property
* @param winkVersion The winkVersion parameter
* @param accept The accept parameter
* @return ResponseSpec
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
public ResponseSpec showUniqueCityListWithResponseSpec(String propertyIdentifier, String winkVersion, String accept) throws WebClientResponseException {
return showUniqueCityListRequestCreation(propertyIdentifier, winkVersion, accept);
}
/**
* Show Unique Affiliate Countries
* Retrieve a list of unique countries where affiliates live
*
500 - Internal Server Error
*
403 - Forbidden
*
401 - Unauthorized
*
400 - Bad Request
*
200 - OK
* @param propertyIdentifier Display unique countries of affiliate to this specified property
* @param winkVersion The winkVersion parameter
* @param accept The accept parameter
* @return List<KeyValuePairSupplier>
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
private ResponseSpec showUniqueCountryListRequestCreation(String propertyIdentifier, String winkVersion, String accept) throws WebClientResponseException {
Object postBody = null;
// verify the required parameter 'propertyIdentifier' is set
if (propertyIdentifier == null) {
throw new WebClientResponseException("Missing the required parameter 'propertyIdentifier' when calling showUniqueCountryList", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null);
}
// create path and map variables
final Map pathParams = new HashMap();
pathParams.put("propertyIdentifier", propertyIdentifier);
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));
if (accept != null)
headerParams.add("Accept", apiClient.parameterToString(accept));
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/property/{propertyIdentifier}/sales/affiliate/country/list", HttpMethod.GET, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
}
/**
* Show Unique Affiliate Countries
* Retrieve a list of unique countries where affiliates live
* 500 - Internal Server Error
*
403 - Forbidden
*
401 - Unauthorized
*
400 - Bad Request
*
200 - OK
* @param propertyIdentifier Display unique countries of affiliate to this specified property
* @param winkVersion The winkVersion parameter
* @param accept The accept parameter
* @return List<KeyValuePairSupplier>
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
public Flux showUniqueCountryList(String propertyIdentifier, String winkVersion, String accept) throws WebClientResponseException {
ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {};
return showUniqueCountryListRequestCreation(propertyIdentifier, winkVersion, accept).bodyToFlux(localVarReturnType);
}
/**
* Show Unique Affiliate Countries
* Retrieve a list of unique countries where affiliates live
* 500 - Internal Server Error
*
403 - Forbidden
*
401 - Unauthorized
*
400 - Bad Request
*
200 - OK
* @param propertyIdentifier Display unique countries of affiliate to this specified property
* @param winkVersion The winkVersion parameter
* @param accept The accept parameter
* @return ResponseEntity<List<KeyValuePairSupplier>>
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
public Mono>> showUniqueCountryListWithHttpInfo(String propertyIdentifier, String winkVersion, String accept) throws WebClientResponseException {
ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {};
return showUniqueCountryListRequestCreation(propertyIdentifier, winkVersion, accept).toEntityList(localVarReturnType);
}
/**
* Show Unique Affiliate Countries
* Retrieve a list of unique countries where affiliates live
* 500 - Internal Server Error
*
403 - Forbidden
*
401 - Unauthorized
*
400 - Bad Request
*
200 - OK
* @param propertyIdentifier Display unique countries of affiliate to this specified property
* @param winkVersion The winkVersion parameter
* @param accept The accept parameter
* @return ResponseSpec
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
public ResponseSpec showUniqueCountryListWithResponseSpec(String propertyIdentifier, String winkVersion, String accept) throws WebClientResponseException {
return showUniqueCountryListRequestCreation(propertyIdentifier, winkVersion, accept);
}
}