travel.wink.sdk.extranet.api.MediaApi Maven / Gradle / Ivy
Show all versions of extranet-sdk-java Show documentation
package travel.wink.sdk.extranet.api;
import travel.wink.sdk.extranet.invoker.ApiClient;
import java.io.File;
import travel.wink.sdk.extranet.model.GenericErrorMessage;
import travel.wink.sdk.extranet.model.HotelViewSupplier;
import travel.wink.sdk.extranet.model.ShowPropertyPolicy400Response;
import travel.wink.sdk.extranet.model.SimpleMultimediaSupplier;
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-06-04T22:29:13.908295668+07:00[Asia/Bangkok]")
public class MediaApi {
private ApiClient apiClient;
public MediaApi() {
this(new ApiClient());
}
@Autowired
public MediaApi(ApiClient apiClient) {
this.apiClient = apiClient;
}
public ApiClient getApiClient() {
return apiClient;
}
public void setApiClient(ApiClient apiClient) {
this.apiClient = apiClient;
}
/**
* Create Multimedia
* Save multimedia of a hotel identified by its identifier
* 503 - Service Unavailable
*
400 - Bad Request
*
405 - Method Not Allowed
*
415 - Unsupported Media Type
*
500 - Internal Server Error
*
403 - Forbidden
*
401 - Unauthorized
*
201 - Created
* @param hotelIdentifier Save a single media associated with this hotel identifier
* @param simpleMultimediaSupplier The simpleMultimediaSupplier parameter
* @param winkVersion The winkVersion parameter
* @return HotelViewSupplier
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
private ResponseSpec createMultimediaRequestCreation(String hotelIdentifier, SimpleMultimediaSupplier simpleMultimediaSupplier, String winkVersion) throws WebClientResponseException {
Object postBody = simpleMultimediaSupplier;
// verify the required parameter 'hotelIdentifier' is set
if (hotelIdentifier == null) {
throw new WebClientResponseException("Missing the required parameter 'hotelIdentifier' when calling createMultimedia", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null);
}
// verify the required parameter 'simpleMultimediaSupplier' is set
if (simpleMultimediaSupplier == null) {
throw new WebClientResponseException("Missing the required parameter 'simpleMultimediaSupplier' when calling createMultimedia", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null);
}
// create path and map variables
final Map pathParams = new HashMap();
pathParams.put("hotelIdentifier", hotelIdentifier);
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/hotel/{hotelIdentifier}/multimedia", HttpMethod.POST, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
}
/**
* Create Multimedia
* Save multimedia of a hotel identified by its identifier
* 503 - Service Unavailable
*
400 - Bad Request
*
405 - Method Not Allowed
*
415 - Unsupported Media Type
*
500 - Internal Server Error
*
403 - Forbidden
*
401 - Unauthorized
*
201 - Created
* @param hotelIdentifier Save a single media associated with this hotel identifier
* @param simpleMultimediaSupplier The simpleMultimediaSupplier parameter
* @param winkVersion The winkVersion parameter
* @return HotelViewSupplier
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
public Mono createMultimedia(String hotelIdentifier, SimpleMultimediaSupplier simpleMultimediaSupplier, String winkVersion) throws WebClientResponseException {
ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {};
return createMultimediaRequestCreation(hotelIdentifier, simpleMultimediaSupplier, winkVersion).bodyToMono(localVarReturnType);
}
/**
* Create Multimedia
* Save multimedia of a hotel identified by its identifier
* 503 - Service Unavailable
*
400 - Bad Request
*
405 - Method Not Allowed
*
415 - Unsupported Media Type
*
500 - Internal Server Error
*
403 - Forbidden
*
401 - Unauthorized
*
201 - Created
* @param hotelIdentifier Save a single media associated with this hotel identifier
* @param simpleMultimediaSupplier The simpleMultimediaSupplier parameter
* @param winkVersion The winkVersion parameter
* @return ResponseEntity<HotelViewSupplier>
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
public Mono> createMultimediaWithHttpInfo(String hotelIdentifier, SimpleMultimediaSupplier simpleMultimediaSupplier, String winkVersion) throws WebClientResponseException {
ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {};
return createMultimediaRequestCreation(hotelIdentifier, simpleMultimediaSupplier, winkVersion).toEntity(localVarReturnType);
}
/**
* Create Multimedia
* Save multimedia of a hotel identified by its identifier
* 503 - Service Unavailable
*
400 - Bad Request
*
405 - Method Not Allowed
*
415 - Unsupported Media Type
*
500 - Internal Server Error
*
403 - Forbidden
*
401 - Unauthorized
*
201 - Created
* @param hotelIdentifier Save a single media associated with this hotel identifier
* @param simpleMultimediaSupplier The simpleMultimediaSupplier parameter
* @param winkVersion The winkVersion parameter
* @return ResponseSpec
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
public ResponseSpec createMultimediaWithResponseSpec(String hotelIdentifier, SimpleMultimediaSupplier simpleMultimediaSupplier, String winkVersion) throws WebClientResponseException {
return createMultimediaRequestCreation(hotelIdentifier, simpleMultimediaSupplier, winkVersion);
}
/**
* Delete Multimedia List
* Remove multimedia list of a hotel identified by its identifier
*
503 - Service Unavailable
*
400 - Bad Request
*
405 - Method Not Allowed
*
415 - Unsupported Media Type
*
500 - Internal Server Error
*
403 - Forbidden
*
401 - Unauthorized
*
207 - Multi-Status
* @param hotelIdentifier Remove selected media for this hotel identifier
* @param multimediaIdentifiers Remove media identified by these identifiers
* @param winkVersion The winkVersion parameter
* @return HotelViewSupplier
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
private ResponseSpec removeMediaListRequestCreation(String hotelIdentifier, List multimediaIdentifiers, String winkVersion) throws WebClientResponseException {
Object postBody = null;
// verify the required parameter 'hotelIdentifier' is set
if (hotelIdentifier == null) {
throw new WebClientResponseException("Missing the required parameter 'hotelIdentifier' when calling removeMediaList", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null);
}
// verify the required parameter 'multimediaIdentifiers' is set
if (multimediaIdentifiers == null) {
throw new WebClientResponseException("Missing the required parameter 'multimediaIdentifiers' when calling removeMediaList", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null);
}
// create path and map variables
final Map pathParams = new HashMap();
pathParams.put("hotelIdentifier", hotelIdentifier);
final MultiValueMap queryParams = new LinkedMultiValueMap();
final HttpHeaders headerParams = new HttpHeaders();
final MultiValueMap cookieParams = new LinkedMultiValueMap();
final MultiValueMap formParams = new LinkedMultiValueMap();
queryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("multi".toUpperCase(Locale.ROOT)), "multimediaIdentifiers", multimediaIdentifiers));
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/hotel/{hotelIdentifier}/multimedia/list", HttpMethod.DELETE, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
}
/**
* Delete Multimedia List
* Remove multimedia list of a hotel identified by its identifier
* 503 - Service Unavailable
*
400 - Bad Request
*
405 - Method Not Allowed
*
415 - Unsupported Media Type
*
500 - Internal Server Error
*
403 - Forbidden
*
401 - Unauthorized
*
207 - Multi-Status
* @param hotelIdentifier Remove selected media for this hotel identifier
* @param multimediaIdentifiers Remove media identified by these identifiers
* @param winkVersion The winkVersion parameter
* @return HotelViewSupplier
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
public Mono removeMediaList(String hotelIdentifier, List multimediaIdentifiers, String winkVersion) throws WebClientResponseException {
ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {};
return removeMediaListRequestCreation(hotelIdentifier, multimediaIdentifiers, winkVersion).bodyToMono(localVarReturnType);
}
/**
* Delete Multimedia List
* Remove multimedia list of a hotel identified by its identifier
* 503 - Service Unavailable
*
400 - Bad Request
*
405 - Method Not Allowed
*
415 - Unsupported Media Type
*
500 - Internal Server Error
*
403 - Forbidden
*
401 - Unauthorized
*
207 - Multi-Status
* @param hotelIdentifier Remove selected media for this hotel identifier
* @param multimediaIdentifiers Remove media identified by these identifiers
* @param winkVersion The winkVersion parameter
* @return ResponseEntity<HotelViewSupplier>
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
public Mono> removeMediaListWithHttpInfo(String hotelIdentifier, List multimediaIdentifiers, String winkVersion) throws WebClientResponseException {
ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {};
return removeMediaListRequestCreation(hotelIdentifier, multimediaIdentifiers, winkVersion).toEntity(localVarReturnType);
}
/**
* Delete Multimedia List
* Remove multimedia list of a hotel identified by its identifier
* 503 - Service Unavailable
*
400 - Bad Request
*
405 - Method Not Allowed
*
415 - Unsupported Media Type
*
500 - Internal Server Error
*
403 - Forbidden
*
401 - Unauthorized
*
207 - Multi-Status
* @param hotelIdentifier Remove selected media for this hotel identifier
* @param multimediaIdentifiers Remove media identified by these identifiers
* @param winkVersion The winkVersion parameter
* @return ResponseSpec
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
public ResponseSpec removeMediaListWithResponseSpec(String hotelIdentifier, List multimediaIdentifiers, String winkVersion) throws WebClientResponseException {
return removeMediaListRequestCreation(hotelIdentifier, multimediaIdentifiers, winkVersion);
}
/**
* Delete Multimedia
* Remove multimedia record for hotel identified by its identifier
* 503 - Service Unavailable
*
400 - Bad Request
*
405 - Method Not Allowed
*
415 - Unsupported Media Type
*
500 - Internal Server Error
*
403 - Forbidden
*
401 - Unauthorized
*
202 - Accepted
* @param hotelIdentifier Remove a single media associated with this hotel identifier
* @param multimediaIdentifier Remove record for this media identifier
* @param winkVersion The winkVersion parameter
* @return HotelViewSupplier
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
private ResponseSpec removeMultimediaRequestCreation(String hotelIdentifier, String multimediaIdentifier, String winkVersion) throws WebClientResponseException {
Object postBody = null;
// verify the required parameter 'hotelIdentifier' is set
if (hotelIdentifier == null) {
throw new WebClientResponseException("Missing the required parameter 'hotelIdentifier' when calling removeMultimedia", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null);
}
// verify the required parameter 'multimediaIdentifier' is set
if (multimediaIdentifier == null) {
throw new WebClientResponseException("Missing the required parameter 'multimediaIdentifier' when calling removeMultimedia", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null);
}
// create path and map variables
final Map pathParams = new HashMap();
pathParams.put("hotelIdentifier", hotelIdentifier);
pathParams.put("multimediaIdentifier", multimediaIdentifier);
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/hotel/{hotelIdentifier}/multimedia/{multimediaIdentifier}", HttpMethod.DELETE, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
}
/**
* Delete Multimedia
* Remove multimedia record for hotel identified by its identifier
* 503 - Service Unavailable
*
400 - Bad Request
*
405 - Method Not Allowed
*
415 - Unsupported Media Type
*
500 - Internal Server Error
*
403 - Forbidden
*
401 - Unauthorized
*
202 - Accepted
* @param hotelIdentifier Remove a single media associated with this hotel identifier
* @param multimediaIdentifier Remove record for this media identifier
* @param winkVersion The winkVersion parameter
* @return HotelViewSupplier
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
public Mono removeMultimedia(String hotelIdentifier, String multimediaIdentifier, String winkVersion) throws WebClientResponseException {
ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {};
return removeMultimediaRequestCreation(hotelIdentifier, multimediaIdentifier, winkVersion).bodyToMono(localVarReturnType);
}
/**
* Delete Multimedia
* Remove multimedia record for hotel identified by its identifier
* 503 - Service Unavailable
*
400 - Bad Request
*
405 - Method Not Allowed
*
415 - Unsupported Media Type
*
500 - Internal Server Error
*
403 - Forbidden
*
401 - Unauthorized
*
202 - Accepted
* @param hotelIdentifier Remove a single media associated with this hotel identifier
* @param multimediaIdentifier Remove record for this media identifier
* @param winkVersion The winkVersion parameter
* @return ResponseEntity<HotelViewSupplier>
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
public Mono> removeMultimediaWithHttpInfo(String hotelIdentifier, String multimediaIdentifier, String winkVersion) throws WebClientResponseException {
ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {};
return removeMultimediaRequestCreation(hotelIdentifier, multimediaIdentifier, winkVersion).toEntity(localVarReturnType);
}
/**
* Delete Multimedia
* Remove multimedia record for hotel identified by its identifier
* 503 - Service Unavailable
*
400 - Bad Request
*
405 - Method Not Allowed
*
415 - Unsupported Media Type
*
500 - Internal Server Error
*
403 - Forbidden
*
401 - Unauthorized
*
202 - Accepted
* @param hotelIdentifier Remove a single media associated with this hotel identifier
* @param multimediaIdentifier Remove record for this media identifier
* @param winkVersion The winkVersion parameter
* @return ResponseSpec
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
public ResponseSpec removeMultimediaWithResponseSpec(String hotelIdentifier, String multimediaIdentifier, String winkVersion) throws WebClientResponseException {
return removeMultimediaRequestCreation(hotelIdentifier, multimediaIdentifier, winkVersion);
}
/**
* Show Multimedia
* Retrieve list of multimedia (images / videos) for property.
*
503 - Service Unavailable
*
400 - Bad Request
*
405 - Method Not Allowed
*
415 - Unsupported Media Type
*
500 - Internal Server Error
*
403 - Forbidden
*
401 - Unauthorized
*
200 - OK
* @param hotelIdentifier Show media associated with this hotel identifier
* @param winkVersion The winkVersion parameter
* @return List<SimpleMultimediaSupplier>
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
private ResponseSpec showMediaListRequestCreation(String hotelIdentifier, String winkVersion) throws WebClientResponseException {
Object postBody = null;
// verify the required parameter 'hotelIdentifier' is set
if (hotelIdentifier == null) {
throw new WebClientResponseException("Missing the required parameter 'hotelIdentifier' when calling showMediaList", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null);
}
// create path and map variables
final Map pathParams = new HashMap();
pathParams.put("hotelIdentifier", hotelIdentifier);
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/hotel/{hotelIdentifier}/multimedia/list", HttpMethod.GET, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
}
/**
* Show Multimedia
* Retrieve list of multimedia (images / videos) for property.
* 503 - Service Unavailable
*
400 - Bad Request
*
405 - Method Not Allowed
*
415 - Unsupported Media Type
*
500 - Internal Server Error
*
403 - Forbidden
*
401 - Unauthorized
*
200 - OK
* @param hotelIdentifier Show media associated with this hotel identifier
* @param winkVersion The winkVersion parameter
* @return List<SimpleMultimediaSupplier>
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
public Flux showMediaList(String hotelIdentifier, String winkVersion) throws WebClientResponseException {
ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {};
return showMediaListRequestCreation(hotelIdentifier, winkVersion).bodyToFlux(localVarReturnType);
}
/**
* Show Multimedia
* Retrieve list of multimedia (images / videos) for property.
* 503 - Service Unavailable
*
400 - Bad Request
*
405 - Method Not Allowed
*
415 - Unsupported Media Type
*
500 - Internal Server Error
*
403 - Forbidden
*
401 - Unauthorized
*
200 - OK
* @param hotelIdentifier Show media associated with this hotel identifier
* @param winkVersion The winkVersion parameter
* @return ResponseEntity<List<SimpleMultimediaSupplier>>
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
public Mono>> showMediaListWithHttpInfo(String hotelIdentifier, String winkVersion) throws WebClientResponseException {
ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {};
return showMediaListRequestCreation(hotelIdentifier, winkVersion).toEntityList(localVarReturnType);
}
/**
* Show Multimedia
* Retrieve list of multimedia (images / videos) for property.
* 503 - Service Unavailable
*
400 - Bad Request
*
405 - Method Not Allowed
*
415 - Unsupported Media Type
*
500 - Internal Server Error
*
403 - Forbidden
*
401 - Unauthorized
*
200 - OK
* @param hotelIdentifier Show media associated with this hotel identifier
* @param winkVersion The winkVersion parameter
* @return ResponseSpec
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
public ResponseSpec showMediaListWithResponseSpec(String hotelIdentifier, String winkVersion) throws WebClientResponseException {
return showMediaListRequestCreation(hotelIdentifier, winkVersion);
}
/**
* Update Multimedia List
* Save/Update multimedia list of a hotel identified by its identifier
*
503 - Service Unavailable
*
400 - Bad Request
*
405 - Method Not Allowed
*
415 - Unsupported Media Type
*
500 - Internal Server Error
*
403 - Forbidden
*
401 - Unauthorized
*
200 - OK
* @param hotelIdentifier Save media to the property with this hotel identifier
* @param simpleMultimediaSupplier The simpleMultimediaSupplier parameter
* @param winkVersion The winkVersion parameter
* @return HotelViewSupplier
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
private ResponseSpec updateMediaListRequestCreation(String hotelIdentifier, List simpleMultimediaSupplier, String winkVersion) throws WebClientResponseException {
Object postBody = simpleMultimediaSupplier;
// verify the required parameter 'hotelIdentifier' is set
if (hotelIdentifier == null) {
throw new WebClientResponseException("Missing the required parameter 'hotelIdentifier' when calling updateMediaList", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null);
}
// verify the required parameter 'simpleMultimediaSupplier' is set
if (simpleMultimediaSupplier == null) {
throw new WebClientResponseException("Missing the required parameter 'simpleMultimediaSupplier' when calling updateMediaList", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null);
}
// create path and map variables
final Map pathParams = new HashMap();
pathParams.put("hotelIdentifier", hotelIdentifier);
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/hotel/{hotelIdentifier}/multimedia/list", HttpMethod.POST, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
}
/**
* Update Multimedia List
* Save/Update multimedia list of a hotel identified by its identifier
* 503 - Service Unavailable
*
400 - Bad Request
*
405 - Method Not Allowed
*
415 - Unsupported Media Type
*
500 - Internal Server Error
*
403 - Forbidden
*
401 - Unauthorized
*
200 - OK
* @param hotelIdentifier Save media to the property with this hotel identifier
* @param simpleMultimediaSupplier The simpleMultimediaSupplier parameter
* @param winkVersion The winkVersion parameter
* @return HotelViewSupplier
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
public Mono updateMediaList(String hotelIdentifier, List simpleMultimediaSupplier, String winkVersion) throws WebClientResponseException {
ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {};
return updateMediaListRequestCreation(hotelIdentifier, simpleMultimediaSupplier, winkVersion).bodyToMono(localVarReturnType);
}
/**
* Update Multimedia List
* Save/Update multimedia list of a hotel identified by its identifier
* 503 - Service Unavailable
*
400 - Bad Request
*
405 - Method Not Allowed
*
415 - Unsupported Media Type
*
500 - Internal Server Error
*
403 - Forbidden
*
401 - Unauthorized
*
200 - OK
* @param hotelIdentifier Save media to the property with this hotel identifier
* @param simpleMultimediaSupplier The simpleMultimediaSupplier parameter
* @param winkVersion The winkVersion parameter
* @return ResponseEntity<HotelViewSupplier>
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
public Mono> updateMediaListWithHttpInfo(String hotelIdentifier, List simpleMultimediaSupplier, String winkVersion) throws WebClientResponseException {
ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {};
return updateMediaListRequestCreation(hotelIdentifier, simpleMultimediaSupplier, winkVersion).toEntity(localVarReturnType);
}
/**
* Update Multimedia List
* Save/Update multimedia list of a hotel identified by its identifier
* 503 - Service Unavailable
*
400 - Bad Request
*
405 - Method Not Allowed
*
415 - Unsupported Media Type
*
500 - Internal Server Error
*
403 - Forbidden
*
401 - Unauthorized
*
200 - OK
* @param hotelIdentifier Save media to the property with this hotel identifier
* @param simpleMultimediaSupplier The simpleMultimediaSupplier parameter
* @param winkVersion The winkVersion parameter
* @return ResponseSpec
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
public ResponseSpec updateMediaListWithResponseSpec(String hotelIdentifier, List simpleMultimediaSupplier, String winkVersion) throws WebClientResponseException {
return updateMediaListRequestCreation(hotelIdentifier, simpleMultimediaSupplier, winkVersion);
}
/**
* Update Multimedia
* Update multimedia properties of a hotel identified by its identifier
* 503 - Service Unavailable
*
400 - Bad Request
*
405 - Method Not Allowed
*
415 - Unsupported Media Type
*
500 - Internal Server Error
*
403 - Forbidden
*
401 - Unauthorized
*
200 - OK
* @param hotelIdentifier Update a single media associated with this hotel identifier
* @param multimediaIdentifier Update record for this media identifier
* @param simpleMultimediaSupplier The simpleMultimediaSupplier parameter
* @param winkVersion The winkVersion parameter
* @return HotelViewSupplier
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
private ResponseSpec updateMultimediaRequestCreation(String hotelIdentifier, String multimediaIdentifier, SimpleMultimediaSupplier simpleMultimediaSupplier, String winkVersion) throws WebClientResponseException {
Object postBody = simpleMultimediaSupplier;
// verify the required parameter 'hotelIdentifier' is set
if (hotelIdentifier == null) {
throw new WebClientResponseException("Missing the required parameter 'hotelIdentifier' when calling updateMultimedia", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null);
}
// verify the required parameter 'multimediaIdentifier' is set
if (multimediaIdentifier == null) {
throw new WebClientResponseException("Missing the required parameter 'multimediaIdentifier' when calling updateMultimedia", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null);
}
// verify the required parameter 'simpleMultimediaSupplier' is set
if (simpleMultimediaSupplier == null) {
throw new WebClientResponseException("Missing the required parameter 'simpleMultimediaSupplier' when calling updateMultimedia", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null);
}
// create path and map variables
final Map pathParams = new HashMap();
pathParams.put("hotelIdentifier", hotelIdentifier);
pathParams.put("multimediaIdentifier", multimediaIdentifier);
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/hotel/{hotelIdentifier}/multimedia/{multimediaIdentifier}", HttpMethod.PUT, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
}
/**
* Update Multimedia
* Update multimedia properties of a hotel identified by its identifier
* 503 - Service Unavailable
*
400 - Bad Request
*
405 - Method Not Allowed
*
415 - Unsupported Media Type
*
500 - Internal Server Error
*
403 - Forbidden
*
401 - Unauthorized
*
200 - OK
* @param hotelIdentifier Update a single media associated with this hotel identifier
* @param multimediaIdentifier Update record for this media identifier
* @param simpleMultimediaSupplier The simpleMultimediaSupplier parameter
* @param winkVersion The winkVersion parameter
* @return HotelViewSupplier
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
public Mono updateMultimedia(String hotelIdentifier, String multimediaIdentifier, SimpleMultimediaSupplier simpleMultimediaSupplier, String winkVersion) throws WebClientResponseException {
ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {};
return updateMultimediaRequestCreation(hotelIdentifier, multimediaIdentifier, simpleMultimediaSupplier, winkVersion).bodyToMono(localVarReturnType);
}
/**
* Update Multimedia
* Update multimedia properties of a hotel identified by its identifier
* 503 - Service Unavailable
*
400 - Bad Request
*
405 - Method Not Allowed
*
415 - Unsupported Media Type
*
500 - Internal Server Error
*
403 - Forbidden
*
401 - Unauthorized
*
200 - OK
* @param hotelIdentifier Update a single media associated with this hotel identifier
* @param multimediaIdentifier Update record for this media identifier
* @param simpleMultimediaSupplier The simpleMultimediaSupplier parameter
* @param winkVersion The winkVersion parameter
* @return ResponseEntity<HotelViewSupplier>
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
public Mono> updateMultimediaWithHttpInfo(String hotelIdentifier, String multimediaIdentifier, SimpleMultimediaSupplier simpleMultimediaSupplier, String winkVersion) throws WebClientResponseException {
ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {};
return updateMultimediaRequestCreation(hotelIdentifier, multimediaIdentifier, simpleMultimediaSupplier, winkVersion).toEntity(localVarReturnType);
}
/**
* Update Multimedia
* Update multimedia properties of a hotel identified by its identifier
* 503 - Service Unavailable
*
400 - Bad Request
*
405 - Method Not Allowed
*
415 - Unsupported Media Type
*
500 - Internal Server Error
*
403 - Forbidden
*
401 - Unauthorized
*
200 - OK
* @param hotelIdentifier Update a single media associated with this hotel identifier
* @param multimediaIdentifier Update record for this media identifier
* @param simpleMultimediaSupplier The simpleMultimediaSupplier parameter
* @param winkVersion The winkVersion parameter
* @return ResponseSpec
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
public ResponseSpec updateMultimediaWithResponseSpec(String hotelIdentifier, String multimediaIdentifier, SimpleMultimediaSupplier simpleMultimediaSupplier, String winkVersion) throws WebClientResponseException {
return updateMultimediaRequestCreation(hotelIdentifier, multimediaIdentifier, simpleMultimediaSupplier, winkVersion);
}
/**
* Upload Multimedia
* Upload videos and/or images and associate it with specified hotelIdentifier
*
503 - Service Unavailable
*
400 - Bad Request
*
405 - Method Not Allowed
*
415 - Unsupported Media Type
*
500 - Internal Server Error
*
403 - Forbidden
*
401 - Unauthorized
*
207 - Multi-Status
* @param hotelIdentifier Upload multipart file media for this hotel identifier
* @param files The files parameter
* @return HotelViewSupplier
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
private ResponseSpec uploadMultipartFilesRequestCreation(String hotelIdentifier, List files) throws WebClientResponseException {
Object postBody = null;
// verify the required parameter 'hotelIdentifier' is set
if (hotelIdentifier == null) {
throw new WebClientResponseException("Missing the required parameter 'hotelIdentifier' when calling uploadMultipartFiles", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null);
}
// verify the required parameter 'files' is set
if (files == null) {
throw new WebClientResponseException("Missing the required parameter 'files' when calling uploadMultipartFiles", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null);
}
// create path and map variables
final Map pathParams = new HashMap();
pathParams.put("hotelIdentifier", hotelIdentifier);
final MultiValueMap queryParams = new LinkedMultiValueMap();
final HttpHeaders headerParams = new HttpHeaders();
final MultiValueMap cookieParams = new LinkedMultiValueMap();
final MultiValueMap formParams = new LinkedMultiValueMap();
if (files != null)
formParams.addAll("files", files.stream().map(FileSystemResource::new).collect(Collectors.toList()));
final String[] localVarAccepts = {
"*/*", "application/json", "application/xml", "text/xml", "text/plain"
};
final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
final String[] localVarContentTypes = {
"multipart/form-data"
};
final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
String[] localVarAuthNames = new String[] { "oauth2ClientCredentials" };
ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {};
return apiClient.invokeAPI("/api/hotel/{hotelIdentifier}/multimedia/upload", HttpMethod.POST, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
}
/**
* Upload Multimedia
* Upload videos and/or images and associate it with specified hotelIdentifier
* 503 - Service Unavailable
*
400 - Bad Request
*
405 - Method Not Allowed
*
415 - Unsupported Media Type
*
500 - Internal Server Error
*
403 - Forbidden
*
401 - Unauthorized
*
207 - Multi-Status
* @param hotelIdentifier Upload multipart file media for this hotel identifier
* @param files The files parameter
* @return HotelViewSupplier
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
public Mono uploadMultipartFiles(String hotelIdentifier, List files) throws WebClientResponseException {
ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {};
return uploadMultipartFilesRequestCreation(hotelIdentifier, files).bodyToMono(localVarReturnType);
}
/**
* Upload Multimedia
* Upload videos and/or images and associate it with specified hotelIdentifier
* 503 - Service Unavailable
*
400 - Bad Request
*
405 - Method Not Allowed
*
415 - Unsupported Media Type
*
500 - Internal Server Error
*
403 - Forbidden
*
401 - Unauthorized
*
207 - Multi-Status
* @param hotelIdentifier Upload multipart file media for this hotel identifier
* @param files The files parameter
* @return ResponseEntity<HotelViewSupplier>
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
public Mono> uploadMultipartFilesWithHttpInfo(String hotelIdentifier, List files) throws WebClientResponseException {
ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {};
return uploadMultipartFilesRequestCreation(hotelIdentifier, files).toEntity(localVarReturnType);
}
/**
* Upload Multimedia
* Upload videos and/or images and associate it with specified hotelIdentifier
* 503 - Service Unavailable
*
400 - Bad Request
*
405 - Method Not Allowed
*
415 - Unsupported Media Type
*
500 - Internal Server Error
*
403 - Forbidden
*
401 - Unauthorized
*
207 - Multi-Status
* @param hotelIdentifier Upload multipart file media for this hotel identifier
* @param files The files parameter
* @return ResponseSpec
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
public ResponseSpec uploadMultipartFilesWithResponseSpec(String hotelIdentifier, List files) throws WebClientResponseException {
return uploadMultipartFilesRequestCreation(hotelIdentifier, files);
}
}