|
11 | 11 | import com.datadog.api.client.v2.model.CaseEmptyRequest; |
12 | 12 | import com.datadog.api.client.v2.model.CaseResponse; |
13 | 13 | import com.datadog.api.client.v2.model.CaseSortableField; |
| 14 | +import com.datadog.api.client.v2.model.CaseUpdateAttributesRequest; |
14 | 15 | import com.datadog.api.client.v2.model.CaseUpdatePriorityRequest; |
15 | 16 | import com.datadog.api.client.v2.model.CaseUpdateStatusRequest; |
16 | 17 | import com.datadog.api.client.v2.model.CasesResponse; |
@@ -1740,6 +1741,164 @@ public CompletableFuture<ApiResponse<CaseResponse>> unassignCaseWithHttpInfoAsyn |
1740 | 1741 | new GenericType<CaseResponse>() {}); |
1741 | 1742 | } |
1742 | 1743 |
|
| 1744 | + /** |
| 1745 | + * Update case attributes. |
| 1746 | + * |
| 1747 | + * <p>See {@link #updateAttributesWithHttpInfo}. |
| 1748 | + * |
| 1749 | + * @param caseId Case's UUID or key (required) |
| 1750 | + * @param body Case attributes update payload (required) |
| 1751 | + * @return CaseResponse |
| 1752 | + * @throws ApiException if fails to make API call |
| 1753 | + */ |
| 1754 | + public CaseResponse updateAttributes(String caseId, CaseUpdateAttributesRequest body) |
| 1755 | + throws ApiException { |
| 1756 | + return updateAttributesWithHttpInfo(caseId, body).getData(); |
| 1757 | + } |
| 1758 | + |
| 1759 | + /** |
| 1760 | + * Update case attributes. |
| 1761 | + * |
| 1762 | + * <p>See {@link #updateAttributesWithHttpInfoAsync}. |
| 1763 | + * |
| 1764 | + * @param caseId Case's UUID or key (required) |
| 1765 | + * @param body Case attributes update payload (required) |
| 1766 | + * @return CompletableFuture<CaseResponse> |
| 1767 | + */ |
| 1768 | + public CompletableFuture<CaseResponse> updateAttributesAsync( |
| 1769 | + String caseId, CaseUpdateAttributesRequest body) { |
| 1770 | + return updateAttributesWithHttpInfoAsync(caseId, body) |
| 1771 | + .thenApply( |
| 1772 | + response -> { |
| 1773 | + return response.getData(); |
| 1774 | + }); |
| 1775 | + } |
| 1776 | + |
| 1777 | + /** |
| 1778 | + * Update case attributes |
| 1779 | + * |
| 1780 | + * @param caseId Case's UUID or key (required) |
| 1781 | + * @param body Case attributes update payload (required) |
| 1782 | + * @return ApiResponse<CaseResponse> |
| 1783 | + * @throws ApiException if fails to make API call |
| 1784 | + * @http.response.details |
| 1785 | + * <table border="1"> |
| 1786 | + * <caption>Response details</caption> |
| 1787 | + * <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> |
| 1788 | + * <tr><td> 200 </td><td> OK </td><td> - </td></tr> |
| 1789 | + * <tr><td> 400 </td><td> Bad Request </td><td> - </td></tr> |
| 1790 | + * <tr><td> 401 </td><td> Unauthorized </td><td> - </td></tr> |
| 1791 | + * <tr><td> 403 </td><td> Forbidden </td><td> - </td></tr> |
| 1792 | + * <tr><td> 404 </td><td> Not Found </td><td> - </td></tr> |
| 1793 | + * <tr><td> 429 </td><td> Too many requests </td><td> - </td></tr> |
| 1794 | + * </table> |
| 1795 | + */ |
| 1796 | + public ApiResponse<CaseResponse> updateAttributesWithHttpInfo( |
| 1797 | + String caseId, CaseUpdateAttributesRequest body) throws ApiException { |
| 1798 | + Object localVarPostBody = body; |
| 1799 | + |
| 1800 | + // verify the required parameter 'caseId' is set |
| 1801 | + if (caseId == null) { |
| 1802 | + throw new ApiException( |
| 1803 | + 400, "Missing the required parameter 'caseId' when calling updateAttributes"); |
| 1804 | + } |
| 1805 | + |
| 1806 | + // verify the required parameter 'body' is set |
| 1807 | + if (body == null) { |
| 1808 | + throw new ApiException( |
| 1809 | + 400, "Missing the required parameter 'body' when calling updateAttributes"); |
| 1810 | + } |
| 1811 | + // create path and map variables |
| 1812 | + String localVarPath = |
| 1813 | + "/api/v2/cases/{case_id}/attributes" |
| 1814 | + .replaceAll("\\{" + "case_id" + "\\}", apiClient.escapeString(caseId.toString())); |
| 1815 | + |
| 1816 | + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); |
| 1817 | + |
| 1818 | + Invocation.Builder builder = |
| 1819 | + apiClient.createBuilder( |
| 1820 | + "v2.CaseManagementApi.updateAttributes", |
| 1821 | + localVarPath, |
| 1822 | + new ArrayList<Pair>(), |
| 1823 | + localVarHeaderParams, |
| 1824 | + new HashMap<String, String>(), |
| 1825 | + new String[] {"application/json"}, |
| 1826 | + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); |
| 1827 | + return apiClient.invokeAPI( |
| 1828 | + "POST", |
| 1829 | + builder, |
| 1830 | + localVarHeaderParams, |
| 1831 | + new String[] {"application/json"}, |
| 1832 | + localVarPostBody, |
| 1833 | + new HashMap<String, Object>(), |
| 1834 | + false, |
| 1835 | + new GenericType<CaseResponse>() {}); |
| 1836 | + } |
| 1837 | + |
| 1838 | + /** |
| 1839 | + * Update case attributes. |
| 1840 | + * |
| 1841 | + * <p>See {@link #updateAttributesWithHttpInfo}. |
| 1842 | + * |
| 1843 | + * @param caseId Case's UUID or key (required) |
| 1844 | + * @param body Case attributes update payload (required) |
| 1845 | + * @return CompletableFuture<ApiResponse<CaseResponse>> |
| 1846 | + */ |
| 1847 | + public CompletableFuture<ApiResponse<CaseResponse>> updateAttributesWithHttpInfoAsync( |
| 1848 | + String caseId, CaseUpdateAttributesRequest body) { |
| 1849 | + Object localVarPostBody = body; |
| 1850 | + |
| 1851 | + // verify the required parameter 'caseId' is set |
| 1852 | + if (caseId == null) { |
| 1853 | + CompletableFuture<ApiResponse<CaseResponse>> result = new CompletableFuture<>(); |
| 1854 | + result.completeExceptionally( |
| 1855 | + new ApiException( |
| 1856 | + 400, "Missing the required parameter 'caseId' when calling updateAttributes")); |
| 1857 | + return result; |
| 1858 | + } |
| 1859 | + |
| 1860 | + // verify the required parameter 'body' is set |
| 1861 | + if (body == null) { |
| 1862 | + CompletableFuture<ApiResponse<CaseResponse>> result = new CompletableFuture<>(); |
| 1863 | + result.completeExceptionally( |
| 1864 | + new ApiException( |
| 1865 | + 400, "Missing the required parameter 'body' when calling updateAttributes")); |
| 1866 | + return result; |
| 1867 | + } |
| 1868 | + // create path and map variables |
| 1869 | + String localVarPath = |
| 1870 | + "/api/v2/cases/{case_id}/attributes" |
| 1871 | + .replaceAll("\\{" + "case_id" + "\\}", apiClient.escapeString(caseId.toString())); |
| 1872 | + |
| 1873 | + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); |
| 1874 | + |
| 1875 | + Invocation.Builder builder; |
| 1876 | + try { |
| 1877 | + builder = |
| 1878 | + apiClient.createBuilder( |
| 1879 | + "v2.CaseManagementApi.updateAttributes", |
| 1880 | + localVarPath, |
| 1881 | + new ArrayList<Pair>(), |
| 1882 | + localVarHeaderParams, |
| 1883 | + new HashMap<String, String>(), |
| 1884 | + new String[] {"application/json"}, |
| 1885 | + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); |
| 1886 | + } catch (ApiException ex) { |
| 1887 | + CompletableFuture<ApiResponse<CaseResponse>> result = new CompletableFuture<>(); |
| 1888 | + result.completeExceptionally(ex); |
| 1889 | + return result; |
| 1890 | + } |
| 1891 | + return apiClient.invokeAPIAsync( |
| 1892 | + "POST", |
| 1893 | + builder, |
| 1894 | + localVarHeaderParams, |
| 1895 | + new String[] {"application/json"}, |
| 1896 | + localVarPostBody, |
| 1897 | + new HashMap<String, Object>(), |
| 1898 | + false, |
| 1899 | + new GenericType<CaseResponse>() {}); |
| 1900 | + } |
| 1901 | + |
1743 | 1902 | /** |
1744 | 1903 | * Update case priority. |
1745 | 1904 | * |
|
0 commit comments