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
8 changes: 8 additions & 0 deletions examples/v2/case-management/FavoriteProject.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Add project to favorites returns "No Content" response

require "datadog_api_client"
DatadogAPIClient.configure do |config|
config.unstable_operations["v2.favorite_project".to_sym] = true
end
api_instance = DatadogAPIClient::V2::CaseManagementAPI.new
api_instance.favorite_project("project_id")
8 changes: 8 additions & 0 deletions examples/v2/case-management/ListUserProjectFavorites.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Get user's project favorites returns "OK" response

require "datadog_api_client"
DatadogAPIClient.configure do |config|
config.unstable_operations["v2.list_user_project_favorites".to_sym] = true
end
api_instance = DatadogAPIClient::V2::CaseManagementAPI.new
p api_instance.list_user_project_favorites()
8 changes: 8 additions & 0 deletions examples/v2/case-management/UnfavoriteProject.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Remove project from favorites returns "No Content" response

require "datadog_api_client"
DatadogAPIClient.configure do |config|
config.unstable_operations["v2.unfavorite_project".to_sym] = true
end
api_instance = DatadogAPIClient::V2::CaseManagementAPI.new
api_instance.unfavorite_project("project_id")
6 changes: 6 additions & 0 deletions features/scenarios_model_mapping.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1250,6 +1250,12 @@
"case_id" => "String",
"body" => "CaseEmptyRequest",
},
"v2.UnfavoriteProject" => {
"project_id" => "String",
},
"v2.FavoriteProject" => {
"project_id" => "String",
},
"v2.CreateCaseType" => {
"body" => "CaseTypeCreateRequest",
},
Expand Down
62 changes: 62 additions & 0 deletions features/v2/case_management.feature
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,30 @@ Feature: Case Management
And a valid "appKeyAuth" key in the system
And an instance of "CaseManagement" API

@generated @skip @team:DataDog/case-management
Scenario: Add project to favorites returns "Bad Request" response
Given operation "FavoriteProject" enabled
And new "FavoriteProject" request
And request contains "project_id" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 400 Bad Request

@generated @skip @team:DataDog/case-management
Scenario: Add project to favorites returns "No Content" response
Given operation "FavoriteProject" enabled
And new "FavoriteProject" request
And request contains "project_id" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 204 No Content

@generated @skip @team:DataDog/case-management
Scenario: Add project to favorites returns "Not Found" response
Given operation "FavoriteProject" enabled
And new "FavoriteProject" request
And request contains "project_id" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 404 Not Found

@team:DataDog/case-management
Scenario: Archive case returns "Bad Request" response
Given new "ArchiveCase" request
Expand Down Expand Up @@ -247,6 +271,20 @@ Feature: Case Management
When the request is sent
Then the response status is 200 OK

@generated @skip @team:DataDog/case-management
Scenario: Get user's project favorites returns "Bad Request" response
Given operation "ListUserProjectFavorites" enabled
And new "ListUserProjectFavorites" request
When the request is sent
Then the response status is 400 Bad Request

@generated @skip @team:DataDog/case-management
Scenario: Get user's project favorites returns "OK" response
Given operation "ListUserProjectFavorites" enabled
And new "ListUserProjectFavorites" request
When the request is sent
Then the response status is 200 OK

@generated @skip @team:DataDog/case-management
Scenario: Remove a project returns "API error response" response
Given new "DeleteProject" request
Expand All @@ -261,6 +299,30 @@ Feature: Case Management
When the request is sent
Then the response status is 204 No Content

@generated @skip @team:DataDog/case-management
Scenario: Remove project from favorites returns "Bad Request" response
Given operation "UnfavoriteProject" enabled
And new "UnfavoriteProject" request
And request contains "project_id" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 400 Bad Request

@generated @skip @team:DataDog/case-management
Scenario: Remove project from favorites returns "No Content" response
Given operation "UnfavoriteProject" enabled
And new "UnfavoriteProject" request
And request contains "project_id" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 204 No Content

@generated @skip @team:DataDog/case-management
Scenario: Remove project from favorites returns "Not Found" response
Given operation "UnfavoriteProject" enabled
And new "UnfavoriteProject" request
And request contains "project_id" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 404 Not Found

@generated @skip @team:DataDog/case-management
Scenario: Search cases returns "Bad Request" response
Given new "SearchCases" request
Expand Down
20 changes: 20 additions & 0 deletions features/v2/undo.json
Original file line number Diff line number Diff line change
Expand Up @@ -3445,6 +3445,26 @@
"type": "safe"
}
},
"ListUserProjectFavorites": {
"tag": "Case Management",
"undo": {
"type": "safe"
}
},
"UnfavoriteProject": {
"tag": "Case Management",
"undo": {
"type": "idempotent"
}
},
"FavoriteProject": {
"tag": "Case Management",
"undo": {
"operationId": "TODO",
"parameters": [],
"type": "unsafe"
}
},
"QueryScalarData": {
"tag": "Metrics",
"undo": {
Expand Down
3 changes: 3 additions & 0 deletions lib/datadog_api_client/configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,9 @@ def initialize
"v2.get_open_api": false,
"v2.list_apis": false,
"v2.update_open_api": false,
"v2.favorite_project": false,
"v2.list_user_project_favorites": false,
"v2.unfavorite_project": false,
"v2.cancel_threat_hunting_job": false,
"v2.convert_job_result_to_signal": false,
"v2.delete_threat_hunting_job": false,
Expand Down
5 changes: 5 additions & 0 deletions lib/datadog_api_client/inflector.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3749,6 +3749,11 @@ def overrides
"v2.projected_cost_attributes" => "ProjectedCostAttributes",
"v2.projected_cost_response" => "ProjectedCostResponse",
"v2.projected_cost_type" => "ProjectedCostType",
"v2.project_favorite" => "ProjectFavorite",
"v2.project_favorite_relationships" => "ProjectFavoriteRelationships",
"v2.project_favorite_resource_type" => "ProjectFavoriteResourceType",
"v2.project_favorites_response" => "ProjectFavoritesResponse",
"v2.project_favorite_user_relationship" => "ProjectFavoriteUserRelationship",
"v2.project_relationship" => "ProjectRelationship",
"v2.project_relationship_data" => "ProjectRelationshipData",
"v2.project_relationships" => "ProjectRelationships",
Expand Down
Loading
Loading