# UseCasesApi All URIs are relative to *https://demo.iriusrisk.com/api/v1* Method | HTTP request | Description ------------- | ------------- | ------------- [**librariesLibraryRefRiskpatternsRiskPatternRefUsecasesPost**](UseCasesApi.md#librariesLibraryRefRiskpatternsRiskPatternRefUsecasesPost) | **POST** /libraries/{libraryRef}/riskpatterns/{riskPatternRef}/usecases | Creates new use case in a library. [**librariesLibraryRefRiskpatternsRiskPatternRefUsecasesUseCaseRefThreatsThreatRefCountermeasuresPut**](UseCasesApi.md#librariesLibraryRefRiskpatternsRiskPatternRefUsecasesUseCaseRefThreatsThreatRefCountermeasuresPut) | **PUT** /libraries/{libraryRef}/riskpatterns/{riskPatternRef}/usecases/{useCaseRef}/threats/{threatRef}/countermeasures | Associates a countermeasure to a threat in a risk pattern. [**librariesLibraryRefRiskpatternsRiskPatternRefUsecasesUseCaseRefThreatsThreatRefWeaknessesPut**](UseCasesApi.md#librariesLibraryRefRiskpatternsRiskPatternRefUsecasesUseCaseRefThreatsThreatRefWeaknessesPut) | **PUT** /libraries/{libraryRef}/riskpatterns/{riskPatternRef}/usecases/{useCaseRef}/threats/{threatRef}/weaknesses | Associates weakness to a threat in a risk pattern. [**librariesLibraryRefRiskpatternsRiskPatternRefUsecasesUseCaseRefThreatsThreatRefWeaknessesWeaknessRefCountermeasuresPut**](UseCasesApi.md#librariesLibraryRefRiskpatternsRiskPatternRefUsecasesUseCaseRefThreatsThreatRefWeaknessesWeaknessRefCountermeasuresPut) | **PUT** /libraries/{libraryRef}/riskpatterns/{riskPatternRef}/usecases/{useCaseRef}/threats/{threatRef}/weaknesses/{weaknessRef}/countermeasures | Associates a countermeasure to a weakness in a risk pattern. # **librariesLibraryRefRiskpatternsRiskPatternRefUsecasesPost** > LibraryUseCase librariesLibraryRefRiskpatternsRiskPatternRefUsecasesPost(apiToken, libraryRef, riskPatternRef, createUseCaseLibraryRequestBody) Creates new use case in a library. Creates new use case in a library. Conditions to be able to perform the action: - To have the permission **LIBRARY_UPDATE** granted. ### Example ```java // Import classes: //import io.swagger.client.ApiException; //import io.swagger.client.api.UseCasesApi; UseCasesApi apiInstance = new UseCasesApi(); String apiToken = "apiToken_example"; // String | Authentication token String libraryRef = "libraryRef_example"; // String | Reference for library String riskPatternRef = "riskPatternRef_example"; // String | Reference for Risk Pattern CreateUseCaseLibraryRequestBody createUseCaseLibraryRequestBody = new CreateUseCaseLibraryRequestBody(); // CreateUseCaseLibraryRequestBody | JSON data that contains information of the fields try { LibraryUseCase result = apiInstance.librariesLibraryRefRiskpatternsRiskPatternRefUsecasesPost(apiToken, libraryRef, riskPatternRef, createUseCaseLibraryRequestBody); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling UseCasesApi#librariesLibraryRefRiskpatternsRiskPatternRefUsecasesPost"); e.printStackTrace(); } ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **apiToken** | **String**| Authentication token | **libraryRef** | **String**| Reference for library | **riskPatternRef** | **String**| Reference for Risk Pattern | **createUseCaseLibraryRequestBody** | [**CreateUseCaseLibraryRequestBody**](CreateUseCaseLibraryRequestBody.md)| JSON data that contains information of the fields | ### Return type [**LibraryUseCase**](LibraryUseCase.md) ### Authorization No authorization required ### HTTP request headers - **Content-Type**: application/json - **Accept**: application/json # **librariesLibraryRefRiskpatternsRiskPatternRefUsecasesUseCaseRefThreatsThreatRefCountermeasuresPut** > LibraryControl librariesLibraryRefRiskpatternsRiskPatternRefUsecasesUseCaseRefThreatsThreatRefCountermeasuresPut(apiToken, libraryRef, riskPatternRef, useCaseRef, threatRef, associateCountermeasureThreatLibraryRequestBody) Associates a countermeasure to a threat in a risk pattern. Associates a countermeasure to a threat in a risk pattern. Conditions to be able to perform the action: - To have the permission **LIBRARY_UPDATE** granted. ### Example ```java // Import classes: //import io.swagger.client.ApiException; //import io.swagger.client.api.UseCasesApi; UseCasesApi apiInstance = new UseCasesApi(); String apiToken = "apiToken_example"; // String | Authentication token String libraryRef = "libraryRef_example"; // String | Reference for library String riskPatternRef = "riskPatternRef_example"; // String | Reference for Risk Pattern String useCaseRef = "useCaseRef_example"; // String | Reference for Use Case String threatRef = "threatRef_example"; // String | Reference for Threat AssociateCountermeasureThreatLibraryRequestBody associateCountermeasureThreatLibraryRequestBody = new AssociateCountermeasureThreatLibraryRequestBody(); // AssociateCountermeasureThreatLibraryRequestBody | JSON data that contains information of the fields try { LibraryControl result = apiInstance.librariesLibraryRefRiskpatternsRiskPatternRefUsecasesUseCaseRefThreatsThreatRefCountermeasuresPut(apiToken, libraryRef, riskPatternRef, useCaseRef, threatRef, associateCountermeasureThreatLibraryRequestBody); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling UseCasesApi#librariesLibraryRefRiskpatternsRiskPatternRefUsecasesUseCaseRefThreatsThreatRefCountermeasuresPut"); e.printStackTrace(); } ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **apiToken** | **String**| Authentication token | **libraryRef** | **String**| Reference for library | **riskPatternRef** | **String**| Reference for Risk Pattern | **useCaseRef** | **String**| Reference for Use Case | **threatRef** | **String**| Reference for Threat | **associateCountermeasureThreatLibraryRequestBody** | [**AssociateCountermeasureThreatLibraryRequestBody**](AssociateCountermeasureThreatLibraryRequestBody.md)| JSON data that contains information of the fields | ### Return type [**LibraryControl**](LibraryControl.md) ### Authorization No authorization required ### HTTP request headers - **Content-Type**: application/json - **Accept**: application/json # **librariesLibraryRefRiskpatternsRiskPatternRefUsecasesUseCaseRefThreatsThreatRefWeaknessesPut** > LibraryWeakness librariesLibraryRefRiskpatternsRiskPatternRefUsecasesUseCaseRefThreatsThreatRefWeaknessesPut(apiToken, libraryRef, riskPatternRef, useCaseRef, threatRef, associateWeaknessThreatLibraryRequestBody) Associates weakness to a threat in a risk pattern. Associates weakness to a threat in a risk pattern. Conditions to be able to perform the action: - To have the permission **LIBRARY_UPDATE** granted. ### Example ```java // Import classes: //import io.swagger.client.ApiException; //import io.swagger.client.api.UseCasesApi; UseCasesApi apiInstance = new UseCasesApi(); String apiToken = "apiToken_example"; // String | Authentication token String libraryRef = "libraryRef_example"; // String | Reference for library String riskPatternRef = "riskPatternRef_example"; // String | Reference for Risk Pattern String useCaseRef = "useCaseRef_example"; // String | Reference for Use Case String threatRef = "threatRef_example"; // String | Reference for Threat AssociateWeaknessThreatLibraryRequestBody associateWeaknessThreatLibraryRequestBody = new AssociateWeaknessThreatLibraryRequestBody(); // AssociateWeaknessThreatLibraryRequestBody | JSON data that contains information of the fields try { LibraryWeakness result = apiInstance.librariesLibraryRefRiskpatternsRiskPatternRefUsecasesUseCaseRefThreatsThreatRefWeaknessesPut(apiToken, libraryRef, riskPatternRef, useCaseRef, threatRef, associateWeaknessThreatLibraryRequestBody); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling UseCasesApi#librariesLibraryRefRiskpatternsRiskPatternRefUsecasesUseCaseRefThreatsThreatRefWeaknessesPut"); e.printStackTrace(); } ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **apiToken** | **String**| Authentication token | **libraryRef** | **String**| Reference for library | **riskPatternRef** | **String**| Reference for Risk Pattern | **useCaseRef** | **String**| Reference for Use Case | **threatRef** | **String**| Reference for Threat | **associateWeaknessThreatLibraryRequestBody** | [**AssociateWeaknessThreatLibraryRequestBody**](AssociateWeaknessThreatLibraryRequestBody.md)| JSON data that contains information of the fields | ### Return type [**LibraryWeakness**](LibraryWeakness.md) ### Authorization No authorization required ### HTTP request headers - **Content-Type**: application/json - **Accept**: application/json # **librariesLibraryRefRiskpatternsRiskPatternRefUsecasesUseCaseRefThreatsThreatRefWeaknessesWeaknessRefCountermeasuresPut** > LibraryControl librariesLibraryRefRiskpatternsRiskPatternRefUsecasesUseCaseRefThreatsThreatRefWeaknessesWeaknessRefCountermeasuresPut(apiToken, libraryRef, riskPatternRef, useCaseRef, threatRef, weaknessRef, associateCountermeasureWeaknessLibraryRequestBody) Associates a countermeasure to a weakness in a risk pattern. Associates a countermeasure to a weakness in a risk pattern. Conditions to be able to perform the action: - To have the permission **LIBRARY_UPDATE** granted. ### Example ```java // Import classes: //import io.swagger.client.ApiException; //import io.swagger.client.api.UseCasesApi; UseCasesApi apiInstance = new UseCasesApi(); String apiToken = "apiToken_example"; // String | Authentication token String libraryRef = "libraryRef_example"; // String | Reference for library String riskPatternRef = "riskPatternRef_example"; // String | Reference for Risk Pattern String useCaseRef = "useCaseRef_example"; // String | Reference for Use Case String threatRef = "threatRef_example"; // String | Reference for Threat String weaknessRef = "weaknessRef_example"; // String | Reference for Weakness AssociateCountermeasureWeaknessLibraryRequestBody associateCountermeasureWeaknessLibraryRequestBody = new AssociateCountermeasureWeaknessLibraryRequestBody(); // AssociateCountermeasureWeaknessLibraryRequestBody | JSON data that contains information of the fields try { LibraryControl result = apiInstance.librariesLibraryRefRiskpatternsRiskPatternRefUsecasesUseCaseRefThreatsThreatRefWeaknessesWeaknessRefCountermeasuresPut(apiToken, libraryRef, riskPatternRef, useCaseRef, threatRef, weaknessRef, associateCountermeasureWeaknessLibraryRequestBody); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling UseCasesApi#librariesLibraryRefRiskpatternsRiskPatternRefUsecasesUseCaseRefThreatsThreatRefWeaknessesWeaknessRefCountermeasuresPut"); e.printStackTrace(); } ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **apiToken** | **String**| Authentication token | **libraryRef** | **String**| Reference for library | **riskPatternRef** | **String**| Reference for Risk Pattern | **useCaseRef** | **String**| Reference for Use Case | **threatRef** | **String**| Reference for Threat | **weaknessRef** | **String**| Reference for Weakness | **associateCountermeasureWeaknessLibraryRequestBody** | [**AssociateCountermeasureWeaknessLibraryRequestBody**](AssociateCountermeasureWeaknessLibraryRequestBody.md)| JSON data that contains information of the fields | ### Return type [**LibraryControl**](LibraryControl.md) ### Authorization No authorization required ### HTTP request headers - **Content-Type**: application/json - **Accept**: application/json