2 * ============LICENSE_START=======================================================
3 * Copyright (C) 2019 Samsung. All rights reserved.
4 * ================================================================================
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
9 * http://www.apache.org/licenses/LICENSE-2.0
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 * ============LICENSE_END=========================================================
19 package org.onap.so.svnfm.simulator.api;
21 import com.squareup.okhttp.Call;
22 import com.squareup.okhttp.Response;
23 import org.onap.so.adapters.vnfmadapter.extclients.vnfm.lcn.*;
24 import org.onap.so.adapters.vnfmadapter.extclients.vnfm.lcn.api.DefaultApi;
25 import org.onap.so.adapters.vnfmadapter.extclients.vnfm.lcn.model.VnfLcmOperationOccurrenceNotification;
27 import java.util.ArrayList;
28 import java.util.HashMap;
29 import java.util.List;
32 public class VeVnfmApi extends DefaultApi {
34 public VeVnfmApi(final ApiClient apiClient) {
38 public Call lcnVnfLcmOperationOccurrenceNotificationPostCall(
39 final VnfLcmOperationOccurrenceNotification vnfLcmOperationOccurrenceNotification,
40 final String contentType, final String authorization,
41 final ProgressResponseBody.ProgressListener progressListener,
42 final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
43 return lcnVnfObjectNotificationPostCall(vnfLcmOperationOccurrenceNotification,
44 contentType, authorization, progressListener, progressRequestListener);
47 private Call lcnVnfObjectNotificationPostCall(
48 final Object body, final String contentType, final String authorization,
49 final ProgressResponseBody.ProgressListener progressListener,
50 final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
51 final List<Pair> localVarQueryParams = new ArrayList<>();
52 final List<Pair> localVarCollectionQueryParams = new ArrayList<>();
53 final Map<String, String> localVarHeaderParams = new HashMap<>();
55 if (authorization != null) {
56 localVarHeaderParams.put("Authorization", getApiClient().parameterToString(authorization));
59 if (contentType != null) {
60 localVarHeaderParams.put("Content-Type", getApiClient().parameterToString(contentType));
63 final String[] localVarAccepts = new String[]{"application/json"};
64 final String localVarAccept = getApiClient().selectHeaderAccept(localVarAccepts);
66 if (localVarAccept != null) {
67 localVarHeaderParams.put("Accept", localVarAccept);
70 final String[] localVarContentTypes = new String[]{"application/json"};
71 final String localVarContentType = getApiClient().selectHeaderContentType(localVarContentTypes);
72 localVarHeaderParams.put("Content-Type", localVarContentType);
74 if (progressListener != null) {
75 getApiClient().getHttpClient().networkInterceptors().add(ch -> {
76 final Response originalResponse = ch.proceed(ch.request());
77 return originalResponse.newBuilder().body(new ProgressResponseBody(originalResponse.body(), progressListener)).build();
81 final Map<String, Object> localVarFormParams = new HashMap<>();
82 final String[] localVarAuthNames = new String[0];
84 return getApiClient().buildCall("", "POST", localVarQueryParams, localVarCollectionQueryParams, body, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);