travel.wink.sdk.inventory.api.ShareableLinkApi Maven / Gradle / Ivy
Show all versions of inventory-sdk-java Show documentation
package travel.wink.sdk.inventory.api;
import travel.wink.sdk.inventory.invoker.ApiClient;
import travel.wink.sdk.inventory.model.ConsumableSellerUrlNonAuthenticatedEntity;
import travel.wink.sdk.inventory.model.GenericErrorMessage;
import travel.wink.sdk.inventory.model.Oauth2ShowConsumableUrl400Response;
import travel.wink.sdk.inventory.model.UserSessionNonAuthenticatedEntity;
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-28T11:54:35.134126621+07:00[Asia/Bangkok]")
public class ShareableLinkApi {
private ApiClient apiClient;
public ShareableLinkApi() {
this(new ApiClient());
}
@Autowired
public ShareableLinkApi(ApiClient apiClient) {
this.apiClient = apiClient;
}
public ApiClient getApiClient() {
return apiClient;
}
public void setApiClient(ApiClient apiClient) {
this.apiClient = apiClient;
}
/**
* Show Shareable Link (OAuth2)
* Retrieve a shareable link by its unique code
* 500 - Internal Server Error
*
403 - Forbidden
*
401 - Unauthorized
*
400 - Bad Request
*
200 - OK
* @param code Unique link code
* @param userSessionNonAuthenticatedEntity The userSessionNonAuthenticatedEntity parameter
* @param cid Optional campaign id
* @param winkVersion The winkVersion parameter
* @return ConsumableSellerUrlNonAuthenticatedEntity
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
private ResponseSpec oauth2ShowConsumableUrlRequestCreation(String code, UserSessionNonAuthenticatedEntity userSessionNonAuthenticatedEntity, String cid, String winkVersion) throws WebClientResponseException {
Object postBody = userSessionNonAuthenticatedEntity;
// verify the required parameter 'code' is set
if (code == null) {
throw new WebClientResponseException("Missing the required parameter 'code' when calling oauth2ShowConsumableUrl", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null);
}
// verify the required parameter 'userSessionNonAuthenticatedEntity' is set
if (userSessionNonAuthenticatedEntity == null) {
throw new WebClientResponseException("Missing the required parameter 'userSessionNonAuthenticatedEntity' when calling oauth2ShowConsumableUrl", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null);
}
// create path and map variables
final Map pathParams = new HashMap();
pathParams.put("code", code);
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, "cid", cid));
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/shareable-link/{code}", HttpMethod.POST, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
}
/**
* Show Shareable Link (OAuth2)
* Retrieve a shareable link by its unique code
* 500 - Internal Server Error
*
403 - Forbidden
*
401 - Unauthorized
*
400 - Bad Request
*
200 - OK
* @param code Unique link code
* @param userSessionNonAuthenticatedEntity The userSessionNonAuthenticatedEntity parameter
* @param cid Optional campaign id
* @param winkVersion The winkVersion parameter
* @return ConsumableSellerUrlNonAuthenticatedEntity
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
public Mono oauth2ShowConsumableUrl(String code, UserSessionNonAuthenticatedEntity userSessionNonAuthenticatedEntity, String cid, String winkVersion) throws WebClientResponseException {
ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {};
return oauth2ShowConsumableUrlRequestCreation(code, userSessionNonAuthenticatedEntity, cid, winkVersion).bodyToMono(localVarReturnType);
}
/**
* Show Shareable Link (OAuth2)
* Retrieve a shareable link by its unique code
* 500 - Internal Server Error
*
403 - Forbidden
*
401 - Unauthorized
*
400 - Bad Request
*
200 - OK
* @param code Unique link code
* @param userSessionNonAuthenticatedEntity The userSessionNonAuthenticatedEntity parameter
* @param cid Optional campaign id
* @param winkVersion The winkVersion parameter
* @return ResponseEntity<ConsumableSellerUrlNonAuthenticatedEntity>
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
public Mono> oauth2ShowConsumableUrlWithHttpInfo(String code, UserSessionNonAuthenticatedEntity userSessionNonAuthenticatedEntity, String cid, String winkVersion) throws WebClientResponseException {
ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {};
return oauth2ShowConsumableUrlRequestCreation(code, userSessionNonAuthenticatedEntity, cid, winkVersion).toEntity(localVarReturnType);
}
/**
* Show Shareable Link (OAuth2)
* Retrieve a shareable link by its unique code
* 500 - Internal Server Error
*
403 - Forbidden
*
401 - Unauthorized
*
400 - Bad Request
*
200 - OK
* @param code Unique link code
* @param userSessionNonAuthenticatedEntity The userSessionNonAuthenticatedEntity parameter
* @param cid Optional campaign id
* @param winkVersion The winkVersion parameter
* @return ResponseSpec
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
public ResponseSpec oauth2ShowConsumableUrlWithResponseSpec(String code, UserSessionNonAuthenticatedEntity userSessionNonAuthenticatedEntity, String cid, String winkVersion) throws WebClientResponseException {
return oauth2ShowConsumableUrlRequestCreation(code, userSessionNonAuthenticatedEntity, cid, winkVersion);
}
/**
* Show Shareable Link
* Retrieve a shareable link by its unique code
*
500 - Internal Server Error
*
403 - Forbidden
*
401 - Unauthorized
*
400 - Bad Request
*
200 - OK
* @param companyIdentifier Affiliate account identifier
* @param code The code parameter
* @param userSessionNonAuthenticatedEntity The userSessionNonAuthenticatedEntity parameter
* @param cid The cid parameter
* @param winkVersion The winkVersion parameter
* @return ConsumableSellerUrlNonAuthenticatedEntity
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
private ResponseSpec showConsumableUrlRequestCreation(String companyIdentifier, String code, UserSessionNonAuthenticatedEntity userSessionNonAuthenticatedEntity, String cid, String winkVersion) throws WebClientResponseException {
Object postBody = userSessionNonAuthenticatedEntity;
// verify the required parameter 'companyIdentifier' is set
if (companyIdentifier == null) {
throw new WebClientResponseException("Missing the required parameter 'companyIdentifier' when calling showConsumableUrl", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null);
}
// verify the required parameter 'code' is set
if (code == null) {
throw new WebClientResponseException("Missing the required parameter 'code' when calling showConsumableUrl", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null);
}
// verify the required parameter 'userSessionNonAuthenticatedEntity' is set
if (userSessionNonAuthenticatedEntity == null) {
throw new WebClientResponseException("Missing the required parameter 'userSessionNonAuthenticatedEntity' when calling showConsumableUrl", 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("code", code);
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, "cid", cid));
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/sell/{companyIdentifier}/shareable-link/{code}", HttpMethod.POST, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
}
/**
* Show Shareable Link
* Retrieve a shareable link by its unique code
* 500 - Internal Server Error
*
403 - Forbidden
*
401 - Unauthorized
*
400 - Bad Request
*
200 - OK
* @param companyIdentifier Affiliate account identifier
* @param code The code parameter
* @param userSessionNonAuthenticatedEntity The userSessionNonAuthenticatedEntity parameter
* @param cid The cid parameter
* @param winkVersion The winkVersion parameter
* @return ConsumableSellerUrlNonAuthenticatedEntity
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
public Mono showConsumableUrl(String companyIdentifier, String code, UserSessionNonAuthenticatedEntity userSessionNonAuthenticatedEntity, String cid, String winkVersion) throws WebClientResponseException {
ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {};
return showConsumableUrlRequestCreation(companyIdentifier, code, userSessionNonAuthenticatedEntity, cid, winkVersion).bodyToMono(localVarReturnType);
}
/**
* Show Shareable Link
* Retrieve a shareable link by its unique code
* 500 - Internal Server Error
*
403 - Forbidden
*
401 - Unauthorized
*
400 - Bad Request
*
200 - OK
* @param companyIdentifier Affiliate account identifier
* @param code The code parameter
* @param userSessionNonAuthenticatedEntity The userSessionNonAuthenticatedEntity parameter
* @param cid The cid parameter
* @param winkVersion The winkVersion parameter
* @return ResponseEntity<ConsumableSellerUrlNonAuthenticatedEntity>
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
public Mono> showConsumableUrlWithHttpInfo(String companyIdentifier, String code, UserSessionNonAuthenticatedEntity userSessionNonAuthenticatedEntity, String cid, String winkVersion) throws WebClientResponseException {
ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {};
return showConsumableUrlRequestCreation(companyIdentifier, code, userSessionNonAuthenticatedEntity, cid, winkVersion).toEntity(localVarReturnType);
}
/**
* Show Shareable Link
* Retrieve a shareable link by its unique code
* 500 - Internal Server Error
*
403 - Forbidden
*
401 - Unauthorized
*
400 - Bad Request
*
200 - OK
* @param companyIdentifier Affiliate account identifier
* @param code The code parameter
* @param userSessionNonAuthenticatedEntity The userSessionNonAuthenticatedEntity parameter
* @param cid The cid parameter
* @param winkVersion The winkVersion parameter
* @return ResponseSpec
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
public ResponseSpec showConsumableUrlWithResponseSpec(String companyIdentifier, String code, UserSessionNonAuthenticatedEntity userSessionNonAuthenticatedEntity, String cid, String winkVersion) throws WebClientResponseException {
return showConsumableUrlRequestCreation(companyIdentifier, code, userSessionNonAuthenticatedEntity, cid, winkVersion);
}
}