All Downloads are FREE. Search and download functionalities are using the official Maven repository.

travel.wink.sdk.booking.api.CheckoutApi Maven / Gradle / Ivy

package travel.wink.sdk.booking.api;

import travel.wink.sdk.booking.invoker.ApiClient;

import travel.wink.sdk.booking.model.CheckoutRequestAuthenticatedEntity;
import travel.wink.sdk.booking.model.CheckoutResponseAuthenticatedEntity;
import travel.wink.sdk.booking.model.CreateCart400Response;
import travel.wink.sdk.booking.model.GenericErrorMessage;

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-10-04T20:21:21.186005100+07:00[Asia/Bangkok]")
public class CheckoutApi {
    private ApiClient apiClient;

    public CheckoutApi() {
        this(new ApiClient());
    }

    @Autowired
    public CheckoutApi(ApiClient apiClient) {
        this.apiClient = apiClient;
    }

    public ApiClient getApiClient() {
        return apiClient;
    }

    public void setApiClient(ApiClient apiClient) {
        this.apiClient = apiClient;
    }

    /**
     * Prepare payment
     * Communicates shopping cart to TripPay.
     * 

500 - Internal Server Error *

403 - Forbidden *

401 - Unauthorized *

400 - Bad Request *

200 - OK * @param checkoutRequestAuthenticatedEntity The checkoutRequestAuthenticatedEntity parameter * @param winkVersion The winkVersion parameter * @return CheckoutResponseAuthenticatedEntity * @throws WebClientResponseException if an error occurs while attempting to invoke the API */ private ResponseSpec checkoutRequestCreation(CheckoutRequestAuthenticatedEntity checkoutRequestAuthenticatedEntity, String winkVersion) throws WebClientResponseException { Object postBody = checkoutRequestAuthenticatedEntity; // verify the required parameter 'checkoutRequestAuthenticatedEntity' is set if (checkoutRequestAuthenticatedEntity == null) { throw new WebClientResponseException("Missing the required parameter 'checkoutRequestAuthenticatedEntity' when calling checkout", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); } // create path and map variables final Map pathParams = new HashMap(); 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/checkout", HttpMethod.POST, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); } /** * Prepare payment * Communicates shopping cart to TripPay. *

500 - Internal Server Error *

403 - Forbidden *

401 - Unauthorized *

400 - Bad Request *

200 - OK * @param checkoutRequestAuthenticatedEntity The checkoutRequestAuthenticatedEntity parameter * @param winkVersion The winkVersion parameter * @return CheckoutResponseAuthenticatedEntity * @throws WebClientResponseException if an error occurs while attempting to invoke the API */ public Mono checkout(CheckoutRequestAuthenticatedEntity checkoutRequestAuthenticatedEntity, String winkVersion) throws WebClientResponseException { ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; return checkoutRequestCreation(checkoutRequestAuthenticatedEntity, winkVersion).bodyToMono(localVarReturnType); } /** * Prepare payment * Communicates shopping cart to TripPay. *

500 - Internal Server Error *

403 - Forbidden *

401 - Unauthorized *

400 - Bad Request *

200 - OK * @param checkoutRequestAuthenticatedEntity The checkoutRequestAuthenticatedEntity parameter * @param winkVersion The winkVersion parameter * @return ResponseEntity<CheckoutResponseAuthenticatedEntity> * @throws WebClientResponseException if an error occurs while attempting to invoke the API */ public Mono> checkoutWithHttpInfo(CheckoutRequestAuthenticatedEntity checkoutRequestAuthenticatedEntity, String winkVersion) throws WebClientResponseException { ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; return checkoutRequestCreation(checkoutRequestAuthenticatedEntity, winkVersion).toEntity(localVarReturnType); } /** * Prepare payment * Communicates shopping cart to TripPay. *

500 - Internal Server Error *

403 - Forbidden *

401 - Unauthorized *

400 - Bad Request *

200 - OK * @param checkoutRequestAuthenticatedEntity The checkoutRequestAuthenticatedEntity parameter * @param winkVersion The winkVersion parameter * @return ResponseSpec * @throws WebClientResponseException if an error occurs while attempting to invoke the API */ public ResponseSpec checkoutWithResponseSpec(CheckoutRequestAuthenticatedEntity checkoutRequestAuthenticatedEntity, String winkVersion) throws WebClientResponseException { return checkoutRequestCreation(checkoutRequestAuthenticatedEntity, winkVersion); } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy