@@ -73,6 +73,141 @@ public void setCustomBaseUrl(String customBaseUrl) {
73
73
this .localCustomBaseUrl = customBaseUrl ;
74
74
}
75
75
76
+ /**
77
+ * Build call for createOrder
78
+ * @param order Order object with data to create. (required)
79
+ * @param _callback Callback for upload/download progress
80
+ * @return Call to execute
81
+ * @throws ApiException If fail to serialize the request body object
82
+ * @http.response.details
83
+ <table border="1">
84
+ <caption>Response Details</caption>
85
+ <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
86
+ <tr><td> 200 </td><td> Returns specified order. </td><td> - </td></tr>
87
+ <tr><td> 401 </td><td> Unauthorized </td><td> - </td></tr>
88
+ <tr><td> 404 </td><td> Not Found </td><td> - </td></tr>
89
+ </table>
90
+ */
91
+ public okhttp3 .Call createOrderCall (Order order , final ApiCallback _callback ) throws ApiException {
92
+ String basePath = null ;
93
+ // Operation Servers
94
+ String [] localBasePaths = new String [] { };
95
+
96
+ // Determine Base Path to Use
97
+ if (localCustomBaseUrl != null ){
98
+ basePath = localCustomBaseUrl ;
99
+ } else if ( localBasePaths .length > 0 ) {
100
+ basePath = localBasePaths [localHostIndex ];
101
+ } else {
102
+ basePath = null ;
103
+ }
104
+
105
+ Object localVarPostBody = order ;
106
+
107
+ // create path and map variables
108
+ String localVarPath = "/orders" ;
109
+
110
+ List <Pair > localVarQueryParams = new ArrayList <Pair >();
111
+ List <Pair > localVarCollectionQueryParams = new ArrayList <Pair >();
112
+ Map <String , String > localVarHeaderParams = new HashMap <String , String >();
113
+ Map <String , String > localVarCookieParams = new HashMap <String , String >();
114
+ Map <String , Object > localVarFormParams = new HashMap <String , Object >();
115
+
116
+ final String [] localVarAccepts = {
117
+ "application/json"
118
+ };
119
+ final String localVarAccept = localVarApiClient .selectHeaderAccept (localVarAccepts );
120
+ if (localVarAccept != null ) {
121
+ localVarHeaderParams .put ("Accept" , localVarAccept );
122
+ }
123
+
124
+ final String [] localVarContentTypes = {
125
+ "application/json"
126
+ };
127
+ final String localVarContentType = localVarApiClient .selectHeaderContentType (localVarContentTypes );
128
+ if (localVarContentType != null ) {
129
+ localVarHeaderParams .put ("Content-Type" , localVarContentType );
130
+ }
131
+
132
+ String [] localVarAuthNames = new String [] { "basicAuth" };
133
+ return localVarApiClient .buildCall (basePath , localVarPath , "POST" , localVarQueryParams , localVarCollectionQueryParams , localVarPostBody , localVarHeaderParams , localVarCookieParams , localVarFormParams , localVarAuthNames , _callback );
134
+ }
135
+
136
+ @ SuppressWarnings ("rawtypes" )
137
+ private okhttp3 .Call createOrderValidateBeforeCall (Order order , final ApiCallback _callback ) throws ApiException {
138
+ // verify the required parameter 'order' is set
139
+ if (order == null ) {
140
+ throw new ApiException ("Missing the required parameter 'order' when calling createOrder(Async)" );
141
+ }
142
+
143
+ return createOrderCall (order , _callback );
144
+
145
+ }
146
+
147
+ /**
148
+ * This API helps you to create a new order.
149
+ *
150
+ * @param order Order object with data to create. (required)
151
+ * @return Order
152
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
153
+ * @http.response.details
154
+ <table border="1">
155
+ <caption>Response Details</caption>
156
+ <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
157
+ <tr><td> 200 </td><td> Returns specified order. </td><td> - </td></tr>
158
+ <tr><td> 401 </td><td> Unauthorized </td><td> - </td></tr>
159
+ <tr><td> 404 </td><td> Not Found </td><td> - </td></tr>
160
+ </table>
161
+ */
162
+ public Order createOrder (Order order ) throws ApiException {
163
+ ApiResponse <Order > localVarResp = createOrderWithHttpInfo (order );
164
+ return localVarResp .getData ();
165
+ }
166
+
167
+ /**
168
+ * This API helps you to create a new order.
169
+ *
170
+ * @param order Order object with data to create. (required)
171
+ * @return ApiResponse<Order>
172
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
173
+ * @http.response.details
174
+ <table border="1">
175
+ <caption>Response Details</caption>
176
+ <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
177
+ <tr><td> 200 </td><td> Returns specified order. </td><td> - </td></tr>
178
+ <tr><td> 401 </td><td> Unauthorized </td><td> - </td></tr>
179
+ <tr><td> 404 </td><td> Not Found </td><td> - </td></tr>
180
+ </table>
181
+ */
182
+ public ApiResponse <Order > createOrderWithHttpInfo (Order order ) throws ApiException {
183
+ okhttp3 .Call localVarCall = createOrderValidateBeforeCall (order , null );
184
+ Type localVarReturnType = new TypeToken <Order >(){}.getType ();
185
+ return localVarApiClient .execute (localVarCall , localVarReturnType );
186
+ }
187
+
188
+ /**
189
+ * This API helps you to create a new order. (asynchronously)
190
+ *
191
+ * @param order Order object with data to create. (required)
192
+ * @param _callback The callback to be executed when the API call finishes
193
+ * @return The request call
194
+ * @throws ApiException If fail to process the API call, e.g. serializing the request body object
195
+ * @http.response.details
196
+ <table border="1">
197
+ <caption>Response Details</caption>
198
+ <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
199
+ <tr><td> 200 </td><td> Returns specified order. </td><td> - </td></tr>
200
+ <tr><td> 401 </td><td> Unauthorized </td><td> - </td></tr>
201
+ <tr><td> 404 </td><td> Not Found </td><td> - </td></tr>
202
+ </table>
203
+ */
204
+ public okhttp3 .Call createOrderAsync (Order order , final ApiCallback <Order > _callback ) throws ApiException {
205
+
206
+ okhttp3 .Call localVarCall = createOrderValidateBeforeCall (order , _callback );
207
+ Type localVarReturnType = new TypeToken <Order >(){}.getType ();
208
+ localVarApiClient .executeAsync (localVarCall , localVarReturnType , _callback );
209
+ return localVarCall ;
210
+ }
76
211
/**
77
212
* Build call for listAllOrders
78
213
* @param page Current page of the collection. Default is 1. (optional)
0 commit comments