travel.wink.sdk.extranet.api.AnnouncementApi 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 travel.wink.sdk.extranet.model.AnnouncementViewSupplier;
import travel.wink.sdk.extranet.model.GenericErrorMessage;
import travel.wink.sdk.extranet.model.RemoveEntryResponseSupplier;
import travel.wink.sdk.extranet.model.ShowPropertyPolicy400Response;
import travel.wink.sdk.extranet.model.UpsertAnnouncementRequestSupplier;
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 AnnouncementApi {
private ApiClient apiClient;
public AnnouncementApi() {
this(new ApiClient());
}
@Autowired
public AnnouncementApi(ApiClient apiClient) {
this.apiClient = apiClient;
}
public ApiClient getApiClient() {
return apiClient;
}
public void setApiClient(ApiClient apiClient) {
this.apiClient = apiClient;
}
/**
* Create Announcement
* Create a new announcement
* 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 Create announcement for this hotel identifier
* @param upsertAnnouncementRequestSupplier The upsertAnnouncementRequestSupplier parameter
* @param winkVersion The winkVersion parameter
* @return AnnouncementViewSupplier
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
private ResponseSpec createAnnouncementRequestCreation(String hotelIdentifier, UpsertAnnouncementRequestSupplier upsertAnnouncementRequestSupplier, String winkVersion) throws WebClientResponseException {
Object postBody = upsertAnnouncementRequestSupplier;
// verify the required parameter 'hotelIdentifier' is set
if (hotelIdentifier == null) {
throw new WebClientResponseException("Missing the required parameter 'hotelIdentifier' when calling createAnnouncement", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null);
}
// verify the required parameter 'upsertAnnouncementRequestSupplier' is set
if (upsertAnnouncementRequestSupplier == null) {
throw new WebClientResponseException("Missing the required parameter 'upsertAnnouncementRequestSupplier' when calling createAnnouncement", 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}/announcement", HttpMethod.POST, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
}
/**
* Create Announcement
* Create a new announcement
* 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 Create announcement for this hotel identifier
* @param upsertAnnouncementRequestSupplier The upsertAnnouncementRequestSupplier parameter
* @param winkVersion The winkVersion parameter
* @return AnnouncementViewSupplier
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
public Mono createAnnouncement(String hotelIdentifier, UpsertAnnouncementRequestSupplier upsertAnnouncementRequestSupplier, String winkVersion) throws WebClientResponseException {
ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {};
return createAnnouncementRequestCreation(hotelIdentifier, upsertAnnouncementRequestSupplier, winkVersion).bodyToMono(localVarReturnType);
}
/**
* Create Announcement
* Create a new announcement
* 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 Create announcement for this hotel identifier
* @param upsertAnnouncementRequestSupplier The upsertAnnouncementRequestSupplier parameter
* @param winkVersion The winkVersion parameter
* @return ResponseEntity<AnnouncementViewSupplier>
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
public Mono> createAnnouncementWithHttpInfo(String hotelIdentifier, UpsertAnnouncementRequestSupplier upsertAnnouncementRequestSupplier, String winkVersion) throws WebClientResponseException {
ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {};
return createAnnouncementRequestCreation(hotelIdentifier, upsertAnnouncementRequestSupplier, winkVersion).toEntity(localVarReturnType);
}
/**
* Create Announcement
* Create a new announcement
* 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 Create announcement for this hotel identifier
* @param upsertAnnouncementRequestSupplier The upsertAnnouncementRequestSupplier parameter
* @param winkVersion The winkVersion parameter
* @return ResponseSpec
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
public ResponseSpec createAnnouncementWithResponseSpec(String hotelIdentifier, UpsertAnnouncementRequestSupplier upsertAnnouncementRequestSupplier, String winkVersion) throws WebClientResponseException {
return createAnnouncementRequestCreation(hotelIdentifier, upsertAnnouncementRequestSupplier, winkVersion);
}
/**
* Delete Announcement
* Delete an announcement 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 announcement for this hotel identifier
* @param announcementIdentifier Remove announcement with this identifier
* @param winkVersion The winkVersion parameter
* @return RemoveEntryResponseSupplier
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
private ResponseSpec removeAnnouncementRequestCreation(String hotelIdentifier, String announcementIdentifier, 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 removeAnnouncement", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null);
}
// verify the required parameter 'announcementIdentifier' is set
if (announcementIdentifier == null) {
throw new WebClientResponseException("Missing the required parameter 'announcementIdentifier' when calling removeAnnouncement", 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("announcementIdentifier", announcementIdentifier);
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}/announcement/{announcementIdentifier}", HttpMethod.DELETE, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
}
/**
* Delete Announcement
* Delete an announcement 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 announcement for this hotel identifier
* @param announcementIdentifier Remove announcement with this identifier
* @param winkVersion The winkVersion parameter
* @return RemoveEntryResponseSupplier
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
public Mono removeAnnouncement(String hotelIdentifier, String announcementIdentifier, String winkVersion) throws WebClientResponseException {
ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {};
return removeAnnouncementRequestCreation(hotelIdentifier, announcementIdentifier, winkVersion).bodyToMono(localVarReturnType);
}
/**
* Delete Announcement
* Delete an announcement 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 announcement for this hotel identifier
* @param announcementIdentifier Remove announcement with this identifier
* @param winkVersion The winkVersion parameter
* @return ResponseEntity<RemoveEntryResponseSupplier>
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
public Mono> removeAnnouncementWithHttpInfo(String hotelIdentifier, String announcementIdentifier, String winkVersion) throws WebClientResponseException {
ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {};
return removeAnnouncementRequestCreation(hotelIdentifier, announcementIdentifier, winkVersion).toEntity(localVarReturnType);
}
/**
* Delete Announcement
* Delete an announcement 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 announcement for this hotel identifier
* @param announcementIdentifier Remove announcement with this identifier
* @param winkVersion The winkVersion parameter
* @return ResponseSpec
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
public ResponseSpec removeAnnouncementWithResponseSpec(String hotelIdentifier, String announcementIdentifier, String winkVersion) throws WebClientResponseException {
return removeAnnouncementRequestCreation(hotelIdentifier, announcementIdentifier, winkVersion);
}
/**
* Show Announcement
* Retrieve an announcement 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 Show announcement for this hotel identifier
* @param announcementIdentifier Show data for this announcement identifier
* @param winkVersion The winkVersion parameter
* @return AnnouncementViewSupplier
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
private ResponseSpec showAnnouncementRequestCreation(String hotelIdentifier, String announcementIdentifier, 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 showAnnouncement", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null);
}
// verify the required parameter 'announcementIdentifier' is set
if (announcementIdentifier == null) {
throw new WebClientResponseException("Missing the required parameter 'announcementIdentifier' when calling showAnnouncement", 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("announcementIdentifier", announcementIdentifier);
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}/announcement/{announcementIdentifier}", HttpMethod.GET, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
}
/**
* Show Announcement
* Retrieve an announcement 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 Show announcement for this hotel identifier
* @param announcementIdentifier Show data for this announcement identifier
* @param winkVersion The winkVersion parameter
* @return AnnouncementViewSupplier
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
public Mono showAnnouncement(String hotelIdentifier, String announcementIdentifier, String winkVersion) throws WebClientResponseException {
ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {};
return showAnnouncementRequestCreation(hotelIdentifier, announcementIdentifier, winkVersion).bodyToMono(localVarReturnType);
}
/**
* Show Announcement
* Retrieve an announcement 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 Show announcement for this hotel identifier
* @param announcementIdentifier Show data for this announcement identifier
* @param winkVersion The winkVersion parameter
* @return ResponseEntity<AnnouncementViewSupplier>
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
public Mono> showAnnouncementWithHttpInfo(String hotelIdentifier, String announcementIdentifier, String winkVersion) throws WebClientResponseException {
ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {};
return showAnnouncementRequestCreation(hotelIdentifier, announcementIdentifier, winkVersion).toEntity(localVarReturnType);
}
/**
* Show Announcement
* Retrieve an announcement 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 Show announcement for this hotel identifier
* @param announcementIdentifier Show data for this announcement identifier
* @param winkVersion The winkVersion parameter
* @return ResponseSpec
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
public ResponseSpec showAnnouncementWithResponseSpec(String hotelIdentifier, String announcementIdentifier, String winkVersion) throws WebClientResponseException {
return showAnnouncementRequestCreation(hotelIdentifier, announcementIdentifier, winkVersion);
}
/**
* Show Announcements
* Retrieve list of announcements
*
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 announcements for this hotel identifier
* @param winkVersion The winkVersion parameter
* @return List<AnnouncementViewSupplier>
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
private ResponseSpec showAnnouncementsRequestCreation(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 showAnnouncements", 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}/announcement/list", HttpMethod.GET, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
}
/**
* Show Announcements
* Retrieve list of announcements
* 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 announcements for this hotel identifier
* @param winkVersion The winkVersion parameter
* @return List<AnnouncementViewSupplier>
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
public Flux showAnnouncements(String hotelIdentifier, String winkVersion) throws WebClientResponseException {
ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {};
return showAnnouncementsRequestCreation(hotelIdentifier, winkVersion).bodyToFlux(localVarReturnType);
}
/**
* Show Announcements
* Retrieve list of announcements
* 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 announcements for this hotel identifier
* @param winkVersion The winkVersion parameter
* @return ResponseEntity<List<AnnouncementViewSupplier>>
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
public Mono>> showAnnouncementsWithHttpInfo(String hotelIdentifier, String winkVersion) throws WebClientResponseException {
ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {};
return showAnnouncementsRequestCreation(hotelIdentifier, winkVersion).toEntityList(localVarReturnType);
}
/**
* Show Announcements
* Retrieve list of announcements
* 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 announcements for this hotel identifier
* @param winkVersion The winkVersion parameter
* @return ResponseSpec
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
public ResponseSpec showAnnouncementsWithResponseSpec(String hotelIdentifier, String winkVersion) throws WebClientResponseException {
return showAnnouncementsRequestCreation(hotelIdentifier, winkVersion);
}
/**
* Update Announcement
* Update an announcement 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 announcement for this hotel identifier
* @param announcementIdentifier Update announcement with this identifier
* @param upsertAnnouncementRequestSupplier The upsertAnnouncementRequestSupplier parameter
* @param winkVersion The winkVersion parameter
* @return AnnouncementViewSupplier
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
private ResponseSpec updateAnnouncementRequestCreation(String hotelIdentifier, String announcementIdentifier, UpsertAnnouncementRequestSupplier upsertAnnouncementRequestSupplier, String winkVersion) throws WebClientResponseException {
Object postBody = upsertAnnouncementRequestSupplier;
// verify the required parameter 'hotelIdentifier' is set
if (hotelIdentifier == null) {
throw new WebClientResponseException("Missing the required parameter 'hotelIdentifier' when calling updateAnnouncement", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null);
}
// verify the required parameter 'announcementIdentifier' is set
if (announcementIdentifier == null) {
throw new WebClientResponseException("Missing the required parameter 'announcementIdentifier' when calling updateAnnouncement", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null);
}
// verify the required parameter 'upsertAnnouncementRequestSupplier' is set
if (upsertAnnouncementRequestSupplier == null) {
throw new WebClientResponseException("Missing the required parameter 'upsertAnnouncementRequestSupplier' when calling updateAnnouncement", 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("announcementIdentifier", announcementIdentifier);
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}/announcement/{announcementIdentifier}", HttpMethod.PUT, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
}
/**
* Update Announcement
* Update an announcement 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 announcement for this hotel identifier
* @param announcementIdentifier Update announcement with this identifier
* @param upsertAnnouncementRequestSupplier The upsertAnnouncementRequestSupplier parameter
* @param winkVersion The winkVersion parameter
* @return AnnouncementViewSupplier
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
public Mono updateAnnouncement(String hotelIdentifier, String announcementIdentifier, UpsertAnnouncementRequestSupplier upsertAnnouncementRequestSupplier, String winkVersion) throws WebClientResponseException {
ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {};
return updateAnnouncementRequestCreation(hotelIdentifier, announcementIdentifier, upsertAnnouncementRequestSupplier, winkVersion).bodyToMono(localVarReturnType);
}
/**
* Update Announcement
* Update an announcement 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 announcement for this hotel identifier
* @param announcementIdentifier Update announcement with this identifier
* @param upsertAnnouncementRequestSupplier The upsertAnnouncementRequestSupplier parameter
* @param winkVersion The winkVersion parameter
* @return ResponseEntity<AnnouncementViewSupplier>
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
public Mono> updateAnnouncementWithHttpInfo(String hotelIdentifier, String announcementIdentifier, UpsertAnnouncementRequestSupplier upsertAnnouncementRequestSupplier, String winkVersion) throws WebClientResponseException {
ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {};
return updateAnnouncementRequestCreation(hotelIdentifier, announcementIdentifier, upsertAnnouncementRequestSupplier, winkVersion).toEntity(localVarReturnType);
}
/**
* Update Announcement
* Update an announcement 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 announcement for this hotel identifier
* @param announcementIdentifier Update announcement with this identifier
* @param upsertAnnouncementRequestSupplier The upsertAnnouncementRequestSupplier parameter
* @param winkVersion The winkVersion parameter
* @return ResponseSpec
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
public ResponseSpec updateAnnouncementWithResponseSpec(String hotelIdentifier, String announcementIdentifier, UpsertAnnouncementRequestSupplier upsertAnnouncementRequestSupplier, String winkVersion) throws WebClientResponseException {
return updateAnnouncementRequestCreation(hotelIdentifier, announcementIdentifier, upsertAnnouncementRequestSupplier, winkVersion);
}
}