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