How to use call method of Requirement Package

Best Spectus_ruby code snippet using Requirement.call

RequirementApi.java

Source:RequirementApi.java Github

copy

Full Screen

...42 }43 public void setApiClient(ApiClient apiClient) {44 this.apiClient = apiClient;45 }46 /* Build call for addRequirementComment */47 private com.squareup.okhttp.Call addRequirementCommentCall(Long projectId, String idOrKey, CommentResource body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {48 Object localVarPostBody = body;49 50 // create path and map variables51 String localVarPath = "/api/v3/projects/{projectId}/requirements/{idOrKey}/comments".replaceAll("\\{format\\}","json")52 .replaceAll("\\{" + "projectId" + "\\}", apiClient.escapeString(projectId.toString()))53 .replaceAll("\\{" + "idOrKey" + "\\}", apiClient.escapeString(idOrKey.toString()));54 List<Pair> localVarQueryParams = new ArrayList<Pair>();55 Map<String, String> localVarHeaderParams = new HashMap<String, String>();56 Map<String, Object> localVarFormParams = new HashMap<String, Object>();57 final String[] localVarAccepts = {58 59 };60 final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);61 if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);62 final String[] localVarContentTypes = {63 64 };65 if (!localVarHeaderParams.containsKey("Content-Type")) {66 final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);67 localVarHeaderParams.put("Content-Type", localVarContentType);68 }69 70 if(progressListener != null) {71 apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {72 @Override73 public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {74 com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());75 return originalResponse.newBuilder()76 .body(new ProgressResponseBody(originalResponse.body(), progressListener))77 .build();78 }79 });80 }81 String[] localVarAuthNames = new String[] { "Authorization" };82 return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);83 }84 85 @SuppressWarnings("rawtypes")86 private com.squareup.okhttp.Call addRequirementCommentValidateBeforeCall(Long projectId, String idOrKey, CommentResource body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {87 88 // verify the required parameter 'projectId' is set89 if (projectId == null) {90 throw new ApiException("Missing the required parameter 'projectId' when calling addRequirementComment(Async)");91 }92 93 // verify the required parameter 'idOrKey' is set94 if (idOrKey == null) {95 throw new ApiException("Missing the required parameter 'idOrKey' when calling addRequirementComment(Async)");96 }97 98 // verify the required parameter 'body' is set99 if (body == null) {100 throw new ApiException("Missing the required parameter 'body' when calling addRequirementComment(Async)");101 }102 103 104 com.squareup.okhttp.Call call = addRequirementCommentCall(projectId, idOrKey, body, progressListener, progressRequestListener);105 return call;106 107 108 109 110 }111 /**112 * Adds a Comment to a Requirement113 * To add a comment to a Requirement &lt;strong&gt;qTest Manager version:&lt;/strong&gt; 7.5+114 * @param projectId ID of the project (required)115 * @param idOrKey PID or ID of the Requirement. (required)116 * @param body The comment&#39;s properties and its content (required)117 * @return CommentResource118 * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body119 */120 public CommentResource addRequirementComment(Long projectId, String idOrKey, CommentResource body) throws ApiException {121 ApiResponse<CommentResource> resp = addRequirementCommentWithHttpInfo(projectId, idOrKey, body);122 return resp.getData();123 }124 /**125 * Adds a Comment to a Requirement126 * To add a comment to a Requirement &lt;strong&gt;qTest Manager version:&lt;/strong&gt; 7.5+127 * @param projectId ID of the project (required)128 * @param idOrKey PID or ID of the Requirement. (required)129 * @param body The comment&#39;s properties and its content (required)130 * @return ApiResponse&lt;CommentResource&gt;131 * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body132 */133 public ApiResponse<CommentResource> addRequirementCommentWithHttpInfo(Long projectId, String idOrKey, CommentResource body) throws ApiException {134 com.squareup.okhttp.Call call = addRequirementCommentValidateBeforeCall(projectId, idOrKey, body, null, null);135 Type localVarReturnType = new TypeToken<CommentResource>(){}.getType();136 return apiClient.execute(call, localVarReturnType);137 }138 /**139 * Adds a Comment to a Requirement (asynchronously)140 * To add a comment to a Requirement &lt;strong&gt;qTest Manager version:&lt;/strong&gt; 7.5+141 * @param projectId ID of the project (required)142 * @param idOrKey PID or ID of the Requirement. (required)143 * @param body The comment&#39;s properties and its content (required)144 * @param callback The callback to be executed when the API call finishes145 * @return The request call146 * @throws ApiException If fail to process the API call, e.g. serializing the request body object147 */148 public com.squareup.okhttp.Call addRequirementCommentAsync(Long projectId, String idOrKey, CommentResource body, final ApiCallback<CommentResource> callback) throws ApiException {149 ProgressResponseBody.ProgressListener progressListener = null;150 ProgressRequestBody.ProgressRequestListener progressRequestListener = null;151 if (callback != null) {152 progressListener = new ProgressResponseBody.ProgressListener() {153 @Override154 public void update(long bytesRead, long contentLength, boolean done) {155 callback.onDownloadProgress(bytesRead, contentLength, done);156 }157 };158 progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {159 @Override160 public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {161 callback.onUploadProgress(bytesWritten, contentLength, done);162 }163 };164 }165 com.squareup.okhttp.Call call = addRequirementCommentValidateBeforeCall(projectId, idOrKey, body, progressListener, progressRequestListener);166 Type localVarReturnType = new TypeToken<CommentResource>(){}.getType();167 apiClient.executeAsync(call, localVarReturnType, callback);168 return call;169 }170 /* Build call for createRequirement */171 private com.squareup.okhttp.Call createRequirementCall(Long projectId, RequirementResource body, Long parentId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {172 Object localVarPostBody = body;173 174 // create path and map variables175 String localVarPath = "/api/v3/projects/{projectId}/requirements".replaceAll("\\{format\\}","json")176 .replaceAll("\\{" + "projectId" + "\\}", apiClient.escapeString(projectId.toString()));177 List<Pair> localVarQueryParams = new ArrayList<Pair>();178 if (parentId != null)179 localVarQueryParams.addAll(apiClient.parameterToPairs("", "parentId", parentId));180 Map<String, String> localVarHeaderParams = new HashMap<String, String>();181 Map<String, Object> localVarFormParams = new HashMap<String, Object>();182 final String[] localVarAccepts = {183 184 };185 final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);186 if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);187 final String[] localVarContentTypes = {188 189 };190 if (!localVarHeaderParams.containsKey("Content-Type")) {191 final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);192 localVarHeaderParams.put("Content-Type", localVarContentType);193 }194 195 if(progressListener != null) {196 apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {197 @Override198 public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {199 com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());200 return originalResponse.newBuilder()201 .body(new ProgressResponseBody(originalResponse.body(), progressListener))202 .build();203 }204 });205 }206 String[] localVarAuthNames = new String[] { "Authorization" };207 return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);208 }209 210 @SuppressWarnings("rawtypes")211 private com.squareup.okhttp.Call createRequirementValidateBeforeCall(Long projectId, RequirementResource body, Long parentId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {212 213 // verify the required parameter 'projectId' is set214 if (projectId == null) {215 throw new ApiException("Missing the required parameter 'projectId' when calling createRequirement(Async)");216 }217 218 // verify the required parameter 'body' is set219 if (body == null) {220 throw new ApiException("Missing the required parameter 'body' when calling createRequirement(Async)");221 }222 223 224 com.squareup.okhttp.Call call = createRequirementCall(projectId, body, parentId, progressListener, progressRequestListener);225 return call;226 227 228 229 230 }231 /**232 * Creates a Requirement233 * To create a new Requirement &lt;strong&gt;qTest Manager version:&lt;/strong&gt; 4+234 * @param projectId ID of the project (required)235 * @param body &lt;p&gt;&lt;em&gt;name *:&lt;/em&gt; Requirement name&lt;/p&gt;&lt;p&gt;&lt;em&gt;properties:&lt;/em&gt; An array of field-value pairs&lt;/p&gt; (required)236 * @param parentId ID of the parent Module under which the Requirement will be located (optional)237 * @return RequirementResource238 * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body239 */240 public RequirementResource createRequirement(Long projectId, RequirementResource body, Long parentId) throws ApiException {241 ApiResponse<RequirementResource> resp = createRequirementWithHttpInfo(projectId, body, parentId);242 return resp.getData();243 }244 /**245 * Creates a Requirement246 * To create a new Requirement &lt;strong&gt;qTest Manager version:&lt;/strong&gt; 4+247 * @param projectId ID of the project (required)248 * @param body &lt;p&gt;&lt;em&gt;name *:&lt;/em&gt; Requirement name&lt;/p&gt;&lt;p&gt;&lt;em&gt;properties:&lt;/em&gt; An array of field-value pairs&lt;/p&gt; (required)249 * @param parentId ID of the parent Module under which the Requirement will be located (optional)250 * @return ApiResponse&lt;RequirementResource&gt;251 * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body252 */253 public ApiResponse<RequirementResource> createRequirementWithHttpInfo(Long projectId, RequirementResource body, Long parentId) throws ApiException {254 com.squareup.okhttp.Call call = createRequirementValidateBeforeCall(projectId, body, parentId, null, null);255 Type localVarReturnType = new TypeToken<RequirementResource>(){}.getType();256 return apiClient.execute(call, localVarReturnType);257 }258 /**259 * Creates a Requirement (asynchronously)260 * To create a new Requirement &lt;strong&gt;qTest Manager version:&lt;/strong&gt; 4+261 * @param projectId ID of the project (required)262 * @param body &lt;p&gt;&lt;em&gt;name *:&lt;/em&gt; Requirement name&lt;/p&gt;&lt;p&gt;&lt;em&gt;properties:&lt;/em&gt; An array of field-value pairs&lt;/p&gt; (required)263 * @param parentId ID of the parent Module under which the Requirement will be located (optional)264 * @param callback The callback to be executed when the API call finishes265 * @return The request call266 * @throws ApiException If fail to process the API call, e.g. serializing the request body object267 */268 public com.squareup.okhttp.Call createRequirementAsync(Long projectId, RequirementResource body, Long parentId, final ApiCallback<RequirementResource> callback) throws ApiException {269 ProgressResponseBody.ProgressListener progressListener = null;270 ProgressRequestBody.ProgressRequestListener progressRequestListener = null;271 if (callback != null) {272 progressListener = new ProgressResponseBody.ProgressListener() {273 @Override274 public void update(long bytesRead, long contentLength, boolean done) {275 callback.onDownloadProgress(bytesRead, contentLength, done);276 }277 };278 progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {279 @Override280 public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {281 callback.onUploadProgress(bytesWritten, contentLength, done);282 }283 };284 }285 com.squareup.okhttp.Call call = createRequirementValidateBeforeCall(projectId, body, parentId, progressListener, progressRequestListener);286 Type localVarReturnType = new TypeToken<RequirementResource>(){}.getType();287 apiClient.executeAsync(call, localVarReturnType, callback);288 return call;289 }290 /* Build call for deleteRequirementById */291 private com.squareup.okhttp.Call deleteRequirementByIdCall(Long projectId, Long requirementId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {292 Object localVarPostBody = null;293 294 // create path and map variables295 String localVarPath = "/api/v3/projects/{projectId}/requirements/{requirementId}".replaceAll("\\{format\\}","json")296 .replaceAll("\\{" + "projectId" + "\\}", apiClient.escapeString(projectId.toString()))297 .replaceAll("\\{" + "requirementId" + "\\}", apiClient.escapeString(requirementId.toString()));298 List<Pair> localVarQueryParams = new ArrayList<Pair>();299 Map<String, String> localVarHeaderParams = new HashMap<String, String>();300 Map<String, Object> localVarFormParams = new HashMap<String, Object>();301 final String[] localVarAccepts = {302 303 };304 final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);305 if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);306 final String[] localVarContentTypes = {307 308 };309 if (!localVarHeaderParams.containsKey("Content-Type")) {310 final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);311 localVarHeaderParams.put("Content-Type", localVarContentType);312 }313 314 if(progressListener != null) {315 apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {316 @Override317 public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {318 com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());319 return originalResponse.newBuilder()320 .body(new ProgressResponseBody(originalResponse.body(), progressListener))321 .build();322 }323 });324 }325 String[] localVarAuthNames = new String[] { "Authorization" };326 return apiClient.buildCall(localVarPath, "DELETE", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);327 }328 329 @SuppressWarnings("rawtypes")330 private com.squareup.okhttp.Call deleteRequirementByIdValidateBeforeCall(Long projectId, Long requirementId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {331 332 // verify the required parameter 'projectId' is set333 if (projectId == null) {334 throw new ApiException("Missing the required parameter 'projectId' when calling deleteRequirementById(Async)");335 }336 337 // verify the required parameter 'requirementId' is set338 if (requirementId == null) {339 throw new ApiException("Missing the required parameter 'requirementId' when calling deleteRequirementById(Async)");340 }341 342 343 com.squareup.okhttp.Call call = deleteRequirementByIdCall(projectId, requirementId, progressListener, progressRequestListener);344 return call;345 346 347 348 349 }350 /**351 * Deletes a Requirement352 * To delete a Requirement &lt;strong&gt;qTest Manager version:&lt;/strong&gt; 6+353 * @param projectId ID of the project (required)354 * @param requirementId ID of the Requirement which needs to be deleted. (required)355 * @return Object356 * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body357 */358 public Object deleteRequirementById(Long projectId, Long requirementId) throws ApiException {359 ApiResponse<Object> resp = deleteRequirementByIdWithHttpInfo(projectId, requirementId);360 return resp.getData();361 }362 /**363 * Deletes a Requirement364 * To delete a Requirement &lt;strong&gt;qTest Manager version:&lt;/strong&gt; 6+365 * @param projectId ID of the project (required)366 * @param requirementId ID of the Requirement which needs to be deleted. (required)367 * @return ApiResponse&lt;Object&gt;368 * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body369 */370 public ApiResponse<Object> deleteRequirementByIdWithHttpInfo(Long projectId, Long requirementId) throws ApiException {371 com.squareup.okhttp.Call call = deleteRequirementByIdValidateBeforeCall(projectId, requirementId, null, null);372 Type localVarReturnType = new TypeToken<Object>(){}.getType();373 return apiClient.execute(call, localVarReturnType);374 }375 /**376 * Deletes a Requirement (asynchronously)377 * To delete a Requirement &lt;strong&gt;qTest Manager version:&lt;/strong&gt; 6+378 * @param projectId ID of the project (required)379 * @param requirementId ID of the Requirement which needs to be deleted. (required)380 * @param callback The callback to be executed when the API call finishes381 * @return The request call382 * @throws ApiException If fail to process the API call, e.g. serializing the request body object383 */384 public com.squareup.okhttp.Call deleteRequirementByIdAsync(Long projectId, Long requirementId, final ApiCallback<Object> callback) throws ApiException {385 ProgressResponseBody.ProgressListener progressListener = null;386 ProgressRequestBody.ProgressRequestListener progressRequestListener = null;387 if (callback != null) {388 progressListener = new ProgressResponseBody.ProgressListener() {389 @Override390 public void update(long bytesRead, long contentLength, boolean done) {391 callback.onDownloadProgress(bytesRead, contentLength, done);392 }393 };394 progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {395 @Override396 public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {397 callback.onUploadProgress(bytesWritten, contentLength, done);398 }399 };400 }401 com.squareup.okhttp.Call call = deleteRequirementByIdValidateBeforeCall(projectId, requirementId, progressListener, progressRequestListener);402 Type localVarReturnType = new TypeToken<Object>(){}.getType();403 apiClient.executeAsync(call, localVarReturnType, callback);404 return call;405 }406 /* Build call for deleteRequirementCommentById */407 private com.squareup.okhttp.Call deleteRequirementCommentByIdCall(Long projectId, String idOrKey, Long commentId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {408 Object localVarPostBody = null;409 410 // create path and map variables411 String localVarPath = "/api/v3/projects/{projectId}/requirements/{idOrKey}/comments/{commentId}".replaceAll("\\{format\\}","json")412 .replaceAll("\\{" + "projectId" + "\\}", apiClient.escapeString(projectId.toString()))413 .replaceAll("\\{" + "idOrKey" + "\\}", apiClient.escapeString(idOrKey.toString()))414 .replaceAll("\\{" + "commentId" + "\\}", apiClient.escapeString(commentId.toString()));415 List<Pair> localVarQueryParams = new ArrayList<Pair>();416 Map<String, String> localVarHeaderParams = new HashMap<String, String>();417 Map<String, Object> localVarFormParams = new HashMap<String, Object>();418 final String[] localVarAccepts = {419 420 };421 final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);422 if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);423 final String[] localVarContentTypes = {424 425 };426 if (!localVarHeaderParams.containsKey("Content-Type")) {427 final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);428 localVarHeaderParams.put("Content-Type", localVarContentType);429 }430 431 if(progressListener != null) {432 apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {433 @Override434 public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {435 com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());436 return originalResponse.newBuilder()437 .body(new ProgressResponseBody(originalResponse.body(), progressListener))438 .build();439 }440 });441 }442 String[] localVarAuthNames = new String[] { "Authorization" };443 return apiClient.buildCall(localVarPath, "DELETE", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);444 }445 446 @SuppressWarnings("rawtypes")447 private com.squareup.okhttp.Call deleteRequirementCommentByIdValidateBeforeCall(Long projectId, String idOrKey, Long commentId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {448 449 // verify the required parameter 'projectId' is set450 if (projectId == null) {451 throw new ApiException("Missing the required parameter 'projectId' when calling deleteRequirementCommentById(Async)");452 }453 454 // verify the required parameter 'idOrKey' is set455 if (idOrKey == null) {456 throw new ApiException("Missing the required parameter 'idOrKey' when calling deleteRequirementCommentById(Async)");457 }458 459 // verify the required parameter 'commentId' is set460 if (commentId == null) {461 throw new ApiException("Missing the required parameter 'commentId' when calling deleteRequirementCommentById(Async)");462 }463 464 465 com.squareup.okhttp.Call call = deleteRequirementCommentByIdCall(projectId, idOrKey, commentId, progressListener, progressRequestListener);466 return call;467 468 469 470 471 }472 /**473 * Deletes a Comment of a Requirement474 * To delete a comment of a Requirement &lt;strong&gt;qTest Manager version:&lt;/strong&gt; 7.5+475 * @param projectId ID of the project (required)476 * @param idOrKey PID or ID of the Requirement whose comment you want to delete (required)477 * @param commentId The comment&#39;s ID (required)478 * @return Object479 * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body480 */481 public Object deleteRequirementCommentById(Long projectId, String idOrKey, Long commentId) throws ApiException {482 ApiResponse<Object> resp = deleteRequirementCommentByIdWithHttpInfo(projectId, idOrKey, commentId);483 return resp.getData();484 }485 /**486 * Deletes a Comment of a Requirement487 * To delete a comment of a Requirement &lt;strong&gt;qTest Manager version:&lt;/strong&gt; 7.5+488 * @param projectId ID of the project (required)489 * @param idOrKey PID or ID of the Requirement whose comment you want to delete (required)490 * @param commentId The comment&#39;s ID (required)491 * @return ApiResponse&lt;Object&gt;492 * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body493 */494 public ApiResponse<Object> deleteRequirementCommentByIdWithHttpInfo(Long projectId, String idOrKey, Long commentId) throws ApiException {495 com.squareup.okhttp.Call call = deleteRequirementCommentByIdValidateBeforeCall(projectId, idOrKey, commentId, null, null);496 Type localVarReturnType = new TypeToken<Object>(){}.getType();497 return apiClient.execute(call, localVarReturnType);498 }499 /**500 * Deletes a Comment of a Requirement (asynchronously)501 * To delete a comment of a Requirement &lt;strong&gt;qTest Manager version:&lt;/strong&gt; 7.5+502 * @param projectId ID of the project (required)503 * @param idOrKey PID or ID of the Requirement whose comment you want to delete (required)504 * @param commentId The comment&#39;s ID (required)505 * @param callback The callback to be executed when the API call finishes506 * @return The request call507 * @throws ApiException If fail to process the API call, e.g. serializing the request body object508 */509 public com.squareup.okhttp.Call deleteRequirementCommentByIdAsync(Long projectId, String idOrKey, Long commentId, final ApiCallback<Object> callback) throws ApiException {510 ProgressResponseBody.ProgressListener progressListener = null;511 ProgressRequestBody.ProgressRequestListener progressRequestListener = null;512 if (callback != null) {513 progressListener = new ProgressResponseBody.ProgressListener() {514 @Override515 public void update(long bytesRead, long contentLength, boolean done) {516 callback.onDownloadProgress(bytesRead, contentLength, done);517 }518 };519 progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {520 @Override521 public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {522 callback.onUploadProgress(bytesWritten, contentLength, done);523 }524 };525 }526 com.squareup.okhttp.Call call = deleteRequirementCommentByIdValidateBeforeCall(projectId, idOrKey, commentId, progressListener, progressRequestListener);527 Type localVarReturnType = new TypeToken<Object>(){}.getType();528 apiClient.executeAsync(call, localVarReturnType, callback);529 return call;530 }531 /* Build call for getAllRequirementComments */532 private com.squareup.okhttp.Call getAllRequirementCommentsCall(Long projectId, String idOrKey, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {533 Object localVarPostBody = null;534 535 // create path and map variables536 String localVarPath = "/api/v3/projects/{projectId}/requirements/{idOrKey}/comments".replaceAll("\\{format\\}","json")537 .replaceAll("\\{" + "projectId" + "\\}", apiClient.escapeString(projectId.toString()))538 .replaceAll("\\{" + "idOrKey" + "\\}", apiClient.escapeString(idOrKey.toString()));539 List<Pair> localVarQueryParams = new ArrayList<Pair>();540 Map<String, String> localVarHeaderParams = new HashMap<String, String>();541 Map<String, Object> localVarFormParams = new HashMap<String, Object>();542 final String[] localVarAccepts = {543 544 };545 final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);546 if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);547 final String[] localVarContentTypes = {548 549 };550 if (!localVarHeaderParams.containsKey("Content-Type")) {551 final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);552 localVarHeaderParams.put("Content-Type", localVarContentType);553 }554 555 if(progressListener != null) {556 apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {557 @Override558 public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {559 com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());560 return originalResponse.newBuilder()561 .body(new ProgressResponseBody(originalResponse.body(), progressListener))562 .build();563 }564 });565 }566 String[] localVarAuthNames = new String[] { "Authorization" };567 return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);568 }569 570 @SuppressWarnings("rawtypes")571 private com.squareup.okhttp.Call getAllRequirementCommentsValidateBeforeCall(Long projectId, String idOrKey, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {572 573 // verify the required parameter 'projectId' is set574 if (projectId == null) {575 throw new ApiException("Missing the required parameter 'projectId' when calling getAllRequirementComments(Async)");576 }577 578 // verify the required parameter 'idOrKey' is set579 if (idOrKey == null) {580 throw new ApiException("Missing the required parameter 'idOrKey' when calling getAllRequirementComments(Async)");581 }582 583 584 com.squareup.okhttp.Call call = getAllRequirementCommentsCall(projectId, idOrKey, progressListener, progressRequestListener);585 return call;586 587 588 589 590 }591 /**592 * Gets all Comments of a Requirement593 * To retrieve all comments of a Requirement &lt;strong&gt;qTest Manager version:&lt;/strong&gt; 7.6+594 * @param projectId ID of the project (required)595 * @param idOrKey PID or ID of the Requirement whose comments you want to retrieve (required)596 * @return PagedResourceCommentResource597 * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body598 */599 public PagedResourceCommentResource getAllRequirementComments(Long projectId, String idOrKey) throws ApiException {600 ApiResponse<PagedResourceCommentResource> resp = getAllRequirementCommentsWithHttpInfo(projectId, idOrKey);601 return resp.getData();602 }603 /**604 * Gets all Comments of a Requirement605 * To retrieve all comments of a Requirement &lt;strong&gt;qTest Manager version:&lt;/strong&gt; 7.6+606 * @param projectId ID of the project (required)607 * @param idOrKey PID or ID of the Requirement whose comments you want to retrieve (required)608 * @return ApiResponse&lt;PagedResourceCommentResource&gt;609 * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body610 */611 public ApiResponse<PagedResourceCommentResource> getAllRequirementCommentsWithHttpInfo(Long projectId, String idOrKey) throws ApiException {612 com.squareup.okhttp.Call call = getAllRequirementCommentsValidateBeforeCall(projectId, idOrKey, null, null);613 Type localVarReturnType = new TypeToken<PagedResourceCommentResource>(){}.getType();614 return apiClient.execute(call, localVarReturnType);615 }616 /**617 * Gets all Comments of a Requirement (asynchronously)618 * To retrieve all comments of a Requirement &lt;strong&gt;qTest Manager version:&lt;/strong&gt; 7.6+619 * @param projectId ID of the project (required)620 * @param idOrKey PID or ID of the Requirement whose comments you want to retrieve (required)621 * @param callback The callback to be executed when the API call finishes622 * @return The request call623 * @throws ApiException If fail to process the API call, e.g. serializing the request body object624 */625 public com.squareup.okhttp.Call getAllRequirementCommentsAsync(Long projectId, String idOrKey, final ApiCallback<PagedResourceCommentResource> callback) throws ApiException {626 ProgressResponseBody.ProgressListener progressListener = null;627 ProgressRequestBody.ProgressRequestListener progressRequestListener = null;628 if (callback != null) {629 progressListener = new ProgressResponseBody.ProgressListener() {630 @Override631 public void update(long bytesRead, long contentLength, boolean done) {632 callback.onDownloadProgress(bytesRead, contentLength, done);633 }634 };635 progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {636 @Override637 public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {638 callback.onUploadProgress(bytesWritten, contentLength, done);639 }640 };641 }642 com.squareup.okhttp.Call call = getAllRequirementCommentsValidateBeforeCall(projectId, idOrKey, progressListener, progressRequestListener);643 Type localVarReturnType = new TypeToken<PagedResourceCommentResource>(){}.getType();644 apiClient.executeAsync(call, localVarReturnType, callback);645 return call;646 }647 /* Build call for getPublicTraceabilityMatrixReport */648 private com.squareup.okhttp.Call getPublicTraceabilityMatrixReportCall(Long projectId, Long page, Integer size, String fieldIds, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {649 Object localVarPostBody = null;650 651 // create path and map variables652 String localVarPath = "/api/v3/projects/{projectId}/requirements/trace-matrix-report".replaceAll("\\{format\\}","json")653 .replaceAll("\\{" + "projectId" + "\\}", apiClient.escapeString(projectId.toString()));654 List<Pair> localVarQueryParams = new ArrayList<Pair>();655 if (page != null)656 localVarQueryParams.addAll(apiClient.parameterToPairs("", "page", page));657 if (size != null)658 localVarQueryParams.addAll(apiClient.parameterToPairs("", "size", size));659 if (fieldIds != null)660 localVarQueryParams.addAll(apiClient.parameterToPairs("", "fieldIds", fieldIds));661 Map<String, String> localVarHeaderParams = new HashMap<String, String>();662 Map<String, Object> localVarFormParams = new HashMap<String, Object>();663 final String[] localVarAccepts = {664 665 };666 final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);667 if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);668 final String[] localVarContentTypes = {669 670 };671 if (!localVarHeaderParams.containsKey("Content-Type")) {672 final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);673 localVarHeaderParams.put("Content-Type", localVarContentType);674 }675 676 if(progressListener != null) {677 apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {678 @Override679 public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {680 com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());681 return originalResponse.newBuilder()682 .body(new ProgressResponseBody(originalResponse.body(), progressListener))683 .build();684 }685 });686 }687 String[] localVarAuthNames = new String[] { "Authorization" };688 return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);689 }690 691 @SuppressWarnings("rawtypes")692 private com.squareup.okhttp.Call getPublicTraceabilityMatrixReportValidateBeforeCall(Long projectId, Long page, Integer size, String fieldIds, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {693 694 // verify the required parameter 'projectId' is set695 if (projectId == null) {696 throw new ApiException("Missing the required parameter 'projectId' when calling getPublicTraceabilityMatrixReport(Async)");697 }698 699 700 com.squareup.okhttp.Call call = getPublicTraceabilityMatrixReportCall(projectId, page, size, fieldIds, progressListener, progressRequestListener);701 return call;702 703 704 705 706 }707 /**708 * Gets Requirement Traceability Matrix Report709 * To retrieve a report of Requirements with their covering Test Cases710 * @param projectId ID of the project (required)711 * @param page By default the first page is returned but you can specify any page number to retrieve requirements. (optional, default to 1)712 * @param size The result is paginated. By default, the number of requirements in each page is 20. You can specify your custom number in this parameter and the maximum number is 999. (optional, default to 20)713 * @param fieldIds ID(s) of requirement fields (system or custom fields) which you would like to retrieve. They are separated by commas. (optional)714 * @return List&lt;TraceabilityRequirement&gt;715 * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body716 */717 public List<TraceabilityRequirement> getPublicTraceabilityMatrixReport(Long projectId, Long page, Integer size, String fieldIds) throws ApiException {718 ApiResponse<List<TraceabilityRequirement>> resp = getPublicTraceabilityMatrixReportWithHttpInfo(projectId, page, size, fieldIds);719 return resp.getData();720 }721 /**722 * Gets Requirement Traceability Matrix Report723 * To retrieve a report of Requirements with their covering Test Cases724 * @param projectId ID of the project (required)725 * @param page By default the first page is returned but you can specify any page number to retrieve requirements. (optional, default to 1)726 * @param size The result is paginated. By default, the number of requirements in each page is 20. You can specify your custom number in this parameter and the maximum number is 999. (optional, default to 20)727 * @param fieldIds ID(s) of requirement fields (system or custom fields) which you would like to retrieve. They are separated by commas. (optional)728 * @return ApiResponse&lt;List&lt;TraceabilityRequirement&gt;&gt;729 * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body730 */731 public ApiResponse<List<TraceabilityRequirement>> getPublicTraceabilityMatrixReportWithHttpInfo(Long projectId, Long page, Integer size, String fieldIds) throws ApiException {732 com.squareup.okhttp.Call call = getPublicTraceabilityMatrixReportValidateBeforeCall(projectId, page, size, fieldIds, null, null);733 Type localVarReturnType = new TypeToken<List<TraceabilityRequirement>>(){}.getType();734 return apiClient.execute(call, localVarReturnType);735 }736 /**737 * Gets Requirement Traceability Matrix Report (asynchronously)738 * To retrieve a report of Requirements with their covering Test Cases739 * @param projectId ID of the project (required)740 * @param page By default the first page is returned but you can specify any page number to retrieve requirements. (optional, default to 1)741 * @param size The result is paginated. By default, the number of requirements in each page is 20. You can specify your custom number in this parameter and the maximum number is 999. (optional, default to 20)742 * @param fieldIds ID(s) of requirement fields (system or custom fields) which you would like to retrieve. They are separated by commas. (optional)743 * @param callback The callback to be executed when the API call finishes744 * @return The request call745 * @throws ApiException If fail to process the API call, e.g. serializing the request body object746 */747 public com.squareup.okhttp.Call getPublicTraceabilityMatrixReportAsync(Long projectId, Long page, Integer size, String fieldIds, final ApiCallback<List<TraceabilityRequirement>> callback) throws ApiException {748 ProgressResponseBody.ProgressListener progressListener = null;749 ProgressRequestBody.ProgressRequestListener progressRequestListener = null;750 if (callback != null) {751 progressListener = new ProgressResponseBody.ProgressListener() {752 @Override753 public void update(long bytesRead, long contentLength, boolean done) {754 callback.onDownloadProgress(bytesRead, contentLength, done);755 }756 };757 progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {758 @Override759 public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {760 callback.onUploadProgress(bytesWritten, contentLength, done);761 }762 };763 }764 com.squareup.okhttp.Call call = getPublicTraceabilityMatrixReportValidateBeforeCall(projectId, page, size, fieldIds, progressListener, progressRequestListener);765 Type localVarReturnType = new TypeToken<List<TraceabilityRequirement>>(){}.getType();766 apiClient.executeAsync(call, localVarReturnType, callback);767 return call;768 }769 /* Build call for getRequirement */770 private com.squareup.okhttp.Call getRequirementCall(Long projectId, Long requirementId, Boolean includeExternalProperties, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {771 Object localVarPostBody = null;772 773 // create path and map variables774 String localVarPath = "/api/v3/projects/{projectId}/requirements/{requirementId}".replaceAll("\\{format\\}","json")775 .replaceAll("\\{" + "projectId" + "\\}", apiClient.escapeString(projectId.toString()))776 .replaceAll("\\{" + "requirementId" + "\\}", apiClient.escapeString(requirementId.toString()));777 List<Pair> localVarQueryParams = new ArrayList<Pair>();778 if (includeExternalProperties != null)779 localVarQueryParams.addAll(apiClient.parameterToPairs("", "includeExternalProperties", includeExternalProperties));780 Map<String, String> localVarHeaderParams = new HashMap<String, String>();781 Map<String, Object> localVarFormParams = new HashMap<String, Object>();782 final String[] localVarAccepts = {783 784 };785 final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);786 if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);787 final String[] localVarContentTypes = {788 789 };790 if (!localVarHeaderParams.containsKey("Content-Type")) {791 final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);792 localVarHeaderParams.put("Content-Type", localVarContentType);793 }794 795 if(progressListener != null) {796 apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {797 @Override798 public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {799 com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());800 return originalResponse.newBuilder()801 .body(new ProgressResponseBody(originalResponse.body(), progressListener))802 .build();803 }804 });805 }806 String[] localVarAuthNames = new String[] { "Authorization" };807 return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);808 }809 810 @SuppressWarnings("rawtypes")811 private com.squareup.okhttp.Call getRequirementValidateBeforeCall(Long projectId, Long requirementId, Boolean includeExternalProperties, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {812 813 // verify the required parameter 'projectId' is set814 if (projectId == null) {815 throw new ApiException("Missing the required parameter 'projectId' when calling getRequirement(Async)");816 }817 818 // verify the required parameter 'requirementId' is set819 if (requirementId == null) {820 throw new ApiException("Missing the required parameter 'requirementId' when calling getRequirement(Async)");821 }822 823 824 com.squareup.okhttp.Call call = getRequirementCall(projectId, requirementId, includeExternalProperties, progressListener, progressRequestListener);825 return call;826 827 828 829 830 }831 /**832 * Gets a Requirement833 * To retrieve a Requirement &lt;strong&gt;qTest Manager version:&lt;/strong&gt; 6+834 * @param projectId ID of the project (required)835 * @param requirementId ID of the Requirement which you want to retrieve. (required)836 * @param includeExternalProperties By default, Requirement external properties are not included in the response. Specify includeExternalProperties&#x3D;true to include them. (optional)837 * @return RequirementResource838 * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body839 */840 public RequirementResource getRequirement(Long projectId, Long requirementId, Boolean includeExternalProperties) throws ApiException {841 ApiResponse<RequirementResource> resp = getRequirementWithHttpInfo(projectId, requirementId, includeExternalProperties);842 return resp.getData();843 }844 /**845 * Gets a Requirement846 * To retrieve a Requirement &lt;strong&gt;qTest Manager version:&lt;/strong&gt; 6+847 * @param projectId ID of the project (required)848 * @param requirementId ID of the Requirement which you want to retrieve. (required)849 * @param includeExternalProperties By default, Requirement external properties are not included in the response. Specify includeExternalProperties&#x3D;true to include them. (optional)850 * @return ApiResponse&lt;RequirementResource&gt;851 * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body852 */853 public ApiResponse<RequirementResource> getRequirementWithHttpInfo(Long projectId, Long requirementId, Boolean includeExternalProperties) throws ApiException {854 com.squareup.okhttp.Call call = getRequirementValidateBeforeCall(projectId, requirementId, includeExternalProperties, null, null);855 Type localVarReturnType = new TypeToken<RequirementResource>(){}.getType();856 return apiClient.execute(call, localVarReturnType);857 }858 /**859 * Gets a Requirement (asynchronously)860 * To retrieve a Requirement &lt;strong&gt;qTest Manager version:&lt;/strong&gt; 6+861 * @param projectId ID of the project (required)862 * @param requirementId ID of the Requirement which you want to retrieve. (required)863 * @param includeExternalProperties By default, Requirement external properties are not included in the response. Specify includeExternalProperties&#x3D;true to include them. (optional)864 * @param callback The callback to be executed when the API call finishes865 * @return The request call866 * @throws ApiException If fail to process the API call, e.g. serializing the request body object867 */868 public com.squareup.okhttp.Call getRequirementAsync(Long projectId, Long requirementId, Boolean includeExternalProperties, final ApiCallback<RequirementResource> callback) throws ApiException {869 ProgressResponseBody.ProgressListener progressListener = null;870 ProgressRequestBody.ProgressRequestListener progressRequestListener = null;871 if (callback != null) {872 progressListener = new ProgressResponseBody.ProgressListener() {873 @Override874 public void update(long bytesRead, long contentLength, boolean done) {875 callback.onDownloadProgress(bytesRead, contentLength, done);876 }877 };878 progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {879 @Override880 public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {881 callback.onUploadProgress(bytesWritten, contentLength, done);882 }883 };884 }885 com.squareup.okhttp.Call call = getRequirementValidateBeforeCall(projectId, requirementId, includeExternalProperties, progressListener, progressRequestListener);886 Type localVarReturnType = new TypeToken<RequirementResource>(){}.getType();887 apiClient.executeAsync(call, localVarReturnType, callback);888 return call;889 }890 /* Build call for getRequirementCommentById */891 private com.squareup.okhttp.Call getRequirementCommentByIdCall(Long projectId, String idOrKey, Long commentId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {892 Object localVarPostBody = null;893 894 // create path and map variables895 String localVarPath = "/api/v3/projects/{projectId}/requirements/{idOrKey}/comments/{commentId}".replaceAll("\\{format\\}","json")896 .replaceAll("\\{" + "projectId" + "\\}", apiClient.escapeString(projectId.toString()))897 .replaceAll("\\{" + "idOrKey" + "\\}", apiClient.escapeString(idOrKey.toString()))898 .replaceAll("\\{" + "commentId" + "\\}", apiClient.escapeString(commentId.toString()));899 List<Pair> localVarQueryParams = new ArrayList<Pair>();900 Map<String, String> localVarHeaderParams = new HashMap<String, String>();901 Map<String, Object> localVarFormParams = new HashMap<String, Object>();902 final String[] localVarAccepts = {903 904 };905 final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);906 if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);907 final String[] localVarContentTypes = {908 909 };910 if (!localVarHeaderParams.containsKey("Content-Type")) {911 final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);912 localVarHeaderParams.put("Content-Type", localVarContentType);913 }914 915 if(progressListener != null) {916 apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {917 @Override918 public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {919 com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());920 return originalResponse.newBuilder()921 .body(new ProgressResponseBody(originalResponse.body(), progressListener))922 .build();923 }924 });925 }926 String[] localVarAuthNames = new String[] { "Authorization" };927 return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);928 }929 930 @SuppressWarnings("rawtypes")931 private com.squareup.okhttp.Call getRequirementCommentByIdValidateBeforeCall(Long projectId, String idOrKey, Long commentId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {932 933 // verify the required parameter 'projectId' is set934 if (projectId == null) {935 throw new ApiException("Missing the required parameter 'projectId' when calling getRequirementCommentById(Async)");936 }937 938 // verify the required parameter 'idOrKey' is set939 if (idOrKey == null) {940 throw new ApiException("Missing the required parameter 'idOrKey' when calling getRequirementCommentById(Async)");941 }942 943 // verify the required parameter 'commentId' is set944 if (commentId == null) {945 throw new ApiException("Missing the required parameter 'commentId' when calling getRequirementCommentById(Async)");946 }947 948 949 com.squareup.okhttp.Call call = getRequirementCommentByIdCall(projectId, idOrKey, commentId, progressListener, progressRequestListener);950 return call;951 952 953 954 955 }956 /**957 * Gets a Comment of a Requirement958 * To retrieve a comment of a Requirement &lt;strong&gt;qTest Manager version:&lt;/strong&gt; 7.5+959 * @param projectId ID of the project (required)960 * @param idOrKey PID or ID of the Requirement whose comment you want to delete (required)961 * @param commentId The comment&#39;s ID (required)962 * @return CommentResource963 * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body964 */965 public CommentResource getRequirementCommentById(Long projectId, String idOrKey, Long commentId) throws ApiException {966 ApiResponse<CommentResource> resp = getRequirementCommentByIdWithHttpInfo(projectId, idOrKey, commentId);967 return resp.getData();968 }969 /**970 * Gets a Comment of a Requirement971 * To retrieve a comment of a Requirement &lt;strong&gt;qTest Manager version:&lt;/strong&gt; 7.5+972 * @param projectId ID of the project (required)973 * @param idOrKey PID or ID of the Requirement whose comment you want to delete (required)974 * @param commentId The comment&#39;s ID (required)975 * @return ApiResponse&lt;CommentResource&gt;976 * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body977 */978 public ApiResponse<CommentResource> getRequirementCommentByIdWithHttpInfo(Long projectId, String idOrKey, Long commentId) throws ApiException {979 com.squareup.okhttp.Call call = getRequirementCommentByIdValidateBeforeCall(projectId, idOrKey, commentId, null, null);980 Type localVarReturnType = new TypeToken<CommentResource>(){}.getType();981 return apiClient.execute(call, localVarReturnType);982 }983 /**984 * Gets a Comment of a Requirement (asynchronously)985 * To retrieve a comment of a Requirement &lt;strong&gt;qTest Manager version:&lt;/strong&gt; 7.5+986 * @param projectId ID of the project (required)987 * @param idOrKey PID or ID of the Requirement whose comment you want to delete (required)988 * @param commentId The comment&#39;s ID (required)989 * @param callback The callback to be executed when the API call finishes990 * @return The request call991 * @throws ApiException If fail to process the API call, e.g. serializing the request body object992 */993 public com.squareup.okhttp.Call getRequirementCommentByIdAsync(Long projectId, String idOrKey, Long commentId, final ApiCallback<CommentResource> callback) throws ApiException {994 ProgressResponseBody.ProgressListener progressListener = null;995 ProgressRequestBody.ProgressRequestListener progressRequestListener = null;996 if (callback != null) {997 progressListener = new ProgressResponseBody.ProgressListener() {998 @Override999 public void update(long bytesRead, long contentLength, boolean done) {1000 callback.onDownloadProgress(bytesRead, contentLength, done);1001 }1002 };1003 progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {1004 @Override1005 public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {1006 callback.onUploadProgress(bytesWritten, contentLength, done);1007 }1008 };1009 }1010 com.squareup.okhttp.Call call = getRequirementCommentByIdValidateBeforeCall(projectId, idOrKey, commentId, progressListener, progressRequestListener);1011 Type localVarReturnType = new TypeToken<CommentResource>(){}.getType();1012 apiClient.executeAsync(call, localVarReturnType, callback);1013 return call;1014 }1015 /* Build call for getRequirements */1016 private com.squareup.okhttp.Call getRequirementsCall(Long projectId, Long parentId, Long page, Integer size, Boolean includeExternalProperties, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {1017 Object localVarPostBody = null;1018 1019 // create path and map variables1020 String localVarPath = "/api/v3/projects/{projectId}/requirements".replaceAll("\\{format\\}","json")1021 .replaceAll("\\{" + "projectId" + "\\}", apiClient.escapeString(projectId.toString()));1022 List<Pair> localVarQueryParams = new ArrayList<Pair>();1023 if (parentId != null)1024 localVarQueryParams.addAll(apiClient.parameterToPairs("", "parentId", parentId));1025 if (page != null)1026 localVarQueryParams.addAll(apiClient.parameterToPairs("", "page", page));1027 if (size != null)1028 localVarQueryParams.addAll(apiClient.parameterToPairs("", "size", size));1029 if (includeExternalProperties != null)1030 localVarQueryParams.addAll(apiClient.parameterToPairs("", "includeExternalProperties", includeExternalProperties));1031 Map<String, String> localVarHeaderParams = new HashMap<String, String>();1032 Map<String, Object> localVarFormParams = new HashMap<String, Object>();1033 final String[] localVarAccepts = {1034 1035 };1036 final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);1037 if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);1038 final String[] localVarContentTypes = {1039 1040 };1041 if (!localVarHeaderParams.containsKey("Content-Type")) {1042 final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);1043 localVarHeaderParams.put("Content-Type", localVarContentType);1044 }1045 1046 if(progressListener != null) {1047 apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {1048 @Override1049 public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {1050 com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());1051 return originalResponse.newBuilder()1052 .body(new ProgressResponseBody(originalResponse.body(), progressListener))1053 .build();1054 }1055 });1056 }1057 String[] localVarAuthNames = new String[] { "Authorization" };1058 return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);1059 }1060 1061 @SuppressWarnings("rawtypes")1062 private com.squareup.okhttp.Call getRequirementsValidateBeforeCall(Long projectId, Long parentId, Long page, Integer size, Boolean includeExternalProperties, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {1063 1064 // verify the required parameter 'projectId' is set1065 if (projectId == null) {1066 throw new ApiException("Missing the required parameter 'projectId' when calling getRequirements(Async)");1067 }1068 1069 1070 com.squareup.okhttp.Call call = getRequirementsCall(projectId, parentId, page, size, includeExternalProperties, progressListener, progressRequestListener);1071 return call;1072 1073 1074 1075 1076 }1077 /**1078 * Gets multiple Requirements1079 * To retrieve all Requirements or Requirements under a specific Module1080 * @param projectId ID of the project (required)1081 * @param parentId Specify the parent Module&#39;s ID to retrieve all of its Requirements which are located directly under the parent Module (optional)1082 * @param page By default the first page is returned but you can specify any page number to retrieve requirements. (optional, default to 1)1083 * @param size The result is paginated. By the default, the number of requirements in each page is 20. You can specify your custom number in this parameter. (optional)1084 * @param includeExternalProperties By default, Requirement external properties are not included in the response. Specify includeExternalProperties&#x3D;true to include them. (optional)1085 * @return List&lt;RequirementResource&gt;1086 * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body1087 */1088 public List<RequirementResource> getRequirements(Long projectId, Long parentId, Long page, Integer size, Boolean includeExternalProperties) throws ApiException {1089 ApiResponse<List<RequirementResource>> resp = getRequirementsWithHttpInfo(projectId, parentId, page, size, includeExternalProperties);1090 return resp.getData();1091 }1092 /**1093 * Gets multiple Requirements1094 * To retrieve all Requirements or Requirements under a specific Module1095 * @param projectId ID of the project (required)1096 * @param parentId Specify the parent Module&#39;s ID to retrieve all of its Requirements which are located directly under the parent Module (optional)1097 * @param page By default the first page is returned but you can specify any page number to retrieve requirements. (optional, default to 1)1098 * @param size The result is paginated. By the default, the number of requirements in each page is 20. You can specify your custom number in this parameter. (optional)1099 * @param includeExternalProperties By default, Requirement external properties are not included in the response. Specify includeExternalProperties&#x3D;true to include them. (optional)1100 * @return ApiResponse&lt;List&lt;RequirementResource&gt;&gt;1101 * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body1102 */1103 public ApiResponse<List<RequirementResource>> getRequirementsWithHttpInfo(Long projectId, Long parentId, Long page, Integer size, Boolean includeExternalProperties) throws ApiException {1104 com.squareup.okhttp.Call call = getRequirementsValidateBeforeCall(projectId, parentId, page, size, includeExternalProperties, null, null);1105 Type localVarReturnType = new TypeToken<List<RequirementResource>>(){}.getType();1106 return apiClient.execute(call, localVarReturnType);1107 }1108 /**1109 * Gets multiple Requirements (asynchronously)1110 * To retrieve all Requirements or Requirements under a specific Module1111 * @param projectId ID of the project (required)1112 * @param parentId Specify the parent Module&#39;s ID to retrieve all of its Requirements which are located directly under the parent Module (optional)1113 * @param page By default the first page is returned but you can specify any page number to retrieve requirements. (optional, default to 1)1114 * @param size The result is paginated. By the default, the number of requirements in each page is 20. You can specify your custom number in this parameter. (optional)1115 * @param includeExternalProperties By default, Requirement external properties are not included in the response. Specify includeExternalProperties&#x3D;true to include them. (optional)1116 * @param callback The callback to be executed when the API call finishes1117 * @return The request call1118 * @throws ApiException If fail to process the API call, e.g. serializing the request body object1119 */1120 public com.squareup.okhttp.Call getRequirementsAsync(Long projectId, Long parentId, Long page, Integer size, Boolean includeExternalProperties, final ApiCallback<List<RequirementResource>> callback) throws ApiException {1121 ProgressResponseBody.ProgressListener progressListener = null;1122 ProgressRequestBody.ProgressRequestListener progressRequestListener = null;1123 if (callback != null) {1124 progressListener = new ProgressResponseBody.ProgressListener() {1125 @Override1126 public void update(long bytesRead, long contentLength, boolean done) {1127 callback.onDownloadProgress(bytesRead, contentLength, done);1128 }1129 };1130 progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {1131 @Override1132 public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {1133 callback.onUploadProgress(bytesWritten, contentLength, done);1134 }1135 };1136 }1137 com.squareup.okhttp.Call call = getRequirementsValidateBeforeCall(projectId, parentId, page, size, includeExternalProperties, progressListener, progressRequestListener);1138 Type localVarReturnType = new TypeToken<List<RequirementResource>>(){}.getType();1139 apiClient.executeAsync(call, localVarReturnType, callback);1140 return call;1141 }1142 /* Build call for updateRequirement */1143 private com.squareup.okhttp.Call updateRequirementCall(Long projectId, Long requirementId, RequirementResource body, Long parentId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {1144 Object localVarPostBody = body;1145 1146 // create path and map variables1147 String localVarPath = "/api/v3/projects/{projectId}/requirements/{requirementId}".replaceAll("\\{format\\}","json")1148 .replaceAll("\\{" + "projectId" + "\\}", apiClient.escapeString(projectId.toString()))1149 .replaceAll("\\{" + "requirementId" + "\\}", apiClient.escapeString(requirementId.toString()));1150 List<Pair> localVarQueryParams = new ArrayList<Pair>();1151 if (parentId != null)1152 localVarQueryParams.addAll(apiClient.parameterToPairs("", "parentId", parentId));1153 Map<String, String> localVarHeaderParams = new HashMap<String, String>();1154 Map<String, Object> localVarFormParams = new HashMap<String, Object>();1155 final String[] localVarAccepts = {1156 1157 };1158 final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);1159 if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);1160 final String[] localVarContentTypes = {1161 1162 };1163 if (!localVarHeaderParams.containsKey("Content-Type")) {1164 final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);1165 localVarHeaderParams.put("Content-Type", localVarContentType);1166 }1167 1168 if(progressListener != null) {1169 apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {1170 @Override1171 public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {1172 com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());1173 return originalResponse.newBuilder()1174 .body(new ProgressResponseBody(originalResponse.body(), progressListener))1175 .build();1176 }1177 });1178 }1179 String[] localVarAuthNames = new String[] { "Authorization" };1180 return apiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);1181 }1182 1183 @SuppressWarnings("rawtypes")1184 private com.squareup.okhttp.Call updateRequirementValidateBeforeCall(Long projectId, Long requirementId, RequirementResource body, Long parentId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {1185 1186 // verify the required parameter 'projectId' is set1187 if (projectId == null) {1188 throw new ApiException("Missing the required parameter 'projectId' when calling updateRequirement(Async)");1189 }1190 1191 // verify the required parameter 'requirementId' is set1192 if (requirementId == null) {1193 throw new ApiException("Missing the required parameter 'requirementId' when calling updateRequirement(Async)");1194 }1195 1196 // verify the required parameter 'body' is set1197 if (body == null) {1198 throw new ApiException("Missing the required parameter 'body' when calling updateRequirement(Async)");1199 }1200 1201 1202 com.squareup.okhttp.Call call = updateRequirementCall(projectId, requirementId, body, parentId, progressListener, progressRequestListener);1203 return call;1204 1205 1206 1207 1208 }1209 /**1210 * Updates a Requirement1211 * To update properties of an Requirement or to move it to other parent Module1212 * @param projectId ID of the project (required)1213 * @param requirementId ID of the Requirement which needs to be updated. (required)1214 * @param body &lt;strong&gt;name: *&lt;/strong&gt; Requirement name. &lt;strong&gt;properties:&lt;/strong&gt; An array of field-value pairs (required)1215 * @param parentId ID of the parent Module to which the Requirement will be moved to (optional)1216 * @return RequirementResource1217 * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body1218 */1219 public RequirementResource updateRequirement(Long projectId, Long requirementId, RequirementResource body, Long parentId) throws ApiException {1220 ApiResponse<RequirementResource> resp = updateRequirementWithHttpInfo(projectId, requirementId, body, parentId);1221 return resp.getData();1222 }1223 /**1224 * Updates a Requirement1225 * To update properties of an Requirement or to move it to other parent Module1226 * @param projectId ID of the project (required)1227 * @param requirementId ID of the Requirement which needs to be updated. (required)1228 * @param body &lt;strong&gt;name: *&lt;/strong&gt; Requirement name. &lt;strong&gt;properties:&lt;/strong&gt; An array of field-value pairs (required)1229 * @param parentId ID of the parent Module to which the Requirement will be moved to (optional)1230 * @return ApiResponse&lt;RequirementResource&gt;1231 * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body1232 */1233 public ApiResponse<RequirementResource> updateRequirementWithHttpInfo(Long projectId, Long requirementId, RequirementResource body, Long parentId) throws ApiException {1234 com.squareup.okhttp.Call call = updateRequirementValidateBeforeCall(projectId, requirementId, body, parentId, null, null);1235 Type localVarReturnType = new TypeToken<RequirementResource>(){}.getType();1236 return apiClient.execute(call, localVarReturnType);1237 }1238 /**1239 * Updates a Requirement (asynchronously)1240 * To update properties of an Requirement or to move it to other parent Module1241 * @param projectId ID of the project (required)1242 * @param requirementId ID of the Requirement which needs to be updated. (required)1243 * @param body &lt;strong&gt;name: *&lt;/strong&gt; Requirement name. &lt;strong&gt;properties:&lt;/strong&gt; An array of field-value pairs (required)1244 * @param parentId ID of the parent Module to which the Requirement will be moved to (optional)1245 * @param callback The callback to be executed when the API call finishes1246 * @return The request call1247 * @throws ApiException If fail to process the API call, e.g. serializing the request body object1248 */1249 public com.squareup.okhttp.Call updateRequirementAsync(Long projectId, Long requirementId, RequirementResource body, Long parentId, final ApiCallback<RequirementResource> callback) throws ApiException {1250 ProgressResponseBody.ProgressListener progressListener = null;1251 ProgressRequestBody.ProgressRequestListener progressRequestListener = null;1252 if (callback != null) {1253 progressListener = new ProgressResponseBody.ProgressListener() {1254 @Override1255 public void update(long bytesRead, long contentLength, boolean done) {1256 callback.onDownloadProgress(bytesRead, contentLength, done);1257 }1258 };1259 progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {1260 @Override1261 public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {1262 callback.onUploadProgress(bytesWritten, contentLength, done);1263 }1264 };1265 }1266 com.squareup.okhttp.Call call = updateRequirementValidateBeforeCall(projectId, requirementId, body, parentId, progressListener, progressRequestListener);1267 Type localVarReturnType = new TypeToken<RequirementResource>(){}.getType();1268 apiClient.executeAsync(call, localVarReturnType, callback);1269 return call;1270 }1271 /* Build call for updateRequirementCommentById */1272 private com.squareup.okhttp.Call updateRequirementCommentByIdCall(Long projectId, String idOrKey, Long commentId, CommentResource body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {1273 Object localVarPostBody = body;1274 1275 // create path and map variables1276 String localVarPath = "/api/v3/projects/{projectId}/requirements/{idOrKey}/comments/{commentId}".replaceAll("\\{format\\}","json")1277 .replaceAll("\\{" + "projectId" + "\\}", apiClient.escapeString(projectId.toString()))1278 .replaceAll("\\{" + "idOrKey" + "\\}", apiClient.escapeString(idOrKey.toString()))1279 .replaceAll("\\{" + "commentId" + "\\}", apiClient.escapeString(commentId.toString()));1280 List<Pair> localVarQueryParams = new ArrayList<Pair>();1281 Map<String, String> localVarHeaderParams = new HashMap<String, String>();1282 Map<String, Object> localVarFormParams = new HashMap<String, Object>();1283 final String[] localVarAccepts = {1284 1285 };1286 final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);1287 if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);1288 final String[] localVarContentTypes = {1289 1290 };1291 if (!localVarHeaderParams.containsKey("Content-Type")) {1292 final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);1293 localVarHeaderParams.put("Content-Type", localVarContentType);1294 }1295 1296 if(progressListener != null) {1297 apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {1298 @Override1299 public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {1300 com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());1301 return originalResponse.newBuilder()1302 .body(new ProgressResponseBody(originalResponse.body(), progressListener))1303 .build();1304 }1305 });1306 }1307 String[] localVarAuthNames = new String[] { "Authorization" };1308 return apiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);1309 }1310 1311 @SuppressWarnings("rawtypes")1312 private com.squareup.okhttp.Call updateRequirementCommentByIdValidateBeforeCall(Long projectId, String idOrKey, Long commentId, CommentResource body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {1313 1314 // verify the required parameter 'projectId' is set1315 if (projectId == null) {1316 throw new ApiException("Missing the required parameter 'projectId' when calling updateRequirementCommentById(Async)");1317 }1318 1319 // verify the required parameter 'idOrKey' is set1320 if (idOrKey == null) {1321 throw new ApiException("Missing the required parameter 'idOrKey' when calling updateRequirementCommentById(Async)");1322 }1323 1324 // verify the required parameter 'commentId' is set1325 if (commentId == null) {1326 throw new ApiException("Missing the required parameter 'commentId' when calling updateRequirementCommentById(Async)");1327 }1328 1329 // verify the required parameter 'body' is set1330 if (body == null) {1331 throw new ApiException("Missing the required parameter 'body' when calling updateRequirementCommentById(Async)");1332 }1333 1334 1335 com.squareup.okhttp.Call call = updateRequirementCommentByIdCall(projectId, idOrKey, commentId, body, progressListener, progressRequestListener);1336 return call;1337 1338 1339 1340 1341 }1342 /**1343 * Updates a Comment of a Requirement1344 * To modify a comment of a Requirement &lt;strong&gt;qTest Manager version:&lt;/strong&gt; 7.5+1345 * @param projectId ID of the project (required)1346 * @param idOrKey PID or ID of the Requirement whose comment you want to update (required)1347 * @param commentId The comment&#39;s ID (required)1348 * @param body The comment&#39;s updated content (required)1349 * @return CommentResource1350 * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body1351 */1352 public CommentResource updateRequirementCommentById(Long projectId, String idOrKey, Long commentId, CommentResource body) throws ApiException {1353 ApiResponse<CommentResource> resp = updateRequirementCommentByIdWithHttpInfo(projectId, idOrKey, commentId, body);1354 return resp.getData();1355 }1356 /**1357 * Updates a Comment of a Requirement1358 * To modify a comment of a Requirement &lt;strong&gt;qTest Manager version:&lt;/strong&gt; 7.5+1359 * @param projectId ID of the project (required)1360 * @param idOrKey PID or ID of the Requirement whose comment you want to update (required)1361 * @param commentId The comment&#39;s ID (required)1362 * @param body The comment&#39;s updated content (required)1363 * @return ApiResponse&lt;CommentResource&gt;1364 * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body1365 */1366 public ApiResponse<CommentResource> updateRequirementCommentByIdWithHttpInfo(Long projectId, String idOrKey, Long commentId, CommentResource body) throws ApiException {1367 com.squareup.okhttp.Call call = updateRequirementCommentByIdValidateBeforeCall(projectId, idOrKey, commentId, body, null, null);1368 Type localVarReturnType = new TypeToken<CommentResource>(){}.getType();1369 return apiClient.execute(call, localVarReturnType);1370 }1371 /**1372 * Updates a Comment of a Requirement (asynchronously)1373 * To modify a comment of a Requirement &lt;strong&gt;qTest Manager version:&lt;/strong&gt; 7.5+1374 * @param projectId ID of the project (required)1375 * @param idOrKey PID or ID of the Requirement whose comment you want to update (required)1376 * @param commentId The comment&#39;s ID (required)1377 * @param body The comment&#39;s updated content (required)1378 * @param callback The callback to be executed when the API call finishes1379 * @return The request call1380 * @throws ApiException If fail to process the API call, e.g. serializing the request body object1381 */1382 public com.squareup.okhttp.Call updateRequirementCommentByIdAsync(Long projectId, String idOrKey, Long commentId, CommentResource body, final ApiCallback<CommentResource> callback) throws ApiException {1383 ProgressResponseBody.ProgressListener progressListener = null;1384 ProgressRequestBody.ProgressRequestListener progressRequestListener = null;1385 if (callback != null) {1386 progressListener = new ProgressResponseBody.ProgressListener() {1387 @Override1388 public void update(long bytesRead, long contentLength, boolean done) {1389 callback.onDownloadProgress(bytesRead, contentLength, done);1390 }1391 };1392 progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {1393 @Override1394 public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {1395 callback.onUploadProgress(bytesWritten, contentLength, done);1396 }1397 };1398 }1399 com.squareup.okhttp.Call call = updateRequirementCommentByIdValidateBeforeCall(projectId, idOrKey, commentId, body, progressListener, progressRequestListener);1400 Type localVarReturnType = new TypeToken<CommentResource>(){}.getType();1401 apiClient.executeAsync(call, localVarReturnType, callback);1402 return call;1403 }1404}...

Full Screen

Full Screen

SemverSyntacticSequencer.java

Source:SemverSyntacticSequencer.java Github

copy

Full Screen

1/**2 * Copyright (c) 2017 NumberFour AG.3 * All rights reserved. This program and the accompanying materials4 * are made available under the terms of the Eclipse Public License v1.05 * which accompanies this distribution, and is available at6 * http://www.eclipse.org/legal/epl-v10.html7 *8 * Contributors:9 * NumberFour AG - Initial API and implementation10 */11package org.eclipse.n4js.semver.serializer;12import com.google.inject.Inject;13import java.util.List;14import org.eclipse.emf.ecore.EObject;15import org.eclipse.n4js.semver.services.SemverGrammarAccess;16import org.eclipse.xtext.IGrammarAccess;17import org.eclipse.xtext.RuleCall;18import org.eclipse.xtext.nodemodel.INode;19import org.eclipse.xtext.serializer.analysis.GrammarAlias.AbstractElementAlias;20import org.eclipse.xtext.serializer.analysis.GrammarAlias.TokenAlias;21import org.eclipse.xtext.serializer.analysis.ISyntacticSequencerPDAProvider.ISynNavigable;22import org.eclipse.xtext.serializer.analysis.ISyntacticSequencerPDAProvider.ISynTransition;23import org.eclipse.xtext.serializer.sequencer.AbstractSyntacticSequencer;24@SuppressWarnings("all")25public class SemverSyntacticSequencer extends AbstractSyntacticSequencer {26 protected SemverGrammarAccess grammarAccess;27 protected AbstractElementAlias match_NPMVersionRequirement_WSTerminalRuleCall_0_0_q;28 protected AbstractElementAlias match_NPMVersionRequirement_WSTerminalRuleCall_1_1_q;29 protected AbstractElementAlias match_SimpleVersion_WSTerminalRuleCall_0_1_q;30 protected AbstractElementAlias match_VersionRangeSetRequirement_WSTerminalRuleCall_1_1_0_q;31 protected AbstractElementAlias match_VersionRangeSetRequirement_WSTerminalRuleCall_1_1_2_q;32 protected AbstractElementAlias match_VersionRangeSetRequirement_WSTerminalRuleCall_1_2_q;33 34 @Inject35 protected void init(IGrammarAccess access) {36 grammarAccess = (SemverGrammarAccess) access;37 match_NPMVersionRequirement_WSTerminalRuleCall_0_0_q = new TokenAlias(false, true, grammarAccess.getNPMVersionRequirementAccess().getWSTerminalRuleCall_0_0());38 match_NPMVersionRequirement_WSTerminalRuleCall_1_1_q = new TokenAlias(false, true, grammarAccess.getNPMVersionRequirementAccess().getWSTerminalRuleCall_1_1());39 match_SimpleVersion_WSTerminalRuleCall_0_1_q = new TokenAlias(false, true, grammarAccess.getSimpleVersionAccess().getWSTerminalRuleCall_0_1());40 match_VersionRangeSetRequirement_WSTerminalRuleCall_1_1_0_q = new TokenAlias(false, true, grammarAccess.getVersionRangeSetRequirementAccess().getWSTerminalRuleCall_1_1_0());41 match_VersionRangeSetRequirement_WSTerminalRuleCall_1_1_2_q = new TokenAlias(false, true, grammarAccess.getVersionRangeSetRequirementAccess().getWSTerminalRuleCall_1_1_2());42 match_VersionRangeSetRequirement_WSTerminalRuleCall_1_2_q = new TokenAlias(false, true, grammarAccess.getVersionRangeSetRequirementAccess().getWSTerminalRuleCall_1_2());43 }44 45 @Override46 protected String getUnassignedRuleCallToken(EObject semanticObject, RuleCall ruleCall, INode node) {47 if (ruleCall.getRule() == grammarAccess.getFILE_TAGRule())48 return getFILE_TAGToken(semanticObject, ruleCall, node);49 else if (ruleCall.getRule() == grammarAccess.getLETTER_VRule())50 return getLETTER_VToken(semanticObject, ruleCall, node);51 else if (ruleCall.getRule() == grammarAccess.getSEMVER_TAGRule())52 return getSEMVER_TAGToken(semanticObject, ruleCall, node);53 else if (ruleCall.getRule() == grammarAccess.getWILDCARDRule())54 return getWILDCARDToken(semanticObject, ruleCall, node);55 else if (ruleCall.getRule() == grammarAccess.getWSRule())56 return getWSToken(semanticObject, ruleCall, node);57 return "";58 }59 60 /**61 * FILE_TAG:62 * LETTER_F LETTER_I LETTER_L LETTER_E ':'63 * ;64 */65 protected String getFILE_TAGToken(EObject semanticObject, RuleCall ruleCall, INode node) {66 if (node != null)67 return getTokenText(node);68 return "f i l e :";69 }70 71 /**72 * terminal LETTER_V :73 * 'v' | 'V'74 * ;75 */76 protected String getLETTER_VToken(EObject semanticObject, RuleCall ruleCall, INode node) {77 if (node != null)78 return getTokenText(node);79 return "v";80 }81 82 /**83 * SEMVER_TAG:84 * LETTER_S LETTER_E LETTER_M LETTER_V LETTER_E LETTER_R ':'85 * ;86 */87 protected String getSEMVER_TAGToken(EObject semanticObject, RuleCall ruleCall, INode node) {88 if (node != null)89 return getTokenText(node);90 return "s e m v r :";91 }92 93 /**94 * WILDCARD:95 * LETTER_X | ASTERIX96 * ;97 */98 protected String getWILDCARDToken(EObject semanticObject, RuleCall ruleCall, INode node) {99 if (node != null)100 return getTokenText(node);101 return "x";102 }103 104 /**105 * terminal WS:106 * WHITESPACE_FRAGMENT+;107 */108 protected String getWSToken(EObject semanticObject, RuleCall ruleCall, INode node) {109 if (node != null)110 return getTokenText(node);111 return "\t";112 }113 114 @Override115 protected void emitUnassignedTokens(EObject semanticObject, ISynTransition transition, INode fromNode, INode toNode) {116 if (transition.getAmbiguousSyntaxes().isEmpty()) return;117 List<INode> transitionNodes = collectNodes(fromNode, toNode);118 for (AbstractElementAlias syntax : transition.getAmbiguousSyntaxes()) {119 List<INode> syntaxNodes = getNodesFor(transitionNodes, syntax);120 if (match_NPMVersionRequirement_WSTerminalRuleCall_0_0_q.equals(syntax))121 emit_NPMVersionRequirement_WSTerminalRuleCall_0_0_q(semanticObject, getLastNavigableState(), syntaxNodes);122 else if (match_NPMVersionRequirement_WSTerminalRuleCall_1_1_q.equals(syntax))123 emit_NPMVersionRequirement_WSTerminalRuleCall_1_1_q(semanticObject, getLastNavigableState(), syntaxNodes);124 else if (match_SimpleVersion_WSTerminalRuleCall_0_1_q.equals(syntax))125 emit_SimpleVersion_WSTerminalRuleCall_0_1_q(semanticObject, getLastNavigableState(), syntaxNodes);126 else if (match_VersionRangeSetRequirement_WSTerminalRuleCall_1_1_0_q.equals(syntax))127 emit_VersionRangeSetRequirement_WSTerminalRuleCall_1_1_0_q(semanticObject, getLastNavigableState(), syntaxNodes);128 else if (match_VersionRangeSetRequirement_WSTerminalRuleCall_1_1_2_q.equals(syntax))129 emit_VersionRangeSetRequirement_WSTerminalRuleCall_1_1_2_q(semanticObject, getLastNavigableState(), syntaxNodes);130 else if (match_VersionRangeSetRequirement_WSTerminalRuleCall_1_2_q.equals(syntax))131 emit_VersionRangeSetRequirement_WSTerminalRuleCall_1_2_q(semanticObject, getLastNavigableState(), syntaxNodes);132 else acceptNodes(getLastNavigableState(), syntaxNodes);133 }134 }135 /**136 * Ambiguous syntax:137 * WS?138 *139 * This ambiguous syntax occurs at:140 * (rule start) (ambiguity) (rule start)141 * (rule start) (ambiguity) ranges+=VersionRange142 */143 protected void emit_NPMVersionRequirement_WSTerminalRuleCall_0_0_q(EObject semanticObject, ISynNavigable transition, List<INode> nodes) {144 acceptNodes(transition, nodes);145 }146 147 /**148 * Ambiguous syntax:149 * WS?150 *151 * This ambiguous syntax occurs at:152 * commitISH=ALPHA_NUMERIC_CHARS (ambiguity) (rule end)153 * githubUrl=URL_NO_VX (ambiguity) (rule end)154 * localPath=PATH (ambiguity) (rule end)155 * tagName=TAG (ambiguity) (rule end)156 * url=URL (ambiguity) (rule end)157 * versionSpecifier=URLVersionSpecifier (ambiguity) (rule end)158 */159 protected void emit_NPMVersionRequirement_WSTerminalRuleCall_1_1_q(EObject semanticObject, ISynNavigable transition, List<INode> nodes) {160 acceptNodes(transition, nodes);161 }162 163 /**164 * Ambiguous syntax:165 * WS?166 *167 * This ambiguous syntax occurs at:168 * comparators+=VersionComparator (ambiguity) comparators+=VersionComparator169 * comparators+=VersionComparator (ambiguity) number=VersionNumber170 * comparators+=VersionComparator (ambiguity) withLetterV?=LETTER_V171 */172 protected void emit_SimpleVersion_WSTerminalRuleCall_0_1_q(EObject semanticObject, ISynNavigable transition, List<INode> nodes) {173 acceptNodes(transition, nodes);174 }175 176 /**177 * Ambiguous syntax:178 * WS?179 *180 * This ambiguous syntax occurs at:181 * ranges+=VersionRange (ambiguity) '||' WS? ranges+=VersionRange182 */183 protected void emit_VersionRangeSetRequirement_WSTerminalRuleCall_1_1_0_q(EObject semanticObject, ISynNavigable transition, List<INode> nodes) {184 acceptNodes(transition, nodes);185 }186 187 /**188 * Ambiguous syntax:189 * WS?190 *191 * This ambiguous syntax occurs at:192 * ranges+=VersionRange WS? '||' (ambiguity) ranges+=VersionRange193 */194 protected void emit_VersionRangeSetRequirement_WSTerminalRuleCall_1_1_2_q(EObject semanticObject, ISynNavigable transition, List<INode> nodes) {195 acceptNodes(transition, nodes);196 }197 198 /**199 * Ambiguous syntax:200 * WS?201 *202 * This ambiguous syntax occurs at:203 * ranges+=VersionRange (ambiguity) (rule end)204 */205 protected void emit_VersionRangeSetRequirement_WSTerminalRuleCall_1_2_q(EObject semanticObject, ISynNavigable transition, List<INode> nodes) {206 acceptNodes(transition, nodes);207 }208 209}...

Full Screen

Full Screen

EntryLevelSystemCallRequirementImpl.java

Source:EntryLevelSystemCallRequirementImpl.java Github

copy

Full Screen

1/**2 */3package de.uka.ipd.sdq.dsexplore.qml.profile.impl;4import de.uka.ipd.sdq.dsexplore.qml.profile.EntryLevelSystemCallRequirement;5import de.uka.ipd.sdq.dsexplore.qml.profile.ProfilePackage;6import org.eclipse.emf.ecore.EClass;7import org.palladiosimulator.pcm.usagemodel.EntryLevelSystemCall;8/**9 * <!-- begin-user-doc -->10 * An implementation of the model object '<em><b>Entry Level System Call Requirement</b></em>'.11 * <!-- end-user-doc -->12 * <p>13 * The following features are implemented:14 * </p>15 * <ul>16 * <li>{@link de.uka.ipd.sdq.dsexplore.qml.profile.impl.EntryLevelSystemCallRequirementImpl#getEntryLevelSystemCall <em>Entry Level System Call</em>}</li>17 * </ul>18 *19 * @generated20 */21public class EntryLevelSystemCallRequirementImpl extends RequirementImpl implements EntryLevelSystemCallRequirement {22 /**23 * <!-- begin-user-doc -->24 * <!-- end-user-doc -->25 * @generated26 */27 protected EntryLevelSystemCallRequirementImpl() {28 super();29 }30 /**31 * <!-- begin-user-doc -->32 * <!-- end-user-doc -->33 * @generated34 */35 @Override36 protected EClass eStaticClass() {37 return ProfilePackage.Literals.ENTRY_LEVEL_SYSTEM_CALL_REQUIREMENT;38 }39 /**40 * <!-- begin-user-doc -->41 * <!-- end-user-doc -->42 * @generated43 */44 public EntryLevelSystemCall getEntryLevelSystemCall() {45 return (EntryLevelSystemCall)eDynamicGet(ProfilePackage.ENTRY_LEVEL_SYSTEM_CALL_REQUIREMENT__ENTRY_LEVEL_SYSTEM_CALL, ProfilePackage.Literals.ENTRY_LEVEL_SYSTEM_CALL_REQUIREMENT__ENTRY_LEVEL_SYSTEM_CALL, true, true);46 }47 /**48 * <!-- begin-user-doc -->49 * <!-- end-user-doc -->50 * @generated51 */52 public EntryLevelSystemCall basicGetEntryLevelSystemCall() {53 return (EntryLevelSystemCall)eDynamicGet(ProfilePackage.ENTRY_LEVEL_SYSTEM_CALL_REQUIREMENT__ENTRY_LEVEL_SYSTEM_CALL, ProfilePackage.Literals.ENTRY_LEVEL_SYSTEM_CALL_REQUIREMENT__ENTRY_LEVEL_SYSTEM_CALL, false, true);54 }55 /**56 * <!-- begin-user-doc -->57 * <!-- end-user-doc -->58 * @generated59 */60 public void setEntryLevelSystemCall(EntryLevelSystemCall newEntryLevelSystemCall) {61 eDynamicSet(ProfilePackage.ENTRY_LEVEL_SYSTEM_CALL_REQUIREMENT__ENTRY_LEVEL_SYSTEM_CALL, ProfilePackage.Literals.ENTRY_LEVEL_SYSTEM_CALL_REQUIREMENT__ENTRY_LEVEL_SYSTEM_CALL, newEntryLevelSystemCall);62 }63 /**64 * <!-- begin-user-doc -->65 * <!-- end-user-doc -->66 * @generated67 */68 @Override69 public Object eGet(int featureID, boolean resolve, boolean coreType) {70 switch (featureID) {71 case ProfilePackage.ENTRY_LEVEL_SYSTEM_CALL_REQUIREMENT__ENTRY_LEVEL_SYSTEM_CALL:72 if (resolve) return getEntryLevelSystemCall();73 return basicGetEntryLevelSystemCall();74 }75 return super.eGet(featureID, resolve, coreType);76 }77 /**78 * <!-- begin-user-doc -->79 * <!-- end-user-doc -->80 * @generated81 */82 @Override83 public void eSet(int featureID, Object newValue) {84 switch (featureID) {85 case ProfilePackage.ENTRY_LEVEL_SYSTEM_CALL_REQUIREMENT__ENTRY_LEVEL_SYSTEM_CALL:86 setEntryLevelSystemCall((EntryLevelSystemCall)newValue);87 return;88 }89 super.eSet(featureID, newValue);90 }91 /**92 * <!-- begin-user-doc -->93 * <!-- end-user-doc -->94 * @generated95 */96 @Override97 public void eUnset(int featureID) {98 switch (featureID) {99 case ProfilePackage.ENTRY_LEVEL_SYSTEM_CALL_REQUIREMENT__ENTRY_LEVEL_SYSTEM_CALL:100 setEntryLevelSystemCall((EntryLevelSystemCall)null);101 return;102 }103 super.eUnset(featureID);104 }105 /**106 * <!-- begin-user-doc -->107 * <!-- end-user-doc -->108 * @generated109 */110 @Override111 public boolean eIsSet(int featureID) {112 switch (featureID) {113 case ProfilePackage.ENTRY_LEVEL_SYSTEM_CALL_REQUIREMENT__ENTRY_LEVEL_SYSTEM_CALL:114 return basicGetEntryLevelSystemCall() != null;115 }116 return super.eIsSet(featureID);117 }118} //EntryLevelSystemCallRequirementImpl...

Full Screen

Full Screen

call

Using AI Code Generation

copy

Full Screen

1file = File.read('requirements.json')2data = JSON.parse(file)3req = Requirement.new(data['name'], data['description'], data['priority'])4 def initialize(name, description, priority)

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run Spectus_ruby automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Most used method in

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful