11/*
2- * SodaStore API
3- * API for managing soda products and orders in SodaStore.
4- *
5- *
6- *
7- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
8- * https://openapi-generator.tech
9- * Do not edit the class manually.
10- */
2+ * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved.
3+ */
114
125package com .sap .cloud .sdk .datamodel .openapi .apache .sample .api ;
136
147import java .util .ArrayList ;
15- import java .util .Collections ;
168import java .util .HashMap ;
179import java .util .List ;
1810import java .util .Map ;
1911import java .util .StringJoiner ;
2012
13+ import javax .annotation .Nonnull ;
14+
2115import com .fasterxml .jackson .core .type .TypeReference ;
16+ import com .sap .cloud .sdk .cloudplatform .connectivity .Destination ;
2217import com .sap .cloud .sdk .datamodel .openapi .apache .sample .model .Order ;
2318import com .sap .cloud .sdk .services .openapi .apache .ApiClient ;
24- import com .sap .cloud .sdk .services .openapi .apache .ApiException ;
2519import com .sap .cloud .sdk .services .openapi .apache .BaseApi ;
26- import com .sap .cloud .sdk .services .openapi .apache .Configuration ;
2720import com .sap .cloud .sdk .services .openapi .apache .Pair ;
21+ import com .sap .cloud .sdk .services .openapi .core .OpenApiRequestException ;
2822
23+ /**
24+ * SodaStore API in version 1.0.0.
25+ *
26+ * API for managing soda products and orders in SodaStore.
27+ */
2928public class OrdersApi extends BaseApi
3029{
3130
31+ /**
32+ * Instantiates this API class to invoke operations on the SodaStore API
33+ */
3234 public OrdersApi ()
3335 {
34- super (Configuration .getDefaultApiClient ());
3536 }
3637
37- public OrdersApi ( ApiClient apiClient )
38+ /**
39+ * Instantiates this API class to invoke operations on the SodaStore API.
40+ *
41+ * @param httpDestination
42+ * The destination that API should be used with
43+ */
44+ public OrdersApi ( @ Nonnull final Destination httpDestination )
3845 {
39- super (apiClient );
46+ super (httpDestination );
4047 }
4148
4249 /**
43- * Create a new order
50+ * Instantiates this API class to invoke operations on the SodaStore API based on a given {@link ApiClient}.
4451 *
45- * @param order
46- * The order details (required)
47- * @return Order
48- * @throws ApiException
49- * if fails to make API call
52+ * @param apiClient
53+ * ApiClient to invoke the API on
5054 */
51- public Order ordersPost ( @ javax .annotation .Nonnull Order order )
52- throws ApiException
55+ public OrdersApi ( @ Nonnull final ApiClient apiClient )
5356 {
54- return this . ordersPost ( order , Collections . emptyMap () );
57+ super ( apiClient );
5558 }
5659
5760 /**
61+ * <p>
5862 * Create a new order
63+ * <p>
64+ * <p>
65+ * <b>201</b> - The created order
5966 *
6067 * @param order
61- * The order details (required)
62- * @param additionalHeaders
63- * additionalHeaders for this call
68+ * The order details
6469 * @return Order
65- * @throws ApiException
66- * if fails to make API call
70+ * @throws OpenApiRequestException
71+ * if an error occurs while attempting to invoke the API
6772 */
68- public Order ordersPost ( @ javax .annotation .Nonnull Order order , Map <String , String > additionalHeaders )
69- throws ApiException
73+ @ Nonnull
74+ public Order ordersPost ( @ Nonnull final Order order )
75+ throws OpenApiRequestException
7076 {
71- Object localVarPostBody = order ;
77+ final Object localVarPostBody = order ;
7278
7379 // verify the required parameter 'order' is set
7480 if ( order == null ) {
75- throw new ApiException (400 , "Missing the required parameter 'order' when calling ordersPost" );
81+ throw new OpenApiRequestException ("Missing the required parameter 'order' when calling ordersPost" )
82+ .statusCode (400 );
7683 }
7784
7885 // create path and map variables
79- String localVarPath = "/orders" ;
86+ final String localVarPath = "/orders" ;
8087
81- StringJoiner localVarQueryStringJoiner = new StringJoiner ("&" );
88+ final StringJoiner localVarQueryStringJoiner = new StringJoiner ("&" );
8289 String localVarQueryParameterBaseName ;
83- List <Pair > localVarQueryParams = new ArrayList <Pair >();
84- List <Pair > localVarCollectionQueryParams = new ArrayList <Pair >();
85- Map <String , String > localVarHeaderParams = new HashMap <String , String >();
86- Map <String , String > localVarCookieParams = new HashMap <String , String >();
87- Map <String , Object > localVarFormParams = new HashMap <String , Object >();
88-
89- localVarHeaderParams .putAll (additionalHeaders );
90+ final List <Pair > localVarQueryParams = new ArrayList <Pair >();
91+ final List <Pair > localVarCollectionQueryParams = new ArrayList <Pair >();
92+ final Map <String , String > localVarHeaderParams = new HashMap <String , String >();
93+ final Map <String , Object > localVarFormParams = new HashMap <String , Object >();
9094
9195 final String [] localVarAccepts = { "application/json" };
92- final String localVarAccept = apiClient .selectHeaderAccept (localVarAccepts );
96+ final String localVarAccept = ApiClient .selectHeaderAccept (localVarAccepts );
9397
9498 final String [] localVarContentTypes = { "application/json" };
95- final String localVarContentType = apiClient .selectHeaderContentType (localVarContentTypes );
96-
97- String [] localVarAuthNames = new String [] { "apiKeyAuth" };
99+ final String localVarContentType = ApiClient .selectHeaderContentType (localVarContentTypes );
98100
99- TypeReference <Order > localVarReturnType = new TypeReference <Order >()
101+ final TypeReference <Order > localVarReturnType = new TypeReference <Order >()
100102 {
101103 };
102104 return apiClient
@@ -108,55 +110,9 @@ public Order ordersPost( @javax.annotation.Nonnull Order order, Map<String, Stri
108110 localVarQueryStringJoiner .toString (),
109111 localVarPostBody ,
110112 localVarHeaderParams ,
111- localVarCookieParams ,
112113 localVarFormParams ,
113114 localVarAccept ,
114115 localVarContentType ,
115- localVarAuthNames ,
116116 localVarReturnType );
117117 }
118-
119- @ Override
120- public <T > T invokeAPI (
121- String url ,
122- String method ,
123- Object request ,
124- TypeReference <T > returnType ,
125- Map <String , String > additionalHeaders )
126- throws ApiException
127- {
128- String localVarPath = url .replace (apiClient .getBaseURL (), "" );
129- StringJoiner localVarQueryStringJoiner = new StringJoiner ("&" );
130- List <Pair > localVarQueryParams = new ArrayList <Pair >();
131- List <Pair > localVarCollectionQueryParams = new ArrayList <Pair >();
132- Map <String , String > localVarHeaderParams = new HashMap <String , String >();
133- Map <String , String > localVarCookieParams = new HashMap <String , String >();
134- Map <String , Object > localVarFormParams = new HashMap <String , Object >();
135-
136- localVarHeaderParams .putAll (additionalHeaders );
137-
138- final String [] localVarAccepts = { "application/json" };
139- final String localVarAccept = apiClient .selectHeaderAccept (localVarAccepts );
140-
141- final String [] localVarContentTypes = { "application/json" };
142- final String localVarContentType = apiClient .selectHeaderContentType (localVarContentTypes );
143-
144- String [] localVarAuthNames = new String [] { "apiKeyAuth" };
145-
146- return apiClient
147- .invokeAPI (
148- localVarPath ,
149- method ,
150- localVarQueryParams ,
151- localVarCollectionQueryParams ,
152- localVarQueryStringJoiner .toString (),
153- request ,
154- localVarHeaderParams ,
155- localVarCookieParams ,
156- localVarFormParams ,
157- localVarAccept ,
158- localVarContentType ,
159- localVarAuthNames ,
160- returnType );
161- }
162118}
0 commit comments