Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
184 changes: 184 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44827,6 +44827,57 @@ components:
required:
- data
type: object
ProjectFavorite:
description: Project favorite
properties:
id:
description: The project's identifier
example: d4bbe1af-f36e-42f1-87c1-493ca35c320e
type: string
relationships:
$ref: '#/components/schemas/ProjectFavoriteRelationships'
type:
$ref: '#/components/schemas/ProjectFavoriteResourceType'
required:
- id
- type
- relationships
type: object
ProjectFavoriteRelationships:
description: Project favorite relationships
properties:
user:
$ref: '#/components/schemas/ProjectFavoriteUserRelationship'
required:
- user
type: object
ProjectFavoriteResourceType:
description: Project favorite resource type
enum:
- project_favorite
example: project_favorite
type: string
x-enum-varnames:
- PROJECT_FAVORITE
ProjectFavoriteUserRelationship:
description: Relationship to user
properties:
data:
$ref: '#/components/schemas/UserRelationshipData'
required:
- data
type: object
ProjectFavoritesResponse:
description: Response with project favorites
properties:
data:
description: Array of project favorites
items:
$ref: '#/components/schemas/ProjectFavorite'
type: array
required:
- data
type: object
ProjectRelationship:
description: Relationship to project
properties:
Expand Down Expand Up @@ -85757,6 +85808,139 @@ paths:
tags:
- Rum Audience Management
x-unstable: '**Note**: This endpoint may be subject to changes.'
/api/v2/projects/favorites:
get:
description: Get all projects marked as favorite by the current user
operationId: ListUserProjectFavorites
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/ProjectFavoritesResponse'
description: OK
'400':
content:
application/json:
schema:
$ref: '#/components/schemas/JSONAPIErrorResponse'
description: Bad Request
'401':
content:
application/json:
schema:
$ref: '#/components/schemas/JSONAPIErrorResponse'
description: Unauthorized
'403':
content:
application/json:
schema:
$ref: '#/components/schemas/JSONAPIErrorResponse'
description: Forbidden
'429':
$ref: '#/components/responses/TooManyRequestsResponse'
security:
- apiKeyAuth: []
appKeyAuth: []
- AuthZ:
- cases_read
summary: Get user's project favorites
tags:
- Case Management
x-unstable: '**Note**: This endpoint is in preview and is subject to change.

If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).'
/api/v2/projects/{project_id}/favorites:
delete:
description: Remove a project from the current user's favorites
operationId: UnfavoriteProject
parameters:
- $ref: '#/components/parameters/ProjectIDPathParameter'
responses:
'204':
description: No Content
'400':
content:
application/json:
schema:
$ref: '#/components/schemas/JSONAPIErrorResponse'
description: Bad Request
'401':
content:
application/json:
schema:
$ref: '#/components/schemas/JSONAPIErrorResponse'
description: Unauthorized
'403':
content:
application/json:
schema:
$ref: '#/components/schemas/JSONAPIErrorResponse'
description: Forbidden
'404':
content:
application/json:
schema:
$ref: '#/components/schemas/JSONAPIErrorResponse'
description: Not Found
'429':
$ref: '#/components/responses/TooManyRequestsResponse'
security:
- apiKeyAuth: []
appKeyAuth: []
- AuthZ:
- cases_write
summary: Remove project from favorites
tags:
- Case Management
x-unstable: '**Note**: This endpoint is in preview and is subject to change.

If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).'
post:
description: Add a project to the current user's favorites
operationId: FavoriteProject
parameters:
- $ref: '#/components/parameters/ProjectIDPathParameter'
responses:
'204':
description: No Content
'400':
content:
application/json:
schema:
$ref: '#/components/schemas/JSONAPIErrorResponse'
description: Bad Request
'401':
content:
application/json:
schema:
$ref: '#/components/schemas/JSONAPIErrorResponse'
description: Unauthorized
'403':
content:
application/json:
schema:
$ref: '#/components/schemas/JSONAPIErrorResponse'
description: Forbidden
'404':
content:
application/json:
schema:
$ref: '#/components/schemas/JSONAPIErrorResponse'
description: Not Found
'429':
$ref: '#/components/responses/TooManyRequestsResponse'
security:
- apiKeyAuth: []
appKeyAuth: []
- AuthZ:
- cases_write
summary: Add project to favorites
tags:
- Case Management
x-unstable: '**Note**: This endpoint is in preview and is subject to change.

If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).'
/api/v2/query/scalar:
post:
description: 'Query scalar values (as seen on Query Value, Table, and Toplist
Expand Down
23 changes: 23 additions & 0 deletions examples/v2/case-management/FavoriteProject.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// Add project to favorites returns "No Content" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.CaseManagementApi;

public class Example {
public static void main(String[] args) {
ApiClient defaultClient = ApiClient.getDefaultApiClient();
defaultClient.setUnstableOperationEnabled("v2.favoriteProject", true);
CaseManagementApi apiInstance = new CaseManagementApi(defaultClient);

try {
apiInstance.favoriteProject("e555e290-ed65-49bd-ae18-8acbfcf18db7");
} catch (ApiException e) {
System.err.println("Exception when calling CaseManagementApi#favoriteProject");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
25 changes: 25 additions & 0 deletions examples/v2/case-management/ListUserProjectFavorites.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// Get user's project favorites returns "OK" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.CaseManagementApi;
import com.datadog.api.client.v2.model.ProjectFavoritesResponse;

public class Example {
public static void main(String[] args) {
ApiClient defaultClient = ApiClient.getDefaultApiClient();
defaultClient.setUnstableOperationEnabled("v2.listUserProjectFavorites", true);
CaseManagementApi apiInstance = new CaseManagementApi(defaultClient);

try {
ProjectFavoritesResponse result = apiInstance.listUserProjectFavorites();
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling CaseManagementApi#listUserProjectFavorites");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
23 changes: 23 additions & 0 deletions examples/v2/case-management/UnfavoriteProject.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// Remove project from favorites returns "No Content" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.CaseManagementApi;

public class Example {
public static void main(String[] args) {
ApiClient defaultClient = ApiClient.getDefaultApiClient();
defaultClient.setUnstableOperationEnabled("v2.unfavoriteProject", true);
CaseManagementApi apiInstance = new CaseManagementApi(defaultClient);

try {
apiInstance.unfavoriteProject("e555e290-ed65-49bd-ae18-8acbfcf18db7");
} catch (ApiException e) {
System.err.println("Exception when calling CaseManagementApi#unfavoriteProject");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
3 changes: 3 additions & 0 deletions src/main/java/com/datadog/api/client/ApiClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -775,6 +775,9 @@ public class ApiClient {
put("v2.getOpenAPI", false);
put("v2.listAPIs", false);
put("v2.updateOpenAPI", false);
put("v2.favoriteProject", false);
put("v2.listUserProjectFavorites", false);
put("v2.unfavoriteProject", false);
put("v2.cancelThreatHuntingJob", false);
put("v2.convertJobResultToSignal", false);
put("v2.deleteThreatHuntingJob", false);
Expand Down
Loading
Loading