# ProductsApi
All URIs are relative to *https://demo.iriusrisk.com/api/v1*
Method | HTTP request | Description
------------- | ------------- | -------------
[**productsGet**](ProductsApi.md#productsGet) | **GET** /products | Gets a list of all products.
[**productsPost**](ProductsApi.md#productsPost) | **POST** /products | Creates a new product
[**productsRefComponentsComponentRefControlsControlRefStatusPut**](ProductsApi.md#productsRefComponentsComponentRefControlsControlRefStatusPut) | **PUT** /products/{ref}/components/{componentRef}/controls/{controlRef}/status | Sets the desired status to a countermeasure
[**productsRefComponentsComponentRefTestsCwePut**](ProductsApi.md#productsRefComponentsComponentRefTestsCwePut) | **PUT** /products/{ref}/components/{componentRef}/tests/{cwe} | Updates a single test to a component.
[**productsRefComponentsComponentRefTestsTestTypeUploadPost**](ProductsApi.md#productsRefComponentsComponentRefTestsTestTypeUploadPost) | **POST** /products/{ref}/components/{componentRef}/tests/{testType}/upload | Imports test results from different sources to a component
[**productsRefControlsGet**](ProductsApi.md#productsRefControlsGet) | **GET** /products/{ref}/controls | Gets a list of all product countermeasures
[**productsRefControlsImplementedGet**](ProductsApi.md#productsRefControlsImplementedGet) | **GET** /products/{ref}/controls/implemented | Gets a list of all implemented countermeasures of a product.
[**productsRefControlsRequiredGet**](ProductsApi.md#productsRefControlsRequiredGet) | **GET** /products/{ref}/controls/required | Gets a list of all required countermeasures of a product
[**productsRefDelete**](ProductsApi.md#productsRefDelete) | **DELETE** /products/{ref} | Deletes a product
[**productsRefDiagramImageGet**](ProductsApi.md#productsRefDiagramImageGet) | **GET** /products/{ref}/diagram/image | Gets diagram image for product.
[**productsRefGet**](ProductsApi.md#productsRefGet) | **GET** /products/{ref} | Gets product details
[**productsRefGroupsDelete**](ProductsApi.md#productsRefGroupsDelete) | **DELETE** /products/{ref}/groups | Unassigns a list of user groups from a product.
[**productsRefGroupsGet**](ProductsApi.md#productsRefGroupsGet) | **GET** /products/{ref}/groups | List all groups assigned to a product
[**productsRefGroupsPut**](ProductsApi.md#productsRefGroupsPut) | **PUT** /products/{ref}/groups | Assigns groups of users to a product.
[**productsRefPut**](ProductsApi.md#productsRefPut) | **PUT** /products/{ref} | Updates a product
[**productsRefRisksGet**](ProductsApi.md#productsRefRisksGet) | **GET** /products/{ref}/risks | Gets the risks summary of a product
[**productsRefTestsTestTypeUploadPost**](ProductsApi.md#productsRefTestsTestTypeUploadPost) | **POST** /products/{ref}/tests/{testType}/upload | Imports test results from different sources to a product.
[**productsRefThreatsGet**](ProductsApi.md#productsRefThreatsGet) | **GET** /products/{ref}/threats | Gets a list of all threats of a product
[**productsRefUsersDelete**](ProductsApi.md#productsRefUsersDelete) | **DELETE** /products/{ref}/users | Unassigns a list of users from a product.
[**productsRefUsersGet**](ProductsApi.md#productsRefUsersGet) | **GET** /products/{ref}/users | List all users assigned to a product
[**productsRefUsersPut**](ProductsApi.md#productsRefUsersPut) | **PUT** /products/{ref}/users | Assigns users to a product.
[**productsRefUsersUserDelete**](ProductsApi.md#productsRefUsersUserDelete) | **DELETE** /products/{ref}/users/{user} | Unassigns a user from a product
[**productsRefWeaknessesGet**](ProductsApi.md#productsRefWeaknessesGet) | **GET** /products/{ref}/weaknesses | Gets a list of all weaknesses of a product
[**productsRefWeaknessesTestStateGet**](ProductsApi.md#productsRefWeaknessesTestStateGet) | **GET** /products/{ref}/weaknesses/{test_state} | Gets a list of all weaknesses of a product filtered by test state
[**productsUploadPost**](ProductsApi.md#productsUploadPost) | **POST** /products/upload | Creates a new product, library or template from a XML file upload.
[**productsUploadRefPost**](ProductsApi.md#productsUploadRefPost) | **POST** /products/upload/{ref} | Updates an existing product from a XML file upload.
[**rulesProductRefPut**](ProductsApi.md#rulesProductRefPut) | **PUT** /rules/product/{ref} | Executes rules by a product
# **productsGet**
> List<ProductShort> productsGet(apiToken, max, index, workflowState)
Gets a list of all products.
Gets a list of all products visible by the user who perform the call. Conditions to be able to perform the action: - No permissions are required to perform this action.
### Example
```java
// Import classes:
//import io.swagger.client.ApiException;
//import io.swagger.client.api.ProductsApi;
ProductsApi apiInstance = new ProductsApi();
String apiToken = "apiToken_example"; // String | Authentication token
Integer max = 1; // Integer | maximun number of items returned
Integer index = 1; // Integer | index of the first element to return
String workflowState = "workflowState_example"; // String | filter for products by workflow state ref
try {
List result = apiInstance.productsGet(apiToken, max, index, workflowState);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling ProductsApi#productsGet");
e.printStackTrace();
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**apiToken** | **String**| Authentication token |
**max** | **Integer**| maximun number of items returned | [optional] [default to 1]
**index** | **Integer**| index of the first element to return | [optional] [default to 1]
**workflowState** | **String**| filter for products by workflow state ref | [optional]
### Return type
[**List<ProductShort>**](ProductShort.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
# **productsPost**
> ProductShort productsPost(apiToken, createProductRequestBody)
Creates a new product
Createa a new product. Conditions to be able to perform the action: - To have the permission **PRODUCT_CREATE** granted.
### Example
```java
// Import classes:
//import io.swagger.client.ApiException;
//import io.swagger.client.api.ProductsApi;
ProductsApi apiInstance = new ProductsApi();
String apiToken = "apiToken_example"; // String | Authentication token
CreateProduct createProductRequestBody = new CreateProduct(); // CreateProduct | JSON data that contains information to create new product
try {
ProductShort result = apiInstance.productsPost(apiToken, createProductRequestBody);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling ProductsApi#productsPost");
e.printStackTrace();
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**apiToken** | **String**| Authentication token |
**createProductRequestBody** | [**CreateProduct**](CreateProduct.md)| JSON data that contains information to create new product |
### Return type
[**ProductShort**](ProductShort.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
# **productsRefComponentsComponentRefControlsControlRefStatusPut**
> productsRefComponentsComponentRefControlsControlRefStatusPut(apiToken, ref, componentRef, controlRef, updateStatusCountermeasureRequestBody)
Sets the desired status to a countermeasure
Sets the desired status to a countermeasure. Possible values are: - implemented - recommended - rejected - required Conditions to be able to perform the action: - To have the permission **COUNTERMEASURE_UPDATE** granted to set any state. - To have the permission **COUNTERMEASURE_SELECT_IMPLEMENTED** granted to set implemented state. - To have the permission **COUNTERMEASURE_SELECT_RECOMMENDED** granted to set recommended state. - To have the permission **COUNTERMEASURE_SELECT_REJECTED** granted to set reject state. - To have the permission **COUNTERMEASURE_SELECT_REQUIRED** granted to set required state.
### Example
```java
// Import classes:
//import io.swagger.client.ApiException;
//import io.swagger.client.api.ProductsApi;
ProductsApi apiInstance = new ProductsApi();
String apiToken = "apiToken_example"; // String | Authentication token
String ref = "ref_example"; // String | ID for product
String componentRef = "componentRef_example"; // String | ID for component
String controlRef = "controlRef_example"; // String | Control ref
UpdateStatusCountermeasureRequestBody updateStatusCountermeasureRequestBody = new UpdateStatusCountermeasureRequestBody(); // UpdateStatusCountermeasureRequestBody | JSON data that contains the information to update countermeasure
try {
apiInstance.productsRefComponentsComponentRefControlsControlRefStatusPut(apiToken, ref, componentRef, controlRef, updateStatusCountermeasureRequestBody);
} catch (ApiException e) {
System.err.println("Exception when calling ProductsApi#productsRefComponentsComponentRefControlsControlRefStatusPut");
e.printStackTrace();
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**apiToken** | **String**| Authentication token |
**ref** | **String**| ID for product |
**componentRef** | **String**| ID for component |
**controlRef** | **String**| Control ref |
**updateStatusCountermeasureRequestBody** | [**UpdateStatusCountermeasureRequestBody**](UpdateStatusCountermeasureRequestBody.md)| JSON data that contains the information to update countermeasure |
### Return type
null (empty response body)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
# **productsRefComponentsComponentRefTestsCwePut**
> List<InlineResponse2001> productsRefComponentsComponentRefTestsCwePut(apiToken, ref, componentRef, cwe, updateStatusTestRequestBody)
Updates a single test to a component.
Updates a single test to a component. Conditions to be able to perform the action: - To have the permission **TEST_UPDATE** granted.
### Example
```java
// Import classes:
//import io.swagger.client.ApiException;
//import io.swagger.client.api.ProductsApi;
ProductsApi apiInstance = new ProductsApi();
String apiToken = "apiToken_example"; // String | Authentication token
String ref = "ref_example"; // String | ID for product
String componentRef = "componentRef_example"; // String | ID for component
String cwe = "cwe_example"; // String | countermeasure or weakness CWE
UpdateStatusTestRequestBody updateStatusTestRequestBody = new UpdateStatusTestRequestBody(); // UpdateStatusTestRequestBody | JSON data that contains the information to update test
try {
List result = apiInstance.productsRefComponentsComponentRefTestsCwePut(apiToken, ref, componentRef, cwe, updateStatusTestRequestBody);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling ProductsApi#productsRefComponentsComponentRefTestsCwePut");
e.printStackTrace();
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**apiToken** | **String**| Authentication token |
**ref** | **String**| ID for product |
**componentRef** | **String**| ID for component |
**cwe** | **String**| countermeasure or weakness CWE |
**updateStatusTestRequestBody** | [**UpdateStatusTestRequestBody**](UpdateStatusTestRequestBody.md)| JSON data that contains the information to update test |
### Return type
[**List<InlineResponse2001>**](InlineResponse2001.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
# **productsRefComponentsComponentRefTestsTestTypeUploadPost**
> InlineResponse2011 productsRefComponentsComponentRefTestsTestTypeUploadPost(apiToken, ref, componentRef, testType, fileName)
Imports test results from different sources to a component
Imports test results from different sources (OWASP ZAP, Cucumber, Micro Focus Fortify) into the specified component. More than one file can be attached to the call. Conditions to be able to perform the action: - To have the permission **TEST_UPDATE** granted.
### Example
```java
// Import classes:
//import io.swagger.client.ApiException;
//import io.swagger.client.api.ProductsApi;
ProductsApi apiInstance = new ProductsApi();
String apiToken = "apiToken_example"; // String | Authentication token
String ref = "ref_example"; // String | ID for product
String componentRef = "componentRef_example"; // String | ID for component
String testType = "testType_example"; // String | Type of test to be imported (zap|cucumber|junit|hp-fortify)
File fileName = new File("/path/to/file.txt"); // File | File to upload
try {
InlineResponse2011 result = apiInstance.productsRefComponentsComponentRefTestsTestTypeUploadPost(apiToken, ref, componentRef, testType, fileName);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling ProductsApi#productsRefComponentsComponentRefTestsTestTypeUploadPost");
e.printStackTrace();
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**apiToken** | **String**| Authentication token |
**ref** | **String**| ID for product |
**componentRef** | **String**| ID for component |
**testType** | **String**| Type of test to be imported (zap|cucumber|junit|hp-fortify) | [enum: zap, cucumber, junit, hp-fortify]
**fileName** | **File**| File to upload | [optional]
### Return type
[**InlineResponse2011**](InlineResponse2011.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: multipart/form-data
- **Accept**: application/json
# **productsRefControlsGet**
> List<ComponentControl> productsRefControlsGet(apiToken, ref)
Gets a list of all product countermeasures
Returns a list of all the countermeasures of a product. Conditions to be able to perform the action: - To have the permission **COUNTERMEASURE_VIEW** granted, or - To have the permission **COUNTERMEASURE_UPDATE** granted.
### Example
```java
// Import classes:
//import io.swagger.client.ApiException;
//import io.swagger.client.api.ProductsApi;
ProductsApi apiInstance = new ProductsApi();
String apiToken = "apiToken_example"; // String | Authentication token
String ref = "ref_example"; // String | ID for product
try {
List result = apiInstance.productsRefControlsGet(apiToken, ref);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling ProductsApi#productsRefControlsGet");
e.printStackTrace();
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**apiToken** | **String**| Authentication token |
**ref** | **String**| ID for product |
### Return type
[**List<ComponentControl>**](ComponentControl.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
# **productsRefControlsImplementedGet**
> List<ComponentControl> productsRefControlsImplementedGet(apiToken, ref)
Gets a list of all implemented countermeasures of a product.
Returns a list of all the implemented countermeasures of a product. Conditions to be able to perform the action: - To have the permission **COUNTERMEASURE_VIEW** granted, or - To have the permission **COUNTERMEASURE_UPDATE** granted.
### Example
```java
// Import classes:
//import io.swagger.client.ApiException;
//import io.swagger.client.api.ProductsApi;
ProductsApi apiInstance = new ProductsApi();
String apiToken = "apiToken_example"; // String | Authentication token
String ref = "ref_example"; // String | ID for product
try {
List result = apiInstance.productsRefControlsImplementedGet(apiToken, ref);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling ProductsApi#productsRefControlsImplementedGet");
e.printStackTrace();
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**apiToken** | **String**| Authentication token |
**ref** | **String**| ID for product |
### Return type
[**List<ComponentControl>**](ComponentControl.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
# **productsRefControlsRequiredGet**
> List<ComponentControl> productsRefControlsRequiredGet(apiToken, ref)
Gets a list of all required countermeasures of a product
Returns a list of all the required countermeasures of a product. Conditions to be able to perform the action: - To have the permission **COUNTERMEASURE_VIEW** granted, or - To have the permission **COUNTERMEASURE_UPDATE** granted.
### Example
```java
// Import classes:
//import io.swagger.client.ApiException;
//import io.swagger.client.api.ProductsApi;
ProductsApi apiInstance = new ProductsApi();
String apiToken = "apiToken_example"; // String | Authentication token
String ref = "ref_example"; // String | ID for product
try {
List result = apiInstance.productsRefControlsRequiredGet(apiToken, ref);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling ProductsApi#productsRefControlsRequiredGet");
e.printStackTrace();
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**apiToken** | **String**| Authentication token |
**ref** | **String**| ID for product |
### Return type
[**List<ComponentControl>**](ComponentControl.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
# **productsRefDelete**
> productsRefDelete(apiToken, ref)
Deletes a product
Deletes a product. Conditions to be able to perform the action: - To have the permission **PRODUCT_DELETE** granted.
### Example
```java
// Import classes:
//import io.swagger.client.ApiException;
//import io.swagger.client.api.ProductsApi;
ProductsApi apiInstance = new ProductsApi();
String apiToken = "apiToken_example"; // String | Authentication token
String ref = "ref_example"; // String | ID for product
try {
apiInstance.productsRefDelete(apiToken, ref);
} catch (ApiException e) {
System.err.println("Exception when calling ProductsApi#productsRefDelete");
e.printStackTrace();
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**apiToken** | **String**| Authentication token |
**ref** | **String**| ID for product |
### Return type
null (empty response body)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
# **productsRefDiagramImageGet**
> String productsRefDiagramImageGet(apiToken, ref)
Gets diagram image for product.
Gets a an image in png format of the product diagram. Conditions to be able to perform the action: - No special permissions are required to perform this action. - This API call can be used only if the user who performs the call has visibility over the product.
### Example
```java
// Import classes:
//import io.swagger.client.ApiException;
//import io.swagger.client.api.ProductsApi;
ProductsApi apiInstance = new ProductsApi();
String apiToken = "apiToken_example"; // String | Authentication token
String ref = "ref_example"; // String | ID for product
try {
String result = apiInstance.productsRefDiagramImageGet(apiToken, ref);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling ProductsApi#productsRefDiagramImageGet");
e.printStackTrace();
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**apiToken** | **String**| Authentication token |
**ref** | **String**| ID for product |
### Return type
**String**
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
# **productsRefGet**
> Product productsRefGet(apiToken, ref)
Gets product details
Gets the details of a product. Conditions to be able to perform the action: - No permissions are required to perform this action.
### Example
```java
// Import classes:
//import io.swagger.client.ApiException;
//import io.swagger.client.api.ProductsApi;
ProductsApi apiInstance = new ProductsApi();
String apiToken = "apiToken_example"; // String | Authentication token
String ref = "ref_example"; // String | ID for product
try {
Product result = apiInstance.productsRefGet(apiToken, ref);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling ProductsApi#productsRefGet");
e.printStackTrace();
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**apiToken** | **String**| Authentication token |
**ref** | **String**| ID for product |
### Return type
[**Product**](Product.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
# **productsRefGroupsDelete**
> InlineResponse200 productsRefGroupsDelete(apiToken, ref, unassignGroupsProductRequestBody)
Unassigns a list of user groups from a product.
Unassigns a list of user groups from a product. Conditions to be able to perform the action: - To have the permission **PRODUCT_UPDATE** granted.
### Example
```java
// Import classes:
//import io.swagger.client.ApiException;
//import io.swagger.client.api.ProductsApi;
ProductsApi apiInstance = new ProductsApi();
String apiToken = "apiToken_example"; // String | Authentication token
String ref = "ref_example"; // String | Reference for product
UnassignGroupsProductRequestBody unassignGroupsProductRequestBody = new UnassignGroupsProductRequestBody(); // UnassignGroupsProductRequestBody | JSON object that contains information to unassign groups from a product
try {
InlineResponse200 result = apiInstance.productsRefGroupsDelete(apiToken, ref, unassignGroupsProductRequestBody);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling ProductsApi#productsRefGroupsDelete");
e.printStackTrace();
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**apiToken** | **String**| Authentication token |
**ref** | **String**| Reference for product |
**unassignGroupsProductRequestBody** | [**UnassignGroupsProductRequestBody**](UnassignGroupsProductRequestBody.md)| JSON object that contains information to unassign groups from a product |
### Return type
[**InlineResponse200**](InlineResponse200.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
# **productsRefGroupsGet**
> List<String> productsRefGroupsGet(apiToken, ref)
List all groups assigned to a product
List all groups assigned to a product. Conditions to be able to perform the action: - If the caller has the PRODUCTS_LIST_ALL permission then all products can be queried without restriction. - Without the PRODUCTS_LIST_ALL permission, the call will only return the groups if the caller belongs to that product.
### Example
```java
// Import classes:
//import io.swagger.client.ApiException;
//import io.swagger.client.api.ProductsApi;
ProductsApi apiInstance = new ProductsApi();
String apiToken = "apiToken_example"; // String | Authentication token
String ref = "ref_example"; // String | Reference to product
try {
List result = apiInstance.productsRefGroupsGet(apiToken, ref);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling ProductsApi#productsRefGroupsGet");
e.printStackTrace();
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**apiToken** | **String**| Authentication token |
**ref** | **String**| Reference to product |
### Return type
**List<String>**
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
# **productsRefGroupsPut**
> ProductShortGroups productsRefGroupsPut(apiToken, ref, assignGroupsProductRequestBody)
Assigns groups of users to a product.
Assigns groups of users to a product. Conditions to be able to perform the action: - To have the permission **PRODUCT_UPDATE** granted.
### Example
```java
// Import classes:
//import io.swagger.client.ApiException;
//import io.swagger.client.api.ProductsApi;
ProductsApi apiInstance = new ProductsApi();
String apiToken = "apiToken_example"; // String | Authentication token
String ref = "ref_example"; // String | Reference for product
AssignGroupsProductRequestBody assignGroupsProductRequestBody = new AssignGroupsProductRequestBody(); // AssignGroupsProductRequestBody | JSON object that contains information to assign groups to product
try {
ProductShortGroups result = apiInstance.productsRefGroupsPut(apiToken, ref, assignGroupsProductRequestBody);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling ProductsApi#productsRefGroupsPut");
e.printStackTrace();
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**apiToken** | **String**| Authentication token |
**ref** | **String**| Reference for product |
**assignGroupsProductRequestBody** | [**AssignGroupsProductRequestBody**](AssignGroupsProductRequestBody.md)| JSON object that contains information to assign groups to product |
### Return type
[**ProductShortGroups**](ProductShortGroups.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
# **productsRefPut**
> productsRefPut(apiToken, ref, updateProductRequestBody)
Updates a product
Updates the details of a product. Conditions to be able to perform the action: - To have the permission **PRODUCT_UPDATE** granted.
### Example
```java
// Import classes:
//import io.swagger.client.ApiException;
//import io.swagger.client.api.ProductsApi;
ProductsApi apiInstance = new ProductsApi();
String apiToken = "apiToken_example"; // String | Authentication token
String ref = "ref_example"; // String | ID for product
UpdateProduct updateProductRequestBody = new UpdateProduct(); // UpdateProduct | JSON data that contains product details to update
try {
apiInstance.productsRefPut(apiToken, ref, updateProductRequestBody);
} catch (ApiException e) {
System.err.println("Exception when calling ProductsApi#productsRefPut");
e.printStackTrace();
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**apiToken** | **String**| Authentication token |
**ref** | **String**| ID for product |
**updateProductRequestBody** | [**UpdateProduct**](UpdateProduct.md)| JSON data that contains product details to update |
### Return type
null (empty response body)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
# **productsRefRisksGet**
> RiskSummary productsRefRisksGet(apiToken, ref)
Gets the risks summary of a product
This endpoint returns a summary of the risks of a product. Conditions to be able to perform the action: - No permissions are required to perform this action.
### Example
```java
// Import classes:
//import io.swagger.client.ApiException;
//import io.swagger.client.api.ProductsApi;
ProductsApi apiInstance = new ProductsApi();
String apiToken = "apiToken_example"; // String | Authentication token
String ref = "ref_example"; // String | ID for product
try {
RiskSummary result = apiInstance.productsRefRisksGet(apiToken, ref);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling ProductsApi#productsRefRisksGet");
e.printStackTrace();
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**apiToken** | **String**| Authentication token |
**ref** | **String**| ID for product |
### Return type
[**RiskSummary**](RiskSummary.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
# **productsRefTestsTestTypeUploadPost**
> InlineResponse2011 productsRefTestsTestTypeUploadPost(apiToken, ref, testType, fileName)
Imports test results from different sources to a product.
Imports test results from different sources (OWASP ZAP, Cucumber, Micro Focus Fortify) uploading files. More than one file can be attached to the call. Conditions to be able to perform the action: - To have the permission **TEST_UPDATE** granted.
### Example
```java
// Import classes:
//import io.swagger.client.ApiException;
//import io.swagger.client.api.ProductsApi;
ProductsApi apiInstance = new ProductsApi();
String apiToken = "apiToken_example"; // String | Authentication token
String ref = "ref_example"; // String | ID for product
String testType = "testType_example"; // String | Type of test to be imported (zap|cucumber|junit|hp-fortify)
File fileName = new File("/path/to/file.txt"); // File | File to upload
try {
InlineResponse2011 result = apiInstance.productsRefTestsTestTypeUploadPost(apiToken, ref, testType, fileName);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling ProductsApi#productsRefTestsTestTypeUploadPost");
e.printStackTrace();
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**apiToken** | **String**| Authentication token |
**ref** | **String**| ID for product |
**testType** | **String**| Type of test to be imported (zap|cucumber|junit|hp-fortify) | [enum: zap, cucumber, junit, hp-fortify]
**fileName** | **File**| File to upload | [optional]
### Return type
[**InlineResponse2011**](InlineResponse2011.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: multipart/form-data
- **Accept**: application/json
# **productsRefThreatsGet**
> List<ComponentUseCaseThreatShort> productsRefThreatsGet(apiToken, ref)
Gets a list of all threats of a product
Returns a list of all the threats of a product. Conditions to be able to perform the action: - To have the permission **THREAT_VIEW** granted, or - To have the permission **THREAT_UPDATE** granted.
### Example
```java
// Import classes:
//import io.swagger.client.ApiException;
//import io.swagger.client.api.ProductsApi;
ProductsApi apiInstance = new ProductsApi();
String apiToken = "apiToken_example"; // String | Authentication token
String ref = "ref_example"; // String | ID for product
try {
List result = apiInstance.productsRefThreatsGet(apiToken, ref);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling ProductsApi#productsRefThreatsGet");
e.printStackTrace();
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**apiToken** | **String**| Authentication token |
**ref** | **String**| ID for product |
### Return type
[**List<ComponentUseCaseThreatShort>**](ComponentUseCaseThreatShort.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
# **productsRefUsersDelete**
> productsRefUsersDelete(apiToken, ref, unassignUsersProductRequestBody)
Unassigns a list of users from a product.
Unassign a list of users from a product. Conditions to be able to perform the action: - To have the permission **PRODUCT_UPDATE** granted.
### Example
```java
// Import classes:
//import io.swagger.client.ApiException;
//import io.swagger.client.api.ProductsApi;
ProductsApi apiInstance = new ProductsApi();
String apiToken = "apiToken_example"; // String | Authentication token
String ref = "ref_example"; // String | Reference for product
UnassignUsersProductRequestBody unassignUsersProductRequestBody = new UnassignUsersProductRequestBody(); // UnassignUsersProductRequestBody | JSON object that contains information to unassign users from product
try {
apiInstance.productsRefUsersDelete(apiToken, ref, unassignUsersProductRequestBody);
} catch (ApiException e) {
System.err.println("Exception when calling ProductsApi#productsRefUsersDelete");
e.printStackTrace();
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**apiToken** | **String**| Authentication token |
**ref** | **String**| Reference for product |
**unassignUsersProductRequestBody** | [**UnassignUsersProductRequestBody**](UnassignUsersProductRequestBody.md)| JSON object that contains information to unassign users from product |
### Return type
null (empty response body)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
# **productsRefUsersGet**
> List<String> productsRefUsersGet(apiToken, ref)
List all users assigned to a product
List all users assigned to a product. Conditions to be able to perform the action: - No permissions are required to perform this action.
### Example
```java
// Import classes:
//import io.swagger.client.ApiException;
//import io.swagger.client.api.ProductsApi;
ProductsApi apiInstance = new ProductsApi();
String apiToken = "apiToken_example"; // String | Authentication token
String ref = "ref_example"; // String | Reference to product
try {
List result = apiInstance.productsRefUsersGet(apiToken, ref);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling ProductsApi#productsRefUsersGet");
e.printStackTrace();
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**apiToken** | **String**| Authentication token |
**ref** | **String**| Reference to product |
### Return type
**List<String>**
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
# **productsRefUsersPut**
> ProductShortUsers productsRefUsersPut(apiToken, ref, assignUsersProductRequestBody)
Assigns users to a product.
Assigns users to a product. Conditions to be able to perform the action: - To have the permission **PRODUCT_UPDATE** granted.
### Example
```java
// Import classes:
//import io.swagger.client.ApiException;
//import io.swagger.client.api.ProductsApi;
ProductsApi apiInstance = new ProductsApi();
String apiToken = "apiToken_example"; // String | Authentication token
String ref = "ref_example"; // String | Reference for product
AssignUsersProductRequestBody assignUsersProductRequestBody = new AssignUsersProductRequestBody(); // AssignUsersProductRequestBody | JSON data that contains the information to assign users to product
try {
ProductShortUsers result = apiInstance.productsRefUsersPut(apiToken, ref, assignUsersProductRequestBody);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling ProductsApi#productsRefUsersPut");
e.printStackTrace();
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**apiToken** | **String**| Authentication token |
**ref** | **String**| Reference for product |
**assignUsersProductRequestBody** | [**AssignUsersProductRequestBody**](AssignUsersProductRequestBody.md)| JSON data that contains the information to assign users to product |
### Return type
[**ProductShortUsers**](ProductShortUsers.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
# **productsRefUsersUserDelete**
> productsRefUsersUserDelete(apiToken, ref, user)
Unassigns a user from a product
Unassigns a user from a product. Conditions to be able to perform the action: - To have the permission **PRODUCT_UPDATE** granted.
### Example
```java
// Import classes:
//import io.swagger.client.ApiException;
//import io.swagger.client.api.ProductsApi;
ProductsApi apiInstance = new ProductsApi();
String apiToken = "apiToken_example"; // String | Authentication token
String ref = "ref_example"; // String | Reference for product
String user = "user_example"; // String | Username of the user who will be unassigned from the product
try {
apiInstance.productsRefUsersUserDelete(apiToken, ref, user);
} catch (ApiException e) {
System.err.println("Exception when calling ProductsApi#productsRefUsersUserDelete");
e.printStackTrace();
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**apiToken** | **String**| Authentication token |
**ref** | **String**| Reference for product |
**user** | **String**| Username of the user who will be unassigned from the product |
### Return type
null (empty response body)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
# **productsRefWeaknessesGet**
> List<ComponentWeakness> productsRefWeaknessesGet(apiToken, ref)
Gets a list of all weaknesses of a product
Returns a list of all the weaknesses of a product. Conditions to be able to perform the action: - To have the permission **THREAT_VIEW** granted, or - To have the permission **THREAT_UPDATE** granted.
### Example
```java
// Import classes:
//import io.swagger.client.ApiException;
//import io.swagger.client.api.ProductsApi;
ProductsApi apiInstance = new ProductsApi();
String apiToken = "apiToken_example"; // String | Authentication token
String ref = "ref_example"; // String | ID for product
try {
List result = apiInstance.productsRefWeaknessesGet(apiToken, ref);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling ProductsApi#productsRefWeaknessesGet");
e.printStackTrace();
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**apiToken** | **String**| Authentication token |
**ref** | **String**| ID for product |
### Return type
[**List<ComponentWeakness>**](ComponentWeakness.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
# **productsRefWeaknessesTestStateGet**
> List<ComponentWeakness> productsRefWeaknessesTestStateGet(apiToken, ref, testState)
Gets a list of all weaknesses of a product filtered by test state
Returns a list of all the weaknesses of a product. With the optional parameter `test_state` can filter the weakness by test state. Conditions to be able to perform the action: - To have the permission **THREAT_VIEW** granted, or - To have the permission **THREAT_UPDATE** granted.
### Example
```java
// Import classes:
//import io.swagger.client.ApiException;
//import io.swagger.client.api.ProductsApi;
ProductsApi apiInstance = new ProductsApi();
String apiToken = "apiToken_example"; // String | Authentication token
String ref = "ref_example"; // String | ID for product
String testState = "testState_example"; // String | Code for a test state
try {
List result = apiInstance.productsRefWeaknessesTestStateGet(apiToken, ref, testState);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling ProductsApi#productsRefWeaknessesTestStateGet");
e.printStackTrace();
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**apiToken** | **String**| Authentication token |
**ref** | **String**| ID for product |
**testState** | **String**| Code for a test state | [enum: failed, error, not-tested, passed, not-applicable, partially-tested]
### Return type
[**List<ComponentWeakness>**](ComponentWeakness.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
# **productsUploadPost**
> ProductShort productsUploadPost(apiToken, ref, name, fileName, type)
Creates a new product, library or template from a XML file upload.
Creates a new product, library or template from a XML file upload. Conditions to be able to perform the action: - To have the permission **PRODUCT_CREATE** granted allows to create a product. - To have the permission **LIBRARY_UPDATE** granted allows to create a library. - To have the permission **TEMPLATE_UPDATE** granted allows to create a template.
### Example
```java
// Import classes:
//import io.swagger.client.ApiException;
//import io.swagger.client.api.ProductsApi;
ProductsApi apiInstance = new ProductsApi();
String apiToken = "apiToken_example"; // String | Authentication token
String ref = "ref_example"; // String | Product ref
String name = "name_example"; // String | Product name
File fileName = new File("/path/to/file.txt"); // File | File to upload in XML format
String type = "type_example"; // String | Product type - STANDARD (By default), TEMPLATE or LIBRARY
try {
ProductShort result = apiInstance.productsUploadPost(apiToken, ref, name, fileName, type);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling ProductsApi#productsUploadPost");
e.printStackTrace();
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**apiToken** | **String**| Authentication token |
**ref** | **String**| Product ref |
**name** | **String**| Product name |
**fileName** | **File**| File to upload in XML format |
**type** | **String**| Product type - STANDARD (By default), TEMPLATE or LIBRARY | [optional]
### Return type
[**ProductShort**](ProductShort.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: multipart/form-data
- **Accept**: application/json
# **productsUploadRefPost**
> ProductShort productsUploadRefPost(apiToken, ref, fileName, deleteCountermeasures)
Updates an existing product from a XML file upload.
Updates a product from a XML file upload. Conditions to be able to perform the action: - To have the permission **PRODUCT_UPDATE** granted allows to update a product.
### Example
```java
// Import classes:
//import io.swagger.client.ApiException;
//import io.swagger.client.api.ProductsApi;
ProductsApi apiInstance = new ProductsApi();
String apiToken = "apiToken_example"; // String | Authentication token
String ref = "ref_example"; // String | ID for product
File fileName = new File("/path/to/file.txt"); // File | File to upload in XML format
String deleteCountermeasures = "deleteCountermeasures_example"; // String | This flag indicates if the rules execution will delete the threat and countermeasures which don't apply to the new product threat model. If true, the threats and countermeasures will be automatically removed from the model. If false, the threats and countermeasures won't be removed from the model.
try {
ProductShort result = apiInstance.productsUploadRefPost(apiToken, ref, fileName, deleteCountermeasures);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling ProductsApi#productsUploadRefPost");
e.printStackTrace();
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**apiToken** | **String**| Authentication token |
**ref** | **String**| ID for product |
**fileName** | **File**| File to upload in XML format |
**deleteCountermeasures** | **String**| This flag indicates if the rules execution will delete the threat and countermeasures which don't apply to the new product threat model. If true, the threats and countermeasures will be automatically removed from the model. If false, the threats and countermeasures won't be removed from the model. | [optional]
### Return type
[**ProductShort**](ProductShort.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: multipart/form-data
- **Accept**: application/json
# **rulesProductRefPut**
> rulesProductRefPut(apiToken, ref, deleteCountermeasures)
Executes rules by a product
Execute the rules engine for a product and for all components within the product. If the deleteCountermeasures parameter is true, then threats and countermeasure that no longer apply to the model will automatically be removed. If it is false, then those threats and countermeasures will remain in the model. - To have the permission **ARCHITECTURE_UPDATE** granted.
### Example
```java
// Import classes:
//import io.swagger.client.ApiException;
//import io.swagger.client.api.ProductsApi;
ProductsApi apiInstance = new ProductsApi();
String apiToken = "apiToken_example"; // String | Authentication token
String ref = "ref_example"; // String | ID for Product
String deleteCountermeasures = "deleteCountermeasures_example"; // String | This flag indicates if the rules execution will delete the threat and countermeasures which don't apply to the new product threat model. If true, the threats and countermeasures will be automatically removed from the model. If false, the threats and countermeasures won't be removed from the model.
try {
apiInstance.rulesProductRefPut(apiToken, ref, deleteCountermeasures);
} catch (ApiException e) {
System.err.println("Exception when calling ProductsApi#rulesProductRefPut");
e.printStackTrace();
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**apiToken** | **String**| Authentication token |
**ref** | **String**| ID for Product |
**deleteCountermeasures** | **String**| This flag indicates if the rules execution will delete the threat and countermeasures which don't apply to the new product threat model. If true, the threats and countermeasures will be automatically removed from the model. If false, the threats and countermeasures won't be removed from the model. | [optional]
### Return type
null (empty response body)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json