From f0360cc34067918047585ea607b17a4b34f8c7e4 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Tue, 19 May 2026 23:37:31 +0000 Subject: [PATCH] Regenerate client from commit 8b9a237 of spec repo --- .generator/schemas/v2/openapi.yaml | 3673 ++++++- .../UpdateCustomAttributeConfig.java | 52 + .../case-management-type/UpdateCaseType.java | 41 + .../v2/case-management/AddCaseInsights.java | 47 + .../v2/case-management/AggregateCases.java | 44 + .../v2/case-management/BulkUpdateCases.java | 41 + examples/v2/case-management/CountCases.java | 25 + .../CreateCaseAutomationRule.java | 57 + .../v2/case-management/CreateCaseLink.java | 42 + .../v2/case-management/CreateCaseView.java | 40 + .../CreateMaintenanceWindow.java | 42 + .../DeleteCaseAutomationRule.java | 24 + .../v2/case-management/DeleteCaseLink.java | 23 + .../v2/case-management/DeleteCaseView.java | 23 + .../DeleteMaintenanceWindow.java | 23 + .../DisableCaseAutomationRule.java | 27 + .../EnableCaseAutomationRule.java | 27 + .../case-management/FavoriteCaseProject.java | 23 + .../GetCaseAutomationRule.java | 27 + examples/v2/case-management/GetCaseView.java | 25 + .../ListCaseAutomationRules.java | 26 + .../v2/case-management/ListCaseLinks.java | 26 + .../v2/case-management/ListCaseTimeline.java | 26 + .../v2/case-management/ListCaseViews.java | 25 + .../v2/case-management/ListCaseWatchers.java | 26 + .../ListMaintenanceWindows.java | 25 + .../ListUserCaseProjectFavorites.java | 25 + .../case-management/RemoveCaseInsights.java | 47 + .../UnfavoriteCaseProject.java | 23 + examples/v2/case-management/UnwatchCase.java | 24 + .../UpdateCaseAutomationRule.java | 58 + .../v2/case-management/UpdateCaseComment.java | 35 + .../v2/case-management/UpdateCaseDueDate.java | 37 + .../UpdateCaseResolvedReason.java | 39 + .../v2/case-management/UpdateCaseView.java | 37 + .../UpdateMaintenanceWindow.java | 37 + examples/v2/case-management/WatchCase.java | 24 + .../DeleteCostTagDescriptionByKey.java | 23 + .../GenerateCostTagDescriptionByKey.java | 26 + .../GetCostTagDescriptionByKey.java | 25 + .../UpsertCostTagDescriptionByKey.java | 38 + .../com/datadog/api/client/ApiClient.java | 36 + .../api/client/v2/api/CaseManagementApi.java | 8808 ++++++++++++++--- .../v2/api/CaseManagementAttributeApi.java | 244 +- .../client/v2/api/CaseManagementTypeApi.java | 186 +- .../client/v2/api/CloudCostManagementApi.java | 836 +- .../api/client/v2/model/AutomationRule.java | 243 + .../client/v2/model/AutomationRuleAction.java | 184 + .../v2/model/AutomationRuleActionData.java | 193 + .../v2/model/AutomationRuleActionType.java | 62 + .../v2/model/AutomationRuleAttributes.java | 283 + .../client/v2/model/AutomationRuleCreate.java | 182 + .../model/AutomationRuleCreateAttributes.java | 241 + .../v2/model/AutomationRuleCreateRequest.java | 146 + .../v2/model/AutomationRuleRelationships.java | 190 + .../v2/model/AutomationRuleResponse.java | 146 + .../v2/model/AutomationRuleTrigger.java | 184 + .../v2/model/AutomationRuleTriggerData.java | 257 + .../v2/model/AutomationRuleTriggerType.java | 74 + .../client/v2/model/AutomationRuleUpdate.java | 179 + .../v2/model/AutomationRuleUpdateRequest.java | 146 + .../v2/model/AutomationRulesResponse.java | 154 + .../com/datadog/api/client/v2/model/Case.java | 2 +- .../client/v2/model/CaseAggregateGroup.java | 181 + .../client/v2/model/CaseAggregateGroupBy.java | 180 + .../client/v2/model/CaseAggregateRequest.java | 148 + .../model/CaseAggregateRequestAttributes.java | 180 + .../v2/model/CaseAggregateRequestData.java | 181 + .../v2/model/CaseAggregateResourceType.java | 56 + .../v2/model/CaseAggregateResponse.java | 145 + .../CaseAggregateResponseAttributes.java | 189 + .../v2/model/CaseAggregateResponseData.java | 208 + .../api/client/v2/model/CaseAssign.java | 2 +- .../api/client/v2/model/CaseAttributes.java | 3 +- .../model/CaseAutomationRuleResourceType.java | 57 + .../v2/model/CaseAutomationRuleState.java | 60 + .../client/v2/model/CaseBulkActionType.java | 79 + .../client/v2/model/CaseBulkResourceType.java | 54 + .../v2/model/CaseBulkUpdateRequest.java | 148 + .../CaseBulkUpdateRequestAttributes.java | 226 + .../v2/model/CaseBulkUpdateRequestData.java | 182 + .../api/client/v2/model/CaseComment.java | 2 +- .../api/client/v2/model/CaseCountGroup.java | 186 + .../client/v2/model/CaseCountGroupValue.java | 176 + .../client/v2/model/CaseCountResponse.java | 148 + .../v2/model/CaseCountResponseAttributes.java | 155 + .../v2/model/CaseCountResponseData.java | 204 + .../api/client/v2/model/CaseCreate.java | 2 +- .../api/client/v2/model/CaseEmpty.java | 2 +- .../api/client/v2/model/CaseInsight.java | 213 + .../api/client/v2/model/CaseInsightType.java | 95 + .../v2/model/CaseInsightsAttributes.java | 154 + .../api/client/v2/model/CaseInsightsData.java | 178 + .../client/v2/model/CaseInsightsRequest.java | 145 + .../datadog/api/client/v2/model/CaseLink.java | 213 + .../client/v2/model/CaseLinkAttributes.java | 274 + .../api/client/v2/model/CaseLinkCreate.java | 179 + .../v2/model/CaseLinkCreateRequest.java | 145 + .../client/v2/model/CaseLinkResourceType.java | 54 + .../api/client/v2/model/CaseLinkResponse.java | 146 + .../client/v2/model/CaseLinksResponse.java | 154 + .../api/client/v2/model/CaseResourceType.java | 2 +- .../api/client/v2/model/CaseTypeCreate.java | 8 +- .../v2/model/CaseTypeCreateRequest.java | 4 +- .../api/client/v2/model/CaseTypeResource.java | 11 +- .../v2/model/CaseTypeResourceAttributes.java | 16 +- .../client/v2/model/CaseTypeResourceType.java | 2 +- .../api/client/v2/model/CaseTypeResponse.java | 5 +- .../api/client/v2/model/CaseTypeUpdate.java | 177 + .../v2/model/CaseTypeUpdateRequest.java | 145 + .../client/v2/model/CaseTypesResponse.java | 2 +- .../client/v2/model/CaseUpdateAttributes.java | 2 +- .../model/CaseUpdateAttributesAttributes.java | 3 +- .../client/v2/model/CaseUpdateComment.java | 181 + .../v2/model/CaseUpdateCommentAttributes.java | 144 + .../v2/model/CaseUpdateCommentRequest.java | 145 + .../v2/model/CaseUpdateCustomAttribute.java | 4 +- .../v2/model/CaseUpdateDescription.java | 2 +- .../client/v2/model/CaseUpdateDueDate.java | 181 + .../v2/model/CaseUpdateDueDateAttributes.java | 145 + .../v2/model/CaseUpdateDueDateRequest.java | 145 + .../client/v2/model/CaseUpdatePriority.java | 2 +- .../v2/model/CaseUpdateResolvedReason.java | 181 + .../CaseUpdateResolvedReasonAttributes.java | 150 + .../CaseUpdateResolvedReasonRequest.java | 147 + .../api/client/v2/model/CaseUpdateStatus.java | 2 +- .../api/client/v2/model/CaseUpdateTitle.java | 2 +- .../datadog/api/client/v2/model/CaseView.java | 241 + .../client/v2/model/CaseViewAttributes.java | 240 + .../api/client/v2/model/CaseViewCreate.java | 178 + .../v2/model/CaseViewCreateAttributes.java | 229 + .../v2/model/CaseViewCreateRequest.java | 145 + .../v2/model/CaseViewRelationships.java | 218 + .../client/v2/model/CaseViewResourceType.java | 54 + .../api/client/v2/model/CaseViewResponse.java | 146 + .../api/client/v2/model/CaseViewUpdate.java | 176 + .../v2/model/CaseViewUpdateAttributes.java | 195 + .../v2/model/CaseViewUpdateRequest.java | 145 + .../client/v2/model/CaseViewsResponse.java | 154 + .../api/client/v2/model/CaseWatcher.java | 212 + .../v2/model/CaseWatcherRelationships.java | 145 + .../v2/model/CaseWatcherResourceType.java | 55 + .../v2/model/CaseWatcherUserRelationship.java | 146 + .../client/v2/model/CaseWatchersResponse.java | 154 + .../v2/model/CostTagDescriptionResponse.java | 147 + .../CostTagDescriptionUpsertRequest.java | 149 + .../CostTagDescriptionUpsertRequestData.java | 215 + ...escriptionUpsertRequestDataAttributes.java | 178 + .../v2/model/CustomAttributeConfig.java | 11 +- ...CustomAttributeConfigAttributesCreate.java | 14 +- .../v2/model/CustomAttributeConfigCreate.java | 6 +- .../CustomAttributeConfigCreateRequest.java | 4 +- ...stomAttributeConfigResourceAttributes.java | 19 +- .../CustomAttributeConfigResourceType.java | 2 +- .../model/CustomAttributeConfigResponse.java | 6 +- .../v2/model/CustomAttributeConfigUpdate.java | 182 + ...CustomAttributeConfigUpdateAttributes.java | 258 + .../CustomAttributeConfigUpdateRequest.java | 147 + .../model/CustomAttributeConfigsResponse.java | 2 +- .../v2/model/CustomAttributeSelectOption.java | 144 + .../client/v2/model/CustomAttributeType.java | 4 +- .../v2/model/CustomAttributeTypeData.java | 152 + .../client/v2/model/CustomAttributeValue.java | 8 +- .../GenerateCostTagDescriptionResponse.java | 148 + .../v2/model/GeneratedCostTagDescription.java | 215 + ...GeneratedCostTagDescriptionAttributes.java | 145 + .../GeneratedCostTagDescriptionType.java | 58 + .../client/v2/model/MaintenanceWindow.java | 215 + .../v2/model/MaintenanceWindowAttributes.java | 274 + .../v2/model/MaintenanceWindowCreate.java | 182 + .../MaintenanceWindowCreateAttributes.java | 232 + .../model/MaintenanceWindowCreateRequest.java | 147 + .../model/MaintenanceWindowResourceType.java | 57 + .../v2/model/MaintenanceWindowResponse.java | 148 + .../v2/model/MaintenanceWindowUpdate.java | 180 + .../MaintenanceWindowUpdateAttributes.java | 224 + .../model/MaintenanceWindowUpdateRequest.java | 147 + .../v2/model/MaintenanceWindowsResponse.java | 155 + .../api/client/v2/model/ProjectFavorite.java | 178 + .../v2/model/ProjectFavoriteResourceType.java | 57 + .../v2/model/ProjectFavoritesResponse.java | 154 + .../api/client/v2/model/TimelineCell.java | 12 +- .../v2/model/TimelineCellAuthorUser.java | 6 +- .../model/TimelineCellAuthorUserContent.java | 10 +- .../v2/model/TimelineCellAuthorUserType.java | 2 +- .../v2/model/TimelineCellContentComment.java | 4 +- .../client/v2/model/TimelineCellResource.java | 7 +- .../v2/model/TimelineCellResourceType.java | 2 +- .../api/client/v2/model/TimelineCellType.java | 5 +- .../api/client/v2/model/TimelineResponse.java | 2 +- .../api/client/v2/api/case_management.feature | 852 ++ .../v2/api/case_management_attribute.feature | 30 + .../v2/api/case_management_type.feature | 27 + .../v2/api/cloud_cost_management.feature | 65 + .../com/datadog/api/client/v2/api/undo.json | 290 + 195 files changed, 31868 insertions(+), 1709 deletions(-) create mode 100644 examples/v2/case-management-attribute/UpdateCustomAttributeConfig.java create mode 100644 examples/v2/case-management-type/UpdateCaseType.java create mode 100644 examples/v2/case-management/AddCaseInsights.java create mode 100644 examples/v2/case-management/AggregateCases.java create mode 100644 examples/v2/case-management/BulkUpdateCases.java create mode 100644 examples/v2/case-management/CountCases.java create mode 100644 examples/v2/case-management/CreateCaseAutomationRule.java create mode 100644 examples/v2/case-management/CreateCaseLink.java create mode 100644 examples/v2/case-management/CreateCaseView.java create mode 100644 examples/v2/case-management/CreateMaintenanceWindow.java create mode 100644 examples/v2/case-management/DeleteCaseAutomationRule.java create mode 100644 examples/v2/case-management/DeleteCaseLink.java create mode 100644 examples/v2/case-management/DeleteCaseView.java create mode 100644 examples/v2/case-management/DeleteMaintenanceWindow.java create mode 100644 examples/v2/case-management/DisableCaseAutomationRule.java create mode 100644 examples/v2/case-management/EnableCaseAutomationRule.java create mode 100644 examples/v2/case-management/FavoriteCaseProject.java create mode 100644 examples/v2/case-management/GetCaseAutomationRule.java create mode 100644 examples/v2/case-management/GetCaseView.java create mode 100644 examples/v2/case-management/ListCaseAutomationRules.java create mode 100644 examples/v2/case-management/ListCaseLinks.java create mode 100644 examples/v2/case-management/ListCaseTimeline.java create mode 100644 examples/v2/case-management/ListCaseViews.java create mode 100644 examples/v2/case-management/ListCaseWatchers.java create mode 100644 examples/v2/case-management/ListMaintenanceWindows.java create mode 100644 examples/v2/case-management/ListUserCaseProjectFavorites.java create mode 100644 examples/v2/case-management/RemoveCaseInsights.java create mode 100644 examples/v2/case-management/UnfavoriteCaseProject.java create mode 100644 examples/v2/case-management/UnwatchCase.java create mode 100644 examples/v2/case-management/UpdateCaseAutomationRule.java create mode 100644 examples/v2/case-management/UpdateCaseComment.java create mode 100644 examples/v2/case-management/UpdateCaseDueDate.java create mode 100644 examples/v2/case-management/UpdateCaseResolvedReason.java create mode 100644 examples/v2/case-management/UpdateCaseView.java create mode 100644 examples/v2/case-management/UpdateMaintenanceWindow.java create mode 100644 examples/v2/case-management/WatchCase.java create mode 100644 examples/v2/cloud-cost-management/DeleteCostTagDescriptionByKey.java create mode 100644 examples/v2/cloud-cost-management/GenerateCostTagDescriptionByKey.java create mode 100644 examples/v2/cloud-cost-management/GetCostTagDescriptionByKey.java create mode 100644 examples/v2/cloud-cost-management/UpsertCostTagDescriptionByKey.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/AutomationRule.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/AutomationRuleAction.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/AutomationRuleActionData.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/AutomationRuleActionType.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/AutomationRuleAttributes.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/AutomationRuleCreate.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/AutomationRuleCreateAttributes.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/AutomationRuleCreateRequest.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/AutomationRuleRelationships.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/AutomationRuleResponse.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/AutomationRuleTrigger.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/AutomationRuleTriggerData.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/AutomationRuleTriggerType.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/AutomationRuleUpdate.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/AutomationRuleUpdateRequest.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/AutomationRulesResponse.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/CaseAggregateGroup.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/CaseAggregateGroupBy.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/CaseAggregateRequest.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/CaseAggregateRequestAttributes.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/CaseAggregateRequestData.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/CaseAggregateResourceType.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/CaseAggregateResponse.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/CaseAggregateResponseAttributes.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/CaseAggregateResponseData.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/CaseAutomationRuleResourceType.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/CaseAutomationRuleState.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/CaseBulkActionType.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/CaseBulkResourceType.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/CaseBulkUpdateRequest.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/CaseBulkUpdateRequestAttributes.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/CaseBulkUpdateRequestData.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/CaseCountGroup.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/CaseCountGroupValue.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/CaseCountResponse.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/CaseCountResponseAttributes.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/CaseCountResponseData.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/CaseInsight.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/CaseInsightType.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/CaseInsightsAttributes.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/CaseInsightsData.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/CaseInsightsRequest.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/CaseLink.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/CaseLinkAttributes.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/CaseLinkCreate.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/CaseLinkCreateRequest.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/CaseLinkResourceType.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/CaseLinkResponse.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/CaseLinksResponse.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/CaseTypeUpdate.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/CaseTypeUpdateRequest.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/CaseUpdateComment.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/CaseUpdateCommentAttributes.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/CaseUpdateCommentRequest.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/CaseUpdateDueDate.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/CaseUpdateDueDateAttributes.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/CaseUpdateDueDateRequest.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/CaseUpdateResolvedReason.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/CaseUpdateResolvedReasonAttributes.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/CaseUpdateResolvedReasonRequest.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/CaseView.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/CaseViewAttributes.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/CaseViewCreate.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/CaseViewCreateAttributes.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/CaseViewCreateRequest.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/CaseViewRelationships.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/CaseViewResourceType.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/CaseViewResponse.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/CaseViewUpdate.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/CaseViewUpdateAttributes.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/CaseViewUpdateRequest.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/CaseViewsResponse.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/CaseWatcher.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/CaseWatcherRelationships.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/CaseWatcherResourceType.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/CaseWatcherUserRelationship.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/CaseWatchersResponse.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/CostTagDescriptionResponse.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/CostTagDescriptionUpsertRequest.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/CostTagDescriptionUpsertRequestData.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/CostTagDescriptionUpsertRequestDataAttributes.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/CustomAttributeConfigUpdate.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/CustomAttributeConfigUpdateAttributes.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/CustomAttributeConfigUpdateRequest.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/CustomAttributeSelectOption.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/CustomAttributeTypeData.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/GenerateCostTagDescriptionResponse.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/GeneratedCostTagDescription.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/GeneratedCostTagDescriptionAttributes.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/GeneratedCostTagDescriptionType.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/MaintenanceWindow.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/MaintenanceWindowAttributes.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/MaintenanceWindowCreate.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/MaintenanceWindowCreateAttributes.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/MaintenanceWindowCreateRequest.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/MaintenanceWindowResourceType.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/MaintenanceWindowResponse.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/MaintenanceWindowUpdate.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/MaintenanceWindowUpdateAttributes.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/MaintenanceWindowUpdateRequest.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/MaintenanceWindowsResponse.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/ProjectFavorite.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/ProjectFavoriteResourceType.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/ProjectFavoritesResponse.java diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 0f0a8a4eda9..37053ac91c9 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -249,7 +249,7 @@ components: schema: $ref: "#/components/schemas/CaseSortableField" CaseTypeIDPathParameter: - description: Case type's UUID + description: The UUID of the case type. example: "f98a5a5b-e0ff-45d4-b2f5-afe6e74de505" in: path name: case_type_id @@ -257,7 +257,7 @@ components: schema: type: string CellIDPathParameter: - description: Timeline cell's UUID + description: The UUID of the timeline cell (comment) to update. example: "f98a5a5b-e0ff-45d4-b2f5-afe6e74de504" in: path name: cell_id @@ -853,6 +853,22 @@ components: required: true schema: type: string + LinkIDPathParameter: + description: "The UUID of the case link." + in: path + name: link_id + required: true + schema: + example: "804cd682-55f6-4541-ab00-b608b282ea7d" + type: string + MaintenanceWindowIDPathParameter: + description: The UUID of the maintenance window. + example: "a1b2c3d4-e5f6-7890-abcd-ef1234567890" + in: path + name: maintenance_window_id + required: true + schema: + type: string MembershipSort: description: >- Field to sort memberships by. Supported values: `name`, `uuid`, `-name`, `-uuid`. Defaults to `uuid`. @@ -1441,6 +1457,14 @@ components: schema: example: "1" type: string + RuleIDPathParameter: + description: The UUID of the automation rule. + example: "e6773723-fe58-49ff-9975-dff00f14e28d" + in: path + name: rule_id + required: true + schema: + type: string RuleId: description: The ID of the rule. in: path @@ -1619,6 +1643,22 @@ components: schema: example: "00000000-0000-9999-0000-000000000000" type: string + UserUUIDPathParameter: + description: The UUID of the user to add or remove as a watcher. + example: "8146583c-0b5f-11ec-abf8-da7ad0900001" + in: path + name: user_uuid + required: true + schema: + type: string + ViewIDPathParameter: + description: The UUID of the case view. + example: a1b2c3d4-e5f6-7890-abcd-ef1234567890 + in: path + name: view_id + required: true + schema: + type: string WorkflowId: description: The ID of the workflow. in: path @@ -7626,6 +7666,219 @@ components: description: Whether to auto-transition cases when self-assigned. type: boolean type: object + AutomationRule: + description: An automation rule that executes an action (such as running a Datadog workflow or assigning an AI agent) when a specified case event occurs within a project. + properties: + attributes: + $ref: "#/components/schemas/AutomationRuleAttributes" + id: + description: Automation rule identifier. + example: "e6773723-fe58-49ff-9975-dff00f14e28d" + type: string + relationships: + $ref: "#/components/schemas/AutomationRuleRelationships" + type: + $ref: "#/components/schemas/CaseAutomationRuleResourceType" + required: + - id + - type + - attributes + type: object + AutomationRuleAction: + description: Defines what happens when the rule triggers. Combines an action type with action-specific configuration data. + properties: + data: + $ref: "#/components/schemas/AutomationRuleActionData" + type: + $ref: "#/components/schemas/AutomationRuleActionType" + required: + - type + - data + type: object + AutomationRuleActionData: + description: Configuration for the action to execute, dependent on the action type. + properties: + agent_type: + description: The type of AI agent to assign. Required when the action type is `assign_agent`. + type: string + assigned_agent_id: + description: The identifier of the AI agent to assign to the case. Required when the action type is `assign_agent`. + type: string + handle: + description: The handle of the Datadog workflow to execute. Required when the action type is `execute_workflow`. + example: "workflow-handle-123" + type: string + type: object + AutomationRuleActionType: + description: The type of automated action to perform when the rule triggers. `execute_workflow` runs a Datadog workflow; `assign_agent` assigns an AI agent to the case. + enum: + - execute_workflow + - assign_agent + example: execute_workflow + type: string + x-enum-varnames: + - EXECUTE_WORKFLOW + - ASSIGN_AGENT + AutomationRuleAttributes: + description: Core attributes of an automation rule, including its name, trigger condition, action to execute, and current state. + properties: + action: + $ref: "#/components/schemas/AutomationRuleAction" + created_at: + description: Timestamp when the automation rule was created. + example: "2024-01-01T00:00:00.000Z" + format: date-time + readOnly: true + type: string + modified_at: + description: Timestamp when the automation rule was last modified. + format: date-time + readOnly: true + type: string + name: + description: A human-readable name for the automation rule, used to identify the rule in the UI and API responses. + example: "Auto-assign workflow" + type: string + state: + $ref: "#/components/schemas/CaseAutomationRuleState" + trigger: + $ref: "#/components/schemas/AutomationRuleTrigger" + required: + - name + - trigger + - action + - state + - created_at + type: object + AutomationRuleCreate: + description: Data object for creating an automation rule. + properties: + attributes: + $ref: "#/components/schemas/AutomationRuleCreateAttributes" + type: + $ref: "#/components/schemas/CaseAutomationRuleResourceType" + required: + - type + - attributes + type: object + AutomationRuleCreateAttributes: + description: Attributes required to create an automation rule. + properties: + action: + $ref: "#/components/schemas/AutomationRuleAction" + name: + description: Name of the automation rule. + example: "Auto-assign workflow" + type: string + state: + $ref: "#/components/schemas/CaseAutomationRuleState" + trigger: + $ref: "#/components/schemas/AutomationRuleTrigger" + required: + - name + - trigger + - action + type: object + AutomationRuleCreateRequest: + description: Request payload for creating an automation rule. + properties: + data: + $ref: "#/components/schemas/AutomationRuleCreate" + required: + - data + type: object + AutomationRuleRelationships: + description: Related resources for the automation rule, including the users who created and last modified it. + properties: + created_by: + $ref: "#/components/schemas/NullableUserRelationship" + modified_by: + $ref: "#/components/schemas/NullableUserRelationship" + type: object + AutomationRuleResponse: + description: Response containing a single automation rule. + properties: + data: + $ref: "#/components/schemas/AutomationRule" + required: + - data + type: object + AutomationRuleTrigger: + description: Defines when the rule activates. Combines a trigger type (the case event to listen for) with optional trigger data (conditions that narrow when the trigger fires). + properties: + data: + $ref: "#/components/schemas/AutomationRuleTriggerData" + type: + $ref: "#/components/schemas/AutomationRuleTriggerType" + required: + - type + type: object + AutomationRuleTriggerData: + description: Additional configuration for the trigger, dependent on the trigger type. For `status_transitioned` triggers, specify `from_status_name` and `to_status_name`. For `attribute_value_changed` triggers, specify `field` and `change_type`. + properties: + approval_type: + description: The approval outcome to match. Used with `case_review_approved` triggers. + type: string + change_type: + description: "The kind of attribute change to match. Allowed values: `VALUE_ADDED`, `VALUE_DELETED`, `ANY_CHANGES`. Used with `attribute_value_changed` triggers." + type: string + field: + description: The case attribute field name to monitor for changes. Used with `attribute_value_changed` triggers. + type: string + from_status_name: + description: The originating status name. Used with `status_transitioned` triggers to match transitions from this status. + type: string + to_status_name: + description: The destination status name. Used with `status_transitioned` triggers to match transitions to this status. + type: string + type: object + AutomationRuleTriggerType: + description: The case event that activates the automation rule. + enum: + - case_created + - status_transitioned + - attribute_value_changed + - event_correlation_signal_correlated + - case_review_approved + - comment_added + example: case_created + type: string + x-enum-varnames: + - CASE_CREATED + - STATUS_TRANSITIONED + - ATTRIBUTE_VALUE_CHANGED + - EVENT_CORRELATION_SIGNAL_CORRELATED + - CASE_REVIEW_APPROVED + - COMMENT_ADDED + AutomationRuleUpdate: + description: Data object for updating an automation rule. + properties: + attributes: + $ref: "#/components/schemas/AutomationRuleCreateAttributes" + type: + $ref: "#/components/schemas/CaseAutomationRuleResourceType" + required: + - type + type: object + AutomationRuleUpdateRequest: + description: Request payload for updating an automation rule. + properties: + data: + $ref: "#/components/schemas/AutomationRuleUpdate" + required: + - data + type: object + AutomationRulesResponse: + description: Response containing a list of automation rules for a project. + properties: + data: + description: List of automation rules. + items: + $ref: "#/components/schemas/AutomationRule" + type: array + required: + - data + type: object AwsAccountId: description: The ID of the AWS account. example: "123456789012" @@ -10890,6 +11143,128 @@ components: - IN_PROGRESS - COMPLETED - FAILED + CaseAggregateGroup: + description: A single group within the aggregation results, containing the group key and its associated count values. + properties: + group: + description: "The value of the field being grouped on (for example, `OPEN` when grouping by status)." + example: "OPEN" + type: string + value: + description: The count of cases in this group. + example: + - 42.0 + items: + format: double + type: number + type: array + required: + - group + - value + type: object + CaseAggregateGroupBy: + description: Configuration for grouping aggregated results by one or more case fields. + properties: + groups: + description: Fields to group by. + example: + - "status" + items: + type: string + type: array + limit: + description: Maximum number of groups to return. + example: 14 + format: int32 + maximum: 1000 + type: integer + required: + - groups + - limit + type: object + CaseAggregateRequest: + description: Request payload for aggregating case counts with grouping. Use this to get faceted breakdowns of cases (for example, count of cases grouped by priority and status). + properties: + data: + $ref: "#/components/schemas/CaseAggregateRequestData" + required: + - data + type: object + CaseAggregateRequestAttributes: + description: Attributes for the aggregation request, including the search query and grouping configuration. + properties: + group_by: + $ref: "#/components/schemas/CaseAggregateGroupBy" + query_filter: + description: "A search query to filter which cases are included in the aggregation. Uses the same syntax as the Case Management search bar." + example: "service:case-api" + type: string + required: + - query_filter + - group_by + type: object + CaseAggregateRequestData: + description: Data object wrapping the aggregation query type and attributes. + properties: + attributes: + $ref: "#/components/schemas/CaseAggregateRequestAttributes" + type: + $ref: "#/components/schemas/CaseAggregateResourceType" + required: + - attributes + - type + type: object + CaseAggregateResourceType: + description: JSON:API resource type for case aggregation requests. + enum: + - aggregate + example: aggregate + type: string + x-enum-varnames: + - AGGREGATE + CaseAggregateResponse: + description: Response containing aggregated case counts grouped by the requested fields. + properties: + data: + $ref: "#/components/schemas/CaseAggregateResponseData" + required: + - data + type: object + CaseAggregateResponseAttributes: + description: Attributes of the aggregation result, including the total count across all groups and the per-group breakdowns. + properties: + groups: + description: Aggregated groups. + items: + $ref: "#/components/schemas/CaseAggregateGroup" + type: array + total: + description: Total count of aggregated cases. + example: 100.0 + format: double + type: number + required: + - total + - groups + type: object + CaseAggregateResponseData: + description: Data object containing the aggregation results, including total count and per-group breakdowns. + properties: + attributes: + $ref: "#/components/schemas/CaseAggregateResponseAttributes" + id: + description: Aggregate response identifier. + example: "agg-result-001" + type: string + type: + description: Aggregate resource type. + example: "aggregate" + type: string + required: + - type + - id + - attributes + type: object CaseAssign: description: Case assign properties: @@ -10982,6 +11357,102 @@ components: example: "3b010bde-09ce-4449-b745-71dd5f861963" type: string type: object + CaseAutomationRuleResourceType: + default: rule + description: JSON:API resource type for case automation rules. + enum: + - rule + example: rule + type: string + x-enum-varnames: + - RULE + CaseAutomationRuleState: + description: Whether the automation rule is active. Enabled rules trigger on matching case events; disabled rules are inactive but preserve their configuration. + enum: + - ENABLED + - DISABLED + example: ENABLED + type: string + x-enum-varnames: + - ENABLED + - DISABLED + CaseBulkActionType: + description: "The type of action to apply in a bulk update. Allowed values are `priority`, `status`, `assign`, `unassign`, `archive`, `unarchive`, `jira`, `servicenow`, `linear`, `update_project`." + enum: + - priority + - status + - assign + - unassign + - archive + - unarchive + - jira + - servicenow + - linear + - update_project + example: priority + type: string + x-enum-varnames: + - PRIORITY + - STATUS + - ASSIGN + - UNASSIGN + - ARCHIVE + - UNARCHIVE + - JIRA + - SERVICENOW + - LINEAR + - UPDATE_PROJECT + CaseBulkResourceType: + description: JSON:API resource type for bulk case operations. + enum: + - bulk + example: bulk + type: string + x-enum-varnames: + - BULK + CaseBulkUpdateRequest: + description: Request payload for applying a single action (such as changing priority, status, or assignment) to multiple cases at once. + properties: + data: + $ref: "#/components/schemas/CaseBulkUpdateRequestData" + required: + - data + type: object + CaseBulkUpdateRequestAttributes: + description: Attributes for the bulk update, specifying which cases to update and the action to apply. + properties: + case_ids: + description: An array of case identifiers to apply the bulk action to. + example: + - "case-id-1" + - "case-id-2" + items: + type: string + type: array + payload: + additionalProperties: + type: string + description: A key-value map of action-specific parameters. The required keys depend on the action type (for example, `priority` for the priority action, `assignee_id` for assign). + example: + priority: "P1" + type: object + type: + $ref: "#/components/schemas/CaseBulkActionType" + required: + - case_ids + - type + type: object + CaseBulkUpdateRequestData: + description: Data object wrapping the bulk update type and attributes. + properties: + attributes: + $ref: "#/components/schemas/CaseBulkUpdateRequestAttributes" + type: + $ref: "#/components/schemas/CaseBulkResourceType" + required: + - attributes + - type + type: object CaseComment: description: Case comment properties: @@ -11011,6 +11482,75 @@ components: required: - data type: object + CaseCountGroup: + description: A facet group containing counts broken down by the distinct values of a case field (for example, status or priority). + properties: + group: + description: "The name of the field being grouped on (for example, `status` or `priority`)." + example: "status" + type: string + group_values: + description: Values within this group. + items: + $ref: "#/components/schemas/CaseCountGroupValue" + type: array + required: + - group + - group_values + type: object + CaseCountGroupValue: + description: A single value within a count group, representing the number of cases with that specific field value. + properties: + count: + description: Count of cases for this value. + example: 42 + format: int64 + type: integer + value: + description: The group value. + example: "OPEN" + type: string + required: + - value + - count + type: object + CaseCountResponse: + description: Response containing the total number of cases matching a query, optionally grouped by specified fields. + properties: + data: + $ref: "#/components/schemas/CaseCountResponseData" + required: + - data + type: object + CaseCountResponseAttributes: + description: Attributes for the count response, including the total count and optional facet breakdowns. + properties: + groups: + description: List of facet groups, one per field specified in `group_bys`. + items: + $ref: "#/components/schemas/CaseCountGroup" + type: array + required: + - groups + type: object + CaseCountResponseData: + description: Data object containing the count results, including per-field group breakdowns. + properties: + attributes: + $ref: "#/components/schemas/CaseCountResponseAttributes" + id: + description: Count response identifier. + example: "count-result-001" + type: string + type: + description: Count resource type. + example: "count" + type: string + required: + - type + - id + - attributes + type: object CaseCreate: description: Case creation data properties: @@ -11094,6 +11634,86 @@ components: required: - data type: object + CaseInsight: + description: A reference to an external Datadog resource that provides investigative context for a case, such as a security signal, monitor alert, error tracking issue, or incident. + properties: + ref: + description: "The URL path or deep link to the insight resource within Datadog (for example, `/monitors/12345?q=total`)." + example: "/monitors/12345?q=total" + type: string + resource_id: + description: The unique identifier of the referenced Datadog resource (for example, a monitor ID, incident ID, or signal ID). + example: "12345" + type: string + type: + $ref: "#/components/schemas/CaseInsightType" + required: + - type + - ref + - resource_id + type: object + CaseInsightType: + description: The type of Datadog resource linked to the case as contextual evidence. Each type corresponds to a different Datadog product signal (for example, a security finding, a monitor alert, or an incident). + enum: + - SECURITY_SIGNAL + - MONITOR + - EVENT_CORRELATION + - ERROR_TRACKING + - CLOUD_COST_RECOMMENDATION + - INCIDENT + - SENSITIVE_DATA_SCANNER_ISSUE + - EVENT + - WATCHDOG_STORY + - WIDGET + - SECURITY_FINDING + - INSIGHT_SCORECARD_CAMPAIGN + - RESOURCE_POLICY + - APM_RECOMMENDATION + - SCM_URL + - PROFILING_DOWNSIZING_EXPERIMENT + example: SECURITY_SIGNAL + type: string + x-enum-varnames: + - SECURITY_SIGNAL + - MONITOR + - EVENT_CORRELATION + - ERROR_TRACKING + - CLOUD_COST_RECOMMENDATION + - INCIDENT + - SENSITIVE_DATA_SCANNER_ISSUE + - EVENT + - WATCHDOG_STORY + - WIDGET + - SECURITY_FINDING + - INSIGHT_SCORECARD_CAMPAIGN + - RESOURCE_POLICY + - APM_RECOMMENDATION + - SCM_URL + - PROFILING_DOWNSIZING_EXPERIMENT + CaseInsightsAttributes: + description: Attributes for adding or removing insights from a case. + properties: + insights: + description: Array of insights to add to or remove from a case. + items: + $ref: "#/components/schemas/CaseInsight" + maxItems: 100 + minItems: 1 + type: array + required: + - insights + type: object + CaseInsightsData: + description: Data object containing the insights to add or remove. + properties: + attributes: + $ref: "#/components/schemas/CaseInsightsAttributes" + type: + $ref: "#/components/schemas/CaseResourceType" + required: + - type + - attributes + type: object CaseInsightsItems: description: An insight of the case. properties: @@ -11110,6 +11730,106 @@ components: example: "SECURITY_FINDING" type: string type: object + CaseInsightsRequest: + description: Request payload for adding or removing case insights. + properties: + data: + $ref: "#/components/schemas/CaseInsightsData" + required: + - data + type: object + CaseLink: + description: "A directional link representing a relationship between two entities. At least one entity must be a case." + properties: + attributes: + $ref: "#/components/schemas/CaseLinkAttributes" + id: + description: "The case link identifier." + example: "804cd682-55f6-4541-ab00-b608b282ea7d" + type: string + type: + $ref: "#/components/schemas/CaseLinkResourceType" + required: + - id + - type + - attributes + type: object + CaseLinkAttributes: + description: "Attributes describing a directional relationship between two entities (cases, incidents, or pages)." + properties: + child_entity_id: + description: "The UUID of the child (target) entity in the relationship." + example: "4417921d-0866-4a38-822c-6f2a0f65f77d" + type: string + child_entity_type: + description: "The type of the child entity. Allowed values: `CASE`, `INCIDENT`, `PAGE`, `AGENT_CONVERSATION`." + example: "CASE" + type: string + parent_entity_id: + description: "The UUID of the parent (source) entity in the relationship." + example: "bf0cbac6-4c16-4cfb-b6bf-ca5e0ec37a4f" + type: string + parent_entity_type: + description: "The type of the parent entity. Allowed values: `CASE`, `INCIDENT`, `PAGE`, `AGENT_CONVERSATION`." + example: "CASE" + type: string + relationship: + description: "The type of directional relationship. Allowed values: `RELATES_TO` (bidirectional association), `CAUSES` (parent causes child), `BLOCKS` (parent blocks child), `DUPLICATES` (parent duplicates child), `PARENT_OF` (hierarchical), `SUCCESSOR_OF` (sequence), `ESCALATES_TO` (priority escalation)." + example: "BLOCKS" + type: string + required: + - relationship + - parent_entity_id + - parent_entity_type + - child_entity_id + - child_entity_type + type: object + CaseLinkCreate: + description: "Data object for creating a case link." + properties: + attributes: + $ref: "#/components/schemas/CaseLinkAttributes" + type: + $ref: "#/components/schemas/CaseLinkResourceType" + required: + - type + - attributes + type: object + CaseLinkCreateRequest: + description: "Request payload for creating a link between two entities." + properties: + data: + $ref: "#/components/schemas/CaseLinkCreate" + required: + - data + type: object + CaseLinkResourceType: + description: "JSON:API resource type for case links." + enum: + - link + example: link + type: string + x-enum-varnames: + - LINK + CaseLinkResponse: + description: "Response containing a single case link." + properties: + data: + $ref: "#/components/schemas/CaseLink" + required: + - data + type: object + CaseLinksResponse: + description: "Response containing a list of case links." + properties: + data: + description: "A list of case links." + items: + $ref: "#/components/schemas/CaseLink" + type: array + required: + - data + type: object CaseManagementProject: description: Case management project. properties: @@ -11352,7 +12072,7 @@ components: description: An attribute value. type: string type: array - description: The definition of `CaseObjectAttributes` object. + description: Key-value pairs of case attributes. Each key maps to an array of string values, used for flexible metadata such as labels or tags. type: object CasePriority: default: NOT_DEFINED @@ -11387,7 +12107,7 @@ components: type: object CaseResourceType: default: case - description: Case resource type + description: JSON:API resource type for cases. enum: - case example: case @@ -11467,7 +12187,7 @@ components: x-enum-varnames: - STANDARD CaseTypeCreate: - description: Case type + description: Data object for creating a case type. properties: attributes: $ref: "#/components/schemas/CaseTypeResourceAttributes" @@ -11478,7 +12198,7 @@ components: - type type: object CaseTypeCreateRequest: - description: Case type create request + description: Request payload for creating a case type. properties: data: $ref: "#/components/schemas/CaseTypeCreate" @@ -11486,7 +12206,7 @@ components: - data type: object CaseTypeResource: - description: The definition of `CaseType` object. + description: A case type that defines a classification category for cases. Each case type can have its own custom attributes, statuses, and automation rules. properties: attributes: $ref: "#/components/schemas/CaseTypeResourceAttributes" @@ -11498,24 +12218,24 @@ components: $ref: "#/components/schemas/CaseTypeResourceType" type: object CaseTypeResourceAttributes: - description: Case Type resource attributes + description: "Attributes of a case type, which define a classification category for cases. Organizations use case types to model different workflows (for example, Security Incident, Bug Report, Change Request)." properties: deleted_at: - description: Timestamp of when the case type was deleted + description: Timestamp when the case type was marked as deleted. A null value indicates the case type is active. format: date-time nullable: true readOnly: true type: string description: - description: Case type description. + description: A detailed description explaining when this case type should be used. example: "Investigations done in case management" type: string emoji: - description: Case type emoji. + description: An emoji icon representing the case type in the UI. example: "🕵🏻‍♂️" type: string name: - description: Case type name. + description: The display name of the case type, shown in the Case Management UI when creating or viewing cases. example: "Investigation" type: string required: @@ -11523,7 +12243,7 @@ components: type: object CaseTypeResourceType: default: case_type - description: Case type resource type + description: JSON:API resource type for case types. enum: - case_type example: case_type @@ -11531,13 +12251,31 @@ components: x-enum-varnames: - CASE_TYPE CaseTypeResponse: - description: Case type response + description: Response containing a single case type. properties: data: $ref: "#/components/schemas/CaseTypeResource" type: object + CaseTypeUpdate: + description: Data object for updating a case type. + properties: + attributes: + $ref: "#/components/schemas/CaseTypeResourceAttributes" + type: + $ref: "#/components/schemas/CaseTypeResourceType" + required: + - type + type: object + CaseTypeUpdateRequest: + description: Request payload for updating a case type. + properties: + data: + $ref: "#/components/schemas/CaseTypeUpdate" + required: + - data + type: object CaseTypesResponse: - description: Case types response. + description: Response containing a list of case types. properties: data: description: List of case types @@ -11572,6 +12310,35 @@ components: required: - data type: object + CaseUpdateComment: + description: Data object for updating a case comment. + properties: + attributes: + $ref: "#/components/schemas/CaseUpdateCommentAttributes" + type: + $ref: "#/components/schemas/CaseResourceType" + required: + - type + - attributes + type: object + CaseUpdateCommentAttributes: + description: Attributes for updating a comment. + properties: + comment: + description: The updated comment message. + example: "Updated comment text" + type: string + required: + - comment + type: object + CaseUpdateCommentRequest: + description: Request payload for updating a comment on a case timeline. + properties: + data: + $ref: "#/components/schemas/CaseUpdateComment" + required: + - data + type: object CaseUpdateCustomAttribute: description: Case update custom attribute properties: @@ -11620,6 +12387,35 @@ components: required: - data type: object + CaseUpdateDueDate: + description: Data object for updating a case's due date. + properties: + attributes: + $ref: "#/components/schemas/CaseUpdateDueDateAttributes" + type: + $ref: "#/components/schemas/CaseResourceType" + required: + - attributes + - type + type: object + CaseUpdateDueDateAttributes: + description: Attributes for setting or clearing a case's due date. + properties: + due_date: + description: "The target resolution date for the case, in `YYYY-MM-DD` format. Set to `null` to clear the due date." + example: "2026-12-31" + type: string + required: + - due_date + type: object + CaseUpdateDueDateRequest: + description: Request payload for updating a case's due date. + properties: + data: + $ref: "#/components/schemas/CaseUpdateDueDate" + required: + - data + type: object CaseUpdatePriority: description: Case priority status properties: @@ -11647,6 +12443,35 @@ components: required: - data type: object + CaseUpdateResolvedReason: + description: Data object for updating a case's resolved reason. + properties: + attributes: + $ref: "#/components/schemas/CaseUpdateResolvedReasonAttributes" + type: + $ref: "#/components/schemas/CaseResourceType" + required: + - attributes + - type + type: object + CaseUpdateResolvedReasonAttributes: + description: Attributes for setting the resolution reason on a security case. + properties: + security_resolved_reason: + description: "The reason the security case was resolved (for example, `FALSE_POSITIVE`, `TRUE_POSITIVE`, `BENIGN_POSITIVE`)." + example: "FALSE_POSITIVE" + type: string + required: + - security_resolved_reason + type: object + CaseUpdateResolvedReasonRequest: + description: Request payload for updating the resolution reason on a closed security case. + properties: + data: + $ref: "#/components/schemas/CaseUpdateResolvedReason" + required: + - data + type: object CaseUpdateStatus: description: Case update status properties: @@ -11704,6 +12529,217 @@ components: required: - data type: object + CaseView: + description: A saved case view that provides a filtered, reusable list of cases matching a specific query. Views act as persistent dashboards for monitoring case subsets. + properties: + attributes: + $ref: "#/components/schemas/CaseViewAttributes" + id: + description: The view's identifier. + example: a1b2c3d4-e5f6-7890-abcd-ef1234567890 + type: string + relationships: + $ref: "#/components/schemas/CaseViewRelationships" + type: + $ref: "#/components/schemas/CaseViewResourceType" + required: + - id + - type + - attributes + type: object + CaseViewAttributes: + description: Attributes of a case view, including the filter query and optional notification rule. + properties: + created_at: + description: Timestamp when the view was created. + example: "2024-01-01T00:00:00.000Z" + format: date-time + readOnly: true + type: string + modified_at: + description: Timestamp when the view was last modified. + format: date-time + readOnly: true + type: string + name: + description: A human-readable name for the view, displayed in the Case Management UI. + example: Open bugs + type: string + np_rule_id: + description: The identifier of a notification rule linked to this view. When set, users subscribed to the view receive alerts for matching cases. + type: string + query: + description: "The search query that determines which cases appear in this view. Uses the same syntax as the Case Management search bar (for example, `status:open priority:P1`)." + example: "status:open type:bug" + type: string + required: + - name + - query + - created_at + type: object + CaseViewCreate: + description: Data object for creating a case view. + properties: + attributes: + $ref: "#/components/schemas/CaseViewCreateAttributes" + type: + $ref: "#/components/schemas/CaseViewResourceType" + required: + - type + - attributes + type: object + CaseViewCreateAttributes: + description: Attributes required to create a case view. + properties: + name: + description: The name of the view. + example: Open bugs + type: string + np_rule_id: + description: The identifier of a notification rule linked to this view. When set, users subscribed to the view receive alerts for matching cases. + type: string + project_id: + description: The UUID of the project this view belongs to. Views are scoped to a single project. + example: e555e290-ed65-49bd-ae18-8acbfcf18db7 + type: string + query: + description: The query used to filter cases in this view. + example: "status:open type:bug" + type: string + required: + - name + - query + - project_id + type: object + CaseViewCreateRequest: + description: Request payload for creating a case view. + properties: + data: + $ref: "#/components/schemas/CaseViewCreate" + required: + - data + type: object + CaseViewRelationships: + description: Related resources for the case view, including the creator, last modifier, and associated project. + properties: + created_by: + $ref: "#/components/schemas/NullableUserRelationship" + modified_by: + $ref: "#/components/schemas/NullableUserRelationship" + project: + $ref: "#/components/schemas/ProjectRelationship" + type: object + CaseViewResourceType: + default: view + description: "JSON:API resource type for case views." + enum: + - view + example: view + type: string + x-enum-varnames: + - VIEW + CaseViewResponse: + description: Response containing a single case view. + properties: + data: + $ref: "#/components/schemas/CaseView" + required: + - data + type: object + CaseViewUpdate: + description: Data object for updating a case view. + properties: + attributes: + $ref: "#/components/schemas/CaseViewUpdateAttributes" + type: + $ref: "#/components/schemas/CaseViewResourceType" + required: + - type + type: object + CaseViewUpdateAttributes: + description: Attributes that can be updated on a case view. All fields are optional; only provided fields are changed. + properties: + name: + description: The name of the view. + type: string + np_rule_id: + description: The identifier of a notification rule linked to this view. When set, users subscribed to the view receive alerts for matching cases. + type: string + query: + description: The query used to filter cases in this view. + type: string + type: object + CaseViewUpdateRequest: + description: Request payload for updating a case view. + properties: + data: + $ref: "#/components/schemas/CaseViewUpdate" + required: + - data + type: object + CaseViewsResponse: + description: Response containing a list of case views. + properties: + data: + description: A list of case views. + items: + $ref: "#/components/schemas/CaseView" + type: array + required: + - data + type: object + CaseWatcher: + description: Represents a user who is subscribed to notifications for a case. Watchers receive updates when the case's status, priority, assignee, or comments change. + properties: + id: + description: The primary identifier of the case watcher. + example: "8146583c-0b5f-11ec-abf8-da7ad0900001" + type: string + relationships: + $ref: "#/components/schemas/CaseWatcherRelationships" + type: + $ref: "#/components/schemas/CaseWatcherResourceType" + required: + - id + - type + - relationships + type: object + CaseWatcherRelationships: + description: Relationships for a case watcher, linking to the underlying user resource. + properties: + user: + $ref: "#/components/schemas/CaseWatcherUserRelationship" + required: + - user + type: object + CaseWatcherResourceType: + default: watcher + description: JSON:API resource type for case watchers. + enum: + - watcher + example: watcher + type: string + x-enum-varnames: + - WATCHER + CaseWatcherUserRelationship: + description: The user relationship for a case watcher. + properties: + data: + $ref: "#/components/schemas/UserRelationshipData" + required: + - data + type: object + CaseWatchersResponse: + description: Response containing the list of users watching a case. + properties: + data: + description: List of case watchers. + items: + $ref: "#/components/schemas/CaseWatcher" + type: array + required: + - data + type: object CasesResponse: description: Response with cases properties: @@ -16879,6 +17915,25 @@ components: - tag_key - updated_at type: object + CostTagDescriptionResponse: + description: Single Cloud Cost Management tag key description returned by the get-by-key endpoint. + example: + data: + attributes: + cloud: aws + created_at: "2026-01-01T12:00:00Z" + description: AWS account that owns this cost. + source: human + tag_key: account_id + updated_at: "2026-01-01T12:00:00Z" + id: account_id + type: cost_tag_description + properties: + data: + $ref: "#/components/schemas/CostTagDescription" + required: + - data + type: object CostTagDescriptionSource: description: Origin of the description. `human` indicates the description was written by a user, `ai_generated` was produced by AI, and `datadog` is a default supplied by Datadog. enum: @@ -16900,6 +17955,50 @@ components: type: string x-enum-varnames: - COST_TAG_DESCRIPTION + CostTagDescriptionUpsertRequest: + description: Request body for creating or updating a Cloud Cost Management tag key description. + example: + data: + attributes: + cloud: aws + description: AWS account that owns this cost. + id: account_id + type: cost_tag_description + properties: + data: + $ref: "#/components/schemas/CostTagDescriptionUpsertRequestData" + required: + - data + type: object + CostTagDescriptionUpsertRequestData: + description: Resource envelope carrying the tag key description being upserted. The `id` is informational; the authoritative tag key is taken from the URL path. + properties: + attributes: + $ref: "#/components/schemas/CostTagDescriptionUpsertRequestDataAttributes" + id: + description: Identifier of the tag key the description applies to. Matches the `tag_key` path parameter. + example: account_id + type: string + type: + $ref: "#/components/schemas/CostTagDescriptionType" + required: + - attributes + - type + type: object + CostTagDescriptionUpsertRequestDataAttributes: + description: Mutable attributes set when creating or updating a Cloud Cost Management tag key description. + properties: + cloud: + description: Cloud provider this description applies to (for example, `aws`). Omit to set the cross-cloud default for the tag key. + example: aws + type: string + description: + description: The human-readable description for the tag key. + example: AWS account that owns this cost. + type: string + required: + - description + type: object CostTagDescriptionsResponse: description: List of Cloud Cost Management tag key descriptions for the organization, optionally filtered to a single cloud provider. example: @@ -20357,7 +21456,7 @@ components: $ref: "#/components/schemas/CsmServerlessCoverageAnalysisData" type: object CustomAttributeConfig: - description: The definition of `CustomAttributeConfig` object. + description: "A custom attribute configuration that defines an organization-specific metadata field on cases. Custom attributes are scoped to a case type and can hold text, URLs, numbers, or predefined select options." properties: attributes: $ref: "#/components/schemas/CustomAttributeConfigResourceAttributes" @@ -20369,22 +21468,22 @@ components: $ref: "#/components/schemas/CustomAttributeConfigResourceType" type: object CustomAttributeConfigAttributesCreate: - description: Custom attribute config resource attributes + description: Attributes required to create a custom attribute configuration. properties: description: - description: Custom attribute description. + description: A description explaining the purpose and expected values for this custom attribute. example: "AWS Region, must be a valid region supported by AWS" type: string display_name: - description: Custom attribute name. + description: The human-readable label shown in the Case Management UI for this custom attribute. example: "AWS Region" type: string is_multi: - description: Whether multiple values can be set + description: "If `true`, this attribute accepts an array of values. If `false`, only a single value is allowed." example: true type: boolean key: - description: Custom attribute key. This will be the value use to search on this custom attribute + description: The programmatic key used to reference this custom attribute in search queries and API calls. example: "aws_region" type: string type: @@ -20396,7 +21495,7 @@ components: - is_multi type: object CustomAttributeConfigCreate: - description: Custom attribute config + description: Data object for creating a custom attribute configuration. properties: attributes: $ref: "#/components/schemas/CustomAttributeConfigAttributesCreate" @@ -20407,7 +21506,7 @@ components: - type type: object CustomAttributeConfigCreateRequest: - description: Custom attribute config create request + description: Request payload for creating a custom attribute configuration. properties: data: $ref: "#/components/schemas/CustomAttributeConfigCreate" @@ -20415,26 +21514,26 @@ components: - data type: object CustomAttributeConfigResourceAttributes: - description: Custom attribute resource attributes + description: "Attributes of a custom attribute configuration, defining an organization-specific metadata field that can be added to cases of a given type." properties: case_type_id: - description: Custom attribute config identifier. + description: The UUID of the case type this custom attribute belongs to. example: "aeadc05e-98a8-11ec-ac2c-da7ad0900001" type: string description: - description: Custom attribute description. + description: A description explaining the purpose and expected values for this custom attribute. example: "AWS Region, must be a valid region supported by AWS" type: string display_name: - description: Custom attribute name. + description: The human-readable label shown in the Case Management UI for this custom attribute. example: "AWS Region" type: string is_multi: - description: Whether multiple values can be set + description: "If `true`, this attribute accepts an array of values. If `false`, only a single value is allowed." example: true type: boolean key: - description: Custom attribute key. This will be the value use to search on this custom attribute + description: The programmatic key used to reference this custom attribute in search queries and API calls. example: "aws_region" type: string type: @@ -20448,7 +21547,7 @@ components: type: object CustomAttributeConfigResourceType: default: custom_attribute - description: Custom attributes config JSON:API resource type + description: JSON:API resource type for custom attribute configurations. enum: - custom_attribute example: custom_attribute @@ -20456,13 +21555,50 @@ components: x-enum-varnames: - CUSTOM_ATTRIBUTE CustomAttributeConfigResponse: - description: Custom attribute config response. + description: Response containing a single custom attribute configuration. properties: data: $ref: "#/components/schemas/CustomAttributeConfig" type: object + CustomAttributeConfigUpdate: + description: Data object for updating a custom attribute configuration. + properties: + attributes: + $ref: "#/components/schemas/CustomAttributeConfigUpdateAttributes" + type: + $ref: "#/components/schemas/CustomAttributeConfigResourceType" + required: + - type + type: object + CustomAttributeConfigUpdateAttributes: + description: Attributes that can be updated on a custom attribute configuration. All fields are optional; only provided fields are changed. + properties: + description: + description: A description explaining the purpose and expected values for this custom attribute. + example: "Updated description." + type: string + display_name: + description: The human-readable label shown in the Case Management UI for this custom attribute. + example: "AWS Region" + type: string + map_from: + description: An external field identifier to auto-populate this attribute from (used for integrations with external systems). + type: string + type: + $ref: "#/components/schemas/CustomAttributeType" + type_data: + $ref: "#/components/schemas/CustomAttributeTypeData" + type: object + CustomAttributeConfigUpdateRequest: + description: Request payload for updating a custom attribute configuration. + properties: + data: + $ref: "#/components/schemas/CustomAttributeConfigUpdate" + required: + - data + type: object CustomAttributeConfigsResponse: - description: Custom attribute configs response. + description: Response containing a list of custom attribute configurations. properties: data: description: List of custom attribute configs of case type @@ -20471,27 +21607,37 @@ components: type: array type: object CustomAttributeMultiNumberValue: - description: Values of multi NUMBER custom attribute + description: An array of numeric values for a multi-value NUMBER-type custom attribute. items: description: NUMBER value format: double type: number type: array CustomAttributeMultiStringValue: - description: Value of multi TEXT/URL/NUMBER/SELECT custom attribute + description: An array of string values for a multi-value TEXT, URL, or SELECT-type custom attribute. items: description: TEXT/URL/NUMBER/SELECT Value type: string type: array CustomAttributeNumberValue: - description: Value of NUMBER custom attribute + description: A numeric value for a NUMBER-type custom attribute. format: double type: number + CustomAttributeSelectOption: + description: A selectable option for a SELECT-type custom attribute. + properties: + value: + description: Option value. + example: "us-east-1" + type: string + required: + - value + type: object CustomAttributeStringValue: - description: Value of TEXT/URL/NUMBER/SELECT custom attribute + description: A string value for a TEXT, URL, or SELECT-type custom attribute. type: string CustomAttributeType: - description: Custom attributes type + description: "The data type of the custom attribute, which determines the allowed values and UI input control." enum: - URL - TEXT @@ -20504,8 +21650,17 @@ components: - TEXT - NUMBER - SELECT + CustomAttributeTypeData: + description: "Type-specific configuration for the custom attribute. For SELECT-type attributes, this contains the list of allowed options." + properties: + options: + description: Options for SELECT type custom attributes. + items: + $ref: "#/components/schemas/CustomAttributeSelectOption" + type: array + type: object CustomAttributeValue: - description: Custom attribute values + description: A typed value for a custom attribute on a specific case. properties: is_multi: description: If true, value must be an array @@ -20521,7 +21676,7 @@ components: - value type: object CustomAttributeValuesUnion: - description: Union of supported value for a custom attribute + description: The value of a custom attribute. The accepted format depends on the attribute's type and whether it accepts multiple values. example: "" oneOf: - $ref: "#/components/schemas/CustomAttributeStringValue" @@ -32666,6 +33821,55 @@ components: required: - type type: object + GenerateCostTagDescriptionResponse: + description: Response wrapping an AI-generated Cloud Cost Management tag key description. + example: + data: + attributes: + description: AWS account that owns this cost. + id: account_id + type: cost_generated_tag_description + properties: + data: + $ref: "#/components/schemas/GeneratedCostTagDescription" + required: + - data + type: object + GeneratedCostTagDescription: + description: AI-generated Cloud Cost Management tag key description returned by the generate endpoint. The result is returned to the client but is not persisted by this endpoint. + properties: + attributes: + $ref: "#/components/schemas/GeneratedCostTagDescriptionAttributes" + id: + description: The tag key the AI description was generated for. + example: account_id + type: string + type: + $ref: "#/components/schemas/GeneratedCostTagDescriptionType" + required: + - attributes + - id + - type + type: object + GeneratedCostTagDescriptionAttributes: + description: Attributes of an AI-generated Cloud Cost Management tag key description. + properties: + description: + description: The AI-generated description for the tag key. + example: AWS account that owns this cost. + type: string + required: + - description + type: object + GeneratedCostTagDescriptionType: + default: cost_generated_tag_description + description: Type of the AI-generated Cloud Cost Management tag description resource. + enum: + - cost_generated_tag_description + example: cost_generated_tag_description + type: string + x-enum-varnames: + - COST_GENERATED_TAG_DESCRIPTION GetActionConnectionResponse: description: The response for found connection properties: @@ -45325,6 +46529,167 @@ components: - type - id type: object + MaintenanceWindow: + description: A maintenance window that defines a scheduled time period during which case-related notifications and automation rules are suppressed. Each maintenance window applies to cases matching a specified query. + properties: + attributes: + $ref: "#/components/schemas/MaintenanceWindowAttributes" + id: + description: The maintenance window's identifier. + example: "a1b2c3d4-e5f6-7890-abcd-ef1234567890" + type: string + type: + $ref: "#/components/schemas/MaintenanceWindowResourceType" + required: + - id + - type + - attributes + type: object + MaintenanceWindowAttributes: + description: Attributes of a maintenance window, including its schedule and the query that determines which cases are affected. + properties: + created_by: + description: The UUID of the user who created this maintenance window. Read-only. + readOnly: true + type: string + end_at: + description: The ISO 8601 timestamp when the maintenance window ends and normal notification behavior resumes. + example: "2026-06-01T06:00:00Z" + format: date-time + type: string + name: + description: "A human-readable name for the maintenance window (for example, `Database migration - Dec 15`)." + example: "Weekly maintenance" + type: string + query: + description: A case search query that determines which cases are affected during the maintenance window. Uses the same syntax as the Case Management search bar. + example: "project:SEC" + type: string + start_at: + description: The ISO 8601 timestamp when the maintenance window begins and notifications start being suppressed. + example: "2026-06-01T00:00:00Z" + format: date-time + type: string + updated_by: + description: The UUID of the user who last modified this maintenance window. Read-only. + readOnly: true + type: string + required: + - name + - query + - start_at + - end_at + type: object + MaintenanceWindowCreate: + description: Data object for creating a maintenance window. + properties: + attributes: + $ref: "#/components/schemas/MaintenanceWindowCreateAttributes" + type: + $ref: "#/components/schemas/MaintenanceWindowResourceType" + required: + - type + - attributes + type: object + MaintenanceWindowCreateAttributes: + description: Attributes required to create a maintenance window. + properties: + end_at: + description: The end time of the maintenance window. + example: "2026-06-01T06:00:00Z" + format: date-time + type: string + name: + description: The name of the maintenance window. + example: "Weekly maintenance" + type: string + query: + description: The query to filter event management cases for this maintenance window. + example: "project:SEC" + type: string + start_at: + description: The start time of the maintenance window. + example: "2026-06-01T00:00:00Z" + format: date-time + type: string + required: + - name + - query + - start_at + - end_at + type: object + MaintenanceWindowCreateRequest: + description: Request payload for creating a maintenance window. + properties: + data: + $ref: "#/components/schemas/MaintenanceWindowCreate" + required: + - data + type: object + MaintenanceWindowResourceType: + default: maintenance_window + description: JSON:API resource type for maintenance windows. + enum: + - maintenance_window + example: maintenance_window + type: string + x-enum-varnames: + - MAINTENANCE_WINDOW + MaintenanceWindowResponse: + description: Response containing a single maintenance window. + properties: + data: + $ref: "#/components/schemas/MaintenanceWindow" + required: + - data + type: object + MaintenanceWindowUpdate: + description: Data object for updating a maintenance window. + properties: + attributes: + $ref: "#/components/schemas/MaintenanceWindowUpdateAttributes" + type: + $ref: "#/components/schemas/MaintenanceWindowResourceType" + required: + - type + type: object + MaintenanceWindowUpdateAttributes: + description: Attributes that can be updated on a maintenance window. All fields are optional; only provided fields are changed. + properties: + end_at: + description: The end time of the maintenance window. + format: date-time + type: string + name: + description: The name of the maintenance window. + type: string + query: + description: The query to filter event management cases for this maintenance window. + type: string + start_at: + description: The start time of the maintenance window. + format: date-time + type: string + type: object + MaintenanceWindowUpdateRequest: + description: Request payload for updating a maintenance window. + properties: + data: + $ref: "#/components/schemas/MaintenanceWindowUpdate" + required: + - data + type: object + MaintenanceWindowsResponse: + description: Response containing a list of maintenance windows. + properties: + data: + description: List of maintenance windows. + items: + $ref: "#/components/schemas/MaintenanceWindow" + type: array + required: + - data + type: object ManagedOrgsData: description: The managed organizations resource. properties: @@ -59450,6 +60815,39 @@ components: required: - data type: object + ProjectFavorite: + description: Represents a case project that the current user has bookmarked for quick access. Favorited projects appear prominently in the Case Management UI. + properties: + id: + description: The UUID of the favorited project. + example: "e555e290-ed65-49bd-ae18-8acbfcf18db7" + type: string + type: + $ref: "#/components/schemas/ProjectFavoriteResourceType" + required: + - id + - type + type: object + ProjectFavoriteResourceType: + default: project_favorite + description: "JSON:API resource type for project favorites." + enum: + - project_favorite + example: project_favorite + type: string + x-enum-varnames: + - PROJECT_FAVORITE + ProjectFavoritesResponse: + description: Response containing the list of projects the current user has favorited. + properties: + data: + description: List of project favorites. + items: + $ref: "#/components/schemas/ProjectFavorite" + type: array + required: + - data + type: object ProjectNotificationSettings: description: Project notification settings. properties: @@ -82696,7 +84094,7 @@ components: - restrictions type: object TimelineCell: - description: timeline cell + description: "Attributes of a timeline cell, representing a single event in a case's chronological activity log (for example, a comment, status change, or assignment update)." properties: author: $ref: "#/components/schemas/TimelineCellAuthor" @@ -82721,11 +84119,11 @@ components: $ref: "#/components/schemas/TimelineCellType" type: object TimelineCellAuthor: - description: author of the timeline cell + description: The author of the timeline cell. Currently only user authors are supported. oneOf: - $ref: "#/components/schemas/TimelineCellAuthorUser" TimelineCellAuthorUser: - description: timeline cell user author + description: A user who authored a timeline cell. properties: content: $ref: "#/components/schemas/TimelineCellAuthorUserContent" @@ -82733,23 +84131,23 @@ components: $ref: "#/components/schemas/TimelineCellAuthorUserType" type: object TimelineCellAuthorUserContent: - description: user author content. + description: Profile information for the user who authored the timeline cell. properties: email: - description: user email + description: The email address of the user. type: string handle: - description: user handle + description: The Datadog handle of the user. type: string id: - description: user UUID + description: The UUID of the user. type: string name: - description: user name + description: The display name of the user. type: string type: object TimelineCellAuthorUserType: - description: user author type. + description: The type of timeline cell author. Currently only `USER` is supported. enum: - USER example: USER @@ -82757,18 +84155,18 @@ components: x-enum-varnames: - USER TimelineCellContent: - description: timeline cell content + description: The content payload of a timeline cell, varying by cell type. oneOf: - $ref: "#/components/schemas/TimelineCellContentComment" TimelineCellContentComment: - description: comment content + description: The content of a comment timeline cell. properties: message: - description: comment message + description: The text content of the comment. Supports Markdown formatting. type: string type: object TimelineCellResource: - description: Timeline cell JSON:API resource + description: A timeline cell resource representing a single entry in a case's activity timeline. properties: attributes: $ref: "#/components/schemas/TimelineCell" @@ -82785,7 +84183,7 @@ components: type: object TimelineCellResourceType: default: timeline_cell - description: Timeline cell JSON:API resource type + description: JSON:API resource type for timeline cells. enum: - timeline_cell example: timeline_cell @@ -82793,7 +84191,7 @@ components: x-enum-varnames: - TIMELINE_CELL TimelineCellType: - description: Timeline cell content type + description: The type of content in the timeline cell. Currently only `COMMENT` is supported in this endpoint. enum: - COMMENT example: COMMENT @@ -82801,7 +84199,7 @@ components: x-enum-varnames: - COMMENT TimelineResponse: - description: Timeline response + description: Response containing the chronological list of timeline cells for a case. properties: data: description: The `TimelineResponse` `data`. @@ -87438,6 +88836,7 @@ components: bits_investigations_read: View Bits AI investigations. bits_investigations_write: Create and manage Bits AI investigations. cases_read: View Cases. + cases_shared_settings_write: Update shared case management settings. cases_write: Create and update cases. ci_visibility_pipelines_write: Create CI Visibility pipeline spans using the API. ci_visibility_read: View CI Visibility. @@ -87459,6 +88858,8 @@ components: embeddable_graphs_share: Generate public links to share embeddable graphs externally. error_tracking_read: Read Error Tracking data. error_tracking_write: Edit Error Tracking issues. + event_correlation_config_read: View event correlation configurations. + event_correlation_config_write: Create and update event correlation configurations. events_read: Read Events data. hosts_read: List hosts and their attributes. incident_notification_settings_read: View Incident Notification Rule Settings. @@ -94287,6 +95688,336 @@ paths: summary: Create a case tags: - Case Management + /api/v2/cases/aggregate: + post: + description: Performs an aggregation query over cases, grouping results by specified fields and returning counts per group along with a total. Useful for dashboards and analytics. + operationId: AggregateCases + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + group_by: + groups: + - "status" + limit: 14 + query_filter: "service:case-api" + type: aggregate + schema: + $ref: "#/components/schemas/CaseAggregateRequest" + description: Case aggregate request payload. + required: true + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + groups: + - group: OPEN + value: + - 42.0 + total: 100.0 + id: agg-result-001 + type: aggregate + schema: + $ref: "#/components/schemas/CaseAggregateResponse" + description: OK + "400": + $ref: "#/components/responses/BadRequestResponse" + "401": + $ref: "#/components/responses/UnauthorizedResponse" + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - cases_read + summary: Aggregate cases + 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/cases/bulk: + post: + description: Applies a single action (such as changing priority, status, assignment, or archiving) to multiple cases at once. The list of case IDs and the action type with its payload are specified in the request body. + operationId: BulkUpdateCases + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + case_ids: + - "case-id-1" + - "case-id-2" + payload: + priority: "P1" + type: priority + type: bulk + schema: + $ref: "#/components/schemas/CaseBulkUpdateRequest" + description: Case bulk update request payload. + required: true + responses: + "200": + description: OK + "400": + $ref: "#/components/responses/BadRequestResponse" + "401": + $ref: "#/components/responses/UnauthorizedResponse" + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - cases_write + summary: Bulk update cases + 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/cases/count: + get: + description: Returns case counts, optionally grouped by one or more fields (for example, status, priority). Supports a query filter to narrow the scope. + operationId: CountCases + parameters: + - description: Filter query for cases. + in: query + name: query_filter + required: false + schema: + type: string + - description: Comma-separated fields to group by. + example: "status,priority" + in: query + name: group_bys + required: false + schema: + type: string + - description: Maximum facet values to return. + in: query + name: limit + required: false + schema: + type: integer + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + groups: + - group: status + group_values: + - count: 42 + value: OPEN + id: count-result-001 + type: count + schema: + $ref: "#/components/schemas/CaseCountResponse" + description: OK + "400": + $ref: "#/components/responses/BadRequestResponse" + "401": + $ref: "#/components/responses/UnauthorizedResponse" + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - cases_read + summary: Count cases + 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/cases/link: + get: + description: Returns all links associated with a case. Links define relationships (for example, BLOCKS) between cases. Requires entity_type and entity_id query parameters. + operationId: ListCaseLinks + parameters: + - description: "The entity type to look up links for. Use `CASE` to find links for a specific case." + in: query + name: entity_type + required: true + schema: + example: "CASE" + type: string + - description: "The UUID of the entity to look up links for." + in: query + name: entity_id + required: true + schema: + example: "bf0cbac6-4c16-4cfb-b6bf-ca5e0ec37a4f" + type: string + - description: "Optional filter to only return links of a specific relationship type (for example, `BLOCKS` or `CAUSES`)." + in: query + name: relationship + required: false + schema: + example: "BLOCKS" + type: string + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - attributes: + child_entity_id: 4417921d-0866-4a38-822c-6f2a0f65f77d + child_entity_type: CASE + parent_entity_id: bf0cbac6-4c16-4cfb-b6bf-ca5e0ec37a4f + parent_entity_type: CASE + relationship: BLOCKS + id: 804cd682-55f6-4541-ab00-b608b282ea7d + type: link + schema: + $ref: "#/components/schemas/CaseLinksResponse" + description: OK + "400": + $ref: "#/components/responses/BadRequestResponse" + "401": + $ref: "#/components/responses/UnauthorizedResponse" + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - cases_read + summary: List case links + 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: Creates a directional link between two cases (for example, case A blocks case B). The parent and child cases and their relationship type must be specified. + operationId: CreateCaseLink + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + child_entity_id: 4417921d-0866-4a38-822c-6f2a0f65f77d + child_entity_type: CASE + parent_entity_id: bf0cbac6-4c16-4cfb-b6bf-ca5e0ec37a4f + parent_entity_type: CASE + relationship: BLOCKS + type: link + schema: + $ref: "#/components/schemas/CaseLinkCreateRequest" + description: "Case link create request." + required: true + responses: + "201": + content: + application/json: + examples: + default: + value: + data: + attributes: + child_entity_id: 4417921d-0866-4a38-822c-6f2a0f65f77d + child_entity_type: CASE + parent_entity_id: bf0cbac6-4c16-4cfb-b6bf-ca5e0ec37a4f + parent_entity_type: CASE + relationship: BLOCKS + id: 804cd682-55f6-4541-ab00-b608b282ea7d + type: link + schema: + $ref: "#/components/schemas/CaseLinkResponse" + description: Created + "400": + $ref: "#/components/responses/BadRequestResponse" + "401": + $ref: "#/components/responses/UnauthorizedResponse" + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - cases_write + summary: Create a case link + 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/cases/link/{link_id}: + delete: + description: Deletes an existing link between cases by link ID. + operationId: DeleteCaseLink + parameters: + - $ref: "#/components/parameters/LinkIDPathParameter" + responses: + "204": + description: No Content + "400": + $ref: "#/components/responses/BadRequestResponse" + "401": + $ref: "#/components/responses/UnauthorizedResponse" + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - cases_write + summary: Delete a case link + 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/cases/projects: get: description: >- @@ -94378,6 +96109,44 @@ paths: summary: Create a project tags: - Case Management + /api/v2/cases/projects/favorites: + get: + description: Returns the list of case projects that the current authenticated user has marked as favorites. + operationId: ListUserCaseProjectFavorites + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - id: e555e290-ed65-49bd-ae18-8acbfcf18db7 + type: project_favorite + schema: + $ref: "#/components/schemas/ProjectFavoritesResponse" + description: OK + "400": + $ref: "#/components/responses/BadRequestResponse" + "401": + $ref: "#/components/responses/UnauthorizedResponse" + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - cases_read + summary: List 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/cases/projects/{project_id}: delete: description: Remove a project using the project's `id`. @@ -94497,6 +96266,65 @@ paths: summary: Update a project tags: - Case Management + /api/v2/cases/projects/{project_id}/favorites: + delete: + description: Removes a case project from the current user's favorites list. + operationId: UnfavoriteCaseProject + parameters: + - $ref: "#/components/parameters/ProjectIDPathParameter" + responses: + "204": + description: No Content + "400": + $ref: "#/components/responses/BadRequestResponse" + "401": + $ref: "#/components/responses/UnauthorizedResponse" + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - cases_write + summary: Unfavorite a project + 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: Marks a case project as a favorite for the current authenticated user. + operationId: FavoriteCaseProject + parameters: + - $ref: "#/components/parameters/ProjectIDPathParameter" + responses: + "204": + description: No Content + "400": + $ref: "#/components/responses/BadRequestResponse" + "401": + $ref: "#/components/responses/UnauthorizedResponse" + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - cases_write + summary: Favorite a project + 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/cases/projects/{project_id}/notification_rules: get: description: >- @@ -94705,6 +96533,418 @@ paths: summary: Update a notification rule tags: - Case Management + /api/v2/cases/projects/{project_id}/rules: + get: + description: Returns all automation rules configured for a project. Automation rules allow automatic actions to be triggered by case events like creation, status transitions, or attribute changes. + operationId: ListCaseAutomationRules + parameters: + - description: The UUID of the project that owns the automation rules. + example: "e555e290-ed65-49bd-ae18-8acbfcf18db7" + in: path + name: project_id + required: true + schema: + type: string + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - attributes: + action: + data: + handle: workflow-handle-123 + type: execute_workflow + created_at: "2024-01-01T00:00:00.000Z" + name: Auto-assign workflow + state: ENABLED + trigger: + type: case_created + id: e6773723-fe58-49ff-9975-dff00f14e28d + type: rule + schema: + $ref: "#/components/schemas/AutomationRulesResponse" + description: OK + "400": + $ref: "#/components/responses/BadRequestResponse" + "401": + $ref: "#/components/responses/UnauthorizedResponse" + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - cases_read + summary: List automation rules + 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: Creates an automation rule for a project. The rule defines a trigger event (for example, case created, status transitioned) and an action to execute. + operationId: CreateCaseAutomationRule + parameters: + - description: The UUID of the project that owns the automation rules. + example: "e555e290-ed65-49bd-ae18-8acbfcf18db7" + in: path + name: project_id + required: true + schema: + type: string + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + action: + data: + handle: workflow-handle-123 + type: execute_workflow + name: Auto-assign workflow + state: ENABLED + trigger: + type: case_created + type: rule + schema: + $ref: "#/components/schemas/AutomationRuleCreateRequest" + description: Automation rule payload. + required: true + responses: + "201": + content: + application/json: + examples: + default: + value: + data: + attributes: + action: + data: + handle: workflow-handle-123 + type: execute_workflow + created_at: "2024-01-01T00:00:00.000Z" + name: Auto-assign workflow + state: ENABLED + trigger: + type: case_created + id: e6773723-fe58-49ff-9975-dff00f14e28d + type: rule + schema: + $ref: "#/components/schemas/AutomationRuleResponse" + description: Created + "400": + $ref: "#/components/responses/BadRequestResponse" + "401": + $ref: "#/components/responses/UnauthorizedResponse" + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - cases_write + summary: Create an automation rule + 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/cases/projects/{project_id}/rules/{rule_id}: + delete: + description: Permanently deletes an automation rule from a project. + operationId: DeleteCaseAutomationRule + parameters: + - description: The UUID of the project that owns the automation rules. + example: "e555e290-ed65-49bd-ae18-8acbfcf18db7" + in: path + name: project_id + required: true + schema: + type: string + - $ref: "#/components/parameters/RuleIDPathParameter" + responses: + "204": + description: No Content + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - cases_write + summary: Delete an automation rule + 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/). + get: + description: Returns a single automation rule identified by its UUID, including its trigger, action, and current state (enabled/disabled). + operationId: GetCaseAutomationRule + parameters: + - description: The UUID of the project that owns the automation rules. + example: "e555e290-ed65-49bd-ae18-8acbfcf18db7" + in: path + name: project_id + required: true + schema: + type: string + - $ref: "#/components/parameters/RuleIDPathParameter" + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + action: + data: + handle: workflow-handle-123 + type: execute_workflow + created_at: "2024-01-01T00:00:00.000Z" + name: Auto-assign workflow + state: ENABLED + trigger: + type: case_created + id: e6773723-fe58-49ff-9975-dff00f14e28d + type: rule + schema: + $ref: "#/components/schemas/AutomationRuleResponse" + description: OK + "400": + $ref: "#/components/responses/BadRequestResponse" + "401": + $ref: "#/components/responses/UnauthorizedResponse" + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - cases_read + summary: Get an automation rule + 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/). + put: + description: Updates the trigger, action, name, or state of an existing automation rule. + operationId: UpdateCaseAutomationRule + parameters: + - description: The UUID of the project that owns the automation rules. + example: "e555e290-ed65-49bd-ae18-8acbfcf18db7" + in: path + name: project_id + required: true + schema: + type: string + - $ref: "#/components/parameters/RuleIDPathParameter" + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + action: + data: + handle: workflow-handle-123 + type: execute_workflow + name: Auto-assign workflow + state: ENABLED + trigger: + type: case_created + type: rule + schema: + $ref: "#/components/schemas/AutomationRuleUpdateRequest" + description: Automation rule payload. + required: true + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + action: + data: + handle: workflow-handle-123 + type: execute_workflow + created_at: "2024-01-01T00:00:00.000Z" + name: Auto-assign workflow + state: ENABLED + trigger: + type: case_created + id: e6773723-fe58-49ff-9975-dff00f14e28d + type: rule + schema: + $ref: "#/components/schemas/AutomationRuleResponse" + description: OK + "400": + $ref: "#/components/responses/BadRequestResponse" + "401": + $ref: "#/components/responses/UnauthorizedResponse" + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - cases_write + summary: Update an automation rule + 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/cases/projects/{project_id}/rules/{rule_id}/disable: + post: + description: Disables an automation rule so it no longer triggers on case events. The rule configuration is preserved. + operationId: DisableCaseAutomationRule + parameters: + - description: The UUID of the project that owns the automation rules. + example: "e555e290-ed65-49bd-ae18-8acbfcf18db7" + in: path + name: project_id + required: true + schema: + type: string + - $ref: "#/components/parameters/RuleIDPathParameter" + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + action: + data: + handle: workflow-handle-123 + type: execute_workflow + created_at: "2024-01-01T00:00:00.000Z" + name: Auto-assign workflow + state: DISABLED + trigger: + type: case_created + id: e6773723-fe58-49ff-9975-dff00f14e28d + type: rule + schema: + $ref: "#/components/schemas/AutomationRuleResponse" + description: OK + "400": + $ref: "#/components/responses/BadRequestResponse" + "401": + $ref: "#/components/responses/UnauthorizedResponse" + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - cases_write + summary: Disable an automation rule + 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/cases/projects/{project_id}/rules/{rule_id}/enable: + post: + description: Enables a previously disabled automation rule so it triggers on matching case events. + operationId: EnableCaseAutomationRule + parameters: + - description: The UUID of the project that owns the automation rules. + example: "e555e290-ed65-49bd-ae18-8acbfcf18db7" + in: path + name: project_id + required: true + schema: + type: string + - $ref: "#/components/parameters/RuleIDPathParameter" + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + action: + data: + handle: workflow-handle-123 + type: execute_workflow + created_at: "2024-01-01T00:00:00.000Z" + name: Auto-assign workflow + state: ENABLED + trigger: + type: case_created + id: e6773723-fe58-49ff-9975-dff00f14e28d + type: rule + schema: + $ref: "#/components/schemas/AutomationRuleResponse" + description: OK + "400": + $ref: "#/components/responses/BadRequestResponse" + "401": + $ref: "#/components/responses/UnauthorizedResponse" + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - cases_write + summary: Enable an automation rule + 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/cases/types: get: description: Get all case types @@ -94833,6 +97073,65 @@ paths: summary: Delete a case type tags: - Case Management Type + put: + description: Updates the name, emoji, or description of an existing case type. + operationId: UpdateCaseType + parameters: + - $ref: "#/components/parameters/CaseTypeIDPathParameter" + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + description: Investigations done in case management + emoji: "🕵🏻‍♂️" + name: Investigation + type: case_type + schema: + $ref: "#/components/schemas/CaseTypeUpdateRequest" + description: Case type payload. + required: true + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + description: Investigations done in case management + emoji: "🕵🏻‍♂️" + name: Investigation + id: 00000000-0000-0000-0000-000000000001 + type: case_type + schema: + $ref: "#/components/schemas/CaseTypeResponse" + description: OK + "400": + $ref: "#/components/responses/BadRequestResponse" + "401": + $ref: "#/components/responses/UnauthorizedResponse" + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - cases_shared_settings_write + summary: Update a case type + tags: + - Case Management Type + 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/cases/types/{case_type_id}/custom_attributes: get: description: Get all custom attribute config of case type @@ -94947,6 +97246,305 @@ paths: summary: Delete custom attributes config tags: - Case Management Attribute + put: + description: Updates the display name, description, type, or options of an existing custom attribute configuration for a case type. + operationId: UpdateCustomAttributeConfig + parameters: + - $ref: "#/components/parameters/CaseTypeIDPathParameter" + - $ref: "#/components/parameters/CaseCustomAttributeIDPathParameter" + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + description: Updated description. + display_name: AWS Region + type: custom_attribute + schema: + $ref: "#/components/schemas/CustomAttributeConfigUpdateRequest" + description: Custom attribute config payload. + required: true + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + case_type_id: 00000000-0000-0000-0000-000000000006 + description: Updated description. + display_name: AWS Region + is_multi: true + key: aws_region + type: TEXT + id: 00000000-0000-0000-0000-000000000005 + type: custom_attribute + schema: + $ref: "#/components/schemas/CustomAttributeConfigResponse" + description: OK + "400": + $ref: "#/components/responses/BadRequestResponse" + "401": + $ref: "#/components/responses/UnauthorizedResponse" + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - cases_shared_settings_write + summary: Update custom attribute config + tags: + - Case Management Attribute + 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/cases/views: + get: + description: Returns all saved case views for a given project. Views are saved search queries that allow quick access to filtered lists of cases. + operationId: ListCaseViews + parameters: + - description: Filter views by project identifier. + example: e555e290-ed65-49bd-ae18-8acbfcf18db7 + in: query + name: project_id + required: true + schema: + type: string + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - attributes: + created_at: "2024-01-01T00:00:00.000Z" + name: Open bugs + query: "status:open type:bug" + id: a1b2c3d4-e5f6-7890-abcd-ef1234567890 + type: view + schema: + $ref: "#/components/schemas/CaseViewsResponse" + description: OK + "400": + $ref: "#/components/responses/BadRequestResponse" + "401": + $ref: "#/components/responses/UnauthorizedResponse" + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - cases_read + summary: List case views + 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: Creates a new saved case view with a name, filter query, and associated project. Optionally, a notification rule can be linked to the view. + operationId: CreateCaseView + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + name: Open bugs + project_id: e555e290-ed65-49bd-ae18-8acbfcf18db7 + query: "status:open type:bug" + type: view + schema: + $ref: "#/components/schemas/CaseViewCreateRequest" + description: Case view payload. + required: true + responses: + "201": + content: + application/json: + examples: + default: + value: + data: + attributes: + created_at: "2024-01-01T00:00:00.000Z" + name: Open bugs + query: "status:open type:bug" + id: a1b2c3d4-e5f6-7890-abcd-ef1234567890 + type: view + schema: + $ref: "#/components/schemas/CaseViewResponse" + description: Created + "400": + $ref: "#/components/responses/BadRequestResponse" + "401": + $ref: "#/components/responses/UnauthorizedResponse" + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - cases_write + summary: Create a case view + 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/cases/views/{view_id}: + delete: + description: Permanently deletes a saved case view. + operationId: DeleteCaseView + parameters: + - $ref: "#/components/parameters/ViewIDPathParameter" + responses: + "204": + description: No Content + "400": + $ref: "#/components/responses/BadRequestResponse" + "401": + $ref: "#/components/responses/UnauthorizedResponse" + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - cases_write + summary: Delete a case view + 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/). + get: + description: Returns a single saved case view identified by its UUID, including its query, associated project, and timestamps. + operationId: GetCaseView + parameters: + - $ref: "#/components/parameters/ViewIDPathParameter" + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + created_at: "2024-01-01T00:00:00.000Z" + name: Open bugs + query: "status:open type:bug" + id: a1b2c3d4-e5f6-7890-abcd-ef1234567890 + type: view + schema: + $ref: "#/components/schemas/CaseViewResponse" + description: OK + "400": + $ref: "#/components/responses/BadRequestResponse" + "401": + $ref: "#/components/responses/UnauthorizedResponse" + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - cases_read + summary: Get a case view + 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/). + put: + description: Updates the name, query, or notification rule of an existing case view. + operationId: UpdateCaseView + parameters: + - $ref: "#/components/parameters/ViewIDPathParameter" + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + name: Updated view name + type: view + schema: + $ref: "#/components/schemas/CaseViewUpdateRequest" + description: Case view payload. + required: true + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + created_at: "2024-01-01T00:00:00.000Z" + name: Updated view name + query: "status:open type:bug" + id: a1b2c3d4-e5f6-7890-abcd-ef1234567890 + type: view + schema: + $ref: "#/components/schemas/CaseViewResponse" + description: OK + "400": + $ref: "#/components/responses/BadRequestResponse" + "401": + $ref: "#/components/responses/UnauthorizedResponse" + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - cases_write + summary: Update a case view + 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/cases/{case_id}: get: description: >- @@ -95265,6 +97863,50 @@ paths: summary: Delete case comment tags: - Case Management + put: + description: Updates the text content of an existing comment on a case timeline. The comment is identified by its cell ID. + operationId: UpdateCaseComment + parameters: + - $ref: "#/components/parameters/CaseIDPathParameter" + - $ref: "#/components/parameters/CellIDPathParameter" + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + comment: Updated comment text + type: case + schema: + $ref: "#/components/schemas/CaseUpdateCommentRequest" + description: Case update comment payload. + required: true + responses: + "200": + description: OK + "400": + $ref: "#/components/responses/BadRequestResponse" + "401": + $ref: "#/components/responses/UnauthorizedResponse" + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - cases_write + summary: Update case comment + 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/cases/{case_id}/custom_attributes/{custom_attribute_key}: delete: description: Delete custom attribute from case @@ -95361,13 +98003,224 @@ paths: $ref: "#/components/schemas/CaseResponse" description: OK "400": - $ref: "#/components/responses/BadRequestResponse" + $ref: "#/components/responses/BadRequestResponse" + "401": + $ref: "#/components/responses/UnauthorizedResponse" + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - cases_write + summary: Update case custom attribute + tags: + - Case Management + /api/v2/cases/{case_id}/description: + post: + description: Update case description + operationId: UpdateCaseDescription + parameters: + - $ref: "#/components/parameters/CaseIDPathParameter" + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + description: Seeing some weird memory increase... We shouldn't ignore this + type: case + schema: + $ref: "#/components/schemas/CaseUpdateDescriptionRequest" + description: Case description update payload + required: true + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + created_at: "2024-01-01T00:00:00+00:00" + key: CASEM-1234 + priority: NOT_DEFINED + status: OPEN + status_name: Open + title: Memory leak investigation on API + id: 00000000-0000-0000-0000-000000000001 + relationships: + project: + data: + id: 00000000-0000-0000-0000-000000000002 + type: project + type: case + schema: + $ref: "#/components/schemas/CaseResponse" + description: OK + "400": + $ref: "#/components/responses/BadRequestResponse" + "401": + $ref: "#/components/responses/UnauthorizedResponse" + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - cases_write + summary: Update case description + tags: + - Case Management + /api/v2/cases/{case_id}/due_date: + post: + description: Sets or updates the due date for a case. The due date is a calendar date (without a time component) indicating when the case should be resolved. + operationId: UpdateCaseDueDate + parameters: + - $ref: "#/components/parameters/CaseIDPathParameter" + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + due_date: "2026-12-31" + type: case + schema: + $ref: "#/components/schemas/CaseUpdateDueDateRequest" + description: Case due date update payload. + required: true + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + created_at: "2024-01-01T00:00:00+00:00" + key: CASEM-1234 + priority: NOT_DEFINED + status: OPEN + status_name: Open + title: Memory leak investigation on API + id: 00000000-0000-0000-0000-000000000001 + relationships: + project: + data: + id: 00000000-0000-0000-0000-000000000002 + type: project + type: case + schema: + $ref: "#/components/schemas/CaseResponse" + description: OK + "400": + $ref: "#/components/responses/BadRequestResponse" + "401": + $ref: "#/components/responses/UnauthorizedResponse" + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - cases_write + summary: Update case due date + 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/cases/{case_id}/insights: + delete: + description: Removes one or more previously added insights from a case by specifying their type and resource identifier in the request body. + operationId: RemoveCaseInsights + parameters: + - $ref: "#/components/parameters/CaseIDPathParameter" + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + insights: + - ref: "/monitors/12345?q=total" + resource_id: "12345" + type: SECURITY_SIGNAL + type: case + schema: + $ref: "#/components/schemas/CaseInsightsRequest" + description: Case insights request. + required: true + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + created_at: "2024-01-01T00:00:00+00:00" + key: CASEM-1234 + priority: NOT_DEFINED + status: OPEN + status_name: Open + title: Memory leak investigation on API + id: 00000000-0000-0000-0000-000000000001 + relationships: + project: + data: + id: 00000000-0000-0000-0000-000000000002 + type: project + type: case + schema: + $ref: "#/components/schemas/CaseResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request "401": - $ref: "#/components/responses/UnauthorizedResponse" + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Unauthorized "403": - $ref: "#/components/responses/ForbiddenResponse" + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Forbidden "404": - $ref: "#/components/responses/NotFoundResponse" + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Not Found "429": $ref: "#/components/responses/TooManyRequestsResponse" security: @@ -95375,13 +98228,16 @@ paths: appKeyAuth: [] - AuthZ: - cases_write - summary: Update case custom attribute + summary: Remove insights from a case tags: - Case Management - /api/v2/cases/{case_id}/description: - post: - description: Update case description - operationId: UpdateCaseDescription + 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/). + put: + description: >- + Adds one or more insights to a case. Insights are references to related Datadog resources (such as monitors, security signals, incidents, or error tracking issues) that provide investigative context. Up to 100 insights can be added per request. Each insight requires a type (see `CaseInsightType` for allowed values), a ref (URL path to the resource), and a resource_id. + operationId: AddCaseInsights parameters: - $ref: "#/components/parameters/CaseIDPathParameter" requestBody: @@ -95392,11 +98248,14 @@ paths: value: data: attributes: - description: Seeing some weird memory increase... We shouldn't ignore this + insights: + - ref: "/monitors/12345?q=total" + resource_id: "12345" + type: SECURITY_SIGNAL type: case schema: - $ref: "#/components/schemas/CaseUpdateDescriptionRequest" - description: Case description update payload + $ref: "#/components/schemas/CaseInsightsRequest" + description: Case insights request. required: true responses: "200": @@ -95424,13 +98283,29 @@ paths: $ref: "#/components/schemas/CaseResponse" description: OK "400": - $ref: "#/components/responses/BadRequestResponse" + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request "401": - $ref: "#/components/responses/UnauthorizedResponse" + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Unauthorized "403": - $ref: "#/components/responses/ForbiddenResponse" + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Forbidden "404": - $ref: "#/components/responses/NotFoundResponse" + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Not Found "429": $ref: "#/components/responses/TooManyRequestsResponse" security: @@ -95438,9 +98313,12 @@ paths: appKeyAuth: [] - AuthZ: - cases_write - summary: Update case description + summary: Add insights to a case 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/cases/{case_id}/priority: post: description: Update case priority @@ -95944,6 +98822,72 @@ paths: 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/cases/{case_id}/resolved_reason: + post: + description: Sets the resolved reason for a security case (for example, FALSE_POSITIVE, TRUE_POSITIVE). Applicable to security-type cases. + operationId: UpdateCaseResolvedReason + parameters: + - $ref: "#/components/parameters/CaseIDPathParameter" + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + security_resolved_reason: "FALSE_POSITIVE" + type: case + schema: + $ref: "#/components/schemas/CaseUpdateResolvedReasonRequest" + description: Case resolved reason update payload. + required: true + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + created_at: "2024-01-01T00:00:00+00:00" + key: CASEM-1234 + priority: NOT_DEFINED + status: OPEN + status_name: Open + title: Memory leak investigation on API + id: 00000000-0000-0000-0000-000000000001 + relationships: + project: + data: + id: 00000000-0000-0000-0000-000000000002 + type: project + type: case + schema: + $ref: "#/components/schemas/CaseResponse" + description: OK + "400": + $ref: "#/components/responses/BadRequestResponse" + "401": + $ref: "#/components/responses/UnauthorizedResponse" + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - cases_write + summary: Update case resolved reason + 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/cases/{case_id}/status: post: description: Update case status @@ -96008,6 +98952,72 @@ paths: summary: Update case status tags: - Case Management + /api/v2/cases/{case_id}/timelines: + get: + description: Returns the timeline of events for a case, including comments, status changes, and other activity. Supports pagination and sort order. + operationId: ListCaseTimeline + parameters: + - $ref: "#/components/parameters/CaseIDPathParameter" + - description: Number of timeline cells to return per page. + in: query + name: page[size] + required: false + schema: + default: 100 + type: integer + - description: Zero-based page number for pagination. + in: query + name: page[number] + required: false + schema: + default: 0 + type: integer + - description: "If `true`, returns timeline cells in chronological order (oldest first). Defaults to `false` (newest first)." + in: query + name: sort[ascending] + required: false + schema: + default: false + type: boolean + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - attributes: + cell_content: + message: This is a comment + created_at: "2024-01-01T00:00:00+00:00" + type: COMMENT + id: 00000000-0000-0000-0000-000000000001 + type: timeline_cell + schema: + $ref: "#/components/schemas/TimelineResponse" + description: OK + "400": + $ref: "#/components/responses/BadRequestResponse" + "401": + $ref: "#/components/responses/UnauthorizedResponse" + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - cases_read + summary: Get case timeline + 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/cases/{case_id}/title: post: description: Update case title @@ -96193,6 +99203,112 @@ paths: summary: Unassign case tags: - Case Management + /api/v2/cases/{case_id}/watchers: + get: + description: Returns the list of users who are watching a case. Watchers receive notifications about updates to the case. + operationId: ListCaseWatchers + parameters: + - $ref: "#/components/parameters/CaseIDPathParameter" + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - id: 8146583c-0b5f-11ec-abf8-da7ad0900001 + relationships: + user: + data: + id: 8146583c-0b5f-11ec-abf8-da7ad0900001 + type: user + type: watcher + schema: + $ref: "#/components/schemas/CaseWatchersResponse" + description: OK + "400": + $ref: "#/components/responses/BadRequestResponse" + "401": + $ref: "#/components/responses/UnauthorizedResponse" + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - cases_read + summary: List case watchers + 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/cases/{case_id}/watchers/{user_uuid}: + delete: + description: Removes a user from the watchers list of a case. The user no longer receives notifications about updates to the case. + operationId: UnwatchCase + parameters: + - $ref: "#/components/parameters/CaseIDPathParameter" + - $ref: "#/components/parameters/UserUUIDPathParameter" + responses: + "204": + description: No Content + "400": + $ref: "#/components/responses/BadRequestResponse" + "401": + $ref: "#/components/responses/UnauthorizedResponse" + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - cases_write + summary: Unwatch a case + 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: Adds a user (identified by their UUID) as a watcher of a case. The user receives notifications about subsequent updates to the case. + operationId: WatchCase + parameters: + - $ref: "#/components/parameters/CaseIDPathParameter" + - $ref: "#/components/parameters/UserUUIDPathParameter" + responses: + "201": + description: Created + "400": + $ref: "#/components/responses/BadRequestResponse" + "401": + $ref: "#/components/responses/UnauthorizedResponse" + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - cases_write + summary: Watch a case + 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/catalog/entity: get: description: Get a list of entities from Software Catalog. @@ -101607,6 +104723,226 @@ paths: operator: OR permissions: - cloud_cost_management_read + /api/v2/cost/tag_descriptions/{tag_key}: + delete: + description: Delete a Cloud Cost Management tag key description. When `cloud` is omitted, deletes every description for the tag key, falling back to Datadog's global default when available. When `cloud` is provided, deletes only the description scoped to that cloud provider. + operationId: DeleteCostTagDescriptionByKey + parameters: + - description: The tag key whose description is being deleted. + in: path + name: tag_key + required: true + schema: + type: string + - description: Cloud provider to scope the deletion to (for example, `aws`). Omit to delete every description for the tag key. + in: query + name: cloud + required: false + schema: + type: string + responses: + "204": + description: No Content + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: Bad Request + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: Forbidden + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - cloud_cost_management_write + summary: Delete a Cloud Cost Management tag description + tags: + - Cloud Cost Management + "x-permission": + operator: OR + permissions: + - cloud_cost_management_write + get: + description: Get the Cloud Cost Management description for a single tag key. Use `filter[cloud]` to scope the lookup to a specific cloud provider; when omitted, the response resolves the description in fallback order (cloud-specific organization override, then cloudless organization default, then Datadog's global default). + operationId: GetCostTagDescriptionByKey + parameters: + - description: The tag key whose description is being fetched. + in: path + name: tag_key + required: true + schema: + type: string + - description: Cloud provider to scope the lookup to (for example, `aws`). Omit to use the resolved fallback. + in: query + name: filter[cloud] + required: false + schema: + type: string + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + cloud: aws + created_at: "2026-01-01T12:00:00Z" + description: AWS account that owns this cost. + source: human + tag_key: account_id + updated_at: "2026-01-01T12:00:00Z" + id: account_id + type: cost_tag_description + schema: + $ref: "#/components/schemas/CostTagDescriptionResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: Bad Request + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: Forbidden + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: Not Found + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - cloud_cost_management_read + summary: Get a Cloud Cost Management tag description + tags: + - Cloud Cost Management + "x-permission": + operator: OR + permissions: + - cloud_cost_management_read + put: + description: Create or update a Cloud Cost Management tag key description. The new description and optional cloud scoping are supplied in the request body. Omit `cloud` to set a cross-cloud default for the tag key. + operationId: UpsertCostTagDescriptionByKey + parameters: + - description: The tag key whose description is being upserted. + in: path + name: tag_key + required: true + schema: + type: string + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + cloud: aws + description: AWS account that owns this cost. + id: account_id + type: cost_tag_description + schema: + $ref: "#/components/schemas/CostTagDescriptionUpsertRequest" + required: true + responses: + "204": + description: No Content + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: Bad Request + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: Forbidden + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - cloud_cost_management_write + summary: Upsert a Cloud Cost Management tag description + tags: + - Cloud Cost Management + "x-permission": + operator: OR + permissions: + - cloud_cost_management_write + /api/v2/cost/tag_descriptions/{tag_key}/generate: + get: + description: Use AI to draft a Cloud Cost Management tag key description based on associated cost data. The generated description is returned in the response and is not persisted by this endpoint; follow up with `UpsertCostTagDescriptionByKey` to save it. + operationId: GenerateCostTagDescriptionByKey + parameters: + - description: The tag key to generate an AI description for. + in: path + name: tag_key + required: true + schema: + type: string + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + description: AWS account that owns this cost. + id: account_id + type: cost_generated_tag_description + schema: + $ref: "#/components/schemas/GenerateCostTagDescriptionResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: Bad Request + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: Forbidden + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - cloud_cost_management_read + summary: Generate a Cloud Cost Management tag description + tags: + - Cloud Cost Management + "x-permission": + operator: OR + permissions: + - cloud_cost_management_read /api/v2/cost/tag_keys: get: description: List Cloud Cost Management tag keys. @@ -119836,6 +123172,199 @@ paths: operator: OR permissions: - logs_read_data + /api/v2/maintenance_windows: + get: + description: Returns all configured maintenance windows for event management cases. Maintenance windows define time periods during which case notifications and automation rules are suppressed for cases matching a given query. + operationId: ListMaintenanceWindows + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - attributes: + end_at: "2026-06-01T06:00:00Z" + name: Weekly maintenance + query: "project:SEC" + start_at: "2026-06-01T00:00:00Z" + id: a1b2c3d4-e5f6-7890-abcd-ef1234567890 + type: maintenance_window + schema: + $ref: "#/components/schemas/MaintenanceWindowsResponse" + description: OK + "400": + $ref: "#/components/responses/BadRequestResponse" + "401": + $ref: "#/components/responses/UnauthorizedResponse" + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - event_correlation_config_read + summary: List maintenance windows + 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: Creates a maintenance window for event management cases with a name, case filter query, and time range (start and end). + operationId: CreateMaintenanceWindow + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + end_at: "2026-06-01T06:00:00Z" + name: Weekly maintenance + query: "project:SEC" + start_at: "2026-06-01T00:00:00Z" + type: maintenance_window + schema: + $ref: "#/components/schemas/MaintenanceWindowCreateRequest" + description: Maintenance window payload. + required: true + responses: + "201": + content: + application/json: + examples: + default: + value: + data: + attributes: + end_at: "2026-06-01T06:00:00Z" + name: Weekly maintenance + query: "project:SEC" + start_at: "2026-06-01T00:00:00Z" + id: a1b2c3d4-e5f6-7890-abcd-ef1234567890 + type: maintenance_window + schema: + $ref: "#/components/schemas/MaintenanceWindowResponse" + description: Created + "400": + $ref: "#/components/responses/BadRequestResponse" + "401": + $ref: "#/components/responses/UnauthorizedResponse" + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - event_correlation_config_write + summary: Create a maintenance window + 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/maintenance_windows/{maintenance_window_id}: + delete: + description: Permanently deletes a maintenance window. + operationId: DeleteMaintenanceWindow + parameters: + - $ref: "#/components/parameters/MaintenanceWindowIDPathParameter" + responses: + "204": + description: No Content + "400": + $ref: "#/components/responses/BadRequestResponse" + "401": + $ref: "#/components/responses/UnauthorizedResponse" + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - event_correlation_config_write + summary: Delete a maintenance window + 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/). + put: + description: Updates the name, query, start time, or end time of an existing maintenance window. + operationId: UpdateMaintenanceWindow + parameters: + - $ref: "#/components/parameters/MaintenanceWindowIDPathParameter" + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + end_at: "2026-06-01T06:00:00Z" + name: Weekly maintenance + query: "project:SEC" + start_at: "2026-06-01T00:00:00Z" + type: maintenance_window + schema: + $ref: "#/components/schemas/MaintenanceWindowUpdateRequest" + description: Maintenance window payload. + required: true + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + end_at: "2026-06-01T06:00:00Z" + name: Weekly maintenance + query: "project:SEC" + start_at: "2026-06-01T00:00:00Z" + id: a1b2c3d4-e5f6-7890-abcd-ef1234567890 + type: maintenance_window + schema: + $ref: "#/components/schemas/MaintenanceWindowResponse" + description: OK + "400": + $ref: "#/components/responses/BadRequestResponse" + "401": + $ref: "#/components/responses/UnauthorizedResponse" + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - event_correlation_config_write + summary: Update a maintenance window + 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/metrics: get: description: |- diff --git a/examples/v2/case-management-attribute/UpdateCustomAttributeConfig.java b/examples/v2/case-management-attribute/UpdateCustomAttributeConfig.java new file mode 100644 index 00000000000..d7e1ec64014 --- /dev/null +++ b/examples/v2/case-management-attribute/UpdateCustomAttributeConfig.java @@ -0,0 +1,52 @@ +// Update custom attribute config returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.CaseManagementAttributeApi; +import com.datadog.api.client.v2.model.CustomAttributeConfigResourceType; +import com.datadog.api.client.v2.model.CustomAttributeConfigResponse; +import com.datadog.api.client.v2.model.CustomAttributeConfigUpdate; +import com.datadog.api.client.v2.model.CustomAttributeConfigUpdateAttributes; +import com.datadog.api.client.v2.model.CustomAttributeConfigUpdateRequest; +import com.datadog.api.client.v2.model.CustomAttributeSelectOption; +import com.datadog.api.client.v2.model.CustomAttributeType; +import com.datadog.api.client.v2.model.CustomAttributeTypeData; +import java.util.Collections; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.updateCustomAttributeConfig", true); + CaseManagementAttributeApi apiInstance = new CaseManagementAttributeApi(defaultClient); + + CustomAttributeConfigUpdateRequest body = + new CustomAttributeConfigUpdateRequest() + .data( + new CustomAttributeConfigUpdate() + .attributes( + new CustomAttributeConfigUpdateAttributes() + .description("Updated description.") + .displayName("AWS Region") + .type(CustomAttributeType.NUMBER) + .typeData( + new CustomAttributeTypeData() + .options( + Collections.singletonList( + new CustomAttributeSelectOption().value("us-east-1"))))) + .type(CustomAttributeConfigResourceType.CUSTOM_ATTRIBUTE)); + + try { + CustomAttributeConfigResponse result = + apiInstance.updateCustomAttributeConfig( + "f98a5a5b-e0ff-45d4-b2f5-afe6e74de505", "f98a5a5b-e0ff-45d4-b2f5-afe6e74de505", body); + System.out.println(result); + } catch (ApiException e) { + System.err.println( + "Exception when calling CaseManagementAttributeApi#updateCustomAttributeConfig"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/case-management-type/UpdateCaseType.java b/examples/v2/case-management-type/UpdateCaseType.java new file mode 100644 index 00000000000..cc15dbfd441 --- /dev/null +++ b/examples/v2/case-management-type/UpdateCaseType.java @@ -0,0 +1,41 @@ +// Update a case type returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.CaseManagementTypeApi; +import com.datadog.api.client.v2.model.CaseTypeResourceAttributes; +import com.datadog.api.client.v2.model.CaseTypeResourceType; +import com.datadog.api.client.v2.model.CaseTypeResponse; +import com.datadog.api.client.v2.model.CaseTypeUpdate; +import com.datadog.api.client.v2.model.CaseTypeUpdateRequest; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.updateCaseType", true); + CaseManagementTypeApi apiInstance = new CaseManagementTypeApi(defaultClient); + + CaseTypeUpdateRequest body = + new CaseTypeUpdateRequest() + .data( + new CaseTypeUpdate() + .attributes( + new CaseTypeResourceAttributes() + .description("Investigations done in case management") + .emoji("🕵🏻‍♂️") + .name("Investigation")) + .type(CaseTypeResourceType.CASE_TYPE)); + + try { + CaseTypeResponse result = + apiInstance.updateCaseType("f98a5a5b-e0ff-45d4-b2f5-afe6e74de505", body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling CaseManagementTypeApi#updateCaseType"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/case-management/AddCaseInsights.java b/examples/v2/case-management/AddCaseInsights.java new file mode 100644 index 00000000000..e6f26f68176 --- /dev/null +++ b/examples/v2/case-management/AddCaseInsights.java @@ -0,0 +1,47 @@ +// Add insights to a case 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.CaseInsight; +import com.datadog.api.client.v2.model.CaseInsightType; +import com.datadog.api.client.v2.model.CaseInsightsAttributes; +import com.datadog.api.client.v2.model.CaseInsightsData; +import com.datadog.api.client.v2.model.CaseInsightsRequest; +import com.datadog.api.client.v2.model.CaseResourceType; +import com.datadog.api.client.v2.model.CaseResponse; +import java.util.Collections; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.addCaseInsights", true); + CaseManagementApi apiInstance = new CaseManagementApi(defaultClient); + + CaseInsightsRequest body = + new CaseInsightsRequest() + .data( + new CaseInsightsData() + .attributes( + new CaseInsightsAttributes() + .insights( + Collections.singletonList( + new CaseInsight() + .ref("/monitors/12345?q=total") + .resourceId("12345") + .type(CaseInsightType.SECURITY_SIGNAL)))) + .type(CaseResourceType.CASE)); + + try { + CaseResponse result = + apiInstance.addCaseInsights("f98a5a5b-e0ff-45d4-b2f5-afe6e74de504", body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling CaseManagementApi#addCaseInsights"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/case-management/AggregateCases.java b/examples/v2/case-management/AggregateCases.java new file mode 100644 index 00000000000..0836c865807 --- /dev/null +++ b/examples/v2/case-management/AggregateCases.java @@ -0,0 +1,44 @@ +// Aggregate cases 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.CaseAggregateGroupBy; +import com.datadog.api.client.v2.model.CaseAggregateRequest; +import com.datadog.api.client.v2.model.CaseAggregateRequestAttributes; +import com.datadog.api.client.v2.model.CaseAggregateRequestData; +import com.datadog.api.client.v2.model.CaseAggregateResourceType; +import com.datadog.api.client.v2.model.CaseAggregateResponse; +import java.util.Collections; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.aggregateCases", true); + CaseManagementApi apiInstance = new CaseManagementApi(defaultClient); + + CaseAggregateRequest body = + new CaseAggregateRequest() + .data( + new CaseAggregateRequestData() + .attributes( + new CaseAggregateRequestAttributes() + .groupBy( + new CaseAggregateGroupBy() + .groups(Collections.singletonList("status")) + .limit(14)) + .queryFilter("service:case-api")) + .type(CaseAggregateResourceType.AGGREGATE)); + + try { + CaseAggregateResponse result = apiInstance.aggregateCases(body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling CaseManagementApi#aggregateCases"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/case-management/BulkUpdateCases.java b/examples/v2/case-management/BulkUpdateCases.java new file mode 100644 index 00000000000..c034b632d94 --- /dev/null +++ b/examples/v2/case-management/BulkUpdateCases.java @@ -0,0 +1,41 @@ +// Bulk update cases 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.CaseBulkActionType; +import com.datadog.api.client.v2.model.CaseBulkResourceType; +import com.datadog.api.client.v2.model.CaseBulkUpdateRequest; +import com.datadog.api.client.v2.model.CaseBulkUpdateRequestAttributes; +import com.datadog.api.client.v2.model.CaseBulkUpdateRequestData; +import java.util.Arrays; +import java.util.Map; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.bulkUpdateCases", true); + CaseManagementApi apiInstance = new CaseManagementApi(defaultClient); + + CaseBulkUpdateRequest body = + new CaseBulkUpdateRequest() + .data( + new CaseBulkUpdateRequestData() + .attributes( + new CaseBulkUpdateRequestAttributes() + .caseIds(Arrays.asList("case-id-1", "case-id-2")) + .payload(Map.ofEntries(Map.entry("priority", "P1"))) + .type(CaseBulkActionType.PRIORITY)) + .type(CaseBulkResourceType.BULK)); + + try { + apiInstance.bulkUpdateCases(body); + } catch (ApiException e) { + System.err.println("Exception when calling CaseManagementApi#bulkUpdateCases"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/case-management/CountCases.java b/examples/v2/case-management/CountCases.java new file mode 100644 index 00000000000..70e1bdd3993 --- /dev/null +++ b/examples/v2/case-management/CountCases.java @@ -0,0 +1,25 @@ +// Count cases 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.CaseCountResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.countCases", true); + CaseManagementApi apiInstance = new CaseManagementApi(defaultClient); + + try { + CaseCountResponse result = apiInstance.countCases(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling CaseManagementApi#countCases"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/case-management/CreateCaseAutomationRule.java b/examples/v2/case-management/CreateCaseAutomationRule.java new file mode 100644 index 00000000000..53a056fc923 --- /dev/null +++ b/examples/v2/case-management/CreateCaseAutomationRule.java @@ -0,0 +1,57 @@ +// Create an automation rule returns "Created" 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.AutomationRuleAction; +import com.datadog.api.client.v2.model.AutomationRuleActionData; +import com.datadog.api.client.v2.model.AutomationRuleActionType; +import com.datadog.api.client.v2.model.AutomationRuleCreate; +import com.datadog.api.client.v2.model.AutomationRuleCreateAttributes; +import com.datadog.api.client.v2.model.AutomationRuleCreateRequest; +import com.datadog.api.client.v2.model.AutomationRuleResponse; +import com.datadog.api.client.v2.model.AutomationRuleTrigger; +import com.datadog.api.client.v2.model.AutomationRuleTriggerData; +import com.datadog.api.client.v2.model.AutomationRuleTriggerType; +import com.datadog.api.client.v2.model.CaseAutomationRuleResourceType; +import com.datadog.api.client.v2.model.CaseAutomationRuleState; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.createCaseAutomationRule", true); + CaseManagementApi apiInstance = new CaseManagementApi(defaultClient); + + AutomationRuleCreateRequest body = + new AutomationRuleCreateRequest() + .data( + new AutomationRuleCreate() + .attributes( + new AutomationRuleCreateAttributes() + .action( + new AutomationRuleAction() + .data( + new AutomationRuleActionData() + .handle("workflow-handle-123")) + .type(AutomationRuleActionType.EXECUTE_WORKFLOW)) + .name("Auto-assign workflow") + .state(CaseAutomationRuleState.ENABLED) + .trigger( + new AutomationRuleTrigger() + .data(new AutomationRuleTriggerData()) + .type(AutomationRuleTriggerType.CASE_CREATED))) + .type(CaseAutomationRuleResourceType.RULE)); + + try { + AutomationRuleResponse result = + apiInstance.createCaseAutomationRule("e555e290-ed65-49bd-ae18-8acbfcf18db7", body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling CaseManagementApi#createCaseAutomationRule"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/case-management/CreateCaseLink.java b/examples/v2/case-management/CreateCaseLink.java new file mode 100644 index 00000000000..b4962577b96 --- /dev/null +++ b/examples/v2/case-management/CreateCaseLink.java @@ -0,0 +1,42 @@ +// Create a case link returns "Created" 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.CaseLinkAttributes; +import com.datadog.api.client.v2.model.CaseLinkCreate; +import com.datadog.api.client.v2.model.CaseLinkCreateRequest; +import com.datadog.api.client.v2.model.CaseLinkResourceType; +import com.datadog.api.client.v2.model.CaseLinkResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.createCaseLink", true); + CaseManagementApi apiInstance = new CaseManagementApi(defaultClient); + + CaseLinkCreateRequest body = + new CaseLinkCreateRequest() + .data( + new CaseLinkCreate() + .attributes( + new CaseLinkAttributes() + .childEntityId("4417921d-0866-4a38-822c-6f2a0f65f77d") + .childEntityType("CASE") + .parentEntityId("bf0cbac6-4c16-4cfb-b6bf-ca5e0ec37a4f") + .parentEntityType("CASE") + .relationship("BLOCKS")) + .type(CaseLinkResourceType.LINK)); + + try { + CaseLinkResponse result = apiInstance.createCaseLink(body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling CaseManagementApi#createCaseLink"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/case-management/CreateCaseView.java b/examples/v2/case-management/CreateCaseView.java new file mode 100644 index 00000000000..0634693048e --- /dev/null +++ b/examples/v2/case-management/CreateCaseView.java @@ -0,0 +1,40 @@ +// Create a case view returns "Created" 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.CaseViewCreate; +import com.datadog.api.client.v2.model.CaseViewCreateAttributes; +import com.datadog.api.client.v2.model.CaseViewCreateRequest; +import com.datadog.api.client.v2.model.CaseViewResourceType; +import com.datadog.api.client.v2.model.CaseViewResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.createCaseView", true); + CaseManagementApi apiInstance = new CaseManagementApi(defaultClient); + + CaseViewCreateRequest body = + new CaseViewCreateRequest() + .data( + new CaseViewCreate() + .attributes( + new CaseViewCreateAttributes() + .name("Open bugs") + .projectId("e555e290-ed65-49bd-ae18-8acbfcf18db7") + .query("status:open type:bug")) + .type(CaseViewResourceType.VIEW)); + + try { + CaseViewResponse result = apiInstance.createCaseView(body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling CaseManagementApi#createCaseView"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/case-management/CreateMaintenanceWindow.java b/examples/v2/case-management/CreateMaintenanceWindow.java new file mode 100644 index 00000000000..acbc98018f7 --- /dev/null +++ b/examples/v2/case-management/CreateMaintenanceWindow.java @@ -0,0 +1,42 @@ +// Create a maintenance window returns "Created" 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.MaintenanceWindowCreate; +import com.datadog.api.client.v2.model.MaintenanceWindowCreateAttributes; +import com.datadog.api.client.v2.model.MaintenanceWindowCreateRequest; +import com.datadog.api.client.v2.model.MaintenanceWindowResourceType; +import com.datadog.api.client.v2.model.MaintenanceWindowResponse; +import java.time.OffsetDateTime; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.createMaintenanceWindow", true); + CaseManagementApi apiInstance = new CaseManagementApi(defaultClient); + + MaintenanceWindowCreateRequest body = + new MaintenanceWindowCreateRequest() + .data( + new MaintenanceWindowCreate() + .attributes( + new MaintenanceWindowCreateAttributes() + .endAt(OffsetDateTime.parse("2026-06-01T06:00:00Z")) + .name("Weekly maintenance") + .query("project:SEC") + .startAt(OffsetDateTime.parse("2026-06-01T00:00:00Z"))) + .type(MaintenanceWindowResourceType.MAINTENANCE_WINDOW)); + + try { + MaintenanceWindowResponse result = apiInstance.createMaintenanceWindow(body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling CaseManagementApi#createMaintenanceWindow"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/case-management/DeleteCaseAutomationRule.java b/examples/v2/case-management/DeleteCaseAutomationRule.java new file mode 100644 index 00000000000..d461dd331e2 --- /dev/null +++ b/examples/v2/case-management/DeleteCaseAutomationRule.java @@ -0,0 +1,24 @@ +// Delete an automation rule 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.deleteCaseAutomationRule", true); + CaseManagementApi apiInstance = new CaseManagementApi(defaultClient); + + try { + apiInstance.deleteCaseAutomationRule( + "e555e290-ed65-49bd-ae18-8acbfcf18db7", "e6773723-fe58-49ff-9975-dff00f14e28d"); + } catch (ApiException e) { + System.err.println("Exception when calling CaseManagementApi#deleteCaseAutomationRule"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/case-management/DeleteCaseLink.java b/examples/v2/case-management/DeleteCaseLink.java new file mode 100644 index 00000000000..d52b14425b8 --- /dev/null +++ b/examples/v2/case-management/DeleteCaseLink.java @@ -0,0 +1,23 @@ +// Delete a case link 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.deleteCaseLink", true); + CaseManagementApi apiInstance = new CaseManagementApi(defaultClient); + + try { + apiInstance.deleteCaseLink("804cd682-55f6-4541-ab00-b608b282ea7d"); + } catch (ApiException e) { + System.err.println("Exception when calling CaseManagementApi#deleteCaseLink"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/case-management/DeleteCaseView.java b/examples/v2/case-management/DeleteCaseView.java new file mode 100644 index 00000000000..ed7b96c8d94 --- /dev/null +++ b/examples/v2/case-management/DeleteCaseView.java @@ -0,0 +1,23 @@ +// Delete a case view 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.deleteCaseView", true); + CaseManagementApi apiInstance = new CaseManagementApi(defaultClient); + + try { + apiInstance.deleteCaseView("a1b2c3d4-e5f6-7890-abcd-ef1234567890"); + } catch (ApiException e) { + System.err.println("Exception when calling CaseManagementApi#deleteCaseView"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/case-management/DeleteMaintenanceWindow.java b/examples/v2/case-management/DeleteMaintenanceWindow.java new file mode 100644 index 00000000000..6de1957ba4d --- /dev/null +++ b/examples/v2/case-management/DeleteMaintenanceWindow.java @@ -0,0 +1,23 @@ +// Delete a maintenance window 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.deleteMaintenanceWindow", true); + CaseManagementApi apiInstance = new CaseManagementApi(defaultClient); + + try { + apiInstance.deleteMaintenanceWindow("a1b2c3d4-e5f6-7890-abcd-ef1234567890"); + } catch (ApiException e) { + System.err.println("Exception when calling CaseManagementApi#deleteMaintenanceWindow"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/case-management/DisableCaseAutomationRule.java b/examples/v2/case-management/DisableCaseAutomationRule.java new file mode 100644 index 00000000000..0351e61689c --- /dev/null +++ b/examples/v2/case-management/DisableCaseAutomationRule.java @@ -0,0 +1,27 @@ +// Disable an automation rule 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.AutomationRuleResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.disableCaseAutomationRule", true); + CaseManagementApi apiInstance = new CaseManagementApi(defaultClient); + + try { + AutomationRuleResponse result = + apiInstance.disableCaseAutomationRule( + "e555e290-ed65-49bd-ae18-8acbfcf18db7", "e6773723-fe58-49ff-9975-dff00f14e28d"); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling CaseManagementApi#disableCaseAutomationRule"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/case-management/EnableCaseAutomationRule.java b/examples/v2/case-management/EnableCaseAutomationRule.java new file mode 100644 index 00000000000..7ebdf811e41 --- /dev/null +++ b/examples/v2/case-management/EnableCaseAutomationRule.java @@ -0,0 +1,27 @@ +// Enable an automation rule 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.AutomationRuleResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.enableCaseAutomationRule", true); + CaseManagementApi apiInstance = new CaseManagementApi(defaultClient); + + try { + AutomationRuleResponse result = + apiInstance.enableCaseAutomationRule( + "e555e290-ed65-49bd-ae18-8acbfcf18db7", "e6773723-fe58-49ff-9975-dff00f14e28d"); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling CaseManagementApi#enableCaseAutomationRule"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/case-management/FavoriteCaseProject.java b/examples/v2/case-management/FavoriteCaseProject.java new file mode 100644 index 00000000000..d698738a437 --- /dev/null +++ b/examples/v2/case-management/FavoriteCaseProject.java @@ -0,0 +1,23 @@ +// Favorite a project 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.favoriteCaseProject", true); + CaseManagementApi apiInstance = new CaseManagementApi(defaultClient); + + try { + apiInstance.favoriteCaseProject("e555e290-ed65-49bd-ae18-8acbfcf18db7"); + } catch (ApiException e) { + System.err.println("Exception when calling CaseManagementApi#favoriteCaseProject"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/case-management/GetCaseAutomationRule.java b/examples/v2/case-management/GetCaseAutomationRule.java new file mode 100644 index 00000000000..1c4481ff635 --- /dev/null +++ b/examples/v2/case-management/GetCaseAutomationRule.java @@ -0,0 +1,27 @@ +// Get an automation rule 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.AutomationRuleResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.getCaseAutomationRule", true); + CaseManagementApi apiInstance = new CaseManagementApi(defaultClient); + + try { + AutomationRuleResponse result = + apiInstance.getCaseAutomationRule( + "e555e290-ed65-49bd-ae18-8acbfcf18db7", "e6773723-fe58-49ff-9975-dff00f14e28d"); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling CaseManagementApi#getCaseAutomationRule"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/case-management/GetCaseView.java b/examples/v2/case-management/GetCaseView.java new file mode 100644 index 00000000000..ba4f81d56ae --- /dev/null +++ b/examples/v2/case-management/GetCaseView.java @@ -0,0 +1,25 @@ +// Get a case view 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.CaseViewResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.getCaseView", true); + CaseManagementApi apiInstance = new CaseManagementApi(defaultClient); + + try { + CaseViewResponse result = apiInstance.getCaseView("a1b2c3d4-e5f6-7890-abcd-ef1234567890"); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling CaseManagementApi#getCaseView"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/case-management/ListCaseAutomationRules.java b/examples/v2/case-management/ListCaseAutomationRules.java new file mode 100644 index 00000000000..4865bb58de4 --- /dev/null +++ b/examples/v2/case-management/ListCaseAutomationRules.java @@ -0,0 +1,26 @@ +// List automation rules 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.AutomationRulesResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.listCaseAutomationRules", true); + CaseManagementApi apiInstance = new CaseManagementApi(defaultClient); + + try { + AutomationRulesResponse result = + apiInstance.listCaseAutomationRules("e555e290-ed65-49bd-ae18-8acbfcf18db7"); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling CaseManagementApi#listCaseAutomationRules"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/case-management/ListCaseLinks.java b/examples/v2/case-management/ListCaseLinks.java new file mode 100644 index 00000000000..aaa6842a5a2 --- /dev/null +++ b/examples/v2/case-management/ListCaseLinks.java @@ -0,0 +1,26 @@ +// List case links 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.CaseLinksResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.listCaseLinks", true); + CaseManagementApi apiInstance = new CaseManagementApi(defaultClient); + + try { + CaseLinksResponse result = + apiInstance.listCaseLinks("CASE", "bf0cbac6-4c16-4cfb-b6bf-ca5e0ec37a4f"); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling CaseManagementApi#listCaseLinks"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/case-management/ListCaseTimeline.java b/examples/v2/case-management/ListCaseTimeline.java new file mode 100644 index 00000000000..e8b61beaef5 --- /dev/null +++ b/examples/v2/case-management/ListCaseTimeline.java @@ -0,0 +1,26 @@ +// Get case timeline 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.TimelineResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.listCaseTimeline", true); + CaseManagementApi apiInstance = new CaseManagementApi(defaultClient); + + try { + TimelineResponse result = + apiInstance.listCaseTimeline("f98a5a5b-e0ff-45d4-b2f5-afe6e74de504"); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling CaseManagementApi#listCaseTimeline"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/case-management/ListCaseViews.java b/examples/v2/case-management/ListCaseViews.java new file mode 100644 index 00000000000..5a6a57c6ec1 --- /dev/null +++ b/examples/v2/case-management/ListCaseViews.java @@ -0,0 +1,25 @@ +// List case views 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.CaseViewsResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.listCaseViews", true); + CaseManagementApi apiInstance = new CaseManagementApi(defaultClient); + + try { + CaseViewsResponse result = apiInstance.listCaseViews("e555e290-ed65-49bd-ae18-8acbfcf18db7"); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling CaseManagementApi#listCaseViews"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/case-management/ListCaseWatchers.java b/examples/v2/case-management/ListCaseWatchers.java new file mode 100644 index 00000000000..56716c7da57 --- /dev/null +++ b/examples/v2/case-management/ListCaseWatchers.java @@ -0,0 +1,26 @@ +// List case watchers 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.CaseWatchersResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.listCaseWatchers", true); + CaseManagementApi apiInstance = new CaseManagementApi(defaultClient); + + try { + CaseWatchersResponse result = + apiInstance.listCaseWatchers("f98a5a5b-e0ff-45d4-b2f5-afe6e74de504"); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling CaseManagementApi#listCaseWatchers"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/case-management/ListMaintenanceWindows.java b/examples/v2/case-management/ListMaintenanceWindows.java new file mode 100644 index 00000000000..816a250f3dc --- /dev/null +++ b/examples/v2/case-management/ListMaintenanceWindows.java @@ -0,0 +1,25 @@ +// List maintenance windows 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.MaintenanceWindowsResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.listMaintenanceWindows", true); + CaseManagementApi apiInstance = new CaseManagementApi(defaultClient); + + try { + MaintenanceWindowsResponse result = apiInstance.listMaintenanceWindows(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling CaseManagementApi#listMaintenanceWindows"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/case-management/ListUserCaseProjectFavorites.java b/examples/v2/case-management/ListUserCaseProjectFavorites.java new file mode 100644 index 00000000000..801a3cc6bcd --- /dev/null +++ b/examples/v2/case-management/ListUserCaseProjectFavorites.java @@ -0,0 +1,25 @@ +// List 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.listUserCaseProjectFavorites", true); + CaseManagementApi apiInstance = new CaseManagementApi(defaultClient); + + try { + ProjectFavoritesResponse result = apiInstance.listUserCaseProjectFavorites(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling CaseManagementApi#listUserCaseProjectFavorites"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/case-management/RemoveCaseInsights.java b/examples/v2/case-management/RemoveCaseInsights.java new file mode 100644 index 00000000000..d0e6fb7ebfb --- /dev/null +++ b/examples/v2/case-management/RemoveCaseInsights.java @@ -0,0 +1,47 @@ +// Remove insights from a case 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.CaseInsight; +import com.datadog.api.client.v2.model.CaseInsightType; +import com.datadog.api.client.v2.model.CaseInsightsAttributes; +import com.datadog.api.client.v2.model.CaseInsightsData; +import com.datadog.api.client.v2.model.CaseInsightsRequest; +import com.datadog.api.client.v2.model.CaseResourceType; +import com.datadog.api.client.v2.model.CaseResponse; +import java.util.Collections; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.removeCaseInsights", true); + CaseManagementApi apiInstance = new CaseManagementApi(defaultClient); + + CaseInsightsRequest body = + new CaseInsightsRequest() + .data( + new CaseInsightsData() + .attributes( + new CaseInsightsAttributes() + .insights( + Collections.singletonList( + new CaseInsight() + .ref("/monitors/12345?q=total") + .resourceId("12345") + .type(CaseInsightType.SECURITY_SIGNAL)))) + .type(CaseResourceType.CASE)); + + try { + CaseResponse result = + apiInstance.removeCaseInsights("f98a5a5b-e0ff-45d4-b2f5-afe6e74de504", body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling CaseManagementApi#removeCaseInsights"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/case-management/UnfavoriteCaseProject.java b/examples/v2/case-management/UnfavoriteCaseProject.java new file mode 100644 index 00000000000..8410d476e62 --- /dev/null +++ b/examples/v2/case-management/UnfavoriteCaseProject.java @@ -0,0 +1,23 @@ +// Unfavorite a project 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.unfavoriteCaseProject", true); + CaseManagementApi apiInstance = new CaseManagementApi(defaultClient); + + try { + apiInstance.unfavoriteCaseProject("e555e290-ed65-49bd-ae18-8acbfcf18db7"); + } catch (ApiException e) { + System.err.println("Exception when calling CaseManagementApi#unfavoriteCaseProject"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/case-management/UnwatchCase.java b/examples/v2/case-management/UnwatchCase.java new file mode 100644 index 00000000000..595e61bf4d2 --- /dev/null +++ b/examples/v2/case-management/UnwatchCase.java @@ -0,0 +1,24 @@ +// Unwatch a case 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.unwatchCase", true); + CaseManagementApi apiInstance = new CaseManagementApi(defaultClient); + + try { + apiInstance.unwatchCase( + "f98a5a5b-e0ff-45d4-b2f5-afe6e74de504", "8146583c-0b5f-11ec-abf8-da7ad0900001"); + } catch (ApiException e) { + System.err.println("Exception when calling CaseManagementApi#unwatchCase"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/case-management/UpdateCaseAutomationRule.java b/examples/v2/case-management/UpdateCaseAutomationRule.java new file mode 100644 index 00000000000..ae790b716a5 --- /dev/null +++ b/examples/v2/case-management/UpdateCaseAutomationRule.java @@ -0,0 +1,58 @@ +// Update an automation rule 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.AutomationRuleAction; +import com.datadog.api.client.v2.model.AutomationRuleActionData; +import com.datadog.api.client.v2.model.AutomationRuleActionType; +import com.datadog.api.client.v2.model.AutomationRuleCreateAttributes; +import com.datadog.api.client.v2.model.AutomationRuleResponse; +import com.datadog.api.client.v2.model.AutomationRuleTrigger; +import com.datadog.api.client.v2.model.AutomationRuleTriggerData; +import com.datadog.api.client.v2.model.AutomationRuleTriggerType; +import com.datadog.api.client.v2.model.AutomationRuleUpdate; +import com.datadog.api.client.v2.model.AutomationRuleUpdateRequest; +import com.datadog.api.client.v2.model.CaseAutomationRuleResourceType; +import com.datadog.api.client.v2.model.CaseAutomationRuleState; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.updateCaseAutomationRule", true); + CaseManagementApi apiInstance = new CaseManagementApi(defaultClient); + + AutomationRuleUpdateRequest body = + new AutomationRuleUpdateRequest() + .data( + new AutomationRuleUpdate() + .attributes( + new AutomationRuleCreateAttributes() + .action( + new AutomationRuleAction() + .data( + new AutomationRuleActionData() + .handle("workflow-handle-123")) + .type(AutomationRuleActionType.EXECUTE_WORKFLOW)) + .name("Auto-assign workflow") + .state(CaseAutomationRuleState.ENABLED) + .trigger( + new AutomationRuleTrigger() + .data(new AutomationRuleTriggerData()) + .type(AutomationRuleTriggerType.CASE_CREATED))) + .type(CaseAutomationRuleResourceType.RULE)); + + try { + AutomationRuleResponse result = + apiInstance.updateCaseAutomationRule( + "e555e290-ed65-49bd-ae18-8acbfcf18db7", "e6773723-fe58-49ff-9975-dff00f14e28d", body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling CaseManagementApi#updateCaseAutomationRule"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/case-management/UpdateCaseComment.java b/examples/v2/case-management/UpdateCaseComment.java new file mode 100644 index 00000000000..9811185295e --- /dev/null +++ b/examples/v2/case-management/UpdateCaseComment.java @@ -0,0 +1,35 @@ +// Update case comment 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.CaseResourceType; +import com.datadog.api.client.v2.model.CaseUpdateComment; +import com.datadog.api.client.v2.model.CaseUpdateCommentAttributes; +import com.datadog.api.client.v2.model.CaseUpdateCommentRequest; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.updateCaseComment", true); + CaseManagementApi apiInstance = new CaseManagementApi(defaultClient); + + CaseUpdateCommentRequest body = + new CaseUpdateCommentRequest() + .data( + new CaseUpdateComment() + .attributes(new CaseUpdateCommentAttributes().comment("Updated comment text")) + .type(CaseResourceType.CASE)); + + try { + apiInstance.updateCaseComment( + "f98a5a5b-e0ff-45d4-b2f5-afe6e74de504", "f98a5a5b-e0ff-45d4-b2f5-afe6e74de504", body); + } catch (ApiException e) { + System.err.println("Exception when calling CaseManagementApi#updateCaseComment"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/case-management/UpdateCaseDueDate.java b/examples/v2/case-management/UpdateCaseDueDate.java new file mode 100644 index 00000000000..c6d4c89ac4a --- /dev/null +++ b/examples/v2/case-management/UpdateCaseDueDate.java @@ -0,0 +1,37 @@ +// Update case due date 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.CaseResourceType; +import com.datadog.api.client.v2.model.CaseResponse; +import com.datadog.api.client.v2.model.CaseUpdateDueDate; +import com.datadog.api.client.v2.model.CaseUpdateDueDateAttributes; +import com.datadog.api.client.v2.model.CaseUpdateDueDateRequest; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.updateCaseDueDate", true); + CaseManagementApi apiInstance = new CaseManagementApi(defaultClient); + + CaseUpdateDueDateRequest body = + new CaseUpdateDueDateRequest() + .data( + new CaseUpdateDueDate() + .attributes(new CaseUpdateDueDateAttributes().dueDate("2026-12-31")) + .type(CaseResourceType.CASE)); + + try { + CaseResponse result = + apiInstance.updateCaseDueDate("f98a5a5b-e0ff-45d4-b2f5-afe6e74de504", body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling CaseManagementApi#updateCaseDueDate"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/case-management/UpdateCaseResolvedReason.java b/examples/v2/case-management/UpdateCaseResolvedReason.java new file mode 100644 index 00000000000..8a68da05d48 --- /dev/null +++ b/examples/v2/case-management/UpdateCaseResolvedReason.java @@ -0,0 +1,39 @@ +// Update case resolved reason 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.CaseResourceType; +import com.datadog.api.client.v2.model.CaseResponse; +import com.datadog.api.client.v2.model.CaseUpdateResolvedReason; +import com.datadog.api.client.v2.model.CaseUpdateResolvedReasonAttributes; +import com.datadog.api.client.v2.model.CaseUpdateResolvedReasonRequest; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.updateCaseResolvedReason", true); + CaseManagementApi apiInstance = new CaseManagementApi(defaultClient); + + CaseUpdateResolvedReasonRequest body = + new CaseUpdateResolvedReasonRequest() + .data( + new CaseUpdateResolvedReason() + .attributes( + new CaseUpdateResolvedReasonAttributes() + .securityResolvedReason("FALSE_POSITIVE")) + .type(CaseResourceType.CASE)); + + try { + CaseResponse result = + apiInstance.updateCaseResolvedReason("f98a5a5b-e0ff-45d4-b2f5-afe6e74de504", body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling CaseManagementApi#updateCaseResolvedReason"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/case-management/UpdateCaseView.java b/examples/v2/case-management/UpdateCaseView.java new file mode 100644 index 00000000000..7fd99f732a3 --- /dev/null +++ b/examples/v2/case-management/UpdateCaseView.java @@ -0,0 +1,37 @@ +// Update a case view 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.CaseViewResourceType; +import com.datadog.api.client.v2.model.CaseViewResponse; +import com.datadog.api.client.v2.model.CaseViewUpdate; +import com.datadog.api.client.v2.model.CaseViewUpdateAttributes; +import com.datadog.api.client.v2.model.CaseViewUpdateRequest; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.updateCaseView", true); + CaseManagementApi apiInstance = new CaseManagementApi(defaultClient); + + CaseViewUpdateRequest body = + new CaseViewUpdateRequest() + .data( + new CaseViewUpdate() + .attributes(new CaseViewUpdateAttributes()) + .type(CaseViewResourceType.VIEW)); + + try { + CaseViewResponse result = + apiInstance.updateCaseView("a1b2c3d4-e5f6-7890-abcd-ef1234567890", body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling CaseManagementApi#updateCaseView"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/case-management/UpdateMaintenanceWindow.java b/examples/v2/case-management/UpdateMaintenanceWindow.java new file mode 100644 index 00000000000..5f1034c4a0d --- /dev/null +++ b/examples/v2/case-management/UpdateMaintenanceWindow.java @@ -0,0 +1,37 @@ +// Update a maintenance window 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.MaintenanceWindowResourceType; +import com.datadog.api.client.v2.model.MaintenanceWindowResponse; +import com.datadog.api.client.v2.model.MaintenanceWindowUpdate; +import com.datadog.api.client.v2.model.MaintenanceWindowUpdateAttributes; +import com.datadog.api.client.v2.model.MaintenanceWindowUpdateRequest; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.updateMaintenanceWindow", true); + CaseManagementApi apiInstance = new CaseManagementApi(defaultClient); + + MaintenanceWindowUpdateRequest body = + new MaintenanceWindowUpdateRequest() + .data( + new MaintenanceWindowUpdate() + .attributes(new MaintenanceWindowUpdateAttributes()) + .type(MaintenanceWindowResourceType.MAINTENANCE_WINDOW)); + + try { + MaintenanceWindowResponse result = + apiInstance.updateMaintenanceWindow("a1b2c3d4-e5f6-7890-abcd-ef1234567890", body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling CaseManagementApi#updateMaintenanceWindow"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/case-management/WatchCase.java b/examples/v2/case-management/WatchCase.java new file mode 100644 index 00000000000..571b44a8d1c --- /dev/null +++ b/examples/v2/case-management/WatchCase.java @@ -0,0 +1,24 @@ +// Watch a case returns "Created" 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.watchCase", true); + CaseManagementApi apiInstance = new CaseManagementApi(defaultClient); + + try { + apiInstance.watchCase( + "f98a5a5b-e0ff-45d4-b2f5-afe6e74de504", "8146583c-0b5f-11ec-abf8-da7ad0900001"); + } catch (ApiException e) { + System.err.println("Exception when calling CaseManagementApi#watchCase"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/cloud-cost-management/DeleteCostTagDescriptionByKey.java b/examples/v2/cloud-cost-management/DeleteCostTagDescriptionByKey.java new file mode 100644 index 00000000000..3d8b97aa170 --- /dev/null +++ b/examples/v2/cloud-cost-management/DeleteCostTagDescriptionByKey.java @@ -0,0 +1,23 @@ +// Delete a Cloud Cost Management tag description returns "No Content" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.CloudCostManagementApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + CloudCostManagementApi apiInstance = new CloudCostManagementApi(defaultClient); + + try { + apiInstance.deleteCostTagDescriptionByKey("tag_key"); + } catch (ApiException e) { + System.err.println( + "Exception when calling CloudCostManagementApi#deleteCostTagDescriptionByKey"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/cloud-cost-management/GenerateCostTagDescriptionByKey.java b/examples/v2/cloud-cost-management/GenerateCostTagDescriptionByKey.java new file mode 100644 index 00000000000..b2968547235 --- /dev/null +++ b/examples/v2/cloud-cost-management/GenerateCostTagDescriptionByKey.java @@ -0,0 +1,26 @@ +// Generate a Cloud Cost Management tag description returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.CloudCostManagementApi; +import com.datadog.api.client.v2.model.GenerateCostTagDescriptionResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + CloudCostManagementApi apiInstance = new CloudCostManagementApi(defaultClient); + + try { + GenerateCostTagDescriptionResponse result = + apiInstance.generateCostTagDescriptionByKey("tag_key"); + System.out.println(result); + } catch (ApiException e) { + System.err.println( + "Exception when calling CloudCostManagementApi#generateCostTagDescriptionByKey"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/cloud-cost-management/GetCostTagDescriptionByKey.java b/examples/v2/cloud-cost-management/GetCostTagDescriptionByKey.java new file mode 100644 index 00000000000..ebeea18f5de --- /dev/null +++ b/examples/v2/cloud-cost-management/GetCostTagDescriptionByKey.java @@ -0,0 +1,25 @@ +// Get a Cloud Cost Management tag description returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.CloudCostManagementApi; +import com.datadog.api.client.v2.model.CostTagDescriptionResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + CloudCostManagementApi apiInstance = new CloudCostManagementApi(defaultClient); + + try { + CostTagDescriptionResponse result = apiInstance.getCostTagDescriptionByKey("tag_key"); + System.out.println(result); + } catch (ApiException e) { + System.err.println( + "Exception when calling CloudCostManagementApi#getCostTagDescriptionByKey"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/cloud-cost-management/UpsertCostTagDescriptionByKey.java b/examples/v2/cloud-cost-management/UpsertCostTagDescriptionByKey.java new file mode 100644 index 00000000000..c2566ee1d00 --- /dev/null +++ b/examples/v2/cloud-cost-management/UpsertCostTagDescriptionByKey.java @@ -0,0 +1,38 @@ +// Upsert a Cloud Cost Management tag description returns "No Content" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.CloudCostManagementApi; +import com.datadog.api.client.v2.model.CostTagDescriptionType; +import com.datadog.api.client.v2.model.CostTagDescriptionUpsertRequest; +import com.datadog.api.client.v2.model.CostTagDescriptionUpsertRequestData; +import com.datadog.api.client.v2.model.CostTagDescriptionUpsertRequestDataAttributes; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + CloudCostManagementApi apiInstance = new CloudCostManagementApi(defaultClient); + + CostTagDescriptionUpsertRequest body = + new CostTagDescriptionUpsertRequest() + .data( + new CostTagDescriptionUpsertRequestData() + .attributes( + new CostTagDescriptionUpsertRequestDataAttributes() + .cloud("aws") + .description("AWS account that owns this cost.")) + .id("account_id") + .type(CostTagDescriptionType.COST_TAG_DESCRIPTION)); + + try { + apiInstance.upsertCostTagDescriptionByKey("tag_key", body); + } catch (ApiException e) { + System.err.println( + "Exception when calling CloudCostManagementApi#upsertCostTagDescriptionByKey"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/src/main/java/com/datadog/api/client/ApiClient.java b/src/main/java/com/datadog/api/client/ApiClient.java index 2e075b16da1..154df27bdac 100644 --- a/src/main/java/com/datadog/api/client/ApiClient.java +++ b/src/main/java/com/datadog/api/client/ApiClient.java @@ -812,13 +812,49 @@ public class ApiClient { put("v2.getInvestigation", false); put("v2.listInvestigations", false); put("v2.triggerInvestigation", false); + put("v2.addCaseInsights", false); + put("v2.aggregateCases", false); + put("v2.bulkUpdateCases", false); + put("v2.countCases", false); + put("v2.createCaseAutomationRule", false); put("v2.createCaseJiraIssue", false); + put("v2.createCaseLink", false); put("v2.createCaseNotebook", false); put("v2.createCaseServiceNowTicket", false); + put("v2.createCaseView", false); + put("v2.createMaintenanceWindow", false); + put("v2.deleteCaseAutomationRule", false); + put("v2.deleteCaseLink", false); + put("v2.deleteCaseView", false); + put("v2.deleteMaintenanceWindow", false); + put("v2.disableCaseAutomationRule", false); + put("v2.enableCaseAutomationRule", false); + put("v2.favoriteCaseProject", false); + put("v2.getCaseAutomationRule", false); + put("v2.getCaseView", false); put("v2.linkIncident", false); put("v2.linkJiraIssueToCase", false); + put("v2.listCaseAutomationRules", false); + put("v2.listCaseLinks", false); + put("v2.listCaseTimeline", false); + put("v2.listCaseViews", false); + put("v2.listCaseWatchers", false); + put("v2.listMaintenanceWindows", false); + put("v2.listUserCaseProjectFavorites", false); put("v2.moveCaseToProject", false); + put("v2.removeCaseInsights", false); + put("v2.unfavoriteCaseProject", false); put("v2.unlinkJiraIssue", false); + put("v2.unwatchCase", false); + put("v2.updateCaseAutomationRule", false); + put("v2.updateCaseComment", false); + put("v2.updateCaseDueDate", false); + put("v2.updateCaseResolvedReason", false); + put("v2.updateCaseView", false); + put("v2.updateMaintenanceWindow", false); + put("v2.watchCase", false); + put("v2.updateCaseType", false); + put("v2.updateCustomAttributeConfig", false); put("v2.createChangeRequest", false); put("v2.createChangeRequestBranch", false); put("v2.deleteChangeRequestDecision", false); diff --git a/src/main/java/com/datadog/api/client/v2/api/CaseManagementApi.java b/src/main/java/com/datadog/api/client/v2/api/CaseManagementApi.java index 73c196b871f..6fc97f9e86a 100644 --- a/src/main/java/com/datadog/api/client/v2/api/CaseManagementApi.java +++ b/src/main/java/com/datadog/api/client/v2/api/CaseManagementApi.java @@ -5,11 +5,23 @@ import com.datadog.api.client.ApiResponse; import com.datadog.api.client.PaginationIterable; import com.datadog.api.client.Pair; +import com.datadog.api.client.v2.model.AutomationRuleCreateRequest; +import com.datadog.api.client.v2.model.AutomationRuleResponse; +import com.datadog.api.client.v2.model.AutomationRuleUpdateRequest; +import com.datadog.api.client.v2.model.AutomationRulesResponse; import com.datadog.api.client.v2.model.Case; +import com.datadog.api.client.v2.model.CaseAggregateRequest; +import com.datadog.api.client.v2.model.CaseAggregateResponse; import com.datadog.api.client.v2.model.CaseAssignRequest; +import com.datadog.api.client.v2.model.CaseBulkUpdateRequest; import com.datadog.api.client.v2.model.CaseCommentRequest; +import com.datadog.api.client.v2.model.CaseCountResponse; import com.datadog.api.client.v2.model.CaseCreateRequest; import com.datadog.api.client.v2.model.CaseEmptyRequest; +import com.datadog.api.client.v2.model.CaseInsightsRequest; +import com.datadog.api.client.v2.model.CaseLinkCreateRequest; +import com.datadog.api.client.v2.model.CaseLinkResponse; +import com.datadog.api.client.v2.model.CaseLinksResponse; import com.datadog.api.client.v2.model.CaseNotificationRuleCreateRequest; import com.datadog.api.client.v2.model.CaseNotificationRuleResponse; import com.datadog.api.client.v2.model.CaseNotificationRuleUpdateRequest; @@ -17,16 +29,29 @@ import com.datadog.api.client.v2.model.CaseResponse; import com.datadog.api.client.v2.model.CaseSortableField; import com.datadog.api.client.v2.model.CaseUpdateAttributesRequest; +import com.datadog.api.client.v2.model.CaseUpdateCommentRequest; import com.datadog.api.client.v2.model.CaseUpdateCustomAttributeRequest; import com.datadog.api.client.v2.model.CaseUpdateDescriptionRequest; +import com.datadog.api.client.v2.model.CaseUpdateDueDateRequest; import com.datadog.api.client.v2.model.CaseUpdatePriorityRequest; +import com.datadog.api.client.v2.model.CaseUpdateResolvedReasonRequest; import com.datadog.api.client.v2.model.CaseUpdateStatusRequest; import com.datadog.api.client.v2.model.CaseUpdateTitleRequest; +import com.datadog.api.client.v2.model.CaseViewCreateRequest; +import com.datadog.api.client.v2.model.CaseViewResponse; +import com.datadog.api.client.v2.model.CaseViewUpdateRequest; +import com.datadog.api.client.v2.model.CaseViewsResponse; +import com.datadog.api.client.v2.model.CaseWatchersResponse; import com.datadog.api.client.v2.model.CasesResponse; import com.datadog.api.client.v2.model.JiraIssueCreateRequest; import com.datadog.api.client.v2.model.JiraIssueLinkRequest; +import com.datadog.api.client.v2.model.MaintenanceWindowCreateRequest; +import com.datadog.api.client.v2.model.MaintenanceWindowResponse; +import com.datadog.api.client.v2.model.MaintenanceWindowUpdateRequest; +import com.datadog.api.client.v2.model.MaintenanceWindowsResponse; import com.datadog.api.client.v2.model.NotebookCreateRequest; import com.datadog.api.client.v2.model.ProjectCreateRequest; +import com.datadog.api.client.v2.model.ProjectFavoritesResponse; import com.datadog.api.client.v2.model.ProjectRelationship; import com.datadog.api.client.v2.model.ProjectResponse; import com.datadog.api.client.v2.model.ProjectUpdateRequest; @@ -75,30 +100,31 @@ public void setApiClient(ApiClient apiClient) { } /** - * Archive case. + * Add insights to a case. * - *

See {@link #archiveCaseWithHttpInfo}. + *

See {@link #addCaseInsightsWithHttpInfo}. * * @param caseId Case's UUID or key (required) - * @param body Archive case payload (required) + * @param body Case insights request. (required) * @return CaseResponse * @throws ApiException if fails to make API call */ - public CaseResponse archiveCase(String caseId, CaseEmptyRequest body) throws ApiException { - return archiveCaseWithHttpInfo(caseId, body).getData(); + public CaseResponse addCaseInsights(String caseId, CaseInsightsRequest body) throws ApiException { + return addCaseInsightsWithHttpInfo(caseId, body).getData(); } /** - * Archive case. + * Add insights to a case. * - *

See {@link #archiveCaseWithHttpInfoAsync}. + *

See {@link #addCaseInsightsWithHttpInfoAsync}. * * @param caseId Case's UUID or key (required) - * @param body Archive case payload (required) + * @param body Case insights request. (required) * @return CompletableFuture<CaseResponse> */ - public CompletableFuture archiveCaseAsync(String caseId, CaseEmptyRequest body) { - return archiveCaseWithHttpInfoAsync(caseId, body) + public CompletableFuture addCaseInsightsAsync( + String caseId, CaseInsightsRequest body) { + return addCaseInsightsWithHttpInfoAsync(caseId, body) .thenApply( response -> { return response.getData(); @@ -106,10 +132,14 @@ public CompletableFuture archiveCaseAsync(String caseId, CaseEmpty } /** - * Archive case + * Adds one or more insights to a case. Insights are references to related Datadog resources (such + * as monitors, security signals, incidents, or error tracking issues) that provide investigative + * context. Up to 100 insights can be added per request. Each insight requires a type (see + * CaseInsightType for allowed values), a ref (URL path to the resource), and a + * resource_id. * * @param caseId Case's UUID or key (required) - * @param body Archive case payload (required) + * @param body Case insights request. (required) * @return ApiResponse<CaseResponse> * @throws ApiException if fails to make API call * @http.response.details @@ -124,30 +154,38 @@ public CompletableFuture archiveCaseAsync(String caseId, CaseEmpty * 429 Too many requests - * */ - public ApiResponse archiveCaseWithHttpInfo(String caseId, CaseEmptyRequest body) - throws ApiException { + public ApiResponse addCaseInsightsWithHttpInfo( + String caseId, CaseInsightsRequest body) throws ApiException { + // Check if unstable operation is enabled + String operationId = "addCaseInsights"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } Object localVarPostBody = body; // verify the required parameter 'caseId' is set if (caseId == null) { throw new ApiException( - 400, "Missing the required parameter 'caseId' when calling archiveCase"); + 400, "Missing the required parameter 'caseId' when calling addCaseInsights"); } // verify the required parameter 'body' is set if (body == null) { - throw new ApiException(400, "Missing the required parameter 'body' when calling archiveCase"); + throw new ApiException( + 400, "Missing the required parameter 'body' when calling addCaseInsights"); } // create path and map variables String localVarPath = - "/api/v2/cases/{case_id}/archive" + "/api/v2/cases/{case_id}/insights" .replaceAll("\\{" + "case_id" + "\\}", apiClient.escapeString(caseId.toString())); Map localVarHeaderParams = new HashMap(); Invocation.Builder builder = apiClient.createBuilder( - "v2.CaseManagementApi.archiveCase", + "v2.CaseManagementApi.addCaseInsights", localVarPath, new ArrayList(), localVarHeaderParams, @@ -155,7 +193,7 @@ public ApiResponse archiveCaseWithHttpInfo(String caseId, CaseEmpt new String[] {"application/json"}, new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); return apiClient.invokeAPI( - "POST", + "PUT", builder, localVarHeaderParams, new String[] {"application/json"}, @@ -166,16 +204,26 @@ public ApiResponse archiveCaseWithHttpInfo(String caseId, CaseEmpt } /** - * Archive case. + * Add insights to a case. * - *

See {@link #archiveCaseWithHttpInfo}. + *

See {@link #addCaseInsightsWithHttpInfo}. * * @param caseId Case's UUID or key (required) - * @param body Archive case payload (required) + * @param body Case insights request. (required) * @return CompletableFuture<ApiResponse<CaseResponse>> */ - public CompletableFuture> archiveCaseWithHttpInfoAsync( - String caseId, CaseEmptyRequest body) { + public CompletableFuture> addCaseInsightsWithHttpInfoAsync( + String caseId, CaseInsightsRequest body) { + // Check if unstable operation is enabled + String operationId = "addCaseInsights"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } Object localVarPostBody = body; // verify the required parameter 'caseId' is set @@ -183,7 +231,7 @@ public CompletableFuture> archiveCaseWithHttpInfoAsync CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( new ApiException( - 400, "Missing the required parameter 'caseId' when calling archiveCase")); + 400, "Missing the required parameter 'caseId' when calling addCaseInsights")); return result; } @@ -191,12 +239,13 @@ public CompletableFuture> archiveCaseWithHttpInfoAsync if (body == null) { CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( - new ApiException(400, "Missing the required parameter 'body' when calling archiveCase")); + new ApiException( + 400, "Missing the required parameter 'body' when calling addCaseInsights")); return result; } // create path and map variables String localVarPath = - "/api/v2/cases/{case_id}/archive" + "/api/v2/cases/{case_id}/insights" .replaceAll("\\{" + "case_id" + "\\}", apiClient.escapeString(caseId.toString())); Map localVarHeaderParams = new HashMap(); @@ -205,7 +254,7 @@ public CompletableFuture> archiveCaseWithHttpInfoAsync try { builder = apiClient.createBuilder( - "v2.CaseManagementApi.archiveCase", + "v2.CaseManagementApi.addCaseInsights", localVarPath, new ArrayList(), localVarHeaderParams, @@ -218,7 +267,7 @@ public CompletableFuture> archiveCaseWithHttpInfoAsync return result; } return apiClient.invokeAPIAsync( - "POST", + "PUT", builder, localVarHeaderParams, new String[] {"application/json"}, @@ -229,30 +278,28 @@ public CompletableFuture> archiveCaseWithHttpInfoAsync } /** - * Assign case. + * Aggregate cases. * - *

See {@link #assignCaseWithHttpInfo}. + *

See {@link #aggregateCasesWithHttpInfo}. * - * @param caseId Case's UUID or key (required) - * @param body Assign case payload (required) - * @return CaseResponse + * @param body Case aggregate request payload. (required) + * @return CaseAggregateResponse * @throws ApiException if fails to make API call */ - public CaseResponse assignCase(String caseId, CaseAssignRequest body) throws ApiException { - return assignCaseWithHttpInfo(caseId, body).getData(); + public CaseAggregateResponse aggregateCases(CaseAggregateRequest body) throws ApiException { + return aggregateCasesWithHttpInfo(body).getData(); } /** - * Assign case. + * Aggregate cases. * - *

See {@link #assignCaseWithHttpInfoAsync}. + *

See {@link #aggregateCasesWithHttpInfoAsync}. * - * @param caseId Case's UUID or key (required) - * @param body Assign case payload (required) - * @return CompletableFuture<CaseResponse> + * @param body Case aggregate request payload. (required) + * @return CompletableFuture<CaseAggregateResponse> */ - public CompletableFuture assignCaseAsync(String caseId, CaseAssignRequest body) { - return assignCaseWithHttpInfoAsync(caseId, body) + public CompletableFuture aggregateCasesAsync(CaseAggregateRequest body) { + return aggregateCasesWithHttpInfoAsync(body) .thenApply( response -> { return response.getData(); @@ -260,11 +307,11 @@ public CompletableFuture assignCaseAsync(String caseId, CaseAssign } /** - * Assign case to a user + * Performs an aggregation query over cases, grouping results by specified fields and returning + * counts per group along with a total. Useful for dashboards and analytics. * - * @param caseId Case's UUID or key (required) - * @param body Assign case payload (required) - * @return ApiResponse<CaseResponse> + * @param body Case aggregate request payload. (required) + * @return ApiResponse<CaseAggregateResponse> * @throws ApiException if fails to make API call * @http.response.details * @@ -278,30 +325,30 @@ public CompletableFuture assignCaseAsync(String caseId, CaseAssign * *
429 Too many requests -
*/ - public ApiResponse assignCaseWithHttpInfo(String caseId, CaseAssignRequest body) + public ApiResponse aggregateCasesWithHttpInfo(CaseAggregateRequest body) throws ApiException { - Object localVarPostBody = body; - - // verify the required parameter 'caseId' is set - if (caseId == null) { - throw new ApiException( - 400, "Missing the required parameter 'caseId' when calling assignCase"); + // Check if unstable operation is enabled + String operationId = "aggregateCases"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); } + Object localVarPostBody = body; // verify the required parameter 'body' is set if (body == null) { - throw new ApiException(400, "Missing the required parameter 'body' when calling assignCase"); + throw new ApiException( + 400, "Missing the required parameter 'body' when calling aggregateCases"); } // create path and map variables - String localVarPath = - "/api/v2/cases/{case_id}/assign" - .replaceAll("\\{" + "case_id" + "\\}", apiClient.escapeString(caseId.toString())); + String localVarPath = "/api/v2/cases/aggregate"; Map localVarHeaderParams = new HashMap(); Invocation.Builder builder = apiClient.createBuilder( - "v2.CaseManagementApi.assignCase", + "v2.CaseManagementApi.aggregateCases", localVarPath, new ArrayList(), localVarHeaderParams, @@ -316,41 +363,41 @@ public ApiResponse assignCaseWithHttpInfo(String caseId, CaseAssig localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * Assign case. + * Aggregate cases. * - *

See {@link #assignCaseWithHttpInfo}. + *

See {@link #aggregateCasesWithHttpInfo}. * - * @param caseId Case's UUID or key (required) - * @param body Assign case payload (required) - * @return CompletableFuture<ApiResponse<CaseResponse>> + * @param body Case aggregate request payload. (required) + * @return CompletableFuture<ApiResponse<CaseAggregateResponse>> */ - public CompletableFuture> assignCaseWithHttpInfoAsync( - String caseId, CaseAssignRequest body) { - Object localVarPostBody = body; - - // verify the required parameter 'caseId' is set - if (caseId == null) { - CompletableFuture> result = new CompletableFuture<>(); + public CompletableFuture> aggregateCasesWithHttpInfoAsync( + CaseAggregateRequest body) { + // Check if unstable operation is enabled + String operationId = "aggregateCases"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( - new ApiException(400, "Missing the required parameter 'caseId' when calling assignCase")); + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); return result; } + Object localVarPostBody = body; // verify the required parameter 'body' is set if (body == null) { - CompletableFuture> result = new CompletableFuture<>(); + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( - new ApiException(400, "Missing the required parameter 'body' when calling assignCase")); + new ApiException( + 400, "Missing the required parameter 'body' when calling aggregateCases")); return result; } // create path and map variables - String localVarPath = - "/api/v2/cases/{case_id}/assign" - .replaceAll("\\{" + "case_id" + "\\}", apiClient.escapeString(caseId.toString())); + String localVarPath = "/api/v2/cases/aggregate"; Map localVarHeaderParams = new HashMap(); @@ -358,7 +405,7 @@ public CompletableFuture> assignCaseWithHttpInfoAsync( try { builder = apiClient.createBuilder( - "v2.CaseManagementApi.assignCase", + "v2.CaseManagementApi.aggregateCases", localVarPath, new ArrayList(), localVarHeaderParams, @@ -366,7 +413,7 @@ public CompletableFuture> assignCaseWithHttpInfoAsync( new String[] {"application/json"}, new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); } catch (ApiException ex) { - CompletableFuture> result = new CompletableFuture<>(); + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally(ex); return result; } @@ -378,35 +425,34 @@ public CompletableFuture> assignCaseWithHttpInfoAsync( localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * Comment case. + * Archive case. * - *

See {@link #commentCaseWithHttpInfo}. + *

See {@link #archiveCaseWithHttpInfo}. * * @param caseId Case's UUID or key (required) - * @param body Case comment payload (required) - * @return TimelineResponse + * @param body Archive case payload (required) + * @return CaseResponse * @throws ApiException if fails to make API call */ - public TimelineResponse commentCase(String caseId, CaseCommentRequest body) throws ApiException { - return commentCaseWithHttpInfo(caseId, body).getData(); + public CaseResponse archiveCase(String caseId, CaseEmptyRequest body) throws ApiException { + return archiveCaseWithHttpInfo(caseId, body).getData(); } /** - * Comment case. + * Archive case. * - *

See {@link #commentCaseWithHttpInfoAsync}. + *

See {@link #archiveCaseWithHttpInfoAsync}. * * @param caseId Case's UUID or key (required) - * @param body Case comment payload (required) - * @return CompletableFuture<TimelineResponse> + * @param body Archive case payload (required) + * @return CompletableFuture<CaseResponse> */ - public CompletableFuture commentCaseAsync( - String caseId, CaseCommentRequest body) { - return commentCaseWithHttpInfoAsync(caseId, body) + public CompletableFuture archiveCaseAsync(String caseId, CaseEmptyRequest body) { + return archiveCaseWithHttpInfoAsync(caseId, body) .thenApply( response -> { return response.getData(); @@ -414,11 +460,11 @@ public CompletableFuture commentCaseAsync( } /** - * Comment case + * Archive case * * @param caseId Case's UUID or key (required) - * @param body Case comment payload (required) - * @return ApiResponse<TimelineResponse> + * @param body Archive case payload (required) + * @return ApiResponse<CaseResponse> * @throws ApiException if fails to make API call * @http.response.details * @@ -432,36 +478,36 @@ public CompletableFuture commentCaseAsync( * *
429 Too many requests -
*/ - public ApiResponse commentCaseWithHttpInfo( - String caseId, CaseCommentRequest body) throws ApiException { + public ApiResponse archiveCaseWithHttpInfo(String caseId, CaseEmptyRequest body) + throws ApiException { Object localVarPostBody = body; // verify the required parameter 'caseId' is set if (caseId == null) { throw new ApiException( - 400, "Missing the required parameter 'caseId' when calling commentCase"); + 400, "Missing the required parameter 'caseId' when calling archiveCase"); } // verify the required parameter 'body' is set if (body == null) { - throw new ApiException(400, "Missing the required parameter 'body' when calling commentCase"); + throw new ApiException(400, "Missing the required parameter 'body' when calling archiveCase"); } // create path and map variables String localVarPath = - "/api/v2/cases/{case_id}/comment" + "/api/v2/cases/{case_id}/archive" .replaceAll("\\{" + "case_id" + "\\}", apiClient.escapeString(caseId.toString())); Map localVarHeaderParams = new HashMap(); Invocation.Builder builder = apiClient.createBuilder( - "v2.CaseManagementApi.commentCase", + "v2.CaseManagementApi.archiveCase", localVarPath, new ArrayList(), localVarHeaderParams, new HashMap(), new String[] {"application/json"}, - new String[] {"apiKeyAuth", "appKeyAuth"}); + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); return apiClient.invokeAPI( "POST", builder, @@ -470,41 +516,41 @@ public ApiResponse commentCaseWithHttpInfo( localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * Comment case. + * Archive case. * - *

See {@link #commentCaseWithHttpInfo}. + *

See {@link #archiveCaseWithHttpInfo}. * * @param caseId Case's UUID or key (required) - * @param body Case comment payload (required) - * @return CompletableFuture<ApiResponse<TimelineResponse>> + * @param body Archive case payload (required) + * @return CompletableFuture<ApiResponse<CaseResponse>> */ - public CompletableFuture> commentCaseWithHttpInfoAsync( - String caseId, CaseCommentRequest body) { + public CompletableFuture> archiveCaseWithHttpInfoAsync( + String caseId, CaseEmptyRequest body) { Object localVarPostBody = body; // verify the required parameter 'caseId' is set if (caseId == null) { - CompletableFuture> result = new CompletableFuture<>(); + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( new ApiException( - 400, "Missing the required parameter 'caseId' when calling commentCase")); + 400, "Missing the required parameter 'caseId' when calling archiveCase")); return result; } // verify the required parameter 'body' is set if (body == null) { - CompletableFuture> result = new CompletableFuture<>(); + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( - new ApiException(400, "Missing the required parameter 'body' when calling commentCase")); + new ApiException(400, "Missing the required parameter 'body' when calling archiveCase")); return result; } // create path and map variables String localVarPath = - "/api/v2/cases/{case_id}/comment" + "/api/v2/cases/{case_id}/archive" .replaceAll("\\{" + "case_id" + "\\}", apiClient.escapeString(caseId.toString())); Map localVarHeaderParams = new HashMap(); @@ -513,15 +559,15 @@ public CompletableFuture> commentCaseWithHttpInfoA try { builder = apiClient.createBuilder( - "v2.CaseManagementApi.commentCase", + "v2.CaseManagementApi.archiveCase", localVarPath, new ArrayList(), localVarHeaderParams, new HashMap(), new String[] {"application/json"}, - new String[] {"apiKeyAuth", "appKeyAuth"}); + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); } catch (ApiException ex) { - CompletableFuture> result = new CompletableFuture<>(); + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally(ex); return result; } @@ -533,32 +579,34 @@ public CompletableFuture> commentCaseWithHttpInfoA localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * Create a case. + * Assign case. * - *

See {@link #createCaseWithHttpInfo}. + *

See {@link #assignCaseWithHttpInfo}. * - * @param body Case payload (required) + * @param caseId Case's UUID or key (required) + * @param body Assign case payload (required) * @return CaseResponse * @throws ApiException if fails to make API call */ - public CaseResponse createCase(CaseCreateRequest body) throws ApiException { - return createCaseWithHttpInfo(body).getData(); + public CaseResponse assignCase(String caseId, CaseAssignRequest body) throws ApiException { + return assignCaseWithHttpInfo(caseId, body).getData(); } /** - * Create a case. + * Assign case. * - *

See {@link #createCaseWithHttpInfoAsync}. + *

See {@link #assignCaseWithHttpInfoAsync}. * - * @param body Case payload (required) + * @param caseId Case's UUID or key (required) + * @param body Assign case payload (required) * @return CompletableFuture<CaseResponse> */ - public CompletableFuture createCaseAsync(CaseCreateRequest body) { - return createCaseWithHttpInfoAsync(body) + public CompletableFuture assignCaseAsync(String caseId, CaseAssignRequest body) { + return assignCaseWithHttpInfoAsync(caseId, body) .thenApply( response -> { return response.getData(); @@ -566,16 +614,17 @@ public CompletableFuture createCaseAsync(CaseCreateRequest body) { } /** - * Create a Case + * Assign case to a user * - * @param body Case payload (required) + * @param caseId Case's UUID or key (required) + * @param body Assign case payload (required) * @return ApiResponse<CaseResponse> * @throws ApiException if fails to make API call * @http.response.details * * * - * + * * * * @@ -583,22 +632,30 @@ public CompletableFuture createCaseAsync(CaseCreateRequest body) { * *
Response details
Status Code Description Response Headers
201 CREATED -
200 OK -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
429 Too many requests -
*/ - public ApiResponse createCaseWithHttpInfo(CaseCreateRequest body) + public ApiResponse assignCaseWithHttpInfo(String caseId, CaseAssignRequest body) throws ApiException { Object localVarPostBody = body; + // verify the required parameter 'caseId' is set + if (caseId == null) { + throw new ApiException( + 400, "Missing the required parameter 'caseId' when calling assignCase"); + } + // verify the required parameter 'body' is set if (body == null) { - throw new ApiException(400, "Missing the required parameter 'body' when calling createCase"); + throw new ApiException(400, "Missing the required parameter 'body' when calling assignCase"); } // create path and map variables - String localVarPath = "/api/v2/cases"; + String localVarPath = + "/api/v2/cases/{case_id}/assign" + .replaceAll("\\{" + "case_id" + "\\}", apiClient.escapeString(caseId.toString())); Map localVarHeaderParams = new HashMap(); Invocation.Builder builder = apiClient.createBuilder( - "v2.CaseManagementApi.createCase", + "v2.CaseManagementApi.assignCase", localVarPath, new ArrayList(), localVarHeaderParams, @@ -617,34 +674,45 @@ public ApiResponse createCaseWithHttpInfo(CaseCreateRequest body) } /** - * Create a case. + * Assign case. * - *

See {@link #createCaseWithHttpInfo}. + *

See {@link #assignCaseWithHttpInfo}. * - * @param body Case payload (required) + * @param caseId Case's UUID or key (required) + * @param body Assign case payload (required) * @return CompletableFuture<ApiResponse<CaseResponse>> */ - public CompletableFuture> createCaseWithHttpInfoAsync( - CaseCreateRequest body) { + public CompletableFuture> assignCaseWithHttpInfoAsync( + String caseId, CaseAssignRequest body) { Object localVarPostBody = body; - // verify the required parameter 'body' is set - if (body == null) { + // verify the required parameter 'caseId' is set + if (caseId == null) { CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( - new ApiException(400, "Missing the required parameter 'body' when calling createCase")); + new ApiException(400, "Missing the required parameter 'caseId' when calling assignCase")); return result; } - // create path and map variables - String localVarPath = "/api/v2/cases"; - Map localVarHeaderParams = new HashMap(); + // verify the required parameter 'body' is set + if (body == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(400, "Missing the required parameter 'body' when calling assignCase")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/cases/{case_id}/assign" + .replaceAll("\\{" + "case_id" + "\\}", apiClient.escapeString(caseId.toString())); + + Map localVarHeaderParams = new HashMap(); Invocation.Builder builder; try { builder = apiClient.createBuilder( - "v2.CaseManagementApi.createCase", + "v2.CaseManagementApi.assignCase", localVarPath, new ArrayList(), localVarHeaderParams, @@ -668,30 +736,27 @@ public CompletableFuture> createCaseWithHttpInfoAsync( } /** - * Create Jira issue for case. + * Bulk update cases. * - *

See {@link #createCaseJiraIssueWithHttpInfo}. + *

See {@link #bulkUpdateCasesWithHttpInfo}. * - * @param caseId Case's UUID or key (required) - * @param body Jira issue creation request (required) + * @param body Case bulk update request payload. (required) * @throws ApiException if fails to make API call */ - public void createCaseJiraIssue(String caseId, JiraIssueCreateRequest body) throws ApiException { - createCaseJiraIssueWithHttpInfo(caseId, body); + public void bulkUpdateCases(CaseBulkUpdateRequest body) throws ApiException { + bulkUpdateCasesWithHttpInfo(body); } /** - * Create Jira issue for case. + * Bulk update cases. * - *

See {@link #createCaseJiraIssueWithHttpInfoAsync}. + *

See {@link #bulkUpdateCasesWithHttpInfoAsync}. * - * @param caseId Case's UUID or key (required) - * @param body Jira issue creation request (required) + * @param body Case bulk update request payload. (required) * @return CompletableFuture */ - public CompletableFuture createCaseJiraIssueAsync( - String caseId, JiraIssueCreateRequest body) { - return createCaseJiraIssueWithHttpInfoAsync(caseId, body) + public CompletableFuture bulkUpdateCasesAsync(CaseBulkUpdateRequest body) { + return bulkUpdateCasesWithHttpInfoAsync(body) .thenApply( response -> { return response.getData(); @@ -699,17 +764,18 @@ public CompletableFuture createCaseJiraIssueAsync( } /** - * Create a new Jira issue and link it to a case + * Applies a single action (such as changing priority, status, assignment, or archiving) to + * multiple cases at once. The list of case IDs and the action type with its payload are specified + * in the request body. * - * @param caseId Case's UUID or key (required) - * @param body Jira issue creation request (required) + * @param body Case bulk update request payload. (required) * @return ApiResponse<Void> * @throws ApiException if fails to make API call * @http.response.details * * * - * + * * * * @@ -717,10 +783,10 @@ public CompletableFuture createCaseJiraIssueAsync( * *
Response details
Status Code Description Response Headers
202 Accepted -
200 OK -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
429 Too many requests -
*/ - public ApiResponse createCaseJiraIssueWithHttpInfo( - String caseId, JiraIssueCreateRequest body) throws ApiException { + public ApiResponse bulkUpdateCasesWithHttpInfo(CaseBulkUpdateRequest body) + throws ApiException { // Check if unstable operation is enabled - String operationId = "createCaseJiraIssue"; + String operationId = "bulkUpdateCases"; if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); } else { @@ -728,27 +794,19 @@ public ApiResponse createCaseJiraIssueWithHttpInfo( } Object localVarPostBody = body; - // verify the required parameter 'caseId' is set - if (caseId == null) { - throw new ApiException( - 400, "Missing the required parameter 'caseId' when calling createCaseJiraIssue"); - } - // verify the required parameter 'body' is set if (body == null) { throw new ApiException( - 400, "Missing the required parameter 'body' when calling createCaseJiraIssue"); + 400, "Missing the required parameter 'body' when calling bulkUpdateCases"); } // create path and map variables - String localVarPath = - "/api/v2/cases/{case_id}/relationships/jira_issues" - .replaceAll("\\{" + "case_id" + "\\}", apiClient.escapeString(caseId.toString())); + String localVarPath = "/api/v2/cases/bulk"; Map localVarHeaderParams = new HashMap(); Invocation.Builder builder = apiClient.createBuilder( - "v2.CaseManagementApi.createCaseJiraIssue", + "v2.CaseManagementApi.bulkUpdateCases", localVarPath, new ArrayList(), localVarHeaderParams, @@ -767,18 +825,17 @@ public ApiResponse createCaseJiraIssueWithHttpInfo( } /** - * Create Jira issue for case. + * Bulk update cases. * - *

See {@link #createCaseJiraIssueWithHttpInfo}. + *

See {@link #bulkUpdateCasesWithHttpInfo}. * - * @param caseId Case's UUID or key (required) - * @param body Jira issue creation request (required) + * @param body Case bulk update request payload. (required) * @return CompletableFuture<ApiResponse<Void>> */ - public CompletableFuture> createCaseJiraIssueWithHttpInfoAsync( - String caseId, JiraIssueCreateRequest body) { + public CompletableFuture> bulkUpdateCasesWithHttpInfoAsync( + CaseBulkUpdateRequest body) { // Check if unstable operation is enabled - String operationId = "createCaseJiraIssue"; + String operationId = "bulkUpdateCases"; if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); } else { @@ -789,27 +846,16 @@ public CompletableFuture> createCaseJiraIssueWithHttpInfoAsync } Object localVarPostBody = body; - // verify the required parameter 'caseId' is set - if (caseId == null) { - CompletableFuture> result = new CompletableFuture<>(); - result.completeExceptionally( - new ApiException( - 400, "Missing the required parameter 'caseId' when calling createCaseJiraIssue")); - return result; - } - // verify the required parameter 'body' is set if (body == null) { CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( new ApiException( - 400, "Missing the required parameter 'body' when calling createCaseJiraIssue")); + 400, "Missing the required parameter 'body' when calling bulkUpdateCases")); return result; } // create path and map variables - String localVarPath = - "/api/v2/cases/{case_id}/relationships/jira_issues" - .replaceAll("\\{" + "case_id" + "\\}", apiClient.escapeString(caseId.toString())); + String localVarPath = "/api/v2/cases/bulk"; Map localVarHeaderParams = new HashMap(); @@ -817,7 +863,7 @@ public CompletableFuture> createCaseJiraIssueWithHttpInfoAsync try { builder = apiClient.createBuilder( - "v2.CaseManagementApi.createCaseJiraIssue", + "v2.CaseManagementApi.bulkUpdateCases", localVarPath, new ArrayList(), localVarHeaderParams, @@ -841,30 +887,31 @@ public CompletableFuture> createCaseJiraIssueWithHttpInfoAsync } /** - * Create investigation notebook for case. + * Comment case. * - *

See {@link #createCaseNotebookWithHttpInfo}. + *

See {@link #commentCaseWithHttpInfo}. * * @param caseId Case's UUID or key (required) - * @param body Notebook creation request (required) + * @param body Case comment payload (required) + * @return TimelineResponse * @throws ApiException if fails to make API call */ - public void createCaseNotebook(String caseId, NotebookCreateRequest body) throws ApiException { - createCaseNotebookWithHttpInfo(caseId, body); + public TimelineResponse commentCase(String caseId, CaseCommentRequest body) throws ApiException { + return commentCaseWithHttpInfo(caseId, body).getData(); } /** - * Create investigation notebook for case. + * Comment case. * - *

See {@link #createCaseNotebookWithHttpInfoAsync}. + *

See {@link #commentCaseWithHttpInfoAsync}. * * @param caseId Case's UUID or key (required) - * @param body Notebook creation request (required) - * @return CompletableFuture + * @param body Case comment payload (required) + * @return CompletableFuture<TimelineResponse> */ - public CompletableFuture createCaseNotebookAsync( - String caseId, NotebookCreateRequest body) { - return createCaseNotebookWithHttpInfoAsync(caseId, body) + public CompletableFuture commentCaseAsync( + String caseId, CaseCommentRequest body) { + return commentCaseWithHttpInfoAsync(caseId, body) .thenApply( response -> { return response.getData(); @@ -872,17 +919,17 @@ public CompletableFuture createCaseNotebookAsync( } /** - * Create a new investigation notebook and link it to a case + * Comment case * * @param caseId Case's UUID or key (required) - * @param body Notebook creation request (required) - * @return ApiResponse<Void> + * @param body Case comment payload (required) + * @return ApiResponse<TimelineResponse> * @throws ApiException if fails to make API call * @http.response.details * * * - * + * * * * @@ -890,44 +937,36 @@ public CompletableFuture createCaseNotebookAsync( * *
Response details
Status Code Description Response Headers
204 No Content -
200 OK -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
429 Too many requests -
*/ - public ApiResponse createCaseNotebookWithHttpInfo(String caseId, NotebookCreateRequest body) - throws ApiException { - // Check if unstable operation is enabled - String operationId = "createCaseNotebook"; - if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { - apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); - } else { - throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); - } + public ApiResponse commentCaseWithHttpInfo( + String caseId, CaseCommentRequest body) throws ApiException { Object localVarPostBody = body; // verify the required parameter 'caseId' is set if (caseId == null) { throw new ApiException( - 400, "Missing the required parameter 'caseId' when calling createCaseNotebook"); + 400, "Missing the required parameter 'caseId' when calling commentCase"); } // verify the required parameter 'body' is set if (body == null) { - throw new ApiException( - 400, "Missing the required parameter 'body' when calling createCaseNotebook"); + throw new ApiException(400, "Missing the required parameter 'body' when calling commentCase"); } // create path and map variables String localVarPath = - "/api/v2/cases/{case_id}/relationships/notebook" + "/api/v2/cases/{case_id}/comment" .replaceAll("\\{" + "case_id" + "\\}", apiClient.escapeString(caseId.toString())); Map localVarHeaderParams = new HashMap(); Invocation.Builder builder = apiClient.createBuilder( - "v2.CaseManagementApi.createCaseNotebook", + "v2.CaseManagementApi.commentCase", localVarPath, new ArrayList(), localVarHeaderParams, new HashMap(), - new String[] {"*/*"}, - new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); return apiClient.invokeAPI( "POST", builder, @@ -936,52 +975,41 @@ public ApiResponse createCaseNotebookWithHttpInfo(String caseId, NotebookC localVarPostBody, new HashMap(), false, - null); + new GenericType() {}); } /** - * Create investigation notebook for case. + * Comment case. * - *

See {@link #createCaseNotebookWithHttpInfo}. + *

See {@link #commentCaseWithHttpInfo}. * * @param caseId Case's UUID or key (required) - * @param body Notebook creation request (required) - * @return CompletableFuture<ApiResponse<Void>> + * @param body Case comment payload (required) + * @return CompletableFuture<ApiResponse<TimelineResponse>> */ - public CompletableFuture> createCaseNotebookWithHttpInfoAsync( - String caseId, NotebookCreateRequest body) { - // Check if unstable operation is enabled - String operationId = "createCaseNotebook"; - if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { - apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); - } else { - CompletableFuture> result = new CompletableFuture<>(); - result.completeExceptionally( - new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); - return result; - } + public CompletableFuture> commentCaseWithHttpInfoAsync( + String caseId, CaseCommentRequest body) { Object localVarPostBody = body; // verify the required parameter 'caseId' is set if (caseId == null) { - CompletableFuture> result = new CompletableFuture<>(); + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( new ApiException( - 400, "Missing the required parameter 'caseId' when calling createCaseNotebook")); + 400, "Missing the required parameter 'caseId' when calling commentCase")); return result; } // verify the required parameter 'body' is set if (body == null) { - CompletableFuture> result = new CompletableFuture<>(); + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( - new ApiException( - 400, "Missing the required parameter 'body' when calling createCaseNotebook")); + new ApiException(400, "Missing the required parameter 'body' when calling commentCase")); return result; } // create path and map variables String localVarPath = - "/api/v2/cases/{case_id}/relationships/notebook" + "/api/v2/cases/{case_id}/comment" .replaceAll("\\{" + "case_id" + "\\}", apiClient.escapeString(caseId.toString())); Map localVarHeaderParams = new HashMap(); @@ -990,15 +1018,15 @@ public CompletableFuture> createCaseNotebookWithHttpInfoAsync( try { builder = apiClient.createBuilder( - "v2.CaseManagementApi.createCaseNotebook", + "v2.CaseManagementApi.commentCase", localVarPath, new ArrayList(), localVarHeaderParams, new HashMap(), - new String[] {"*/*"}, - new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); } catch (ApiException ex) { - CompletableFuture> result = new CompletableFuture<>(); + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally(ex); return result; } @@ -1010,35 +1038,70 @@ public CompletableFuture> createCaseNotebookWithHttpInfoAsync( localVarPostBody, new HashMap(), false, - null); + new GenericType() {}); + } + + /** Manage optional parameters to countCases. */ + public static class CountCasesOptionalParameters { + private String queryFilter; + private String groupBys; + private Integer limit; + + /** + * Set queryFilter. + * + * @param queryFilter Filter query for cases. (optional) + * @return CountCasesOptionalParameters + */ + public CountCasesOptionalParameters queryFilter(String queryFilter) { + this.queryFilter = queryFilter; + return this; + } + + /** + * Set groupBys. + * + * @param groupBys Comma-separated fields to group by. (optional) + * @return CountCasesOptionalParameters + */ + public CountCasesOptionalParameters groupBys(String groupBys) { + this.groupBys = groupBys; + return this; + } + + /** + * Set limit. + * + * @param limit Maximum facet values to return. (optional) + * @return CountCasesOptionalParameters + */ + public CountCasesOptionalParameters limit(Integer limit) { + this.limit = limit; + return this; + } } /** - * Create ServiceNow ticket for case. + * Count cases. * - *

See {@link #createCaseServiceNowTicketWithHttpInfo}. + *

See {@link #countCasesWithHttpInfo}. * - * @param caseId Case's UUID or key (required) - * @param body ServiceNow ticket creation request (required) + * @return CaseCountResponse * @throws ApiException if fails to make API call */ - public void createCaseServiceNowTicket(String caseId, ServiceNowTicketCreateRequest body) - throws ApiException { - createCaseServiceNowTicketWithHttpInfo(caseId, body); + public CaseCountResponse countCases() throws ApiException { + return countCasesWithHttpInfo(new CountCasesOptionalParameters()).getData(); } /** - * Create ServiceNow ticket for case. + * Count cases. * - *

See {@link #createCaseServiceNowTicketWithHttpInfoAsync}. + *

See {@link #countCasesWithHttpInfoAsync}. * - * @param caseId Case's UUID or key (required) - * @param body ServiceNow ticket creation request (required) - * @return CompletableFuture + * @return CompletableFuture<CaseCountResponse> */ - public CompletableFuture createCaseServiceNowTicketAsync( - String caseId, ServiceNowTicketCreateRequest body) { - return createCaseServiceNowTicketWithHttpInfoAsync(caseId, body) + public CompletableFuture countCasesAsync() { + return countCasesWithHttpInfoAsync(new CountCasesOptionalParameters()) .thenApply( response -> { return response.getData(); @@ -1046,17 +1109,47 @@ public CompletableFuture createCaseServiceNowTicketAsync( } /** - * Create a new ServiceNow incident ticket and link it to a case + * Count cases. * - * @param caseId Case's UUID or key (required) - * @param body ServiceNow ticket creation request (required) - * @return ApiResponse<Void> + *

See {@link #countCasesWithHttpInfo}. + * + * @param parameters Optional parameters for the request. + * @return CaseCountResponse + * @throws ApiException if fails to make API call + */ + public CaseCountResponse countCases(CountCasesOptionalParameters parameters) throws ApiException { + return countCasesWithHttpInfo(parameters).getData(); + } + + /** + * Count cases. + * + *

See {@link #countCasesWithHttpInfoAsync}. + * + * @param parameters Optional parameters for the request. + * @return CompletableFuture<CaseCountResponse> + */ + public CompletableFuture countCasesAsync( + CountCasesOptionalParameters parameters) { + return countCasesWithHttpInfoAsync(parameters) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Returns case counts, optionally grouped by one or more fields (for example, status, priority). + * Supports a query filter to narrow the scope. + * + * @param parameters Optional parameters for the request. + * @return ApiResponse<CaseCountResponse> * @throws ApiException if fails to make API call * @http.response.details * * * - * + * * * * @@ -1064,154 +1157,133 @@ public CompletableFuture createCaseServiceNowTicketAsync( * *
Response details
Status Code Description Response Headers
202 Accepted -
200 OK -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
429 Too many requests -
*/ - public ApiResponse createCaseServiceNowTicketWithHttpInfo( - String caseId, ServiceNowTicketCreateRequest body) throws ApiException { + public ApiResponse countCasesWithHttpInfo( + CountCasesOptionalParameters parameters) throws ApiException { // Check if unstable operation is enabled - String operationId = "createCaseServiceNowTicket"; + String operationId = "countCases"; if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); } else { throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); } - Object localVarPostBody = body; - - // verify the required parameter 'caseId' is set - if (caseId == null) { - throw new ApiException( - 400, "Missing the required parameter 'caseId' when calling createCaseServiceNowTicket"); - } - - // verify the required parameter 'body' is set - if (body == null) { - throw new ApiException( - 400, "Missing the required parameter 'body' when calling createCaseServiceNowTicket"); - } + Object localVarPostBody = null; + String queryFilter = parameters.queryFilter; + String groupBys = parameters.groupBys; + Integer limit = parameters.limit; // create path and map variables - String localVarPath = - "/api/v2/cases/{case_id}/relationships/servicenow_tickets" - .replaceAll("\\{" + "case_id" + "\\}", apiClient.escapeString(caseId.toString())); + String localVarPath = "/api/v2/cases/count"; + List localVarQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "query_filter", queryFilter)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "group_bys", groupBys)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "limit", limit)); + Invocation.Builder builder = apiClient.createBuilder( - "v2.CaseManagementApi.createCaseServiceNowTicket", + "v2.CaseManagementApi.countCases", localVarPath, - new ArrayList(), + localVarQueryParams, localVarHeaderParams, new HashMap(), - new String[] {"*/*"}, + new String[] {"application/json"}, new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); return apiClient.invokeAPI( - "POST", + "GET", builder, localVarHeaderParams, - new String[] {"application/json"}, + new String[] {}, localVarPostBody, new HashMap(), false, - null); + new GenericType() {}); } /** - * Create ServiceNow ticket for case. + * Count cases. * - *

See {@link #createCaseServiceNowTicketWithHttpInfo}. + *

See {@link #countCasesWithHttpInfo}. * - * @param caseId Case's UUID or key (required) - * @param body ServiceNow ticket creation request (required) - * @return CompletableFuture<ApiResponse<Void>> + * @param parameters Optional parameters for the request. + * @return CompletableFuture<ApiResponse<CaseCountResponse>> */ - public CompletableFuture> createCaseServiceNowTicketWithHttpInfoAsync( - String caseId, ServiceNowTicketCreateRequest body) { + public CompletableFuture> countCasesWithHttpInfoAsync( + CountCasesOptionalParameters parameters) { // Check if unstable operation is enabled - String operationId = "createCaseServiceNowTicket"; + String operationId = "countCases"; if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); } else { - CompletableFuture> result = new CompletableFuture<>(); + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); return result; } - Object localVarPostBody = body; - - // verify the required parameter 'caseId' is set - if (caseId == null) { - CompletableFuture> result = new CompletableFuture<>(); - result.completeExceptionally( - new ApiException( - 400, - "Missing the required parameter 'caseId' when calling createCaseServiceNowTicket")); - return result; - } - - // verify the required parameter 'body' is set - if (body == null) { - CompletableFuture> result = new CompletableFuture<>(); - result.completeExceptionally( - new ApiException( - 400, - "Missing the required parameter 'body' when calling createCaseServiceNowTicket")); - return result; - } + Object localVarPostBody = null; + String queryFilter = parameters.queryFilter; + String groupBys = parameters.groupBys; + Integer limit = parameters.limit; // create path and map variables - String localVarPath = - "/api/v2/cases/{case_id}/relationships/servicenow_tickets" - .replaceAll("\\{" + "case_id" + "\\}", apiClient.escapeString(caseId.toString())); + String localVarPath = "/api/v2/cases/count"; + List localVarQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "query_filter", queryFilter)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "group_bys", groupBys)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "limit", limit)); + Invocation.Builder builder; try { builder = apiClient.createBuilder( - "v2.CaseManagementApi.createCaseServiceNowTicket", + "v2.CaseManagementApi.countCases", localVarPath, - new ArrayList(), + localVarQueryParams, localVarHeaderParams, new HashMap(), - new String[] {"*/*"}, + new String[] {"application/json"}, new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); } catch (ApiException ex) { - CompletableFuture> result = new CompletableFuture<>(); + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally(ex); return result; } return apiClient.invokeAPIAsync( - "POST", + "GET", builder, localVarHeaderParams, - new String[] {"application/json"}, + new String[] {}, localVarPostBody, new HashMap(), false, - null); + new GenericType() {}); } /** - * Create a project. + * Create a case. * - *

See {@link #createProjectWithHttpInfo}. + *

See {@link #createCaseWithHttpInfo}. * - * @param body Project payload. (required) - * @return ProjectResponse + * @param body Case payload (required) + * @return CaseResponse * @throws ApiException if fails to make API call */ - public ProjectResponse createProject(ProjectCreateRequest body) throws ApiException { - return createProjectWithHttpInfo(body).getData(); + public CaseResponse createCase(CaseCreateRequest body) throws ApiException { + return createCaseWithHttpInfo(body).getData(); } /** - * Create a project. + * Create a case. * - *

See {@link #createProjectWithHttpInfoAsync}. + *

See {@link #createCaseWithHttpInfoAsync}. * - * @param body Project payload. (required) - * @return CompletableFuture<ProjectResponse> + * @param body Case payload (required) + * @return CompletableFuture<CaseResponse> */ - public CompletableFuture createProjectAsync(ProjectCreateRequest body) { - return createProjectWithHttpInfoAsync(body) + public CompletableFuture createCaseAsync(CaseCreateRequest body) { + return createCaseWithHttpInfoAsync(body) .thenApply( response -> { return response.getData(); @@ -1219,10 +1291,10 @@ public CompletableFuture createProjectAsync(ProjectCreateReques } /** - * Create a project. + * Create a Case * - * @param body Project payload. (required) - * @return ApiResponse<ProjectResponse> + * @param body Case payload (required) + * @return ApiResponse<CaseResponse> * @throws ApiException if fails to make API call * @http.response.details * @@ -1236,23 +1308,22 @@ public CompletableFuture createProjectAsync(ProjectCreateReques * *
429 Too many requests -
*/ - public ApiResponse createProjectWithHttpInfo(ProjectCreateRequest body) + public ApiResponse createCaseWithHttpInfo(CaseCreateRequest body) throws ApiException { Object localVarPostBody = body; // verify the required parameter 'body' is set if (body == null) { - throw new ApiException( - 400, "Missing the required parameter 'body' when calling createProject"); + throw new ApiException(400, "Missing the required parameter 'body' when calling createCase"); } // create path and map variables - String localVarPath = "/api/v2/cases/projects"; + String localVarPath = "/api/v2/cases"; Map localVarHeaderParams = new HashMap(); Invocation.Builder builder = apiClient.createBuilder( - "v2.CaseManagementApi.createProject", + "v2.CaseManagementApi.createCase", localVarPath, new ArrayList(), localVarHeaderParams, @@ -1267,31 +1338,30 @@ public ApiResponse createProjectWithHttpInfo(ProjectCreateReque localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * Create a project. + * Create a case. * - *

See {@link #createProjectWithHttpInfo}. + *

See {@link #createCaseWithHttpInfo}. * - * @param body Project payload. (required) - * @return CompletableFuture<ApiResponse<ProjectResponse>> + * @param body Case payload (required) + * @return CompletableFuture<ApiResponse<CaseResponse>> */ - public CompletableFuture> createProjectWithHttpInfoAsync( - ProjectCreateRequest body) { + public CompletableFuture> createCaseWithHttpInfoAsync( + CaseCreateRequest body) { Object localVarPostBody = body; // verify the required parameter 'body' is set if (body == null) { - CompletableFuture> result = new CompletableFuture<>(); + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( - new ApiException( - 400, "Missing the required parameter 'body' when calling createProject")); + new ApiException(400, "Missing the required parameter 'body' when calling createCase")); return result; } // create path and map variables - String localVarPath = "/api/v2/cases/projects"; + String localVarPath = "/api/v2/cases"; Map localVarHeaderParams = new HashMap(); @@ -1299,7 +1369,7 @@ public CompletableFuture> createProjectWithHttpInfo try { builder = apiClient.createBuilder( - "v2.CaseManagementApi.createProject", + "v2.CaseManagementApi.createCase", localVarPath, new ArrayList(), localVarHeaderParams, @@ -1307,7 +1377,7 @@ public CompletableFuture> createProjectWithHttpInfo new String[] {"application/json"}, new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); } catch (ApiException ex) { - CompletableFuture> result = new CompletableFuture<>(); + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally(ex); return result; } @@ -1319,36 +1389,36 @@ public CompletableFuture> createProjectWithHttpInfo localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * Create a notification rule. + * Create an automation rule. * - *

See {@link #createProjectNotificationRuleWithHttpInfo}. + *

See {@link #createCaseAutomationRuleWithHttpInfo}. * - * @param projectId Project UUID (required) - * @param body Notification rule payload (required) - * @return CaseNotificationRuleResponse + * @param projectId The UUID of the project that owns the automation rules. (required) + * @param body Automation rule payload. (required) + * @return AutomationRuleResponse * @throws ApiException if fails to make API call */ - public CaseNotificationRuleResponse createProjectNotificationRule( - String projectId, CaseNotificationRuleCreateRequest body) throws ApiException { - return createProjectNotificationRuleWithHttpInfo(projectId, body).getData(); + public AutomationRuleResponse createCaseAutomationRule( + String projectId, AutomationRuleCreateRequest body) throws ApiException { + return createCaseAutomationRuleWithHttpInfo(projectId, body).getData(); } /** - * Create a notification rule. + * Create an automation rule. * - *

See {@link #createProjectNotificationRuleWithHttpInfoAsync}. + *

See {@link #createCaseAutomationRuleWithHttpInfoAsync}. * - * @param projectId Project UUID (required) - * @param body Notification rule payload (required) - * @return CompletableFuture<CaseNotificationRuleResponse> + * @param projectId The UUID of the project that owns the automation rules. (required) + * @param body Automation rule payload. (required) + * @return CompletableFuture<AutomationRuleResponse> */ - public CompletableFuture createProjectNotificationRuleAsync( - String projectId, CaseNotificationRuleCreateRequest body) { - return createProjectNotificationRuleWithHttpInfoAsync(projectId, body) + public CompletableFuture createCaseAutomationRuleAsync( + String projectId, AutomationRuleCreateRequest body) { + return createCaseAutomationRuleWithHttpInfoAsync(projectId, body) .thenApply( response -> { return response.getData(); @@ -1356,17 +1426,18 @@ public CompletableFuture createProjectNotification } /** - * Create a notification rule for a project. + * Creates an automation rule for a project. The rule defines a trigger event (for example, case + * created, status transitioned) and an action to execute. * - * @param projectId Project UUID (required) - * @param body Notification rule payload (required) - * @return ApiResponse<CaseNotificationRuleResponse> + * @param projectId The UUID of the project that owns the automation rules. (required) + * @param body Automation rule payload. (required) + * @return ApiResponse<AutomationRuleResponse> * @throws ApiException if fails to make API call * @http.response.details * * * - * + * * * * @@ -1374,32 +1445,38 @@ public CompletableFuture createProjectNotification * *
Response details
Status Code Description Response Headers
201 CREATED -
201 Created -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
429 Too many requests -
*/ - public ApiResponse createProjectNotificationRuleWithHttpInfo( - String projectId, CaseNotificationRuleCreateRequest body) throws ApiException { + public ApiResponse createCaseAutomationRuleWithHttpInfo( + String projectId, AutomationRuleCreateRequest body) throws ApiException { + // Check if unstable operation is enabled + String operationId = "createCaseAutomationRule"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } Object localVarPostBody = body; // verify the required parameter 'projectId' is set if (projectId == null) { throw new ApiException( - 400, - "Missing the required parameter 'projectId' when calling createProjectNotificationRule"); + 400, "Missing the required parameter 'projectId' when calling createCaseAutomationRule"); } // verify the required parameter 'body' is set if (body == null) { throw new ApiException( - 400, "Missing the required parameter 'body' when calling createProjectNotificationRule"); + 400, "Missing the required parameter 'body' when calling createCaseAutomationRule"); } // create path and map variables String localVarPath = - "/api/v2/cases/projects/{project_id}/notification_rules" + "/api/v2/cases/projects/{project_id}/rules" .replaceAll("\\{" + "project_id" + "\\}", apiClient.escapeString(projectId.toString())); Map localVarHeaderParams = new HashMap(); Invocation.Builder builder = apiClient.createBuilder( - "v2.CaseManagementApi.createProjectNotificationRule", + "v2.CaseManagementApi.createCaseAutomationRule", localVarPath, new ArrayList(), localVarHeaderParams, @@ -1414,48 +1491,54 @@ public ApiResponse createProjectNotificationRuleWi localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * Create a notification rule. + * Create an automation rule. * - *

See {@link #createProjectNotificationRuleWithHttpInfo}. + *

See {@link #createCaseAutomationRuleWithHttpInfo}. * - * @param projectId Project UUID (required) - * @param body Notification rule payload (required) - * @return CompletableFuture<ApiResponse<CaseNotificationRuleResponse>> + * @param projectId The UUID of the project that owns the automation rules. (required) + * @param body Automation rule payload. (required) + * @return CompletableFuture<ApiResponse<AutomationRuleResponse>> */ - public CompletableFuture> - createProjectNotificationRuleWithHttpInfoAsync( - String projectId, CaseNotificationRuleCreateRequest body) { + public CompletableFuture> + createCaseAutomationRuleWithHttpInfoAsync( + String projectId, AutomationRuleCreateRequest body) { + // Check if unstable operation is enabled + String operationId = "createCaseAutomationRule"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } Object localVarPostBody = body; // verify the required parameter 'projectId' is set if (projectId == null) { - CompletableFuture> result = - new CompletableFuture<>(); + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( new ApiException( 400, - "Missing the required parameter 'projectId' when calling" - + " createProjectNotificationRule")); + "Missing the required parameter 'projectId' when calling createCaseAutomationRule")); return result; } // verify the required parameter 'body' is set if (body == null) { - CompletableFuture> result = - new CompletableFuture<>(); + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( new ApiException( - 400, - "Missing the required parameter 'body' when calling createProjectNotificationRule")); + 400, "Missing the required parameter 'body' when calling createCaseAutomationRule")); return result; } // create path and map variables String localVarPath = - "/api/v2/cases/projects/{project_id}/notification_rules" + "/api/v2/cases/projects/{project_id}/rules" .replaceAll("\\{" + "project_id" + "\\}", apiClient.escapeString(projectId.toString())); Map localVarHeaderParams = new HashMap(); @@ -1464,7 +1547,7 @@ public ApiResponse createProjectNotificationRuleWi try { builder = apiClient.createBuilder( - "v2.CaseManagementApi.createProjectNotificationRule", + "v2.CaseManagementApi.createCaseAutomationRule", localVarPath, new ArrayList(), localVarHeaderParams, @@ -1472,8 +1555,7 @@ public ApiResponse createProjectNotificationRuleWi new String[] {"application/json"}, new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); } catch (ApiException ex) { - CompletableFuture> result = - new CompletableFuture<>(); + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally(ex); return result; } @@ -1485,33 +1567,34 @@ public ApiResponse createProjectNotificationRuleWi localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * Delete case comment. + * Create Jira issue for case. * - *

See {@link #deleteCaseCommentWithHttpInfo}. + *

See {@link #createCaseJiraIssueWithHttpInfo}. * * @param caseId Case's UUID or key (required) - * @param cellId Timeline cell's UUID (required) + * @param body Jira issue creation request (required) * @throws ApiException if fails to make API call */ - public void deleteCaseComment(String caseId, String cellId) throws ApiException { - deleteCaseCommentWithHttpInfo(caseId, cellId); + public void createCaseJiraIssue(String caseId, JiraIssueCreateRequest body) throws ApiException { + createCaseJiraIssueWithHttpInfo(caseId, body); } /** - * Delete case comment. + * Create Jira issue for case. * - *

See {@link #deleteCaseCommentWithHttpInfoAsync}. + *

See {@link #createCaseJiraIssueWithHttpInfoAsync}. * * @param caseId Case's UUID or key (required) - * @param cellId Timeline cell's UUID (required) + * @param body Jira issue creation request (required) * @return CompletableFuture */ - public CompletableFuture deleteCaseCommentAsync(String caseId, String cellId) { - return deleteCaseCommentWithHttpInfoAsync(caseId, cellId) + public CompletableFuture createCaseJiraIssueAsync( + String caseId, JiraIssueCreateRequest body) { + return createCaseJiraIssueWithHttpInfoAsync(caseId, body) .thenApply( response -> { return response.getData(); @@ -1519,17 +1602,17 @@ public CompletableFuture deleteCaseCommentAsync(String caseId, String cell } /** - * Delete case comment + * Create a new Jira issue and link it to a case * * @param caseId Case's UUID or key (required) - * @param cellId Timeline cell's UUID (required) + * @param body Jira issue creation request (required) * @return ApiResponse<Void> * @throws ApiException if fails to make API call * @http.response.details * * * - * + * * * * @@ -1537,43 +1620,49 @@ public CompletableFuture deleteCaseCommentAsync(String caseId, String cell * *
Response details
Status Code Description Response Headers
204 No Content -
202 Accepted -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
429 Too many requests -
*/ - public ApiResponse deleteCaseCommentWithHttpInfo(String caseId, String cellId) - throws ApiException { - Object localVarPostBody = null; + public ApiResponse createCaseJiraIssueWithHttpInfo( + String caseId, JiraIssueCreateRequest body) throws ApiException { + // Check if unstable operation is enabled + String operationId = "createCaseJiraIssue"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = body; // verify the required parameter 'caseId' is set if (caseId == null) { throw new ApiException( - 400, "Missing the required parameter 'caseId' when calling deleteCaseComment"); + 400, "Missing the required parameter 'caseId' when calling createCaseJiraIssue"); } - // verify the required parameter 'cellId' is set - if (cellId == null) { + // verify the required parameter 'body' is set + if (body == null) { throw new ApiException( - 400, "Missing the required parameter 'cellId' when calling deleteCaseComment"); + 400, "Missing the required parameter 'body' when calling createCaseJiraIssue"); } // create path and map variables String localVarPath = - "/api/v2/cases/{case_id}/comment/{cell_id}" - .replaceAll("\\{" + "case_id" + "\\}", apiClient.escapeString(caseId.toString())) - .replaceAll("\\{" + "cell_id" + "\\}", apiClient.escapeString(cellId.toString())); + "/api/v2/cases/{case_id}/relationships/jira_issues" + .replaceAll("\\{" + "case_id" + "\\}", apiClient.escapeString(caseId.toString())); Map localVarHeaderParams = new HashMap(); Invocation.Builder builder = apiClient.createBuilder( - "v2.CaseManagementApi.deleteCaseComment", + "v2.CaseManagementApi.createCaseJiraIssue", localVarPath, new ArrayList(), localVarHeaderParams, new HashMap(), new String[] {"*/*"}, - new String[] {"apiKeyAuth", "appKeyAuth"}); + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); return apiClient.invokeAPI( - "DELETE", + "POST", builder, localVarHeaderParams, - new String[] {}, + new String[] {"application/json"}, localVarPostBody, new HashMap(), false, @@ -1581,40 +1670,49 @@ public ApiResponse deleteCaseCommentWithHttpInfo(String caseId, String cel } /** - * Delete case comment. + * Create Jira issue for case. * - *

See {@link #deleteCaseCommentWithHttpInfo}. + *

See {@link #createCaseJiraIssueWithHttpInfo}. * * @param caseId Case's UUID or key (required) - * @param cellId Timeline cell's UUID (required) + * @param body Jira issue creation request (required) * @return CompletableFuture<ApiResponse<Void>> */ - public CompletableFuture> deleteCaseCommentWithHttpInfoAsync( - String caseId, String cellId) { - Object localVarPostBody = null; - - // verify the required parameter 'caseId' is set - if (caseId == null) { + public CompletableFuture> createCaseJiraIssueWithHttpInfoAsync( + String caseId, JiraIssueCreateRequest body) { + // Check if unstable operation is enabled + String operationId = "createCaseJiraIssue"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = body; + + // verify the required parameter 'caseId' is set + if (caseId == null) { CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( new ApiException( - 400, "Missing the required parameter 'caseId' when calling deleteCaseComment")); + 400, "Missing the required parameter 'caseId' when calling createCaseJiraIssue")); return result; } - // verify the required parameter 'cellId' is set - if (cellId == null) { + // verify the required parameter 'body' is set + if (body == null) { CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( new ApiException( - 400, "Missing the required parameter 'cellId' when calling deleteCaseComment")); + 400, "Missing the required parameter 'body' when calling createCaseJiraIssue")); return result; } // create path and map variables String localVarPath = - "/api/v2/cases/{case_id}/comment/{cell_id}" - .replaceAll("\\{" + "case_id" + "\\}", apiClient.escapeString(caseId.toString())) - .replaceAll("\\{" + "cell_id" + "\\}", apiClient.escapeString(cellId.toString())); + "/api/v2/cases/{case_id}/relationships/jira_issues" + .replaceAll("\\{" + "case_id" + "\\}", apiClient.escapeString(caseId.toString())); Map localVarHeaderParams = new HashMap(); @@ -1622,23 +1720,23 @@ public CompletableFuture> deleteCaseCommentWithHttpInfoAsync( try { builder = apiClient.createBuilder( - "v2.CaseManagementApi.deleteCaseComment", + "v2.CaseManagementApi.createCaseJiraIssue", localVarPath, new ArrayList(), localVarHeaderParams, new HashMap(), new String[] {"*/*"}, - new String[] {"apiKeyAuth", "appKeyAuth"}); + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); } catch (ApiException ex) { CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally(ex); return result; } return apiClient.invokeAPIAsync( - "DELETE", + "POST", builder, localVarHeaderParams, - new String[] {}, + new String[] {"application/json"}, localVarPostBody, new HashMap(), false, @@ -1646,32 +1744,28 @@ public CompletableFuture> deleteCaseCommentWithHttpInfoAsync( } /** - * Delete custom attribute from case. + * Create a case link. * - *

See {@link #deleteCaseCustomAttributeWithHttpInfo}. + *

See {@link #createCaseLinkWithHttpInfo}. * - * @param caseId Case's UUID or key (required) - * @param customAttributeKey Case Custom attribute's key (required) - * @return CaseResponse + * @param body Case link create request. (required) + * @return CaseLinkResponse * @throws ApiException if fails to make API call */ - public CaseResponse deleteCaseCustomAttribute(String caseId, String customAttributeKey) - throws ApiException { - return deleteCaseCustomAttributeWithHttpInfo(caseId, customAttributeKey).getData(); + public CaseLinkResponse createCaseLink(CaseLinkCreateRequest body) throws ApiException { + return createCaseLinkWithHttpInfo(body).getData(); } /** - * Delete custom attribute from case. + * Create a case link. * - *

See {@link #deleteCaseCustomAttributeWithHttpInfoAsync}. + *

See {@link #createCaseLinkWithHttpInfoAsync}. * - * @param caseId Case's UUID or key (required) - * @param customAttributeKey Case Custom attribute's key (required) - * @return CompletableFuture<CaseResponse> + * @param body Case link create request. (required) + * @return CompletableFuture<CaseLinkResponse> */ - public CompletableFuture deleteCaseCustomAttributeAsync( - String caseId, String customAttributeKey) { - return deleteCaseCustomAttributeWithHttpInfoAsync(caseId, customAttributeKey) + public CompletableFuture createCaseLinkAsync(CaseLinkCreateRequest body) { + return createCaseLinkWithHttpInfoAsync(body) .thenApply( response -> { return response.getData(); @@ -1679,53 +1773,48 @@ public CompletableFuture deleteCaseCustomAttributeAsync( } /** - * Delete custom attribute from case + * Creates a directional link between two cases (for example, case A blocks case B). The parent + * and child cases and their relationship type must be specified. * - * @param caseId Case's UUID or key (required) - * @param customAttributeKey Case Custom attribute's key (required) - * @return ApiResponse<CaseResponse> + * @param body Case link create request. (required) + * @return ApiResponse<CaseLinkResponse> * @throws ApiException if fails to make API call * @http.response.details * * * - * + * + * * * * * *
Response details
Status Code Description Response Headers
200 OK -
201 Created -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
404 Not Found -
429 Too many requests -
*/ - public ApiResponse deleteCaseCustomAttributeWithHttpInfo( - String caseId, String customAttributeKey) throws ApiException { - Object localVarPostBody = null; - - // verify the required parameter 'caseId' is set - if (caseId == null) { - throw new ApiException( - 400, "Missing the required parameter 'caseId' when calling deleteCaseCustomAttribute"); + public ApiResponse createCaseLinkWithHttpInfo(CaseLinkCreateRequest body) + throws ApiException { + // Check if unstable operation is enabled + String operationId = "createCaseLink"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); } + Object localVarPostBody = body; - // verify the required parameter 'customAttributeKey' is set - if (customAttributeKey == null) { + // verify the required parameter 'body' is set + if (body == null) { throw new ApiException( - 400, - "Missing the required parameter 'customAttributeKey' when calling" - + " deleteCaseCustomAttribute"); + 400, "Missing the required parameter 'body' when calling createCaseLink"); } // create path and map variables - String localVarPath = - "/api/v2/cases/{case_id}/custom_attributes/{custom_attribute_key}" - .replaceAll("\\{" + "case_id" + "\\}", apiClient.escapeString(caseId.toString())) - .replaceAll( - "\\{" + "custom_attribute_key" + "\\}", - apiClient.escapeString(customAttributeKey.toString())); + String localVarPath = "/api/v2/cases/link"; Map localVarHeaderParams = new HashMap(); Invocation.Builder builder = apiClient.createBuilder( - "v2.CaseManagementApi.deleteCaseCustomAttribute", + "v2.CaseManagementApi.createCaseLink", localVarPath, new ArrayList(), localVarHeaderParams, @@ -1733,56 +1822,48 @@ public ApiResponse deleteCaseCustomAttributeWithHttpInfo( new String[] {"application/json"}, new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); return apiClient.invokeAPI( - "DELETE", + "POST", builder, localVarHeaderParams, - new String[] {}, + new String[] {"application/json"}, localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * Delete custom attribute from case. + * Create a case link. * - *

See {@link #deleteCaseCustomAttributeWithHttpInfo}. + *

See {@link #createCaseLinkWithHttpInfo}. * - * @param caseId Case's UUID or key (required) - * @param customAttributeKey Case Custom attribute's key (required) - * @return CompletableFuture<ApiResponse<CaseResponse>> + * @param body Case link create request. (required) + * @return CompletableFuture<ApiResponse<CaseLinkResponse>> */ - public CompletableFuture> deleteCaseCustomAttributeWithHttpInfoAsync( - String caseId, String customAttributeKey) { - Object localVarPostBody = null; - - // verify the required parameter 'caseId' is set - if (caseId == null) { - CompletableFuture> result = new CompletableFuture<>(); + public CompletableFuture> createCaseLinkWithHttpInfoAsync( + CaseLinkCreateRequest body) { + // Check if unstable operation is enabled + String operationId = "createCaseLink"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( - new ApiException( - 400, - "Missing the required parameter 'caseId' when calling deleteCaseCustomAttribute")); + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); return result; } + Object localVarPostBody = body; - // verify the required parameter 'customAttributeKey' is set - if (customAttributeKey == null) { - CompletableFuture> result = new CompletableFuture<>(); + // verify the required parameter 'body' is set + if (body == null) { + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( new ApiException( - 400, - "Missing the required parameter 'customAttributeKey' when calling" - + " deleteCaseCustomAttribute")); + 400, "Missing the required parameter 'body' when calling createCaseLink")); return result; } // create path and map variables - String localVarPath = - "/api/v2/cases/{case_id}/custom_attributes/{custom_attribute_key}" - .replaceAll("\\{" + "case_id" + "\\}", apiClient.escapeString(caseId.toString())) - .replaceAll( - "\\{" + "custom_attribute_key" + "\\}", - apiClient.escapeString(customAttributeKey.toString())); + String localVarPath = "/api/v2/cases/link"; Map localVarHeaderParams = new HashMap(); @@ -1790,7 +1871,7 @@ public CompletableFuture> deleteCaseCustomAttributeWit try { builder = apiClient.createBuilder( - "v2.CaseManagementApi.deleteCaseCustomAttribute", + "v2.CaseManagementApi.createCaseLink", localVarPath, new ArrayList(), localVarHeaderParams, @@ -1798,43 +1879,46 @@ public CompletableFuture> deleteCaseCustomAttributeWit new String[] {"application/json"}, new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); } catch (ApiException ex) { - CompletableFuture> result = new CompletableFuture<>(); + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally(ex); return result; } return apiClient.invokeAPIAsync( - "DELETE", + "POST", builder, localVarHeaderParams, - new String[] {}, + new String[] {"application/json"}, localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * Remove a project. + * Create investigation notebook for case. * - *

See {@link #deleteProjectWithHttpInfo}. + *

See {@link #createCaseNotebookWithHttpInfo}. * - * @param projectId Project UUID. (required) + * @param caseId Case's UUID or key (required) + * @param body Notebook creation request (required) * @throws ApiException if fails to make API call */ - public void deleteProject(String projectId) throws ApiException { - deleteProjectWithHttpInfo(projectId); + public void createCaseNotebook(String caseId, NotebookCreateRequest body) throws ApiException { + createCaseNotebookWithHttpInfo(caseId, body); } /** - * Remove a project. + * Create investigation notebook for case. * - *

See {@link #deleteProjectWithHttpInfoAsync}. + *

See {@link #createCaseNotebookWithHttpInfoAsync}. * - * @param projectId Project UUID. (required) + * @param caseId Case's UUID or key (required) + * @param body Notebook creation request (required) * @return CompletableFuture */ - public CompletableFuture deleteProjectAsync(String projectId) { - return deleteProjectWithHttpInfoAsync(projectId) + public CompletableFuture createCaseNotebookAsync( + String caseId, NotebookCreateRequest body) { + return createCaseNotebookWithHttpInfoAsync(caseId, body) .thenApply( response -> { return response.getData(); @@ -1842,9 +1926,10 @@ public CompletableFuture deleteProjectAsync(String projectId) { } /** - * Remove a project using the project's id. + * Create a new investigation notebook and link it to a case * - * @param projectId Project UUID. (required) + * @param caseId Case's UUID or key (required) + * @param body Notebook creation request (required) * @return ApiResponse<Void> * @throws ApiException if fails to make API call * @http.response.details @@ -1852,29 +1937,45 @@ public CompletableFuture deleteProjectAsync(String projectId) { * Response details * Status Code Description Response Headers * 204 No Content - + * 400 Bad Request - + * 401 Unauthorized - * 403 Forbidden - - * 404 API error response - + * 404 Not Found - * 429 Too many requests - * */ - public ApiResponse deleteProjectWithHttpInfo(String projectId) throws ApiException { - Object localVarPostBody = null; + public ApiResponse createCaseNotebookWithHttpInfo(String caseId, NotebookCreateRequest body) + throws ApiException { + // Check if unstable operation is enabled + String operationId = "createCaseNotebook"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = body; - // verify the required parameter 'projectId' is set - if (projectId == null) { + // verify the required parameter 'caseId' is set + if (caseId == null) { throw new ApiException( - 400, "Missing the required parameter 'projectId' when calling deleteProject"); + 400, "Missing the required parameter 'caseId' when calling createCaseNotebook"); + } + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException( + 400, "Missing the required parameter 'body' when calling createCaseNotebook"); } // create path and map variables String localVarPath = - "/api/v2/cases/projects/{project_id}" - .replaceAll("\\{" + "project_id" + "\\}", apiClient.escapeString(projectId.toString())); + "/api/v2/cases/{case_id}/relationships/notebook" + .replaceAll("\\{" + "case_id" + "\\}", apiClient.escapeString(caseId.toString())); Map localVarHeaderParams = new HashMap(); Invocation.Builder builder = apiClient.createBuilder( - "v2.CaseManagementApi.deleteProject", + "v2.CaseManagementApi.createCaseNotebook", localVarPath, new ArrayList(), localVarHeaderParams, @@ -1882,10 +1983,10 @@ public ApiResponse deleteProjectWithHttpInfo(String projectId) throws ApiE new String[] {"*/*"}, new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); return apiClient.invokeAPI( - "DELETE", + "POST", builder, localVarHeaderParams, - new String[] {}, + new String[] {"application/json"}, localVarPostBody, new HashMap(), false, @@ -1893,28 +1994,49 @@ public ApiResponse deleteProjectWithHttpInfo(String projectId) throws ApiE } /** - * Remove a project. + * Create investigation notebook for case. * - *

See {@link #deleteProjectWithHttpInfo}. + *

See {@link #createCaseNotebookWithHttpInfo}. * - * @param projectId Project UUID. (required) + * @param caseId Case's UUID or key (required) + * @param body Notebook creation request (required) * @return CompletableFuture<ApiResponse<Void>> */ - public CompletableFuture> deleteProjectWithHttpInfoAsync(String projectId) { - Object localVarPostBody = null; + public CompletableFuture> createCaseNotebookWithHttpInfoAsync( + String caseId, NotebookCreateRequest body) { + // Check if unstable operation is enabled + String operationId = "createCaseNotebook"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = body; - // verify the required parameter 'projectId' is set - if (projectId == null) { + // verify the required parameter 'caseId' is set + if (caseId == null) { CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( new ApiException( - 400, "Missing the required parameter 'projectId' when calling deleteProject")); + 400, "Missing the required parameter 'caseId' when calling createCaseNotebook")); + return result; + } + + // verify the required parameter 'body' is set + if (body == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'body' when calling createCaseNotebook")); return result; } // create path and map variables String localVarPath = - "/api/v2/cases/projects/{project_id}" - .replaceAll("\\{" + "project_id" + "\\}", apiClient.escapeString(projectId.toString())); + "/api/v2/cases/{case_id}/relationships/notebook" + .replaceAll("\\{" + "case_id" + "\\}", apiClient.escapeString(caseId.toString())); Map localVarHeaderParams = new HashMap(); @@ -1922,7 +2044,7 @@ public CompletableFuture> deleteProjectWithHttpInfoAsync(Strin try { builder = apiClient.createBuilder( - "v2.CaseManagementApi.deleteProject", + "v2.CaseManagementApi.createCaseNotebook", localVarPath, new ArrayList(), localVarHeaderParams, @@ -1935,10 +2057,10 @@ public CompletableFuture> deleteProjectWithHttpInfoAsync(Strin return result; } return apiClient.invokeAPIAsync( - "DELETE", + "POST", builder, localVarHeaderParams, - new String[] {}, + new String[] {"application/json"}, localVarPostBody, new HashMap(), false, @@ -1946,31 +2068,31 @@ public CompletableFuture> deleteProjectWithHttpInfoAsync(Strin } /** - * Delete a notification rule. + * Create ServiceNow ticket for case. * - *

See {@link #deleteProjectNotificationRuleWithHttpInfo}. + *

See {@link #createCaseServiceNowTicketWithHttpInfo}. * - * @param projectId Project UUID (required) - * @param notificationRuleId Notification Rule UUID (required) - * @throws ApiException if fails to make API call + * @param caseId Case's UUID or key (required) + * @param body ServiceNow ticket creation request (required) + * @throws ApiException if fails to make API call */ - public void deleteProjectNotificationRule(String projectId, String notificationRuleId) + public void createCaseServiceNowTicket(String caseId, ServiceNowTicketCreateRequest body) throws ApiException { - deleteProjectNotificationRuleWithHttpInfo(projectId, notificationRuleId); + createCaseServiceNowTicketWithHttpInfo(caseId, body); } /** - * Delete a notification rule. + * Create ServiceNow ticket for case. * - *

See {@link #deleteProjectNotificationRuleWithHttpInfoAsync}. + *

See {@link #createCaseServiceNowTicketWithHttpInfoAsync}. * - * @param projectId Project UUID (required) - * @param notificationRuleId Notification Rule UUID (required) + * @param caseId Case's UUID or key (required) + * @param body ServiceNow ticket creation request (required) * @return CompletableFuture */ - public CompletableFuture deleteProjectNotificationRuleAsync( - String projectId, String notificationRuleId) { - return deleteProjectNotificationRuleWithHttpInfoAsync(projectId, notificationRuleId) + public CompletableFuture createCaseServiceNowTicketAsync( + String caseId, ServiceNowTicketCreateRequest body) { + return createCaseServiceNowTicketWithHttpInfoAsync(caseId, body) .thenApply( response -> { return response.getData(); @@ -1978,53 +2100,56 @@ public CompletableFuture deleteProjectNotificationRuleAsync( } /** - * Delete a notification rule using the notification rule's id. + * Create a new ServiceNow incident ticket and link it to a case * - * @param projectId Project UUID (required) - * @param notificationRuleId Notification Rule UUID (required) + * @param caseId Case's UUID or key (required) + * @param body ServiceNow ticket creation request (required) * @return ApiResponse<Void> * @throws ApiException if fails to make API call * @http.response.details * * * - * + * + * + * * - * + * * *
Response details
Status Code Description Response Headers
204 No Content -
202 Accepted -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
404 API error response -
404 Not Found -
429 Too many requests -
*/ - public ApiResponse deleteProjectNotificationRuleWithHttpInfo( - String projectId, String notificationRuleId) throws ApiException { - Object localVarPostBody = null; + public ApiResponse createCaseServiceNowTicketWithHttpInfo( + String caseId, ServiceNowTicketCreateRequest body) throws ApiException { + // Check if unstable operation is enabled + String operationId = "createCaseServiceNowTicket"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = body; - // verify the required parameter 'projectId' is set - if (projectId == null) { + // verify the required parameter 'caseId' is set + if (caseId == null) { throw new ApiException( - 400, - "Missing the required parameter 'projectId' when calling deleteProjectNotificationRule"); + 400, "Missing the required parameter 'caseId' when calling createCaseServiceNowTicket"); } - // verify the required parameter 'notificationRuleId' is set - if (notificationRuleId == null) { + // verify the required parameter 'body' is set + if (body == null) { throw new ApiException( - 400, - "Missing the required parameter 'notificationRuleId' when calling" - + " deleteProjectNotificationRule"); + 400, "Missing the required parameter 'body' when calling createCaseServiceNowTicket"); } // create path and map variables String localVarPath = - "/api/v2/cases/projects/{project_id}/notification_rules/{notification_rule_id}" - .replaceAll("\\{" + "project_id" + "\\}", apiClient.escapeString(projectId.toString())) - .replaceAll( - "\\{" + "notification_rule_id" + "\\}", - apiClient.escapeString(notificationRuleId.toString())); + "/api/v2/cases/{case_id}/relationships/servicenow_tickets" + .replaceAll("\\{" + "case_id" + "\\}", apiClient.escapeString(caseId.toString())); Map localVarHeaderParams = new HashMap(); Invocation.Builder builder = apiClient.createBuilder( - "v2.CaseManagementApi.deleteProjectNotificationRule", + "v2.CaseManagementApi.createCaseServiceNowTicket", localVarPath, new ArrayList(), localVarHeaderParams, @@ -2032,10 +2157,10 @@ public ApiResponse deleteProjectNotificationRuleWithHttpInfo( new String[] {"*/*"}, new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); return apiClient.invokeAPI( - "DELETE", + "POST", builder, localVarHeaderParams, - new String[] {}, + new String[] {"application/json"}, localVarPostBody, new HashMap(), false, @@ -2043,46 +2168,51 @@ public ApiResponse deleteProjectNotificationRuleWithHttpInfo( } /** - * Delete a notification rule. + * Create ServiceNow ticket for case. * - *

See {@link #deleteProjectNotificationRuleWithHttpInfo}. + *

See {@link #createCaseServiceNowTicketWithHttpInfo}. * - * @param projectId Project UUID (required) - * @param notificationRuleId Notification Rule UUID (required) + * @param caseId Case's UUID or key (required) + * @param body ServiceNow ticket creation request (required) * @return CompletableFuture<ApiResponse<Void>> */ - public CompletableFuture> deleteProjectNotificationRuleWithHttpInfoAsync( - String projectId, String notificationRuleId) { - Object localVarPostBody = null; + public CompletableFuture> createCaseServiceNowTicketWithHttpInfoAsync( + String caseId, ServiceNowTicketCreateRequest body) { + // Check if unstable operation is enabled + String operationId = "createCaseServiceNowTicket"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = body; - // verify the required parameter 'projectId' is set - if (projectId == null) { + // verify the required parameter 'caseId' is set + if (caseId == null) { CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( new ApiException( 400, - "Missing the required parameter 'projectId' when calling" - + " deleteProjectNotificationRule")); + "Missing the required parameter 'caseId' when calling createCaseServiceNowTicket")); return result; } - // verify the required parameter 'notificationRuleId' is set - if (notificationRuleId == null) { + // verify the required parameter 'body' is set + if (body == null) { CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( new ApiException( 400, - "Missing the required parameter 'notificationRuleId' when calling" - + " deleteProjectNotificationRule")); + "Missing the required parameter 'body' when calling createCaseServiceNowTicket")); return result; } // create path and map variables String localVarPath = - "/api/v2/cases/projects/{project_id}/notification_rules/{notification_rule_id}" - .replaceAll("\\{" + "project_id" + "\\}", apiClient.escapeString(projectId.toString())) - .replaceAll( - "\\{" + "notification_rule_id" + "\\}", - apiClient.escapeString(notificationRuleId.toString())); + "/api/v2/cases/{case_id}/relationships/servicenow_tickets" + .replaceAll("\\{" + "case_id" + "\\}", apiClient.escapeString(caseId.toString())); Map localVarHeaderParams = new HashMap(); @@ -2090,7 +2220,7 @@ public CompletableFuture> deleteProjectNotificationRuleWithHtt try { builder = apiClient.createBuilder( - "v2.CaseManagementApi.deleteProjectNotificationRule", + "v2.CaseManagementApi.createCaseServiceNowTicket", localVarPath, new ArrayList(), localVarHeaderParams, @@ -2103,10 +2233,10 @@ public CompletableFuture> deleteProjectNotificationRuleWithHtt return result; } return apiClient.invokeAPIAsync( - "DELETE", + "POST", builder, localVarHeaderParams, - new String[] {}, + new String[] {"application/json"}, localVarPostBody, new HashMap(), false, @@ -2114,28 +2244,28 @@ public CompletableFuture> deleteProjectNotificationRuleWithHtt } /** - * Get the details of a case. + * Create a case view. * - *

See {@link #getCaseWithHttpInfo}. + *

See {@link #createCaseViewWithHttpInfo}. * - * @param caseId Case's UUID or key (required) - * @return CaseResponse + * @param body Case view payload. (required) + * @return CaseViewResponse * @throws ApiException if fails to make API call */ - public CaseResponse getCase(String caseId) throws ApiException { - return getCaseWithHttpInfo(caseId).getData(); + public CaseViewResponse createCaseView(CaseViewCreateRequest body) throws ApiException { + return createCaseViewWithHttpInfo(body).getData(); } /** - * Get the details of a case. + * Create a case view. * - *

See {@link #getCaseWithHttpInfoAsync}. + *

See {@link #createCaseViewWithHttpInfoAsync}. * - * @param caseId Case's UUID or key (required) - * @return CompletableFuture<CaseResponse> + * @param body Case view payload. (required) + * @return CompletableFuture<CaseViewResponse> */ - public CompletableFuture getCaseAsync(String caseId) { - return getCaseWithHttpInfoAsync(caseId) + public CompletableFuture createCaseViewAsync(CaseViewCreateRequest body) { + return createCaseViewWithHttpInfoAsync(body) .thenApply( response -> { return response.getData(); @@ -2143,16 +2273,17 @@ public CompletableFuture getCaseAsync(String caseId) { } /** - * Get the details of case by case_id + * Creates a new saved case view with a name, filter query, and associated project. Optionally, a + * notification rule can be linked to the view. * - * @param caseId Case's UUID or key (required) - * @return ApiResponse<CaseResponse> + * @param body Case view payload. (required) + * @return ApiResponse<CaseViewResponse> * @throws ApiException if fails to make API call * @http.response.details * * * - * + * * * * @@ -2160,23 +2291,30 @@ public CompletableFuture getCaseAsync(String caseId) { * *
Response details
Status Code Description Response Headers
200 OK -
201 Created -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
429 Too many requests -
*/ - public ApiResponse getCaseWithHttpInfo(String caseId) throws ApiException { - Object localVarPostBody = null; + public ApiResponse createCaseViewWithHttpInfo(CaseViewCreateRequest body) + throws ApiException { + // Check if unstable operation is enabled + String operationId = "createCaseView"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = body; - // verify the required parameter 'caseId' is set - if (caseId == null) { - throw new ApiException(400, "Missing the required parameter 'caseId' when calling getCase"); + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException( + 400, "Missing the required parameter 'body' when calling createCaseView"); } // create path and map variables - String localVarPath = - "/api/v2/cases/{case_id}" - .replaceAll("\\{" + "case_id" + "\\}", apiClient.escapeString(caseId.toString())); + String localVarPath = "/api/v2/cases/views"; Map localVarHeaderParams = new HashMap(); Invocation.Builder builder = apiClient.createBuilder( - "v2.CaseManagementApi.getCase", + "v2.CaseManagementApi.createCaseView", localVarPath, new ArrayList(), localVarHeaderParams, @@ -2184,38 +2322,48 @@ public ApiResponse getCaseWithHttpInfo(String caseId) throws ApiEx new String[] {"application/json"}, new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); return apiClient.invokeAPI( - "GET", + "POST", builder, localVarHeaderParams, - new String[] {}, + new String[] {"application/json"}, localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * Get the details of a case. + * Create a case view. * - *

See {@link #getCaseWithHttpInfo}. + *

See {@link #createCaseViewWithHttpInfo}. * - * @param caseId Case's UUID or key (required) - * @return CompletableFuture<ApiResponse<CaseResponse>> + * @param body Case view payload. (required) + * @return CompletableFuture<ApiResponse<CaseViewResponse>> */ - public CompletableFuture> getCaseWithHttpInfoAsync(String caseId) { - Object localVarPostBody = null; + public CompletableFuture> createCaseViewWithHttpInfoAsync( + CaseViewCreateRequest body) { + // Check if unstable operation is enabled + String operationId = "createCaseView"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = body; - // verify the required parameter 'caseId' is set - if (caseId == null) { - CompletableFuture> result = new CompletableFuture<>(); + // verify the required parameter 'body' is set + if (body == null) { + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( - new ApiException(400, "Missing the required parameter 'caseId' when calling getCase")); + new ApiException( + 400, "Missing the required parameter 'body' when calling createCaseView")); return result; } // create path and map variables - String localVarPath = - "/api/v2/cases/{case_id}" - .replaceAll("\\{" + "case_id" + "\\}", apiClient.escapeString(caseId.toString())); + String localVarPath = "/api/v2/cases/views"; Map localVarHeaderParams = new HashMap(); @@ -2223,7 +2371,7 @@ public CompletableFuture> getCaseWithHttpInfoAsync(Str try { builder = apiClient.createBuilder( - "v2.CaseManagementApi.getCase", + "v2.CaseManagementApi.createCaseView", localVarPath, new ArrayList(), localVarHeaderParams, @@ -2231,44 +2379,46 @@ public CompletableFuture> getCaseWithHttpInfoAsync(Str new String[] {"application/json"}, new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); } catch (ApiException ex) { - CompletableFuture> result = new CompletableFuture<>(); + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally(ex); return result; } return apiClient.invokeAPIAsync( - "GET", + "POST", builder, localVarHeaderParams, - new String[] {}, + new String[] {"application/json"}, localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * Get the details of a project. + * Create a maintenance window. * - *

See {@link #getProjectWithHttpInfo}. + *

See {@link #createMaintenanceWindowWithHttpInfo}. * - * @param projectId Project UUID. (required) - * @return ProjectResponse + * @param body Maintenance window payload. (required) + * @return MaintenanceWindowResponse * @throws ApiException if fails to make API call */ - public ProjectResponse getProject(String projectId) throws ApiException { - return getProjectWithHttpInfo(projectId).getData(); + public MaintenanceWindowResponse createMaintenanceWindow(MaintenanceWindowCreateRequest body) + throws ApiException { + return createMaintenanceWindowWithHttpInfo(body).getData(); } /** - * Get the details of a project. + * Create a maintenance window. * - *

See {@link #getProjectWithHttpInfoAsync}. + *

See {@link #createMaintenanceWindowWithHttpInfoAsync}. * - * @param projectId Project UUID. (required) - * @return CompletableFuture<ProjectResponse> + * @param body Maintenance window payload. (required) + * @return CompletableFuture<MaintenanceWindowResponse> */ - public CompletableFuture getProjectAsync(String projectId) { - return getProjectWithHttpInfoAsync(projectId) + public CompletableFuture createMaintenanceWindowAsync( + MaintenanceWindowCreateRequest body) { + return createMaintenanceWindowWithHttpInfoAsync(body) .thenApply( response -> { return response.getData(); @@ -2276,16 +2426,17 @@ public CompletableFuture getProjectAsync(String projectId) { } /** - * Get the details of a project by project_id. + * Creates a maintenance window for event management cases with a name, case filter query, and + * time range (start and end). * - * @param projectId Project UUID. (required) - * @return ApiResponse<ProjectResponse> + * @param body Maintenance window payload. (required) + * @return ApiResponse<MaintenanceWindowResponse> * @throws ApiException if fails to make API call * @http.response.details * * * - * + * * * * @@ -2293,24 +2444,30 @@ public CompletableFuture getProjectAsync(String projectId) { * *
Response details
Status Code Description Response Headers
200 OK -
201 Created -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
429 Too many requests -
*/ - public ApiResponse getProjectWithHttpInfo(String projectId) throws ApiException { - Object localVarPostBody = null; + public ApiResponse createMaintenanceWindowWithHttpInfo( + MaintenanceWindowCreateRequest body) throws ApiException { + // Check if unstable operation is enabled + String operationId = "createMaintenanceWindow"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = body; - // verify the required parameter 'projectId' is set - if (projectId == null) { + // verify the required parameter 'body' is set + if (body == null) { throw new ApiException( - 400, "Missing the required parameter 'projectId' when calling getProject"); + 400, "Missing the required parameter 'body' when calling createMaintenanceWindow"); } // create path and map variables - String localVarPath = - "/api/v2/cases/projects/{project_id}" - .replaceAll("\\{" + "project_id" + "\\}", apiClient.escapeString(projectId.toString())); + String localVarPath = "/api/v2/maintenance_windows"; Map localVarHeaderParams = new HashMap(); Invocation.Builder builder = apiClient.createBuilder( - "v2.CaseManagementApi.getProject", + "v2.CaseManagementApi.createMaintenanceWindow", localVarPath, new ArrayList(), localVarHeaderParams, @@ -2318,40 +2475,48 @@ public ApiResponse getProjectWithHttpInfo(String projectId) thr new String[] {"application/json"}, new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); return apiClient.invokeAPI( - "GET", + "POST", builder, localVarHeaderParams, - new String[] {}, + new String[] {"application/json"}, localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * Get the details of a project. + * Create a maintenance window. * - *

See {@link #getProjectWithHttpInfo}. + *

See {@link #createMaintenanceWindowWithHttpInfo}. * - * @param projectId Project UUID. (required) - * @return CompletableFuture<ApiResponse<ProjectResponse>> + * @param body Maintenance window payload. (required) + * @return CompletableFuture<ApiResponse<MaintenanceWindowResponse>> */ - public CompletableFuture> getProjectWithHttpInfoAsync( - String projectId) { - Object localVarPostBody = null; - - // verify the required parameter 'projectId' is set - if (projectId == null) { - CompletableFuture> result = new CompletableFuture<>(); + public CompletableFuture> + createMaintenanceWindowWithHttpInfoAsync(MaintenanceWindowCreateRequest body) { + // Check if unstable operation is enabled + String operationId = "createMaintenanceWindow"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( - new ApiException( - 400, "Missing the required parameter 'projectId' when calling getProject")); + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = body; + + // verify the required parameter 'body' is set + if (body == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'body' when calling createMaintenanceWindow")); return result; } // create path and map variables - String localVarPath = - "/api/v2/cases/projects/{project_id}" - .replaceAll("\\{" + "project_id" + "\\}", apiClient.escapeString(projectId.toString())); + String localVarPath = "/api/v2/maintenance_windows"; Map localVarHeaderParams = new HashMap(); @@ -2359,7 +2524,7 @@ public CompletableFuture> getProjectWithHttpInfoAsy try { builder = apiClient.createBuilder( - "v2.CaseManagementApi.getProject", + "v2.CaseManagementApi.createMaintenanceWindow", localVarPath, new ArrayList(), localVarHeaderParams, @@ -2367,46 +2532,44 @@ public CompletableFuture> getProjectWithHttpInfoAsy new String[] {"application/json"}, new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); } catch (ApiException ex) { - CompletableFuture> result = new CompletableFuture<>(); + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally(ex); return result; } return apiClient.invokeAPIAsync( - "GET", + "POST", builder, localVarHeaderParams, - new String[] {}, + new String[] {"application/json"}, localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * Get notification rules. + * Create a project. * - *

See {@link #getProjectNotificationRulesWithHttpInfo}. + *

See {@link #createProjectWithHttpInfo}. * - * @param projectId Project UUID (required) - * @return CaseNotificationRulesResponse + * @param body Project payload. (required) + * @return ProjectResponse * @throws ApiException if fails to make API call */ - public CaseNotificationRulesResponse getProjectNotificationRules(String projectId) - throws ApiException { - return getProjectNotificationRulesWithHttpInfo(projectId).getData(); + public ProjectResponse createProject(ProjectCreateRequest body) throws ApiException { + return createProjectWithHttpInfo(body).getData(); } /** - * Get notification rules. + * Create a project. * - *

See {@link #getProjectNotificationRulesWithHttpInfoAsync}. + *

See {@link #createProjectWithHttpInfoAsync}. * - * @param projectId Project UUID (required) - * @return CompletableFuture<CaseNotificationRulesResponse> + * @param body Project payload. (required) + * @return CompletableFuture<ProjectResponse> */ - public CompletableFuture getProjectNotificationRulesAsync( - String projectId) { - return getProjectNotificationRulesWithHttpInfoAsync(projectId) + public CompletableFuture createProjectAsync(ProjectCreateRequest body) { + return createProjectWithHttpInfoAsync(body) .thenApply( response -> { return response.getData(); @@ -2414,16 +2577,16 @@ public CompletableFuture getProjectNotificationRu } /** - * Get all notification rules for a project. + * Create a project. * - * @param projectId Project UUID (required) - * @return ApiResponse<CaseNotificationRulesResponse> + * @param body Project payload. (required) + * @return ApiResponse<ProjectResponse> * @throws ApiException if fails to make API call * @http.response.details * * * - * + * * * * @@ -2431,26 +2594,23 @@ public CompletableFuture getProjectNotificationRu * *
Response details
Status Code Description Response Headers
200 OK -
201 CREATED -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
429 Too many requests -
*/ - public ApiResponse getProjectNotificationRulesWithHttpInfo( - String projectId) throws ApiException { - Object localVarPostBody = null; + public ApiResponse createProjectWithHttpInfo(ProjectCreateRequest body) + throws ApiException { + Object localVarPostBody = body; - // verify the required parameter 'projectId' is set - if (projectId == null) { + // verify the required parameter 'body' is set + if (body == null) { throw new ApiException( - 400, - "Missing the required parameter 'projectId' when calling getProjectNotificationRules"); + 400, "Missing the required parameter 'body' when calling createProject"); } // create path and map variables - String localVarPath = - "/api/v2/cases/projects/{project_id}/notification_rules" - .replaceAll("\\{" + "project_id" + "\\}", apiClient.escapeString(projectId.toString())); + String localVarPath = "/api/v2/cases/projects"; Map localVarHeaderParams = new HashMap(); Invocation.Builder builder = apiClient.createBuilder( - "v2.CaseManagementApi.getProjectNotificationRules", + "v2.CaseManagementApi.createProject", localVarPath, new ArrayList(), localVarHeaderParams, @@ -2458,43 +2618,38 @@ public ApiResponse getProjectNotificationRulesWit new String[] {"application/json"}, new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); return apiClient.invokeAPI( - "GET", + "POST", builder, localVarHeaderParams, - new String[] {}, + new String[] {"application/json"}, localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * Get notification rules. + * Create a project. * - *

See {@link #getProjectNotificationRulesWithHttpInfo}. + *

See {@link #createProjectWithHttpInfo}. * - * @param projectId Project UUID (required) - * @return CompletableFuture<ApiResponse<CaseNotificationRulesResponse>> + * @param body Project payload. (required) + * @return CompletableFuture<ApiResponse<ProjectResponse>> */ - public CompletableFuture> - getProjectNotificationRulesWithHttpInfoAsync(String projectId) { - Object localVarPostBody = null; + public CompletableFuture> createProjectWithHttpInfoAsync( + ProjectCreateRequest body) { + Object localVarPostBody = body; - // verify the required parameter 'projectId' is set - if (projectId == null) { - CompletableFuture> result = - new CompletableFuture<>(); + // verify the required parameter 'body' is set + if (body == null) { + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( new ApiException( - 400, - "Missing the required parameter 'projectId' when calling" - + " getProjectNotificationRules")); + 400, "Missing the required parameter 'body' when calling createProject")); return result; } // create path and map variables - String localVarPath = - "/api/v2/cases/projects/{project_id}/notification_rules" - .replaceAll("\\{" + "project_id" + "\\}", apiClient.escapeString(projectId.toString())); + String localVarPath = "/api/v2/cases/projects"; Map localVarHeaderParams = new HashMap(); @@ -2502,7 +2657,7 @@ public ApiResponse getProjectNotificationRulesWit try { builder = apiClient.createBuilder( - "v2.CaseManagementApi.getProjectNotificationRules", + "v2.CaseManagementApi.createProject", localVarPath, new ArrayList(), localVarHeaderParams, @@ -2510,43 +2665,48 @@ public ApiResponse getProjectNotificationRulesWit new String[] {"application/json"}, new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); } catch (ApiException ex) { - CompletableFuture> result = - new CompletableFuture<>(); + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally(ex); return result; } return apiClient.invokeAPIAsync( - "GET", + "POST", builder, localVarHeaderParams, - new String[] {}, + new String[] {"application/json"}, localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * Get all projects. + * Create a notification rule. * - *

See {@link #getProjectsWithHttpInfo}. + *

See {@link #createProjectNotificationRuleWithHttpInfo}. * - * @return ProjectsResponse + * @param projectId Project UUID (required) + * @param body Notification rule payload (required) + * @return CaseNotificationRuleResponse * @throws ApiException if fails to make API call */ - public ProjectsResponse getProjects() throws ApiException { - return getProjectsWithHttpInfo().getData(); + public CaseNotificationRuleResponse createProjectNotificationRule( + String projectId, CaseNotificationRuleCreateRequest body) throws ApiException { + return createProjectNotificationRuleWithHttpInfo(projectId, body).getData(); } /** - * Get all projects. + * Create a notification rule. * - *

See {@link #getProjectsWithHttpInfoAsync}. + *

See {@link #createProjectNotificationRuleWithHttpInfoAsync}. * - * @return CompletableFuture<ProjectsResponse> + * @param projectId Project UUID (required) + * @param body Notification rule payload (required) + * @return CompletableFuture<CaseNotificationRuleResponse> */ - public CompletableFuture getProjectsAsync() { - return getProjectsWithHttpInfoAsync() + public CompletableFuture createProjectNotificationRuleAsync( + String projectId, CaseNotificationRuleCreateRequest body) { + return createProjectNotificationRuleWithHttpInfoAsync(projectId, body) .thenApply( response -> { return response.getData(); @@ -2554,15 +2714,17 @@ public CompletableFuture getProjectsAsync() { } /** - * Get all projects. + * Create a notification rule for a project. * - * @return ApiResponse<ProjectsResponse> + * @param projectId Project UUID (required) + * @param body Notification rule payload (required) + * @return ApiResponse<CaseNotificationRuleResponse> * @throws ApiException if fails to make API call * @http.response.details * * * - * + * * * * @@ -2570,16 +2732,32 @@ public CompletableFuture getProjectsAsync() { * *
Response details
Status Code Description Response Headers
200 OK -
201 CREATED -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
429 Too many requests -
*/ - public ApiResponse getProjectsWithHttpInfo() throws ApiException { - Object localVarPostBody = null; + public ApiResponse createProjectNotificationRuleWithHttpInfo( + String projectId, CaseNotificationRuleCreateRequest body) throws ApiException { + Object localVarPostBody = body; + + // verify the required parameter 'projectId' is set + if (projectId == null) { + throw new ApiException( + 400, + "Missing the required parameter 'projectId' when calling createProjectNotificationRule"); + } + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException( + 400, "Missing the required parameter 'body' when calling createProjectNotificationRule"); + } // create path and map variables - String localVarPath = "/api/v2/cases/projects"; + String localVarPath = + "/api/v2/cases/projects/{project_id}/notification_rules" + .replaceAll("\\{" + "project_id" + "\\}", apiClient.escapeString(projectId.toString())); Map localVarHeaderParams = new HashMap(); Invocation.Builder builder = apiClient.createBuilder( - "v2.CaseManagementApi.getProjects", + "v2.CaseManagementApi.createProjectNotificationRule", localVarPath, new ArrayList(), localVarHeaderParams, @@ -2587,27 +2765,56 @@ public ApiResponse getProjectsWithHttpInfo() throws ApiExcepti new String[] {"application/json"}, new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); return apiClient.invokeAPI( - "GET", + "POST", builder, localVarHeaderParams, - new String[] {}, + new String[] {"application/json"}, localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * Get all projects. + * Create a notification rule. * - *

See {@link #getProjectsWithHttpInfo}. + *

See {@link #createProjectNotificationRuleWithHttpInfo}. * - * @return CompletableFuture<ApiResponse<ProjectsResponse>> + * @param projectId Project UUID (required) + * @param body Notification rule payload (required) + * @return CompletableFuture<ApiResponse<CaseNotificationRuleResponse>> */ - public CompletableFuture> getProjectsWithHttpInfoAsync() { - Object localVarPostBody = null; + public CompletableFuture> + createProjectNotificationRuleWithHttpInfoAsync( + String projectId, CaseNotificationRuleCreateRequest body) { + Object localVarPostBody = body; + + // verify the required parameter 'projectId' is set + if (projectId == null) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'projectId' when calling" + + " createProjectNotificationRule")); + return result; + } + + // verify the required parameter 'body' is set + if (body == null) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'body' when calling createProjectNotificationRule")); + return result; + } // create path and map variables - String localVarPath = "/api/v2/cases/projects"; + String localVarPath = + "/api/v2/cases/projects/{project_id}/notification_rules" + .replaceAll("\\{" + "project_id" + "\\}", apiClient.escapeString(projectId.toString())); Map localVarHeaderParams = new HashMap(); @@ -2615,7 +2822,7 @@ public CompletableFuture> getProjectsWithHttpInfoA try { builder = apiClient.createBuilder( - "v2.CaseManagementApi.getProjects", + "v2.CaseManagementApi.createProjectNotificationRule", localVarPath, new ArrayList(), localVarHeaderParams, @@ -2623,48 +2830,46 @@ public CompletableFuture> getProjectsWithHttpInfoA new String[] {"application/json"}, new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); } catch (ApiException ex) { - CompletableFuture> result = new CompletableFuture<>(); + CompletableFuture> result = + new CompletableFuture<>(); result.completeExceptionally(ex); return result; } return apiClient.invokeAPIAsync( - "GET", + "POST", builder, localVarHeaderParams, - new String[] {}, + new String[] {"application/json"}, localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * Link incident to case. + * Delete an automation rule. * - *

See {@link #linkIncidentWithHttpInfo}. + *

See {@link #deleteCaseAutomationRuleWithHttpInfo}. * - * @param caseId Case's UUID or key (required) - * @param body Incident link request (required) - * @return CaseResponse + * @param projectId The UUID of the project that owns the automation rules. (required) + * @param ruleId The UUID of the automation rule. (required) * @throws ApiException if fails to make API call */ - public CaseResponse linkIncident(String caseId, RelationshipToIncidentRequest body) - throws ApiException { - return linkIncidentWithHttpInfo(caseId, body).getData(); + public void deleteCaseAutomationRule(String projectId, String ruleId) throws ApiException { + deleteCaseAutomationRuleWithHttpInfo(projectId, ruleId); } /** - * Link incident to case. + * Delete an automation rule. * - *

See {@link #linkIncidentWithHttpInfoAsync}. + *

See {@link #deleteCaseAutomationRuleWithHttpInfoAsync}. * - * @param caseId Case's UUID or key (required) - * @param body Incident link request (required) - * @return CompletableFuture<CaseResponse> + * @param projectId The UUID of the project that owns the automation rules. (required) + * @param ruleId The UUID of the automation rule. (required) + * @return CompletableFuture */ - public CompletableFuture linkIncidentAsync( - String caseId, RelationshipToIncidentRequest body) { - return linkIncidentWithHttpInfoAsync(caseId, body) + public CompletableFuture deleteCaseAutomationRuleAsync(String projectId, String ruleId) { + return deleteCaseAutomationRuleWithHttpInfoAsync(projectId, ruleId) .thenApply( response -> { return response.getData(); @@ -2672,116 +2877,119 @@ public CompletableFuture linkIncidentAsync( } /** - * Link an incident to a case + * Permanently deletes an automation rule from a project. * - * @param caseId Case's UUID or key (required) - * @param body Incident link request (required) - * @return ApiResponse<CaseResponse> + * @param projectId The UUID of the project that owns the automation rules. (required) + * @param ruleId The UUID of the automation rule. (required) + * @return ApiResponse<Void> * @throws ApiException if fails to make API call * @http.response.details * * * - * - * - * + * * * * *
Response details
Status Code Description Response Headers
201 Created -
400 Bad Request -
401 Unauthorized -
204 No Content -
403 Forbidden -
404 Not Found -
429 Too many requests -
*/ - public ApiResponse linkIncidentWithHttpInfo( - String caseId, RelationshipToIncidentRequest body) throws ApiException { + public ApiResponse deleteCaseAutomationRuleWithHttpInfo(String projectId, String ruleId) + throws ApiException { // Check if unstable operation is enabled - String operationId = "linkIncident"; + String operationId = "deleteCaseAutomationRule"; if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); } else { throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); } - Object localVarPostBody = body; + Object localVarPostBody = null; - // verify the required parameter 'caseId' is set - if (caseId == null) { + // verify the required parameter 'projectId' is set + if (projectId == null) { throw new ApiException( - 400, "Missing the required parameter 'caseId' when calling linkIncident"); + 400, "Missing the required parameter 'projectId' when calling deleteCaseAutomationRule"); } - // verify the required parameter 'body' is set - if (body == null) { + // verify the required parameter 'ruleId' is set + if (ruleId == null) { throw new ApiException( - 400, "Missing the required parameter 'body' when calling linkIncident"); + 400, "Missing the required parameter 'ruleId' when calling deleteCaseAutomationRule"); } // create path and map variables String localVarPath = - "/api/v2/cases/{case_id}/relationships/incidents" - .replaceAll("\\{" + "case_id" + "\\}", apiClient.escapeString(caseId.toString())); + "/api/v2/cases/projects/{project_id}/rules/{rule_id}" + .replaceAll("\\{" + "project_id" + "\\}", apiClient.escapeString(projectId.toString())) + .replaceAll("\\{" + "rule_id" + "\\}", apiClient.escapeString(ruleId.toString())); Map localVarHeaderParams = new HashMap(); Invocation.Builder builder = apiClient.createBuilder( - "v2.CaseManagementApi.linkIncident", + "v2.CaseManagementApi.deleteCaseAutomationRule", localVarPath, new ArrayList(), localVarHeaderParams, new HashMap(), - new String[] {"application/json"}, + new String[] {"*/*"}, new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); return apiClient.invokeAPI( - "POST", + "DELETE", builder, localVarHeaderParams, - new String[] {"application/json"}, + new String[] {}, localVarPostBody, new HashMap(), false, - new GenericType() {}); + null); } /** - * Link incident to case. + * Delete an automation rule. * - *

See {@link #linkIncidentWithHttpInfo}. + *

See {@link #deleteCaseAutomationRuleWithHttpInfo}. * - * @param caseId Case's UUID or key (required) - * @param body Incident link request (required) - * @return CompletableFuture<ApiResponse<CaseResponse>> + * @param projectId The UUID of the project that owns the automation rules. (required) + * @param ruleId The UUID of the automation rule. (required) + * @return CompletableFuture<ApiResponse<Void>> */ - public CompletableFuture> linkIncidentWithHttpInfoAsync( - String caseId, RelationshipToIncidentRequest body) { + public CompletableFuture> deleteCaseAutomationRuleWithHttpInfoAsync( + String projectId, String ruleId) { // Check if unstable operation is enabled - String operationId = "linkIncident"; + String operationId = "deleteCaseAutomationRule"; if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); } else { - CompletableFuture> result = new CompletableFuture<>(); + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); return result; } - Object localVarPostBody = body; + Object localVarPostBody = null; - // verify the required parameter 'caseId' is set - if (caseId == null) { - CompletableFuture> result = new CompletableFuture<>(); + // verify the required parameter 'projectId' is set + if (projectId == null) { + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( new ApiException( - 400, "Missing the required parameter 'caseId' when calling linkIncident")); + 400, + "Missing the required parameter 'projectId' when calling deleteCaseAutomationRule")); return result; } - // verify the required parameter 'body' is set - if (body == null) { - CompletableFuture> result = new CompletableFuture<>(); + // verify the required parameter 'ruleId' is set + if (ruleId == null) { + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( - new ApiException(400, "Missing the required parameter 'body' when calling linkIncident")); + new ApiException( + 400, + "Missing the required parameter 'ruleId' when calling deleteCaseAutomationRule")); return result; } // create path and map variables String localVarPath = - "/api/v2/cases/{case_id}/relationships/incidents" - .replaceAll("\\{" + "case_id" + "\\}", apiClient.escapeString(caseId.toString())); + "/api/v2/cases/projects/{project_id}/rules/{rule_id}" + .replaceAll("\\{" + "project_id" + "\\}", apiClient.escapeString(projectId.toString())) + .replaceAll("\\{" + "rule_id" + "\\}", apiClient.escapeString(ruleId.toString())); Map localVarHeaderParams = new HashMap(); @@ -2789,54 +2997,53 @@ public CompletableFuture> linkIncidentWithHttpInfoAsyn try { builder = apiClient.createBuilder( - "v2.CaseManagementApi.linkIncident", + "v2.CaseManagementApi.deleteCaseAutomationRule", localVarPath, new ArrayList(), localVarHeaderParams, new HashMap(), - new String[] {"application/json"}, + new String[] {"*/*"}, new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); } catch (ApiException ex) { - CompletableFuture> result = new CompletableFuture<>(); + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally(ex); return result; } return apiClient.invokeAPIAsync( - "POST", + "DELETE", builder, localVarHeaderParams, - new String[] {"application/json"}, + new String[] {}, localVarPostBody, new HashMap(), false, - new GenericType() {}); + null); } /** - * Link existing Jira issue to case. + * Delete case comment. * - *

See {@link #linkJiraIssueToCaseWithHttpInfo}. + *

See {@link #deleteCaseCommentWithHttpInfo}. * * @param caseId Case's UUID or key (required) - * @param body Jira issue link request (required) + * @param cellId The UUID of the timeline cell (comment) to update. (required) * @throws ApiException if fails to make API call */ - public void linkJiraIssueToCase(String caseId, JiraIssueLinkRequest body) throws ApiException { - linkJiraIssueToCaseWithHttpInfo(caseId, body); + public void deleteCaseComment(String caseId, String cellId) throws ApiException { + deleteCaseCommentWithHttpInfo(caseId, cellId); } /** - * Link existing Jira issue to case. + * Delete case comment. * - *

See {@link #linkJiraIssueToCaseWithHttpInfoAsync}. + *

See {@link #deleteCaseCommentWithHttpInfoAsync}. * * @param caseId Case's UUID or key (required) - * @param body Jira issue link request (required) + * @param cellId The UUID of the timeline cell (comment) to update. (required) * @return CompletableFuture */ - public CompletableFuture linkJiraIssueToCaseAsync( - String caseId, JiraIssueLinkRequest body) { - return linkJiraIssueToCaseWithHttpInfoAsync(caseId, body) + public CompletableFuture deleteCaseCommentAsync(String caseId, String cellId) { + return deleteCaseCommentWithHttpInfoAsync(caseId, cellId) .thenApply( response -> { return response.getData(); @@ -2844,10 +3051,10 @@ public CompletableFuture linkJiraIssueToCaseAsync( } /** - * Link an existing Jira issue to a case + * Delete case comment * * @param caseId Case's UUID or key (required) - * @param body Jira issue link request (required) + * @param cellId The UUID of the timeline cell (comment) to update. (required) * @return ApiResponse<Void> * @throws ApiException if fails to make API call * @http.response.details @@ -2859,53 +3066,46 @@ public CompletableFuture linkJiraIssueToCaseAsync( * 401 Unauthorized - * 403 Forbidden - * 404 Not Found - - * 409 Conflict - * 429 Too many requests - * */ - public ApiResponse linkJiraIssueToCaseWithHttpInfo(String caseId, JiraIssueLinkRequest body) + public ApiResponse deleteCaseCommentWithHttpInfo(String caseId, String cellId) throws ApiException { - // Check if unstable operation is enabled - String operationId = "linkJiraIssueToCase"; - if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { - apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); - } else { - throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); - } - Object localVarPostBody = body; + Object localVarPostBody = null; // verify the required parameter 'caseId' is set if (caseId == null) { throw new ApiException( - 400, "Missing the required parameter 'caseId' when calling linkJiraIssueToCase"); + 400, "Missing the required parameter 'caseId' when calling deleteCaseComment"); } - // verify the required parameter 'body' is set - if (body == null) { + // verify the required parameter 'cellId' is set + if (cellId == null) { throw new ApiException( - 400, "Missing the required parameter 'body' when calling linkJiraIssueToCase"); + 400, "Missing the required parameter 'cellId' when calling deleteCaseComment"); } // create path and map variables String localVarPath = - "/api/v2/cases/{case_id}/relationships/jira_issues" - .replaceAll("\\{" + "case_id" + "\\}", apiClient.escapeString(caseId.toString())); + "/api/v2/cases/{case_id}/comment/{cell_id}" + .replaceAll("\\{" + "case_id" + "\\}", apiClient.escapeString(caseId.toString())) + .replaceAll("\\{" + "cell_id" + "\\}", apiClient.escapeString(cellId.toString())); Map localVarHeaderParams = new HashMap(); Invocation.Builder builder = apiClient.createBuilder( - "v2.CaseManagementApi.linkJiraIssueToCase", + "v2.CaseManagementApi.deleteCaseComment", localVarPath, new ArrayList(), localVarHeaderParams, new HashMap(), new String[] {"*/*"}, - new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + new String[] {"apiKeyAuth", "appKeyAuth"}); return apiClient.invokeAPI( - "PATCH", + "DELETE", builder, localVarHeaderParams, - new String[] {"application/json"}, + new String[] {}, localVarPostBody, new HashMap(), false, @@ -2913,49 +3113,40 @@ public ApiResponse linkJiraIssueToCaseWithHttpInfo(String caseId, JiraIssu } /** - * Link existing Jira issue to case. + * Delete case comment. * - *

See {@link #linkJiraIssueToCaseWithHttpInfo}. + *

See {@link #deleteCaseCommentWithHttpInfo}. * * @param caseId Case's UUID or key (required) - * @param body Jira issue link request (required) + * @param cellId The UUID of the timeline cell (comment) to update. (required) * @return CompletableFuture<ApiResponse<Void>> */ - public CompletableFuture> linkJiraIssueToCaseWithHttpInfoAsync( - String caseId, JiraIssueLinkRequest body) { - // Check if unstable operation is enabled - String operationId = "linkJiraIssueToCase"; - if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { - apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); - } else { - CompletableFuture> result = new CompletableFuture<>(); - result.completeExceptionally( - new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); - return result; - } - Object localVarPostBody = body; + public CompletableFuture> deleteCaseCommentWithHttpInfoAsync( + String caseId, String cellId) { + Object localVarPostBody = null; // verify the required parameter 'caseId' is set if (caseId == null) { CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( new ApiException( - 400, "Missing the required parameter 'caseId' when calling linkJiraIssueToCase")); + 400, "Missing the required parameter 'caseId' when calling deleteCaseComment")); return result; } - // verify the required parameter 'body' is set - if (body == null) { + // verify the required parameter 'cellId' is set + if (cellId == null) { CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( new ApiException( - 400, "Missing the required parameter 'body' when calling linkJiraIssueToCase")); + 400, "Missing the required parameter 'cellId' when calling deleteCaseComment")); return result; } // create path and map variables String localVarPath = - "/api/v2/cases/{case_id}/relationships/jira_issues" - .replaceAll("\\{" + "case_id" + "\\}", apiClient.escapeString(caseId.toString())); + "/api/v2/cases/{case_id}/comment/{cell_id}" + .replaceAll("\\{" + "case_id" + "\\}", apiClient.escapeString(caseId.toString())) + .replaceAll("\\{" + "cell_id" + "\\}", apiClient.escapeString(cellId.toString())); Map localVarHeaderParams = new HashMap(); @@ -2963,23 +3154,23 @@ public CompletableFuture> linkJiraIssueToCaseWithHttpInfoAsync try { builder = apiClient.createBuilder( - "v2.CaseManagementApi.linkJiraIssueToCase", + "v2.CaseManagementApi.deleteCaseComment", localVarPath, new ArrayList(), localVarHeaderParams, new HashMap(), new String[] {"*/*"}, - new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + new String[] {"apiKeyAuth", "appKeyAuth"}); } catch (ApiException ex) { CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally(ex); return result; } return apiClient.invokeAPIAsync( - "PATCH", + "DELETE", builder, localVarHeaderParams, - new String[] {"application/json"}, + new String[] {}, localVarPostBody, new HashMap(), false, @@ -2987,32 +3178,32 @@ public CompletableFuture> linkJiraIssueToCaseWithHttpInfoAsync } /** - * Update case project. + * Delete custom attribute from case. * - *

See {@link #moveCaseToProjectWithHttpInfo}. + *

See {@link #deleteCaseCustomAttributeWithHttpInfo}. * * @param caseId Case's UUID or key (required) - * @param body Project update request (required) + * @param customAttributeKey Case Custom attribute's key (required) * @return CaseResponse * @throws ApiException if fails to make API call */ - public CaseResponse moveCaseToProject(String caseId, ProjectRelationship body) + public CaseResponse deleteCaseCustomAttribute(String caseId, String customAttributeKey) throws ApiException { - return moveCaseToProjectWithHttpInfo(caseId, body).getData(); + return deleteCaseCustomAttributeWithHttpInfo(caseId, customAttributeKey).getData(); } /** - * Update case project. + * Delete custom attribute from case. * - *

See {@link #moveCaseToProjectWithHttpInfoAsync}. + *

See {@link #deleteCaseCustomAttributeWithHttpInfoAsync}. * * @param caseId Case's UUID or key (required) - * @param body Project update request (required) + * @param customAttributeKey Case Custom attribute's key (required) * @return CompletableFuture<CaseResponse> */ - public CompletableFuture moveCaseToProjectAsync( - String caseId, ProjectRelationship body) { - return moveCaseToProjectWithHttpInfoAsync(caseId, body) + public CompletableFuture deleteCaseCustomAttributeAsync( + String caseId, String customAttributeKey) { + return deleteCaseCustomAttributeWithHttpInfoAsync(caseId, customAttributeKey) .thenApply( response -> { return response.getData(); @@ -3020,10 +3211,10 @@ public CompletableFuture moveCaseToProjectAsync( } /** - * Update the project associated with a case + * Delete custom attribute from case * * @param caseId Case's UUID or key (required) - * @param body Project update request (required) + * @param customAttributeKey Case Custom attribute's key (required) * @return ApiResponse<CaseResponse> * @throws ApiException if fails to make API call * @http.response.details @@ -3031,45 +3222,42 @@ public CompletableFuture moveCaseToProjectAsync( * Response details * Status Code Description Response Headers * 200 OK - - * 400 Bad Request - * 401 Unauthorized - * 403 Forbidden - * 404 Not Found - * 429 Too many requests - * */ - public ApiResponse moveCaseToProjectWithHttpInfo( - String caseId, ProjectRelationship body) throws ApiException { - // Check if unstable operation is enabled - String operationId = "moveCaseToProject"; - if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { - apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); - } else { - throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); - } - Object localVarPostBody = body; + public ApiResponse deleteCaseCustomAttributeWithHttpInfo( + String caseId, String customAttributeKey) throws ApiException { + Object localVarPostBody = null; // verify the required parameter 'caseId' is set if (caseId == null) { throw new ApiException( - 400, "Missing the required parameter 'caseId' when calling moveCaseToProject"); + 400, "Missing the required parameter 'caseId' when calling deleteCaseCustomAttribute"); } - // verify the required parameter 'body' is set - if (body == null) { + // verify the required parameter 'customAttributeKey' is set + if (customAttributeKey == null) { throw new ApiException( - 400, "Missing the required parameter 'body' when calling moveCaseToProject"); + 400, + "Missing the required parameter 'customAttributeKey' when calling" + + " deleteCaseCustomAttribute"); } // create path and map variables String localVarPath = - "/api/v2/cases/{case_id}/relationships/project" - .replaceAll("\\{" + "case_id" + "\\}", apiClient.escapeString(caseId.toString())); + "/api/v2/cases/{case_id}/custom_attributes/{custom_attribute_key}" + .replaceAll("\\{" + "case_id" + "\\}", apiClient.escapeString(caseId.toString())) + .replaceAll( + "\\{" + "custom_attribute_key" + "\\}", + apiClient.escapeString(customAttributeKey.toString())); Map localVarHeaderParams = new HashMap(); Invocation.Builder builder = apiClient.createBuilder( - "v2.CaseManagementApi.moveCaseToProject", + "v2.CaseManagementApi.deleteCaseCustomAttribute", localVarPath, new ArrayList(), localVarHeaderParams, @@ -3077,10 +3265,10 @@ public ApiResponse moveCaseToProjectWithHttpInfo( new String[] {"application/json"}, new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); return apiClient.invokeAPI( - "PATCH", + "DELETE", builder, localVarHeaderParams, - new String[] {"application/json"}, + new String[] {}, localVarPostBody, new HashMap(), false, @@ -3088,49 +3276,45 @@ public ApiResponse moveCaseToProjectWithHttpInfo( } /** - * Update case project. + * Delete custom attribute from case. * - *

See {@link #moveCaseToProjectWithHttpInfo}. + *

See {@link #deleteCaseCustomAttributeWithHttpInfo}. * * @param caseId Case's UUID or key (required) - * @param body Project update request (required) + * @param customAttributeKey Case Custom attribute's key (required) * @return CompletableFuture<ApiResponse<CaseResponse>> */ - public CompletableFuture> moveCaseToProjectWithHttpInfoAsync( - String caseId, ProjectRelationship body) { - // Check if unstable operation is enabled - String operationId = "moveCaseToProject"; - if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { - apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); - } else { - CompletableFuture> result = new CompletableFuture<>(); - result.completeExceptionally( - new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); - return result; - } - Object localVarPostBody = body; + public CompletableFuture> deleteCaseCustomAttributeWithHttpInfoAsync( + String caseId, String customAttributeKey) { + Object localVarPostBody = null; // verify the required parameter 'caseId' is set if (caseId == null) { CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( new ApiException( - 400, "Missing the required parameter 'caseId' when calling moveCaseToProject")); + 400, + "Missing the required parameter 'caseId' when calling deleteCaseCustomAttribute")); return result; } - // verify the required parameter 'body' is set - if (body == null) { + // verify the required parameter 'customAttributeKey' is set + if (customAttributeKey == null) { CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( new ApiException( - 400, "Missing the required parameter 'body' when calling moveCaseToProject")); + 400, + "Missing the required parameter 'customAttributeKey' when calling" + + " deleteCaseCustomAttribute")); return result; } // create path and map variables String localVarPath = - "/api/v2/cases/{case_id}/relationships/project" - .replaceAll("\\{" + "case_id" + "\\}", apiClient.escapeString(caseId.toString())); + "/api/v2/cases/{case_id}/custom_attributes/{custom_attribute_key}" + .replaceAll("\\{" + "case_id" + "\\}", apiClient.escapeString(caseId.toString())) + .replaceAll( + "\\{" + "custom_attribute_key" + "\\}", + apiClient.escapeString(customAttributeKey.toString())); Map localVarHeaderParams = new HashMap(); @@ -3138,7 +3322,7 @@ public CompletableFuture> moveCaseToProjectWithHttpInf try { builder = apiClient.createBuilder( - "v2.CaseManagementApi.moveCaseToProject", + "v2.CaseManagementApi.deleteCaseCustomAttribute", localVarPath, new ArrayList(), localVarHeaderParams, @@ -3151,102 +3335,38 @@ public CompletableFuture> moveCaseToProjectWithHttpInf return result; } return apiClient.invokeAPIAsync( - "PATCH", + "DELETE", builder, localVarHeaderParams, - new String[] {"application/json"}, + new String[] {}, localVarPostBody, new HashMap(), false, new GenericType() {}); } - /** Manage optional parameters to searchCases. */ - public static class SearchCasesOptionalParameters { - private Long pageSize; - private Long pageNumber; - private CaseSortableField sortField; - private String filter; - private Boolean sortAsc; - - /** - * Set pageSize. - * - * @param pageSize Size for a given page. The maximum allowed value is 100. (optional, default - * to 10) - * @return SearchCasesOptionalParameters - */ - public SearchCasesOptionalParameters pageSize(Long pageSize) { - this.pageSize = pageSize; - return this; - } - - /** - * Set pageNumber. - * - * @param pageNumber Specific page number to return. (optional, default to 0) - * @return SearchCasesOptionalParameters - */ - public SearchCasesOptionalParameters pageNumber(Long pageNumber) { - this.pageNumber = pageNumber; - return this; - } - - /** - * Set sortField. - * - * @param sortField Specify which field to sort (optional) - * @return SearchCasesOptionalParameters - */ - public SearchCasesOptionalParameters sortField(CaseSortableField sortField) { - this.sortField = sortField; - return this; - } - - /** - * Set filter. - * - * @param filter Search query (optional) - * @return SearchCasesOptionalParameters - */ - public SearchCasesOptionalParameters filter(String filter) { - this.filter = filter; - return this; - } - - /** - * Set sortAsc. - * - * @param sortAsc Specify if order is ascending or not (optional, default to false) - * @return SearchCasesOptionalParameters - */ - public SearchCasesOptionalParameters sortAsc(Boolean sortAsc) { - this.sortAsc = sortAsc; - return this; - } - } - /** - * Search cases. + * Delete a case link. * - *

See {@link #searchCasesWithHttpInfo}. + *

See {@link #deleteCaseLinkWithHttpInfo}. * - * @return CasesResponse + * @param linkId The UUID of the case link. (required) * @throws ApiException if fails to make API call */ - public CasesResponse searchCases() throws ApiException { - return searchCasesWithHttpInfo(new SearchCasesOptionalParameters()).getData(); + public void deleteCaseLink(String linkId) throws ApiException { + deleteCaseLinkWithHttpInfo(linkId); } /** - * Search cases. + * Delete a case link. * - *

See {@link #searchCasesWithHttpInfoAsync}. + *

See {@link #deleteCaseLinkWithHttpInfoAsync}. * - * @return CompletableFuture<CasesResponse> + * @param linkId The UUID of the case link. (required) + * @return CompletableFuture */ - public CompletableFuture searchCasesAsync() { - return searchCasesWithHttpInfoAsync(new SearchCasesOptionalParameters()) + public CompletableFuture deleteCaseLinkAsync(String linkId) { + return deleteCaseLinkWithHttpInfoAsync(linkId) .thenApply( response -> { return response.getData(); @@ -3254,95 +3374,5514 @@ public CompletableFuture searchCasesAsync() { } /** - * Search cases. + * Deletes an existing link between cases by link ID. * - *

See {@link #searchCasesWithHttpInfo}. - * - * @param parameters Optional parameters for the request. - * @return CasesResponse + * @param linkId The UUID of the case link. (required) + * @return ApiResponse<Void> * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
204 No Content -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
404 Not Found -
429 Too many requests -
*/ - public CasesResponse searchCases(SearchCasesOptionalParameters parameters) throws ApiException { - return searchCasesWithHttpInfo(parameters).getData(); + public ApiResponse deleteCaseLinkWithHttpInfo(String linkId) throws ApiException { + // Check if unstable operation is enabled + String operationId = "deleteCaseLink"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = null; + + // verify the required parameter 'linkId' is set + if (linkId == null) { + throw new ApiException( + 400, "Missing the required parameter 'linkId' when calling deleteCaseLink"); + } + // create path and map variables + String localVarPath = + "/api/v2/cases/link/{link_id}" + .replaceAll("\\{" + "link_id" + "\\}", apiClient.escapeString(linkId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.CaseManagementApi.deleteCaseLink", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"*/*"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + return apiClient.invokeAPI( + "DELETE", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + null); } /** - * Search cases. + * Delete a case link. * - *

See {@link #searchCasesWithHttpInfoAsync}. + *

See {@link #deleteCaseLinkWithHttpInfo}. * - * @param parameters Optional parameters for the request. - * @return CompletableFuture<CasesResponse> + * @param linkId The UUID of the case link. (required) + * @return CompletableFuture<ApiResponse<Void>> */ - public CompletableFuture searchCasesAsync( - SearchCasesOptionalParameters parameters) { - return searchCasesWithHttpInfoAsync(parameters) - .thenApply( - response -> { - return response.getData(); - }); + public CompletableFuture> deleteCaseLinkWithHttpInfoAsync(String linkId) { + // Check if unstable operation is enabled + String operationId = "deleteCaseLink"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = null; + + // verify the required parameter 'linkId' is set + if (linkId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'linkId' when calling deleteCaseLink")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/cases/link/{link_id}" + .replaceAll("\\{" + "link_id" + "\\}", apiClient.escapeString(linkId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.CaseManagementApi.deleteCaseLink", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"*/*"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "DELETE", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + null); } /** - * Search cases. + * Delete a case view. * - *

See {@link #searchCasesWithHttpInfo}. + *

See {@link #deleteCaseViewWithHttpInfo}. * - * @return PaginationIterable<Case> + * @param viewId The UUID of the case view. (required) + * @throws ApiException if fails to make API call */ - public PaginationIterable searchCasesWithPagination() { - SearchCasesOptionalParameters parameters = new SearchCasesOptionalParameters(); - return searchCasesWithPagination(parameters); + public void deleteCaseView(String viewId) throws ApiException { + deleteCaseViewWithHttpInfo(viewId); } /** - * Search cases. + * Delete a case view. * - *

See {@link #searchCasesWithHttpInfo}. + *

See {@link #deleteCaseViewWithHttpInfoAsync}. * - * @return CasesResponse + * @param viewId The UUID of the case view. (required) + * @return CompletableFuture */ - public PaginationIterable searchCasesWithPagination( - SearchCasesOptionalParameters parameters) { - String resultsPath = "getData"; - String valueGetterPath = ""; - String valueSetterPath = "pageNumber"; - Boolean valueSetterParamOptional = true; - parameters.pageNumber(1l); - Long limit; + public CompletableFuture deleteCaseViewAsync(String viewId) { + return deleteCaseViewWithHttpInfoAsync(viewId) + .thenApply( + response -> { + return response.getData(); + }); + } - if (parameters.pageSize == null) { - limit = 10l; - parameters.pageSize(limit); + /** + * Permanently deletes a saved case view. + * + * @param viewId The UUID of the case view. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
204 No Content -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
404 Not Found -
429 Too many requests -
+ */ + public ApiResponse deleteCaseViewWithHttpInfo(String viewId) throws ApiException { + // Check if unstable operation is enabled + String operationId = "deleteCaseView"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); } else { - limit = parameters.pageSize; + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = null; + + // verify the required parameter 'viewId' is set + if (viewId == null) { + throw new ApiException( + 400, "Missing the required parameter 'viewId' when calling deleteCaseView"); + } + // create path and map variables + String localVarPath = + "/api/v2/cases/views/{view_id}" + .replaceAll("\\{" + "view_id" + "\\}", apiClient.escapeString(viewId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.CaseManagementApi.deleteCaseView", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"*/*"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + return apiClient.invokeAPI( + "DELETE", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + null); + } + + /** + * Delete a case view. + * + *

See {@link #deleteCaseViewWithHttpInfo}. + * + * @param viewId The UUID of the case view. (required) + * @return CompletableFuture<ApiResponse<Void>> + */ + public CompletableFuture> deleteCaseViewWithHttpInfoAsync(String viewId) { + // Check if unstable operation is enabled + String operationId = "deleteCaseView"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = null; + + // verify the required parameter 'viewId' is set + if (viewId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'viewId' when calling deleteCaseView")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/cases/views/{view_id}" + .replaceAll("\\{" + "view_id" + "\\}", apiClient.escapeString(viewId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.CaseManagementApi.deleteCaseView", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"*/*"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "DELETE", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + null); + } + + /** + * Delete a maintenance window. + * + *

See {@link #deleteMaintenanceWindowWithHttpInfo}. + * + * @param maintenanceWindowId The UUID of the maintenance window. (required) + * @throws ApiException if fails to make API call + */ + public void deleteMaintenanceWindow(String maintenanceWindowId) throws ApiException { + deleteMaintenanceWindowWithHttpInfo(maintenanceWindowId); + } + + /** + * Delete a maintenance window. + * + *

See {@link #deleteMaintenanceWindowWithHttpInfoAsync}. + * + * @param maintenanceWindowId The UUID of the maintenance window. (required) + * @return CompletableFuture + */ + public CompletableFuture deleteMaintenanceWindowAsync(String maintenanceWindowId) { + return deleteMaintenanceWindowWithHttpInfoAsync(maintenanceWindowId) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Permanently deletes a maintenance window. + * + * @param maintenanceWindowId The UUID of the maintenance window. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
204 No Content -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
404 Not Found -
429 Too many requests -
+ */ + public ApiResponse deleteMaintenanceWindowWithHttpInfo(String maintenanceWindowId) + throws ApiException { + // Check if unstable operation is enabled + String operationId = "deleteMaintenanceWindow"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = null; + + // verify the required parameter 'maintenanceWindowId' is set + if (maintenanceWindowId == null) { + throw new ApiException( + 400, + "Missing the required parameter 'maintenanceWindowId' when calling" + + " deleteMaintenanceWindow"); + } + // create path and map variables + String localVarPath = + "/api/v2/maintenance_windows/{maintenance_window_id}" + .replaceAll( + "\\{" + "maintenance_window_id" + "\\}", + apiClient.escapeString(maintenanceWindowId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.CaseManagementApi.deleteMaintenanceWindow", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"*/*"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + return apiClient.invokeAPI( + "DELETE", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + null); + } + + /** + * Delete a maintenance window. + * + *

See {@link #deleteMaintenanceWindowWithHttpInfo}. + * + * @param maintenanceWindowId The UUID of the maintenance window. (required) + * @return CompletableFuture<ApiResponse<Void>> + */ + public CompletableFuture> deleteMaintenanceWindowWithHttpInfoAsync( + String maintenanceWindowId) { + // Check if unstable operation is enabled + String operationId = "deleteMaintenanceWindow"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = null; + + // verify the required parameter 'maintenanceWindowId' is set + if (maintenanceWindowId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'maintenanceWindowId' when calling" + + " deleteMaintenanceWindow")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/maintenance_windows/{maintenance_window_id}" + .replaceAll( + "\\{" + "maintenance_window_id" + "\\}", + apiClient.escapeString(maintenanceWindowId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.CaseManagementApi.deleteMaintenanceWindow", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"*/*"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "DELETE", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + null); + } + + /** + * Remove a project. + * + *

See {@link #deleteProjectWithHttpInfo}. + * + * @param projectId Project UUID. (required) + * @throws ApiException if fails to make API call + */ + public void deleteProject(String projectId) throws ApiException { + deleteProjectWithHttpInfo(projectId); + } + + /** + * Remove a project. + * + *

See {@link #deleteProjectWithHttpInfoAsync}. + * + * @param projectId Project UUID. (required) + * @return CompletableFuture + */ + public CompletableFuture deleteProjectAsync(String projectId) { + return deleteProjectWithHttpInfoAsync(projectId) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Remove a project using the project's id. + * + * @param projectId Project UUID. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
204 No Content -
403 Forbidden -
404 API error response -
429 Too many requests -
+ */ + public ApiResponse deleteProjectWithHttpInfo(String projectId) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'projectId' is set + if (projectId == null) { + throw new ApiException( + 400, "Missing the required parameter 'projectId' when calling deleteProject"); + } + // create path and map variables + String localVarPath = + "/api/v2/cases/projects/{project_id}" + .replaceAll("\\{" + "project_id" + "\\}", apiClient.escapeString(projectId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.CaseManagementApi.deleteProject", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"*/*"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + return apiClient.invokeAPI( + "DELETE", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + null); + } + + /** + * Remove a project. + * + *

See {@link #deleteProjectWithHttpInfo}. + * + * @param projectId Project UUID. (required) + * @return CompletableFuture<ApiResponse<Void>> + */ + public CompletableFuture> deleteProjectWithHttpInfoAsync(String projectId) { + Object localVarPostBody = null; + + // verify the required parameter 'projectId' is set + if (projectId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'projectId' when calling deleteProject")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/cases/projects/{project_id}" + .replaceAll("\\{" + "project_id" + "\\}", apiClient.escapeString(projectId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.CaseManagementApi.deleteProject", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"*/*"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "DELETE", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + null); + } + + /** + * Delete a notification rule. + * + *

See {@link #deleteProjectNotificationRuleWithHttpInfo}. + * + * @param projectId Project UUID (required) + * @param notificationRuleId Notification Rule UUID (required) + * @throws ApiException if fails to make API call + */ + public void deleteProjectNotificationRule(String projectId, String notificationRuleId) + throws ApiException { + deleteProjectNotificationRuleWithHttpInfo(projectId, notificationRuleId); + } + + /** + * Delete a notification rule. + * + *

See {@link #deleteProjectNotificationRuleWithHttpInfoAsync}. + * + * @param projectId Project UUID (required) + * @param notificationRuleId Notification Rule UUID (required) + * @return CompletableFuture + */ + public CompletableFuture deleteProjectNotificationRuleAsync( + String projectId, String notificationRuleId) { + return deleteProjectNotificationRuleWithHttpInfoAsync(projectId, notificationRuleId) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Delete a notification rule using the notification rule's id. + * + * @param projectId Project UUID (required) + * @param notificationRuleId Notification Rule UUID (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
204 No Content -
403 Forbidden -
404 API error response -
429 Too many requests -
+ */ + public ApiResponse deleteProjectNotificationRuleWithHttpInfo( + String projectId, String notificationRuleId) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'projectId' is set + if (projectId == null) { + throw new ApiException( + 400, + "Missing the required parameter 'projectId' when calling deleteProjectNotificationRule"); + } + + // verify the required parameter 'notificationRuleId' is set + if (notificationRuleId == null) { + throw new ApiException( + 400, + "Missing the required parameter 'notificationRuleId' when calling" + + " deleteProjectNotificationRule"); + } + // create path and map variables + String localVarPath = + "/api/v2/cases/projects/{project_id}/notification_rules/{notification_rule_id}" + .replaceAll("\\{" + "project_id" + "\\}", apiClient.escapeString(projectId.toString())) + .replaceAll( + "\\{" + "notification_rule_id" + "\\}", + apiClient.escapeString(notificationRuleId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.CaseManagementApi.deleteProjectNotificationRule", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"*/*"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + return apiClient.invokeAPI( + "DELETE", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + null); + } + + /** + * Delete a notification rule. + * + *

See {@link #deleteProjectNotificationRuleWithHttpInfo}. + * + * @param projectId Project UUID (required) + * @param notificationRuleId Notification Rule UUID (required) + * @return CompletableFuture<ApiResponse<Void>> + */ + public CompletableFuture> deleteProjectNotificationRuleWithHttpInfoAsync( + String projectId, String notificationRuleId) { + Object localVarPostBody = null; + + // verify the required parameter 'projectId' is set + if (projectId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'projectId' when calling" + + " deleteProjectNotificationRule")); + return result; + } + + // verify the required parameter 'notificationRuleId' is set + if (notificationRuleId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'notificationRuleId' when calling" + + " deleteProjectNotificationRule")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/cases/projects/{project_id}/notification_rules/{notification_rule_id}" + .replaceAll("\\{" + "project_id" + "\\}", apiClient.escapeString(projectId.toString())) + .replaceAll( + "\\{" + "notification_rule_id" + "\\}", + apiClient.escapeString(notificationRuleId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.CaseManagementApi.deleteProjectNotificationRule", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"*/*"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "DELETE", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + null); + } + + /** + * Disable an automation rule. + * + *

See {@link #disableCaseAutomationRuleWithHttpInfo}. + * + * @param projectId The UUID of the project that owns the automation rules. (required) + * @param ruleId The UUID of the automation rule. (required) + * @return AutomationRuleResponse + * @throws ApiException if fails to make API call + */ + public AutomationRuleResponse disableCaseAutomationRule(String projectId, String ruleId) + throws ApiException { + return disableCaseAutomationRuleWithHttpInfo(projectId, ruleId).getData(); + } + + /** + * Disable an automation rule. + * + *

See {@link #disableCaseAutomationRuleWithHttpInfoAsync}. + * + * @param projectId The UUID of the project that owns the automation rules. (required) + * @param ruleId The UUID of the automation rule. (required) + * @return CompletableFuture<AutomationRuleResponse> + */ + public CompletableFuture disableCaseAutomationRuleAsync( + String projectId, String ruleId) { + return disableCaseAutomationRuleWithHttpInfoAsync(projectId, ruleId) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Disables an automation rule so it no longer triggers on case events. The rule configuration is + * preserved. + * + * @param projectId The UUID of the project that owns the automation rules. (required) + * @param ruleId The UUID of the automation rule. (required) + * @return ApiResponse<AutomationRuleResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
404 Not Found -
429 Too many requests -
+ */ + public ApiResponse disableCaseAutomationRuleWithHttpInfo( + String projectId, String ruleId) throws ApiException { + // Check if unstable operation is enabled + String operationId = "disableCaseAutomationRule"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = null; + + // verify the required parameter 'projectId' is set + if (projectId == null) { + throw new ApiException( + 400, "Missing the required parameter 'projectId' when calling disableCaseAutomationRule"); + } + + // verify the required parameter 'ruleId' is set + if (ruleId == null) { + throw new ApiException( + 400, "Missing the required parameter 'ruleId' when calling disableCaseAutomationRule"); + } + // create path and map variables + String localVarPath = + "/api/v2/cases/projects/{project_id}/rules/{rule_id}/disable" + .replaceAll("\\{" + "project_id" + "\\}", apiClient.escapeString(projectId.toString())) + .replaceAll("\\{" + "rule_id" + "\\}", apiClient.escapeString(ruleId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.CaseManagementApi.disableCaseAutomationRule", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + return apiClient.invokeAPI( + "POST", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Disable an automation rule. + * + *

See {@link #disableCaseAutomationRuleWithHttpInfo}. + * + * @param projectId The UUID of the project that owns the automation rules. (required) + * @param ruleId The UUID of the automation rule. (required) + * @return CompletableFuture<ApiResponse<AutomationRuleResponse>> + */ + public CompletableFuture> + disableCaseAutomationRuleWithHttpInfoAsync(String projectId, String ruleId) { + // Check if unstable operation is enabled + String operationId = "disableCaseAutomationRule"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = null; + + // verify the required parameter 'projectId' is set + if (projectId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'projectId' when calling disableCaseAutomationRule")); + return result; + } + + // verify the required parameter 'ruleId' is set + if (ruleId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'ruleId' when calling disableCaseAutomationRule")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/cases/projects/{project_id}/rules/{rule_id}/disable" + .replaceAll("\\{" + "project_id" + "\\}", apiClient.escapeString(projectId.toString())) + .replaceAll("\\{" + "rule_id" + "\\}", apiClient.escapeString(ruleId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.CaseManagementApi.disableCaseAutomationRule", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "POST", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Enable an automation rule. + * + *

See {@link #enableCaseAutomationRuleWithHttpInfo}. + * + * @param projectId The UUID of the project that owns the automation rules. (required) + * @param ruleId The UUID of the automation rule. (required) + * @return AutomationRuleResponse + * @throws ApiException if fails to make API call + */ + public AutomationRuleResponse enableCaseAutomationRule(String projectId, String ruleId) + throws ApiException { + return enableCaseAutomationRuleWithHttpInfo(projectId, ruleId).getData(); + } + + /** + * Enable an automation rule. + * + *

See {@link #enableCaseAutomationRuleWithHttpInfoAsync}. + * + * @param projectId The UUID of the project that owns the automation rules. (required) + * @param ruleId The UUID of the automation rule. (required) + * @return CompletableFuture<AutomationRuleResponse> + */ + public CompletableFuture enableCaseAutomationRuleAsync( + String projectId, String ruleId) { + return enableCaseAutomationRuleWithHttpInfoAsync(projectId, ruleId) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Enables a previously disabled automation rule so it triggers on matching case events. + * + * @param projectId The UUID of the project that owns the automation rules. (required) + * @param ruleId The UUID of the automation rule. (required) + * @return ApiResponse<AutomationRuleResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
404 Not Found -
429 Too many requests -
+ */ + public ApiResponse enableCaseAutomationRuleWithHttpInfo( + String projectId, String ruleId) throws ApiException { + // Check if unstable operation is enabled + String operationId = "enableCaseAutomationRule"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = null; + + // verify the required parameter 'projectId' is set + if (projectId == null) { + throw new ApiException( + 400, "Missing the required parameter 'projectId' when calling enableCaseAutomationRule"); + } + + // verify the required parameter 'ruleId' is set + if (ruleId == null) { + throw new ApiException( + 400, "Missing the required parameter 'ruleId' when calling enableCaseAutomationRule"); + } + // create path and map variables + String localVarPath = + "/api/v2/cases/projects/{project_id}/rules/{rule_id}/enable" + .replaceAll("\\{" + "project_id" + "\\}", apiClient.escapeString(projectId.toString())) + .replaceAll("\\{" + "rule_id" + "\\}", apiClient.escapeString(ruleId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.CaseManagementApi.enableCaseAutomationRule", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + return apiClient.invokeAPI( + "POST", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Enable an automation rule. + * + *

See {@link #enableCaseAutomationRuleWithHttpInfo}. + * + * @param projectId The UUID of the project that owns the automation rules. (required) + * @param ruleId The UUID of the automation rule. (required) + * @return CompletableFuture<ApiResponse<AutomationRuleResponse>> + */ + public CompletableFuture> + enableCaseAutomationRuleWithHttpInfoAsync(String projectId, String ruleId) { + // Check if unstable operation is enabled + String operationId = "enableCaseAutomationRule"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = null; + + // verify the required parameter 'projectId' is set + if (projectId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'projectId' when calling enableCaseAutomationRule")); + return result; + } + + // verify the required parameter 'ruleId' is set + if (ruleId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'ruleId' when calling enableCaseAutomationRule")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/cases/projects/{project_id}/rules/{rule_id}/enable" + .replaceAll("\\{" + "project_id" + "\\}", apiClient.escapeString(projectId.toString())) + .replaceAll("\\{" + "rule_id" + "\\}", apiClient.escapeString(ruleId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.CaseManagementApi.enableCaseAutomationRule", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "POST", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Favorite a project. + * + *

See {@link #favoriteCaseProjectWithHttpInfo}. + * + * @param projectId Project UUID. (required) + * @throws ApiException if fails to make API call + */ + public void favoriteCaseProject(String projectId) throws ApiException { + favoriteCaseProjectWithHttpInfo(projectId); + } + + /** + * Favorite a project. + * + *

See {@link #favoriteCaseProjectWithHttpInfoAsync}. + * + * @param projectId Project UUID. (required) + * @return CompletableFuture + */ + public CompletableFuture favoriteCaseProjectAsync(String projectId) { + return favoriteCaseProjectWithHttpInfoAsync(projectId) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Marks a case project as a favorite for the current authenticated user. + * + * @param projectId Project UUID. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
204 No Content -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
404 Not Found -
429 Too many requests -
+ */ + public ApiResponse favoriteCaseProjectWithHttpInfo(String projectId) throws ApiException { + // Check if unstable operation is enabled + String operationId = "favoriteCaseProject"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = null; + + // verify the required parameter 'projectId' is set + if (projectId == null) { + throw new ApiException( + 400, "Missing the required parameter 'projectId' when calling favoriteCaseProject"); + } + // create path and map variables + String localVarPath = + "/api/v2/cases/projects/{project_id}/favorites" + .replaceAll("\\{" + "project_id" + "\\}", apiClient.escapeString(projectId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.CaseManagementApi.favoriteCaseProject", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"*/*"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + return apiClient.invokeAPI( + "POST", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + null); + } + + /** + * Favorite a project. + * + *

See {@link #favoriteCaseProjectWithHttpInfo}. + * + * @param projectId Project UUID. (required) + * @return CompletableFuture<ApiResponse<Void>> + */ + public CompletableFuture> favoriteCaseProjectWithHttpInfoAsync( + String projectId) { + // Check if unstable operation is enabled + String operationId = "favoriteCaseProject"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = null; + + // verify the required parameter 'projectId' is set + if (projectId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'projectId' when calling favoriteCaseProject")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/cases/projects/{project_id}/favorites" + .replaceAll("\\{" + "project_id" + "\\}", apiClient.escapeString(projectId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.CaseManagementApi.favoriteCaseProject", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"*/*"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "POST", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + null); + } + + /** + * Get the details of a case. + * + *

See {@link #getCaseWithHttpInfo}. + * + * @param caseId Case's UUID or key (required) + * @return CaseResponse + * @throws ApiException if fails to make API call + */ + public CaseResponse getCase(String caseId) throws ApiException { + return getCaseWithHttpInfo(caseId).getData(); + } + + /** + * Get the details of a case. + * + *

See {@link #getCaseWithHttpInfoAsync}. + * + * @param caseId Case's UUID or key (required) + * @return CompletableFuture<CaseResponse> + */ + public CompletableFuture getCaseAsync(String caseId) { + return getCaseWithHttpInfoAsync(caseId) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Get the details of case by case_id + * + * @param caseId Case's UUID or key (required) + * @return ApiResponse<CaseResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
404 Not Found -
429 Too many requests -
+ */ + public ApiResponse getCaseWithHttpInfo(String caseId) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'caseId' is set + if (caseId == null) { + throw new ApiException(400, "Missing the required parameter 'caseId' when calling getCase"); + } + // create path and map variables + String localVarPath = + "/api/v2/cases/{case_id}" + .replaceAll("\\{" + "case_id" + "\\}", apiClient.escapeString(caseId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.CaseManagementApi.getCase", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + return apiClient.invokeAPI( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Get the details of a case. + * + *

See {@link #getCaseWithHttpInfo}. + * + * @param caseId Case's UUID or key (required) + * @return CompletableFuture<ApiResponse<CaseResponse>> + */ + public CompletableFuture> getCaseWithHttpInfoAsync(String caseId) { + Object localVarPostBody = null; + + // verify the required parameter 'caseId' is set + if (caseId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(400, "Missing the required parameter 'caseId' when calling getCase")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/cases/{case_id}" + .replaceAll("\\{" + "case_id" + "\\}", apiClient.escapeString(caseId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.CaseManagementApi.getCase", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Get an automation rule. + * + *

See {@link #getCaseAutomationRuleWithHttpInfo}. + * + * @param projectId The UUID of the project that owns the automation rules. (required) + * @param ruleId The UUID of the automation rule. (required) + * @return AutomationRuleResponse + * @throws ApiException if fails to make API call + */ + public AutomationRuleResponse getCaseAutomationRule(String projectId, String ruleId) + throws ApiException { + return getCaseAutomationRuleWithHttpInfo(projectId, ruleId).getData(); + } + + /** + * Get an automation rule. + * + *

See {@link #getCaseAutomationRuleWithHttpInfoAsync}. + * + * @param projectId The UUID of the project that owns the automation rules. (required) + * @param ruleId The UUID of the automation rule. (required) + * @return CompletableFuture<AutomationRuleResponse> + */ + public CompletableFuture getCaseAutomationRuleAsync( + String projectId, String ruleId) { + return getCaseAutomationRuleWithHttpInfoAsync(projectId, ruleId) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Returns a single automation rule identified by its UUID, including its trigger, action, and + * current state (enabled/disabled). + * + * @param projectId The UUID of the project that owns the automation rules. (required) + * @param ruleId The UUID of the automation rule. (required) + * @return ApiResponse<AutomationRuleResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
404 Not Found -
429 Too many requests -
+ */ + public ApiResponse getCaseAutomationRuleWithHttpInfo( + String projectId, String ruleId) throws ApiException { + // Check if unstable operation is enabled + String operationId = "getCaseAutomationRule"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = null; + + // verify the required parameter 'projectId' is set + if (projectId == null) { + throw new ApiException( + 400, "Missing the required parameter 'projectId' when calling getCaseAutomationRule"); + } + + // verify the required parameter 'ruleId' is set + if (ruleId == null) { + throw new ApiException( + 400, "Missing the required parameter 'ruleId' when calling getCaseAutomationRule"); + } + // create path and map variables + String localVarPath = + "/api/v2/cases/projects/{project_id}/rules/{rule_id}" + .replaceAll("\\{" + "project_id" + "\\}", apiClient.escapeString(projectId.toString())) + .replaceAll("\\{" + "rule_id" + "\\}", apiClient.escapeString(ruleId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.CaseManagementApi.getCaseAutomationRule", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + return apiClient.invokeAPI( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Get an automation rule. + * + *

See {@link #getCaseAutomationRuleWithHttpInfo}. + * + * @param projectId The UUID of the project that owns the automation rules. (required) + * @param ruleId The UUID of the automation rule. (required) + * @return CompletableFuture<ApiResponse<AutomationRuleResponse>> + */ + public CompletableFuture> + getCaseAutomationRuleWithHttpInfoAsync(String projectId, String ruleId) { + // Check if unstable operation is enabled + String operationId = "getCaseAutomationRule"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = null; + + // verify the required parameter 'projectId' is set + if (projectId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'projectId' when calling getCaseAutomationRule")); + return result; + } + + // verify the required parameter 'ruleId' is set + if (ruleId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'ruleId' when calling getCaseAutomationRule")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/cases/projects/{project_id}/rules/{rule_id}" + .replaceAll("\\{" + "project_id" + "\\}", apiClient.escapeString(projectId.toString())) + .replaceAll("\\{" + "rule_id" + "\\}", apiClient.escapeString(ruleId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.CaseManagementApi.getCaseAutomationRule", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Get a case view. + * + *

See {@link #getCaseViewWithHttpInfo}. + * + * @param viewId The UUID of the case view. (required) + * @return CaseViewResponse + * @throws ApiException if fails to make API call + */ + public CaseViewResponse getCaseView(String viewId) throws ApiException { + return getCaseViewWithHttpInfo(viewId).getData(); + } + + /** + * Get a case view. + * + *

See {@link #getCaseViewWithHttpInfoAsync}. + * + * @param viewId The UUID of the case view. (required) + * @return CompletableFuture<CaseViewResponse> + */ + public CompletableFuture getCaseViewAsync(String viewId) { + return getCaseViewWithHttpInfoAsync(viewId) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Returns a single saved case view identified by its UUID, including its query, associated + * project, and timestamps. + * + * @param viewId The UUID of the case view. (required) + * @return ApiResponse<CaseViewResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
404 Not Found -
429 Too many requests -
+ */ + public ApiResponse getCaseViewWithHttpInfo(String viewId) throws ApiException { + // Check if unstable operation is enabled + String operationId = "getCaseView"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = null; + + // verify the required parameter 'viewId' is set + if (viewId == null) { + throw new ApiException( + 400, "Missing the required parameter 'viewId' when calling getCaseView"); + } + // create path and map variables + String localVarPath = + "/api/v2/cases/views/{view_id}" + .replaceAll("\\{" + "view_id" + "\\}", apiClient.escapeString(viewId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.CaseManagementApi.getCaseView", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + return apiClient.invokeAPI( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Get a case view. + * + *

See {@link #getCaseViewWithHttpInfo}. + * + * @param viewId The UUID of the case view. (required) + * @return CompletableFuture<ApiResponse<CaseViewResponse>> + */ + public CompletableFuture> getCaseViewWithHttpInfoAsync( + String viewId) { + // Check if unstable operation is enabled + String operationId = "getCaseView"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = null; + + // verify the required parameter 'viewId' is set + if (viewId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'viewId' when calling getCaseView")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/cases/views/{view_id}" + .replaceAll("\\{" + "view_id" + "\\}", apiClient.escapeString(viewId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.CaseManagementApi.getCaseView", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Get the details of a project. + * + *

See {@link #getProjectWithHttpInfo}. + * + * @param projectId Project UUID. (required) + * @return ProjectResponse + * @throws ApiException if fails to make API call + */ + public ProjectResponse getProject(String projectId) throws ApiException { + return getProjectWithHttpInfo(projectId).getData(); + } + + /** + * Get the details of a project. + * + *

See {@link #getProjectWithHttpInfoAsync}. + * + * @param projectId Project UUID. (required) + * @return CompletableFuture<ProjectResponse> + */ + public CompletableFuture getProjectAsync(String projectId) { + return getProjectWithHttpInfoAsync(projectId) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Get the details of a project by project_id. + * + * @param projectId Project UUID. (required) + * @return ApiResponse<ProjectResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
404 Not Found -
429 Too many requests -
+ */ + public ApiResponse getProjectWithHttpInfo(String projectId) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'projectId' is set + if (projectId == null) { + throw new ApiException( + 400, "Missing the required parameter 'projectId' when calling getProject"); + } + // create path and map variables + String localVarPath = + "/api/v2/cases/projects/{project_id}" + .replaceAll("\\{" + "project_id" + "\\}", apiClient.escapeString(projectId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.CaseManagementApi.getProject", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + return apiClient.invokeAPI( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Get the details of a project. + * + *

See {@link #getProjectWithHttpInfo}. + * + * @param projectId Project UUID. (required) + * @return CompletableFuture<ApiResponse<ProjectResponse>> + */ + public CompletableFuture> getProjectWithHttpInfoAsync( + String projectId) { + Object localVarPostBody = null; + + // verify the required parameter 'projectId' is set + if (projectId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'projectId' when calling getProject")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/cases/projects/{project_id}" + .replaceAll("\\{" + "project_id" + "\\}", apiClient.escapeString(projectId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.CaseManagementApi.getProject", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Get notification rules. + * + *

See {@link #getProjectNotificationRulesWithHttpInfo}. + * + * @param projectId Project UUID (required) + * @return CaseNotificationRulesResponse + * @throws ApiException if fails to make API call + */ + public CaseNotificationRulesResponse getProjectNotificationRules(String projectId) + throws ApiException { + return getProjectNotificationRulesWithHttpInfo(projectId).getData(); + } + + /** + * Get notification rules. + * + *

See {@link #getProjectNotificationRulesWithHttpInfoAsync}. + * + * @param projectId Project UUID (required) + * @return CompletableFuture<CaseNotificationRulesResponse> + */ + public CompletableFuture getProjectNotificationRulesAsync( + String projectId) { + return getProjectNotificationRulesWithHttpInfoAsync(projectId) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Get all notification rules for a project. + * + * @param projectId Project UUID (required) + * @return ApiResponse<CaseNotificationRulesResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
404 Not Found -
429 Too many requests -
+ */ + public ApiResponse getProjectNotificationRulesWithHttpInfo( + String projectId) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'projectId' is set + if (projectId == null) { + throw new ApiException( + 400, + "Missing the required parameter 'projectId' when calling getProjectNotificationRules"); + } + // create path and map variables + String localVarPath = + "/api/v2/cases/projects/{project_id}/notification_rules" + .replaceAll("\\{" + "project_id" + "\\}", apiClient.escapeString(projectId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.CaseManagementApi.getProjectNotificationRules", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + return apiClient.invokeAPI( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Get notification rules. + * + *

See {@link #getProjectNotificationRulesWithHttpInfo}. + * + * @param projectId Project UUID (required) + * @return CompletableFuture<ApiResponse<CaseNotificationRulesResponse>> + */ + public CompletableFuture> + getProjectNotificationRulesWithHttpInfoAsync(String projectId) { + Object localVarPostBody = null; + + // verify the required parameter 'projectId' is set + if (projectId == null) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'projectId' when calling" + + " getProjectNotificationRules")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/cases/projects/{project_id}/notification_rules" + .replaceAll("\\{" + "project_id" + "\\}", apiClient.escapeString(projectId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.CaseManagementApi.getProjectNotificationRules", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + } catch (ApiException ex) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Get all projects. + * + *

See {@link #getProjectsWithHttpInfo}. + * + * @return ProjectsResponse + * @throws ApiException if fails to make API call + */ + public ProjectsResponse getProjects() throws ApiException { + return getProjectsWithHttpInfo().getData(); + } + + /** + * Get all projects. + * + *

See {@link #getProjectsWithHttpInfoAsync}. + * + * @return CompletableFuture<ProjectsResponse> + */ + public CompletableFuture getProjectsAsync() { + return getProjectsWithHttpInfoAsync() + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Get all projects. + * + * @return ApiResponse<ProjectsResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
404 Not Found -
429 Too many requests -
+ */ + public ApiResponse getProjectsWithHttpInfo() throws ApiException { + Object localVarPostBody = null; + // create path and map variables + String localVarPath = "/api/v2/cases/projects"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.CaseManagementApi.getProjects", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + return apiClient.invokeAPI( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Get all projects. + * + *

See {@link #getProjectsWithHttpInfo}. + * + * @return CompletableFuture<ApiResponse<ProjectsResponse>> + */ + public CompletableFuture> getProjectsWithHttpInfoAsync() { + Object localVarPostBody = null; + // create path and map variables + String localVarPath = "/api/v2/cases/projects"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.CaseManagementApi.getProjects", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Link incident to case. + * + *

See {@link #linkIncidentWithHttpInfo}. + * + * @param caseId Case's UUID or key (required) + * @param body Incident link request (required) + * @return CaseResponse + * @throws ApiException if fails to make API call + */ + public CaseResponse linkIncident(String caseId, RelationshipToIncidentRequest body) + throws ApiException { + return linkIncidentWithHttpInfo(caseId, body).getData(); + } + + /** + * Link incident to case. + * + *

See {@link #linkIncidentWithHttpInfoAsync}. + * + * @param caseId Case's UUID or key (required) + * @param body Incident link request (required) + * @return CompletableFuture<CaseResponse> + */ + public CompletableFuture linkIncidentAsync( + String caseId, RelationshipToIncidentRequest body) { + return linkIncidentWithHttpInfoAsync(caseId, body) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Link an incident to a case + * + * @param caseId Case's UUID or key (required) + * @param body Incident link request (required) + * @return ApiResponse<CaseResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
201 Created -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
404 Not Found -
429 Too many requests -
+ */ + public ApiResponse linkIncidentWithHttpInfo( + String caseId, RelationshipToIncidentRequest body) throws ApiException { + // Check if unstable operation is enabled + String operationId = "linkIncident"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = body; + + // verify the required parameter 'caseId' is set + if (caseId == null) { + throw new ApiException( + 400, "Missing the required parameter 'caseId' when calling linkIncident"); + } + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException( + 400, "Missing the required parameter 'body' when calling linkIncident"); + } + // create path and map variables + String localVarPath = + "/api/v2/cases/{case_id}/relationships/incidents" + .replaceAll("\\{" + "case_id" + "\\}", apiClient.escapeString(caseId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.CaseManagementApi.linkIncident", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + return apiClient.invokeAPI( + "POST", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Link incident to case. + * + *

See {@link #linkIncidentWithHttpInfo}. + * + * @param caseId Case's UUID or key (required) + * @param body Incident link request (required) + * @return CompletableFuture<ApiResponse<CaseResponse>> + */ + public CompletableFuture> linkIncidentWithHttpInfoAsync( + String caseId, RelationshipToIncidentRequest body) { + // Check if unstable operation is enabled + String operationId = "linkIncident"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = body; + + // verify the required parameter 'caseId' is set + if (caseId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'caseId' when calling linkIncident")); + return result; + } + + // verify the required parameter 'body' is set + if (body == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(400, "Missing the required parameter 'body' when calling linkIncident")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/cases/{case_id}/relationships/incidents" + .replaceAll("\\{" + "case_id" + "\\}", apiClient.escapeString(caseId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.CaseManagementApi.linkIncident", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "POST", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Link existing Jira issue to case. + * + *

See {@link #linkJiraIssueToCaseWithHttpInfo}. + * + * @param caseId Case's UUID or key (required) + * @param body Jira issue link request (required) + * @throws ApiException if fails to make API call + */ + public void linkJiraIssueToCase(String caseId, JiraIssueLinkRequest body) throws ApiException { + linkJiraIssueToCaseWithHttpInfo(caseId, body); + } + + /** + * Link existing Jira issue to case. + * + *

See {@link #linkJiraIssueToCaseWithHttpInfoAsync}. + * + * @param caseId Case's UUID or key (required) + * @param body Jira issue link request (required) + * @return CompletableFuture + */ + public CompletableFuture linkJiraIssueToCaseAsync( + String caseId, JiraIssueLinkRequest body) { + return linkJiraIssueToCaseWithHttpInfoAsync(caseId, body) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Link an existing Jira issue to a case + * + * @param caseId Case's UUID or key (required) + * @param body Jira issue link request (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
204 No Content -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
404 Not Found -
409 Conflict -
429 Too many requests -
+ */ + public ApiResponse linkJiraIssueToCaseWithHttpInfo(String caseId, JiraIssueLinkRequest body) + throws ApiException { + // Check if unstable operation is enabled + String operationId = "linkJiraIssueToCase"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = body; + + // verify the required parameter 'caseId' is set + if (caseId == null) { + throw new ApiException( + 400, "Missing the required parameter 'caseId' when calling linkJiraIssueToCase"); + } + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException( + 400, "Missing the required parameter 'body' when calling linkJiraIssueToCase"); + } + // create path and map variables + String localVarPath = + "/api/v2/cases/{case_id}/relationships/jira_issues" + .replaceAll("\\{" + "case_id" + "\\}", apiClient.escapeString(caseId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.CaseManagementApi.linkJiraIssueToCase", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"*/*"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + return apiClient.invokeAPI( + "PATCH", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + null); + } + + /** + * Link existing Jira issue to case. + * + *

See {@link #linkJiraIssueToCaseWithHttpInfo}. + * + * @param caseId Case's UUID or key (required) + * @param body Jira issue link request (required) + * @return CompletableFuture<ApiResponse<Void>> + */ + public CompletableFuture> linkJiraIssueToCaseWithHttpInfoAsync( + String caseId, JiraIssueLinkRequest body) { + // Check if unstable operation is enabled + String operationId = "linkJiraIssueToCase"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = body; + + // verify the required parameter 'caseId' is set + if (caseId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'caseId' when calling linkJiraIssueToCase")); + return result; + } + + // verify the required parameter 'body' is set + if (body == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'body' when calling linkJiraIssueToCase")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/cases/{case_id}/relationships/jira_issues" + .replaceAll("\\{" + "case_id" + "\\}", apiClient.escapeString(caseId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.CaseManagementApi.linkJiraIssueToCase", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"*/*"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "PATCH", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + null); + } + + /** + * List automation rules. + * + *

See {@link #listCaseAutomationRulesWithHttpInfo}. + * + * @param projectId The UUID of the project that owns the automation rules. (required) + * @return AutomationRulesResponse + * @throws ApiException if fails to make API call + */ + public AutomationRulesResponse listCaseAutomationRules(String projectId) throws ApiException { + return listCaseAutomationRulesWithHttpInfo(projectId).getData(); + } + + /** + * List automation rules. + * + *

See {@link #listCaseAutomationRulesWithHttpInfoAsync}. + * + * @param projectId The UUID of the project that owns the automation rules. (required) + * @return CompletableFuture<AutomationRulesResponse> + */ + public CompletableFuture listCaseAutomationRulesAsync(String projectId) { + return listCaseAutomationRulesWithHttpInfoAsync(projectId) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Returns all automation rules configured for a project. Automation rules allow automatic actions + * to be triggered by case events like creation, status transitions, or attribute changes. + * + * @param projectId The UUID of the project that owns the automation rules. (required) + * @return ApiResponse<AutomationRulesResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
404 Not Found -
429 Too many requests -
+ */ + public ApiResponse listCaseAutomationRulesWithHttpInfo(String projectId) + throws ApiException { + // Check if unstable operation is enabled + String operationId = "listCaseAutomationRules"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = null; + + // verify the required parameter 'projectId' is set + if (projectId == null) { + throw new ApiException( + 400, "Missing the required parameter 'projectId' when calling listCaseAutomationRules"); + } + // create path and map variables + String localVarPath = + "/api/v2/cases/projects/{project_id}/rules" + .replaceAll("\\{" + "project_id" + "\\}", apiClient.escapeString(projectId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.CaseManagementApi.listCaseAutomationRules", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + return apiClient.invokeAPI( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * List automation rules. + * + *

See {@link #listCaseAutomationRulesWithHttpInfo}. + * + * @param projectId The UUID of the project that owns the automation rules. (required) + * @return CompletableFuture<ApiResponse<AutomationRulesResponse>> + */ + public CompletableFuture> + listCaseAutomationRulesWithHttpInfoAsync(String projectId) { + // Check if unstable operation is enabled + String operationId = "listCaseAutomationRules"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = null; + + // verify the required parameter 'projectId' is set + if (projectId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'projectId' when calling listCaseAutomationRules")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/cases/projects/{project_id}/rules" + .replaceAll("\\{" + "project_id" + "\\}", apiClient.escapeString(projectId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.CaseManagementApi.listCaseAutomationRules", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** Manage optional parameters to listCaseLinks. */ + public static class ListCaseLinksOptionalParameters { + private String relationship; + + /** + * Set relationship. + * + * @param relationship Optional filter to only return links of a specific relationship type (for + * example, BLOCKS or CAUSES). (optional) + * @return ListCaseLinksOptionalParameters + */ + public ListCaseLinksOptionalParameters relationship(String relationship) { + this.relationship = relationship; + return this; + } + } + + /** + * List case links. + * + *

See {@link #listCaseLinksWithHttpInfo}. + * + * @param entityType The entity type to look up links for. Use CASE to find links for + * a specific case. (required) + * @param entityId The UUID of the entity to look up links for. (required) + * @return CaseLinksResponse + * @throws ApiException if fails to make API call + */ + public CaseLinksResponse listCaseLinks(String entityType, String entityId) throws ApiException { + return listCaseLinksWithHttpInfo(entityType, entityId, new ListCaseLinksOptionalParameters()) + .getData(); + } + + /** + * List case links. + * + *

See {@link #listCaseLinksWithHttpInfoAsync}. + * + * @param entityType The entity type to look up links for. Use CASE to find links for + * a specific case. (required) + * @param entityId The UUID of the entity to look up links for. (required) + * @return CompletableFuture<CaseLinksResponse> + */ + public CompletableFuture listCaseLinksAsync( + String entityType, String entityId) { + return listCaseLinksWithHttpInfoAsync( + entityType, entityId, new ListCaseLinksOptionalParameters()) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * List case links. + * + *

See {@link #listCaseLinksWithHttpInfo}. + * + * @param entityType The entity type to look up links for. Use CASE to find links for + * a specific case. (required) + * @param entityId The UUID of the entity to look up links for. (required) + * @param parameters Optional parameters for the request. + * @return CaseLinksResponse + * @throws ApiException if fails to make API call + */ + public CaseLinksResponse listCaseLinks( + String entityType, String entityId, ListCaseLinksOptionalParameters parameters) + throws ApiException { + return listCaseLinksWithHttpInfo(entityType, entityId, parameters).getData(); + } + + /** + * List case links. + * + *

See {@link #listCaseLinksWithHttpInfoAsync}. + * + * @param entityType The entity type to look up links for. Use CASE to find links for + * a specific case. (required) + * @param entityId The UUID of the entity to look up links for. (required) + * @param parameters Optional parameters for the request. + * @return CompletableFuture<CaseLinksResponse> + */ + public CompletableFuture listCaseLinksAsync( + String entityType, String entityId, ListCaseLinksOptionalParameters parameters) { + return listCaseLinksWithHttpInfoAsync(entityType, entityId, parameters) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Returns all links associated with a case. Links define relationships (for example, BLOCKS) + * between cases. Requires entity_type and entity_id query parameters. + * + * @param entityType The entity type to look up links for. Use CASE to find links for + * a specific case. (required) + * @param entityId The UUID of the entity to look up links for. (required) + * @param parameters Optional parameters for the request. + * @return ApiResponse<CaseLinksResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
404 Not Found -
429 Too many requests -
+ */ + public ApiResponse listCaseLinksWithHttpInfo( + String entityType, String entityId, ListCaseLinksOptionalParameters parameters) + throws ApiException { + // Check if unstable operation is enabled + String operationId = "listCaseLinks"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = null; + + // verify the required parameter 'entityType' is set + if (entityType == null) { + throw new ApiException( + 400, "Missing the required parameter 'entityType' when calling listCaseLinks"); + } + + // verify the required parameter 'entityId' is set + if (entityId == null) { + throw new ApiException( + 400, "Missing the required parameter 'entityId' when calling listCaseLinks"); + } + String relationship = parameters.relationship; + // create path and map variables + String localVarPath = "/api/v2/cases/link"; + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "entity_type", entityType)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "entity_id", entityId)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "relationship", relationship)); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.CaseManagementApi.listCaseLinks", + localVarPath, + localVarQueryParams, + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + return apiClient.invokeAPI( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * List case links. + * + *

See {@link #listCaseLinksWithHttpInfo}. + * + * @param entityType The entity type to look up links for. Use CASE to find links for + * a specific case. (required) + * @param entityId The UUID of the entity to look up links for. (required) + * @param parameters Optional parameters for the request. + * @return CompletableFuture<ApiResponse<CaseLinksResponse>> + */ + public CompletableFuture> listCaseLinksWithHttpInfoAsync( + String entityType, String entityId, ListCaseLinksOptionalParameters parameters) { + // Check if unstable operation is enabled + String operationId = "listCaseLinks"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = null; + + // verify the required parameter 'entityType' is set + if (entityType == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'entityType' when calling listCaseLinks")); + return result; + } + + // verify the required parameter 'entityId' is set + if (entityId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'entityId' when calling listCaseLinks")); + return result; + } + String relationship = parameters.relationship; + // create path and map variables + String localVarPath = "/api/v2/cases/link"; + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "entity_type", entityType)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "entity_id", entityId)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "relationship", relationship)); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.CaseManagementApi.listCaseLinks", + localVarPath, + localVarQueryParams, + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** Manage optional parameters to listCaseTimeline. */ + public static class ListCaseTimelineOptionalParameters { + private Integer pageSize; + private Integer pageNumber; + private Boolean sortAscending; + + /** + * Set pageSize. + * + * @param pageSize Number of timeline cells to return per page. (optional, default to 100) + * @return ListCaseTimelineOptionalParameters + */ + public ListCaseTimelineOptionalParameters pageSize(Integer pageSize) { + this.pageSize = pageSize; + return this; + } + + /** + * Set pageNumber. + * + * @param pageNumber Zero-based page number for pagination. (optional, default to 0) + * @return ListCaseTimelineOptionalParameters + */ + public ListCaseTimelineOptionalParameters pageNumber(Integer pageNumber) { + this.pageNumber = pageNumber; + return this; + } + + /** + * Set sortAscending. + * + * @param sortAscending If true, returns timeline cells in chronological order + * (oldest first). Defaults to false (newest first). (optional, default to + * false) + * @return ListCaseTimelineOptionalParameters + */ + public ListCaseTimelineOptionalParameters sortAscending(Boolean sortAscending) { + this.sortAscending = sortAscending; + return this; + } + } + + /** + * Get case timeline. + * + *

See {@link #listCaseTimelineWithHttpInfo}. + * + * @param caseId Case's UUID or key (required) + * @return TimelineResponse + * @throws ApiException if fails to make API call + */ + public TimelineResponse listCaseTimeline(String caseId) throws ApiException { + return listCaseTimelineWithHttpInfo(caseId, new ListCaseTimelineOptionalParameters()).getData(); + } + + /** + * Get case timeline. + * + *

See {@link #listCaseTimelineWithHttpInfoAsync}. + * + * @param caseId Case's UUID or key (required) + * @return CompletableFuture<TimelineResponse> + */ + public CompletableFuture listCaseTimelineAsync(String caseId) { + return listCaseTimelineWithHttpInfoAsync(caseId, new ListCaseTimelineOptionalParameters()) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Get case timeline. + * + *

See {@link #listCaseTimelineWithHttpInfo}. + * + * @param caseId Case's UUID or key (required) + * @param parameters Optional parameters for the request. + * @return TimelineResponse + * @throws ApiException if fails to make API call + */ + public TimelineResponse listCaseTimeline( + String caseId, ListCaseTimelineOptionalParameters parameters) throws ApiException { + return listCaseTimelineWithHttpInfo(caseId, parameters).getData(); + } + + /** + * Get case timeline. + * + *

See {@link #listCaseTimelineWithHttpInfoAsync}. + * + * @param caseId Case's UUID or key (required) + * @param parameters Optional parameters for the request. + * @return CompletableFuture<TimelineResponse> + */ + public CompletableFuture listCaseTimelineAsync( + String caseId, ListCaseTimelineOptionalParameters parameters) { + return listCaseTimelineWithHttpInfoAsync(caseId, parameters) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Returns the timeline of events for a case, including comments, status changes, and other + * activity. Supports pagination and sort order. + * + * @param caseId Case's UUID or key (required) + * @param parameters Optional parameters for the request. + * @return ApiResponse<TimelineResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
404 Not Found -
429 Too many requests -
+ */ + public ApiResponse listCaseTimelineWithHttpInfo( + String caseId, ListCaseTimelineOptionalParameters parameters) throws ApiException { + // Check if unstable operation is enabled + String operationId = "listCaseTimeline"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = null; + + // verify the required parameter 'caseId' is set + if (caseId == null) { + throw new ApiException( + 400, "Missing the required parameter 'caseId' when calling listCaseTimeline"); + } + Integer pageSize = parameters.pageSize; + Integer pageNumber = parameters.pageNumber; + Boolean sortAscending = parameters.sortAscending; + // create path and map variables + String localVarPath = + "/api/v2/cases/{case_id}/timelines" + .replaceAll("\\{" + "case_id" + "\\}", apiClient.escapeString(caseId.toString())); + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[size]", pageSize)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[number]", pageNumber)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "sort[ascending]", sortAscending)); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.CaseManagementApi.listCaseTimeline", + localVarPath, + localVarQueryParams, + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + return apiClient.invokeAPI( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Get case timeline. + * + *

See {@link #listCaseTimelineWithHttpInfo}. + * + * @param caseId Case's UUID or key (required) + * @param parameters Optional parameters for the request. + * @return CompletableFuture<ApiResponse<TimelineResponse>> + */ + public CompletableFuture> listCaseTimelineWithHttpInfoAsync( + String caseId, ListCaseTimelineOptionalParameters parameters) { + // Check if unstable operation is enabled + String operationId = "listCaseTimeline"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = null; + + // verify the required parameter 'caseId' is set + if (caseId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'caseId' when calling listCaseTimeline")); + return result; + } + Integer pageSize = parameters.pageSize; + Integer pageNumber = parameters.pageNumber; + Boolean sortAscending = parameters.sortAscending; + // create path and map variables + String localVarPath = + "/api/v2/cases/{case_id}/timelines" + .replaceAll("\\{" + "case_id" + "\\}", apiClient.escapeString(caseId.toString())); + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[size]", pageSize)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[number]", pageNumber)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "sort[ascending]", sortAscending)); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.CaseManagementApi.listCaseTimeline", + localVarPath, + localVarQueryParams, + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * List case views. + * + *

See {@link #listCaseViewsWithHttpInfo}. + * + * @param projectId Filter views by project identifier. (required) + * @return CaseViewsResponse + * @throws ApiException if fails to make API call + */ + public CaseViewsResponse listCaseViews(String projectId) throws ApiException { + return listCaseViewsWithHttpInfo(projectId).getData(); + } + + /** + * List case views. + * + *

See {@link #listCaseViewsWithHttpInfoAsync}. + * + * @param projectId Filter views by project identifier. (required) + * @return CompletableFuture<CaseViewsResponse> + */ + public CompletableFuture listCaseViewsAsync(String projectId) { + return listCaseViewsWithHttpInfoAsync(projectId) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Returns all saved case views for a given project. Views are saved search queries that allow + * quick access to filtered lists of cases. + * + * @param projectId Filter views by project identifier. (required) + * @return ApiResponse<CaseViewsResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
404 Not Found -
429 Too many requests -
+ */ + public ApiResponse listCaseViewsWithHttpInfo(String projectId) + throws ApiException { + // Check if unstable operation is enabled + String operationId = "listCaseViews"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = null; + + // verify the required parameter 'projectId' is set + if (projectId == null) { + throw new ApiException( + 400, "Missing the required parameter 'projectId' when calling listCaseViews"); + } + // create path and map variables + String localVarPath = "/api/v2/cases/views"; + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "project_id", projectId)); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.CaseManagementApi.listCaseViews", + localVarPath, + localVarQueryParams, + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + return apiClient.invokeAPI( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * List case views. + * + *

See {@link #listCaseViewsWithHttpInfo}. + * + * @param projectId Filter views by project identifier. (required) + * @return CompletableFuture<ApiResponse<CaseViewsResponse>> + */ + public CompletableFuture> listCaseViewsWithHttpInfoAsync( + String projectId) { + // Check if unstable operation is enabled + String operationId = "listCaseViews"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = null; + + // verify the required parameter 'projectId' is set + if (projectId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'projectId' when calling listCaseViews")); + return result; + } + // create path and map variables + String localVarPath = "/api/v2/cases/views"; + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "project_id", projectId)); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.CaseManagementApi.listCaseViews", + localVarPath, + localVarQueryParams, + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * List case watchers. + * + *

See {@link #listCaseWatchersWithHttpInfo}. + * + * @param caseId Case's UUID or key (required) + * @return CaseWatchersResponse + * @throws ApiException if fails to make API call + */ + public CaseWatchersResponse listCaseWatchers(String caseId) throws ApiException { + return listCaseWatchersWithHttpInfo(caseId).getData(); + } + + /** + * List case watchers. + * + *

See {@link #listCaseWatchersWithHttpInfoAsync}. + * + * @param caseId Case's UUID or key (required) + * @return CompletableFuture<CaseWatchersResponse> + */ + public CompletableFuture listCaseWatchersAsync(String caseId) { + return listCaseWatchersWithHttpInfoAsync(caseId) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Returns the list of users who are watching a case. Watchers receive notifications about updates + * to the case. + * + * @param caseId Case's UUID or key (required) + * @return ApiResponse<CaseWatchersResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
404 Not Found -
429 Too many requests -
+ */ + public ApiResponse listCaseWatchersWithHttpInfo(String caseId) + throws ApiException { + // Check if unstable operation is enabled + String operationId = "listCaseWatchers"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = null; + + // verify the required parameter 'caseId' is set + if (caseId == null) { + throw new ApiException( + 400, "Missing the required parameter 'caseId' when calling listCaseWatchers"); + } + // create path and map variables + String localVarPath = + "/api/v2/cases/{case_id}/watchers" + .replaceAll("\\{" + "case_id" + "\\}", apiClient.escapeString(caseId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.CaseManagementApi.listCaseWatchers", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + return apiClient.invokeAPI( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * List case watchers. + * + *

See {@link #listCaseWatchersWithHttpInfo}. + * + * @param caseId Case's UUID or key (required) + * @return CompletableFuture<ApiResponse<CaseWatchersResponse>> + */ + public CompletableFuture> listCaseWatchersWithHttpInfoAsync( + String caseId) { + // Check if unstable operation is enabled + String operationId = "listCaseWatchers"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = null; + + // verify the required parameter 'caseId' is set + if (caseId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'caseId' when calling listCaseWatchers")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/cases/{case_id}/watchers" + .replaceAll("\\{" + "case_id" + "\\}", apiClient.escapeString(caseId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.CaseManagementApi.listCaseWatchers", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * List maintenance windows. + * + *

See {@link #listMaintenanceWindowsWithHttpInfo}. + * + * @return MaintenanceWindowsResponse + * @throws ApiException if fails to make API call + */ + public MaintenanceWindowsResponse listMaintenanceWindows() throws ApiException { + return listMaintenanceWindowsWithHttpInfo().getData(); + } + + /** + * List maintenance windows. + * + *

See {@link #listMaintenanceWindowsWithHttpInfoAsync}. + * + * @return CompletableFuture<MaintenanceWindowsResponse> + */ + public CompletableFuture listMaintenanceWindowsAsync() { + return listMaintenanceWindowsWithHttpInfoAsync() + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Returns all configured maintenance windows for event management cases. Maintenance windows + * define time periods during which case notifications and automation rules are suppressed for + * cases matching a given query. + * + * @return ApiResponse<MaintenanceWindowsResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
404 Not Found -
429 Too many requests -
+ */ + public ApiResponse listMaintenanceWindowsWithHttpInfo() + throws ApiException { + // Check if unstable operation is enabled + String operationId = "listMaintenanceWindows"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = null; + // create path and map variables + String localVarPath = "/api/v2/maintenance_windows"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.CaseManagementApi.listMaintenanceWindows", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + return apiClient.invokeAPI( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * List maintenance windows. + * + *

See {@link #listMaintenanceWindowsWithHttpInfo}. + * + * @return CompletableFuture<ApiResponse<MaintenanceWindowsResponse>> + */ + public CompletableFuture> + listMaintenanceWindowsWithHttpInfoAsync() { + // Check if unstable operation is enabled + String operationId = "listMaintenanceWindows"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = null; + // create path and map variables + String localVarPath = "/api/v2/maintenance_windows"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.CaseManagementApi.listMaintenanceWindows", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * List project favorites. + * + *

See {@link #listUserCaseProjectFavoritesWithHttpInfo}. + * + * @return ProjectFavoritesResponse + * @throws ApiException if fails to make API call + */ + public ProjectFavoritesResponse listUserCaseProjectFavorites() throws ApiException { + return listUserCaseProjectFavoritesWithHttpInfo().getData(); + } + + /** + * List project favorites. + * + *

See {@link #listUserCaseProjectFavoritesWithHttpInfoAsync}. + * + * @return CompletableFuture<ProjectFavoritesResponse> + */ + public CompletableFuture listUserCaseProjectFavoritesAsync() { + return listUserCaseProjectFavoritesWithHttpInfoAsync() + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Returns the list of case projects that the current authenticated user has marked as favorites. + * + * @return ApiResponse<ProjectFavoritesResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
404 Not Found -
429 Too many requests -
+ */ + public ApiResponse listUserCaseProjectFavoritesWithHttpInfo() + throws ApiException { + // Check if unstable operation is enabled + String operationId = "listUserCaseProjectFavorites"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = null; + // create path and map variables + String localVarPath = "/api/v2/cases/projects/favorites"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.CaseManagementApi.listUserCaseProjectFavorites", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + return apiClient.invokeAPI( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * List project favorites. + * + *

See {@link #listUserCaseProjectFavoritesWithHttpInfo}. + * + * @return CompletableFuture<ApiResponse<ProjectFavoritesResponse>> + */ + public CompletableFuture> + listUserCaseProjectFavoritesWithHttpInfoAsync() { + // Check if unstable operation is enabled + String operationId = "listUserCaseProjectFavorites"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = null; + // create path and map variables + String localVarPath = "/api/v2/cases/projects/favorites"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.CaseManagementApi.listUserCaseProjectFavorites", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Update case project. + * + *

See {@link #moveCaseToProjectWithHttpInfo}. + * + * @param caseId Case's UUID or key (required) + * @param body Project update request (required) + * @return CaseResponse + * @throws ApiException if fails to make API call + */ + public CaseResponse moveCaseToProject(String caseId, ProjectRelationship body) + throws ApiException { + return moveCaseToProjectWithHttpInfo(caseId, body).getData(); + } + + /** + * Update case project. + * + *

See {@link #moveCaseToProjectWithHttpInfoAsync}. + * + * @param caseId Case's UUID or key (required) + * @param body Project update request (required) + * @return CompletableFuture<CaseResponse> + */ + public CompletableFuture moveCaseToProjectAsync( + String caseId, ProjectRelationship body) { + return moveCaseToProjectWithHttpInfoAsync(caseId, body) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Update the project associated with a case + * + * @param caseId Case's UUID or key (required) + * @param body Project update request (required) + * @return ApiResponse<CaseResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
404 Not Found -
429 Too many requests -
+ */ + public ApiResponse moveCaseToProjectWithHttpInfo( + String caseId, ProjectRelationship body) throws ApiException { + // Check if unstable operation is enabled + String operationId = "moveCaseToProject"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = body; + + // verify the required parameter 'caseId' is set + if (caseId == null) { + throw new ApiException( + 400, "Missing the required parameter 'caseId' when calling moveCaseToProject"); + } + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException( + 400, "Missing the required parameter 'body' when calling moveCaseToProject"); + } + // create path and map variables + String localVarPath = + "/api/v2/cases/{case_id}/relationships/project" + .replaceAll("\\{" + "case_id" + "\\}", apiClient.escapeString(caseId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.CaseManagementApi.moveCaseToProject", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + return apiClient.invokeAPI( + "PATCH", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Update case project. + * + *

See {@link #moveCaseToProjectWithHttpInfo}. + * + * @param caseId Case's UUID or key (required) + * @param body Project update request (required) + * @return CompletableFuture<ApiResponse<CaseResponse>> + */ + public CompletableFuture> moveCaseToProjectWithHttpInfoAsync( + String caseId, ProjectRelationship body) { + // Check if unstable operation is enabled + String operationId = "moveCaseToProject"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = body; + + // verify the required parameter 'caseId' is set + if (caseId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'caseId' when calling moveCaseToProject")); + return result; + } + + // verify the required parameter 'body' is set + if (body == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'body' when calling moveCaseToProject")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/cases/{case_id}/relationships/project" + .replaceAll("\\{" + "case_id" + "\\}", apiClient.escapeString(caseId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.CaseManagementApi.moveCaseToProject", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "PATCH", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Remove insights from a case. + * + *

See {@link #removeCaseInsightsWithHttpInfo}. + * + * @param caseId Case's UUID or key (required) + * @param body Case insights request. (required) + * @return CaseResponse + * @throws ApiException if fails to make API call + */ + public CaseResponse removeCaseInsights(String caseId, CaseInsightsRequest body) + throws ApiException { + return removeCaseInsightsWithHttpInfo(caseId, body).getData(); + } + + /** + * Remove insights from a case. + * + *

See {@link #removeCaseInsightsWithHttpInfoAsync}. + * + * @param caseId Case's UUID or key (required) + * @param body Case insights request. (required) + * @return CompletableFuture<CaseResponse> + */ + public CompletableFuture removeCaseInsightsAsync( + String caseId, CaseInsightsRequest body) { + return removeCaseInsightsWithHttpInfoAsync(caseId, body) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Removes one or more previously added insights from a case by specifying their type and resource + * identifier in the request body. + * + * @param caseId Case's UUID or key (required) + * @param body Case insights request. (required) + * @return ApiResponse<CaseResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
404 Not Found -
429 Too many requests -
+ */ + public ApiResponse removeCaseInsightsWithHttpInfo( + String caseId, CaseInsightsRequest body) throws ApiException { + // Check if unstable operation is enabled + String operationId = "removeCaseInsights"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = body; + + // verify the required parameter 'caseId' is set + if (caseId == null) { + throw new ApiException( + 400, "Missing the required parameter 'caseId' when calling removeCaseInsights"); + } + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException( + 400, "Missing the required parameter 'body' when calling removeCaseInsights"); + } + // create path and map variables + String localVarPath = + "/api/v2/cases/{case_id}/insights" + .replaceAll("\\{" + "case_id" + "\\}", apiClient.escapeString(caseId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.CaseManagementApi.removeCaseInsights", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + return apiClient.invokeAPI( + "DELETE", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Remove insights from a case. + * + *

See {@link #removeCaseInsightsWithHttpInfo}. + * + * @param caseId Case's UUID or key (required) + * @param body Case insights request. (required) + * @return CompletableFuture<ApiResponse<CaseResponse>> + */ + public CompletableFuture> removeCaseInsightsWithHttpInfoAsync( + String caseId, CaseInsightsRequest body) { + // Check if unstable operation is enabled + String operationId = "removeCaseInsights"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = body; + + // verify the required parameter 'caseId' is set + if (caseId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'caseId' when calling removeCaseInsights")); + return result; + } + + // verify the required parameter 'body' is set + if (body == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'body' when calling removeCaseInsights")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/cases/{case_id}/insights" + .replaceAll("\\{" + "case_id" + "\\}", apiClient.escapeString(caseId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.CaseManagementApi.removeCaseInsights", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "DELETE", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** Manage optional parameters to searchCases. */ + public static class SearchCasesOptionalParameters { + private Long pageSize; + private Long pageNumber; + private CaseSortableField sortField; + private String filter; + private Boolean sortAsc; + + /** + * Set pageSize. + * + * @param pageSize Size for a given page. The maximum allowed value is 100. (optional, default + * to 10) + * @return SearchCasesOptionalParameters + */ + public SearchCasesOptionalParameters pageSize(Long pageSize) { + this.pageSize = pageSize; + return this; + } + + /** + * Set pageNumber. + * + * @param pageNumber Specific page number to return. (optional, default to 0) + * @return SearchCasesOptionalParameters + */ + public SearchCasesOptionalParameters pageNumber(Long pageNumber) { + this.pageNumber = pageNumber; + return this; + } + + /** + * Set sortField. + * + * @param sortField Specify which field to sort (optional) + * @return SearchCasesOptionalParameters + */ + public SearchCasesOptionalParameters sortField(CaseSortableField sortField) { + this.sortField = sortField; + return this; + } + + /** + * Set filter. + * + * @param filter Search query (optional) + * @return SearchCasesOptionalParameters + */ + public SearchCasesOptionalParameters filter(String filter) { + this.filter = filter; + return this; + } + + /** + * Set sortAsc. + * + * @param sortAsc Specify if order is ascending or not (optional, default to false) + * @return SearchCasesOptionalParameters + */ + public SearchCasesOptionalParameters sortAsc(Boolean sortAsc) { + this.sortAsc = sortAsc; + return this; + } + } + + /** + * Search cases. + * + *

See {@link #searchCasesWithHttpInfo}. + * + * @return CasesResponse + * @throws ApiException if fails to make API call + */ + public CasesResponse searchCases() throws ApiException { + return searchCasesWithHttpInfo(new SearchCasesOptionalParameters()).getData(); + } + + /** + * Search cases. + * + *

See {@link #searchCasesWithHttpInfoAsync}. + * + * @return CompletableFuture<CasesResponse> + */ + public CompletableFuture searchCasesAsync() { + return searchCasesWithHttpInfoAsync(new SearchCasesOptionalParameters()) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Search cases. + * + *

See {@link #searchCasesWithHttpInfo}. + * + * @param parameters Optional parameters for the request. + * @return CasesResponse + * @throws ApiException if fails to make API call + */ + public CasesResponse searchCases(SearchCasesOptionalParameters parameters) throws ApiException { + return searchCasesWithHttpInfo(parameters).getData(); + } + + /** + * Search cases. + * + *

See {@link #searchCasesWithHttpInfoAsync}. + * + * @param parameters Optional parameters for the request. + * @return CompletableFuture<CasesResponse> + */ + public CompletableFuture searchCasesAsync( + SearchCasesOptionalParameters parameters) { + return searchCasesWithHttpInfoAsync(parameters) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Search cases. + * + *

See {@link #searchCasesWithHttpInfo}. + * + * @return PaginationIterable<Case> + */ + public PaginationIterable searchCasesWithPagination() { + SearchCasesOptionalParameters parameters = new SearchCasesOptionalParameters(); + return searchCasesWithPagination(parameters); + } + + /** + * Search cases. + * + *

See {@link #searchCasesWithHttpInfo}. + * + * @return CasesResponse + */ + public PaginationIterable searchCasesWithPagination( + SearchCasesOptionalParameters parameters) { + String resultsPath = "getData"; + String valueGetterPath = ""; + String valueSetterPath = "pageNumber"; + Boolean valueSetterParamOptional = true; + parameters.pageNumber(1l); + Long limit; + + if (parameters.pageSize == null) { + limit = 10l; + parameters.pageSize(limit); + } else { + limit = parameters.pageSize; } LinkedHashMap args = new LinkedHashMap(); args.put("optionalParams", parameters); - PaginationIterable iterator = - new PaginationIterable( - this, - "searchCases", - resultsPath, - valueGetterPath, - valueSetterPath, - valueSetterParamOptional, - false, - false, - limit, - args, - 1); + PaginationIterable iterator = + new PaginationIterable( + this, + "searchCases", + resultsPath, + valueGetterPath, + valueSetterPath, + valueSetterParamOptional, + false, + false, + limit, + args, + 1); + + return iterator; + } + + /** + * Search cases. + * + * @param parameters Optional parameters for the request. + * @return ApiResponse<CasesResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
404 Not Found -
429 Too many requests -
+ */ + public ApiResponse searchCasesWithHttpInfo( + SearchCasesOptionalParameters parameters) throws ApiException { + Object localVarPostBody = null; + Long pageSize = parameters.pageSize; + Long pageNumber = parameters.pageNumber; + CaseSortableField sortField = parameters.sortField; + String filter = parameters.filter; + Boolean sortAsc = parameters.sortAsc; + // create path and map variables + String localVarPath = "/api/v2/cases"; + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[size]", pageSize)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[number]", pageNumber)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "sort[field]", sortField)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter", filter)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "sort[asc]", sortAsc)); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.CaseManagementApi.searchCases", + localVarPath, + localVarQueryParams, + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + return apiClient.invokeAPI( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Search cases. + * + *

See {@link #searchCasesWithHttpInfo}. + * + * @param parameters Optional parameters for the request. + * @return CompletableFuture<ApiResponse<CasesResponse>> + */ + public CompletableFuture> searchCasesWithHttpInfoAsync( + SearchCasesOptionalParameters parameters) { + Object localVarPostBody = null; + Long pageSize = parameters.pageSize; + Long pageNumber = parameters.pageNumber; + CaseSortableField sortField = parameters.sortField; + String filter = parameters.filter; + Boolean sortAsc = parameters.sortAsc; + // create path and map variables + String localVarPath = "/api/v2/cases"; + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[size]", pageSize)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[number]", pageNumber)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "sort[field]", sortField)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter", filter)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "sort[asc]", sortAsc)); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.CaseManagementApi.searchCases", + localVarPath, + localVarQueryParams, + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Unarchive case. + * + *

See {@link #unarchiveCaseWithHttpInfo}. + * + * @param caseId Case's UUID or key (required) + * @param body Unarchive case payload (required) + * @return CaseResponse + * @throws ApiException if fails to make API call + */ + public CaseResponse unarchiveCase(String caseId, CaseEmptyRequest body) throws ApiException { + return unarchiveCaseWithHttpInfo(caseId, body).getData(); + } + + /** + * Unarchive case. + * + *

See {@link #unarchiveCaseWithHttpInfoAsync}. + * + * @param caseId Case's UUID or key (required) + * @param body Unarchive case payload (required) + * @return CompletableFuture<CaseResponse> + */ + public CompletableFuture unarchiveCaseAsync(String caseId, CaseEmptyRequest body) { + return unarchiveCaseWithHttpInfoAsync(caseId, body) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Unarchive case + * + * @param caseId Case's UUID or key (required) + * @param body Unarchive case payload (required) + * @return ApiResponse<CaseResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
404 Not Found -
429 Too many requests -
+ */ + public ApiResponse unarchiveCaseWithHttpInfo(String caseId, CaseEmptyRequest body) + throws ApiException { + Object localVarPostBody = body; + + // verify the required parameter 'caseId' is set + if (caseId == null) { + throw new ApiException( + 400, "Missing the required parameter 'caseId' when calling unarchiveCase"); + } + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException( + 400, "Missing the required parameter 'body' when calling unarchiveCase"); + } + // create path and map variables + String localVarPath = + "/api/v2/cases/{case_id}/unarchive" + .replaceAll("\\{" + "case_id" + "\\}", apiClient.escapeString(caseId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.CaseManagementApi.unarchiveCase", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + return apiClient.invokeAPI( + "POST", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Unarchive case. + * + *

See {@link #unarchiveCaseWithHttpInfo}. + * + * @param caseId Case's UUID or key (required) + * @param body Unarchive case payload (required) + * @return CompletableFuture<ApiResponse<CaseResponse>> + */ + public CompletableFuture> unarchiveCaseWithHttpInfoAsync( + String caseId, CaseEmptyRequest body) { + Object localVarPostBody = body; + + // verify the required parameter 'caseId' is set + if (caseId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'caseId' when calling unarchiveCase")); + return result; + } + + // verify the required parameter 'body' is set + if (body == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'body' when calling unarchiveCase")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/cases/{case_id}/unarchive" + .replaceAll("\\{" + "case_id" + "\\}", apiClient.escapeString(caseId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.CaseManagementApi.unarchiveCase", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "POST", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Unassign case. + * + *

See {@link #unassignCaseWithHttpInfo}. + * + * @param caseId Case's UUID or key (required) + * @param body Unassign case payload (required) + * @return CaseResponse + * @throws ApiException if fails to make API call + */ + public CaseResponse unassignCase(String caseId, CaseEmptyRequest body) throws ApiException { + return unassignCaseWithHttpInfo(caseId, body).getData(); + } + + /** + * Unassign case. + * + *

See {@link #unassignCaseWithHttpInfoAsync}. + * + * @param caseId Case's UUID or key (required) + * @param body Unassign case payload (required) + * @return CompletableFuture<CaseResponse> + */ + public CompletableFuture unassignCaseAsync(String caseId, CaseEmptyRequest body) { + return unassignCaseWithHttpInfoAsync(caseId, body) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Unassign case + * + * @param caseId Case's UUID or key (required) + * @param body Unassign case payload (required) + * @return ApiResponse<CaseResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
404 Not Found -
429 Too many requests -
+ */ + public ApiResponse unassignCaseWithHttpInfo(String caseId, CaseEmptyRequest body) + throws ApiException { + Object localVarPostBody = body; + + // verify the required parameter 'caseId' is set + if (caseId == null) { + throw new ApiException( + 400, "Missing the required parameter 'caseId' when calling unassignCase"); + } + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException( + 400, "Missing the required parameter 'body' when calling unassignCase"); + } + // create path and map variables + String localVarPath = + "/api/v2/cases/{case_id}/unassign" + .replaceAll("\\{" + "case_id" + "\\}", apiClient.escapeString(caseId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.CaseManagementApi.unassignCase", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + return apiClient.invokeAPI( + "POST", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Unassign case. + * + *

See {@link #unassignCaseWithHttpInfo}. + * + * @param caseId Case's UUID or key (required) + * @param body Unassign case payload (required) + * @return CompletableFuture<ApiResponse<CaseResponse>> + */ + public CompletableFuture> unassignCaseWithHttpInfoAsync( + String caseId, CaseEmptyRequest body) { + Object localVarPostBody = body; + + // verify the required parameter 'caseId' is set + if (caseId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'caseId' when calling unassignCase")); + return result; + } + + // verify the required parameter 'body' is set + if (body == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(400, "Missing the required parameter 'body' when calling unassignCase")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/cases/{case_id}/unassign" + .replaceAll("\\{" + "case_id" + "\\}", apiClient.escapeString(caseId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.CaseManagementApi.unassignCase", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "POST", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Unfavorite a project. + * + *

See {@link #unfavoriteCaseProjectWithHttpInfo}. + * + * @param projectId Project UUID. (required) + * @throws ApiException if fails to make API call + */ + public void unfavoriteCaseProject(String projectId) throws ApiException { + unfavoriteCaseProjectWithHttpInfo(projectId); + } + + /** + * Unfavorite a project. + * + *

See {@link #unfavoriteCaseProjectWithHttpInfoAsync}. + * + * @param projectId Project UUID. (required) + * @return CompletableFuture + */ + public CompletableFuture unfavoriteCaseProjectAsync(String projectId) { + return unfavoriteCaseProjectWithHttpInfoAsync(projectId) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Removes a case project from the current user's favorites list. + * + * @param projectId Project UUID. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
204 No Content -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
404 Not Found -
429 Too many requests -
+ */ + public ApiResponse unfavoriteCaseProjectWithHttpInfo(String projectId) throws ApiException { + // Check if unstable operation is enabled + String operationId = "unfavoriteCaseProject"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = null; + + // verify the required parameter 'projectId' is set + if (projectId == null) { + throw new ApiException( + 400, "Missing the required parameter 'projectId' when calling unfavoriteCaseProject"); + } + // create path and map variables + String localVarPath = + "/api/v2/cases/projects/{project_id}/favorites" + .replaceAll("\\{" + "project_id" + "\\}", apiClient.escapeString(projectId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.CaseManagementApi.unfavoriteCaseProject", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"*/*"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + return apiClient.invokeAPI( + "DELETE", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + null); + } + + /** + * Unfavorite a project. + * + *

See {@link #unfavoriteCaseProjectWithHttpInfo}. + * + * @param projectId Project UUID. (required) + * @return CompletableFuture<ApiResponse<Void>> + */ + public CompletableFuture> unfavoriteCaseProjectWithHttpInfoAsync( + String projectId) { + // Check if unstable operation is enabled + String operationId = "unfavoriteCaseProject"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = null; + + // verify the required parameter 'projectId' is set + if (projectId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'projectId' when calling unfavoriteCaseProject")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/cases/projects/{project_id}/favorites" + .replaceAll("\\{" + "project_id" + "\\}", apiClient.escapeString(projectId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.CaseManagementApi.unfavoriteCaseProject", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"*/*"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "DELETE", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + null); + } + + /** + * Remove Jira issue link from case. + * + *

See {@link #unlinkJiraIssueWithHttpInfo}. + * + * @param caseId Case's UUID or key (required) + * @throws ApiException if fails to make API call + */ + public void unlinkJiraIssue(String caseId) throws ApiException { + unlinkJiraIssueWithHttpInfo(caseId); + } + + /** + * Remove Jira issue link from case. + * + *

See {@link #unlinkJiraIssueWithHttpInfoAsync}. + * + * @param caseId Case's UUID or key (required) + * @return CompletableFuture + */ + public CompletableFuture unlinkJiraIssueAsync(String caseId) { + return unlinkJiraIssueWithHttpInfoAsync(caseId) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Remove the link between a Jira issue and a case + * + * @param caseId Case's UUID or key (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
204 No Content -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
404 Not Found -
429 Too many requests -
+ */ + public ApiResponse unlinkJiraIssueWithHttpInfo(String caseId) throws ApiException { + // Check if unstable operation is enabled + String operationId = "unlinkJiraIssue"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = null; + + // verify the required parameter 'caseId' is set + if (caseId == null) { + throw new ApiException( + 400, "Missing the required parameter 'caseId' when calling unlinkJiraIssue"); + } + // create path and map variables + String localVarPath = + "/api/v2/cases/{case_id}/relationships/jira_issues" + .replaceAll("\\{" + "case_id" + "\\}", apiClient.escapeString(caseId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.CaseManagementApi.unlinkJiraIssue", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"*/*"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + return apiClient.invokeAPI( + "DELETE", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + null); + } + + /** + * Remove Jira issue link from case. + * + *

See {@link #unlinkJiraIssueWithHttpInfo}. + * + * @param caseId Case's UUID or key (required) + * @return CompletableFuture<ApiResponse<Void>> + */ + public CompletableFuture> unlinkJiraIssueWithHttpInfoAsync(String caseId) { + // Check if unstable operation is enabled + String operationId = "unlinkJiraIssue"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = null; + + // verify the required parameter 'caseId' is set + if (caseId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'caseId' when calling unlinkJiraIssue")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/cases/{case_id}/relationships/jira_issues" + .replaceAll("\\{" + "case_id" + "\\}", apiClient.escapeString(caseId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.CaseManagementApi.unlinkJiraIssue", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"*/*"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "DELETE", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + null); + } + + /** + * Unwatch a case. + * + *

See {@link #unwatchCaseWithHttpInfo}. + * + * @param caseId Case's UUID or key (required) + * @param userUuid The UUID of the user to add or remove as a watcher. (required) + * @throws ApiException if fails to make API call + */ + public void unwatchCase(String caseId, String userUuid) throws ApiException { + unwatchCaseWithHttpInfo(caseId, userUuid); + } + + /** + * Unwatch a case. + * + *

See {@link #unwatchCaseWithHttpInfoAsync}. + * + * @param caseId Case's UUID or key (required) + * @param userUuid The UUID of the user to add or remove as a watcher. (required) + * @return CompletableFuture + */ + public CompletableFuture unwatchCaseAsync(String caseId, String userUuid) { + return unwatchCaseWithHttpInfoAsync(caseId, userUuid) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Removes a user from the watchers list of a case. The user no longer receives notifications + * about updates to the case. + * + * @param caseId Case's UUID or key (required) + * @param userUuid The UUID of the user to add or remove as a watcher. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
204 No Content -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
404 Not Found -
429 Too many requests -
+ */ + public ApiResponse unwatchCaseWithHttpInfo(String caseId, String userUuid) + throws ApiException { + // Check if unstable operation is enabled + String operationId = "unwatchCase"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = null; + + // verify the required parameter 'caseId' is set + if (caseId == null) { + throw new ApiException( + 400, "Missing the required parameter 'caseId' when calling unwatchCase"); + } + + // verify the required parameter 'userUuid' is set + if (userUuid == null) { + throw new ApiException( + 400, "Missing the required parameter 'userUuid' when calling unwatchCase"); + } + // create path and map variables + String localVarPath = + "/api/v2/cases/{case_id}/watchers/{user_uuid}" + .replaceAll("\\{" + "case_id" + "\\}", apiClient.escapeString(caseId.toString())) + .replaceAll("\\{" + "user_uuid" + "\\}", apiClient.escapeString(userUuid.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.CaseManagementApi.unwatchCase", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"*/*"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + return apiClient.invokeAPI( + "DELETE", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + null); + } + + /** + * Unwatch a case. + * + *

See {@link #unwatchCaseWithHttpInfo}. + * + * @param caseId Case's UUID or key (required) + * @param userUuid The UUID of the user to add or remove as a watcher. (required) + * @return CompletableFuture<ApiResponse<Void>> + */ + public CompletableFuture> unwatchCaseWithHttpInfoAsync( + String caseId, String userUuid) { + // Check if unstable operation is enabled + String operationId = "unwatchCase"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = null; + + // verify the required parameter 'caseId' is set + if (caseId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'caseId' when calling unwatchCase")); + return result; + } + + // verify the required parameter 'userUuid' is set + if (userUuid == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'userUuid' when calling unwatchCase")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/cases/{case_id}/watchers/{user_uuid}" + .replaceAll("\\{" + "case_id" + "\\}", apiClient.escapeString(caseId.toString())) + .replaceAll("\\{" + "user_uuid" + "\\}", apiClient.escapeString(userUuid.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.CaseManagementApi.unwatchCase", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"*/*"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "DELETE", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + null); + } + + /** + * Update case attributes. + * + *

See {@link #updateAttributesWithHttpInfo}. + * + * @param caseId Case's UUID or key (required) + * @param body Case attributes update payload (required) + * @return CaseResponse + * @throws ApiException if fails to make API call + */ + public CaseResponse updateAttributes(String caseId, CaseUpdateAttributesRequest body) + throws ApiException { + return updateAttributesWithHttpInfo(caseId, body).getData(); + } + + /** + * Update case attributes. + * + *

See {@link #updateAttributesWithHttpInfoAsync}. + * + * @param caseId Case's UUID or key (required) + * @param body Case attributes update payload (required) + * @return CompletableFuture<CaseResponse> + */ + public CompletableFuture updateAttributesAsync( + String caseId, CaseUpdateAttributesRequest body) { + return updateAttributesWithHttpInfoAsync(caseId, body) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Update case attributes + * + * @param caseId Case's UUID or key (required) + * @param body Case attributes update payload (required) + * @return ApiResponse<CaseResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
404 Not Found -
429 Too many requests -
+ */ + public ApiResponse updateAttributesWithHttpInfo( + String caseId, CaseUpdateAttributesRequest body) throws ApiException { + Object localVarPostBody = body; + + // verify the required parameter 'caseId' is set + if (caseId == null) { + throw new ApiException( + 400, "Missing the required parameter 'caseId' when calling updateAttributes"); + } + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException( + 400, "Missing the required parameter 'body' when calling updateAttributes"); + } + // create path and map variables + String localVarPath = + "/api/v2/cases/{case_id}/attributes" + .replaceAll("\\{" + "case_id" + "\\}", apiClient.escapeString(caseId.toString())); + + Map localVarHeaderParams = new HashMap(); - return iterator; + Invocation.Builder builder = + apiClient.createBuilder( + "v2.CaseManagementApi.updateAttributes", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + return apiClient.invokeAPI( + "POST", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Update case attributes. + * + *

See {@link #updateAttributesWithHttpInfo}. + * + * @param caseId Case's UUID or key (required) + * @param body Case attributes update payload (required) + * @return CompletableFuture<ApiResponse<CaseResponse>> + */ + public CompletableFuture> updateAttributesWithHttpInfoAsync( + String caseId, CaseUpdateAttributesRequest body) { + Object localVarPostBody = body; + + // verify the required parameter 'caseId' is set + if (caseId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'caseId' when calling updateAttributes")); + return result; + } + + // verify the required parameter 'body' is set + if (body == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'body' when calling updateAttributes")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/cases/{case_id}/attributes" + .replaceAll("\\{" + "case_id" + "\\}", apiClient.escapeString(caseId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.CaseManagementApi.updateAttributes", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "POST", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Update an automation rule. + * + *

See {@link #updateCaseAutomationRuleWithHttpInfo}. + * + * @param projectId The UUID of the project that owns the automation rules. (required) + * @param ruleId The UUID of the automation rule. (required) + * @param body Automation rule payload. (required) + * @return AutomationRuleResponse + * @throws ApiException if fails to make API call + */ + public AutomationRuleResponse updateCaseAutomationRule( + String projectId, String ruleId, AutomationRuleUpdateRequest body) throws ApiException { + return updateCaseAutomationRuleWithHttpInfo(projectId, ruleId, body).getData(); + } + + /** + * Update an automation rule. + * + *

See {@link #updateCaseAutomationRuleWithHttpInfoAsync}. + * + * @param projectId The UUID of the project that owns the automation rules. (required) + * @param ruleId The UUID of the automation rule. (required) + * @param body Automation rule payload. (required) + * @return CompletableFuture<AutomationRuleResponse> + */ + public CompletableFuture updateCaseAutomationRuleAsync( + String projectId, String ruleId, AutomationRuleUpdateRequest body) { + return updateCaseAutomationRuleWithHttpInfoAsync(projectId, ruleId, body) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Updates the trigger, action, name, or state of an existing automation rule. + * + * @param projectId The UUID of the project that owns the automation rules. (required) + * @param ruleId The UUID of the automation rule. (required) + * @param body Automation rule payload. (required) + * @return ApiResponse<AutomationRuleResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
404 Not Found -
429 Too many requests -
+ */ + public ApiResponse updateCaseAutomationRuleWithHttpInfo( + String projectId, String ruleId, AutomationRuleUpdateRequest body) throws ApiException { + // Check if unstable operation is enabled + String operationId = "updateCaseAutomationRule"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = body; + + // verify the required parameter 'projectId' is set + if (projectId == null) { + throw new ApiException( + 400, "Missing the required parameter 'projectId' when calling updateCaseAutomationRule"); + } + + // verify the required parameter 'ruleId' is set + if (ruleId == null) { + throw new ApiException( + 400, "Missing the required parameter 'ruleId' when calling updateCaseAutomationRule"); + } + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException( + 400, "Missing the required parameter 'body' when calling updateCaseAutomationRule"); + } + // create path and map variables + String localVarPath = + "/api/v2/cases/projects/{project_id}/rules/{rule_id}" + .replaceAll("\\{" + "project_id" + "\\}", apiClient.escapeString(projectId.toString())) + .replaceAll("\\{" + "rule_id" + "\\}", apiClient.escapeString(ruleId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.CaseManagementApi.updateCaseAutomationRule", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + return apiClient.invokeAPI( + "PUT", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Update an automation rule. + * + *

See {@link #updateCaseAutomationRuleWithHttpInfo}. + * + * @param projectId The UUID of the project that owns the automation rules. (required) + * @param ruleId The UUID of the automation rule. (required) + * @param body Automation rule payload. (required) + * @return CompletableFuture<ApiResponse<AutomationRuleResponse>> + */ + public CompletableFuture> + updateCaseAutomationRuleWithHttpInfoAsync( + String projectId, String ruleId, AutomationRuleUpdateRequest body) { + // Check if unstable operation is enabled + String operationId = "updateCaseAutomationRule"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = body; + + // verify the required parameter 'projectId' is set + if (projectId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'projectId' when calling updateCaseAutomationRule")); + return result; + } + + // verify the required parameter 'ruleId' is set + if (ruleId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'ruleId' when calling updateCaseAutomationRule")); + return result; + } + + // verify the required parameter 'body' is set + if (body == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'body' when calling updateCaseAutomationRule")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/cases/projects/{project_id}/rules/{rule_id}" + .replaceAll("\\{" + "project_id" + "\\}", apiClient.escapeString(projectId.toString())) + .replaceAll("\\{" + "rule_id" + "\\}", apiClient.escapeString(ruleId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.CaseManagementApi.updateCaseAutomationRule", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "PUT", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Update case comment. + * + *

See {@link #updateCaseCommentWithHttpInfo}. + * + * @param caseId Case's UUID or key (required) + * @param cellId The UUID of the timeline cell (comment) to update. (required) + * @param body Case update comment payload. (required) + * @throws ApiException if fails to make API call + */ + public void updateCaseComment(String caseId, String cellId, CaseUpdateCommentRequest body) + throws ApiException { + updateCaseCommentWithHttpInfo(caseId, cellId, body); + } + + /** + * Update case comment. + * + *

See {@link #updateCaseCommentWithHttpInfoAsync}. + * + * @param caseId Case's UUID or key (required) + * @param cellId The UUID of the timeline cell (comment) to update. (required) + * @param body Case update comment payload. (required) + * @return CompletableFuture + */ + public CompletableFuture updateCaseCommentAsync( + String caseId, String cellId, CaseUpdateCommentRequest body) { + return updateCaseCommentWithHttpInfoAsync(caseId, cellId, body) + .thenApply( + response -> { + return response.getData(); + }); } /** - * Search cases. + * Updates the text content of an existing comment on a case timeline. The comment is identified + * by its cell ID. * - * @param parameters Optional parameters for the request. - * @return ApiResponse<CasesResponse> + * @param caseId Case's UUID or key (required) + * @param cellId The UUID of the timeline cell (comment) to update. (required) + * @param body Case update comment payload. (required) + * @return ApiResponse<Void> * @throws ApiException if fails to make API call * @http.response.details * @@ -3356,126 +8895,177 @@ public PaginationIterable searchCasesWithPagination( * *
429 Too many requests -
*/ - public ApiResponse searchCasesWithHttpInfo( - SearchCasesOptionalParameters parameters) throws ApiException { - Object localVarPostBody = null; - Long pageSize = parameters.pageSize; - Long pageNumber = parameters.pageNumber; - CaseSortableField sortField = parameters.sortField; - String filter = parameters.filter; - Boolean sortAsc = parameters.sortAsc; + public ApiResponse updateCaseCommentWithHttpInfo( + String caseId, String cellId, CaseUpdateCommentRequest body) throws ApiException { + // Check if unstable operation is enabled + String operationId = "updateCaseComment"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = body; + + // verify the required parameter 'caseId' is set + if (caseId == null) { + throw new ApiException( + 400, "Missing the required parameter 'caseId' when calling updateCaseComment"); + } + + // verify the required parameter 'cellId' is set + if (cellId == null) { + throw new ApiException( + 400, "Missing the required parameter 'cellId' when calling updateCaseComment"); + } + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException( + 400, "Missing the required parameter 'body' when calling updateCaseComment"); + } // create path and map variables - String localVarPath = "/api/v2/cases"; + String localVarPath = + "/api/v2/cases/{case_id}/comment/{cell_id}" + .replaceAll("\\{" + "case_id" + "\\}", apiClient.escapeString(caseId.toString())) + .replaceAll("\\{" + "cell_id" + "\\}", apiClient.escapeString(cellId.toString())); - List localVarQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[size]", pageSize)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[number]", pageNumber)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "sort[field]", sortField)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter", filter)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "sort[asc]", sortAsc)); - Invocation.Builder builder = apiClient.createBuilder( - "v2.CaseManagementApi.searchCases", + "v2.CaseManagementApi.updateCaseComment", localVarPath, - localVarQueryParams, + new ArrayList(), localVarHeaderParams, new HashMap(), - new String[] {"application/json"}, + new String[] {"*/*"}, new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); return apiClient.invokeAPI( - "GET", + "PUT", builder, localVarHeaderParams, - new String[] {}, + new String[] {"application/json"}, localVarPostBody, new HashMap(), false, - new GenericType() {}); + null); } /** - * Search cases. + * Update case comment. * - *

See {@link #searchCasesWithHttpInfo}. + *

See {@link #updateCaseCommentWithHttpInfo}. * - * @param parameters Optional parameters for the request. - * @return CompletableFuture<ApiResponse<CasesResponse>> + * @param caseId Case's UUID or key (required) + * @param cellId The UUID of the timeline cell (comment) to update. (required) + * @param body Case update comment payload. (required) + * @return CompletableFuture<ApiResponse<Void>> */ - public CompletableFuture> searchCasesWithHttpInfoAsync( - SearchCasesOptionalParameters parameters) { - Object localVarPostBody = null; - Long pageSize = parameters.pageSize; - Long pageNumber = parameters.pageNumber; - CaseSortableField sortField = parameters.sortField; - String filter = parameters.filter; - Boolean sortAsc = parameters.sortAsc; + public CompletableFuture> updateCaseCommentWithHttpInfoAsync( + String caseId, String cellId, CaseUpdateCommentRequest body) { + // Check if unstable operation is enabled + String operationId = "updateCaseComment"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = body; + + // verify the required parameter 'caseId' is set + if (caseId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'caseId' when calling updateCaseComment")); + return result; + } + + // verify the required parameter 'cellId' is set + if (cellId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'cellId' when calling updateCaseComment")); + return result; + } + + // verify the required parameter 'body' is set + if (body == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'body' when calling updateCaseComment")); + return result; + } // create path and map variables - String localVarPath = "/api/v2/cases"; + String localVarPath = + "/api/v2/cases/{case_id}/comment/{cell_id}" + .replaceAll("\\{" + "case_id" + "\\}", apiClient.escapeString(caseId.toString())) + .replaceAll("\\{" + "cell_id" + "\\}", apiClient.escapeString(cellId.toString())); - List localVarQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[size]", pageSize)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[number]", pageNumber)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "sort[field]", sortField)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter", filter)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "sort[asc]", sortAsc)); - Invocation.Builder builder; try { builder = apiClient.createBuilder( - "v2.CaseManagementApi.searchCases", + "v2.CaseManagementApi.updateCaseComment", localVarPath, - localVarQueryParams, + new ArrayList(), localVarHeaderParams, new HashMap(), - new String[] {"application/json"}, + new String[] {"*/*"}, new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); } catch (ApiException ex) { - CompletableFuture> result = new CompletableFuture<>(); + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally(ex); return result; } return apiClient.invokeAPIAsync( - "GET", + "PUT", builder, localVarHeaderParams, - new String[] {}, + new String[] {"application/json"}, localVarPostBody, new HashMap(), false, - new GenericType() {}); + null); } /** - * Unarchive case. + * Update case custom attribute. * - *

See {@link #unarchiveCaseWithHttpInfo}. + *

See {@link #updateCaseCustomAttributeWithHttpInfo}. * * @param caseId Case's UUID or key (required) - * @param body Unarchive case payload (required) + * @param customAttributeKey Case Custom attribute's key (required) + * @param body Update case custom attribute payload (required) * @return CaseResponse * @throws ApiException if fails to make API call */ - public CaseResponse unarchiveCase(String caseId, CaseEmptyRequest body) throws ApiException { - return unarchiveCaseWithHttpInfo(caseId, body).getData(); + public CaseResponse updateCaseCustomAttribute( + String caseId, String customAttributeKey, CaseUpdateCustomAttributeRequest body) + throws ApiException { + return updateCaseCustomAttributeWithHttpInfo(caseId, customAttributeKey, body).getData(); } /** - * Unarchive case. + * Update case custom attribute. * - *

See {@link #unarchiveCaseWithHttpInfoAsync}. + *

See {@link #updateCaseCustomAttributeWithHttpInfoAsync}. * * @param caseId Case's UUID or key (required) - * @param body Unarchive case payload (required) + * @param customAttributeKey Case Custom attribute's key (required) + * @param body Update case custom attribute payload (required) * @return CompletableFuture<CaseResponse> */ - public CompletableFuture unarchiveCaseAsync(String caseId, CaseEmptyRequest body) { - return unarchiveCaseWithHttpInfoAsync(caseId, body) + public CompletableFuture updateCaseCustomAttributeAsync( + String caseId, String customAttributeKey, CaseUpdateCustomAttributeRequest body) { + return updateCaseCustomAttributeWithHttpInfoAsync(caseId, customAttributeKey, body) .thenApply( response -> { return response.getData(); @@ -3483,10 +9073,11 @@ public CompletableFuture unarchiveCaseAsync(String caseId, CaseEmp } /** - * Unarchive case + * Update case custom attribute * * @param caseId Case's UUID or key (required) - * @param body Unarchive case payload (required) + * @param customAttributeKey Case Custom attribute's key (required) + * @param body Update case custom attribute payload (required) * @return ApiResponse<CaseResponse> * @throws ApiException if fails to make API call * @http.response.details @@ -3501,31 +9092,43 @@ public CompletableFuture unarchiveCaseAsync(String caseId, CaseEmp * 429 Too many requests - * */ - public ApiResponse unarchiveCaseWithHttpInfo(String caseId, CaseEmptyRequest body) + public ApiResponse updateCaseCustomAttributeWithHttpInfo( + String caseId, String customAttributeKey, CaseUpdateCustomAttributeRequest body) throws ApiException { Object localVarPostBody = body; // verify the required parameter 'caseId' is set if (caseId == null) { throw new ApiException( - 400, "Missing the required parameter 'caseId' when calling unarchiveCase"); + 400, "Missing the required parameter 'caseId' when calling updateCaseCustomAttribute"); + } + + // verify the required parameter 'customAttributeKey' is set + if (customAttributeKey == null) { + throw new ApiException( + 400, + "Missing the required parameter 'customAttributeKey' when calling" + + " updateCaseCustomAttribute"); } // verify the required parameter 'body' is set if (body == null) { throw new ApiException( - 400, "Missing the required parameter 'body' when calling unarchiveCase"); + 400, "Missing the required parameter 'body' when calling updateCaseCustomAttribute"); } // create path and map variables String localVarPath = - "/api/v2/cases/{case_id}/unarchive" - .replaceAll("\\{" + "case_id" + "\\}", apiClient.escapeString(caseId.toString())); + "/api/v2/cases/{case_id}/custom_attributes/{custom_attribute_key}" + .replaceAll("\\{" + "case_id" + "\\}", apiClient.escapeString(caseId.toString())) + .replaceAll( + "\\{" + "custom_attribute_key" + "\\}", + apiClient.escapeString(customAttributeKey.toString())); Map localVarHeaderParams = new HashMap(); Invocation.Builder builder = apiClient.createBuilder( - "v2.CaseManagementApi.unarchiveCase", + "v2.CaseManagementApi.updateCaseCustomAttribute", localVarPath, new ArrayList(), localVarHeaderParams, @@ -3544,16 +9147,17 @@ public ApiResponse unarchiveCaseWithHttpInfo(String caseId, CaseEm } /** - * Unarchive case. + * Update case custom attribute. * - *

See {@link #unarchiveCaseWithHttpInfo}. + *

See {@link #updateCaseCustomAttributeWithHttpInfo}. * * @param caseId Case's UUID or key (required) - * @param body Unarchive case payload (required) + * @param customAttributeKey Case Custom attribute's key (required) + * @param body Update case custom attribute payload (required) * @return CompletableFuture<ApiResponse<CaseResponse>> */ - public CompletableFuture> unarchiveCaseWithHttpInfoAsync( - String caseId, CaseEmptyRequest body) { + public CompletableFuture> updateCaseCustomAttributeWithHttpInfoAsync( + String caseId, String customAttributeKey, CaseUpdateCustomAttributeRequest body) { Object localVarPostBody = body; // verify the required parameter 'caseId' is set @@ -3561,7 +9165,19 @@ public CompletableFuture> unarchiveCaseWithHttpInfoAsy CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( new ApiException( - 400, "Missing the required parameter 'caseId' when calling unarchiveCase")); + 400, + "Missing the required parameter 'caseId' when calling updateCaseCustomAttribute")); + return result; + } + + // verify the required parameter 'customAttributeKey' is set + if (customAttributeKey == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'customAttributeKey' when calling" + + " updateCaseCustomAttribute")); return result; } @@ -3570,13 +9186,16 @@ public CompletableFuture> unarchiveCaseWithHttpInfoAsy CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( new ApiException( - 400, "Missing the required parameter 'body' when calling unarchiveCase")); + 400, "Missing the required parameter 'body' when calling updateCaseCustomAttribute")); return result; } // create path and map variables String localVarPath = - "/api/v2/cases/{case_id}/unarchive" - .replaceAll("\\{" + "case_id" + "\\}", apiClient.escapeString(caseId.toString())); + "/api/v2/cases/{case_id}/custom_attributes/{custom_attribute_key}" + .replaceAll("\\{" + "case_id" + "\\}", apiClient.escapeString(caseId.toString())) + .replaceAll( + "\\{" + "custom_attribute_key" + "\\}", + apiClient.escapeString(customAttributeKey.toString())); Map localVarHeaderParams = new HashMap(); @@ -3584,7 +9203,7 @@ public CompletableFuture> unarchiveCaseWithHttpInfoAsy try { builder = apiClient.createBuilder( - "v2.CaseManagementApi.unarchiveCase", + "v2.CaseManagementApi.updateCaseCustomAttribute", localVarPath, new ArrayList(), localVarHeaderParams, @@ -3608,30 +9227,32 @@ public CompletableFuture> unarchiveCaseWithHttpInfoAsy } /** - * Unassign case. + * Update case description. * - *

See {@link #unassignCaseWithHttpInfo}. + *

See {@link #updateCaseDescriptionWithHttpInfo}. * * @param caseId Case's UUID or key (required) - * @param body Unassign case payload (required) + * @param body Case description update payload (required) * @return CaseResponse * @throws ApiException if fails to make API call */ - public CaseResponse unassignCase(String caseId, CaseEmptyRequest body) throws ApiException { - return unassignCaseWithHttpInfo(caseId, body).getData(); + public CaseResponse updateCaseDescription(String caseId, CaseUpdateDescriptionRequest body) + throws ApiException { + return updateCaseDescriptionWithHttpInfo(caseId, body).getData(); } /** - * Unassign case. + * Update case description. * - *

See {@link #unassignCaseWithHttpInfoAsync}. + *

See {@link #updateCaseDescriptionWithHttpInfoAsync}. * * @param caseId Case's UUID or key (required) - * @param body Unassign case payload (required) + * @param body Case description update payload (required) * @return CompletableFuture<CaseResponse> */ - public CompletableFuture unassignCaseAsync(String caseId, CaseEmptyRequest body) { - return unassignCaseWithHttpInfoAsync(caseId, body) + public CompletableFuture updateCaseDescriptionAsync( + String caseId, CaseUpdateDescriptionRequest body) { + return updateCaseDescriptionWithHttpInfoAsync(caseId, body) .thenApply( response -> { return response.getData(); @@ -3639,10 +9260,10 @@ public CompletableFuture unassignCaseAsync(String caseId, CaseEmpt } /** - * Unassign case + * Update case description * * @param caseId Case's UUID or key (required) - * @param body Unassign case payload (required) + * @param body Case description update payload (required) * @return ApiResponse<CaseResponse> * @throws ApiException if fails to make API call * @http.response.details @@ -3657,31 +9278,31 @@ public CompletableFuture unassignCaseAsync(String caseId, CaseEmpt * 429 Too many requests - * */ - public ApiResponse unassignCaseWithHttpInfo(String caseId, CaseEmptyRequest body) - throws ApiException { + public ApiResponse updateCaseDescriptionWithHttpInfo( + String caseId, CaseUpdateDescriptionRequest body) throws ApiException { Object localVarPostBody = body; // verify the required parameter 'caseId' is set if (caseId == null) { throw new ApiException( - 400, "Missing the required parameter 'caseId' when calling unassignCase"); + 400, "Missing the required parameter 'caseId' when calling updateCaseDescription"); } // verify the required parameter 'body' is set if (body == null) { throw new ApiException( - 400, "Missing the required parameter 'body' when calling unassignCase"); + 400, "Missing the required parameter 'body' when calling updateCaseDescription"); } // create path and map variables String localVarPath = - "/api/v2/cases/{case_id}/unassign" + "/api/v2/cases/{case_id}/description" .replaceAll("\\{" + "case_id" + "\\}", apiClient.escapeString(caseId.toString())); Map localVarHeaderParams = new HashMap(); Invocation.Builder builder = apiClient.createBuilder( - "v2.CaseManagementApi.unassignCase", + "v2.CaseManagementApi.updateCaseDescription", localVarPath, new ArrayList(), localVarHeaderParams, @@ -3700,16 +9321,16 @@ public ApiResponse unassignCaseWithHttpInfo(String caseId, CaseEmp } /** - * Unassign case. + * Update case description. * - *

See {@link #unassignCaseWithHttpInfo}. + *

See {@link #updateCaseDescriptionWithHttpInfo}. * * @param caseId Case's UUID or key (required) - * @param body Unassign case payload (required) + * @param body Case description update payload (required) * @return CompletableFuture<ApiResponse<CaseResponse>> */ - public CompletableFuture> unassignCaseWithHttpInfoAsync( - String caseId, CaseEmptyRequest body) { + public CompletableFuture> updateCaseDescriptionWithHttpInfoAsync( + String caseId, CaseUpdateDescriptionRequest body) { Object localVarPostBody = body; // verify the required parameter 'caseId' is set @@ -3717,7 +9338,7 @@ public CompletableFuture> unassignCaseWithHttpInfoAsyn CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( new ApiException( - 400, "Missing the required parameter 'caseId' when calling unassignCase")); + 400, "Missing the required parameter 'caseId' when calling updateCaseDescription")); return result; } @@ -3725,12 +9346,13 @@ public CompletableFuture> unassignCaseWithHttpInfoAsyn if (body == null) { CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( - new ApiException(400, "Missing the required parameter 'body' when calling unassignCase")); + new ApiException( + 400, "Missing the required parameter 'body' when calling updateCaseDescription")); return result; } // create path and map variables String localVarPath = - "/api/v2/cases/{case_id}/unassign" + "/api/v2/cases/{case_id}/description" .replaceAll("\\{" + "case_id" + "\\}", apiClient.escapeString(caseId.toString())); Map localVarHeaderParams = new HashMap(); @@ -3739,7 +9361,7 @@ public CompletableFuture> unassignCaseWithHttpInfoAsyn try { builder = apiClient.createBuilder( - "v2.CaseManagementApi.unassignCase", + "v2.CaseManagementApi.updateCaseDescription", localVarPath, new ArrayList(), localVarHeaderParams, @@ -3763,27 +9385,32 @@ public CompletableFuture> unassignCaseWithHttpInfoAsyn } /** - * Remove Jira issue link from case. + * Update case due date. * - *

See {@link #unlinkJiraIssueWithHttpInfo}. + *

See {@link #updateCaseDueDateWithHttpInfo}. * * @param caseId Case's UUID or key (required) + * @param body Case due date update payload. (required) + * @return CaseResponse * @throws ApiException if fails to make API call */ - public void unlinkJiraIssue(String caseId) throws ApiException { - unlinkJiraIssueWithHttpInfo(caseId); + public CaseResponse updateCaseDueDate(String caseId, CaseUpdateDueDateRequest body) + throws ApiException { + return updateCaseDueDateWithHttpInfo(caseId, body).getData(); } /** - * Remove Jira issue link from case. + * Update case due date. * - *

See {@link #unlinkJiraIssueWithHttpInfoAsync}. + *

See {@link #updateCaseDueDateWithHttpInfoAsync}. * * @param caseId Case's UUID or key (required) - * @return CompletableFuture + * @param body Case due date update payload. (required) + * @return CompletableFuture<CaseResponse> */ - public CompletableFuture unlinkJiraIssueAsync(String caseId) { - return unlinkJiraIssueWithHttpInfoAsync(caseId) + public CompletableFuture updateCaseDueDateAsync( + String caseId, CaseUpdateDueDateRequest body) { + return updateCaseDueDateWithHttpInfoAsync(caseId, body) .thenApply( response -> { return response.getData(); @@ -3791,16 +9418,18 @@ public CompletableFuture unlinkJiraIssueAsync(String caseId) { } /** - * Remove the link between a Jira issue and a case + * Sets or updates the due date for a case. The due date is a calendar date (without a time + * component) indicating when the case should be resolved. * * @param caseId Case's UUID or key (required) - * @return ApiResponse<Void> + * @param body Case due date update payload. (required) + * @return ApiResponse<CaseResponse> * @throws ApiException if fails to make API call * @http.response.details * * * - * + * * * * @@ -3808,80 +9437,98 @@ public CompletableFuture unlinkJiraIssueAsync(String caseId) { * *
Response details
Status Code Description Response Headers
204 No Content -
200 OK -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
429 Too many requests -
*/ - public ApiResponse unlinkJiraIssueWithHttpInfo(String caseId) throws ApiException { + public ApiResponse updateCaseDueDateWithHttpInfo( + String caseId, CaseUpdateDueDateRequest body) throws ApiException { // Check if unstable operation is enabled - String operationId = "unlinkJiraIssue"; + String operationId = "updateCaseDueDate"; if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); } else { throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); } - Object localVarPostBody = null; + Object localVarPostBody = body; // verify the required parameter 'caseId' is set if (caseId == null) { throw new ApiException( - 400, "Missing the required parameter 'caseId' when calling unlinkJiraIssue"); + 400, "Missing the required parameter 'caseId' when calling updateCaseDueDate"); + } + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException( + 400, "Missing the required parameter 'body' when calling updateCaseDueDate"); } // create path and map variables String localVarPath = - "/api/v2/cases/{case_id}/relationships/jira_issues" + "/api/v2/cases/{case_id}/due_date" .replaceAll("\\{" + "case_id" + "\\}", apiClient.escapeString(caseId.toString())); Map localVarHeaderParams = new HashMap(); Invocation.Builder builder = apiClient.createBuilder( - "v2.CaseManagementApi.unlinkJiraIssue", + "v2.CaseManagementApi.updateCaseDueDate", localVarPath, new ArrayList(), localVarHeaderParams, new HashMap(), - new String[] {"*/*"}, + new String[] {"application/json"}, new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); return apiClient.invokeAPI( - "DELETE", + "POST", builder, localVarHeaderParams, - new String[] {}, + new String[] {"application/json"}, localVarPostBody, new HashMap(), false, - null); + new GenericType() {}); } /** - * Remove Jira issue link from case. + * Update case due date. * - *

See {@link #unlinkJiraIssueWithHttpInfo}. + *

See {@link #updateCaseDueDateWithHttpInfo}. * * @param caseId Case's UUID or key (required) - * @return CompletableFuture<ApiResponse<Void>> + * @param body Case due date update payload. (required) + * @return CompletableFuture<ApiResponse<CaseResponse>> */ - public CompletableFuture> unlinkJiraIssueWithHttpInfoAsync(String caseId) { + public CompletableFuture> updateCaseDueDateWithHttpInfoAsync( + String caseId, CaseUpdateDueDateRequest body) { // Check if unstable operation is enabled - String operationId = "unlinkJiraIssue"; + String operationId = "updateCaseDueDate"; if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); } else { - CompletableFuture> result = new CompletableFuture<>(); + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); return result; } - Object localVarPostBody = null; + Object localVarPostBody = body; // verify the required parameter 'caseId' is set if (caseId == null) { - CompletableFuture> result = new CompletableFuture<>(); + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( new ApiException( - 400, "Missing the required parameter 'caseId' when calling unlinkJiraIssue")); + 400, "Missing the required parameter 'caseId' when calling updateCaseDueDate")); + return result; + } + + // verify the required parameter 'body' is set + if (body == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'body' when calling updateCaseDueDate")); return result; } // create path and map variables String localVarPath = - "/api/v2/cases/{case_id}/relationships/jira_issues" + "/api/v2/cases/{case_id}/due_date" .replaceAll("\\{" + "case_id" + "\\}", apiClient.escapeString(caseId.toString())); Map localVarHeaderParams = new HashMap(); @@ -3890,56 +9537,56 @@ public CompletableFuture> unlinkJiraIssueWithHttpInfoAsync(Str try { builder = apiClient.createBuilder( - "v2.CaseManagementApi.unlinkJiraIssue", + "v2.CaseManagementApi.updateCaseDueDate", localVarPath, new ArrayList(), localVarHeaderParams, new HashMap(), - new String[] {"*/*"}, + new String[] {"application/json"}, new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); } catch (ApiException ex) { - CompletableFuture> result = new CompletableFuture<>(); + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally(ex); return result; } return apiClient.invokeAPIAsync( - "DELETE", + "POST", builder, localVarHeaderParams, - new String[] {}, + new String[] {"application/json"}, localVarPostBody, new HashMap(), false, - null); + new GenericType() {}); } /** - * Update case attributes. + * Update case resolved reason. * - *

See {@link #updateAttributesWithHttpInfo}. + *

See {@link #updateCaseResolvedReasonWithHttpInfo}. * * @param caseId Case's UUID or key (required) - * @param body Case attributes update payload (required) + * @param body Case resolved reason update payload. (required) * @return CaseResponse * @throws ApiException if fails to make API call */ - public CaseResponse updateAttributes(String caseId, CaseUpdateAttributesRequest body) + public CaseResponse updateCaseResolvedReason(String caseId, CaseUpdateResolvedReasonRequest body) throws ApiException { - return updateAttributesWithHttpInfo(caseId, body).getData(); + return updateCaseResolvedReasonWithHttpInfo(caseId, body).getData(); } /** - * Update case attributes. + * Update case resolved reason. * - *

See {@link #updateAttributesWithHttpInfoAsync}. + *

See {@link #updateCaseResolvedReasonWithHttpInfoAsync}. * * @param caseId Case's UUID or key (required) - * @param body Case attributes update payload (required) + * @param body Case resolved reason update payload. (required) * @return CompletableFuture<CaseResponse> */ - public CompletableFuture updateAttributesAsync( - String caseId, CaseUpdateAttributesRequest body) { - return updateAttributesWithHttpInfoAsync(caseId, body) + public CompletableFuture updateCaseResolvedReasonAsync( + String caseId, CaseUpdateResolvedReasonRequest body) { + return updateCaseResolvedReasonWithHttpInfoAsync(caseId, body) .thenApply( response -> { return response.getData(); @@ -3947,10 +9594,11 @@ public CompletableFuture updateAttributesAsync( } /** - * Update case attributes + * Sets the resolved reason for a security case (for example, FALSE_POSITIVE, TRUE_POSITIVE). + * Applicable to security-type cases. * * @param caseId Case's UUID or key (required) - * @param body Case attributes update payload (required) + * @param body Case resolved reason update payload. (required) * @return ApiResponse<CaseResponse> * @throws ApiException if fails to make API call * @http.response.details @@ -3965,31 +9613,38 @@ public CompletableFuture updateAttributesAsync( * 429 Too many requests - * */ - public ApiResponse updateAttributesWithHttpInfo( - String caseId, CaseUpdateAttributesRequest body) throws ApiException { + public ApiResponse updateCaseResolvedReasonWithHttpInfo( + String caseId, CaseUpdateResolvedReasonRequest body) throws ApiException { + // Check if unstable operation is enabled + String operationId = "updateCaseResolvedReason"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } Object localVarPostBody = body; // verify the required parameter 'caseId' is set if (caseId == null) { throw new ApiException( - 400, "Missing the required parameter 'caseId' when calling updateAttributes"); + 400, "Missing the required parameter 'caseId' when calling updateCaseResolvedReason"); } // verify the required parameter 'body' is set if (body == null) { throw new ApiException( - 400, "Missing the required parameter 'body' when calling updateAttributes"); + 400, "Missing the required parameter 'body' when calling updateCaseResolvedReason"); } // create path and map variables String localVarPath = - "/api/v2/cases/{case_id}/attributes" + "/api/v2/cases/{case_id}/resolved_reason" .replaceAll("\\{" + "case_id" + "\\}", apiClient.escapeString(caseId.toString())); Map localVarHeaderParams = new HashMap(); Invocation.Builder builder = apiClient.createBuilder( - "v2.CaseManagementApi.updateAttributes", + "v2.CaseManagementApi.updateCaseResolvedReason", localVarPath, new ArrayList(), localVarHeaderParams, @@ -4008,16 +9663,26 @@ public ApiResponse updateAttributesWithHttpInfo( } /** - * Update case attributes. + * Update case resolved reason. * - *

See {@link #updateAttributesWithHttpInfo}. + *

See {@link #updateCaseResolvedReasonWithHttpInfo}. * * @param caseId Case's UUID or key (required) - * @param body Case attributes update payload (required) + * @param body Case resolved reason update payload. (required) * @return CompletableFuture<ApiResponse<CaseResponse>> */ - public CompletableFuture> updateAttributesWithHttpInfoAsync( - String caseId, CaseUpdateAttributesRequest body) { + public CompletableFuture> updateCaseResolvedReasonWithHttpInfoAsync( + String caseId, CaseUpdateResolvedReasonRequest body) { + // Check if unstable operation is enabled + String operationId = "updateCaseResolvedReason"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } Object localVarPostBody = body; // verify the required parameter 'caseId' is set @@ -4025,7 +9690,8 @@ public CompletableFuture> updateAttributesWithHttpInfo CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( new ApiException( - 400, "Missing the required parameter 'caseId' when calling updateAttributes")); + 400, + "Missing the required parameter 'caseId' when calling updateCaseResolvedReason")); return result; } @@ -4034,12 +9700,12 @@ public CompletableFuture> updateAttributesWithHttpInfo CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( new ApiException( - 400, "Missing the required parameter 'body' when calling updateAttributes")); + 400, "Missing the required parameter 'body' when calling updateCaseResolvedReason")); return result; } // create path and map variables String localVarPath = - "/api/v2/cases/{case_id}/attributes" + "/api/v2/cases/{case_id}/resolved_reason" .replaceAll("\\{" + "case_id" + "\\}", apiClient.escapeString(caseId.toString())); Map localVarHeaderParams = new HashMap(); @@ -4048,7 +9714,7 @@ public CompletableFuture> updateAttributesWithHttpInfo try { builder = apiClient.createBuilder( - "v2.CaseManagementApi.updateAttributes", + "v2.CaseManagementApi.updateCaseResolvedReason", localVarPath, new ArrayList(), localVarHeaderParams, @@ -4072,35 +9738,32 @@ public CompletableFuture> updateAttributesWithHttpInfo } /** - * Update case custom attribute. + * Update case title. * - *

See {@link #updateCaseCustomAttributeWithHttpInfo}. + *

See {@link #updateCaseTitleWithHttpInfo}. * * @param caseId Case's UUID or key (required) - * @param customAttributeKey Case Custom attribute's key (required) - * @param body Update case custom attribute payload (required) + * @param body Case title update payload (required) * @return CaseResponse * @throws ApiException if fails to make API call */ - public CaseResponse updateCaseCustomAttribute( - String caseId, String customAttributeKey, CaseUpdateCustomAttributeRequest body) + public CaseResponse updateCaseTitle(String caseId, CaseUpdateTitleRequest body) throws ApiException { - return updateCaseCustomAttributeWithHttpInfo(caseId, customAttributeKey, body).getData(); + return updateCaseTitleWithHttpInfo(caseId, body).getData(); } /** - * Update case custom attribute. + * Update case title. * - *

See {@link #updateCaseCustomAttributeWithHttpInfoAsync}. + *

See {@link #updateCaseTitleWithHttpInfoAsync}. * * @param caseId Case's UUID or key (required) - * @param customAttributeKey Case Custom attribute's key (required) - * @param body Update case custom attribute payload (required) + * @param body Case title update payload (required) * @return CompletableFuture<CaseResponse> */ - public CompletableFuture updateCaseCustomAttributeAsync( - String caseId, String customAttributeKey, CaseUpdateCustomAttributeRequest body) { - return updateCaseCustomAttributeWithHttpInfoAsync(caseId, customAttributeKey, body) + public CompletableFuture updateCaseTitleAsync( + String caseId, CaseUpdateTitleRequest body) { + return updateCaseTitleWithHttpInfoAsync(caseId, body) .thenApply( response -> { return response.getData(); @@ -4108,11 +9771,10 @@ public CompletableFuture updateCaseCustomAttributeAsync( } /** - * Update case custom attribute + * Update case title * * @param caseId Case's UUID or key (required) - * @param customAttributeKey Case Custom attribute's key (required) - * @param body Update case custom attribute payload (required) + * @param body Case title update payload (required) * @return ApiResponse<CaseResponse> * @throws ApiException if fails to make API call * @http.response.details @@ -4127,43 +9789,31 @@ public CompletableFuture updateCaseCustomAttributeAsync( * 429 Too many requests - * */ - public ApiResponse updateCaseCustomAttributeWithHttpInfo( - String caseId, String customAttributeKey, CaseUpdateCustomAttributeRequest body) - throws ApiException { + public ApiResponse updateCaseTitleWithHttpInfo( + String caseId, CaseUpdateTitleRequest body) throws ApiException { Object localVarPostBody = body; // verify the required parameter 'caseId' is set if (caseId == null) { throw new ApiException( - 400, "Missing the required parameter 'caseId' when calling updateCaseCustomAttribute"); - } - - // verify the required parameter 'customAttributeKey' is set - if (customAttributeKey == null) { - throw new ApiException( - 400, - "Missing the required parameter 'customAttributeKey' when calling" - + " updateCaseCustomAttribute"); + 400, "Missing the required parameter 'caseId' when calling updateCaseTitle"); } // verify the required parameter 'body' is set if (body == null) { throw new ApiException( - 400, "Missing the required parameter 'body' when calling updateCaseCustomAttribute"); + 400, "Missing the required parameter 'body' when calling updateCaseTitle"); } // create path and map variables String localVarPath = - "/api/v2/cases/{case_id}/custom_attributes/{custom_attribute_key}" - .replaceAll("\\{" + "case_id" + "\\}", apiClient.escapeString(caseId.toString())) - .replaceAll( - "\\{" + "custom_attribute_key" + "\\}", - apiClient.escapeString(customAttributeKey.toString())); + "/api/v2/cases/{case_id}/title" + .replaceAll("\\{" + "case_id" + "\\}", apiClient.escapeString(caseId.toString())); Map localVarHeaderParams = new HashMap(); Invocation.Builder builder = apiClient.createBuilder( - "v2.CaseManagementApi.updateCaseCustomAttribute", + "v2.CaseManagementApi.updateCaseTitle", localVarPath, new ArrayList(), localVarHeaderParams, @@ -4182,17 +9832,16 @@ public ApiResponse updateCaseCustomAttributeWithHttpInfo( } /** - * Update case custom attribute. + * Update case title. * - *

See {@link #updateCaseCustomAttributeWithHttpInfo}. + *

See {@link #updateCaseTitleWithHttpInfo}. * * @param caseId Case's UUID or key (required) - * @param customAttributeKey Case Custom attribute's key (required) - * @param body Update case custom attribute payload (required) + * @param body Case title update payload (required) * @return CompletableFuture<ApiResponse<CaseResponse>> */ - public CompletableFuture> updateCaseCustomAttributeWithHttpInfoAsync( - String caseId, String customAttributeKey, CaseUpdateCustomAttributeRequest body) { + public CompletableFuture> updateCaseTitleWithHttpInfoAsync( + String caseId, CaseUpdateTitleRequest body) { Object localVarPostBody = body; // verify the required parameter 'caseId' is set @@ -4200,19 +9849,7 @@ public CompletableFuture> updateCaseCustomAttributeWit CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( new ApiException( - 400, - "Missing the required parameter 'caseId' when calling updateCaseCustomAttribute")); - return result; - } - - // verify the required parameter 'customAttributeKey' is set - if (customAttributeKey == null) { - CompletableFuture> result = new CompletableFuture<>(); - result.completeExceptionally( - new ApiException( - 400, - "Missing the required parameter 'customAttributeKey' when calling" - + " updateCaseCustomAttribute")); + 400, "Missing the required parameter 'caseId' when calling updateCaseTitle")); return result; } @@ -4221,16 +9858,13 @@ public CompletableFuture> updateCaseCustomAttributeWit CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( new ApiException( - 400, "Missing the required parameter 'body' when calling updateCaseCustomAttribute")); + 400, "Missing the required parameter 'body' when calling updateCaseTitle")); return result; } // create path and map variables String localVarPath = - "/api/v2/cases/{case_id}/custom_attributes/{custom_attribute_key}" - .replaceAll("\\{" + "case_id" + "\\}", apiClient.escapeString(caseId.toString())) - .replaceAll( - "\\{" + "custom_attribute_key" + "\\}", - apiClient.escapeString(customAttributeKey.toString())); + "/api/v2/cases/{case_id}/title" + .replaceAll("\\{" + "case_id" + "\\}", apiClient.escapeString(caseId.toString())); Map localVarHeaderParams = new HashMap(); @@ -4238,7 +9872,7 @@ public CompletableFuture> updateCaseCustomAttributeWit try { builder = apiClient.createBuilder( - "v2.CaseManagementApi.updateCaseCustomAttribute", + "v2.CaseManagementApi.updateCaseTitle", localVarPath, new ArrayList(), localVarHeaderParams, @@ -4262,44 +9896,44 @@ public CompletableFuture> updateCaseCustomAttributeWit } /** - * Update case description. + * Update a case view. * - *

See {@link #updateCaseDescriptionWithHttpInfo}. + *

See {@link #updateCaseViewWithHttpInfo}. * - * @param caseId Case's UUID or key (required) - * @param body Case description update payload (required) - * @return CaseResponse + * @param viewId The UUID of the case view. (required) + * @param body Case view payload. (required) + * @return CaseViewResponse * @throws ApiException if fails to make API call */ - public CaseResponse updateCaseDescription(String caseId, CaseUpdateDescriptionRequest body) + public CaseViewResponse updateCaseView(String viewId, CaseViewUpdateRequest body) throws ApiException { - return updateCaseDescriptionWithHttpInfo(caseId, body).getData(); + return updateCaseViewWithHttpInfo(viewId, body).getData(); } /** - * Update case description. + * Update a case view. * - *

See {@link #updateCaseDescriptionWithHttpInfoAsync}. + *

See {@link #updateCaseViewWithHttpInfoAsync}. * - * @param caseId Case's UUID or key (required) - * @param body Case description update payload (required) - * @return CompletableFuture<CaseResponse> + * @param viewId The UUID of the case view. (required) + * @param body Case view payload. (required) + * @return CompletableFuture<CaseViewResponse> */ - public CompletableFuture updateCaseDescriptionAsync( - String caseId, CaseUpdateDescriptionRequest body) { - return updateCaseDescriptionWithHttpInfoAsync(caseId, body) + public CompletableFuture updateCaseViewAsync( + String viewId, CaseViewUpdateRequest body) { + return updateCaseViewWithHttpInfoAsync(viewId, body) .thenApply( response -> { return response.getData(); }); } - /** - * Update case description - * - * @param caseId Case's UUID or key (required) - * @param body Case description update payload (required) - * @return ApiResponse<CaseResponse> + /** + * Updates the name, query, or notification rule of an existing case view. + * + * @param viewId The UUID of the case view. (required) + * @param body Case view payload. (required) + * @return ApiResponse<CaseViewResponse> * @throws ApiException if fails to make API call * @http.response.details * @@ -4313,31 +9947,38 @@ public CompletableFuture updateCaseDescriptionAsync( * *
429 Too many requests -
*/ - public ApiResponse updateCaseDescriptionWithHttpInfo( - String caseId, CaseUpdateDescriptionRequest body) throws ApiException { + public ApiResponse updateCaseViewWithHttpInfo( + String viewId, CaseViewUpdateRequest body) throws ApiException { + // Check if unstable operation is enabled + String operationId = "updateCaseView"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } Object localVarPostBody = body; - // verify the required parameter 'caseId' is set - if (caseId == null) { + // verify the required parameter 'viewId' is set + if (viewId == null) { throw new ApiException( - 400, "Missing the required parameter 'caseId' when calling updateCaseDescription"); + 400, "Missing the required parameter 'viewId' when calling updateCaseView"); } // verify the required parameter 'body' is set if (body == null) { throw new ApiException( - 400, "Missing the required parameter 'body' when calling updateCaseDescription"); + 400, "Missing the required parameter 'body' when calling updateCaseView"); } // create path and map variables String localVarPath = - "/api/v2/cases/{case_id}/description" - .replaceAll("\\{" + "case_id" + "\\}", apiClient.escapeString(caseId.toString())); + "/api/v2/cases/views/{view_id}" + .replaceAll("\\{" + "view_id" + "\\}", apiClient.escapeString(viewId.toString())); Map localVarHeaderParams = new HashMap(); Invocation.Builder builder = apiClient.createBuilder( - "v2.CaseManagementApi.updateCaseDescription", + "v2.CaseManagementApi.updateCaseView", localVarPath, new ArrayList(), localVarHeaderParams, @@ -4345,50 +9986,60 @@ public ApiResponse updateCaseDescriptionWithHttpInfo( new String[] {"application/json"}, new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); return apiClient.invokeAPI( - "POST", + "PUT", builder, localVarHeaderParams, new String[] {"application/json"}, localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * Update case description. + * Update a case view. * - *

See {@link #updateCaseDescriptionWithHttpInfo}. + *

See {@link #updateCaseViewWithHttpInfo}. * - * @param caseId Case's UUID or key (required) - * @param body Case description update payload (required) - * @return CompletableFuture<ApiResponse<CaseResponse>> + * @param viewId The UUID of the case view. (required) + * @param body Case view payload. (required) + * @return CompletableFuture<ApiResponse<CaseViewResponse>> */ - public CompletableFuture> updateCaseDescriptionWithHttpInfoAsync( - String caseId, CaseUpdateDescriptionRequest body) { + public CompletableFuture> updateCaseViewWithHttpInfoAsync( + String viewId, CaseViewUpdateRequest body) { + // Check if unstable operation is enabled + String operationId = "updateCaseView"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } Object localVarPostBody = body; - // verify the required parameter 'caseId' is set - if (caseId == null) { - CompletableFuture> result = new CompletableFuture<>(); + // verify the required parameter 'viewId' is set + if (viewId == null) { + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( new ApiException( - 400, "Missing the required parameter 'caseId' when calling updateCaseDescription")); + 400, "Missing the required parameter 'viewId' when calling updateCaseView")); return result; } // verify the required parameter 'body' is set if (body == null) { - CompletableFuture> result = new CompletableFuture<>(); + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( new ApiException( - 400, "Missing the required parameter 'body' when calling updateCaseDescription")); + 400, "Missing the required parameter 'body' when calling updateCaseView")); return result; } // create path and map variables String localVarPath = - "/api/v2/cases/{case_id}/description" - .replaceAll("\\{" + "case_id" + "\\}", apiClient.escapeString(caseId.toString())); + "/api/v2/cases/views/{view_id}" + .replaceAll("\\{" + "view_id" + "\\}", apiClient.escapeString(viewId.toString())); Map localVarHeaderParams = new HashMap(); @@ -4396,7 +10047,7 @@ public CompletableFuture> updateCaseDescriptionWithHtt try { builder = apiClient.createBuilder( - "v2.CaseManagementApi.updateCaseDescription", + "v2.CaseManagementApi.updateCaseView", localVarPath, new ArrayList(), localVarHeaderParams, @@ -4404,48 +10055,48 @@ public CompletableFuture> updateCaseDescriptionWithHtt new String[] {"application/json"}, new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); } catch (ApiException ex) { - CompletableFuture> result = new CompletableFuture<>(); + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally(ex); return result; } return apiClient.invokeAPIAsync( - "POST", + "PUT", builder, localVarHeaderParams, new String[] {"application/json"}, localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * Update case title. + * Update a maintenance window. * - *

See {@link #updateCaseTitleWithHttpInfo}. + *

See {@link #updateMaintenanceWindowWithHttpInfo}. * - * @param caseId Case's UUID or key (required) - * @param body Case title update payload (required) - * @return CaseResponse + * @param maintenanceWindowId The UUID of the maintenance window. (required) + * @param body Maintenance window payload. (required) + * @return MaintenanceWindowResponse * @throws ApiException if fails to make API call */ - public CaseResponse updateCaseTitle(String caseId, CaseUpdateTitleRequest body) - throws ApiException { - return updateCaseTitleWithHttpInfo(caseId, body).getData(); + public MaintenanceWindowResponse updateMaintenanceWindow( + String maintenanceWindowId, MaintenanceWindowUpdateRequest body) throws ApiException { + return updateMaintenanceWindowWithHttpInfo(maintenanceWindowId, body).getData(); } /** - * Update case title. + * Update a maintenance window. * - *

See {@link #updateCaseTitleWithHttpInfoAsync}. + *

See {@link #updateMaintenanceWindowWithHttpInfoAsync}. * - * @param caseId Case's UUID or key (required) - * @param body Case title update payload (required) - * @return CompletableFuture<CaseResponse> + * @param maintenanceWindowId The UUID of the maintenance window. (required) + * @param body Maintenance window payload. (required) + * @return CompletableFuture<MaintenanceWindowResponse> */ - public CompletableFuture updateCaseTitleAsync( - String caseId, CaseUpdateTitleRequest body) { - return updateCaseTitleWithHttpInfoAsync(caseId, body) + public CompletableFuture updateMaintenanceWindowAsync( + String maintenanceWindowId, MaintenanceWindowUpdateRequest body) { + return updateMaintenanceWindowWithHttpInfoAsync(maintenanceWindowId, body) .thenApply( response -> { return response.getData(); @@ -4453,11 +10104,11 @@ public CompletableFuture updateCaseTitleAsync( } /** - * Update case title + * Updates the name, query, start time, or end time of an existing maintenance window. * - * @param caseId Case's UUID or key (required) - * @param body Case title update payload (required) - * @return ApiResponse<CaseResponse> + * @param maintenanceWindowId The UUID of the maintenance window. (required) + * @param body Maintenance window payload. (required) + * @return ApiResponse<MaintenanceWindowResponse> * @throws ApiException if fails to make API call * @http.response.details * @@ -4471,31 +10122,42 @@ public CompletableFuture updateCaseTitleAsync( * *
429 Too many requests -
*/ - public ApiResponse updateCaseTitleWithHttpInfo( - String caseId, CaseUpdateTitleRequest body) throws ApiException { + public ApiResponse updateMaintenanceWindowWithHttpInfo( + String maintenanceWindowId, MaintenanceWindowUpdateRequest body) throws ApiException { + // Check if unstable operation is enabled + String operationId = "updateMaintenanceWindow"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } Object localVarPostBody = body; - // verify the required parameter 'caseId' is set - if (caseId == null) { + // verify the required parameter 'maintenanceWindowId' is set + if (maintenanceWindowId == null) { throw new ApiException( - 400, "Missing the required parameter 'caseId' when calling updateCaseTitle"); + 400, + "Missing the required parameter 'maintenanceWindowId' when calling" + + " updateMaintenanceWindow"); } // verify the required parameter 'body' is set if (body == null) { throw new ApiException( - 400, "Missing the required parameter 'body' when calling updateCaseTitle"); + 400, "Missing the required parameter 'body' when calling updateMaintenanceWindow"); } // create path and map variables String localVarPath = - "/api/v2/cases/{case_id}/title" - .replaceAll("\\{" + "case_id" + "\\}", apiClient.escapeString(caseId.toString())); + "/api/v2/maintenance_windows/{maintenance_window_id}" + .replaceAll( + "\\{" + "maintenance_window_id" + "\\}", + apiClient.escapeString(maintenanceWindowId.toString())); Map localVarHeaderParams = new HashMap(); Invocation.Builder builder = apiClient.createBuilder( - "v2.CaseManagementApi.updateCaseTitle", + "v2.CaseManagementApi.updateMaintenanceWindow", localVarPath, new ArrayList(), localVarHeaderParams, @@ -4503,50 +10165,65 @@ public ApiResponse updateCaseTitleWithHttpInfo( new String[] {"application/json"}, new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); return apiClient.invokeAPI( - "POST", + "PUT", builder, localVarHeaderParams, new String[] {"application/json"}, localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * Update case title. + * Update a maintenance window. * - *

See {@link #updateCaseTitleWithHttpInfo}. + *

See {@link #updateMaintenanceWindowWithHttpInfo}. * - * @param caseId Case's UUID or key (required) - * @param body Case title update payload (required) - * @return CompletableFuture<ApiResponse<CaseResponse>> + * @param maintenanceWindowId The UUID of the maintenance window. (required) + * @param body Maintenance window payload. (required) + * @return CompletableFuture<ApiResponse<MaintenanceWindowResponse>> */ - public CompletableFuture> updateCaseTitleWithHttpInfoAsync( - String caseId, CaseUpdateTitleRequest body) { + public CompletableFuture> + updateMaintenanceWindowWithHttpInfoAsync( + String maintenanceWindowId, MaintenanceWindowUpdateRequest body) { + // Check if unstable operation is enabled + String operationId = "updateMaintenanceWindow"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } Object localVarPostBody = body; - // verify the required parameter 'caseId' is set - if (caseId == null) { - CompletableFuture> result = new CompletableFuture<>(); + // verify the required parameter 'maintenanceWindowId' is set + if (maintenanceWindowId == null) { + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( new ApiException( - 400, "Missing the required parameter 'caseId' when calling updateCaseTitle")); + 400, + "Missing the required parameter 'maintenanceWindowId' when calling" + + " updateMaintenanceWindow")); return result; } // verify the required parameter 'body' is set if (body == null) { - CompletableFuture> result = new CompletableFuture<>(); + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( new ApiException( - 400, "Missing the required parameter 'body' when calling updateCaseTitle")); + 400, "Missing the required parameter 'body' when calling updateMaintenanceWindow")); return result; } // create path and map variables String localVarPath = - "/api/v2/cases/{case_id}/title" - .replaceAll("\\{" + "case_id" + "\\}", apiClient.escapeString(caseId.toString())); + "/api/v2/maintenance_windows/{maintenance_window_id}" + .replaceAll( + "\\{" + "maintenance_window_id" + "\\}", + apiClient.escapeString(maintenanceWindowId.toString())); Map localVarHeaderParams = new HashMap(); @@ -4554,7 +10231,7 @@ public CompletableFuture> updateCaseTitleWithHttpInfoA try { builder = apiClient.createBuilder( - "v2.CaseManagementApi.updateCaseTitle", + "v2.CaseManagementApi.updateMaintenanceWindow", localVarPath, new ArrayList(), localVarHeaderParams, @@ -4562,19 +10239,19 @@ public CompletableFuture> updateCaseTitleWithHttpInfoA new String[] {"application/json"}, new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); } catch (ApiException ex) { - CompletableFuture> result = new CompletableFuture<>(); + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally(ex); return result; } return apiClient.invokeAPIAsync( - "POST", + "PUT", builder, localVarHeaderParams, new String[] {"application/json"}, localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** @@ -5241,4 +10918,177 @@ public CompletableFuture> updateStatusWithHttpInfoAsyn false, new GenericType() {}); } + + /** + * Watch a case. + * + *

See {@link #watchCaseWithHttpInfo}. + * + * @param caseId Case's UUID or key (required) + * @param userUuid The UUID of the user to add or remove as a watcher. (required) + * @throws ApiException if fails to make API call + */ + public void watchCase(String caseId, String userUuid) throws ApiException { + watchCaseWithHttpInfo(caseId, userUuid); + } + + /** + * Watch a case. + * + *

See {@link #watchCaseWithHttpInfoAsync}. + * + * @param caseId Case's UUID or key (required) + * @param userUuid The UUID of the user to add or remove as a watcher. (required) + * @return CompletableFuture + */ + public CompletableFuture watchCaseAsync(String caseId, String userUuid) { + return watchCaseWithHttpInfoAsync(caseId, userUuid) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Adds a user (identified by their UUID) as a watcher of a case. The user receives notifications + * about subsequent updates to the case. + * + * @param caseId Case's UUID or key (required) + * @param userUuid The UUID of the user to add or remove as a watcher. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
201 Created -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
404 Not Found -
429 Too many requests -
+ */ + public ApiResponse watchCaseWithHttpInfo(String caseId, String userUuid) + throws ApiException { + // Check if unstable operation is enabled + String operationId = "watchCase"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = null; + + // verify the required parameter 'caseId' is set + if (caseId == null) { + throw new ApiException(400, "Missing the required parameter 'caseId' when calling watchCase"); + } + + // verify the required parameter 'userUuid' is set + if (userUuid == null) { + throw new ApiException( + 400, "Missing the required parameter 'userUuid' when calling watchCase"); + } + // create path and map variables + String localVarPath = + "/api/v2/cases/{case_id}/watchers/{user_uuid}" + .replaceAll("\\{" + "case_id" + "\\}", apiClient.escapeString(caseId.toString())) + .replaceAll("\\{" + "user_uuid" + "\\}", apiClient.escapeString(userUuid.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.CaseManagementApi.watchCase", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"*/*"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + return apiClient.invokeAPI( + "POST", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + null); + } + + /** + * Watch a case. + * + *

See {@link #watchCaseWithHttpInfo}. + * + * @param caseId Case's UUID or key (required) + * @param userUuid The UUID of the user to add or remove as a watcher. (required) + * @return CompletableFuture<ApiResponse<Void>> + */ + public CompletableFuture> watchCaseWithHttpInfoAsync( + String caseId, String userUuid) { + // Check if unstable operation is enabled + String operationId = "watchCase"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = null; + + // verify the required parameter 'caseId' is set + if (caseId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(400, "Missing the required parameter 'caseId' when calling watchCase")); + return result; + } + + // verify the required parameter 'userUuid' is set + if (userUuid == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'userUuid' when calling watchCase")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/cases/{case_id}/watchers/{user_uuid}" + .replaceAll("\\{" + "case_id" + "\\}", apiClient.escapeString(caseId.toString())) + .replaceAll("\\{" + "user_uuid" + "\\}", apiClient.escapeString(userUuid.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.CaseManagementApi.watchCase", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"*/*"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "POST", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + null); + } } diff --git a/src/main/java/com/datadog/api/client/v2/api/CaseManagementAttributeApi.java b/src/main/java/com/datadog/api/client/v2/api/CaseManagementAttributeApi.java index dc59a1a237b..5a6fbd6dc8f 100644 --- a/src/main/java/com/datadog/api/client/v2/api/CaseManagementAttributeApi.java +++ b/src/main/java/com/datadog/api/client/v2/api/CaseManagementAttributeApi.java @@ -6,6 +6,7 @@ import com.datadog.api.client.Pair; import com.datadog.api.client.v2.model.CustomAttributeConfigCreateRequest; import com.datadog.api.client.v2.model.CustomAttributeConfigResponse; +import com.datadog.api.client.v2.model.CustomAttributeConfigUpdateRequest; import com.datadog.api.client.v2.model.CustomAttributeConfigsResponse; import jakarta.ws.rs.client.Invocation; import jakarta.ws.rs.core.GenericType; @@ -50,7 +51,7 @@ public void setApiClient(ApiClient apiClient) { * *

See {@link #createCustomAttributeConfigWithHttpInfo}. * - * @param caseTypeId Case type's UUID (required) + * @param caseTypeId The UUID of the case type. (required) * @param body Custom attribute config payload (required) * @return CustomAttributeConfigResponse * @throws ApiException if fails to make API call @@ -65,7 +66,7 @@ public CustomAttributeConfigResponse createCustomAttributeConfig( * *

See {@link #createCustomAttributeConfigWithHttpInfoAsync}. * - * @param caseTypeId Case type's UUID (required) + * @param caseTypeId The UUID of the case type. (required) * @param body Custom attribute config payload (required) * @return CompletableFuture<CustomAttributeConfigResponse> */ @@ -81,7 +82,7 @@ public CompletableFuture createCustomAttributeCon /** * Create custom attribute config for a case type * - * @param caseTypeId Case type's UUID (required) + * @param caseTypeId The UUID of the case type. (required) * @param body Custom attribute config payload (required) * @return ApiResponse<CustomAttributeConfigResponse> * @throws ApiException if fails to make API call @@ -146,7 +147,7 @@ public ApiResponse createCustomAttributeConfigWit * *

See {@link #createCustomAttributeConfigWithHttpInfo}. * - * @param caseTypeId Case type's UUID (required) + * @param caseTypeId The UUID of the case type. (required) * @param body Custom attribute config payload (required) * @return CompletableFuture<ApiResponse<CustomAttributeConfigResponse>> */ @@ -218,7 +219,7 @@ public ApiResponse createCustomAttributeConfigWit * *

See {@link #deleteCustomAttributeConfigWithHttpInfo}. * - * @param caseTypeId Case type's UUID (required) + * @param caseTypeId The UUID of the case type. (required) * @param customAttributeId Case Custom attribute's UUID (required) * @throws ApiException if fails to make API call */ @@ -232,7 +233,7 @@ public void deleteCustomAttributeConfig(String caseTypeId, String customAttribut * *

See {@link #deleteCustomAttributeConfigWithHttpInfoAsync}. * - * @param caseTypeId Case type's UUID (required) + * @param caseTypeId The UUID of the case type. (required) * @param customAttributeId Case Custom attribute's UUID (required) * @return CompletableFuture */ @@ -248,7 +249,7 @@ public CompletableFuture deleteCustomAttributeConfigAsync( /** * Delete custom attribute config * - * @param caseTypeId Case type's UUID (required) + * @param caseTypeId The UUID of the case type. (required) * @param customAttributeId Case Custom attribute's UUID (required) * @return ApiResponse<Void> * @throws ApiException if fails to make API call @@ -317,7 +318,7 @@ public ApiResponse deleteCustomAttributeConfigWithHttpInfo( * *

See {@link #deleteCustomAttributeConfigWithHttpInfo}. * - * @param caseTypeId Case type's UUID (required) + * @param caseTypeId The UUID of the case type. (required) * @param customAttributeId Case Custom attribute's UUID (required) * @return CompletableFuture<ApiResponse<Void>> */ @@ -389,7 +390,7 @@ public CompletableFuture> deleteCustomAttributeConfigWithHttpI * *

See {@link #getAllCustomAttributeConfigsByCaseTypeWithHttpInfo}. * - * @param caseTypeId Case type's UUID (required) + * @param caseTypeId The UUID of the case type. (required) * @return CustomAttributeConfigsResponse * @throws ApiException if fails to make API call */ @@ -403,7 +404,7 @@ public CustomAttributeConfigsResponse getAllCustomAttributeConfigsByCaseType(Str * *

See {@link #getAllCustomAttributeConfigsByCaseTypeWithHttpInfoAsync}. * - * @param caseTypeId Case type's UUID (required) + * @param caseTypeId The UUID of the case type. (required) * @return CompletableFuture<CustomAttributeConfigsResponse> */ public CompletableFuture @@ -418,7 +419,7 @@ public CustomAttributeConfigsResponse getAllCustomAttributeConfigsByCaseType(Str /** * Get all custom attribute config of case type * - * @param caseTypeId Case type's UUID (required) + * @param caseTypeId The UUID of the case type. (required) * @return ApiResponse<CustomAttributeConfigsResponse> * @throws ApiException if fails to make API call * @http.response.details @@ -476,7 +477,7 @@ public CustomAttributeConfigsResponse getAllCustomAttributeConfigsByCaseType(Str * *

See {@link #getAllCustomAttributeConfigsByCaseTypeWithHttpInfo}. * - * @param caseTypeId Case type's UUID (required) + * @param caseTypeId The UUID of the case type. (required) * @return CompletableFuture<ApiResponse<CustomAttributeConfigsResponse>> */ public CompletableFuture> @@ -642,4 +643,223 @@ public ApiResponse getAllCustomAttributesWithHtt false, new GenericType() {}); } + + /** + * Update custom attribute config. + * + *

See {@link #updateCustomAttributeConfigWithHttpInfo}. + * + * @param caseTypeId The UUID of the case type. (required) + * @param customAttributeId Case Custom attribute's UUID (required) + * @param body Custom attribute config payload. (required) + * @return CustomAttributeConfigResponse + * @throws ApiException if fails to make API call + */ + public CustomAttributeConfigResponse updateCustomAttributeConfig( + String caseTypeId, String customAttributeId, CustomAttributeConfigUpdateRequest body) + throws ApiException { + return updateCustomAttributeConfigWithHttpInfo(caseTypeId, customAttributeId, body).getData(); + } + + /** + * Update custom attribute config. + * + *

See {@link #updateCustomAttributeConfigWithHttpInfoAsync}. + * + * @param caseTypeId The UUID of the case type. (required) + * @param customAttributeId Case Custom attribute's UUID (required) + * @param body Custom attribute config payload. (required) + * @return CompletableFuture<CustomAttributeConfigResponse> + */ + public CompletableFuture updateCustomAttributeConfigAsync( + String caseTypeId, String customAttributeId, CustomAttributeConfigUpdateRequest body) { + return updateCustomAttributeConfigWithHttpInfoAsync(caseTypeId, customAttributeId, body) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Updates the display name, description, type, or options of an existing custom attribute + * configuration for a case type. + * + * @param caseTypeId The UUID of the case type. (required) + * @param customAttributeId Case Custom attribute's UUID (required) + * @param body Custom attribute config payload. (required) + * @return ApiResponse<CustomAttributeConfigResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
404 Not Found -
429 Too many requests -
+ */ + public ApiResponse updateCustomAttributeConfigWithHttpInfo( + String caseTypeId, String customAttributeId, CustomAttributeConfigUpdateRequest body) + throws ApiException { + // Check if unstable operation is enabled + String operationId = "updateCustomAttributeConfig"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = body; + + // verify the required parameter 'caseTypeId' is set + if (caseTypeId == null) { + throw new ApiException( + 400, + "Missing the required parameter 'caseTypeId' when calling updateCustomAttributeConfig"); + } + + // verify the required parameter 'customAttributeId' is set + if (customAttributeId == null) { + throw new ApiException( + 400, + "Missing the required parameter 'customAttributeId' when calling" + + " updateCustomAttributeConfig"); + } + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException( + 400, "Missing the required parameter 'body' when calling updateCustomAttributeConfig"); + } + // create path and map variables + String localVarPath = + "/api/v2/cases/types/{case_type_id}/custom_attributes/{custom_attribute_id}" + .replaceAll( + "\\{" + "case_type_id" + "\\}", apiClient.escapeString(caseTypeId.toString())) + .replaceAll( + "\\{" + "custom_attribute_id" + "\\}", + apiClient.escapeString(customAttributeId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.CaseManagementAttributeApi.updateCustomAttributeConfig", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + return apiClient.invokeAPI( + "PUT", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Update custom attribute config. + * + *

See {@link #updateCustomAttributeConfigWithHttpInfo}. + * + * @param caseTypeId The UUID of the case type. (required) + * @param customAttributeId Case Custom attribute's UUID (required) + * @param body Custom attribute config payload. (required) + * @return CompletableFuture<ApiResponse<CustomAttributeConfigResponse>> + */ + public CompletableFuture> + updateCustomAttributeConfigWithHttpInfoAsync( + String caseTypeId, String customAttributeId, CustomAttributeConfigUpdateRequest body) { + // Check if unstable operation is enabled + String operationId = "updateCustomAttributeConfig"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = body; + + // verify the required parameter 'caseTypeId' is set + if (caseTypeId == null) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'caseTypeId' when calling" + + " updateCustomAttributeConfig")); + return result; + } + + // verify the required parameter 'customAttributeId' is set + if (customAttributeId == null) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'customAttributeId' when calling" + + " updateCustomAttributeConfig")); + return result; + } + + // verify the required parameter 'body' is set + if (body == null) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'body' when calling updateCustomAttributeConfig")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/cases/types/{case_type_id}/custom_attributes/{custom_attribute_id}" + .replaceAll( + "\\{" + "case_type_id" + "\\}", apiClient.escapeString(caseTypeId.toString())) + .replaceAll( + "\\{" + "custom_attribute_id" + "\\}", + apiClient.escapeString(customAttributeId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.CaseManagementAttributeApi.updateCustomAttributeConfig", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + } catch (ApiException ex) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "PUT", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } } diff --git a/src/main/java/com/datadog/api/client/v2/api/CaseManagementTypeApi.java b/src/main/java/com/datadog/api/client/v2/api/CaseManagementTypeApi.java index ac7825306c7..df5685320d9 100644 --- a/src/main/java/com/datadog/api/client/v2/api/CaseManagementTypeApi.java +++ b/src/main/java/com/datadog/api/client/v2/api/CaseManagementTypeApi.java @@ -6,6 +6,7 @@ import com.datadog.api.client.Pair; import com.datadog.api.client.v2.model.CaseTypeCreateRequest; import com.datadog.api.client.v2.model.CaseTypeResponse; +import com.datadog.api.client.v2.model.CaseTypeUpdateRequest; import com.datadog.api.client.v2.model.CaseTypesResponse; import jakarta.ws.rs.client.Invocation; import jakarta.ws.rs.core.GenericType; @@ -182,7 +183,7 @@ public CompletableFuture> createCaseTypeWithHttpIn * *

See {@link #deleteCaseTypeWithHttpInfo}. * - * @param caseTypeId Case type's UUID (required) + * @param caseTypeId The UUID of the case type. (required) * @throws ApiException if fails to make API call */ public void deleteCaseType(String caseTypeId) throws ApiException { @@ -194,7 +195,7 @@ public void deleteCaseType(String caseTypeId) throws ApiException { * *

See {@link #deleteCaseTypeWithHttpInfoAsync}. * - * @param caseTypeId Case type's UUID (required) + * @param caseTypeId The UUID of the case type. (required) * @return CompletableFuture */ public CompletableFuture deleteCaseTypeAsync(String caseTypeId) { @@ -208,7 +209,7 @@ public CompletableFuture deleteCaseTypeAsync(String caseTypeId) { /** * Delete a case type * - * @param caseTypeId Case type's UUID (required) + * @param caseTypeId The UUID of the case type. (required) * @return ApiResponse<Void> * @throws ApiException if fails to make API call * @http.response.details @@ -262,7 +263,7 @@ public ApiResponse deleteCaseTypeWithHttpInfo(String caseTypeId) throws Ap * *

See {@link #deleteCaseTypeWithHttpInfo}. * - * @param caseTypeId Case type's UUID (required) + * @param caseTypeId The UUID of the case type. (required) * @return CompletableFuture<ApiResponse<Void>> */ public CompletableFuture> deleteCaseTypeWithHttpInfoAsync(String caseTypeId) { @@ -420,4 +421,181 @@ public CompletableFuture> getAllCaseTypesWithHttp false, new GenericType() {}); } + + /** + * Update a case type. + * + *

See {@link #updateCaseTypeWithHttpInfo}. + * + * @param caseTypeId The UUID of the case type. (required) + * @param body Case type payload. (required) + * @return CaseTypeResponse + * @throws ApiException if fails to make API call + */ + public CaseTypeResponse updateCaseType(String caseTypeId, CaseTypeUpdateRequest body) + throws ApiException { + return updateCaseTypeWithHttpInfo(caseTypeId, body).getData(); + } + + /** + * Update a case type. + * + *

See {@link #updateCaseTypeWithHttpInfoAsync}. + * + * @param caseTypeId The UUID of the case type. (required) + * @param body Case type payload. (required) + * @return CompletableFuture<CaseTypeResponse> + */ + public CompletableFuture updateCaseTypeAsync( + String caseTypeId, CaseTypeUpdateRequest body) { + return updateCaseTypeWithHttpInfoAsync(caseTypeId, body) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Updates the name, emoji, or description of an existing case type. + * + * @param caseTypeId The UUID of the case type. (required) + * @param body Case type payload. (required) + * @return ApiResponse<CaseTypeResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
404 Not Found -
429 Too many requests -
+ */ + public ApiResponse updateCaseTypeWithHttpInfo( + String caseTypeId, CaseTypeUpdateRequest body) throws ApiException { + // Check if unstable operation is enabled + String operationId = "updateCaseType"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = body; + + // verify the required parameter 'caseTypeId' is set + if (caseTypeId == null) { + throw new ApiException( + 400, "Missing the required parameter 'caseTypeId' when calling updateCaseType"); + } + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException( + 400, "Missing the required parameter 'body' when calling updateCaseType"); + } + // create path and map variables + String localVarPath = + "/api/v2/cases/types/{case_type_id}" + .replaceAll( + "\\{" + "case_type_id" + "\\}", apiClient.escapeString(caseTypeId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.CaseManagementTypeApi.updateCaseType", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + return apiClient.invokeAPI( + "PUT", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Update a case type. + * + *

See {@link #updateCaseTypeWithHttpInfo}. + * + * @param caseTypeId The UUID of the case type. (required) + * @param body Case type payload. (required) + * @return CompletableFuture<ApiResponse<CaseTypeResponse>> + */ + public CompletableFuture> updateCaseTypeWithHttpInfoAsync( + String caseTypeId, CaseTypeUpdateRequest body) { + // Check if unstable operation is enabled + String operationId = "updateCaseType"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = body; + + // verify the required parameter 'caseTypeId' is set + if (caseTypeId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'caseTypeId' when calling updateCaseType")); + return result; + } + + // verify the required parameter 'body' is set + if (body == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'body' when calling updateCaseType")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/cases/types/{case_type_id}" + .replaceAll( + "\\{" + "case_type_id" + "\\}", apiClient.escapeString(caseTypeId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.CaseManagementTypeApi.updateCaseType", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "PUT", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } } diff --git a/src/main/java/com/datadog/api/client/v2/api/CloudCostManagementApi.java b/src/main/java/com/datadog/api/client/v2/api/CloudCostManagementApi.java index 46db44f7a8e..81887de5058 100644 --- a/src/main/java/com/datadog/api/client/v2/api/CloudCostManagementApi.java +++ b/src/main/java/com/datadog/api/client/v2/api/CloudCostManagementApi.java @@ -35,6 +35,8 @@ import com.datadog.api.client.v2.model.CostCurrencyResponse; import com.datadog.api.client.v2.model.CostMetricsResponse; import com.datadog.api.client.v2.model.CostOrchestratorsResponse; +import com.datadog.api.client.v2.model.CostTagDescriptionResponse; +import com.datadog.api.client.v2.model.CostTagDescriptionUpsertRequest; import com.datadog.api.client.v2.model.CostTagDescriptionsResponse; import com.datadog.api.client.v2.model.CostTagKeyMetadataResponse; import com.datadog.api.client.v2.model.CostTagKeyResponse; @@ -52,6 +54,7 @@ import com.datadog.api.client.v2.model.GCPUsageCostConfigResponse; import com.datadog.api.client.v2.model.GCPUsageCostConfigsResponse; import com.datadog.api.client.v2.model.GcpUcConfigResponse; +import com.datadog.api.client.v2.model.GenerateCostTagDescriptionResponse; import com.datadog.api.client.v2.model.OCIConfigsResponse; import com.datadog.api.client.v2.model.ReorderRuleResourceArray; import com.datadog.api.client.v2.model.ReorderRulesetResourceArray; @@ -1333,6 +1336,209 @@ public CompletableFuture> deleteCostGCPUsageCostConfigWithHttp null); } + /** Manage optional parameters to deleteCostTagDescriptionByKey. */ + public static class DeleteCostTagDescriptionByKeyOptionalParameters { + private String cloud; + + /** + * Set cloud. + * + * @param cloud Cloud provider to scope the deletion to (for example, aws). Omit to + * delete every description for the tag key. (optional) + * @return DeleteCostTagDescriptionByKeyOptionalParameters + */ + public DeleteCostTagDescriptionByKeyOptionalParameters cloud(String cloud) { + this.cloud = cloud; + return this; + } + } + + /** + * Delete a Cloud Cost Management tag description. + * + *

See {@link #deleteCostTagDescriptionByKeyWithHttpInfo}. + * + * @param tagKey The tag key whose description is being deleted. (required) + * @throws ApiException if fails to make API call + */ + public void deleteCostTagDescriptionByKey(String tagKey) throws ApiException { + deleteCostTagDescriptionByKeyWithHttpInfo( + tagKey, new DeleteCostTagDescriptionByKeyOptionalParameters()); + } + + /** + * Delete a Cloud Cost Management tag description. + * + *

See {@link #deleteCostTagDescriptionByKeyWithHttpInfoAsync}. + * + * @param tagKey The tag key whose description is being deleted. (required) + * @return CompletableFuture + */ + public CompletableFuture deleteCostTagDescriptionByKeyAsync(String tagKey) { + return deleteCostTagDescriptionByKeyWithHttpInfoAsync( + tagKey, new DeleteCostTagDescriptionByKeyOptionalParameters()) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Delete a Cloud Cost Management tag description. + * + *

See {@link #deleteCostTagDescriptionByKeyWithHttpInfo}. + * + * @param tagKey The tag key whose description is being deleted. (required) + * @param parameters Optional parameters for the request. + * @throws ApiException if fails to make API call + */ + public void deleteCostTagDescriptionByKey( + String tagKey, DeleteCostTagDescriptionByKeyOptionalParameters parameters) + throws ApiException { + deleteCostTagDescriptionByKeyWithHttpInfo(tagKey, parameters); + } + + /** + * Delete a Cloud Cost Management tag description. + * + *

See {@link #deleteCostTagDescriptionByKeyWithHttpInfoAsync}. + * + * @param tagKey The tag key whose description is being deleted. (required) + * @param parameters Optional parameters for the request. + * @return CompletableFuture + */ + public CompletableFuture deleteCostTagDescriptionByKeyAsync( + String tagKey, DeleteCostTagDescriptionByKeyOptionalParameters parameters) { + return deleteCostTagDescriptionByKeyWithHttpInfoAsync(tagKey, parameters) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Delete a Cloud Cost Management tag key description. When cloud is omitted, deletes + * every description for the tag key, falling back to Datadog's global default when available. + * When cloud is provided, deletes only the description scoped to that cloud + * provider. + * + * @param tagKey The tag key whose description is being deleted. (required) + * @param parameters Optional parameters for the request. + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
204 No Content -
400 Bad Request -
403 Forbidden -
429 Too many requests -
+ */ + public ApiResponse deleteCostTagDescriptionByKeyWithHttpInfo( + String tagKey, DeleteCostTagDescriptionByKeyOptionalParameters parameters) + throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'tagKey' is set + if (tagKey == null) { + throw new ApiException( + 400, + "Missing the required parameter 'tagKey' when calling deleteCostTagDescriptionByKey"); + } + String cloud = parameters.cloud; + // create path and map variables + String localVarPath = + "/api/v2/cost/tag_descriptions/{tag_key}" + .replaceAll("\\{" + "tag_key" + "\\}", apiClient.escapeString(tagKey.toString())); + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "cloud", cloud)); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.CloudCostManagementApi.deleteCostTagDescriptionByKey", + localVarPath, + localVarQueryParams, + localVarHeaderParams, + new HashMap(), + new String[] {"*/*"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + return apiClient.invokeAPI( + "DELETE", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + null); + } + + /** + * Delete a Cloud Cost Management tag description. + * + *

See {@link #deleteCostTagDescriptionByKeyWithHttpInfo}. + * + * @param tagKey The tag key whose description is being deleted. (required) + * @param parameters Optional parameters for the request. + * @return CompletableFuture<ApiResponse<Void>> + */ + public CompletableFuture> deleteCostTagDescriptionByKeyWithHttpInfoAsync( + String tagKey, DeleteCostTagDescriptionByKeyOptionalParameters parameters) { + Object localVarPostBody = null; + + // verify the required parameter 'tagKey' is set + if (tagKey == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'tagKey' when calling" + + " deleteCostTagDescriptionByKey")); + return result; + } + String cloud = parameters.cloud; + // create path and map variables + String localVarPath = + "/api/v2/cost/tag_descriptions/{tag_key}" + .replaceAll("\\{" + "tag_key" + "\\}", apiClient.escapeString(tagKey.toString())); + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "cloud", cloud)); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.CloudCostManagementApi.deleteCostTagDescriptionByKey", + localVarPath, + localVarQueryParams, + localVarHeaderParams, + new HashMap(), + new String[] {"*/*"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "DELETE", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + null); + } + /** * Delete custom allocation rule. * @@ -1731,6 +1937,150 @@ public CompletableFuture> deleteTagPipelinesRulesetWithHttpInf null); } + /** + * Generate a Cloud Cost Management tag description. + * + *

See {@link #generateCostTagDescriptionByKeyWithHttpInfo}. + * + * @param tagKey The tag key to generate an AI description for. (required) + * @return GenerateCostTagDescriptionResponse + * @throws ApiException if fails to make API call + */ + public GenerateCostTagDescriptionResponse generateCostTagDescriptionByKey(String tagKey) + throws ApiException { + return generateCostTagDescriptionByKeyWithHttpInfo(tagKey).getData(); + } + + /** + * Generate a Cloud Cost Management tag description. + * + *

See {@link #generateCostTagDescriptionByKeyWithHttpInfoAsync}. + * + * @param tagKey The tag key to generate an AI description for. (required) + * @return CompletableFuture<GenerateCostTagDescriptionResponse> + */ + public CompletableFuture generateCostTagDescriptionByKeyAsync( + String tagKey) { + return generateCostTagDescriptionByKeyWithHttpInfoAsync(tagKey) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Use AI to draft a Cloud Cost Management tag key description based on associated cost data. The + * generated description is returned in the response and is not persisted by this endpoint; follow + * up with UpsertCostTagDescriptionByKey to save it. + * + * @param tagKey The tag key to generate an AI description for. (required) + * @return ApiResponse<GenerateCostTagDescriptionResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
403 Forbidden -
429 Too many requests -
+ */ + public ApiResponse + generateCostTagDescriptionByKeyWithHttpInfo(String tagKey) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'tagKey' is set + if (tagKey == null) { + throw new ApiException( + 400, + "Missing the required parameter 'tagKey' when calling generateCostTagDescriptionByKey"); + } + // create path and map variables + String localVarPath = + "/api/v2/cost/tag_descriptions/{tag_key}/generate" + .replaceAll("\\{" + "tag_key" + "\\}", apiClient.escapeString(tagKey.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.CloudCostManagementApi.generateCostTagDescriptionByKey", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + return apiClient.invokeAPI( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Generate a Cloud Cost Management tag description. + * + *

See {@link #generateCostTagDescriptionByKeyWithHttpInfo}. + * + * @param tagKey The tag key to generate an AI description for. (required) + * @return CompletableFuture<ApiResponse<GenerateCostTagDescriptionResponse>> + */ + public CompletableFuture> + generateCostTagDescriptionByKeyWithHttpInfoAsync(String tagKey) { + Object localVarPostBody = null; + + // verify the required parameter 'tagKey' is set + if (tagKey == null) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'tagKey' when calling" + + " generateCostTagDescriptionByKey")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/cost/tag_descriptions/{tag_key}/generate" + .replaceAll("\\{" + "tag_key" + "\\}", apiClient.escapeString(tagKey.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.CloudCostManagementApi.generateCostTagDescriptionByKey", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + } catch (ApiException ex) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + /** * Get budget. * @@ -4876,33 +5226,174 @@ public ApiResponse getCostAzureUCConfigWithHttpInfo(Long cloudAcco localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); + } + + /** + * Get cost Azure UC config. + * + *

See {@link #getCostAzureUCConfigWithHttpInfo}. + * + * @param cloudAccountId The unique identifier of the cloud account (required) + * @return CompletableFuture<ApiResponse<UCConfigPair>> + */ + public CompletableFuture> getCostAzureUCConfigWithHttpInfoAsync( + Long cloudAccountId) { + Object localVarPostBody = null; + + // verify the required parameter 'cloudAccountId' is set + if (cloudAccountId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'cloudAccountId' when calling getCostAzureUCConfig")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/cost/azure_uc_config/{cloud_account_id}" + .replaceAll( + "\\{" + "cloud_account_id" + "\\}", + apiClient.escapeString(cloudAccountId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.CloudCostManagementApi.getCostAzureUCConfig", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Get Google Cloud Usage Cost config. + * + *

See {@link #getCostGCPUsageCostConfigWithHttpInfo}. + * + * @param cloudAccountId The unique identifier of the cloud account (required) + * @return GcpUcConfigResponse + * @throws ApiException if fails to make API call + */ + public GcpUcConfigResponse getCostGCPUsageCostConfig(Long cloudAccountId) throws ApiException { + return getCostGCPUsageCostConfigWithHttpInfo(cloudAccountId).getData(); + } + + /** + * Get Google Cloud Usage Cost config. + * + *

See {@link #getCostGCPUsageCostConfigWithHttpInfoAsync}. + * + * @param cloudAccountId The unique identifier of the cloud account (required) + * @return CompletableFuture<GcpUcConfigResponse> + */ + public CompletableFuture getCostGCPUsageCostConfigAsync( + Long cloudAccountId) { + return getCostGCPUsageCostConfigWithHttpInfoAsync(cloudAccountId) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Get a specific Google Cloud Usage Cost config. + * + * @param cloudAccountId The unique identifier of the cloud account (required) + * @return ApiResponse<GcpUcConfigResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
429 Too many requests -
+ */ + public ApiResponse getCostGCPUsageCostConfigWithHttpInfo(Long cloudAccountId) + throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'cloudAccountId' is set + if (cloudAccountId == null) { + throw new ApiException( + 400, + "Missing the required parameter 'cloudAccountId' when calling getCostGCPUsageCostConfig"); + } + // create path and map variables + String localVarPath = + "/api/v2/cost/gcp_uc_config/{cloud_account_id}" + .replaceAll( + "\\{" + "cloud_account_id" + "\\}", + apiClient.escapeString(cloudAccountId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.CloudCostManagementApi.getCostGCPUsageCostConfig", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + return apiClient.invokeAPI( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); } /** - * Get cost Azure UC config. + * Get Google Cloud Usage Cost config. * - *

See {@link #getCostAzureUCConfigWithHttpInfo}. + *

See {@link #getCostGCPUsageCostConfigWithHttpInfo}. * * @param cloudAccountId The unique identifier of the cloud account (required) - * @return CompletableFuture<ApiResponse<UCConfigPair>> + * @return CompletableFuture<ApiResponse<GcpUcConfigResponse>> */ - public CompletableFuture> getCostAzureUCConfigWithHttpInfoAsync( - Long cloudAccountId) { + public CompletableFuture> + getCostGCPUsageCostConfigWithHttpInfoAsync(Long cloudAccountId) { Object localVarPostBody = null; // verify the required parameter 'cloudAccountId' is set if (cloudAccountId == null) { - CompletableFuture> result = new CompletableFuture<>(); + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( new ApiException( 400, - "Missing the required parameter 'cloudAccountId' when calling getCostAzureUCConfig")); + "Missing the required parameter 'cloudAccountId' when calling" + + " getCostGCPUsageCostConfig")); return result; } // create path and map variables String localVarPath = - "/api/v2/cost/azure_uc_config/{cloud_account_id}" + "/api/v2/cost/gcp_uc_config/{cloud_account_id}" .replaceAll( "\\{" + "cloud_account_id" + "\\}", apiClient.escapeString(cloudAccountId.toString())); @@ -4913,7 +5404,7 @@ public CompletableFuture> getCostAzureUCConfigWithHttp try { builder = apiClient.createBuilder( - "v2.CloudCostManagementApi.getCostAzureUCConfig", + "v2.CloudCostManagementApi.getCostGCPUsageCostConfig", localVarPath, new ArrayList(), localVarHeaderParams, @@ -4921,7 +5412,7 @@ public CompletableFuture> getCostAzureUCConfigWithHttp new String[] {"application/json"}, new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); } catch (ApiException ex) { - CompletableFuture> result = new CompletableFuture<>(); + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally(ex); return result; } @@ -4933,33 +5424,53 @@ public CompletableFuture> getCostAzureUCConfigWithHttp localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); + } + + /** Manage optional parameters to getCostTagDescriptionByKey. */ + public static class GetCostTagDescriptionByKeyOptionalParameters { + private String filterCloud; + + /** + * Set filterCloud. + * + * @param filterCloud Cloud provider to scope the lookup to (for example, aws). + * Omit to use the resolved fallback. (optional) + * @return GetCostTagDescriptionByKeyOptionalParameters + */ + public GetCostTagDescriptionByKeyOptionalParameters filterCloud(String filterCloud) { + this.filterCloud = filterCloud; + return this; + } } /** - * Get Google Cloud Usage Cost config. + * Get a Cloud Cost Management tag description. * - *

See {@link #getCostGCPUsageCostConfigWithHttpInfo}. + *

See {@link #getCostTagDescriptionByKeyWithHttpInfo}. * - * @param cloudAccountId The unique identifier of the cloud account (required) - * @return GcpUcConfigResponse + * @param tagKey The tag key whose description is being fetched. (required) + * @return CostTagDescriptionResponse * @throws ApiException if fails to make API call */ - public GcpUcConfigResponse getCostGCPUsageCostConfig(Long cloudAccountId) throws ApiException { - return getCostGCPUsageCostConfigWithHttpInfo(cloudAccountId).getData(); + public CostTagDescriptionResponse getCostTagDescriptionByKey(String tagKey) throws ApiException { + return getCostTagDescriptionByKeyWithHttpInfo( + tagKey, new GetCostTagDescriptionByKeyOptionalParameters()) + .getData(); } /** - * Get Google Cloud Usage Cost config. + * Get a Cloud Cost Management tag description. * - *

See {@link #getCostGCPUsageCostConfigWithHttpInfoAsync}. + *

See {@link #getCostTagDescriptionByKeyWithHttpInfoAsync}. * - * @param cloudAccountId The unique identifier of the cloud account (required) - * @return CompletableFuture<GcpUcConfigResponse> + * @param tagKey The tag key whose description is being fetched. (required) + * @return CompletableFuture<CostTagDescriptionResponse> */ - public CompletableFuture getCostGCPUsageCostConfigAsync( - Long cloudAccountId) { - return getCostGCPUsageCostConfigWithHttpInfoAsync(cloudAccountId) + public CompletableFuture getCostTagDescriptionByKeyAsync( + String tagKey) { + return getCostTagDescriptionByKeyWithHttpInfoAsync( + tagKey, new GetCostTagDescriptionByKeyOptionalParameters()) .thenApply( response -> { return response.getData(); @@ -4967,43 +5478,84 @@ public CompletableFuture getCostGCPUsageCostConfigAsync( } /** - * Get a specific Google Cloud Usage Cost config. + * Get a Cloud Cost Management tag description. * - * @param cloudAccountId The unique identifier of the cloud account (required) - * @return ApiResponse<GcpUcConfigResponse> + *

See {@link #getCostTagDescriptionByKeyWithHttpInfo}. + * + * @param tagKey The tag key whose description is being fetched. (required) + * @param parameters Optional parameters for the request. + * @return CostTagDescriptionResponse + * @throws ApiException if fails to make API call + */ + public CostTagDescriptionResponse getCostTagDescriptionByKey( + String tagKey, GetCostTagDescriptionByKeyOptionalParameters parameters) throws ApiException { + return getCostTagDescriptionByKeyWithHttpInfo(tagKey, parameters).getData(); + } + + /** + * Get a Cloud Cost Management tag description. + * + *

See {@link #getCostTagDescriptionByKeyWithHttpInfoAsync}. + * + * @param tagKey The tag key whose description is being fetched. (required) + * @param parameters Optional parameters for the request. + * @return CompletableFuture<CostTagDescriptionResponse> + */ + public CompletableFuture getCostTagDescriptionByKeyAsync( + String tagKey, GetCostTagDescriptionByKeyOptionalParameters parameters) { + return getCostTagDescriptionByKeyWithHttpInfoAsync(tagKey, parameters) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Get the Cloud Cost Management description for a single tag key. Use filter[cloud] + * to scope the lookup to a specific cloud provider; when omitted, the response resolves the + * description in fallback order (cloud-specific organization override, then cloudless + * organization default, then Datadog's global default). + * + * @param tagKey The tag key whose description is being fetched. (required) + * @param parameters Optional parameters for the request. + * @return ApiResponse<CostTagDescriptionResponse> * @throws ApiException if fails to make API call * @http.response.details * * * * + * + * + * * *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
403 Forbidden -
404 Not Found -
429 Too many requests -
*/ - public ApiResponse getCostGCPUsageCostConfigWithHttpInfo(Long cloudAccountId) - throws ApiException { + public ApiResponse getCostTagDescriptionByKeyWithHttpInfo( + String tagKey, GetCostTagDescriptionByKeyOptionalParameters parameters) throws ApiException { Object localVarPostBody = null; - // verify the required parameter 'cloudAccountId' is set - if (cloudAccountId == null) { + // verify the required parameter 'tagKey' is set + if (tagKey == null) { throw new ApiException( - 400, - "Missing the required parameter 'cloudAccountId' when calling getCostGCPUsageCostConfig"); + 400, "Missing the required parameter 'tagKey' when calling getCostTagDescriptionByKey"); } + String filterCloud = parameters.filterCloud; // create path and map variables String localVarPath = - "/api/v2/cost/gcp_uc_config/{cloud_account_id}" - .replaceAll( - "\\{" + "cloud_account_id" + "\\}", - apiClient.escapeString(cloudAccountId.toString())); + "/api/v2/cost/tag_descriptions/{tag_key}" + .replaceAll("\\{" + "tag_key" + "\\}", apiClient.escapeString(tagKey.toString())); + List localVarQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[cloud]", filterCloud)); + Invocation.Builder builder = apiClient.createBuilder( - "v2.CloudCostManagementApi.getCostGCPUsageCostConfig", + "v2.CloudCostManagementApi.getCostTagDescriptionByKey", localVarPath, - new ArrayList(), + localVarQueryParams, localVarHeaderParams, new HashMap(), new String[] {"application/json"}, @@ -5016,53 +5568,56 @@ public ApiResponse getCostGCPUsageCostConfigWithHttpInfo(Lo localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * Get Google Cloud Usage Cost config. + * Get a Cloud Cost Management tag description. * - *

See {@link #getCostGCPUsageCostConfigWithHttpInfo}. + *

See {@link #getCostTagDescriptionByKeyWithHttpInfo}. * - * @param cloudAccountId The unique identifier of the cloud account (required) - * @return CompletableFuture<ApiResponse<GcpUcConfigResponse>> + * @param tagKey The tag key whose description is being fetched. (required) + * @param parameters Optional parameters for the request. + * @return CompletableFuture<ApiResponse<CostTagDescriptionResponse>> */ - public CompletableFuture> - getCostGCPUsageCostConfigWithHttpInfoAsync(Long cloudAccountId) { + public CompletableFuture> + getCostTagDescriptionByKeyWithHttpInfoAsync( + String tagKey, GetCostTagDescriptionByKeyOptionalParameters parameters) { Object localVarPostBody = null; - // verify the required parameter 'cloudAccountId' is set - if (cloudAccountId == null) { - CompletableFuture> result = new CompletableFuture<>(); + // verify the required parameter 'tagKey' is set + if (tagKey == null) { + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( new ApiException( 400, - "Missing the required parameter 'cloudAccountId' when calling" - + " getCostGCPUsageCostConfig")); + "Missing the required parameter 'tagKey' when calling getCostTagDescriptionByKey")); return result; } + String filterCloud = parameters.filterCloud; // create path and map variables String localVarPath = - "/api/v2/cost/gcp_uc_config/{cloud_account_id}" - .replaceAll( - "\\{" + "cloud_account_id" + "\\}", - apiClient.escapeString(cloudAccountId.toString())); + "/api/v2/cost/tag_descriptions/{tag_key}" + .replaceAll("\\{" + "tag_key" + "\\}", apiClient.escapeString(tagKey.toString())); + List localVarQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[cloud]", filterCloud)); + Invocation.Builder builder; try { builder = apiClient.createBuilder( - "v2.CloudCostManagementApi.getCostGCPUsageCostConfig", + "v2.CloudCostManagementApi.getCostTagDescriptionByKey", localVarPath, - new ArrayList(), + localVarQueryParams, localVarHeaderParams, new HashMap(), new String[] {"application/json"}, new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); } catch (ApiException ex) { - CompletableFuture> result = new CompletableFuture<>(); + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally(ex); return result; } @@ -5074,7 +5629,7 @@ public ApiResponse getCostGCPUsageCostConfigWithHttpInfo(Lo localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** Manage optional parameters to getCostTagKey. */ @@ -10442,6 +10997,167 @@ public CompletableFuture> upsertBudgetWithHttpInf new GenericType() {}); } + /** + * Upsert a Cloud Cost Management tag description. + * + *

See {@link #upsertCostTagDescriptionByKeyWithHttpInfo}. + * + * @param tagKey The tag key whose description is being upserted. (required) + * @param body (required) + * @throws ApiException if fails to make API call + */ + public void upsertCostTagDescriptionByKey(String tagKey, CostTagDescriptionUpsertRequest body) + throws ApiException { + upsertCostTagDescriptionByKeyWithHttpInfo(tagKey, body); + } + + /** + * Upsert a Cloud Cost Management tag description. + * + *

See {@link #upsertCostTagDescriptionByKeyWithHttpInfoAsync}. + * + * @param tagKey The tag key whose description is being upserted. (required) + * @param body (required) + * @return CompletableFuture + */ + public CompletableFuture upsertCostTagDescriptionByKeyAsync( + String tagKey, CostTagDescriptionUpsertRequest body) { + return upsertCostTagDescriptionByKeyWithHttpInfoAsync(tagKey, body) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Create or update a Cloud Cost Management tag key description. The new description and optional + * cloud scoping are supplied in the request body. Omit cloud to set a cross-cloud + * default for the tag key. + * + * @param tagKey The tag key whose description is being upserted. (required) + * @param body (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
204 No Content -
400 Bad Request -
403 Forbidden -
429 Too many requests -
+ */ + public ApiResponse upsertCostTagDescriptionByKeyWithHttpInfo( + String tagKey, CostTagDescriptionUpsertRequest body) throws ApiException { + Object localVarPostBody = body; + + // verify the required parameter 'tagKey' is set + if (tagKey == null) { + throw new ApiException( + 400, + "Missing the required parameter 'tagKey' when calling upsertCostTagDescriptionByKey"); + } + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException( + 400, "Missing the required parameter 'body' when calling upsertCostTagDescriptionByKey"); + } + // create path and map variables + String localVarPath = + "/api/v2/cost/tag_descriptions/{tag_key}" + .replaceAll("\\{" + "tag_key" + "\\}", apiClient.escapeString(tagKey.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.CloudCostManagementApi.upsertCostTagDescriptionByKey", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"*/*"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + return apiClient.invokeAPI( + "PUT", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + null); + } + + /** + * Upsert a Cloud Cost Management tag description. + * + *

See {@link #upsertCostTagDescriptionByKeyWithHttpInfo}. + * + * @param tagKey The tag key whose description is being upserted. (required) + * @param body (required) + * @return CompletableFuture<ApiResponse<Void>> + */ + public CompletableFuture> upsertCostTagDescriptionByKeyWithHttpInfoAsync( + String tagKey, CostTagDescriptionUpsertRequest body) { + Object localVarPostBody = body; + + // verify the required parameter 'tagKey' is set + if (tagKey == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'tagKey' when calling" + + " upsertCostTagDescriptionByKey")); + return result; + } + + // verify the required parameter 'body' is set + if (body == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'body' when calling upsertCostTagDescriptionByKey")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/cost/tag_descriptions/{tag_key}" + .replaceAll("\\{" + "tag_key" + "\\}", apiClient.escapeString(tagKey.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.CloudCostManagementApi.upsertCostTagDescriptionByKey", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"*/*"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "PUT", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + null); + } + /** * Validate budget. * diff --git a/src/main/java/com/datadog/api/client/v2/model/AutomationRule.java b/src/main/java/com/datadog/api/client/v2/model/AutomationRule.java new file mode 100644 index 00000000000..5575e55650e --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/AutomationRule.java @@ -0,0 +1,243 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** + * An automation rule that executes an action (such as running a Datadog workflow or assigning an AI + * agent) when a specified case event occurs within a project. + */ +@JsonPropertyOrder({ + AutomationRule.JSON_PROPERTY_ATTRIBUTES, + AutomationRule.JSON_PROPERTY_ID, + AutomationRule.JSON_PROPERTY_RELATIONSHIPS, + AutomationRule.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class AutomationRule { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private AutomationRuleAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_RELATIONSHIPS = "relationships"; + private AutomationRuleRelationships relationships; + + public static final String JSON_PROPERTY_TYPE = "type"; + private CaseAutomationRuleResourceType type = CaseAutomationRuleResourceType.RULE; + + public AutomationRule() {} + + @JsonCreator + public AutomationRule( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + AutomationRuleAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) + CaseAutomationRuleResourceType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public AutomationRule attributes(AutomationRuleAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Core attributes of an automation rule, including its name, trigger condition, action to + * execute, and current state. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public AutomationRuleAttributes getAttributes() { + return attributes; + } + + public void setAttributes(AutomationRuleAttributes attributes) { + this.attributes = attributes; + } + + public AutomationRule id(String id) { + this.id = id; + return this; + } + + /** + * Automation rule identifier. + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public AutomationRule relationships(AutomationRuleRelationships relationships) { + this.relationships = relationships; + this.unparsed |= relationships.unparsed; + return this; + } + + /** + * Related resources for the automation rule, including the users who created and last modified + * it. + * + * @return relationships + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_RELATIONSHIPS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public AutomationRuleRelationships getRelationships() { + return relationships; + } + + public void setRelationships(AutomationRuleRelationships relationships) { + this.relationships = relationships; + } + + public AutomationRule type(CaseAutomationRuleResourceType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * JSON:API resource type for case automation rules. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public CaseAutomationRuleResourceType getType() { + return type; + } + + public void setType(CaseAutomationRuleResourceType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return AutomationRule + */ + @JsonAnySetter + public AutomationRule putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this AutomationRule object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AutomationRule automationRule = (AutomationRule) o; + return Objects.equals(this.attributes, automationRule.attributes) + && Objects.equals(this.id, automationRule.id) + && Objects.equals(this.relationships, automationRule.relationships) + && Objects.equals(this.type, automationRule.type) + && Objects.equals(this.additionalProperties, automationRule.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, relationships, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AutomationRule {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" relationships: ").append(toIndentedString(relationships)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/AutomationRuleAction.java b/src/main/java/com/datadog/api/client/v2/model/AutomationRuleAction.java new file mode 100644 index 00000000000..287b422b7c7 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/AutomationRuleAction.java @@ -0,0 +1,184 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** + * Defines what happens when the rule triggers. Combines an action type with action-specific + * configuration data. + */ +@JsonPropertyOrder({ + AutomationRuleAction.JSON_PROPERTY_DATA, + AutomationRuleAction.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class AutomationRuleAction { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private AutomationRuleActionData data; + + public static final String JSON_PROPERTY_TYPE = "type"; + private AutomationRuleActionType type; + + public AutomationRuleAction() {} + + @JsonCreator + public AutomationRuleAction( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) AutomationRuleActionData data, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) AutomationRuleActionType type) { + this.data = data; + this.unparsed |= data.unparsed; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public AutomationRuleAction data(AutomationRuleActionData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Configuration for the action to execute, dependent on the action type. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public AutomationRuleActionData getData() { + return data; + } + + public void setData(AutomationRuleActionData data) { + this.data = data; + } + + public AutomationRuleAction type(AutomationRuleActionType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * The type of automated action to perform when the rule triggers. execute_workflow + * runs a Datadog workflow; assign_agent assigns an AI agent to the case. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public AutomationRuleActionType getType() { + return type; + } + + public void setType(AutomationRuleActionType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return AutomationRuleAction + */ + @JsonAnySetter + public AutomationRuleAction putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this AutomationRuleAction object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AutomationRuleAction automationRuleAction = (AutomationRuleAction) o; + return Objects.equals(this.data, automationRuleAction.data) + && Objects.equals(this.type, automationRuleAction.type) + && Objects.equals(this.additionalProperties, automationRuleAction.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AutomationRuleAction {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/AutomationRuleActionData.java b/src/main/java/com/datadog/api/client/v2/model/AutomationRuleActionData.java new file mode 100644 index 00000000000..64b494ec498 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/AutomationRuleActionData.java @@ -0,0 +1,193 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Configuration for the action to execute, dependent on the action type. */ +@JsonPropertyOrder({ + AutomationRuleActionData.JSON_PROPERTY_AGENT_TYPE, + AutomationRuleActionData.JSON_PROPERTY_ASSIGNED_AGENT_ID, + AutomationRuleActionData.JSON_PROPERTY_HANDLE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class AutomationRuleActionData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_AGENT_TYPE = "agent_type"; + private String agentType; + + public static final String JSON_PROPERTY_ASSIGNED_AGENT_ID = "assigned_agent_id"; + private String assignedAgentId; + + public static final String JSON_PROPERTY_HANDLE = "handle"; + private String handle; + + public AutomationRuleActionData agentType(String agentType) { + this.agentType = agentType; + return this; + } + + /** + * The type of AI agent to assign. Required when the action type is assign_agent. + * + * @return agentType + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_AGENT_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAgentType() { + return agentType; + } + + public void setAgentType(String agentType) { + this.agentType = agentType; + } + + public AutomationRuleActionData assignedAgentId(String assignedAgentId) { + this.assignedAgentId = assignedAgentId; + return this; + } + + /** + * The identifier of the AI agent to assign to the case. Required when the action type is + * assign_agent. + * + * @return assignedAgentId + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ASSIGNED_AGENT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAssignedAgentId() { + return assignedAgentId; + } + + public void setAssignedAgentId(String assignedAgentId) { + this.assignedAgentId = assignedAgentId; + } + + public AutomationRuleActionData handle(String handle) { + this.handle = handle; + return this; + } + + /** + * The handle of the Datadog workflow to execute. Required when the action type is + * execute_workflow. + * + * @return handle + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_HANDLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getHandle() { + return handle; + } + + public void setHandle(String handle) { + this.handle = handle; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return AutomationRuleActionData + */ + @JsonAnySetter + public AutomationRuleActionData putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this AutomationRuleActionData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AutomationRuleActionData automationRuleActionData = (AutomationRuleActionData) o; + return Objects.equals(this.agentType, automationRuleActionData.agentType) + && Objects.equals(this.assignedAgentId, automationRuleActionData.assignedAgentId) + && Objects.equals(this.handle, automationRuleActionData.handle) + && Objects.equals(this.additionalProperties, automationRuleActionData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(agentType, assignedAgentId, handle, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AutomationRuleActionData {\n"); + sb.append(" agentType: ").append(toIndentedString(agentType)).append("\n"); + sb.append(" assignedAgentId: ").append(toIndentedString(assignedAgentId)).append("\n"); + sb.append(" handle: ").append(toIndentedString(handle)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/AutomationRuleActionType.java b/src/main/java/com/datadog/api/client/v2/model/AutomationRuleActionType.java new file mode 100644 index 00000000000..2796864a658 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/AutomationRuleActionType.java @@ -0,0 +1,62 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** + * The type of automated action to perform when the rule triggers. execute_workflow + * runs a Datadog workflow; assign_agent assigns an AI agent to the case. + */ +@JsonSerialize(using = AutomationRuleActionType.AutomationRuleActionTypeSerializer.class) +public class AutomationRuleActionType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("execute_workflow", "assign_agent")); + + public static final AutomationRuleActionType EXECUTE_WORKFLOW = + new AutomationRuleActionType("execute_workflow"); + public static final AutomationRuleActionType ASSIGN_AGENT = + new AutomationRuleActionType("assign_agent"); + + AutomationRuleActionType(String value) { + super(value, allowedValues); + } + + public static class AutomationRuleActionTypeSerializer + extends StdSerializer { + public AutomationRuleActionTypeSerializer(Class t) { + super(t); + } + + public AutomationRuleActionTypeSerializer() { + this(null); + } + + @Override + public void serialize( + AutomationRuleActionType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static AutomationRuleActionType fromValue(String value) { + return new AutomationRuleActionType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/AutomationRuleAttributes.java b/src/main/java/com/datadog/api/client/v2/model/AutomationRuleAttributes.java new file mode 100644 index 00000000000..76378003bbf --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/AutomationRuleAttributes.java @@ -0,0 +1,283 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** + * Core attributes of an automation rule, including its name, trigger condition, action to execute, + * and current state. + */ +@JsonPropertyOrder({ + AutomationRuleAttributes.JSON_PROPERTY_ACTION, + AutomationRuleAttributes.JSON_PROPERTY_CREATED_AT, + AutomationRuleAttributes.JSON_PROPERTY_MODIFIED_AT, + AutomationRuleAttributes.JSON_PROPERTY_NAME, + AutomationRuleAttributes.JSON_PROPERTY_STATE, + AutomationRuleAttributes.JSON_PROPERTY_TRIGGER +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class AutomationRuleAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ACTION = "action"; + private AutomationRuleAction action; + + public static final String JSON_PROPERTY_CREATED_AT = "created_at"; + private OffsetDateTime createdAt; + + public static final String JSON_PROPERTY_MODIFIED_AT = "modified_at"; + private OffsetDateTime modifiedAt; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_STATE = "state"; + private CaseAutomationRuleState state; + + public static final String JSON_PROPERTY_TRIGGER = "trigger"; + private AutomationRuleTrigger trigger; + + public AutomationRuleAttributes() {} + + @JsonCreator + public AutomationRuleAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_ACTION) AutomationRuleAction action, + @JsonProperty(required = true, value = JSON_PROPERTY_CREATED_AT) OffsetDateTime createdAt, + @JsonProperty(required = true, value = JSON_PROPERTY_NAME) String name, + @JsonProperty(required = true, value = JSON_PROPERTY_STATE) CaseAutomationRuleState state, + @JsonProperty(required = true, value = JSON_PROPERTY_TRIGGER) AutomationRuleTrigger trigger) { + this.action = action; + this.unparsed |= action.unparsed; + this.createdAt = createdAt; + this.name = name; + this.state = state; + this.unparsed |= !state.isValid(); + this.trigger = trigger; + this.unparsed |= trigger.unparsed; + } + + public AutomationRuleAttributes action(AutomationRuleAction action) { + this.action = action; + this.unparsed |= action.unparsed; + return this; + } + + /** + * Defines what happens when the rule triggers. Combines an action type with action-specific + * configuration data. + * + * @return action + */ + @JsonProperty(JSON_PROPERTY_ACTION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public AutomationRuleAction getAction() { + return action; + } + + public void setAction(AutomationRuleAction action) { + this.action = action; + } + + /** + * Timestamp when the automation rule was created. + * + * @return createdAt + */ + @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + /** + * Timestamp when the automation rule was last modified. + * + * @return modifiedAt + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MODIFIED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getModifiedAt() { + return modifiedAt; + } + + public AutomationRuleAttributes name(String name) { + this.name = name; + return this; + } + + /** + * A human-readable name for the automation rule, used to identify the rule in the UI and API + * responses. + * + * @return name + */ + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public AutomationRuleAttributes state(CaseAutomationRuleState state) { + this.state = state; + this.unparsed |= !state.isValid(); + return this; + } + + /** + * Whether the automation rule is active. Enabled rules trigger on matching case events; disabled + * rules are inactive but preserve their configuration. + * + * @return state + */ + @JsonProperty(JSON_PROPERTY_STATE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public CaseAutomationRuleState getState() { + return state; + } + + public void setState(CaseAutomationRuleState state) { + if (!state.isValid()) { + this.unparsed = true; + } + this.state = state; + } + + public AutomationRuleAttributes trigger(AutomationRuleTrigger trigger) { + this.trigger = trigger; + this.unparsed |= trigger.unparsed; + return this; + } + + /** + * Defines when the rule activates. Combines a trigger type (the case event to listen for) with + * optional trigger data (conditions that narrow when the trigger fires). + * + * @return trigger + */ + @JsonProperty(JSON_PROPERTY_TRIGGER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public AutomationRuleTrigger getTrigger() { + return trigger; + } + + public void setTrigger(AutomationRuleTrigger trigger) { + this.trigger = trigger; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return AutomationRuleAttributes + */ + @JsonAnySetter + public AutomationRuleAttributes putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this AutomationRuleAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AutomationRuleAttributes automationRuleAttributes = (AutomationRuleAttributes) o; + return Objects.equals(this.action, automationRuleAttributes.action) + && Objects.equals(this.createdAt, automationRuleAttributes.createdAt) + && Objects.equals(this.modifiedAt, automationRuleAttributes.modifiedAt) + && Objects.equals(this.name, automationRuleAttributes.name) + && Objects.equals(this.state, automationRuleAttributes.state) + && Objects.equals(this.trigger, automationRuleAttributes.trigger) + && Objects.equals(this.additionalProperties, automationRuleAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(action, createdAt, modifiedAt, name, state, trigger, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AutomationRuleAttributes {\n"); + sb.append(" action: ").append(toIndentedString(action)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" modifiedAt: ").append(toIndentedString(modifiedAt)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" state: ").append(toIndentedString(state)).append("\n"); + sb.append(" trigger: ").append(toIndentedString(trigger)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/AutomationRuleCreate.java b/src/main/java/com/datadog/api/client/v2/model/AutomationRuleCreate.java new file mode 100644 index 00000000000..372adfdda72 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/AutomationRuleCreate.java @@ -0,0 +1,182 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Data object for creating an automation rule. */ +@JsonPropertyOrder({ + AutomationRuleCreate.JSON_PROPERTY_ATTRIBUTES, + AutomationRuleCreate.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class AutomationRuleCreate { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private AutomationRuleCreateAttributes attributes; + + public static final String JSON_PROPERTY_TYPE = "type"; + private CaseAutomationRuleResourceType type = CaseAutomationRuleResourceType.RULE; + + public AutomationRuleCreate() {} + + @JsonCreator + public AutomationRuleCreate( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + AutomationRuleCreateAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) + CaseAutomationRuleResourceType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public AutomationRuleCreate attributes(AutomationRuleCreateAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes required to create an automation rule. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public AutomationRuleCreateAttributes getAttributes() { + return attributes; + } + + public void setAttributes(AutomationRuleCreateAttributes attributes) { + this.attributes = attributes; + } + + public AutomationRuleCreate type(CaseAutomationRuleResourceType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * JSON:API resource type for case automation rules. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public CaseAutomationRuleResourceType getType() { + return type; + } + + public void setType(CaseAutomationRuleResourceType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return AutomationRuleCreate + */ + @JsonAnySetter + public AutomationRuleCreate putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this AutomationRuleCreate object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AutomationRuleCreate automationRuleCreate = (AutomationRuleCreate) o; + return Objects.equals(this.attributes, automationRuleCreate.attributes) + && Objects.equals(this.type, automationRuleCreate.type) + && Objects.equals(this.additionalProperties, automationRuleCreate.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AutomationRuleCreate {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/AutomationRuleCreateAttributes.java b/src/main/java/com/datadog/api/client/v2/model/AutomationRuleCreateAttributes.java new file mode 100644 index 00000000000..e86bf50fe9e --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/AutomationRuleCreateAttributes.java @@ -0,0 +1,241 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Attributes required to create an automation rule. */ +@JsonPropertyOrder({ + AutomationRuleCreateAttributes.JSON_PROPERTY_ACTION, + AutomationRuleCreateAttributes.JSON_PROPERTY_NAME, + AutomationRuleCreateAttributes.JSON_PROPERTY_STATE, + AutomationRuleCreateAttributes.JSON_PROPERTY_TRIGGER +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class AutomationRuleCreateAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ACTION = "action"; + private AutomationRuleAction action; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_STATE = "state"; + private CaseAutomationRuleState state; + + public static final String JSON_PROPERTY_TRIGGER = "trigger"; + private AutomationRuleTrigger trigger; + + public AutomationRuleCreateAttributes() {} + + @JsonCreator + public AutomationRuleCreateAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_ACTION) AutomationRuleAction action, + @JsonProperty(required = true, value = JSON_PROPERTY_NAME) String name, + @JsonProperty(required = true, value = JSON_PROPERTY_TRIGGER) AutomationRuleTrigger trigger) { + this.action = action; + this.unparsed |= action.unparsed; + this.name = name; + this.trigger = trigger; + this.unparsed |= trigger.unparsed; + } + + public AutomationRuleCreateAttributes action(AutomationRuleAction action) { + this.action = action; + this.unparsed |= action.unparsed; + return this; + } + + /** + * Defines what happens when the rule triggers. Combines an action type with action-specific + * configuration data. + * + * @return action + */ + @JsonProperty(JSON_PROPERTY_ACTION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public AutomationRuleAction getAction() { + return action; + } + + public void setAction(AutomationRuleAction action) { + this.action = action; + } + + public AutomationRuleCreateAttributes name(String name) { + this.name = name; + return this; + } + + /** + * Name of the automation rule. + * + * @return name + */ + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public AutomationRuleCreateAttributes state(CaseAutomationRuleState state) { + this.state = state; + this.unparsed |= !state.isValid(); + return this; + } + + /** + * Whether the automation rule is active. Enabled rules trigger on matching case events; disabled + * rules are inactive but preserve their configuration. + * + * @return state + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_STATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public CaseAutomationRuleState getState() { + return state; + } + + public void setState(CaseAutomationRuleState state) { + if (!state.isValid()) { + this.unparsed = true; + } + this.state = state; + } + + public AutomationRuleCreateAttributes trigger(AutomationRuleTrigger trigger) { + this.trigger = trigger; + this.unparsed |= trigger.unparsed; + return this; + } + + /** + * Defines when the rule activates. Combines a trigger type (the case event to listen for) with + * optional trigger data (conditions that narrow when the trigger fires). + * + * @return trigger + */ + @JsonProperty(JSON_PROPERTY_TRIGGER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public AutomationRuleTrigger getTrigger() { + return trigger; + } + + public void setTrigger(AutomationRuleTrigger trigger) { + this.trigger = trigger; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return AutomationRuleCreateAttributes + */ + @JsonAnySetter + public AutomationRuleCreateAttributes putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this AutomationRuleCreateAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AutomationRuleCreateAttributes automationRuleCreateAttributes = + (AutomationRuleCreateAttributes) o; + return Objects.equals(this.action, automationRuleCreateAttributes.action) + && Objects.equals(this.name, automationRuleCreateAttributes.name) + && Objects.equals(this.state, automationRuleCreateAttributes.state) + && Objects.equals(this.trigger, automationRuleCreateAttributes.trigger) + && Objects.equals( + this.additionalProperties, automationRuleCreateAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(action, name, state, trigger, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AutomationRuleCreateAttributes {\n"); + sb.append(" action: ").append(toIndentedString(action)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" state: ").append(toIndentedString(state)).append("\n"); + sb.append(" trigger: ").append(toIndentedString(trigger)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/AutomationRuleCreateRequest.java b/src/main/java/com/datadog/api/client/v2/model/AutomationRuleCreateRequest.java new file mode 100644 index 00000000000..872bf777dad --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/AutomationRuleCreateRequest.java @@ -0,0 +1,146 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Request payload for creating an automation rule. */ +@JsonPropertyOrder({AutomationRuleCreateRequest.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class AutomationRuleCreateRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private AutomationRuleCreate data; + + public AutomationRuleCreateRequest() {} + + @JsonCreator + public AutomationRuleCreateRequest( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) AutomationRuleCreate data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public AutomationRuleCreateRequest data(AutomationRuleCreate data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Data object for creating an automation rule. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public AutomationRuleCreate getData() { + return data; + } + + public void setData(AutomationRuleCreate data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return AutomationRuleCreateRequest + */ + @JsonAnySetter + public AutomationRuleCreateRequest putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this AutomationRuleCreateRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AutomationRuleCreateRequest automationRuleCreateRequest = (AutomationRuleCreateRequest) o; + return Objects.equals(this.data, automationRuleCreateRequest.data) + && Objects.equals( + this.additionalProperties, automationRuleCreateRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AutomationRuleCreateRequest {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/AutomationRuleRelationships.java b/src/main/java/com/datadog/api/client/v2/model/AutomationRuleRelationships.java new file mode 100644 index 00000000000..8157b587018 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/AutomationRuleRelationships.java @@ -0,0 +1,190 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.openapitools.jackson.nullable.JsonNullable; + +/** + * Related resources for the automation rule, including the users who created and last modified it. + */ +@JsonPropertyOrder({ + AutomationRuleRelationships.JSON_PROPERTY_CREATED_BY, + AutomationRuleRelationships.JSON_PROPERTY_MODIFIED_BY +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class AutomationRuleRelationships { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_CREATED_BY = "created_by"; + private JsonNullable createdBy = + JsonNullable.undefined(); + + public static final String JSON_PROPERTY_MODIFIED_BY = "modified_by"; + private JsonNullable modifiedBy = + JsonNullable.undefined(); + + public AutomationRuleRelationships createdBy(NullableUserRelationship createdBy) { + this.createdBy = JsonNullable.of(createdBy); + return this; + } + + /** + * Relationship to user. + * + * @return createdBy + */ + @jakarta.annotation.Nullable + @JsonIgnore + public NullableUserRelationship getCreatedBy() { + return createdBy.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_CREATED_BY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getCreatedBy_JsonNullable() { + return createdBy; + } + + @JsonProperty(JSON_PROPERTY_CREATED_BY) + public void setCreatedBy_JsonNullable(JsonNullable createdBy) { + this.createdBy = createdBy; + } + + public void setCreatedBy(NullableUserRelationship createdBy) { + this.createdBy = JsonNullable.of(createdBy); + } + + public AutomationRuleRelationships modifiedBy(NullableUserRelationship modifiedBy) { + this.modifiedBy = JsonNullable.of(modifiedBy); + return this; + } + + /** + * Relationship to user. + * + * @return modifiedBy + */ + @jakarta.annotation.Nullable + @JsonIgnore + public NullableUserRelationship getModifiedBy() { + return modifiedBy.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_MODIFIED_BY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getModifiedBy_JsonNullable() { + return modifiedBy; + } + + @JsonProperty(JSON_PROPERTY_MODIFIED_BY) + public void setModifiedBy_JsonNullable(JsonNullable modifiedBy) { + this.modifiedBy = modifiedBy; + } + + public void setModifiedBy(NullableUserRelationship modifiedBy) { + this.modifiedBy = JsonNullable.of(modifiedBy); + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return AutomationRuleRelationships + */ + @JsonAnySetter + public AutomationRuleRelationships putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this AutomationRuleRelationships object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AutomationRuleRelationships automationRuleRelationships = (AutomationRuleRelationships) o; + return Objects.equals(this.createdBy, automationRuleRelationships.createdBy) + && Objects.equals(this.modifiedBy, automationRuleRelationships.modifiedBy) + && Objects.equals( + this.additionalProperties, automationRuleRelationships.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(createdBy, modifiedBy, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AutomationRuleRelationships {\n"); + sb.append(" createdBy: ").append(toIndentedString(createdBy)).append("\n"); + sb.append(" modifiedBy: ").append(toIndentedString(modifiedBy)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/AutomationRuleResponse.java b/src/main/java/com/datadog/api/client/v2/model/AutomationRuleResponse.java new file mode 100644 index 00000000000..b1e1ca19c56 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/AutomationRuleResponse.java @@ -0,0 +1,146 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Response containing a single automation rule. */ +@JsonPropertyOrder({AutomationRuleResponse.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class AutomationRuleResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private AutomationRule data; + + public AutomationRuleResponse() {} + + @JsonCreator + public AutomationRuleResponse( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) AutomationRule data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public AutomationRuleResponse data(AutomationRule data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * An automation rule that executes an action (such as running a Datadog workflow or assigning an + * AI agent) when a specified case event occurs within a project. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public AutomationRule getData() { + return data; + } + + public void setData(AutomationRule data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return AutomationRuleResponse + */ + @JsonAnySetter + public AutomationRuleResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this AutomationRuleResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AutomationRuleResponse automationRuleResponse = (AutomationRuleResponse) o; + return Objects.equals(this.data, automationRuleResponse.data) + && Objects.equals(this.additionalProperties, automationRuleResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AutomationRuleResponse {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/AutomationRuleTrigger.java b/src/main/java/com/datadog/api/client/v2/model/AutomationRuleTrigger.java new file mode 100644 index 00000000000..99df71c4eb2 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/AutomationRuleTrigger.java @@ -0,0 +1,184 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** + * Defines when the rule activates. Combines a trigger type (the case event to listen for) with + * optional trigger data (conditions that narrow when the trigger fires). + */ +@JsonPropertyOrder({ + AutomationRuleTrigger.JSON_PROPERTY_DATA, + AutomationRuleTrigger.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class AutomationRuleTrigger { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private AutomationRuleTriggerData data; + + public static final String JSON_PROPERTY_TYPE = "type"; + private AutomationRuleTriggerType type; + + public AutomationRuleTrigger() {} + + @JsonCreator + public AutomationRuleTrigger( + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) AutomationRuleTriggerType type) { + this.type = type; + this.unparsed |= !type.isValid(); + } + + public AutomationRuleTrigger data(AutomationRuleTriggerData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Additional configuration for the trigger, dependent on the trigger type. For + * status_transitioned triggers, specify from_status_name and + * to_status_name. For attribute_value_changed triggers, specify field + * and change_type. + * + * @return data + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public AutomationRuleTriggerData getData() { + return data; + } + + public void setData(AutomationRuleTriggerData data) { + this.data = data; + } + + public AutomationRuleTrigger type(AutomationRuleTriggerType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * The case event that activates the automation rule. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public AutomationRuleTriggerType getType() { + return type; + } + + public void setType(AutomationRuleTriggerType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return AutomationRuleTrigger + */ + @JsonAnySetter + public AutomationRuleTrigger putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this AutomationRuleTrigger object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AutomationRuleTrigger automationRuleTrigger = (AutomationRuleTrigger) o; + return Objects.equals(this.data, automationRuleTrigger.data) + && Objects.equals(this.type, automationRuleTrigger.type) + && Objects.equals(this.additionalProperties, automationRuleTrigger.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AutomationRuleTrigger {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/AutomationRuleTriggerData.java b/src/main/java/com/datadog/api/client/v2/model/AutomationRuleTriggerData.java new file mode 100644 index 00000000000..beb725f2d37 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/AutomationRuleTriggerData.java @@ -0,0 +1,257 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** + * Additional configuration for the trigger, dependent on the trigger type. For + * status_transitioned triggers, specify from_status_name and + * to_status_name. For attribute_value_changed triggers, specify field + * and change_type. + */ +@JsonPropertyOrder({ + AutomationRuleTriggerData.JSON_PROPERTY_APPROVAL_TYPE, + AutomationRuleTriggerData.JSON_PROPERTY_CHANGE_TYPE, + AutomationRuleTriggerData.JSON_PROPERTY_FIELD, + AutomationRuleTriggerData.JSON_PROPERTY_FROM_STATUS_NAME, + AutomationRuleTriggerData.JSON_PROPERTY_TO_STATUS_NAME +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class AutomationRuleTriggerData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_APPROVAL_TYPE = "approval_type"; + private String approvalType; + + public static final String JSON_PROPERTY_CHANGE_TYPE = "change_type"; + private String changeType; + + public static final String JSON_PROPERTY_FIELD = "field"; + private String field; + + public static final String JSON_PROPERTY_FROM_STATUS_NAME = "from_status_name"; + private String fromStatusName; + + public static final String JSON_PROPERTY_TO_STATUS_NAME = "to_status_name"; + private String toStatusName; + + public AutomationRuleTriggerData approvalType(String approvalType) { + this.approvalType = approvalType; + return this; + } + + /** + * The approval outcome to match. Used with case_review_approved triggers. + * + * @return approvalType + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_APPROVAL_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getApprovalType() { + return approvalType; + } + + public void setApprovalType(String approvalType) { + this.approvalType = approvalType; + } + + public AutomationRuleTriggerData changeType(String changeType) { + this.changeType = changeType; + return this; + } + + /** + * The kind of attribute change to match. Allowed values: VALUE_ADDED, + * VALUE_DELETED, ANY_CHANGES. Used with attribute_value_changed + * triggers. + * + * @return changeType + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CHANGE_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getChangeType() { + return changeType; + } + + public void setChangeType(String changeType) { + this.changeType = changeType; + } + + public AutomationRuleTriggerData field(String field) { + this.field = field; + return this; + } + + /** + * The case attribute field name to monitor for changes. Used with attribute_value_changed + * triggers. + * + * @return field + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FIELD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getField() { + return field; + } + + public void setField(String field) { + this.field = field; + } + + public AutomationRuleTriggerData fromStatusName(String fromStatusName) { + this.fromStatusName = fromStatusName; + return this; + } + + /** + * The originating status name. Used with status_transitioned triggers to match + * transitions from this status. + * + * @return fromStatusName + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FROM_STATUS_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getFromStatusName() { + return fromStatusName; + } + + public void setFromStatusName(String fromStatusName) { + this.fromStatusName = fromStatusName; + } + + public AutomationRuleTriggerData toStatusName(String toStatusName) { + this.toStatusName = toStatusName; + return this; + } + + /** + * The destination status name. Used with status_transitioned triggers to match + * transitions to this status. + * + * @return toStatusName + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TO_STATUS_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getToStatusName() { + return toStatusName; + } + + public void setToStatusName(String toStatusName) { + this.toStatusName = toStatusName; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return AutomationRuleTriggerData + */ + @JsonAnySetter + public AutomationRuleTriggerData putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this AutomationRuleTriggerData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AutomationRuleTriggerData automationRuleTriggerData = (AutomationRuleTriggerData) o; + return Objects.equals(this.approvalType, automationRuleTriggerData.approvalType) + && Objects.equals(this.changeType, automationRuleTriggerData.changeType) + && Objects.equals(this.field, automationRuleTriggerData.field) + && Objects.equals(this.fromStatusName, automationRuleTriggerData.fromStatusName) + && Objects.equals(this.toStatusName, automationRuleTriggerData.toStatusName) + && Objects.equals( + this.additionalProperties, automationRuleTriggerData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + approvalType, changeType, field, fromStatusName, toStatusName, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AutomationRuleTriggerData {\n"); + sb.append(" approvalType: ").append(toIndentedString(approvalType)).append("\n"); + sb.append(" changeType: ").append(toIndentedString(changeType)).append("\n"); + sb.append(" field: ").append(toIndentedString(field)).append("\n"); + sb.append(" fromStatusName: ").append(toIndentedString(fromStatusName)).append("\n"); + sb.append(" toStatusName: ").append(toIndentedString(toStatusName)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/AutomationRuleTriggerType.java b/src/main/java/com/datadog/api/client/v2/model/AutomationRuleTriggerType.java new file mode 100644 index 00000000000..3192f726760 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/AutomationRuleTriggerType.java @@ -0,0 +1,74 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** The case event that activates the automation rule. */ +@JsonSerialize(using = AutomationRuleTriggerType.AutomationRuleTriggerTypeSerializer.class) +public class AutomationRuleTriggerType extends ModelEnum { + + private static final Set allowedValues = + new HashSet( + Arrays.asList( + "case_created", + "status_transitioned", + "attribute_value_changed", + "event_correlation_signal_correlated", + "case_review_approved", + "comment_added")); + + public static final AutomationRuleTriggerType CASE_CREATED = + new AutomationRuleTriggerType("case_created"); + public static final AutomationRuleTriggerType STATUS_TRANSITIONED = + new AutomationRuleTriggerType("status_transitioned"); + public static final AutomationRuleTriggerType ATTRIBUTE_VALUE_CHANGED = + new AutomationRuleTriggerType("attribute_value_changed"); + public static final AutomationRuleTriggerType EVENT_CORRELATION_SIGNAL_CORRELATED = + new AutomationRuleTriggerType("event_correlation_signal_correlated"); + public static final AutomationRuleTriggerType CASE_REVIEW_APPROVED = + new AutomationRuleTriggerType("case_review_approved"); + public static final AutomationRuleTriggerType COMMENT_ADDED = + new AutomationRuleTriggerType("comment_added"); + + AutomationRuleTriggerType(String value) { + super(value, allowedValues); + } + + public static class AutomationRuleTriggerTypeSerializer + extends StdSerializer { + public AutomationRuleTriggerTypeSerializer(Class t) { + super(t); + } + + public AutomationRuleTriggerTypeSerializer() { + this(null); + } + + @Override + public void serialize( + AutomationRuleTriggerType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static AutomationRuleTriggerType fromValue(String value) { + return new AutomationRuleTriggerType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/AutomationRuleUpdate.java b/src/main/java/com/datadog/api/client/v2/model/AutomationRuleUpdate.java new file mode 100644 index 00000000000..cf962437a05 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/AutomationRuleUpdate.java @@ -0,0 +1,179 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Data object for updating an automation rule. */ +@JsonPropertyOrder({ + AutomationRuleUpdate.JSON_PROPERTY_ATTRIBUTES, + AutomationRuleUpdate.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class AutomationRuleUpdate { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private AutomationRuleCreateAttributes attributes; + + public static final String JSON_PROPERTY_TYPE = "type"; + private CaseAutomationRuleResourceType type = CaseAutomationRuleResourceType.RULE; + + public AutomationRuleUpdate() {} + + @JsonCreator + public AutomationRuleUpdate( + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) + CaseAutomationRuleResourceType type) { + this.type = type; + this.unparsed |= !type.isValid(); + } + + public AutomationRuleUpdate attributes(AutomationRuleCreateAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes required to create an automation rule. + * + * @return attributes + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public AutomationRuleCreateAttributes getAttributes() { + return attributes; + } + + public void setAttributes(AutomationRuleCreateAttributes attributes) { + this.attributes = attributes; + } + + public AutomationRuleUpdate type(CaseAutomationRuleResourceType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * JSON:API resource type for case automation rules. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public CaseAutomationRuleResourceType getType() { + return type; + } + + public void setType(CaseAutomationRuleResourceType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return AutomationRuleUpdate + */ + @JsonAnySetter + public AutomationRuleUpdate putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this AutomationRuleUpdate object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AutomationRuleUpdate automationRuleUpdate = (AutomationRuleUpdate) o; + return Objects.equals(this.attributes, automationRuleUpdate.attributes) + && Objects.equals(this.type, automationRuleUpdate.type) + && Objects.equals(this.additionalProperties, automationRuleUpdate.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AutomationRuleUpdate {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/AutomationRuleUpdateRequest.java b/src/main/java/com/datadog/api/client/v2/model/AutomationRuleUpdateRequest.java new file mode 100644 index 00000000000..099c904798b --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/AutomationRuleUpdateRequest.java @@ -0,0 +1,146 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Request payload for updating an automation rule. */ +@JsonPropertyOrder({AutomationRuleUpdateRequest.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class AutomationRuleUpdateRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private AutomationRuleUpdate data; + + public AutomationRuleUpdateRequest() {} + + @JsonCreator + public AutomationRuleUpdateRequest( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) AutomationRuleUpdate data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public AutomationRuleUpdateRequest data(AutomationRuleUpdate data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Data object for updating an automation rule. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public AutomationRuleUpdate getData() { + return data; + } + + public void setData(AutomationRuleUpdate data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return AutomationRuleUpdateRequest + */ + @JsonAnySetter + public AutomationRuleUpdateRequest putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this AutomationRuleUpdateRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AutomationRuleUpdateRequest automationRuleUpdateRequest = (AutomationRuleUpdateRequest) o; + return Objects.equals(this.data, automationRuleUpdateRequest.data) + && Objects.equals( + this.additionalProperties, automationRuleUpdateRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AutomationRuleUpdateRequest {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/AutomationRulesResponse.java b/src/main/java/com/datadog/api/client/v2/model/AutomationRulesResponse.java new file mode 100644 index 00000000000..5815cb7ac57 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/AutomationRulesResponse.java @@ -0,0 +1,154 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** Response containing a list of automation rules for a project. */ +@JsonPropertyOrder({AutomationRulesResponse.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class AutomationRulesResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private List data = new ArrayList<>(); + + public AutomationRulesResponse() {} + + @JsonCreator + public AutomationRulesResponse( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) List data) { + this.data = data; + } + + public AutomationRulesResponse data(List data) { + this.data = data; + for (AutomationRule item : data) { + this.unparsed |= item.unparsed; + } + return this; + } + + public AutomationRulesResponse addDataItem(AutomationRule dataItem) { + this.data.add(dataItem); + this.unparsed |= dataItem.unparsed; + return this; + } + + /** + * List of automation rules. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return AutomationRulesResponse + */ + @JsonAnySetter + public AutomationRulesResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this AutomationRulesResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AutomationRulesResponse automationRulesResponse = (AutomationRulesResponse) o; + return Objects.equals(this.data, automationRulesResponse.data) + && Objects.equals(this.additionalProperties, automationRulesResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AutomationRulesResponse {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/Case.java b/src/main/java/com/datadog/api/client/v2/model/Case.java index 2fcd203b01b..af9dfc2d72d 100644 --- a/src/main/java/com/datadog/api/client/v2/model/Case.java +++ b/src/main/java/com/datadog/api/client/v2/model/Case.java @@ -124,7 +124,7 @@ public Case type(CaseResourceType type) { } /** - * Case resource type + * JSON:API resource type for cases. * * @return type */ diff --git a/src/main/java/com/datadog/api/client/v2/model/CaseAggregateGroup.java b/src/main/java/com/datadog/api/client/v2/model/CaseAggregateGroup.java new file mode 100644 index 00000000000..1cdb74a4eb8 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CaseAggregateGroup.java @@ -0,0 +1,181 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** + * A single group within the aggregation results, containing the group key and its associated count + * values. + */ +@JsonPropertyOrder({CaseAggregateGroup.JSON_PROPERTY_GROUP, CaseAggregateGroup.JSON_PROPERTY_VALUE}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CaseAggregateGroup { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_GROUP = "group"; + private String group; + + public static final String JSON_PROPERTY_VALUE = "value"; + private List value = new ArrayList<>(); + + public CaseAggregateGroup() {} + + @JsonCreator + public CaseAggregateGroup( + @JsonProperty(required = true, value = JSON_PROPERTY_GROUP) String group, + @JsonProperty(required = true, value = JSON_PROPERTY_VALUE) List value) { + this.group = group; + this.value = value; + } + + public CaseAggregateGroup group(String group) { + this.group = group; + return this; + } + + /** + * The value of the field being grouped on (for example, OPEN when grouping by + * status). + * + * @return group + */ + @JsonProperty(JSON_PROPERTY_GROUP) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getGroup() { + return group; + } + + public void setGroup(String group) { + this.group = group; + } + + public CaseAggregateGroup value(List value) { + this.value = value; + return this; + } + + public CaseAggregateGroup addValueItem(Double valueItem) { + this.value.add(valueItem); + return this; + } + + /** + * The count of cases in this group. + * + * @return value + */ + @JsonProperty(JSON_PROPERTY_VALUE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getValue() { + return value; + } + + public void setValue(List value) { + this.value = value; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return CaseAggregateGroup + */ + @JsonAnySetter + public CaseAggregateGroup putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this CaseAggregateGroup object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CaseAggregateGroup caseAggregateGroup = (CaseAggregateGroup) o; + return Objects.equals(this.group, caseAggregateGroup.group) + && Objects.equals(this.value, caseAggregateGroup.value) + && Objects.equals(this.additionalProperties, caseAggregateGroup.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(group, value, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CaseAggregateGroup {\n"); + sb.append(" group: ").append(toIndentedString(group)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CaseAggregateGroupBy.java b/src/main/java/com/datadog/api/client/v2/model/CaseAggregateGroupBy.java new file mode 100644 index 00000000000..8555fa8c01b --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CaseAggregateGroupBy.java @@ -0,0 +1,180 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** Configuration for grouping aggregated results by one or more case fields. */ +@JsonPropertyOrder({ + CaseAggregateGroupBy.JSON_PROPERTY_GROUPS, + CaseAggregateGroupBy.JSON_PROPERTY_LIMIT +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CaseAggregateGroupBy { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_GROUPS = "groups"; + private List groups = new ArrayList<>(); + + public static final String JSON_PROPERTY_LIMIT = "limit"; + private Integer limit; + + public CaseAggregateGroupBy() {} + + @JsonCreator + public CaseAggregateGroupBy( + @JsonProperty(required = true, value = JSON_PROPERTY_GROUPS) List groups, + @JsonProperty(required = true, value = JSON_PROPERTY_LIMIT) Integer limit) { + this.groups = groups; + this.limit = limit; + } + + public CaseAggregateGroupBy groups(List groups) { + this.groups = groups; + return this; + } + + public CaseAggregateGroupBy addGroupsItem(String groupsItem) { + this.groups.add(groupsItem); + return this; + } + + /** + * Fields to group by. + * + * @return groups + */ + @JsonProperty(JSON_PROPERTY_GROUPS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getGroups() { + return groups; + } + + public void setGroups(List groups) { + this.groups = groups; + } + + public CaseAggregateGroupBy limit(Integer limit) { + this.limit = limit; + return this; + } + + /** + * Maximum number of groups to return. maximum: 1000 + * + * @return limit + */ + @JsonProperty(JSON_PROPERTY_LIMIT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Integer getLimit() { + return limit; + } + + public void setLimit(Integer limit) { + this.limit = limit; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return CaseAggregateGroupBy + */ + @JsonAnySetter + public CaseAggregateGroupBy putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this CaseAggregateGroupBy object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CaseAggregateGroupBy caseAggregateGroupBy = (CaseAggregateGroupBy) o; + return Objects.equals(this.groups, caseAggregateGroupBy.groups) + && Objects.equals(this.limit, caseAggregateGroupBy.limit) + && Objects.equals(this.additionalProperties, caseAggregateGroupBy.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(groups, limit, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CaseAggregateGroupBy {\n"); + sb.append(" groups: ").append(toIndentedString(groups)).append("\n"); + sb.append(" limit: ").append(toIndentedString(limit)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CaseAggregateRequest.java b/src/main/java/com/datadog/api/client/v2/model/CaseAggregateRequest.java new file mode 100644 index 00000000000..4a087dd433d --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CaseAggregateRequest.java @@ -0,0 +1,148 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** + * Request payload for aggregating case counts with grouping. Use this to get faceted breakdowns of + * cases (for example, count of cases grouped by priority and status). + */ +@JsonPropertyOrder({CaseAggregateRequest.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CaseAggregateRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private CaseAggregateRequestData data; + + public CaseAggregateRequest() {} + + @JsonCreator + public CaseAggregateRequest( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) CaseAggregateRequestData data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public CaseAggregateRequest data(CaseAggregateRequestData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Data object wrapping the aggregation query type and attributes. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public CaseAggregateRequestData getData() { + return data; + } + + public void setData(CaseAggregateRequestData data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return CaseAggregateRequest + */ + @JsonAnySetter + public CaseAggregateRequest putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this CaseAggregateRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CaseAggregateRequest caseAggregateRequest = (CaseAggregateRequest) o; + return Objects.equals(this.data, caseAggregateRequest.data) + && Objects.equals(this.additionalProperties, caseAggregateRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CaseAggregateRequest {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CaseAggregateRequestAttributes.java b/src/main/java/com/datadog/api/client/v2/model/CaseAggregateRequestAttributes.java new file mode 100644 index 00000000000..8a5889819f7 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CaseAggregateRequestAttributes.java @@ -0,0 +1,180 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** + * Attributes for the aggregation request, including the search query and grouping configuration. + */ +@JsonPropertyOrder({ + CaseAggregateRequestAttributes.JSON_PROPERTY_GROUP_BY, + CaseAggregateRequestAttributes.JSON_PROPERTY_QUERY_FILTER +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CaseAggregateRequestAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_GROUP_BY = "group_by"; + private CaseAggregateGroupBy groupBy; + + public static final String JSON_PROPERTY_QUERY_FILTER = "query_filter"; + private String queryFilter; + + public CaseAggregateRequestAttributes() {} + + @JsonCreator + public CaseAggregateRequestAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_GROUP_BY) CaseAggregateGroupBy groupBy, + @JsonProperty(required = true, value = JSON_PROPERTY_QUERY_FILTER) String queryFilter) { + this.groupBy = groupBy; + this.unparsed |= groupBy.unparsed; + this.queryFilter = queryFilter; + } + + public CaseAggregateRequestAttributes groupBy(CaseAggregateGroupBy groupBy) { + this.groupBy = groupBy; + this.unparsed |= groupBy.unparsed; + return this; + } + + /** + * Configuration for grouping aggregated results by one or more case fields. + * + * @return groupBy + */ + @JsonProperty(JSON_PROPERTY_GROUP_BY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public CaseAggregateGroupBy getGroupBy() { + return groupBy; + } + + public void setGroupBy(CaseAggregateGroupBy groupBy) { + this.groupBy = groupBy; + } + + public CaseAggregateRequestAttributes queryFilter(String queryFilter) { + this.queryFilter = queryFilter; + return this; + } + + /** + * A search query to filter which cases are included in the aggregation. Uses the same syntax as + * the Case Management search bar. + * + * @return queryFilter + */ + @JsonProperty(JSON_PROPERTY_QUERY_FILTER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getQueryFilter() { + return queryFilter; + } + + public void setQueryFilter(String queryFilter) { + this.queryFilter = queryFilter; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return CaseAggregateRequestAttributes + */ + @JsonAnySetter + public CaseAggregateRequestAttributes putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this CaseAggregateRequestAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CaseAggregateRequestAttributes caseAggregateRequestAttributes = + (CaseAggregateRequestAttributes) o; + return Objects.equals(this.groupBy, caseAggregateRequestAttributes.groupBy) + && Objects.equals(this.queryFilter, caseAggregateRequestAttributes.queryFilter) + && Objects.equals( + this.additionalProperties, caseAggregateRequestAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(groupBy, queryFilter, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CaseAggregateRequestAttributes {\n"); + sb.append(" groupBy: ").append(toIndentedString(groupBy)).append("\n"); + sb.append(" queryFilter: ").append(toIndentedString(queryFilter)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CaseAggregateRequestData.java b/src/main/java/com/datadog/api/client/v2/model/CaseAggregateRequestData.java new file mode 100644 index 00000000000..d38934259b4 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CaseAggregateRequestData.java @@ -0,0 +1,181 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Data object wrapping the aggregation query type and attributes. */ +@JsonPropertyOrder({ + CaseAggregateRequestData.JSON_PROPERTY_ATTRIBUTES, + CaseAggregateRequestData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CaseAggregateRequestData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private CaseAggregateRequestAttributes attributes; + + public static final String JSON_PROPERTY_TYPE = "type"; + private CaseAggregateResourceType type; + + public CaseAggregateRequestData() {} + + @JsonCreator + public CaseAggregateRequestData( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + CaseAggregateRequestAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) CaseAggregateResourceType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public CaseAggregateRequestData attributes(CaseAggregateRequestAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes for the aggregation request, including the search query and grouping configuration. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public CaseAggregateRequestAttributes getAttributes() { + return attributes; + } + + public void setAttributes(CaseAggregateRequestAttributes attributes) { + this.attributes = attributes; + } + + public CaseAggregateRequestData type(CaseAggregateResourceType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * JSON:API resource type for case aggregation requests. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public CaseAggregateResourceType getType() { + return type; + } + + public void setType(CaseAggregateResourceType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return CaseAggregateRequestData + */ + @JsonAnySetter + public CaseAggregateRequestData putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this CaseAggregateRequestData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CaseAggregateRequestData caseAggregateRequestData = (CaseAggregateRequestData) o; + return Objects.equals(this.attributes, caseAggregateRequestData.attributes) + && Objects.equals(this.type, caseAggregateRequestData.type) + && Objects.equals(this.additionalProperties, caseAggregateRequestData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CaseAggregateRequestData {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CaseAggregateResourceType.java b/src/main/java/com/datadog/api/client/v2/model/CaseAggregateResourceType.java new file mode 100644 index 00000000000..3b046129eef --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CaseAggregateResourceType.java @@ -0,0 +1,56 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** JSON:API resource type for case aggregation requests. */ +@JsonSerialize(using = CaseAggregateResourceType.CaseAggregateResourceTypeSerializer.class) +public class CaseAggregateResourceType extends ModelEnum { + + private static final Set allowedValues = new HashSet(Arrays.asList("aggregate")); + + public static final CaseAggregateResourceType AGGREGATE = + new CaseAggregateResourceType("aggregate"); + + CaseAggregateResourceType(String value) { + super(value, allowedValues); + } + + public static class CaseAggregateResourceTypeSerializer + extends StdSerializer { + public CaseAggregateResourceTypeSerializer(Class t) { + super(t); + } + + public CaseAggregateResourceTypeSerializer() { + this(null); + } + + @Override + public void serialize( + CaseAggregateResourceType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static CaseAggregateResourceType fromValue(String value) { + return new CaseAggregateResourceType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CaseAggregateResponse.java b/src/main/java/com/datadog/api/client/v2/model/CaseAggregateResponse.java new file mode 100644 index 00000000000..f2c2200beb4 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CaseAggregateResponse.java @@ -0,0 +1,145 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Response containing aggregated case counts grouped by the requested fields. */ +@JsonPropertyOrder({CaseAggregateResponse.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CaseAggregateResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private CaseAggregateResponseData data; + + public CaseAggregateResponse() {} + + @JsonCreator + public CaseAggregateResponse( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) CaseAggregateResponseData data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public CaseAggregateResponse data(CaseAggregateResponseData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Data object containing the aggregation results, including total count and per-group breakdowns. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public CaseAggregateResponseData getData() { + return data; + } + + public void setData(CaseAggregateResponseData data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return CaseAggregateResponse + */ + @JsonAnySetter + public CaseAggregateResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this CaseAggregateResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CaseAggregateResponse caseAggregateResponse = (CaseAggregateResponse) o; + return Objects.equals(this.data, caseAggregateResponse.data) + && Objects.equals(this.additionalProperties, caseAggregateResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CaseAggregateResponse {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CaseAggregateResponseAttributes.java b/src/main/java/com/datadog/api/client/v2/model/CaseAggregateResponseAttributes.java new file mode 100644 index 00000000000..883e7b808cc --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CaseAggregateResponseAttributes.java @@ -0,0 +1,189 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** + * Attributes of the aggregation result, including the total count across all groups and the + * per-group breakdowns. + */ +@JsonPropertyOrder({ + CaseAggregateResponseAttributes.JSON_PROPERTY_GROUPS, + CaseAggregateResponseAttributes.JSON_PROPERTY_TOTAL +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CaseAggregateResponseAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_GROUPS = "groups"; + private List groups = new ArrayList<>(); + + public static final String JSON_PROPERTY_TOTAL = "total"; + private Double total; + + public CaseAggregateResponseAttributes() {} + + @JsonCreator + public CaseAggregateResponseAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_GROUPS) List groups, + @JsonProperty(required = true, value = JSON_PROPERTY_TOTAL) Double total) { + this.groups = groups; + this.total = total; + } + + public CaseAggregateResponseAttributes groups(List groups) { + this.groups = groups; + for (CaseAggregateGroup item : groups) { + this.unparsed |= item.unparsed; + } + return this; + } + + public CaseAggregateResponseAttributes addGroupsItem(CaseAggregateGroup groupsItem) { + this.groups.add(groupsItem); + this.unparsed |= groupsItem.unparsed; + return this; + } + + /** + * Aggregated groups. + * + * @return groups + */ + @JsonProperty(JSON_PROPERTY_GROUPS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getGroups() { + return groups; + } + + public void setGroups(List groups) { + this.groups = groups; + } + + public CaseAggregateResponseAttributes total(Double total) { + this.total = total; + return this; + } + + /** + * Total count of aggregated cases. + * + * @return total + */ + @JsonProperty(JSON_PROPERTY_TOTAL) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Double getTotal() { + return total; + } + + public void setTotal(Double total) { + this.total = total; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return CaseAggregateResponseAttributes + */ + @JsonAnySetter + public CaseAggregateResponseAttributes putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this CaseAggregateResponseAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CaseAggregateResponseAttributes caseAggregateResponseAttributes = + (CaseAggregateResponseAttributes) o; + return Objects.equals(this.groups, caseAggregateResponseAttributes.groups) + && Objects.equals(this.total, caseAggregateResponseAttributes.total) + && Objects.equals( + this.additionalProperties, caseAggregateResponseAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(groups, total, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CaseAggregateResponseAttributes {\n"); + sb.append(" groups: ").append(toIndentedString(groups)).append("\n"); + sb.append(" total: ").append(toIndentedString(total)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CaseAggregateResponseData.java b/src/main/java/com/datadog/api/client/v2/model/CaseAggregateResponseData.java new file mode 100644 index 00000000000..0bd52da2592 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CaseAggregateResponseData.java @@ -0,0 +1,208 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** + * Data object containing the aggregation results, including total count and per-group breakdowns. + */ +@JsonPropertyOrder({ + CaseAggregateResponseData.JSON_PROPERTY_ATTRIBUTES, + CaseAggregateResponseData.JSON_PROPERTY_ID, + CaseAggregateResponseData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CaseAggregateResponseData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private CaseAggregateResponseAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private String type; + + public CaseAggregateResponseData() {} + + @JsonCreator + public CaseAggregateResponseData( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + CaseAggregateResponseAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) String type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.id = id; + this.type = type; + } + + public CaseAggregateResponseData attributes(CaseAggregateResponseAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes of the aggregation result, including the total count across all groups and the + * per-group breakdowns. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public CaseAggregateResponseAttributes getAttributes() { + return attributes; + } + + public void setAttributes(CaseAggregateResponseAttributes attributes) { + this.attributes = attributes; + } + + public CaseAggregateResponseData id(String id) { + this.id = id; + return this; + } + + /** + * Aggregate response identifier. + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public CaseAggregateResponseData type(String type) { + this.type = type; + return this; + } + + /** + * Aggregate resource type. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return CaseAggregateResponseData + */ + @JsonAnySetter + public CaseAggregateResponseData putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this CaseAggregateResponseData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CaseAggregateResponseData caseAggregateResponseData = (CaseAggregateResponseData) o; + return Objects.equals(this.attributes, caseAggregateResponseData.attributes) + && Objects.equals(this.id, caseAggregateResponseData.id) + && Objects.equals(this.type, caseAggregateResponseData.type) + && Objects.equals( + this.additionalProperties, caseAggregateResponseData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CaseAggregateResponseData {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CaseAssign.java b/src/main/java/com/datadog/api/client/v2/model/CaseAssign.java index ec91ce50ba4..6352b40282d 100644 --- a/src/main/java/com/datadog/api/client/v2/model/CaseAssign.java +++ b/src/main/java/com/datadog/api/client/v2/model/CaseAssign.java @@ -70,7 +70,7 @@ public CaseAssign type(CaseResourceType type) { } /** - * Case resource type + * JSON:API resource type for cases. * * @return type */ diff --git a/src/main/java/com/datadog/api/client/v2/model/CaseAttributes.java b/src/main/java/com/datadog/api/client/v2/model/CaseAttributes.java index 65350568c2e..d1e1b11e293 100644 --- a/src/main/java/com/datadog/api/client/v2/model/CaseAttributes.java +++ b/src/main/java/com/datadog/api/client/v2/model/CaseAttributes.java @@ -135,7 +135,8 @@ public CaseAttributes putAttributesItem(String key, List attributesItem) } /** - * The definition of CaseObjectAttributes object. + * Key-value pairs of case attributes. Each key maps to an array of string values, used for + * flexible metadata such as labels or tags. * * @return attributes */ diff --git a/src/main/java/com/datadog/api/client/v2/model/CaseAutomationRuleResourceType.java b/src/main/java/com/datadog/api/client/v2/model/CaseAutomationRuleResourceType.java new file mode 100644 index 00000000000..3661f76b0da --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CaseAutomationRuleResourceType.java @@ -0,0 +1,57 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** JSON:API resource type for case automation rules. */ +@JsonSerialize( + using = CaseAutomationRuleResourceType.CaseAutomationRuleResourceTypeSerializer.class) +public class CaseAutomationRuleResourceType extends ModelEnum { + + private static final Set allowedValues = new HashSet(Arrays.asList("rule")); + + public static final CaseAutomationRuleResourceType RULE = + new CaseAutomationRuleResourceType("rule"); + + CaseAutomationRuleResourceType(String value) { + super(value, allowedValues); + } + + public static class CaseAutomationRuleResourceTypeSerializer + extends StdSerializer { + public CaseAutomationRuleResourceTypeSerializer(Class t) { + super(t); + } + + public CaseAutomationRuleResourceTypeSerializer() { + this(null); + } + + @Override + public void serialize( + CaseAutomationRuleResourceType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static CaseAutomationRuleResourceType fromValue(String value) { + return new CaseAutomationRuleResourceType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CaseAutomationRuleState.java b/src/main/java/com/datadog/api/client/v2/model/CaseAutomationRuleState.java new file mode 100644 index 00000000000..252d326a953 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CaseAutomationRuleState.java @@ -0,0 +1,60 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** + * Whether the automation rule is active. Enabled rules trigger on matching case events; disabled + * rules are inactive but preserve their configuration. + */ +@JsonSerialize(using = CaseAutomationRuleState.CaseAutomationRuleStateSerializer.class) +public class CaseAutomationRuleState extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("ENABLED", "DISABLED")); + + public static final CaseAutomationRuleState ENABLED = new CaseAutomationRuleState("ENABLED"); + public static final CaseAutomationRuleState DISABLED = new CaseAutomationRuleState("DISABLED"); + + CaseAutomationRuleState(String value) { + super(value, allowedValues); + } + + public static class CaseAutomationRuleStateSerializer + extends StdSerializer { + public CaseAutomationRuleStateSerializer(Class t) { + super(t); + } + + public CaseAutomationRuleStateSerializer() { + this(null); + } + + @Override + public void serialize( + CaseAutomationRuleState value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static CaseAutomationRuleState fromValue(String value) { + return new CaseAutomationRuleState(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CaseBulkActionType.java b/src/main/java/com/datadog/api/client/v2/model/CaseBulkActionType.java new file mode 100644 index 00000000000..90d2896bf01 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CaseBulkActionType.java @@ -0,0 +1,79 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** + * The type of action to apply in a bulk update. Allowed values are priority, + * status, assign, unassign, archive, unarchive + * , jira, servicenow, linear, update_project + * . + */ +@JsonSerialize(using = CaseBulkActionType.CaseBulkActionTypeSerializer.class) +public class CaseBulkActionType extends ModelEnum { + + private static final Set allowedValues = + new HashSet( + Arrays.asList( + "priority", + "status", + "assign", + "unassign", + "archive", + "unarchive", + "jira", + "servicenow", + "linear", + "update_project")); + + public static final CaseBulkActionType PRIORITY = new CaseBulkActionType("priority"); + public static final CaseBulkActionType STATUS = new CaseBulkActionType("status"); + public static final CaseBulkActionType ASSIGN = new CaseBulkActionType("assign"); + public static final CaseBulkActionType UNASSIGN = new CaseBulkActionType("unassign"); + public static final CaseBulkActionType ARCHIVE = new CaseBulkActionType("archive"); + public static final CaseBulkActionType UNARCHIVE = new CaseBulkActionType("unarchive"); + public static final CaseBulkActionType JIRA = new CaseBulkActionType("jira"); + public static final CaseBulkActionType SERVICENOW = new CaseBulkActionType("servicenow"); + public static final CaseBulkActionType LINEAR = new CaseBulkActionType("linear"); + public static final CaseBulkActionType UPDATE_PROJECT = new CaseBulkActionType("update_project"); + + CaseBulkActionType(String value) { + super(value, allowedValues); + } + + public static class CaseBulkActionTypeSerializer extends StdSerializer { + public CaseBulkActionTypeSerializer(Class t) { + super(t); + } + + public CaseBulkActionTypeSerializer() { + this(null); + } + + @Override + public void serialize(CaseBulkActionType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static CaseBulkActionType fromValue(String value) { + return new CaseBulkActionType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CaseBulkResourceType.java b/src/main/java/com/datadog/api/client/v2/model/CaseBulkResourceType.java new file mode 100644 index 00000000000..f343a50678f --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CaseBulkResourceType.java @@ -0,0 +1,54 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** JSON:API resource type for bulk case operations. */ +@JsonSerialize(using = CaseBulkResourceType.CaseBulkResourceTypeSerializer.class) +public class CaseBulkResourceType extends ModelEnum { + + private static final Set allowedValues = new HashSet(Arrays.asList("bulk")); + + public static final CaseBulkResourceType BULK = new CaseBulkResourceType("bulk"); + + CaseBulkResourceType(String value) { + super(value, allowedValues); + } + + public static class CaseBulkResourceTypeSerializer extends StdSerializer { + public CaseBulkResourceTypeSerializer(Class t) { + super(t); + } + + public CaseBulkResourceTypeSerializer() { + this(null); + } + + @Override + public void serialize( + CaseBulkResourceType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static CaseBulkResourceType fromValue(String value) { + return new CaseBulkResourceType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CaseBulkUpdateRequest.java b/src/main/java/com/datadog/api/client/v2/model/CaseBulkUpdateRequest.java new file mode 100644 index 00000000000..c54c563d093 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CaseBulkUpdateRequest.java @@ -0,0 +1,148 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** + * Request payload for applying a single action (such as changing priority, status, or assignment) + * to multiple cases at once. + */ +@JsonPropertyOrder({CaseBulkUpdateRequest.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CaseBulkUpdateRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private CaseBulkUpdateRequestData data; + + public CaseBulkUpdateRequest() {} + + @JsonCreator + public CaseBulkUpdateRequest( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) CaseBulkUpdateRequestData data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public CaseBulkUpdateRequest data(CaseBulkUpdateRequestData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Data object wrapping the bulk update type and attributes. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public CaseBulkUpdateRequestData getData() { + return data; + } + + public void setData(CaseBulkUpdateRequestData data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return CaseBulkUpdateRequest + */ + @JsonAnySetter + public CaseBulkUpdateRequest putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this CaseBulkUpdateRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CaseBulkUpdateRequest caseBulkUpdateRequest = (CaseBulkUpdateRequest) o; + return Objects.equals(this.data, caseBulkUpdateRequest.data) + && Objects.equals(this.additionalProperties, caseBulkUpdateRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CaseBulkUpdateRequest {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CaseBulkUpdateRequestAttributes.java b/src/main/java/com/datadog/api/client/v2/model/CaseBulkUpdateRequestAttributes.java new file mode 100644 index 00000000000..d2328576711 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CaseBulkUpdateRequestAttributes.java @@ -0,0 +1,226 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** Attributes for the bulk update, specifying which cases to update and the action to apply. */ +@JsonPropertyOrder({ + CaseBulkUpdateRequestAttributes.JSON_PROPERTY_CASE_IDS, + CaseBulkUpdateRequestAttributes.JSON_PROPERTY_PAYLOAD, + CaseBulkUpdateRequestAttributes.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CaseBulkUpdateRequestAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_CASE_IDS = "case_ids"; + private List caseIds = new ArrayList<>(); + + public static final String JSON_PROPERTY_PAYLOAD = "payload"; + private Map payload = null; + + public static final String JSON_PROPERTY_TYPE = "type"; + private CaseBulkActionType type; + + public CaseBulkUpdateRequestAttributes() {} + + @JsonCreator + public CaseBulkUpdateRequestAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_CASE_IDS) List caseIds, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) CaseBulkActionType type) { + this.caseIds = caseIds; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public CaseBulkUpdateRequestAttributes caseIds(List caseIds) { + this.caseIds = caseIds; + return this; + } + + public CaseBulkUpdateRequestAttributes addCaseIdsItem(String caseIdsItem) { + this.caseIds.add(caseIdsItem); + return this; + } + + /** + * An array of case identifiers to apply the bulk action to. + * + * @return caseIds + */ + @JsonProperty(JSON_PROPERTY_CASE_IDS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getCaseIds() { + return caseIds; + } + + public void setCaseIds(List caseIds) { + this.caseIds = caseIds; + } + + public CaseBulkUpdateRequestAttributes payload(Map payload) { + this.payload = payload; + return this; + } + + public CaseBulkUpdateRequestAttributes putPayloadItem(String key, String payloadItem) { + if (this.payload == null) { + this.payload = new HashMap<>(); + } + this.payload.put(key, payloadItem); + return this; + } + + /** + * A key-value map of action-specific parameters. The required keys depend on the action type (for + * example, priority for the priority action, assignee_id for assign). + * + * @return payload + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PAYLOAD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getPayload() { + return payload; + } + + public void setPayload(Map payload) { + this.payload = payload; + } + + public CaseBulkUpdateRequestAttributes type(CaseBulkActionType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * The type of action to apply in a bulk update. Allowed values are priority, + * status, assign, unassign, archive, + * unarchive, jira, servicenow, linear, + * update_project. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public CaseBulkActionType getType() { + return type; + } + + public void setType(CaseBulkActionType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return CaseBulkUpdateRequestAttributes + */ + @JsonAnySetter + public CaseBulkUpdateRequestAttributes putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this CaseBulkUpdateRequestAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CaseBulkUpdateRequestAttributes caseBulkUpdateRequestAttributes = + (CaseBulkUpdateRequestAttributes) o; + return Objects.equals(this.caseIds, caseBulkUpdateRequestAttributes.caseIds) + && Objects.equals(this.payload, caseBulkUpdateRequestAttributes.payload) + && Objects.equals(this.type, caseBulkUpdateRequestAttributes.type) + && Objects.equals( + this.additionalProperties, caseBulkUpdateRequestAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(caseIds, payload, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CaseBulkUpdateRequestAttributes {\n"); + sb.append(" caseIds: ").append(toIndentedString(caseIds)).append("\n"); + sb.append(" payload: ").append(toIndentedString(payload)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CaseBulkUpdateRequestData.java b/src/main/java/com/datadog/api/client/v2/model/CaseBulkUpdateRequestData.java new file mode 100644 index 00000000000..40d676bd015 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CaseBulkUpdateRequestData.java @@ -0,0 +1,182 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Data object wrapping the bulk update type and attributes. */ +@JsonPropertyOrder({ + CaseBulkUpdateRequestData.JSON_PROPERTY_ATTRIBUTES, + CaseBulkUpdateRequestData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CaseBulkUpdateRequestData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private CaseBulkUpdateRequestAttributes attributes; + + public static final String JSON_PROPERTY_TYPE = "type"; + private CaseBulkResourceType type; + + public CaseBulkUpdateRequestData() {} + + @JsonCreator + public CaseBulkUpdateRequestData( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + CaseBulkUpdateRequestAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) CaseBulkResourceType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public CaseBulkUpdateRequestData attributes(CaseBulkUpdateRequestAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes for the bulk update, specifying which cases to update and the action to apply. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public CaseBulkUpdateRequestAttributes getAttributes() { + return attributes; + } + + public void setAttributes(CaseBulkUpdateRequestAttributes attributes) { + this.attributes = attributes; + } + + public CaseBulkUpdateRequestData type(CaseBulkResourceType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * JSON:API resource type for bulk case operations. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public CaseBulkResourceType getType() { + return type; + } + + public void setType(CaseBulkResourceType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return CaseBulkUpdateRequestData + */ + @JsonAnySetter + public CaseBulkUpdateRequestData putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this CaseBulkUpdateRequestData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CaseBulkUpdateRequestData caseBulkUpdateRequestData = (CaseBulkUpdateRequestData) o; + return Objects.equals(this.attributes, caseBulkUpdateRequestData.attributes) + && Objects.equals(this.type, caseBulkUpdateRequestData.type) + && Objects.equals( + this.additionalProperties, caseBulkUpdateRequestData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CaseBulkUpdateRequestData {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CaseComment.java b/src/main/java/com/datadog/api/client/v2/model/CaseComment.java index 482beac0f04..ef9a2aabb54 100644 --- a/src/main/java/com/datadog/api/client/v2/model/CaseComment.java +++ b/src/main/java/com/datadog/api/client/v2/model/CaseComment.java @@ -70,7 +70,7 @@ public CaseComment type(CaseResourceType type) { } /** - * Case resource type + * JSON:API resource type for cases. * * @return type */ diff --git a/src/main/java/com/datadog/api/client/v2/model/CaseCountGroup.java b/src/main/java/com/datadog/api/client/v2/model/CaseCountGroup.java new file mode 100644 index 00000000000..90e604521b2 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CaseCountGroup.java @@ -0,0 +1,186 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** + * A facet group containing counts broken down by the distinct values of a case field (for example, + * status or priority). + */ +@JsonPropertyOrder({CaseCountGroup.JSON_PROPERTY_GROUP, CaseCountGroup.JSON_PROPERTY_GROUP_VALUES}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CaseCountGroup { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_GROUP = "group"; + private String group; + + public static final String JSON_PROPERTY_GROUP_VALUES = "group_values"; + private List groupValues = new ArrayList<>(); + + public CaseCountGroup() {} + + @JsonCreator + public CaseCountGroup( + @JsonProperty(required = true, value = JSON_PROPERTY_GROUP) String group, + @JsonProperty(required = true, value = JSON_PROPERTY_GROUP_VALUES) + List groupValues) { + this.group = group; + this.groupValues = groupValues; + } + + public CaseCountGroup group(String group) { + this.group = group; + return this; + } + + /** + * The name of the field being grouped on (for example, status or priority + * ). + * + * @return group + */ + @JsonProperty(JSON_PROPERTY_GROUP) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getGroup() { + return group; + } + + public void setGroup(String group) { + this.group = group; + } + + public CaseCountGroup groupValues(List groupValues) { + this.groupValues = groupValues; + for (CaseCountGroupValue item : groupValues) { + this.unparsed |= item.unparsed; + } + return this; + } + + public CaseCountGroup addGroupValuesItem(CaseCountGroupValue groupValuesItem) { + this.groupValues.add(groupValuesItem); + this.unparsed |= groupValuesItem.unparsed; + return this; + } + + /** + * Values within this group. + * + * @return groupValues + */ + @JsonProperty(JSON_PROPERTY_GROUP_VALUES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getGroupValues() { + return groupValues; + } + + public void setGroupValues(List groupValues) { + this.groupValues = groupValues; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return CaseCountGroup + */ + @JsonAnySetter + public CaseCountGroup putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this CaseCountGroup object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CaseCountGroup caseCountGroup = (CaseCountGroup) o; + return Objects.equals(this.group, caseCountGroup.group) + && Objects.equals(this.groupValues, caseCountGroup.groupValues) + && Objects.equals(this.additionalProperties, caseCountGroup.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(group, groupValues, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CaseCountGroup {\n"); + sb.append(" group: ").append(toIndentedString(group)).append("\n"); + sb.append(" groupValues: ").append(toIndentedString(groupValues)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CaseCountGroupValue.java b/src/main/java/com/datadog/api/client/v2/model/CaseCountGroupValue.java new file mode 100644 index 00000000000..5afc179ee43 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CaseCountGroupValue.java @@ -0,0 +1,176 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** + * A single value within a count group, representing the number of cases with that specific field + * value. + */ +@JsonPropertyOrder({ + CaseCountGroupValue.JSON_PROPERTY_COUNT, + CaseCountGroupValue.JSON_PROPERTY_VALUE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CaseCountGroupValue { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_COUNT = "count"; + private Long count; + + public static final String JSON_PROPERTY_VALUE = "value"; + private String value; + + public CaseCountGroupValue() {} + + @JsonCreator + public CaseCountGroupValue( + @JsonProperty(required = true, value = JSON_PROPERTY_COUNT) Long count, + @JsonProperty(required = true, value = JSON_PROPERTY_VALUE) String value) { + this.count = count; + this.value = value; + } + + public CaseCountGroupValue count(Long count) { + this.count = count; + return this; + } + + /** + * Count of cases for this value. + * + * @return count + */ + @JsonProperty(JSON_PROPERTY_COUNT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Long getCount() { + return count; + } + + public void setCount(Long count) { + this.count = count; + } + + public CaseCountGroupValue value(String value) { + this.value = value; + return this; + } + + /** + * The group value. + * + * @return value + */ + @JsonProperty(JSON_PROPERTY_VALUE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return CaseCountGroupValue + */ + @JsonAnySetter + public CaseCountGroupValue putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this CaseCountGroupValue object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CaseCountGroupValue caseCountGroupValue = (CaseCountGroupValue) o; + return Objects.equals(this.count, caseCountGroupValue.count) + && Objects.equals(this.value, caseCountGroupValue.value) + && Objects.equals(this.additionalProperties, caseCountGroupValue.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(count, value, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CaseCountGroupValue {\n"); + sb.append(" count: ").append(toIndentedString(count)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CaseCountResponse.java b/src/main/java/com/datadog/api/client/v2/model/CaseCountResponse.java new file mode 100644 index 00000000000..0b3ad1799e4 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CaseCountResponse.java @@ -0,0 +1,148 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** + * Response containing the total number of cases matching a query, optionally grouped by specified + * fields. + */ +@JsonPropertyOrder({CaseCountResponse.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CaseCountResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private CaseCountResponseData data; + + public CaseCountResponse() {} + + @JsonCreator + public CaseCountResponse( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) CaseCountResponseData data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public CaseCountResponse data(CaseCountResponseData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Data object containing the count results, including per-field group breakdowns. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public CaseCountResponseData getData() { + return data; + } + + public void setData(CaseCountResponseData data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return CaseCountResponse + */ + @JsonAnySetter + public CaseCountResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this CaseCountResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CaseCountResponse caseCountResponse = (CaseCountResponse) o; + return Objects.equals(this.data, caseCountResponse.data) + && Objects.equals(this.additionalProperties, caseCountResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CaseCountResponse {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CaseCountResponseAttributes.java b/src/main/java/com/datadog/api/client/v2/model/CaseCountResponseAttributes.java new file mode 100644 index 00000000000..09fd240fdd3 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CaseCountResponseAttributes.java @@ -0,0 +1,155 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** Attributes for the count response, including the total count and optional facet breakdowns. */ +@JsonPropertyOrder({CaseCountResponseAttributes.JSON_PROPERTY_GROUPS}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CaseCountResponseAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_GROUPS = "groups"; + private List groups = new ArrayList<>(); + + public CaseCountResponseAttributes() {} + + @JsonCreator + public CaseCountResponseAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_GROUPS) List groups) { + this.groups = groups; + } + + public CaseCountResponseAttributes groups(List groups) { + this.groups = groups; + for (CaseCountGroup item : groups) { + this.unparsed |= item.unparsed; + } + return this; + } + + public CaseCountResponseAttributes addGroupsItem(CaseCountGroup groupsItem) { + this.groups.add(groupsItem); + this.unparsed |= groupsItem.unparsed; + return this; + } + + /** + * List of facet groups, one per field specified in group_bys. + * + * @return groups + */ + @JsonProperty(JSON_PROPERTY_GROUPS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getGroups() { + return groups; + } + + public void setGroups(List groups) { + this.groups = groups; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return CaseCountResponseAttributes + */ + @JsonAnySetter + public CaseCountResponseAttributes putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this CaseCountResponseAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CaseCountResponseAttributes caseCountResponseAttributes = (CaseCountResponseAttributes) o; + return Objects.equals(this.groups, caseCountResponseAttributes.groups) + && Objects.equals( + this.additionalProperties, caseCountResponseAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(groups, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CaseCountResponseAttributes {\n"); + sb.append(" groups: ").append(toIndentedString(groups)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CaseCountResponseData.java b/src/main/java/com/datadog/api/client/v2/model/CaseCountResponseData.java new file mode 100644 index 00000000000..fd659d7dfbe --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CaseCountResponseData.java @@ -0,0 +1,204 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Data object containing the count results, including per-field group breakdowns. */ +@JsonPropertyOrder({ + CaseCountResponseData.JSON_PROPERTY_ATTRIBUTES, + CaseCountResponseData.JSON_PROPERTY_ID, + CaseCountResponseData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CaseCountResponseData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private CaseCountResponseAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private String type; + + public CaseCountResponseData() {} + + @JsonCreator + public CaseCountResponseData( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + CaseCountResponseAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) String type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.id = id; + this.type = type; + } + + public CaseCountResponseData attributes(CaseCountResponseAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes for the count response, including the total count and optional facet breakdowns. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public CaseCountResponseAttributes getAttributes() { + return attributes; + } + + public void setAttributes(CaseCountResponseAttributes attributes) { + this.attributes = attributes; + } + + public CaseCountResponseData id(String id) { + this.id = id; + return this; + } + + /** + * Count response identifier. + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public CaseCountResponseData type(String type) { + this.type = type; + return this; + } + + /** + * Count resource type. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return CaseCountResponseData + */ + @JsonAnySetter + public CaseCountResponseData putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this CaseCountResponseData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CaseCountResponseData caseCountResponseData = (CaseCountResponseData) o; + return Objects.equals(this.attributes, caseCountResponseData.attributes) + && Objects.equals(this.id, caseCountResponseData.id) + && Objects.equals(this.type, caseCountResponseData.type) + && Objects.equals(this.additionalProperties, caseCountResponseData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CaseCountResponseData {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CaseCreate.java b/src/main/java/com/datadog/api/client/v2/model/CaseCreate.java index e459c6970c7..9e66f62eeb1 100644 --- a/src/main/java/com/datadog/api/client/v2/model/CaseCreate.java +++ b/src/main/java/com/datadog/api/client/v2/model/CaseCreate.java @@ -99,7 +99,7 @@ public CaseCreate type(CaseResourceType type) { } /** - * Case resource type + * JSON:API resource type for cases. * * @return type */ diff --git a/src/main/java/com/datadog/api/client/v2/model/CaseEmpty.java b/src/main/java/com/datadog/api/client/v2/model/CaseEmpty.java index 4461affb353..77f7408c6b5 100644 --- a/src/main/java/com/datadog/api/client/v2/model/CaseEmpty.java +++ b/src/main/java/com/datadog/api/client/v2/model/CaseEmpty.java @@ -42,7 +42,7 @@ public CaseEmpty type(CaseResourceType type) { } /** - * Case resource type + * JSON:API resource type for cases. * * @return type */ diff --git a/src/main/java/com/datadog/api/client/v2/model/CaseInsight.java b/src/main/java/com/datadog/api/client/v2/model/CaseInsight.java new file mode 100644 index 00000000000..8be213b2cd6 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CaseInsight.java @@ -0,0 +1,213 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** + * A reference to an external Datadog resource that provides investigative context for a case, such + * as a security signal, monitor alert, error tracking issue, or incident. + */ +@JsonPropertyOrder({ + CaseInsight.JSON_PROPERTY_REF, + CaseInsight.JSON_PROPERTY_RESOURCE_ID, + CaseInsight.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CaseInsight { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_REF = "ref"; + private String ref; + + public static final String JSON_PROPERTY_RESOURCE_ID = "resource_id"; + private String resourceId; + + public static final String JSON_PROPERTY_TYPE = "type"; + private CaseInsightType type; + + public CaseInsight() {} + + @JsonCreator + public CaseInsight( + @JsonProperty(required = true, value = JSON_PROPERTY_REF) String ref, + @JsonProperty(required = true, value = JSON_PROPERTY_RESOURCE_ID) String resourceId, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) CaseInsightType type) { + this.ref = ref; + this.resourceId = resourceId; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public CaseInsight ref(String ref) { + this.ref = ref; + return this; + } + + /** + * The URL path or deep link to the insight resource within Datadog (for example, + * /monitors/12345?q=total). + * + * @return ref + */ + @JsonProperty(JSON_PROPERTY_REF) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getRef() { + return ref; + } + + public void setRef(String ref) { + this.ref = ref; + } + + public CaseInsight resourceId(String resourceId) { + this.resourceId = resourceId; + return this; + } + + /** + * The unique identifier of the referenced Datadog resource (for example, a monitor ID, incident + * ID, or signal ID). + * + * @return resourceId + */ + @JsonProperty(JSON_PROPERTY_RESOURCE_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getResourceId() { + return resourceId; + } + + public void setResourceId(String resourceId) { + this.resourceId = resourceId; + } + + public CaseInsight type(CaseInsightType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * The type of Datadog resource linked to the case as contextual evidence. Each type corresponds + * to a different Datadog product signal (for example, a security finding, a monitor alert, or an + * incident). + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public CaseInsightType getType() { + return type; + } + + public void setType(CaseInsightType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return CaseInsight + */ + @JsonAnySetter + public CaseInsight putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this CaseInsight object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CaseInsight caseInsight = (CaseInsight) o; + return Objects.equals(this.ref, caseInsight.ref) + && Objects.equals(this.resourceId, caseInsight.resourceId) + && Objects.equals(this.type, caseInsight.type) + && Objects.equals(this.additionalProperties, caseInsight.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(ref, resourceId, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CaseInsight {\n"); + sb.append(" ref: ").append(toIndentedString(ref)).append("\n"); + sb.append(" resourceId: ").append(toIndentedString(resourceId)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CaseInsightType.java b/src/main/java/com/datadog/api/client/v2/model/CaseInsightType.java new file mode 100644 index 00000000000..fa721328287 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CaseInsightType.java @@ -0,0 +1,95 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** + * The type of Datadog resource linked to the case as contextual evidence. Each type corresponds to + * a different Datadog product signal (for example, a security finding, a monitor alert, or an + * incident). + */ +@JsonSerialize(using = CaseInsightType.CaseInsightTypeSerializer.class) +public class CaseInsightType extends ModelEnum { + + private static final Set allowedValues = + new HashSet( + Arrays.asList( + "SECURITY_SIGNAL", + "MONITOR", + "EVENT_CORRELATION", + "ERROR_TRACKING", + "CLOUD_COST_RECOMMENDATION", + "INCIDENT", + "SENSITIVE_DATA_SCANNER_ISSUE", + "EVENT", + "WATCHDOG_STORY", + "WIDGET", + "SECURITY_FINDING", + "INSIGHT_SCORECARD_CAMPAIGN", + "RESOURCE_POLICY", + "APM_RECOMMENDATION", + "SCM_URL", + "PROFILING_DOWNSIZING_EXPERIMENT")); + + public static final CaseInsightType SECURITY_SIGNAL = new CaseInsightType("SECURITY_SIGNAL"); + public static final CaseInsightType MONITOR = new CaseInsightType("MONITOR"); + public static final CaseInsightType EVENT_CORRELATION = new CaseInsightType("EVENT_CORRELATION"); + public static final CaseInsightType ERROR_TRACKING = new CaseInsightType("ERROR_TRACKING"); + public static final CaseInsightType CLOUD_COST_RECOMMENDATION = + new CaseInsightType("CLOUD_COST_RECOMMENDATION"); + public static final CaseInsightType INCIDENT = new CaseInsightType("INCIDENT"); + public static final CaseInsightType SENSITIVE_DATA_SCANNER_ISSUE = + new CaseInsightType("SENSITIVE_DATA_SCANNER_ISSUE"); + public static final CaseInsightType EVENT = new CaseInsightType("EVENT"); + public static final CaseInsightType WATCHDOG_STORY = new CaseInsightType("WATCHDOG_STORY"); + public static final CaseInsightType WIDGET = new CaseInsightType("WIDGET"); + public static final CaseInsightType SECURITY_FINDING = new CaseInsightType("SECURITY_FINDING"); + public static final CaseInsightType INSIGHT_SCORECARD_CAMPAIGN = + new CaseInsightType("INSIGHT_SCORECARD_CAMPAIGN"); + public static final CaseInsightType RESOURCE_POLICY = new CaseInsightType("RESOURCE_POLICY"); + public static final CaseInsightType APM_RECOMMENDATION = + new CaseInsightType("APM_RECOMMENDATION"); + public static final CaseInsightType SCM_URL = new CaseInsightType("SCM_URL"); + public static final CaseInsightType PROFILING_DOWNSIZING_EXPERIMENT = + new CaseInsightType("PROFILING_DOWNSIZING_EXPERIMENT"); + + CaseInsightType(String value) { + super(value, allowedValues); + } + + public static class CaseInsightTypeSerializer extends StdSerializer { + public CaseInsightTypeSerializer(Class t) { + super(t); + } + + public CaseInsightTypeSerializer() { + this(null); + } + + @Override + public void serialize(CaseInsightType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static CaseInsightType fromValue(String value) { + return new CaseInsightType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CaseInsightsAttributes.java b/src/main/java/com/datadog/api/client/v2/model/CaseInsightsAttributes.java new file mode 100644 index 00000000000..7163361b868 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CaseInsightsAttributes.java @@ -0,0 +1,154 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** Attributes for adding or removing insights from a case. */ +@JsonPropertyOrder({CaseInsightsAttributes.JSON_PROPERTY_INSIGHTS}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CaseInsightsAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_INSIGHTS = "insights"; + private List insights = new ArrayList<>(); + + public CaseInsightsAttributes() {} + + @JsonCreator + public CaseInsightsAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_INSIGHTS) List insights) { + this.insights = insights; + } + + public CaseInsightsAttributes insights(List insights) { + this.insights = insights; + for (CaseInsight item : insights) { + this.unparsed |= item.unparsed; + } + return this; + } + + public CaseInsightsAttributes addInsightsItem(CaseInsight insightsItem) { + this.insights.add(insightsItem); + this.unparsed |= insightsItem.unparsed; + return this; + } + + /** + * Array of insights to add to or remove from a case. + * + * @return insights + */ + @JsonProperty(JSON_PROPERTY_INSIGHTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getInsights() { + return insights; + } + + public void setInsights(List insights) { + this.insights = insights; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return CaseInsightsAttributes + */ + @JsonAnySetter + public CaseInsightsAttributes putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this CaseInsightsAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CaseInsightsAttributes caseInsightsAttributes = (CaseInsightsAttributes) o; + return Objects.equals(this.insights, caseInsightsAttributes.insights) + && Objects.equals(this.additionalProperties, caseInsightsAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(insights, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CaseInsightsAttributes {\n"); + sb.append(" insights: ").append(toIndentedString(insights)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CaseInsightsData.java b/src/main/java/com/datadog/api/client/v2/model/CaseInsightsData.java new file mode 100644 index 00000000000..1041fa5801b --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CaseInsightsData.java @@ -0,0 +1,178 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Data object containing the insights to add or remove. */ +@JsonPropertyOrder({CaseInsightsData.JSON_PROPERTY_ATTRIBUTES, CaseInsightsData.JSON_PROPERTY_TYPE}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CaseInsightsData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private CaseInsightsAttributes attributes; + + public static final String JSON_PROPERTY_TYPE = "type"; + private CaseResourceType type = CaseResourceType.CASE; + + public CaseInsightsData() {} + + @JsonCreator + public CaseInsightsData( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + CaseInsightsAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) CaseResourceType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public CaseInsightsData attributes(CaseInsightsAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes for adding or removing insights from a case. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public CaseInsightsAttributes getAttributes() { + return attributes; + } + + public void setAttributes(CaseInsightsAttributes attributes) { + this.attributes = attributes; + } + + public CaseInsightsData type(CaseResourceType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * JSON:API resource type for cases. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public CaseResourceType getType() { + return type; + } + + public void setType(CaseResourceType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return CaseInsightsData + */ + @JsonAnySetter + public CaseInsightsData putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this CaseInsightsData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CaseInsightsData caseInsightsData = (CaseInsightsData) o; + return Objects.equals(this.attributes, caseInsightsData.attributes) + && Objects.equals(this.type, caseInsightsData.type) + && Objects.equals(this.additionalProperties, caseInsightsData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CaseInsightsData {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CaseInsightsRequest.java b/src/main/java/com/datadog/api/client/v2/model/CaseInsightsRequest.java new file mode 100644 index 00000000000..a0d96d5fc43 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CaseInsightsRequest.java @@ -0,0 +1,145 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Request payload for adding or removing case insights. */ +@JsonPropertyOrder({CaseInsightsRequest.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CaseInsightsRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private CaseInsightsData data; + + public CaseInsightsRequest() {} + + @JsonCreator + public CaseInsightsRequest( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) CaseInsightsData data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public CaseInsightsRequest data(CaseInsightsData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Data object containing the insights to add or remove. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public CaseInsightsData getData() { + return data; + } + + public void setData(CaseInsightsData data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return CaseInsightsRequest + */ + @JsonAnySetter + public CaseInsightsRequest putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this CaseInsightsRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CaseInsightsRequest caseInsightsRequest = (CaseInsightsRequest) o; + return Objects.equals(this.data, caseInsightsRequest.data) + && Objects.equals(this.additionalProperties, caseInsightsRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CaseInsightsRequest {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CaseLink.java b/src/main/java/com/datadog/api/client/v2/model/CaseLink.java new file mode 100644 index 00000000000..f1ff34c22d2 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CaseLink.java @@ -0,0 +1,213 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** + * A directional link representing a relationship between two entities. At least one entity must be + * a case. + */ +@JsonPropertyOrder({ + CaseLink.JSON_PROPERTY_ATTRIBUTES, + CaseLink.JSON_PROPERTY_ID, + CaseLink.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CaseLink { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private CaseLinkAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private CaseLinkResourceType type; + + public CaseLink() {} + + @JsonCreator + public CaseLink( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + CaseLinkAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) CaseLinkResourceType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public CaseLink attributes(CaseLinkAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes describing a directional relationship between two entities (cases, incidents, or + * pages). + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public CaseLinkAttributes getAttributes() { + return attributes; + } + + public void setAttributes(CaseLinkAttributes attributes) { + this.attributes = attributes; + } + + public CaseLink id(String id) { + this.id = id; + return this; + } + + /** + * The case link identifier. + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public CaseLink type(CaseLinkResourceType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * JSON:API resource type for case links. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public CaseLinkResourceType getType() { + return type; + } + + public void setType(CaseLinkResourceType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return CaseLink + */ + @JsonAnySetter + public CaseLink putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this CaseLink object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CaseLink caseLink = (CaseLink) o; + return Objects.equals(this.attributes, caseLink.attributes) + && Objects.equals(this.id, caseLink.id) + && Objects.equals(this.type, caseLink.type) + && Objects.equals(this.additionalProperties, caseLink.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CaseLink {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CaseLinkAttributes.java b/src/main/java/com/datadog/api/client/v2/model/CaseLinkAttributes.java new file mode 100644 index 00000000000..4e04307b0ff --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CaseLinkAttributes.java @@ -0,0 +1,274 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** + * Attributes describing a directional relationship between two entities (cases, incidents, or + * pages). + */ +@JsonPropertyOrder({ + CaseLinkAttributes.JSON_PROPERTY_CHILD_ENTITY_ID, + CaseLinkAttributes.JSON_PROPERTY_CHILD_ENTITY_TYPE, + CaseLinkAttributes.JSON_PROPERTY_PARENT_ENTITY_ID, + CaseLinkAttributes.JSON_PROPERTY_PARENT_ENTITY_TYPE, + CaseLinkAttributes.JSON_PROPERTY_RELATIONSHIP +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CaseLinkAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_CHILD_ENTITY_ID = "child_entity_id"; + private String childEntityId; + + public static final String JSON_PROPERTY_CHILD_ENTITY_TYPE = "child_entity_type"; + private String childEntityType; + + public static final String JSON_PROPERTY_PARENT_ENTITY_ID = "parent_entity_id"; + private String parentEntityId; + + public static final String JSON_PROPERTY_PARENT_ENTITY_TYPE = "parent_entity_type"; + private String parentEntityType; + + public static final String JSON_PROPERTY_RELATIONSHIP = "relationship"; + private String relationship; + + public CaseLinkAttributes() {} + + @JsonCreator + public CaseLinkAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_CHILD_ENTITY_ID) String childEntityId, + @JsonProperty(required = true, value = JSON_PROPERTY_CHILD_ENTITY_TYPE) + String childEntityType, + @JsonProperty(required = true, value = JSON_PROPERTY_PARENT_ENTITY_ID) String parentEntityId, + @JsonProperty(required = true, value = JSON_PROPERTY_PARENT_ENTITY_TYPE) + String parentEntityType, + @JsonProperty(required = true, value = JSON_PROPERTY_RELATIONSHIP) String relationship) { + this.childEntityId = childEntityId; + this.childEntityType = childEntityType; + this.parentEntityId = parentEntityId; + this.parentEntityType = parentEntityType; + this.relationship = relationship; + } + + public CaseLinkAttributes childEntityId(String childEntityId) { + this.childEntityId = childEntityId; + return this; + } + + /** + * The UUID of the child (target) entity in the relationship. + * + * @return childEntityId + */ + @JsonProperty(JSON_PROPERTY_CHILD_ENTITY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getChildEntityId() { + return childEntityId; + } + + public void setChildEntityId(String childEntityId) { + this.childEntityId = childEntityId; + } + + public CaseLinkAttributes childEntityType(String childEntityType) { + this.childEntityType = childEntityType; + return this; + } + + /** + * The type of the child entity. Allowed values: CASE, INCIDENT, + * PAGE, AGENT_CONVERSATION. + * + * @return childEntityType + */ + @JsonProperty(JSON_PROPERTY_CHILD_ENTITY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getChildEntityType() { + return childEntityType; + } + + public void setChildEntityType(String childEntityType) { + this.childEntityType = childEntityType; + } + + public CaseLinkAttributes parentEntityId(String parentEntityId) { + this.parentEntityId = parentEntityId; + return this; + } + + /** + * The UUID of the parent (source) entity in the relationship. + * + * @return parentEntityId + */ + @JsonProperty(JSON_PROPERTY_PARENT_ENTITY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getParentEntityId() { + return parentEntityId; + } + + public void setParentEntityId(String parentEntityId) { + this.parentEntityId = parentEntityId; + } + + public CaseLinkAttributes parentEntityType(String parentEntityType) { + this.parentEntityType = parentEntityType; + return this; + } + + /** + * The type of the parent entity. Allowed values: CASE, INCIDENT, + * PAGE, AGENT_CONVERSATION. + * + * @return parentEntityType + */ + @JsonProperty(JSON_PROPERTY_PARENT_ENTITY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getParentEntityType() { + return parentEntityType; + } + + public void setParentEntityType(String parentEntityType) { + this.parentEntityType = parentEntityType; + } + + public CaseLinkAttributes relationship(String relationship) { + this.relationship = relationship; + return this; + } + + /** + * The type of directional relationship. Allowed values: RELATES_TO (bidirectional + * association), CAUSES (parent causes child), BLOCKS (parent blocks + * child), DUPLICATES (parent duplicates child), PARENT_OF + * (hierarchical), SUCCESSOR_OF (sequence), ESCALATES_TO (priority + * escalation). + * + * @return relationship + */ + @JsonProperty(JSON_PROPERTY_RELATIONSHIP) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getRelationship() { + return relationship; + } + + public void setRelationship(String relationship) { + this.relationship = relationship; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return CaseLinkAttributes + */ + @JsonAnySetter + public CaseLinkAttributes putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this CaseLinkAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CaseLinkAttributes caseLinkAttributes = (CaseLinkAttributes) o; + return Objects.equals(this.childEntityId, caseLinkAttributes.childEntityId) + && Objects.equals(this.childEntityType, caseLinkAttributes.childEntityType) + && Objects.equals(this.parentEntityId, caseLinkAttributes.parentEntityId) + && Objects.equals(this.parentEntityType, caseLinkAttributes.parentEntityType) + && Objects.equals(this.relationship, caseLinkAttributes.relationship) + && Objects.equals(this.additionalProperties, caseLinkAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + childEntityId, + childEntityType, + parentEntityId, + parentEntityType, + relationship, + additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CaseLinkAttributes {\n"); + sb.append(" childEntityId: ").append(toIndentedString(childEntityId)).append("\n"); + sb.append(" childEntityType: ").append(toIndentedString(childEntityType)).append("\n"); + sb.append(" parentEntityId: ").append(toIndentedString(parentEntityId)).append("\n"); + sb.append(" parentEntityType: ").append(toIndentedString(parentEntityType)).append("\n"); + sb.append(" relationship: ").append(toIndentedString(relationship)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CaseLinkCreate.java b/src/main/java/com/datadog/api/client/v2/model/CaseLinkCreate.java new file mode 100644 index 00000000000..d8db0b9a36a --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CaseLinkCreate.java @@ -0,0 +1,179 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Data object for creating a case link. */ +@JsonPropertyOrder({CaseLinkCreate.JSON_PROPERTY_ATTRIBUTES, CaseLinkCreate.JSON_PROPERTY_TYPE}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CaseLinkCreate { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private CaseLinkAttributes attributes; + + public static final String JSON_PROPERTY_TYPE = "type"; + private CaseLinkResourceType type; + + public CaseLinkCreate() {} + + @JsonCreator + public CaseLinkCreate( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + CaseLinkAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) CaseLinkResourceType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public CaseLinkCreate attributes(CaseLinkAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes describing a directional relationship between two entities (cases, incidents, or + * pages). + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public CaseLinkAttributes getAttributes() { + return attributes; + } + + public void setAttributes(CaseLinkAttributes attributes) { + this.attributes = attributes; + } + + public CaseLinkCreate type(CaseLinkResourceType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * JSON:API resource type for case links. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public CaseLinkResourceType getType() { + return type; + } + + public void setType(CaseLinkResourceType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return CaseLinkCreate + */ + @JsonAnySetter + public CaseLinkCreate putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this CaseLinkCreate object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CaseLinkCreate caseLinkCreate = (CaseLinkCreate) o; + return Objects.equals(this.attributes, caseLinkCreate.attributes) + && Objects.equals(this.type, caseLinkCreate.type) + && Objects.equals(this.additionalProperties, caseLinkCreate.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CaseLinkCreate {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CaseLinkCreateRequest.java b/src/main/java/com/datadog/api/client/v2/model/CaseLinkCreateRequest.java new file mode 100644 index 00000000000..b1eb2294991 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CaseLinkCreateRequest.java @@ -0,0 +1,145 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Request payload for creating a link between two entities. */ +@JsonPropertyOrder({CaseLinkCreateRequest.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CaseLinkCreateRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private CaseLinkCreate data; + + public CaseLinkCreateRequest() {} + + @JsonCreator + public CaseLinkCreateRequest( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) CaseLinkCreate data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public CaseLinkCreateRequest data(CaseLinkCreate data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Data object for creating a case link. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public CaseLinkCreate getData() { + return data; + } + + public void setData(CaseLinkCreate data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return CaseLinkCreateRequest + */ + @JsonAnySetter + public CaseLinkCreateRequest putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this CaseLinkCreateRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CaseLinkCreateRequest caseLinkCreateRequest = (CaseLinkCreateRequest) o; + return Objects.equals(this.data, caseLinkCreateRequest.data) + && Objects.equals(this.additionalProperties, caseLinkCreateRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CaseLinkCreateRequest {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CaseLinkResourceType.java b/src/main/java/com/datadog/api/client/v2/model/CaseLinkResourceType.java new file mode 100644 index 00000000000..feab73a6e21 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CaseLinkResourceType.java @@ -0,0 +1,54 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** JSON:API resource type for case links. */ +@JsonSerialize(using = CaseLinkResourceType.CaseLinkResourceTypeSerializer.class) +public class CaseLinkResourceType extends ModelEnum { + + private static final Set allowedValues = new HashSet(Arrays.asList("link")); + + public static final CaseLinkResourceType LINK = new CaseLinkResourceType("link"); + + CaseLinkResourceType(String value) { + super(value, allowedValues); + } + + public static class CaseLinkResourceTypeSerializer extends StdSerializer { + public CaseLinkResourceTypeSerializer(Class t) { + super(t); + } + + public CaseLinkResourceTypeSerializer() { + this(null); + } + + @Override + public void serialize( + CaseLinkResourceType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static CaseLinkResourceType fromValue(String value) { + return new CaseLinkResourceType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CaseLinkResponse.java b/src/main/java/com/datadog/api/client/v2/model/CaseLinkResponse.java new file mode 100644 index 00000000000..5937d1e83e9 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CaseLinkResponse.java @@ -0,0 +1,146 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Response containing a single case link. */ +@JsonPropertyOrder({CaseLinkResponse.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CaseLinkResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private CaseLink data; + + public CaseLinkResponse() {} + + @JsonCreator + public CaseLinkResponse( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) CaseLink data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public CaseLinkResponse data(CaseLink data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * A directional link representing a relationship between two entities. At least one entity must + * be a case. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public CaseLink getData() { + return data; + } + + public void setData(CaseLink data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return CaseLinkResponse + */ + @JsonAnySetter + public CaseLinkResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this CaseLinkResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CaseLinkResponse caseLinkResponse = (CaseLinkResponse) o; + return Objects.equals(this.data, caseLinkResponse.data) + && Objects.equals(this.additionalProperties, caseLinkResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CaseLinkResponse {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CaseLinksResponse.java b/src/main/java/com/datadog/api/client/v2/model/CaseLinksResponse.java new file mode 100644 index 00000000000..28a0abea2f2 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CaseLinksResponse.java @@ -0,0 +1,154 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** Response containing a list of case links. */ +@JsonPropertyOrder({CaseLinksResponse.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CaseLinksResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private List data = new ArrayList<>(); + + public CaseLinksResponse() {} + + @JsonCreator + public CaseLinksResponse( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) List data) { + this.data = data; + } + + public CaseLinksResponse data(List data) { + this.data = data; + for (CaseLink item : data) { + this.unparsed |= item.unparsed; + } + return this; + } + + public CaseLinksResponse addDataItem(CaseLink dataItem) { + this.data.add(dataItem); + this.unparsed |= dataItem.unparsed; + return this; + } + + /** + * A list of case links. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return CaseLinksResponse + */ + @JsonAnySetter + public CaseLinksResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this CaseLinksResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CaseLinksResponse caseLinksResponse = (CaseLinksResponse) o; + return Objects.equals(this.data, caseLinksResponse.data) + && Objects.equals(this.additionalProperties, caseLinksResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CaseLinksResponse {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CaseResourceType.java b/src/main/java/com/datadog/api/client/v2/model/CaseResourceType.java index 2be5169c955..9bb23312abc 100644 --- a/src/main/java/com/datadog/api/client/v2/model/CaseResourceType.java +++ b/src/main/java/com/datadog/api/client/v2/model/CaseResourceType.java @@ -18,7 +18,7 @@ import java.util.HashSet; import java.util.Set; -/** Case resource type */ +/** JSON:API resource type for cases. */ @JsonSerialize(using = CaseResourceType.CaseResourceTypeSerializer.class) public class CaseResourceType extends ModelEnum { diff --git a/src/main/java/com/datadog/api/client/v2/model/CaseTypeCreate.java b/src/main/java/com/datadog/api/client/v2/model/CaseTypeCreate.java index 30869ad898a..4ac01fad20a 100644 --- a/src/main/java/com/datadog/api/client/v2/model/CaseTypeCreate.java +++ b/src/main/java/com/datadog/api/client/v2/model/CaseTypeCreate.java @@ -17,7 +17,7 @@ import java.util.Map; import java.util.Objects; -/** Case type */ +/** Data object for creating a case type. */ @JsonPropertyOrder({CaseTypeCreate.JSON_PROPERTY_ATTRIBUTES, CaseTypeCreate.JSON_PROPERTY_TYPE}) @jakarta.annotation.Generated( value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") @@ -49,7 +49,9 @@ public CaseTypeCreate attributes(CaseTypeResourceAttributes attributes) { } /** - * Case Type resource attributes + * Attributes of a case type, which define a classification category for cases. Organizations use + * case types to model different workflows (for example, Security Incident, Bug Report, Change + * Request). * * @return attributes */ @@ -70,7 +72,7 @@ public CaseTypeCreate type(CaseTypeResourceType type) { } /** - * Case type resource type + * JSON:API resource type for case types. * * @return type */ diff --git a/src/main/java/com/datadog/api/client/v2/model/CaseTypeCreateRequest.java b/src/main/java/com/datadog/api/client/v2/model/CaseTypeCreateRequest.java index f2d74605f3f..18ec7d6796b 100644 --- a/src/main/java/com/datadog/api/client/v2/model/CaseTypeCreateRequest.java +++ b/src/main/java/com/datadog/api/client/v2/model/CaseTypeCreateRequest.java @@ -17,7 +17,7 @@ import java.util.Map; import java.util.Objects; -/** Case type create request */ +/** Request payload for creating a case type. */ @JsonPropertyOrder({CaseTypeCreateRequest.JSON_PROPERTY_DATA}) @jakarta.annotation.Generated( value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") @@ -42,7 +42,7 @@ public CaseTypeCreateRequest data(CaseTypeCreate data) { } /** - * Case type + * Data object for creating a case type. * * @return data */ diff --git a/src/main/java/com/datadog/api/client/v2/model/CaseTypeResource.java b/src/main/java/com/datadog/api/client/v2/model/CaseTypeResource.java index e19a10d2fb3..5a69f64871f 100644 --- a/src/main/java/com/datadog/api/client/v2/model/CaseTypeResource.java +++ b/src/main/java/com/datadog/api/client/v2/model/CaseTypeResource.java @@ -16,7 +16,10 @@ import java.util.Map; import java.util.Objects; -/** The definition of CaseType object. */ +/** + * A case type that defines a classification category for cases. Each case type can have its own + * custom attributes, statuses, and automation rules. + */ @JsonPropertyOrder({ CaseTypeResource.JSON_PROPERTY_ATTRIBUTES, CaseTypeResource.JSON_PROPERTY_ID, @@ -42,7 +45,9 @@ public CaseTypeResource attributes(CaseTypeResourceAttributes attributes) { } /** - * Case Type resource attributes + * Attributes of a case type, which define a classification category for cases. Organizations use + * case types to model different workflows (for example, Security Incident, Bug Report, Change + * Request). * * @return attributes */ @@ -85,7 +90,7 @@ public CaseTypeResource type(CaseTypeResourceType type) { } /** - * Case type resource type + * JSON:API resource type for case types. * * @return type */ diff --git a/src/main/java/com/datadog/api/client/v2/model/CaseTypeResourceAttributes.java b/src/main/java/com/datadog/api/client/v2/model/CaseTypeResourceAttributes.java index 17eea93daaa..b08aa9f0c70 100644 --- a/src/main/java/com/datadog/api/client/v2/model/CaseTypeResourceAttributes.java +++ b/src/main/java/com/datadog/api/client/v2/model/CaseTypeResourceAttributes.java @@ -19,7 +19,11 @@ import java.util.Objects; import org.openapitools.jackson.nullable.JsonNullable; -/** Case Type resource attributes */ +/** + * Attributes of a case type, which define a classification category for cases. Organizations use + * case types to model different workflows (for example, Security Incident, Bug Report, Change + * Request). + */ @JsonPropertyOrder({ CaseTypeResourceAttributes.JSON_PROPERTY_DELETED_AT, CaseTypeResourceAttributes.JSON_PROPERTY_DESCRIPTION, @@ -51,7 +55,8 @@ public CaseTypeResourceAttributes( } /** - * Timestamp of when the case type was deleted + * Timestamp when the case type was marked as deleted. A null value indicates the case type is + * active. * * @return deletedAt */ @@ -82,7 +87,7 @@ public CaseTypeResourceAttributes description(String description) { } /** - * Case type description. + * A detailed description explaining when this case type should be used. * * @return description */ @@ -103,7 +108,7 @@ public CaseTypeResourceAttributes emoji(String emoji) { } /** - * Case type emoji. + * An emoji icon representing the case type in the UI. * * @return emoji */ @@ -124,7 +129,8 @@ public CaseTypeResourceAttributes name(String name) { } /** - * Case type name. + * The display name of the case type, shown in the Case Management UI when creating or viewing + * cases. * * @return name */ diff --git a/src/main/java/com/datadog/api/client/v2/model/CaseTypeResourceType.java b/src/main/java/com/datadog/api/client/v2/model/CaseTypeResourceType.java index 5bb1ab98d66..e365f81edbd 100644 --- a/src/main/java/com/datadog/api/client/v2/model/CaseTypeResourceType.java +++ b/src/main/java/com/datadog/api/client/v2/model/CaseTypeResourceType.java @@ -18,7 +18,7 @@ import java.util.HashSet; import java.util.Set; -/** Case type resource type */ +/** JSON:API resource type for case types. */ @JsonSerialize(using = CaseTypeResourceType.CaseTypeResourceTypeSerializer.class) public class CaseTypeResourceType extends ModelEnum { diff --git a/src/main/java/com/datadog/api/client/v2/model/CaseTypeResponse.java b/src/main/java/com/datadog/api/client/v2/model/CaseTypeResponse.java index 91f61b68372..f82a3c362bd 100644 --- a/src/main/java/com/datadog/api/client/v2/model/CaseTypeResponse.java +++ b/src/main/java/com/datadog/api/client/v2/model/CaseTypeResponse.java @@ -16,7 +16,7 @@ import java.util.Map; import java.util.Objects; -/** Case type response */ +/** Response containing a single case type. */ @JsonPropertyOrder({CaseTypeResponse.JSON_PROPERTY_DATA}) @jakarta.annotation.Generated( value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") @@ -32,7 +32,8 @@ public CaseTypeResponse data(CaseTypeResource data) { } /** - * The definition of CaseType object. + * A case type that defines a classification category for cases. Each case type can have its own + * custom attributes, statuses, and automation rules. * * @return data */ diff --git a/src/main/java/com/datadog/api/client/v2/model/CaseTypeUpdate.java b/src/main/java/com/datadog/api/client/v2/model/CaseTypeUpdate.java new file mode 100644 index 00000000000..b28d8115871 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CaseTypeUpdate.java @@ -0,0 +1,177 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Data object for updating a case type. */ +@JsonPropertyOrder({CaseTypeUpdate.JSON_PROPERTY_ATTRIBUTES, CaseTypeUpdate.JSON_PROPERTY_TYPE}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CaseTypeUpdate { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private CaseTypeResourceAttributes attributes; + + public static final String JSON_PROPERTY_TYPE = "type"; + private CaseTypeResourceType type = CaseTypeResourceType.CASE_TYPE; + + public CaseTypeUpdate() {} + + @JsonCreator + public CaseTypeUpdate( + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) CaseTypeResourceType type) { + this.type = type; + this.unparsed |= !type.isValid(); + } + + public CaseTypeUpdate attributes(CaseTypeResourceAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes of a case type, which define a classification category for cases. Organizations use + * case types to model different workflows (for example, Security Incident, Bug Report, Change + * Request). + * + * @return attributes + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public CaseTypeResourceAttributes getAttributes() { + return attributes; + } + + public void setAttributes(CaseTypeResourceAttributes attributes) { + this.attributes = attributes; + } + + public CaseTypeUpdate type(CaseTypeResourceType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * JSON:API resource type for case types. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public CaseTypeResourceType getType() { + return type; + } + + public void setType(CaseTypeResourceType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return CaseTypeUpdate + */ + @JsonAnySetter + public CaseTypeUpdate putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this CaseTypeUpdate object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CaseTypeUpdate caseTypeUpdate = (CaseTypeUpdate) o; + return Objects.equals(this.attributes, caseTypeUpdate.attributes) + && Objects.equals(this.type, caseTypeUpdate.type) + && Objects.equals(this.additionalProperties, caseTypeUpdate.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CaseTypeUpdate {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CaseTypeUpdateRequest.java b/src/main/java/com/datadog/api/client/v2/model/CaseTypeUpdateRequest.java new file mode 100644 index 00000000000..2709ce00b1a --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CaseTypeUpdateRequest.java @@ -0,0 +1,145 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Request payload for updating a case type. */ +@JsonPropertyOrder({CaseTypeUpdateRequest.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CaseTypeUpdateRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private CaseTypeUpdate data; + + public CaseTypeUpdateRequest() {} + + @JsonCreator + public CaseTypeUpdateRequest( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) CaseTypeUpdate data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public CaseTypeUpdateRequest data(CaseTypeUpdate data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Data object for updating a case type. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public CaseTypeUpdate getData() { + return data; + } + + public void setData(CaseTypeUpdate data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return CaseTypeUpdateRequest + */ + @JsonAnySetter + public CaseTypeUpdateRequest putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this CaseTypeUpdateRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CaseTypeUpdateRequest caseTypeUpdateRequest = (CaseTypeUpdateRequest) o; + return Objects.equals(this.data, caseTypeUpdateRequest.data) + && Objects.equals(this.additionalProperties, caseTypeUpdateRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CaseTypeUpdateRequest {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CaseTypesResponse.java b/src/main/java/com/datadog/api/client/v2/model/CaseTypesResponse.java index f0f500a5aee..3139d859607 100644 --- a/src/main/java/com/datadog/api/client/v2/model/CaseTypesResponse.java +++ b/src/main/java/com/datadog/api/client/v2/model/CaseTypesResponse.java @@ -18,7 +18,7 @@ import java.util.Map; import java.util.Objects; -/** Case types response. */ +/** Response containing a list of case types. */ @JsonPropertyOrder({CaseTypesResponse.JSON_PROPERTY_DATA}) @jakarta.annotation.Generated( value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") diff --git a/src/main/java/com/datadog/api/client/v2/model/CaseUpdateAttributes.java b/src/main/java/com/datadog/api/client/v2/model/CaseUpdateAttributes.java index c1e0a261b1f..98c8108e7e9 100644 --- a/src/main/java/com/datadog/api/client/v2/model/CaseUpdateAttributes.java +++ b/src/main/java/com/datadog/api/client/v2/model/CaseUpdateAttributes.java @@ -73,7 +73,7 @@ public CaseUpdateAttributes type(CaseResourceType type) { } /** - * Case resource type + * JSON:API resource type for cases. * * @return type */ diff --git a/src/main/java/com/datadog/api/client/v2/model/CaseUpdateAttributesAttributes.java b/src/main/java/com/datadog/api/client/v2/model/CaseUpdateAttributesAttributes.java index 3ef4d18785a..d5bfeb4349a 100644 --- a/src/main/java/com/datadog/api/client/v2/model/CaseUpdateAttributesAttributes.java +++ b/src/main/java/com/datadog/api/client/v2/model/CaseUpdateAttributesAttributes.java @@ -47,7 +47,8 @@ public CaseUpdateAttributesAttributes putAttributesItem(String key, List } /** - * The definition of CaseObjectAttributes object. + * Key-value pairs of case attributes. Each key maps to an array of string values, used for + * flexible metadata such as labels or tags. * * @return attributes */ diff --git a/src/main/java/com/datadog/api/client/v2/model/CaseUpdateComment.java b/src/main/java/com/datadog/api/client/v2/model/CaseUpdateComment.java new file mode 100644 index 00000000000..d1b1950207f --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CaseUpdateComment.java @@ -0,0 +1,181 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Data object for updating a case comment. */ +@JsonPropertyOrder({ + CaseUpdateComment.JSON_PROPERTY_ATTRIBUTES, + CaseUpdateComment.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CaseUpdateComment { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private CaseUpdateCommentAttributes attributes; + + public static final String JSON_PROPERTY_TYPE = "type"; + private CaseResourceType type = CaseResourceType.CASE; + + public CaseUpdateComment() {} + + @JsonCreator + public CaseUpdateComment( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + CaseUpdateCommentAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) CaseResourceType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public CaseUpdateComment attributes(CaseUpdateCommentAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes for updating a comment. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public CaseUpdateCommentAttributes getAttributes() { + return attributes; + } + + public void setAttributes(CaseUpdateCommentAttributes attributes) { + this.attributes = attributes; + } + + public CaseUpdateComment type(CaseResourceType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * JSON:API resource type for cases. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public CaseResourceType getType() { + return type; + } + + public void setType(CaseResourceType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return CaseUpdateComment + */ + @JsonAnySetter + public CaseUpdateComment putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this CaseUpdateComment object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CaseUpdateComment caseUpdateComment = (CaseUpdateComment) o; + return Objects.equals(this.attributes, caseUpdateComment.attributes) + && Objects.equals(this.type, caseUpdateComment.type) + && Objects.equals(this.additionalProperties, caseUpdateComment.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CaseUpdateComment {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CaseUpdateCommentAttributes.java b/src/main/java/com/datadog/api/client/v2/model/CaseUpdateCommentAttributes.java new file mode 100644 index 00000000000..7aa61c3c88c --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CaseUpdateCommentAttributes.java @@ -0,0 +1,144 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Attributes for updating a comment. */ +@JsonPropertyOrder({CaseUpdateCommentAttributes.JSON_PROPERTY_COMMENT}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CaseUpdateCommentAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_COMMENT = "comment"; + private String comment; + + public CaseUpdateCommentAttributes() {} + + @JsonCreator + public CaseUpdateCommentAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_COMMENT) String comment) { + this.comment = comment; + } + + public CaseUpdateCommentAttributes comment(String comment) { + this.comment = comment; + return this; + } + + /** + * The updated comment message. + * + * @return comment + */ + @JsonProperty(JSON_PROPERTY_COMMENT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getComment() { + return comment; + } + + public void setComment(String comment) { + this.comment = comment; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return CaseUpdateCommentAttributes + */ + @JsonAnySetter + public CaseUpdateCommentAttributes putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this CaseUpdateCommentAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CaseUpdateCommentAttributes caseUpdateCommentAttributes = (CaseUpdateCommentAttributes) o; + return Objects.equals(this.comment, caseUpdateCommentAttributes.comment) + && Objects.equals( + this.additionalProperties, caseUpdateCommentAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(comment, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CaseUpdateCommentAttributes {\n"); + sb.append(" comment: ").append(toIndentedString(comment)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CaseUpdateCommentRequest.java b/src/main/java/com/datadog/api/client/v2/model/CaseUpdateCommentRequest.java new file mode 100644 index 00000000000..f1b80519f6a --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CaseUpdateCommentRequest.java @@ -0,0 +1,145 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Request payload for updating a comment on a case timeline. */ +@JsonPropertyOrder({CaseUpdateCommentRequest.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CaseUpdateCommentRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private CaseUpdateComment data; + + public CaseUpdateCommentRequest() {} + + @JsonCreator + public CaseUpdateCommentRequest( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) CaseUpdateComment data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public CaseUpdateCommentRequest data(CaseUpdateComment data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Data object for updating a case comment. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public CaseUpdateComment getData() { + return data; + } + + public void setData(CaseUpdateComment data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return CaseUpdateCommentRequest + */ + @JsonAnySetter + public CaseUpdateCommentRequest putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this CaseUpdateCommentRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CaseUpdateCommentRequest caseUpdateCommentRequest = (CaseUpdateCommentRequest) o; + return Objects.equals(this.data, caseUpdateCommentRequest.data) + && Objects.equals(this.additionalProperties, caseUpdateCommentRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CaseUpdateCommentRequest {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CaseUpdateCustomAttribute.java b/src/main/java/com/datadog/api/client/v2/model/CaseUpdateCustomAttribute.java index 2f5f7769c24..16aade042f8 100644 --- a/src/main/java/com/datadog/api/client/v2/model/CaseUpdateCustomAttribute.java +++ b/src/main/java/com/datadog/api/client/v2/model/CaseUpdateCustomAttribute.java @@ -52,7 +52,7 @@ public CaseUpdateCustomAttribute attributes(CustomAttributeValue attributes) { } /** - * Custom attribute values + * A typed value for a custom attribute on a specific case. * * @return attributes */ @@ -73,7 +73,7 @@ public CaseUpdateCustomAttribute type(CaseResourceType type) { } /** - * Case resource type + * JSON:API resource type for cases. * * @return type */ diff --git a/src/main/java/com/datadog/api/client/v2/model/CaseUpdateDescription.java b/src/main/java/com/datadog/api/client/v2/model/CaseUpdateDescription.java index 6ae4a9c9a26..1a58f29bd3d 100644 --- a/src/main/java/com/datadog/api/client/v2/model/CaseUpdateDescription.java +++ b/src/main/java/com/datadog/api/client/v2/model/CaseUpdateDescription.java @@ -73,7 +73,7 @@ public CaseUpdateDescription type(CaseResourceType type) { } /** - * Case resource type + * JSON:API resource type for cases. * * @return type */ diff --git a/src/main/java/com/datadog/api/client/v2/model/CaseUpdateDueDate.java b/src/main/java/com/datadog/api/client/v2/model/CaseUpdateDueDate.java new file mode 100644 index 00000000000..340ce97f8dc --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CaseUpdateDueDate.java @@ -0,0 +1,181 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Data object for updating a case's due date. */ +@JsonPropertyOrder({ + CaseUpdateDueDate.JSON_PROPERTY_ATTRIBUTES, + CaseUpdateDueDate.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CaseUpdateDueDate { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private CaseUpdateDueDateAttributes attributes; + + public static final String JSON_PROPERTY_TYPE = "type"; + private CaseResourceType type = CaseResourceType.CASE; + + public CaseUpdateDueDate() {} + + @JsonCreator + public CaseUpdateDueDate( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + CaseUpdateDueDateAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) CaseResourceType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public CaseUpdateDueDate attributes(CaseUpdateDueDateAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes for setting or clearing a case's due date. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public CaseUpdateDueDateAttributes getAttributes() { + return attributes; + } + + public void setAttributes(CaseUpdateDueDateAttributes attributes) { + this.attributes = attributes; + } + + public CaseUpdateDueDate type(CaseResourceType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * JSON:API resource type for cases. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public CaseResourceType getType() { + return type; + } + + public void setType(CaseResourceType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return CaseUpdateDueDate + */ + @JsonAnySetter + public CaseUpdateDueDate putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this CaseUpdateDueDate object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CaseUpdateDueDate caseUpdateDueDate = (CaseUpdateDueDate) o; + return Objects.equals(this.attributes, caseUpdateDueDate.attributes) + && Objects.equals(this.type, caseUpdateDueDate.type) + && Objects.equals(this.additionalProperties, caseUpdateDueDate.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CaseUpdateDueDate {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CaseUpdateDueDateAttributes.java b/src/main/java/com/datadog/api/client/v2/model/CaseUpdateDueDateAttributes.java new file mode 100644 index 00000000000..aa9d942e762 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CaseUpdateDueDateAttributes.java @@ -0,0 +1,145 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Attributes for setting or clearing a case's due date. */ +@JsonPropertyOrder({CaseUpdateDueDateAttributes.JSON_PROPERTY_DUE_DATE}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CaseUpdateDueDateAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DUE_DATE = "due_date"; + private String dueDate; + + public CaseUpdateDueDateAttributes() {} + + @JsonCreator + public CaseUpdateDueDateAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_DUE_DATE) String dueDate) { + this.dueDate = dueDate; + } + + public CaseUpdateDueDateAttributes dueDate(String dueDate) { + this.dueDate = dueDate; + return this; + } + + /** + * The target resolution date for the case, in YYYY-MM-DD format. Set to null + * to clear the due date. + * + * @return dueDate + */ + @JsonProperty(JSON_PROPERTY_DUE_DATE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getDueDate() { + return dueDate; + } + + public void setDueDate(String dueDate) { + this.dueDate = dueDate; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return CaseUpdateDueDateAttributes + */ + @JsonAnySetter + public CaseUpdateDueDateAttributes putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this CaseUpdateDueDateAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CaseUpdateDueDateAttributes caseUpdateDueDateAttributes = (CaseUpdateDueDateAttributes) o; + return Objects.equals(this.dueDate, caseUpdateDueDateAttributes.dueDate) + && Objects.equals( + this.additionalProperties, caseUpdateDueDateAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(dueDate, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CaseUpdateDueDateAttributes {\n"); + sb.append(" dueDate: ").append(toIndentedString(dueDate)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CaseUpdateDueDateRequest.java b/src/main/java/com/datadog/api/client/v2/model/CaseUpdateDueDateRequest.java new file mode 100644 index 00000000000..465dcf2e5e0 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CaseUpdateDueDateRequest.java @@ -0,0 +1,145 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Request payload for updating a case's due date. */ +@JsonPropertyOrder({CaseUpdateDueDateRequest.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CaseUpdateDueDateRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private CaseUpdateDueDate data; + + public CaseUpdateDueDateRequest() {} + + @JsonCreator + public CaseUpdateDueDateRequest( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) CaseUpdateDueDate data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public CaseUpdateDueDateRequest data(CaseUpdateDueDate data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Data object for updating a case's due date. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public CaseUpdateDueDate getData() { + return data; + } + + public void setData(CaseUpdateDueDate data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return CaseUpdateDueDateRequest + */ + @JsonAnySetter + public CaseUpdateDueDateRequest putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this CaseUpdateDueDateRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CaseUpdateDueDateRequest caseUpdateDueDateRequest = (CaseUpdateDueDateRequest) o; + return Objects.equals(this.data, caseUpdateDueDateRequest.data) + && Objects.equals(this.additionalProperties, caseUpdateDueDateRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CaseUpdateDueDateRequest {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CaseUpdatePriority.java b/src/main/java/com/datadog/api/client/v2/model/CaseUpdatePriority.java index 77b1cecba09..ba7354da91e 100644 --- a/src/main/java/com/datadog/api/client/v2/model/CaseUpdatePriority.java +++ b/src/main/java/com/datadog/api/client/v2/model/CaseUpdatePriority.java @@ -73,7 +73,7 @@ public CaseUpdatePriority type(CaseResourceType type) { } /** - * Case resource type + * JSON:API resource type for cases. * * @return type */ diff --git a/src/main/java/com/datadog/api/client/v2/model/CaseUpdateResolvedReason.java b/src/main/java/com/datadog/api/client/v2/model/CaseUpdateResolvedReason.java new file mode 100644 index 00000000000..6a37c12f8cc --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CaseUpdateResolvedReason.java @@ -0,0 +1,181 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Data object for updating a case's resolved reason. */ +@JsonPropertyOrder({ + CaseUpdateResolvedReason.JSON_PROPERTY_ATTRIBUTES, + CaseUpdateResolvedReason.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CaseUpdateResolvedReason { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private CaseUpdateResolvedReasonAttributes attributes; + + public static final String JSON_PROPERTY_TYPE = "type"; + private CaseResourceType type = CaseResourceType.CASE; + + public CaseUpdateResolvedReason() {} + + @JsonCreator + public CaseUpdateResolvedReason( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + CaseUpdateResolvedReasonAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) CaseResourceType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public CaseUpdateResolvedReason attributes(CaseUpdateResolvedReasonAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes for setting the resolution reason on a security case. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public CaseUpdateResolvedReasonAttributes getAttributes() { + return attributes; + } + + public void setAttributes(CaseUpdateResolvedReasonAttributes attributes) { + this.attributes = attributes; + } + + public CaseUpdateResolvedReason type(CaseResourceType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * JSON:API resource type for cases. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public CaseResourceType getType() { + return type; + } + + public void setType(CaseResourceType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return CaseUpdateResolvedReason + */ + @JsonAnySetter + public CaseUpdateResolvedReason putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this CaseUpdateResolvedReason object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CaseUpdateResolvedReason caseUpdateResolvedReason = (CaseUpdateResolvedReason) o; + return Objects.equals(this.attributes, caseUpdateResolvedReason.attributes) + && Objects.equals(this.type, caseUpdateResolvedReason.type) + && Objects.equals(this.additionalProperties, caseUpdateResolvedReason.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CaseUpdateResolvedReason {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CaseUpdateResolvedReasonAttributes.java b/src/main/java/com/datadog/api/client/v2/model/CaseUpdateResolvedReasonAttributes.java new file mode 100644 index 00000000000..6d2436cc97b --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CaseUpdateResolvedReasonAttributes.java @@ -0,0 +1,150 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Attributes for setting the resolution reason on a security case. */ +@JsonPropertyOrder({CaseUpdateResolvedReasonAttributes.JSON_PROPERTY_SECURITY_RESOLVED_REASON}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CaseUpdateResolvedReasonAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_SECURITY_RESOLVED_REASON = "security_resolved_reason"; + private String securityResolvedReason; + + public CaseUpdateResolvedReasonAttributes() {} + + @JsonCreator + public CaseUpdateResolvedReasonAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_SECURITY_RESOLVED_REASON) + String securityResolvedReason) { + this.securityResolvedReason = securityResolvedReason; + } + + public CaseUpdateResolvedReasonAttributes securityResolvedReason(String securityResolvedReason) { + this.securityResolvedReason = securityResolvedReason; + return this; + } + + /** + * The reason the security case was resolved (for example, FALSE_POSITIVE, + * TRUE_POSITIVE, BENIGN_POSITIVE). + * + * @return securityResolvedReason + */ + @JsonProperty(JSON_PROPERTY_SECURITY_RESOLVED_REASON) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getSecurityResolvedReason() { + return securityResolvedReason; + } + + public void setSecurityResolvedReason(String securityResolvedReason) { + this.securityResolvedReason = securityResolvedReason; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return CaseUpdateResolvedReasonAttributes + */ + @JsonAnySetter + public CaseUpdateResolvedReasonAttributes putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this CaseUpdateResolvedReasonAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CaseUpdateResolvedReasonAttributes caseUpdateResolvedReasonAttributes = + (CaseUpdateResolvedReasonAttributes) o; + return Objects.equals( + this.securityResolvedReason, caseUpdateResolvedReasonAttributes.securityResolvedReason) + && Objects.equals( + this.additionalProperties, caseUpdateResolvedReasonAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(securityResolvedReason, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CaseUpdateResolvedReasonAttributes {\n"); + sb.append(" securityResolvedReason: ") + .append(toIndentedString(securityResolvedReason)) + .append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CaseUpdateResolvedReasonRequest.java b/src/main/java/com/datadog/api/client/v2/model/CaseUpdateResolvedReasonRequest.java new file mode 100644 index 00000000000..b0f9e12af3e --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CaseUpdateResolvedReasonRequest.java @@ -0,0 +1,147 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Request payload for updating the resolution reason on a closed security case. */ +@JsonPropertyOrder({CaseUpdateResolvedReasonRequest.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CaseUpdateResolvedReasonRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private CaseUpdateResolvedReason data; + + public CaseUpdateResolvedReasonRequest() {} + + @JsonCreator + public CaseUpdateResolvedReasonRequest( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) CaseUpdateResolvedReason data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public CaseUpdateResolvedReasonRequest data(CaseUpdateResolvedReason data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Data object for updating a case's resolved reason. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public CaseUpdateResolvedReason getData() { + return data; + } + + public void setData(CaseUpdateResolvedReason data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return CaseUpdateResolvedReasonRequest + */ + @JsonAnySetter + public CaseUpdateResolvedReasonRequest putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this CaseUpdateResolvedReasonRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CaseUpdateResolvedReasonRequest caseUpdateResolvedReasonRequest = + (CaseUpdateResolvedReasonRequest) o; + return Objects.equals(this.data, caseUpdateResolvedReasonRequest.data) + && Objects.equals( + this.additionalProperties, caseUpdateResolvedReasonRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CaseUpdateResolvedReasonRequest {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CaseUpdateStatus.java b/src/main/java/com/datadog/api/client/v2/model/CaseUpdateStatus.java index bce3d190e9d..4f4ea78e6a2 100644 --- a/src/main/java/com/datadog/api/client/v2/model/CaseUpdateStatus.java +++ b/src/main/java/com/datadog/api/client/v2/model/CaseUpdateStatus.java @@ -70,7 +70,7 @@ public CaseUpdateStatus type(CaseResourceType type) { } /** - * Case resource type + * JSON:API resource type for cases. * * @return type */ diff --git a/src/main/java/com/datadog/api/client/v2/model/CaseUpdateTitle.java b/src/main/java/com/datadog/api/client/v2/model/CaseUpdateTitle.java index 3c07d65dd94..7ac63bd0adf 100644 --- a/src/main/java/com/datadog/api/client/v2/model/CaseUpdateTitle.java +++ b/src/main/java/com/datadog/api/client/v2/model/CaseUpdateTitle.java @@ -70,7 +70,7 @@ public CaseUpdateTitle type(CaseResourceType type) { } /** - * Case resource type + * JSON:API resource type for cases. * * @return type */ diff --git a/src/main/java/com/datadog/api/client/v2/model/CaseView.java b/src/main/java/com/datadog/api/client/v2/model/CaseView.java new file mode 100644 index 00000000000..3b23a5b94c6 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CaseView.java @@ -0,0 +1,241 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** + * A saved case view that provides a filtered, reusable list of cases matching a specific query. + * Views act as persistent dashboards for monitoring case subsets. + */ +@JsonPropertyOrder({ + CaseView.JSON_PROPERTY_ATTRIBUTES, + CaseView.JSON_PROPERTY_ID, + CaseView.JSON_PROPERTY_RELATIONSHIPS, + CaseView.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CaseView { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private CaseViewAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_RELATIONSHIPS = "relationships"; + private CaseViewRelationships relationships; + + public static final String JSON_PROPERTY_TYPE = "type"; + private CaseViewResourceType type = CaseViewResourceType.VIEW; + + public CaseView() {} + + @JsonCreator + public CaseView( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + CaseViewAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) CaseViewResourceType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public CaseView attributes(CaseViewAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes of a case view, including the filter query and optional notification rule. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public CaseViewAttributes getAttributes() { + return attributes; + } + + public void setAttributes(CaseViewAttributes attributes) { + this.attributes = attributes; + } + + public CaseView id(String id) { + this.id = id; + return this; + } + + /** + * The view's identifier. + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public CaseView relationships(CaseViewRelationships relationships) { + this.relationships = relationships; + this.unparsed |= relationships.unparsed; + return this; + } + + /** + * Related resources for the case view, including the creator, last modifier, and associated + * project. + * + * @return relationships + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_RELATIONSHIPS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public CaseViewRelationships getRelationships() { + return relationships; + } + + public void setRelationships(CaseViewRelationships relationships) { + this.relationships = relationships; + } + + public CaseView type(CaseViewResourceType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * JSON:API resource type for case views. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public CaseViewResourceType getType() { + return type; + } + + public void setType(CaseViewResourceType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return CaseView + */ + @JsonAnySetter + public CaseView putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this CaseView object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CaseView caseView = (CaseView) o; + return Objects.equals(this.attributes, caseView.attributes) + && Objects.equals(this.id, caseView.id) + && Objects.equals(this.relationships, caseView.relationships) + && Objects.equals(this.type, caseView.type) + && Objects.equals(this.additionalProperties, caseView.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, relationships, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CaseView {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" relationships: ").append(toIndentedString(relationships)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CaseViewAttributes.java b/src/main/java/com/datadog/api/client/v2/model/CaseViewAttributes.java new file mode 100644 index 00000000000..c2de0e26345 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CaseViewAttributes.java @@ -0,0 +1,240 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Attributes of a case view, including the filter query and optional notification rule. */ +@JsonPropertyOrder({ + CaseViewAttributes.JSON_PROPERTY_CREATED_AT, + CaseViewAttributes.JSON_PROPERTY_MODIFIED_AT, + CaseViewAttributes.JSON_PROPERTY_NAME, + CaseViewAttributes.JSON_PROPERTY_NP_RULE_ID, + CaseViewAttributes.JSON_PROPERTY_QUERY +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CaseViewAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_CREATED_AT = "created_at"; + private OffsetDateTime createdAt; + + public static final String JSON_PROPERTY_MODIFIED_AT = "modified_at"; + private OffsetDateTime modifiedAt; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_NP_RULE_ID = "np_rule_id"; + private String npRuleId; + + public static final String JSON_PROPERTY_QUERY = "query"; + private String query; + + public CaseViewAttributes() {} + + @JsonCreator + public CaseViewAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_CREATED_AT) OffsetDateTime createdAt, + @JsonProperty(required = true, value = JSON_PROPERTY_NAME) String name, + @JsonProperty(required = true, value = JSON_PROPERTY_QUERY) String query) { + this.createdAt = createdAt; + this.name = name; + this.query = query; + } + + /** + * Timestamp when the view was created. + * + * @return createdAt + */ + @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + /** + * Timestamp when the view was last modified. + * + * @return modifiedAt + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MODIFIED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getModifiedAt() { + return modifiedAt; + } + + public CaseViewAttributes name(String name) { + this.name = name; + return this; + } + + /** + * A human-readable name for the view, displayed in the Case Management UI. + * + * @return name + */ + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public CaseViewAttributes npRuleId(String npRuleId) { + this.npRuleId = npRuleId; + return this; + } + + /** + * The identifier of a notification rule linked to this view. When set, users subscribed to the + * view receive alerts for matching cases. + * + * @return npRuleId + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NP_RULE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getNpRuleId() { + return npRuleId; + } + + public void setNpRuleId(String npRuleId) { + this.npRuleId = npRuleId; + } + + public CaseViewAttributes query(String query) { + this.query = query; + return this; + } + + /** + * The search query that determines which cases appear in this view. Uses the same syntax as the + * Case Management search bar (for example, status:open priority:P1). + * + * @return query + */ + @JsonProperty(JSON_PROPERTY_QUERY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getQuery() { + return query; + } + + public void setQuery(String query) { + this.query = query; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return CaseViewAttributes + */ + @JsonAnySetter + public CaseViewAttributes putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this CaseViewAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CaseViewAttributes caseViewAttributes = (CaseViewAttributes) o; + return Objects.equals(this.createdAt, caseViewAttributes.createdAt) + && Objects.equals(this.modifiedAt, caseViewAttributes.modifiedAt) + && Objects.equals(this.name, caseViewAttributes.name) + && Objects.equals(this.npRuleId, caseViewAttributes.npRuleId) + && Objects.equals(this.query, caseViewAttributes.query) + && Objects.equals(this.additionalProperties, caseViewAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(createdAt, modifiedAt, name, npRuleId, query, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CaseViewAttributes {\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" modifiedAt: ").append(toIndentedString(modifiedAt)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" npRuleId: ").append(toIndentedString(npRuleId)).append("\n"); + sb.append(" query: ").append(toIndentedString(query)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CaseViewCreate.java b/src/main/java/com/datadog/api/client/v2/model/CaseViewCreate.java new file mode 100644 index 00000000000..e61a6124999 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CaseViewCreate.java @@ -0,0 +1,178 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Data object for creating a case view. */ +@JsonPropertyOrder({CaseViewCreate.JSON_PROPERTY_ATTRIBUTES, CaseViewCreate.JSON_PROPERTY_TYPE}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CaseViewCreate { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private CaseViewCreateAttributes attributes; + + public static final String JSON_PROPERTY_TYPE = "type"; + private CaseViewResourceType type = CaseViewResourceType.VIEW; + + public CaseViewCreate() {} + + @JsonCreator + public CaseViewCreate( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + CaseViewCreateAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) CaseViewResourceType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public CaseViewCreate attributes(CaseViewCreateAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes required to create a case view. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public CaseViewCreateAttributes getAttributes() { + return attributes; + } + + public void setAttributes(CaseViewCreateAttributes attributes) { + this.attributes = attributes; + } + + public CaseViewCreate type(CaseViewResourceType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * JSON:API resource type for case views. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public CaseViewResourceType getType() { + return type; + } + + public void setType(CaseViewResourceType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return CaseViewCreate + */ + @JsonAnySetter + public CaseViewCreate putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this CaseViewCreate object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CaseViewCreate caseViewCreate = (CaseViewCreate) o; + return Objects.equals(this.attributes, caseViewCreate.attributes) + && Objects.equals(this.type, caseViewCreate.type) + && Objects.equals(this.additionalProperties, caseViewCreate.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CaseViewCreate {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CaseViewCreateAttributes.java b/src/main/java/com/datadog/api/client/v2/model/CaseViewCreateAttributes.java new file mode 100644 index 00000000000..1ce66b13bb9 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CaseViewCreateAttributes.java @@ -0,0 +1,229 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Attributes required to create a case view. */ +@JsonPropertyOrder({ + CaseViewCreateAttributes.JSON_PROPERTY_NAME, + CaseViewCreateAttributes.JSON_PROPERTY_NP_RULE_ID, + CaseViewCreateAttributes.JSON_PROPERTY_PROJECT_ID, + CaseViewCreateAttributes.JSON_PROPERTY_QUERY +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CaseViewCreateAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_NP_RULE_ID = "np_rule_id"; + private String npRuleId; + + public static final String JSON_PROPERTY_PROJECT_ID = "project_id"; + private String projectId; + + public static final String JSON_PROPERTY_QUERY = "query"; + private String query; + + public CaseViewCreateAttributes() {} + + @JsonCreator + public CaseViewCreateAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_NAME) String name, + @JsonProperty(required = true, value = JSON_PROPERTY_PROJECT_ID) String projectId, + @JsonProperty(required = true, value = JSON_PROPERTY_QUERY) String query) { + this.name = name; + this.projectId = projectId; + this.query = query; + } + + public CaseViewCreateAttributes name(String name) { + this.name = name; + return this; + } + + /** + * The name of the view. + * + * @return name + */ + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public CaseViewCreateAttributes npRuleId(String npRuleId) { + this.npRuleId = npRuleId; + return this; + } + + /** + * The identifier of a notification rule linked to this view. When set, users subscribed to the + * view receive alerts for matching cases. + * + * @return npRuleId + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NP_RULE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getNpRuleId() { + return npRuleId; + } + + public void setNpRuleId(String npRuleId) { + this.npRuleId = npRuleId; + } + + public CaseViewCreateAttributes projectId(String projectId) { + this.projectId = projectId; + return this; + } + + /** + * The UUID of the project this view belongs to. Views are scoped to a single project. + * + * @return projectId + */ + @JsonProperty(JSON_PROPERTY_PROJECT_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getProjectId() { + return projectId; + } + + public void setProjectId(String projectId) { + this.projectId = projectId; + } + + public CaseViewCreateAttributes query(String query) { + this.query = query; + return this; + } + + /** + * The query used to filter cases in this view. + * + * @return query + */ + @JsonProperty(JSON_PROPERTY_QUERY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getQuery() { + return query; + } + + public void setQuery(String query) { + this.query = query; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return CaseViewCreateAttributes + */ + @JsonAnySetter + public CaseViewCreateAttributes putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this CaseViewCreateAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CaseViewCreateAttributes caseViewCreateAttributes = (CaseViewCreateAttributes) o; + return Objects.equals(this.name, caseViewCreateAttributes.name) + && Objects.equals(this.npRuleId, caseViewCreateAttributes.npRuleId) + && Objects.equals(this.projectId, caseViewCreateAttributes.projectId) + && Objects.equals(this.query, caseViewCreateAttributes.query) + && Objects.equals(this.additionalProperties, caseViewCreateAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(name, npRuleId, projectId, query, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CaseViewCreateAttributes {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" npRuleId: ").append(toIndentedString(npRuleId)).append("\n"); + sb.append(" projectId: ").append(toIndentedString(projectId)).append("\n"); + sb.append(" query: ").append(toIndentedString(query)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CaseViewCreateRequest.java b/src/main/java/com/datadog/api/client/v2/model/CaseViewCreateRequest.java new file mode 100644 index 00000000000..e94ee713861 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CaseViewCreateRequest.java @@ -0,0 +1,145 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Request payload for creating a case view. */ +@JsonPropertyOrder({CaseViewCreateRequest.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CaseViewCreateRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private CaseViewCreate data; + + public CaseViewCreateRequest() {} + + @JsonCreator + public CaseViewCreateRequest( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) CaseViewCreate data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public CaseViewCreateRequest data(CaseViewCreate data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Data object for creating a case view. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public CaseViewCreate getData() { + return data; + } + + public void setData(CaseViewCreate data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return CaseViewCreateRequest + */ + @JsonAnySetter + public CaseViewCreateRequest putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this CaseViewCreateRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CaseViewCreateRequest caseViewCreateRequest = (CaseViewCreateRequest) o; + return Objects.equals(this.data, caseViewCreateRequest.data) + && Objects.equals(this.additionalProperties, caseViewCreateRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CaseViewCreateRequest {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CaseViewRelationships.java b/src/main/java/com/datadog/api/client/v2/model/CaseViewRelationships.java new file mode 100644 index 00000000000..79066a327e4 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CaseViewRelationships.java @@ -0,0 +1,218 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.openapitools.jackson.nullable.JsonNullable; + +/** + * Related resources for the case view, including the creator, last modifier, and associated + * project. + */ +@JsonPropertyOrder({ + CaseViewRelationships.JSON_PROPERTY_CREATED_BY, + CaseViewRelationships.JSON_PROPERTY_MODIFIED_BY, + CaseViewRelationships.JSON_PROPERTY_PROJECT +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CaseViewRelationships { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_CREATED_BY = "created_by"; + private JsonNullable createdBy = + JsonNullable.undefined(); + + public static final String JSON_PROPERTY_MODIFIED_BY = "modified_by"; + private JsonNullable modifiedBy = + JsonNullable.undefined(); + + public static final String JSON_PROPERTY_PROJECT = "project"; + private ProjectRelationship project; + + public CaseViewRelationships createdBy(NullableUserRelationship createdBy) { + this.createdBy = JsonNullable.of(createdBy); + return this; + } + + /** + * Relationship to user. + * + * @return createdBy + */ + @jakarta.annotation.Nullable + @JsonIgnore + public NullableUserRelationship getCreatedBy() { + return createdBy.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_CREATED_BY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getCreatedBy_JsonNullable() { + return createdBy; + } + + @JsonProperty(JSON_PROPERTY_CREATED_BY) + public void setCreatedBy_JsonNullable(JsonNullable createdBy) { + this.createdBy = createdBy; + } + + public void setCreatedBy(NullableUserRelationship createdBy) { + this.createdBy = JsonNullable.of(createdBy); + } + + public CaseViewRelationships modifiedBy(NullableUserRelationship modifiedBy) { + this.modifiedBy = JsonNullable.of(modifiedBy); + return this; + } + + /** + * Relationship to user. + * + * @return modifiedBy + */ + @jakarta.annotation.Nullable + @JsonIgnore + public NullableUserRelationship getModifiedBy() { + return modifiedBy.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_MODIFIED_BY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getModifiedBy_JsonNullable() { + return modifiedBy; + } + + @JsonProperty(JSON_PROPERTY_MODIFIED_BY) + public void setModifiedBy_JsonNullable(JsonNullable modifiedBy) { + this.modifiedBy = modifiedBy; + } + + public void setModifiedBy(NullableUserRelationship modifiedBy) { + this.modifiedBy = JsonNullable.of(modifiedBy); + } + + public CaseViewRelationships project(ProjectRelationship project) { + this.project = project; + this.unparsed |= project.unparsed; + return this; + } + + /** + * Relationship to project. + * + * @return project + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PROJECT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ProjectRelationship getProject() { + return project; + } + + public void setProject(ProjectRelationship project) { + this.project = project; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return CaseViewRelationships + */ + @JsonAnySetter + public CaseViewRelationships putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this CaseViewRelationships object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CaseViewRelationships caseViewRelationships = (CaseViewRelationships) o; + return Objects.equals(this.createdBy, caseViewRelationships.createdBy) + && Objects.equals(this.modifiedBy, caseViewRelationships.modifiedBy) + && Objects.equals(this.project, caseViewRelationships.project) + && Objects.equals(this.additionalProperties, caseViewRelationships.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(createdBy, modifiedBy, project, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CaseViewRelationships {\n"); + sb.append(" createdBy: ").append(toIndentedString(createdBy)).append("\n"); + sb.append(" modifiedBy: ").append(toIndentedString(modifiedBy)).append("\n"); + sb.append(" project: ").append(toIndentedString(project)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CaseViewResourceType.java b/src/main/java/com/datadog/api/client/v2/model/CaseViewResourceType.java new file mode 100644 index 00000000000..bb5a50bbd20 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CaseViewResourceType.java @@ -0,0 +1,54 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** JSON:API resource type for case views. */ +@JsonSerialize(using = CaseViewResourceType.CaseViewResourceTypeSerializer.class) +public class CaseViewResourceType extends ModelEnum { + + private static final Set allowedValues = new HashSet(Arrays.asList("view")); + + public static final CaseViewResourceType VIEW = new CaseViewResourceType("view"); + + CaseViewResourceType(String value) { + super(value, allowedValues); + } + + public static class CaseViewResourceTypeSerializer extends StdSerializer { + public CaseViewResourceTypeSerializer(Class t) { + super(t); + } + + public CaseViewResourceTypeSerializer() { + this(null); + } + + @Override + public void serialize( + CaseViewResourceType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static CaseViewResourceType fromValue(String value) { + return new CaseViewResourceType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CaseViewResponse.java b/src/main/java/com/datadog/api/client/v2/model/CaseViewResponse.java new file mode 100644 index 00000000000..c0d64195d8b --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CaseViewResponse.java @@ -0,0 +1,146 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Response containing a single case view. */ +@JsonPropertyOrder({CaseViewResponse.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CaseViewResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private CaseView data; + + public CaseViewResponse() {} + + @JsonCreator + public CaseViewResponse( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) CaseView data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public CaseViewResponse data(CaseView data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * A saved case view that provides a filtered, reusable list of cases matching a specific query. + * Views act as persistent dashboards for monitoring case subsets. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public CaseView getData() { + return data; + } + + public void setData(CaseView data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return CaseViewResponse + */ + @JsonAnySetter + public CaseViewResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this CaseViewResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CaseViewResponse caseViewResponse = (CaseViewResponse) o; + return Objects.equals(this.data, caseViewResponse.data) + && Objects.equals(this.additionalProperties, caseViewResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CaseViewResponse {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CaseViewUpdate.java b/src/main/java/com/datadog/api/client/v2/model/CaseViewUpdate.java new file mode 100644 index 00000000000..b99a0954677 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CaseViewUpdate.java @@ -0,0 +1,176 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Data object for updating a case view. */ +@JsonPropertyOrder({CaseViewUpdate.JSON_PROPERTY_ATTRIBUTES, CaseViewUpdate.JSON_PROPERTY_TYPE}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CaseViewUpdate { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private CaseViewUpdateAttributes attributes; + + public static final String JSON_PROPERTY_TYPE = "type"; + private CaseViewResourceType type = CaseViewResourceType.VIEW; + + public CaseViewUpdate() {} + + @JsonCreator + public CaseViewUpdate( + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) CaseViewResourceType type) { + this.type = type; + this.unparsed |= !type.isValid(); + } + + public CaseViewUpdate attributes(CaseViewUpdateAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes that can be updated on a case view. All fields are optional; only provided fields + * are changed. + * + * @return attributes + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public CaseViewUpdateAttributes getAttributes() { + return attributes; + } + + public void setAttributes(CaseViewUpdateAttributes attributes) { + this.attributes = attributes; + } + + public CaseViewUpdate type(CaseViewResourceType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * JSON:API resource type for case views. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public CaseViewResourceType getType() { + return type; + } + + public void setType(CaseViewResourceType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return CaseViewUpdate + */ + @JsonAnySetter + public CaseViewUpdate putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this CaseViewUpdate object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CaseViewUpdate caseViewUpdate = (CaseViewUpdate) o; + return Objects.equals(this.attributes, caseViewUpdate.attributes) + && Objects.equals(this.type, caseViewUpdate.type) + && Objects.equals(this.additionalProperties, caseViewUpdate.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CaseViewUpdate {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CaseViewUpdateAttributes.java b/src/main/java/com/datadog/api/client/v2/model/CaseViewUpdateAttributes.java new file mode 100644 index 00000000000..632a118767e --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CaseViewUpdateAttributes.java @@ -0,0 +1,195 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** + * Attributes that can be updated on a case view. All fields are optional; only provided fields are + * changed. + */ +@JsonPropertyOrder({ + CaseViewUpdateAttributes.JSON_PROPERTY_NAME, + CaseViewUpdateAttributes.JSON_PROPERTY_NP_RULE_ID, + CaseViewUpdateAttributes.JSON_PROPERTY_QUERY +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CaseViewUpdateAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_NP_RULE_ID = "np_rule_id"; + private String npRuleId; + + public static final String JSON_PROPERTY_QUERY = "query"; + private String query; + + public CaseViewUpdateAttributes name(String name) { + this.name = name; + return this; + } + + /** + * The name of the view. + * + * @return name + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public CaseViewUpdateAttributes npRuleId(String npRuleId) { + this.npRuleId = npRuleId; + return this; + } + + /** + * The identifier of a notification rule linked to this view. When set, users subscribed to the + * view receive alerts for matching cases. + * + * @return npRuleId + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NP_RULE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getNpRuleId() { + return npRuleId; + } + + public void setNpRuleId(String npRuleId) { + this.npRuleId = npRuleId; + } + + public CaseViewUpdateAttributes query(String query) { + this.query = query; + return this; + } + + /** + * The query used to filter cases in this view. + * + * @return query + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_QUERY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getQuery() { + return query; + } + + public void setQuery(String query) { + this.query = query; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return CaseViewUpdateAttributes + */ + @JsonAnySetter + public CaseViewUpdateAttributes putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this CaseViewUpdateAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CaseViewUpdateAttributes caseViewUpdateAttributes = (CaseViewUpdateAttributes) o; + return Objects.equals(this.name, caseViewUpdateAttributes.name) + && Objects.equals(this.npRuleId, caseViewUpdateAttributes.npRuleId) + && Objects.equals(this.query, caseViewUpdateAttributes.query) + && Objects.equals(this.additionalProperties, caseViewUpdateAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(name, npRuleId, query, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CaseViewUpdateAttributes {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" npRuleId: ").append(toIndentedString(npRuleId)).append("\n"); + sb.append(" query: ").append(toIndentedString(query)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CaseViewUpdateRequest.java b/src/main/java/com/datadog/api/client/v2/model/CaseViewUpdateRequest.java new file mode 100644 index 00000000000..ac4bf428484 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CaseViewUpdateRequest.java @@ -0,0 +1,145 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Request payload for updating a case view. */ +@JsonPropertyOrder({CaseViewUpdateRequest.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CaseViewUpdateRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private CaseViewUpdate data; + + public CaseViewUpdateRequest() {} + + @JsonCreator + public CaseViewUpdateRequest( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) CaseViewUpdate data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public CaseViewUpdateRequest data(CaseViewUpdate data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Data object for updating a case view. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public CaseViewUpdate getData() { + return data; + } + + public void setData(CaseViewUpdate data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return CaseViewUpdateRequest + */ + @JsonAnySetter + public CaseViewUpdateRequest putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this CaseViewUpdateRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CaseViewUpdateRequest caseViewUpdateRequest = (CaseViewUpdateRequest) o; + return Objects.equals(this.data, caseViewUpdateRequest.data) + && Objects.equals(this.additionalProperties, caseViewUpdateRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CaseViewUpdateRequest {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CaseViewsResponse.java b/src/main/java/com/datadog/api/client/v2/model/CaseViewsResponse.java new file mode 100644 index 00000000000..7bfec29da35 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CaseViewsResponse.java @@ -0,0 +1,154 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** Response containing a list of case views. */ +@JsonPropertyOrder({CaseViewsResponse.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CaseViewsResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private List data = new ArrayList<>(); + + public CaseViewsResponse() {} + + @JsonCreator + public CaseViewsResponse( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) List data) { + this.data = data; + } + + public CaseViewsResponse data(List data) { + this.data = data; + for (CaseView item : data) { + this.unparsed |= item.unparsed; + } + return this; + } + + public CaseViewsResponse addDataItem(CaseView dataItem) { + this.data.add(dataItem); + this.unparsed |= dataItem.unparsed; + return this; + } + + /** + * A list of case views. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return CaseViewsResponse + */ + @JsonAnySetter + public CaseViewsResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this CaseViewsResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CaseViewsResponse caseViewsResponse = (CaseViewsResponse) o; + return Objects.equals(this.data, caseViewsResponse.data) + && Objects.equals(this.additionalProperties, caseViewsResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CaseViewsResponse {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CaseWatcher.java b/src/main/java/com/datadog/api/client/v2/model/CaseWatcher.java new file mode 100644 index 00000000000..3f0d17075e7 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CaseWatcher.java @@ -0,0 +1,212 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** + * Represents a user who is subscribed to notifications for a case. Watchers receive updates when + * the case's status, priority, assignee, or comments change. + */ +@JsonPropertyOrder({ + CaseWatcher.JSON_PROPERTY_ID, + CaseWatcher.JSON_PROPERTY_RELATIONSHIPS, + CaseWatcher.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CaseWatcher { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_RELATIONSHIPS = "relationships"; + private CaseWatcherRelationships relationships; + + public static final String JSON_PROPERTY_TYPE = "type"; + private CaseWatcherResourceType type = CaseWatcherResourceType.WATCHER; + + public CaseWatcher() {} + + @JsonCreator + public CaseWatcher( + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_RELATIONSHIPS) + CaseWatcherRelationships relationships, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) CaseWatcherResourceType type) { + this.id = id; + this.relationships = relationships; + this.unparsed |= relationships.unparsed; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public CaseWatcher id(String id) { + this.id = id; + return this; + } + + /** + * The primary identifier of the case watcher. + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public CaseWatcher relationships(CaseWatcherRelationships relationships) { + this.relationships = relationships; + this.unparsed |= relationships.unparsed; + return this; + } + + /** + * Relationships for a case watcher, linking to the underlying user resource. + * + * @return relationships + */ + @JsonProperty(JSON_PROPERTY_RELATIONSHIPS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public CaseWatcherRelationships getRelationships() { + return relationships; + } + + public void setRelationships(CaseWatcherRelationships relationships) { + this.relationships = relationships; + } + + public CaseWatcher type(CaseWatcherResourceType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * JSON:API resource type for case watchers. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public CaseWatcherResourceType getType() { + return type; + } + + public void setType(CaseWatcherResourceType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return CaseWatcher + */ + @JsonAnySetter + public CaseWatcher putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this CaseWatcher object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CaseWatcher caseWatcher = (CaseWatcher) o; + return Objects.equals(this.id, caseWatcher.id) + && Objects.equals(this.relationships, caseWatcher.relationships) + && Objects.equals(this.type, caseWatcher.type) + && Objects.equals(this.additionalProperties, caseWatcher.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, relationships, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CaseWatcher {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" relationships: ").append(toIndentedString(relationships)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CaseWatcherRelationships.java b/src/main/java/com/datadog/api/client/v2/model/CaseWatcherRelationships.java new file mode 100644 index 00000000000..b557afec9e7 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CaseWatcherRelationships.java @@ -0,0 +1,145 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Relationships for a case watcher, linking to the underlying user resource. */ +@JsonPropertyOrder({CaseWatcherRelationships.JSON_PROPERTY_USER}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CaseWatcherRelationships { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_USER = "user"; + private CaseWatcherUserRelationship user; + + public CaseWatcherRelationships() {} + + @JsonCreator + public CaseWatcherRelationships( + @JsonProperty(required = true, value = JSON_PROPERTY_USER) CaseWatcherUserRelationship user) { + this.user = user; + this.unparsed |= user.unparsed; + } + + public CaseWatcherRelationships user(CaseWatcherUserRelationship user) { + this.user = user; + this.unparsed |= user.unparsed; + return this; + } + + /** + * The user relationship for a case watcher. + * + * @return user + */ + @JsonProperty(JSON_PROPERTY_USER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public CaseWatcherUserRelationship getUser() { + return user; + } + + public void setUser(CaseWatcherUserRelationship user) { + this.user = user; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return CaseWatcherRelationships + */ + @JsonAnySetter + public CaseWatcherRelationships putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this CaseWatcherRelationships object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CaseWatcherRelationships caseWatcherRelationships = (CaseWatcherRelationships) o; + return Objects.equals(this.user, caseWatcherRelationships.user) + && Objects.equals(this.additionalProperties, caseWatcherRelationships.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(user, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CaseWatcherRelationships {\n"); + sb.append(" user: ").append(toIndentedString(user)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CaseWatcherResourceType.java b/src/main/java/com/datadog/api/client/v2/model/CaseWatcherResourceType.java new file mode 100644 index 00000000000..ebf86c4cb31 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CaseWatcherResourceType.java @@ -0,0 +1,55 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** JSON:API resource type for case watchers. */ +@JsonSerialize(using = CaseWatcherResourceType.CaseWatcherResourceTypeSerializer.class) +public class CaseWatcherResourceType extends ModelEnum { + + private static final Set allowedValues = new HashSet(Arrays.asList("watcher")); + + public static final CaseWatcherResourceType WATCHER = new CaseWatcherResourceType("watcher"); + + CaseWatcherResourceType(String value) { + super(value, allowedValues); + } + + public static class CaseWatcherResourceTypeSerializer + extends StdSerializer { + public CaseWatcherResourceTypeSerializer(Class t) { + super(t); + } + + public CaseWatcherResourceTypeSerializer() { + this(null); + } + + @Override + public void serialize( + CaseWatcherResourceType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static CaseWatcherResourceType fromValue(String value) { + return new CaseWatcherResourceType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CaseWatcherUserRelationship.java b/src/main/java/com/datadog/api/client/v2/model/CaseWatcherUserRelationship.java new file mode 100644 index 00000000000..e0206ed2dc6 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CaseWatcherUserRelationship.java @@ -0,0 +1,146 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** The user relationship for a case watcher. */ +@JsonPropertyOrder({CaseWatcherUserRelationship.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CaseWatcherUserRelationship { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private UserRelationshipData data; + + public CaseWatcherUserRelationship() {} + + @JsonCreator + public CaseWatcherUserRelationship( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) UserRelationshipData data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public CaseWatcherUserRelationship data(UserRelationshipData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Relationship to user object. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public UserRelationshipData getData() { + return data; + } + + public void setData(UserRelationshipData data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return CaseWatcherUserRelationship + */ + @JsonAnySetter + public CaseWatcherUserRelationship putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this CaseWatcherUserRelationship object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CaseWatcherUserRelationship caseWatcherUserRelationship = (CaseWatcherUserRelationship) o; + return Objects.equals(this.data, caseWatcherUserRelationship.data) + && Objects.equals( + this.additionalProperties, caseWatcherUserRelationship.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CaseWatcherUserRelationship {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CaseWatchersResponse.java b/src/main/java/com/datadog/api/client/v2/model/CaseWatchersResponse.java new file mode 100644 index 00000000000..32088d9cf00 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CaseWatchersResponse.java @@ -0,0 +1,154 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** Response containing the list of users watching a case. */ +@JsonPropertyOrder({CaseWatchersResponse.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CaseWatchersResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private List data = new ArrayList<>(); + + public CaseWatchersResponse() {} + + @JsonCreator + public CaseWatchersResponse( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) List data) { + this.data = data; + } + + public CaseWatchersResponse data(List data) { + this.data = data; + for (CaseWatcher item : data) { + this.unparsed |= item.unparsed; + } + return this; + } + + public CaseWatchersResponse addDataItem(CaseWatcher dataItem) { + this.data.add(dataItem); + this.unparsed |= dataItem.unparsed; + return this; + } + + /** + * List of case watchers. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return CaseWatchersResponse + */ + @JsonAnySetter + public CaseWatchersResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this CaseWatchersResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CaseWatchersResponse caseWatchersResponse = (CaseWatchersResponse) o; + return Objects.equals(this.data, caseWatchersResponse.data) + && Objects.equals(this.additionalProperties, caseWatchersResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CaseWatchersResponse {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CostTagDescriptionResponse.java b/src/main/java/com/datadog/api/client/v2/model/CostTagDescriptionResponse.java new file mode 100644 index 00000000000..6f78139a21f --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CostTagDescriptionResponse.java @@ -0,0 +1,147 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Single Cloud Cost Management tag key description returned by the get-by-key endpoint. */ +@JsonPropertyOrder({CostTagDescriptionResponse.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CostTagDescriptionResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private CostTagDescription data; + + public CostTagDescriptionResponse() {} + + @JsonCreator + public CostTagDescriptionResponse( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) CostTagDescription data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public CostTagDescriptionResponse data(CostTagDescription data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * A Cloud Cost Management tag key description, either cross-cloud or scoped to a single cloud + * provider. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public CostTagDescription getData() { + return data; + } + + public void setData(CostTagDescription data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return CostTagDescriptionResponse + */ + @JsonAnySetter + public CostTagDescriptionResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this CostTagDescriptionResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CostTagDescriptionResponse costTagDescriptionResponse = (CostTagDescriptionResponse) o; + return Objects.equals(this.data, costTagDescriptionResponse.data) + && Objects.equals( + this.additionalProperties, costTagDescriptionResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CostTagDescriptionResponse {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CostTagDescriptionUpsertRequest.java b/src/main/java/com/datadog/api/client/v2/model/CostTagDescriptionUpsertRequest.java new file mode 100644 index 00000000000..a2df7f8bf0d --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CostTagDescriptionUpsertRequest.java @@ -0,0 +1,149 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Request body for creating or updating a Cloud Cost Management tag key description. */ +@JsonPropertyOrder({CostTagDescriptionUpsertRequest.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CostTagDescriptionUpsertRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private CostTagDescriptionUpsertRequestData data; + + public CostTagDescriptionUpsertRequest() {} + + @JsonCreator + public CostTagDescriptionUpsertRequest( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) + CostTagDescriptionUpsertRequestData data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public CostTagDescriptionUpsertRequest data(CostTagDescriptionUpsertRequestData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Resource envelope carrying the tag key description being upserted. The id is + * informational; the authoritative tag key is taken from the URL path. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public CostTagDescriptionUpsertRequestData getData() { + return data; + } + + public void setData(CostTagDescriptionUpsertRequestData data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return CostTagDescriptionUpsertRequest + */ + @JsonAnySetter + public CostTagDescriptionUpsertRequest putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this CostTagDescriptionUpsertRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CostTagDescriptionUpsertRequest costTagDescriptionUpsertRequest = + (CostTagDescriptionUpsertRequest) o; + return Objects.equals(this.data, costTagDescriptionUpsertRequest.data) + && Objects.equals( + this.additionalProperties, costTagDescriptionUpsertRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CostTagDescriptionUpsertRequest {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CostTagDescriptionUpsertRequestData.java b/src/main/java/com/datadog/api/client/v2/model/CostTagDescriptionUpsertRequestData.java new file mode 100644 index 00000000000..81458337f8c --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CostTagDescriptionUpsertRequestData.java @@ -0,0 +1,215 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** + * Resource envelope carrying the tag key description being upserted. The id is + * informational; the authoritative tag key is taken from the URL path. + */ +@JsonPropertyOrder({ + CostTagDescriptionUpsertRequestData.JSON_PROPERTY_ATTRIBUTES, + CostTagDescriptionUpsertRequestData.JSON_PROPERTY_ID, + CostTagDescriptionUpsertRequestData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CostTagDescriptionUpsertRequestData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private CostTagDescriptionUpsertRequestDataAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private CostTagDescriptionType type = CostTagDescriptionType.COST_TAG_DESCRIPTION; + + public CostTagDescriptionUpsertRequestData() {} + + @JsonCreator + public CostTagDescriptionUpsertRequestData( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + CostTagDescriptionUpsertRequestDataAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) CostTagDescriptionType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public CostTagDescriptionUpsertRequestData attributes( + CostTagDescriptionUpsertRequestDataAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Mutable attributes set when creating or updating a Cloud Cost Management tag key description. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public CostTagDescriptionUpsertRequestDataAttributes getAttributes() { + return attributes; + } + + public void setAttributes(CostTagDescriptionUpsertRequestDataAttributes attributes) { + this.attributes = attributes; + } + + public CostTagDescriptionUpsertRequestData id(String id) { + this.id = id; + return this; + } + + /** + * Identifier of the tag key the description applies to. Matches the tag_key path + * parameter. + * + * @return id + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public CostTagDescriptionUpsertRequestData type(CostTagDescriptionType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Type of the Cloud Cost Management tag description resource. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public CostTagDescriptionType getType() { + return type; + } + + public void setType(CostTagDescriptionType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return CostTagDescriptionUpsertRequestData + */ + @JsonAnySetter + public CostTagDescriptionUpsertRequestData putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this CostTagDescriptionUpsertRequestData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CostTagDescriptionUpsertRequestData costTagDescriptionUpsertRequestData = + (CostTagDescriptionUpsertRequestData) o; + return Objects.equals(this.attributes, costTagDescriptionUpsertRequestData.attributes) + && Objects.equals(this.id, costTagDescriptionUpsertRequestData.id) + && Objects.equals(this.type, costTagDescriptionUpsertRequestData.type) + && Objects.equals( + this.additionalProperties, costTagDescriptionUpsertRequestData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CostTagDescriptionUpsertRequestData {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CostTagDescriptionUpsertRequestDataAttributes.java b/src/main/java/com/datadog/api/client/v2/model/CostTagDescriptionUpsertRequestDataAttributes.java new file mode 100644 index 00000000000..1756adbf6aa --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CostTagDescriptionUpsertRequestDataAttributes.java @@ -0,0 +1,178 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Mutable attributes set when creating or updating a Cloud Cost Management tag key description. */ +@JsonPropertyOrder({ + CostTagDescriptionUpsertRequestDataAttributes.JSON_PROPERTY_CLOUD, + CostTagDescriptionUpsertRequestDataAttributes.JSON_PROPERTY_DESCRIPTION +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CostTagDescriptionUpsertRequestDataAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_CLOUD = "cloud"; + private String cloud; + + public static final String JSON_PROPERTY_DESCRIPTION = "description"; + private String description; + + public CostTagDescriptionUpsertRequestDataAttributes() {} + + @JsonCreator + public CostTagDescriptionUpsertRequestDataAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_DESCRIPTION) String description) { + this.description = description; + } + + public CostTagDescriptionUpsertRequestDataAttributes cloud(String cloud) { + this.cloud = cloud; + return this; + } + + /** + * Cloud provider this description applies to (for example, aws). Omit to set the + * cross-cloud default for the tag key. + * + * @return cloud + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CLOUD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCloud() { + return cloud; + } + + public void setCloud(String cloud) { + this.cloud = cloud; + } + + public CostTagDescriptionUpsertRequestDataAttributes description(String description) { + this.description = description; + return this; + } + + /** + * The human-readable description for the tag key. + * + * @return description + */ + @JsonProperty(JSON_PROPERTY_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return CostTagDescriptionUpsertRequestDataAttributes + */ + @JsonAnySetter + public CostTagDescriptionUpsertRequestDataAttributes putAdditionalProperty( + String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this CostTagDescriptionUpsertRequestDataAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CostTagDescriptionUpsertRequestDataAttributes costTagDescriptionUpsertRequestDataAttributes = + (CostTagDescriptionUpsertRequestDataAttributes) o; + return Objects.equals(this.cloud, costTagDescriptionUpsertRequestDataAttributes.cloud) + && Objects.equals( + this.description, costTagDescriptionUpsertRequestDataAttributes.description) + && Objects.equals( + this.additionalProperties, + costTagDescriptionUpsertRequestDataAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(cloud, description, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CostTagDescriptionUpsertRequestDataAttributes {\n"); + sb.append(" cloud: ").append(toIndentedString(cloud)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CustomAttributeConfig.java b/src/main/java/com/datadog/api/client/v2/model/CustomAttributeConfig.java index 8bfd5692e19..3374623af33 100644 --- a/src/main/java/com/datadog/api/client/v2/model/CustomAttributeConfig.java +++ b/src/main/java/com/datadog/api/client/v2/model/CustomAttributeConfig.java @@ -16,7 +16,11 @@ import java.util.Map; import java.util.Objects; -/** The definition of CustomAttributeConfig object. */ +/** + * A custom attribute configuration that defines an organization-specific metadata field on cases. + * Custom attributes are scoped to a case type and can hold text, URLs, numbers, or predefined + * select options. + */ @JsonPropertyOrder({ CustomAttributeConfig.JSON_PROPERTY_ATTRIBUTES, CustomAttributeConfig.JSON_PROPERTY_ID, @@ -43,7 +47,8 @@ public CustomAttributeConfig attributes(CustomAttributeConfigResourceAttributes } /** - * Custom attribute resource attributes + * Attributes of a custom attribute configuration, defining an organization-specific metadata + * field that can be added to cases of a given type. * * @return attributes */ @@ -86,7 +91,7 @@ public CustomAttributeConfig type(CustomAttributeConfigResourceType type) { } /** - * Custom attributes config JSON:API resource type + * JSON:API resource type for custom attribute configurations. * * @return type */ diff --git a/src/main/java/com/datadog/api/client/v2/model/CustomAttributeConfigAttributesCreate.java b/src/main/java/com/datadog/api/client/v2/model/CustomAttributeConfigAttributesCreate.java index ef58f0c6427..daa245d6e85 100644 --- a/src/main/java/com/datadog/api/client/v2/model/CustomAttributeConfigAttributesCreate.java +++ b/src/main/java/com/datadog/api/client/v2/model/CustomAttributeConfigAttributesCreate.java @@ -17,7 +17,7 @@ import java.util.Map; import java.util.Objects; -/** Custom attribute config resource attributes */ +/** Attributes required to create a custom attribute configuration. */ @JsonPropertyOrder({ CustomAttributeConfigAttributesCreate.JSON_PROPERTY_DESCRIPTION, CustomAttributeConfigAttributesCreate.JSON_PROPERTY_DISPLAY_NAME, @@ -65,7 +65,7 @@ public CustomAttributeConfigAttributesCreate description(String description) { } /** - * Custom attribute description. + * A description explaining the purpose and expected values for this custom attribute. * * @return description */ @@ -86,7 +86,7 @@ public CustomAttributeConfigAttributesCreate displayName(String displayName) { } /** - * Custom attribute name. + * The human-readable label shown in the Case Management UI for this custom attribute. * * @return displayName */ @@ -106,7 +106,8 @@ public CustomAttributeConfigAttributesCreate isMulti(Boolean isMulti) { } /** - * Whether multiple values can be set + * If true, this attribute accepts an array of values. If false, only a + * single value is allowed. * * @return isMulti */ @@ -126,7 +127,7 @@ public CustomAttributeConfigAttributesCreate key(String key) { } /** - * Custom attribute key. This will be the value use to search on this custom attribute + * The programmatic key used to reference this custom attribute in search queries and API calls. * * @return key */ @@ -147,7 +148,8 @@ public CustomAttributeConfigAttributesCreate type(CustomAttributeType type) { } /** - * Custom attributes type + * The data type of the custom attribute, which determines the allowed values and UI input + * control. * * @return type */ diff --git a/src/main/java/com/datadog/api/client/v2/model/CustomAttributeConfigCreate.java b/src/main/java/com/datadog/api/client/v2/model/CustomAttributeConfigCreate.java index 6c3f83bac1d..47b8ddd002d 100644 --- a/src/main/java/com/datadog/api/client/v2/model/CustomAttributeConfigCreate.java +++ b/src/main/java/com/datadog/api/client/v2/model/CustomAttributeConfigCreate.java @@ -17,7 +17,7 @@ import java.util.Map; import java.util.Objects; -/** Custom attribute config */ +/** Data object for creating a custom attribute configuration. */ @JsonPropertyOrder({ CustomAttributeConfigCreate.JSON_PROPERTY_ATTRIBUTES, CustomAttributeConfigCreate.JSON_PROPERTY_TYPE @@ -54,7 +54,7 @@ public CustomAttributeConfigCreate attributes(CustomAttributeConfigAttributesCre } /** - * Custom attribute config resource attributes + * Attributes required to create a custom attribute configuration. * * @return attributes */ @@ -75,7 +75,7 @@ public CustomAttributeConfigCreate type(CustomAttributeConfigResourceType type) } /** - * Custom attributes config JSON:API resource type + * JSON:API resource type for custom attribute configurations. * * @return type */ diff --git a/src/main/java/com/datadog/api/client/v2/model/CustomAttributeConfigCreateRequest.java b/src/main/java/com/datadog/api/client/v2/model/CustomAttributeConfigCreateRequest.java index 8d72693da17..264e94d7e56 100644 --- a/src/main/java/com/datadog/api/client/v2/model/CustomAttributeConfigCreateRequest.java +++ b/src/main/java/com/datadog/api/client/v2/model/CustomAttributeConfigCreateRequest.java @@ -17,7 +17,7 @@ import java.util.Map; import java.util.Objects; -/** Custom attribute config create request */ +/** Request payload for creating a custom attribute configuration. */ @JsonPropertyOrder({CustomAttributeConfigCreateRequest.JSON_PROPERTY_DATA}) @jakarta.annotation.Generated( value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") @@ -42,7 +42,7 @@ public CustomAttributeConfigCreateRequest data(CustomAttributeConfigCreate data) } /** - * Custom attribute config + * Data object for creating a custom attribute configuration. * * @return data */ diff --git a/src/main/java/com/datadog/api/client/v2/model/CustomAttributeConfigResourceAttributes.java b/src/main/java/com/datadog/api/client/v2/model/CustomAttributeConfigResourceAttributes.java index bed132e68bb..0a0f8341715 100644 --- a/src/main/java/com/datadog/api/client/v2/model/CustomAttributeConfigResourceAttributes.java +++ b/src/main/java/com/datadog/api/client/v2/model/CustomAttributeConfigResourceAttributes.java @@ -17,7 +17,10 @@ import java.util.Map; import java.util.Objects; -/** Custom attribute resource attributes */ +/** + * Attributes of a custom attribute configuration, defining an organization-specific metadata field + * that can be added to cases of a given type. + */ @JsonPropertyOrder({ CustomAttributeConfigResourceAttributes.JSON_PROPERTY_CASE_TYPE_ID, CustomAttributeConfigResourceAttributes.JSON_PROPERTY_DESCRIPTION, @@ -71,7 +74,7 @@ public CustomAttributeConfigResourceAttributes caseTypeId(String caseTypeId) { } /** - * Custom attribute config identifier. + * The UUID of the case type this custom attribute belongs to. * * @return caseTypeId */ @@ -91,7 +94,7 @@ public CustomAttributeConfigResourceAttributes description(String description) { } /** - * Custom attribute description. + * A description explaining the purpose and expected values for this custom attribute. * * @return description */ @@ -112,7 +115,7 @@ public CustomAttributeConfigResourceAttributes displayName(String displayName) { } /** - * Custom attribute name. + * The human-readable label shown in the Case Management UI for this custom attribute. * * @return displayName */ @@ -132,7 +135,8 @@ public CustomAttributeConfigResourceAttributes isMulti(Boolean isMulti) { } /** - * Whether multiple values can be set + * If true, this attribute accepts an array of values. If false, only a + * single value is allowed. * * @return isMulti */ @@ -152,7 +156,7 @@ public CustomAttributeConfigResourceAttributes key(String key) { } /** - * Custom attribute key. This will be the value use to search on this custom attribute + * The programmatic key used to reference this custom attribute in search queries and API calls. * * @return key */ @@ -173,7 +177,8 @@ public CustomAttributeConfigResourceAttributes type(CustomAttributeType type) { } /** - * Custom attributes type + * The data type of the custom attribute, which determines the allowed values and UI input + * control. * * @return type */ diff --git a/src/main/java/com/datadog/api/client/v2/model/CustomAttributeConfigResourceType.java b/src/main/java/com/datadog/api/client/v2/model/CustomAttributeConfigResourceType.java index 567f0258057..b165822f592 100644 --- a/src/main/java/com/datadog/api/client/v2/model/CustomAttributeConfigResourceType.java +++ b/src/main/java/com/datadog/api/client/v2/model/CustomAttributeConfigResourceType.java @@ -18,7 +18,7 @@ import java.util.HashSet; import java.util.Set; -/** Custom attributes config JSON:API resource type */ +/** JSON:API resource type for custom attribute configurations. */ @JsonSerialize( using = CustomAttributeConfigResourceType.CustomAttributeConfigResourceTypeSerializer.class) public class CustomAttributeConfigResourceType extends ModelEnum { diff --git a/src/main/java/com/datadog/api/client/v2/model/CustomAttributeConfigResponse.java b/src/main/java/com/datadog/api/client/v2/model/CustomAttributeConfigResponse.java index a598f645190..a512d5f44db 100644 --- a/src/main/java/com/datadog/api/client/v2/model/CustomAttributeConfigResponse.java +++ b/src/main/java/com/datadog/api/client/v2/model/CustomAttributeConfigResponse.java @@ -16,7 +16,7 @@ import java.util.Map; import java.util.Objects; -/** Custom attribute config response. */ +/** Response containing a single custom attribute configuration. */ @JsonPropertyOrder({CustomAttributeConfigResponse.JSON_PROPERTY_DATA}) @jakarta.annotation.Generated( value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") @@ -32,7 +32,9 @@ public CustomAttributeConfigResponse data(CustomAttributeConfig data) { } /** - * The definition of CustomAttributeConfig object. + * A custom attribute configuration that defines an organization-specific metadata field on cases. + * Custom attributes are scoped to a case type and can hold text, URLs, numbers, or predefined + * select options. * * @return data */ diff --git a/src/main/java/com/datadog/api/client/v2/model/CustomAttributeConfigUpdate.java b/src/main/java/com/datadog/api/client/v2/model/CustomAttributeConfigUpdate.java new file mode 100644 index 00000000000..5e3ae6a67e9 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CustomAttributeConfigUpdate.java @@ -0,0 +1,182 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Data object for updating a custom attribute configuration. */ +@JsonPropertyOrder({ + CustomAttributeConfigUpdate.JSON_PROPERTY_ATTRIBUTES, + CustomAttributeConfigUpdate.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CustomAttributeConfigUpdate { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private CustomAttributeConfigUpdateAttributes attributes; + + public static final String JSON_PROPERTY_TYPE = "type"; + private CustomAttributeConfigResourceType type = + CustomAttributeConfigResourceType.CUSTOM_ATTRIBUTE; + + public CustomAttributeConfigUpdate() {} + + @JsonCreator + public CustomAttributeConfigUpdate( + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) + CustomAttributeConfigResourceType type) { + this.type = type; + this.unparsed |= !type.isValid(); + } + + public CustomAttributeConfigUpdate attributes(CustomAttributeConfigUpdateAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes that can be updated on a custom attribute configuration. All fields are optional; + * only provided fields are changed. + * + * @return attributes + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public CustomAttributeConfigUpdateAttributes getAttributes() { + return attributes; + } + + public void setAttributes(CustomAttributeConfigUpdateAttributes attributes) { + this.attributes = attributes; + } + + public CustomAttributeConfigUpdate type(CustomAttributeConfigResourceType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * JSON:API resource type for custom attribute configurations. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public CustomAttributeConfigResourceType getType() { + return type; + } + + public void setType(CustomAttributeConfigResourceType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return CustomAttributeConfigUpdate + */ + @JsonAnySetter + public CustomAttributeConfigUpdate putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this CustomAttributeConfigUpdate object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CustomAttributeConfigUpdate customAttributeConfigUpdate = (CustomAttributeConfigUpdate) o; + return Objects.equals(this.attributes, customAttributeConfigUpdate.attributes) + && Objects.equals(this.type, customAttributeConfigUpdate.type) + && Objects.equals( + this.additionalProperties, customAttributeConfigUpdate.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CustomAttributeConfigUpdate {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CustomAttributeConfigUpdateAttributes.java b/src/main/java/com/datadog/api/client/v2/model/CustomAttributeConfigUpdateAttributes.java new file mode 100644 index 00000000000..7e4db5abb1c --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CustomAttributeConfigUpdateAttributes.java @@ -0,0 +1,258 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** + * Attributes that can be updated on a custom attribute configuration. All fields are optional; only + * provided fields are changed. + */ +@JsonPropertyOrder({ + CustomAttributeConfigUpdateAttributes.JSON_PROPERTY_DESCRIPTION, + CustomAttributeConfigUpdateAttributes.JSON_PROPERTY_DISPLAY_NAME, + CustomAttributeConfigUpdateAttributes.JSON_PROPERTY_MAP_FROM, + CustomAttributeConfigUpdateAttributes.JSON_PROPERTY_TYPE, + CustomAttributeConfigUpdateAttributes.JSON_PROPERTY_TYPE_DATA +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CustomAttributeConfigUpdateAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DESCRIPTION = "description"; + private String description; + + public static final String JSON_PROPERTY_DISPLAY_NAME = "display_name"; + private String displayName; + + public static final String JSON_PROPERTY_MAP_FROM = "map_from"; + private String mapFrom; + + public static final String JSON_PROPERTY_TYPE = "type"; + private CustomAttributeType type; + + public static final String JSON_PROPERTY_TYPE_DATA = "type_data"; + private CustomAttributeTypeData typeData; + + public CustomAttributeConfigUpdateAttributes description(String description) { + this.description = description; + return this; + } + + /** + * A description explaining the purpose and expected values for this custom attribute. + * + * @return description + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public CustomAttributeConfigUpdateAttributes displayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * The human-readable label shown in the Case Management UI for this custom attribute. + * + * @return displayName + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DISPLAY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDisplayName() { + return displayName; + } + + public void setDisplayName(String displayName) { + this.displayName = displayName; + } + + public CustomAttributeConfigUpdateAttributes mapFrom(String mapFrom) { + this.mapFrom = mapFrom; + return this; + } + + /** + * An external field identifier to auto-populate this attribute from (used for integrations with + * external systems). + * + * @return mapFrom + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MAP_FROM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMapFrom() { + return mapFrom; + } + + public void setMapFrom(String mapFrom) { + this.mapFrom = mapFrom; + } + + public CustomAttributeConfigUpdateAttributes type(CustomAttributeType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * The data type of the custom attribute, which determines the allowed values and UI input + * control. + * + * @return type + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public CustomAttributeType getType() { + return type; + } + + public void setType(CustomAttributeType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + public CustomAttributeConfigUpdateAttributes typeData(CustomAttributeTypeData typeData) { + this.typeData = typeData; + this.unparsed |= typeData.unparsed; + return this; + } + + /** + * Type-specific configuration for the custom attribute. For SELECT-type attributes, this contains + * the list of allowed options. + * + * @return typeData + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TYPE_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public CustomAttributeTypeData getTypeData() { + return typeData; + } + + public void setTypeData(CustomAttributeTypeData typeData) { + this.typeData = typeData; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return CustomAttributeConfigUpdateAttributes + */ + @JsonAnySetter + public CustomAttributeConfigUpdateAttributes putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this CustomAttributeConfigUpdateAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CustomAttributeConfigUpdateAttributes customAttributeConfigUpdateAttributes = + (CustomAttributeConfigUpdateAttributes) o; + return Objects.equals(this.description, customAttributeConfigUpdateAttributes.description) + && Objects.equals(this.displayName, customAttributeConfigUpdateAttributes.displayName) + && Objects.equals(this.mapFrom, customAttributeConfigUpdateAttributes.mapFrom) + && Objects.equals(this.type, customAttributeConfigUpdateAttributes.type) + && Objects.equals(this.typeData, customAttributeConfigUpdateAttributes.typeData) + && Objects.equals( + this.additionalProperties, customAttributeConfigUpdateAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(description, displayName, mapFrom, type, typeData, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CustomAttributeConfigUpdateAttributes {\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" displayName: ").append(toIndentedString(displayName)).append("\n"); + sb.append(" mapFrom: ").append(toIndentedString(mapFrom)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" typeData: ").append(toIndentedString(typeData)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CustomAttributeConfigUpdateRequest.java b/src/main/java/com/datadog/api/client/v2/model/CustomAttributeConfigUpdateRequest.java new file mode 100644 index 00000000000..29a1d3176ba --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CustomAttributeConfigUpdateRequest.java @@ -0,0 +1,147 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Request payload for updating a custom attribute configuration. */ +@JsonPropertyOrder({CustomAttributeConfigUpdateRequest.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CustomAttributeConfigUpdateRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private CustomAttributeConfigUpdate data; + + public CustomAttributeConfigUpdateRequest() {} + + @JsonCreator + public CustomAttributeConfigUpdateRequest( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) CustomAttributeConfigUpdate data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public CustomAttributeConfigUpdateRequest data(CustomAttributeConfigUpdate data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Data object for updating a custom attribute configuration. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public CustomAttributeConfigUpdate getData() { + return data; + } + + public void setData(CustomAttributeConfigUpdate data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return CustomAttributeConfigUpdateRequest + */ + @JsonAnySetter + public CustomAttributeConfigUpdateRequest putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this CustomAttributeConfigUpdateRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CustomAttributeConfigUpdateRequest customAttributeConfigUpdateRequest = + (CustomAttributeConfigUpdateRequest) o; + return Objects.equals(this.data, customAttributeConfigUpdateRequest.data) + && Objects.equals( + this.additionalProperties, customAttributeConfigUpdateRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CustomAttributeConfigUpdateRequest {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CustomAttributeConfigsResponse.java b/src/main/java/com/datadog/api/client/v2/model/CustomAttributeConfigsResponse.java index 91727757130..5649d99e8a6 100644 --- a/src/main/java/com/datadog/api/client/v2/model/CustomAttributeConfigsResponse.java +++ b/src/main/java/com/datadog/api/client/v2/model/CustomAttributeConfigsResponse.java @@ -18,7 +18,7 @@ import java.util.Map; import java.util.Objects; -/** Custom attribute configs response. */ +/** Response containing a list of custom attribute configurations. */ @JsonPropertyOrder({CustomAttributeConfigsResponse.JSON_PROPERTY_DATA}) @jakarta.annotation.Generated( value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") diff --git a/src/main/java/com/datadog/api/client/v2/model/CustomAttributeSelectOption.java b/src/main/java/com/datadog/api/client/v2/model/CustomAttributeSelectOption.java new file mode 100644 index 00000000000..ae45b63e9e3 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CustomAttributeSelectOption.java @@ -0,0 +1,144 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** A selectable option for a SELECT-type custom attribute. */ +@JsonPropertyOrder({CustomAttributeSelectOption.JSON_PROPERTY_VALUE}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CustomAttributeSelectOption { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_VALUE = "value"; + private String value; + + public CustomAttributeSelectOption() {} + + @JsonCreator + public CustomAttributeSelectOption( + @JsonProperty(required = true, value = JSON_PROPERTY_VALUE) String value) { + this.value = value; + } + + public CustomAttributeSelectOption value(String value) { + this.value = value; + return this; + } + + /** + * Option value. + * + * @return value + */ + @JsonProperty(JSON_PROPERTY_VALUE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return CustomAttributeSelectOption + */ + @JsonAnySetter + public CustomAttributeSelectOption putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this CustomAttributeSelectOption object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CustomAttributeSelectOption customAttributeSelectOption = (CustomAttributeSelectOption) o; + return Objects.equals(this.value, customAttributeSelectOption.value) + && Objects.equals( + this.additionalProperties, customAttributeSelectOption.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(value, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CustomAttributeSelectOption {\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CustomAttributeType.java b/src/main/java/com/datadog/api/client/v2/model/CustomAttributeType.java index 006294fcda4..5ede491b151 100644 --- a/src/main/java/com/datadog/api/client/v2/model/CustomAttributeType.java +++ b/src/main/java/com/datadog/api/client/v2/model/CustomAttributeType.java @@ -18,7 +18,9 @@ import java.util.HashSet; import java.util.Set; -/** Custom attributes type */ +/** + * The data type of the custom attribute, which determines the allowed values and UI input control. + */ @JsonSerialize(using = CustomAttributeType.CustomAttributeTypeSerializer.class) public class CustomAttributeType extends ModelEnum { diff --git a/src/main/java/com/datadog/api/client/v2/model/CustomAttributeTypeData.java b/src/main/java/com/datadog/api/client/v2/model/CustomAttributeTypeData.java new file mode 100644 index 00000000000..cab84c865cc --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CustomAttributeTypeData.java @@ -0,0 +1,152 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** + * Type-specific configuration for the custom attribute. For SELECT-type attributes, this contains + * the list of allowed options. + */ +@JsonPropertyOrder({CustomAttributeTypeData.JSON_PROPERTY_OPTIONS}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CustomAttributeTypeData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_OPTIONS = "options"; + private List options = null; + + public CustomAttributeTypeData options(List options) { + this.options = options; + for (CustomAttributeSelectOption item : options) { + this.unparsed |= item.unparsed; + } + return this; + } + + public CustomAttributeTypeData addOptionsItem(CustomAttributeSelectOption optionsItem) { + if (this.options == null) { + this.options = new ArrayList<>(); + } + this.options.add(optionsItem); + this.unparsed |= optionsItem.unparsed; + return this; + } + + /** + * Options for SELECT type custom attributes. + * + * @return options + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getOptions() { + return options; + } + + public void setOptions(List options) { + this.options = options; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return CustomAttributeTypeData + */ + @JsonAnySetter + public CustomAttributeTypeData putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this CustomAttributeTypeData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CustomAttributeTypeData customAttributeTypeData = (CustomAttributeTypeData) o; + return Objects.equals(this.options, customAttributeTypeData.options) + && Objects.equals(this.additionalProperties, customAttributeTypeData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(options, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CustomAttributeTypeData {\n"); + sb.append(" options: ").append(toIndentedString(options)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CustomAttributeValue.java b/src/main/java/com/datadog/api/client/v2/model/CustomAttributeValue.java index f7f8f1cd9c9..38e2f4f4a6f 100644 --- a/src/main/java/com/datadog/api/client/v2/model/CustomAttributeValue.java +++ b/src/main/java/com/datadog/api/client/v2/model/CustomAttributeValue.java @@ -17,7 +17,7 @@ import java.util.Map; import java.util.Objects; -/** Custom attribute values */ +/** A typed value for a custom attribute on a specific case. */ @JsonPropertyOrder({ CustomAttributeValue.JSON_PROPERTY_IS_MULTI, CustomAttributeValue.JSON_PROPERTY_TYPE, @@ -78,7 +78,8 @@ public CustomAttributeValue type(CustomAttributeType type) { } /** - * Custom attributes type + * The data type of the custom attribute, which determines the allowed values and UI input + * control. * * @return type */ @@ -102,7 +103,8 @@ public CustomAttributeValue value(CustomAttributeValuesUnion value) { } /** - * Union of supported value for a custom attribute + * The value of a custom attribute. The accepted format depends on the attribute's type and + * whether it accepts multiple values. * * @return value */ diff --git a/src/main/java/com/datadog/api/client/v2/model/GenerateCostTagDescriptionResponse.java b/src/main/java/com/datadog/api/client/v2/model/GenerateCostTagDescriptionResponse.java new file mode 100644 index 00000000000..078e5630f36 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/GenerateCostTagDescriptionResponse.java @@ -0,0 +1,148 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Response wrapping an AI-generated Cloud Cost Management tag key description. */ +@JsonPropertyOrder({GenerateCostTagDescriptionResponse.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class GenerateCostTagDescriptionResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private GeneratedCostTagDescription data; + + public GenerateCostTagDescriptionResponse() {} + + @JsonCreator + public GenerateCostTagDescriptionResponse( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) GeneratedCostTagDescription data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public GenerateCostTagDescriptionResponse data(GeneratedCostTagDescription data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * AI-generated Cloud Cost Management tag key description returned by the generate endpoint. The + * result is returned to the client but is not persisted by this endpoint. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public GeneratedCostTagDescription getData() { + return data; + } + + public void setData(GeneratedCostTagDescription data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return GenerateCostTagDescriptionResponse + */ + @JsonAnySetter + public GenerateCostTagDescriptionResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this GenerateCostTagDescriptionResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GenerateCostTagDescriptionResponse generateCostTagDescriptionResponse = + (GenerateCostTagDescriptionResponse) o; + return Objects.equals(this.data, generateCostTagDescriptionResponse.data) + && Objects.equals( + this.additionalProperties, generateCostTagDescriptionResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GenerateCostTagDescriptionResponse {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/GeneratedCostTagDescription.java b/src/main/java/com/datadog/api/client/v2/model/GeneratedCostTagDescription.java new file mode 100644 index 00000000000..9080784cee9 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/GeneratedCostTagDescription.java @@ -0,0 +1,215 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** + * AI-generated Cloud Cost Management tag key description returned by the generate endpoint. The + * result is returned to the client but is not persisted by this endpoint. + */ +@JsonPropertyOrder({ + GeneratedCostTagDescription.JSON_PROPERTY_ATTRIBUTES, + GeneratedCostTagDescription.JSON_PROPERTY_ID, + GeneratedCostTagDescription.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class GeneratedCostTagDescription { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private GeneratedCostTagDescriptionAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private GeneratedCostTagDescriptionType type = + GeneratedCostTagDescriptionType.COST_GENERATED_TAG_DESCRIPTION; + + public GeneratedCostTagDescription() {} + + @JsonCreator + public GeneratedCostTagDescription( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + GeneratedCostTagDescriptionAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) + GeneratedCostTagDescriptionType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public GeneratedCostTagDescription attributes(GeneratedCostTagDescriptionAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes of an AI-generated Cloud Cost Management tag key description. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public GeneratedCostTagDescriptionAttributes getAttributes() { + return attributes; + } + + public void setAttributes(GeneratedCostTagDescriptionAttributes attributes) { + this.attributes = attributes; + } + + public GeneratedCostTagDescription id(String id) { + this.id = id; + return this; + } + + /** + * The tag key the AI description was generated for. + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public GeneratedCostTagDescription type(GeneratedCostTagDescriptionType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Type of the AI-generated Cloud Cost Management tag description resource. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public GeneratedCostTagDescriptionType getType() { + return type; + } + + public void setType(GeneratedCostTagDescriptionType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return GeneratedCostTagDescription + */ + @JsonAnySetter + public GeneratedCostTagDescription putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this GeneratedCostTagDescription object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GeneratedCostTagDescription generatedCostTagDescription = (GeneratedCostTagDescription) o; + return Objects.equals(this.attributes, generatedCostTagDescription.attributes) + && Objects.equals(this.id, generatedCostTagDescription.id) + && Objects.equals(this.type, generatedCostTagDescription.type) + && Objects.equals( + this.additionalProperties, generatedCostTagDescription.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GeneratedCostTagDescription {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/GeneratedCostTagDescriptionAttributes.java b/src/main/java/com/datadog/api/client/v2/model/GeneratedCostTagDescriptionAttributes.java new file mode 100644 index 00000000000..d52bc622c86 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/GeneratedCostTagDescriptionAttributes.java @@ -0,0 +1,145 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Attributes of an AI-generated Cloud Cost Management tag key description. */ +@JsonPropertyOrder({GeneratedCostTagDescriptionAttributes.JSON_PROPERTY_DESCRIPTION}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class GeneratedCostTagDescriptionAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DESCRIPTION = "description"; + private String description; + + public GeneratedCostTagDescriptionAttributes() {} + + @JsonCreator + public GeneratedCostTagDescriptionAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_DESCRIPTION) String description) { + this.description = description; + } + + public GeneratedCostTagDescriptionAttributes description(String description) { + this.description = description; + return this; + } + + /** + * The AI-generated description for the tag key. + * + * @return description + */ + @JsonProperty(JSON_PROPERTY_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return GeneratedCostTagDescriptionAttributes + */ + @JsonAnySetter + public GeneratedCostTagDescriptionAttributes putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this GeneratedCostTagDescriptionAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GeneratedCostTagDescriptionAttributes generatedCostTagDescriptionAttributes = + (GeneratedCostTagDescriptionAttributes) o; + return Objects.equals(this.description, generatedCostTagDescriptionAttributes.description) + && Objects.equals( + this.additionalProperties, generatedCostTagDescriptionAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(description, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GeneratedCostTagDescriptionAttributes {\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/GeneratedCostTagDescriptionType.java b/src/main/java/com/datadog/api/client/v2/model/GeneratedCostTagDescriptionType.java new file mode 100644 index 00000000000..6af35f8a7a7 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/GeneratedCostTagDescriptionType.java @@ -0,0 +1,58 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** Type of the AI-generated Cloud Cost Management tag description resource. */ +@JsonSerialize( + using = GeneratedCostTagDescriptionType.GeneratedCostTagDescriptionTypeSerializer.class) +public class GeneratedCostTagDescriptionType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("cost_generated_tag_description")); + + public static final GeneratedCostTagDescriptionType COST_GENERATED_TAG_DESCRIPTION = + new GeneratedCostTagDescriptionType("cost_generated_tag_description"); + + GeneratedCostTagDescriptionType(String value) { + super(value, allowedValues); + } + + public static class GeneratedCostTagDescriptionTypeSerializer + extends StdSerializer { + public GeneratedCostTagDescriptionTypeSerializer(Class t) { + super(t); + } + + public GeneratedCostTagDescriptionTypeSerializer() { + this(null); + } + + @Override + public void serialize( + GeneratedCostTagDescriptionType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static GeneratedCostTagDescriptionType fromValue(String value) { + return new GeneratedCostTagDescriptionType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/MaintenanceWindow.java b/src/main/java/com/datadog/api/client/v2/model/MaintenanceWindow.java new file mode 100644 index 00000000000..81ea1345c3a --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/MaintenanceWindow.java @@ -0,0 +1,215 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** + * A maintenance window that defines a scheduled time period during which case-related notifications + * and automation rules are suppressed. Each maintenance window applies to cases matching a + * specified query. + */ +@JsonPropertyOrder({ + MaintenanceWindow.JSON_PROPERTY_ATTRIBUTES, + MaintenanceWindow.JSON_PROPERTY_ID, + MaintenanceWindow.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class MaintenanceWindow { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private MaintenanceWindowAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private MaintenanceWindowResourceType type = MaintenanceWindowResourceType.MAINTENANCE_WINDOW; + + public MaintenanceWindow() {} + + @JsonCreator + public MaintenanceWindow( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + MaintenanceWindowAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) + MaintenanceWindowResourceType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public MaintenanceWindow attributes(MaintenanceWindowAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes of a maintenance window, including its schedule and the query that determines which + * cases are affected. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public MaintenanceWindowAttributes getAttributes() { + return attributes; + } + + public void setAttributes(MaintenanceWindowAttributes attributes) { + this.attributes = attributes; + } + + public MaintenanceWindow id(String id) { + this.id = id; + return this; + } + + /** + * The maintenance window's identifier. + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public MaintenanceWindow type(MaintenanceWindowResourceType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * JSON:API resource type for maintenance windows. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public MaintenanceWindowResourceType getType() { + return type; + } + + public void setType(MaintenanceWindowResourceType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return MaintenanceWindow + */ + @JsonAnySetter + public MaintenanceWindow putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this MaintenanceWindow object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MaintenanceWindow maintenanceWindow = (MaintenanceWindow) o; + return Objects.equals(this.attributes, maintenanceWindow.attributes) + && Objects.equals(this.id, maintenanceWindow.id) + && Objects.equals(this.type, maintenanceWindow.type) + && Objects.equals(this.additionalProperties, maintenanceWindow.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MaintenanceWindow {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/MaintenanceWindowAttributes.java b/src/main/java/com/datadog/api/client/v2/model/MaintenanceWindowAttributes.java new file mode 100644 index 00000000000..f9c4384ae85 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/MaintenanceWindowAttributes.java @@ -0,0 +1,274 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** + * Attributes of a maintenance window, including its schedule and the query that determines which + * cases are affected. + */ +@JsonPropertyOrder({ + MaintenanceWindowAttributes.JSON_PROPERTY_CREATED_BY, + MaintenanceWindowAttributes.JSON_PROPERTY_END_AT, + MaintenanceWindowAttributes.JSON_PROPERTY_NAME, + MaintenanceWindowAttributes.JSON_PROPERTY_QUERY, + MaintenanceWindowAttributes.JSON_PROPERTY_START_AT, + MaintenanceWindowAttributes.JSON_PROPERTY_UPDATED_BY +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class MaintenanceWindowAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_CREATED_BY = "created_by"; + private String createdBy; + + public static final String JSON_PROPERTY_END_AT = "end_at"; + private OffsetDateTime endAt; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_QUERY = "query"; + private String query; + + public static final String JSON_PROPERTY_START_AT = "start_at"; + private OffsetDateTime startAt; + + public static final String JSON_PROPERTY_UPDATED_BY = "updated_by"; + private String updatedBy; + + public MaintenanceWindowAttributes() {} + + @JsonCreator + public MaintenanceWindowAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_END_AT) OffsetDateTime endAt, + @JsonProperty(required = true, value = JSON_PROPERTY_NAME) String name, + @JsonProperty(required = true, value = JSON_PROPERTY_QUERY) String query, + @JsonProperty(required = true, value = JSON_PROPERTY_START_AT) OffsetDateTime startAt) { + this.endAt = endAt; + this.name = name; + this.query = query; + this.startAt = startAt; + } + + /** + * The UUID of the user who created this maintenance window. Read-only. + * + * @return createdBy + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CREATED_BY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCreatedBy() { + return createdBy; + } + + public MaintenanceWindowAttributes endAt(OffsetDateTime endAt) { + this.endAt = endAt; + return this; + } + + /** + * The ISO 8601 timestamp when the maintenance window ends and normal notification behavior + * resumes. + * + * @return endAt + */ + @JsonProperty(JSON_PROPERTY_END_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public OffsetDateTime getEndAt() { + return endAt; + } + + public void setEndAt(OffsetDateTime endAt) { + this.endAt = endAt; + } + + public MaintenanceWindowAttributes name(String name) { + this.name = name; + return this; + } + + /** + * A human-readable name for the maintenance window (for example, + * Database migration - Dec 15). + * + * @return name + */ + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public MaintenanceWindowAttributes query(String query) { + this.query = query; + return this; + } + + /** + * A case search query that determines which cases are affected during the maintenance window. + * Uses the same syntax as the Case Management search bar. + * + * @return query + */ + @JsonProperty(JSON_PROPERTY_QUERY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getQuery() { + return query; + } + + public void setQuery(String query) { + this.query = query; + } + + public MaintenanceWindowAttributes startAt(OffsetDateTime startAt) { + this.startAt = startAt; + return this; + } + + /** + * The ISO 8601 timestamp when the maintenance window begins and notifications start being + * suppressed. + * + * @return startAt + */ + @JsonProperty(JSON_PROPERTY_START_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public OffsetDateTime getStartAt() { + return startAt; + } + + public void setStartAt(OffsetDateTime startAt) { + this.startAt = startAt; + } + + /** + * The UUID of the user who last modified this maintenance window. Read-only. + * + * @return updatedBy + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_UPDATED_BY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getUpdatedBy() { + return updatedBy; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return MaintenanceWindowAttributes + */ + @JsonAnySetter + public MaintenanceWindowAttributes putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this MaintenanceWindowAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MaintenanceWindowAttributes maintenanceWindowAttributes = (MaintenanceWindowAttributes) o; + return Objects.equals(this.createdBy, maintenanceWindowAttributes.createdBy) + && Objects.equals(this.endAt, maintenanceWindowAttributes.endAt) + && Objects.equals(this.name, maintenanceWindowAttributes.name) + && Objects.equals(this.query, maintenanceWindowAttributes.query) + && Objects.equals(this.startAt, maintenanceWindowAttributes.startAt) + && Objects.equals(this.updatedBy, maintenanceWindowAttributes.updatedBy) + && Objects.equals( + this.additionalProperties, maintenanceWindowAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(createdBy, endAt, name, query, startAt, updatedBy, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MaintenanceWindowAttributes {\n"); + sb.append(" createdBy: ").append(toIndentedString(createdBy)).append("\n"); + sb.append(" endAt: ").append(toIndentedString(endAt)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" query: ").append(toIndentedString(query)).append("\n"); + sb.append(" startAt: ").append(toIndentedString(startAt)).append("\n"); + sb.append(" updatedBy: ").append(toIndentedString(updatedBy)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/MaintenanceWindowCreate.java b/src/main/java/com/datadog/api/client/v2/model/MaintenanceWindowCreate.java new file mode 100644 index 00000000000..cfc0a09ad30 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/MaintenanceWindowCreate.java @@ -0,0 +1,182 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Data object for creating a maintenance window. */ +@JsonPropertyOrder({ + MaintenanceWindowCreate.JSON_PROPERTY_ATTRIBUTES, + MaintenanceWindowCreate.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class MaintenanceWindowCreate { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private MaintenanceWindowCreateAttributes attributes; + + public static final String JSON_PROPERTY_TYPE = "type"; + private MaintenanceWindowResourceType type = MaintenanceWindowResourceType.MAINTENANCE_WINDOW; + + public MaintenanceWindowCreate() {} + + @JsonCreator + public MaintenanceWindowCreate( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + MaintenanceWindowCreateAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) + MaintenanceWindowResourceType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public MaintenanceWindowCreate attributes(MaintenanceWindowCreateAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes required to create a maintenance window. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public MaintenanceWindowCreateAttributes getAttributes() { + return attributes; + } + + public void setAttributes(MaintenanceWindowCreateAttributes attributes) { + this.attributes = attributes; + } + + public MaintenanceWindowCreate type(MaintenanceWindowResourceType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * JSON:API resource type for maintenance windows. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public MaintenanceWindowResourceType getType() { + return type; + } + + public void setType(MaintenanceWindowResourceType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return MaintenanceWindowCreate + */ + @JsonAnySetter + public MaintenanceWindowCreate putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this MaintenanceWindowCreate object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MaintenanceWindowCreate maintenanceWindowCreate = (MaintenanceWindowCreate) o; + return Objects.equals(this.attributes, maintenanceWindowCreate.attributes) + && Objects.equals(this.type, maintenanceWindowCreate.type) + && Objects.equals(this.additionalProperties, maintenanceWindowCreate.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MaintenanceWindowCreate {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/MaintenanceWindowCreateAttributes.java b/src/main/java/com/datadog/api/client/v2/model/MaintenanceWindowCreateAttributes.java new file mode 100644 index 00000000000..0852cd28a96 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/MaintenanceWindowCreateAttributes.java @@ -0,0 +1,232 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Attributes required to create a maintenance window. */ +@JsonPropertyOrder({ + MaintenanceWindowCreateAttributes.JSON_PROPERTY_END_AT, + MaintenanceWindowCreateAttributes.JSON_PROPERTY_NAME, + MaintenanceWindowCreateAttributes.JSON_PROPERTY_QUERY, + MaintenanceWindowCreateAttributes.JSON_PROPERTY_START_AT +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class MaintenanceWindowCreateAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_END_AT = "end_at"; + private OffsetDateTime endAt; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_QUERY = "query"; + private String query; + + public static final String JSON_PROPERTY_START_AT = "start_at"; + private OffsetDateTime startAt; + + public MaintenanceWindowCreateAttributes() {} + + @JsonCreator + public MaintenanceWindowCreateAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_END_AT) OffsetDateTime endAt, + @JsonProperty(required = true, value = JSON_PROPERTY_NAME) String name, + @JsonProperty(required = true, value = JSON_PROPERTY_QUERY) String query, + @JsonProperty(required = true, value = JSON_PROPERTY_START_AT) OffsetDateTime startAt) { + this.endAt = endAt; + this.name = name; + this.query = query; + this.startAt = startAt; + } + + public MaintenanceWindowCreateAttributes endAt(OffsetDateTime endAt) { + this.endAt = endAt; + return this; + } + + /** + * The end time of the maintenance window. + * + * @return endAt + */ + @JsonProperty(JSON_PROPERTY_END_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public OffsetDateTime getEndAt() { + return endAt; + } + + public void setEndAt(OffsetDateTime endAt) { + this.endAt = endAt; + } + + public MaintenanceWindowCreateAttributes name(String name) { + this.name = name; + return this; + } + + /** + * The name of the maintenance window. + * + * @return name + */ + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public MaintenanceWindowCreateAttributes query(String query) { + this.query = query; + return this; + } + + /** + * The query to filter event management cases for this maintenance window. + * + * @return query + */ + @JsonProperty(JSON_PROPERTY_QUERY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getQuery() { + return query; + } + + public void setQuery(String query) { + this.query = query; + } + + public MaintenanceWindowCreateAttributes startAt(OffsetDateTime startAt) { + this.startAt = startAt; + return this; + } + + /** + * The start time of the maintenance window. + * + * @return startAt + */ + @JsonProperty(JSON_PROPERTY_START_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public OffsetDateTime getStartAt() { + return startAt; + } + + public void setStartAt(OffsetDateTime startAt) { + this.startAt = startAt; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return MaintenanceWindowCreateAttributes + */ + @JsonAnySetter + public MaintenanceWindowCreateAttributes putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this MaintenanceWindowCreateAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MaintenanceWindowCreateAttributes maintenanceWindowCreateAttributes = + (MaintenanceWindowCreateAttributes) o; + return Objects.equals(this.endAt, maintenanceWindowCreateAttributes.endAt) + && Objects.equals(this.name, maintenanceWindowCreateAttributes.name) + && Objects.equals(this.query, maintenanceWindowCreateAttributes.query) + && Objects.equals(this.startAt, maintenanceWindowCreateAttributes.startAt) + && Objects.equals( + this.additionalProperties, maintenanceWindowCreateAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(endAt, name, query, startAt, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MaintenanceWindowCreateAttributes {\n"); + sb.append(" endAt: ").append(toIndentedString(endAt)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" query: ").append(toIndentedString(query)).append("\n"); + sb.append(" startAt: ").append(toIndentedString(startAt)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/MaintenanceWindowCreateRequest.java b/src/main/java/com/datadog/api/client/v2/model/MaintenanceWindowCreateRequest.java new file mode 100644 index 00000000000..2769ea37d3a --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/MaintenanceWindowCreateRequest.java @@ -0,0 +1,147 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Request payload for creating a maintenance window. */ +@JsonPropertyOrder({MaintenanceWindowCreateRequest.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class MaintenanceWindowCreateRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private MaintenanceWindowCreate data; + + public MaintenanceWindowCreateRequest() {} + + @JsonCreator + public MaintenanceWindowCreateRequest( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) MaintenanceWindowCreate data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public MaintenanceWindowCreateRequest data(MaintenanceWindowCreate data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Data object for creating a maintenance window. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public MaintenanceWindowCreate getData() { + return data; + } + + public void setData(MaintenanceWindowCreate data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return MaintenanceWindowCreateRequest + */ + @JsonAnySetter + public MaintenanceWindowCreateRequest putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this MaintenanceWindowCreateRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MaintenanceWindowCreateRequest maintenanceWindowCreateRequest = + (MaintenanceWindowCreateRequest) o; + return Objects.equals(this.data, maintenanceWindowCreateRequest.data) + && Objects.equals( + this.additionalProperties, maintenanceWindowCreateRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MaintenanceWindowCreateRequest {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/MaintenanceWindowResourceType.java b/src/main/java/com/datadog/api/client/v2/model/MaintenanceWindowResourceType.java new file mode 100644 index 00000000000..dae2c270d2c --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/MaintenanceWindowResourceType.java @@ -0,0 +1,57 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** JSON:API resource type for maintenance windows. */ +@JsonSerialize(using = MaintenanceWindowResourceType.MaintenanceWindowResourceTypeSerializer.class) +public class MaintenanceWindowResourceType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("maintenance_window")); + + public static final MaintenanceWindowResourceType MAINTENANCE_WINDOW = + new MaintenanceWindowResourceType("maintenance_window"); + + MaintenanceWindowResourceType(String value) { + super(value, allowedValues); + } + + public static class MaintenanceWindowResourceTypeSerializer + extends StdSerializer { + public MaintenanceWindowResourceTypeSerializer(Class t) { + super(t); + } + + public MaintenanceWindowResourceTypeSerializer() { + this(null); + } + + @Override + public void serialize( + MaintenanceWindowResourceType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static MaintenanceWindowResourceType fromValue(String value) { + return new MaintenanceWindowResourceType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/MaintenanceWindowResponse.java b/src/main/java/com/datadog/api/client/v2/model/MaintenanceWindowResponse.java new file mode 100644 index 00000000000..e5d8f7cf89c --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/MaintenanceWindowResponse.java @@ -0,0 +1,148 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Response containing a single maintenance window. */ +@JsonPropertyOrder({MaintenanceWindowResponse.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class MaintenanceWindowResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private MaintenanceWindow data; + + public MaintenanceWindowResponse() {} + + @JsonCreator + public MaintenanceWindowResponse( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) MaintenanceWindow data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public MaintenanceWindowResponse data(MaintenanceWindow data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * A maintenance window that defines a scheduled time period during which case-related + * notifications and automation rules are suppressed. Each maintenance window applies to cases + * matching a specified query. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public MaintenanceWindow getData() { + return data; + } + + public void setData(MaintenanceWindow data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return MaintenanceWindowResponse + */ + @JsonAnySetter + public MaintenanceWindowResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this MaintenanceWindowResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MaintenanceWindowResponse maintenanceWindowResponse = (MaintenanceWindowResponse) o; + return Objects.equals(this.data, maintenanceWindowResponse.data) + && Objects.equals( + this.additionalProperties, maintenanceWindowResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MaintenanceWindowResponse {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/MaintenanceWindowUpdate.java b/src/main/java/com/datadog/api/client/v2/model/MaintenanceWindowUpdate.java new file mode 100644 index 00000000000..803f406cfda --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/MaintenanceWindowUpdate.java @@ -0,0 +1,180 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Data object for updating a maintenance window. */ +@JsonPropertyOrder({ + MaintenanceWindowUpdate.JSON_PROPERTY_ATTRIBUTES, + MaintenanceWindowUpdate.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class MaintenanceWindowUpdate { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private MaintenanceWindowUpdateAttributes attributes; + + public static final String JSON_PROPERTY_TYPE = "type"; + private MaintenanceWindowResourceType type = MaintenanceWindowResourceType.MAINTENANCE_WINDOW; + + public MaintenanceWindowUpdate() {} + + @JsonCreator + public MaintenanceWindowUpdate( + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) + MaintenanceWindowResourceType type) { + this.type = type; + this.unparsed |= !type.isValid(); + } + + public MaintenanceWindowUpdate attributes(MaintenanceWindowUpdateAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes that can be updated on a maintenance window. All fields are optional; only provided + * fields are changed. + * + * @return attributes + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public MaintenanceWindowUpdateAttributes getAttributes() { + return attributes; + } + + public void setAttributes(MaintenanceWindowUpdateAttributes attributes) { + this.attributes = attributes; + } + + public MaintenanceWindowUpdate type(MaintenanceWindowResourceType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * JSON:API resource type for maintenance windows. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public MaintenanceWindowResourceType getType() { + return type; + } + + public void setType(MaintenanceWindowResourceType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return MaintenanceWindowUpdate + */ + @JsonAnySetter + public MaintenanceWindowUpdate putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this MaintenanceWindowUpdate object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MaintenanceWindowUpdate maintenanceWindowUpdate = (MaintenanceWindowUpdate) o; + return Objects.equals(this.attributes, maintenanceWindowUpdate.attributes) + && Objects.equals(this.type, maintenanceWindowUpdate.type) + && Objects.equals(this.additionalProperties, maintenanceWindowUpdate.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MaintenanceWindowUpdate {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/MaintenanceWindowUpdateAttributes.java b/src/main/java/com/datadog/api/client/v2/model/MaintenanceWindowUpdateAttributes.java new file mode 100644 index 00000000000..ffd19aa73ad --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/MaintenanceWindowUpdateAttributes.java @@ -0,0 +1,224 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** + * Attributes that can be updated on a maintenance window. All fields are optional; only provided + * fields are changed. + */ +@JsonPropertyOrder({ + MaintenanceWindowUpdateAttributes.JSON_PROPERTY_END_AT, + MaintenanceWindowUpdateAttributes.JSON_PROPERTY_NAME, + MaintenanceWindowUpdateAttributes.JSON_PROPERTY_QUERY, + MaintenanceWindowUpdateAttributes.JSON_PROPERTY_START_AT +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class MaintenanceWindowUpdateAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_END_AT = "end_at"; + private OffsetDateTime endAt; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_QUERY = "query"; + private String query; + + public static final String JSON_PROPERTY_START_AT = "start_at"; + private OffsetDateTime startAt; + + public MaintenanceWindowUpdateAttributes endAt(OffsetDateTime endAt) { + this.endAt = endAt; + return this; + } + + /** + * The end time of the maintenance window. + * + * @return endAt + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_END_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getEndAt() { + return endAt; + } + + public void setEndAt(OffsetDateTime endAt) { + this.endAt = endAt; + } + + public MaintenanceWindowUpdateAttributes name(String name) { + this.name = name; + return this; + } + + /** + * The name of the maintenance window. + * + * @return name + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public MaintenanceWindowUpdateAttributes query(String query) { + this.query = query; + return this; + } + + /** + * The query to filter event management cases for this maintenance window. + * + * @return query + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_QUERY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getQuery() { + return query; + } + + public void setQuery(String query) { + this.query = query; + } + + public MaintenanceWindowUpdateAttributes startAt(OffsetDateTime startAt) { + this.startAt = startAt; + return this; + } + + /** + * The start time of the maintenance window. + * + * @return startAt + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_START_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getStartAt() { + return startAt; + } + + public void setStartAt(OffsetDateTime startAt) { + this.startAt = startAt; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return MaintenanceWindowUpdateAttributes + */ + @JsonAnySetter + public MaintenanceWindowUpdateAttributes putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this MaintenanceWindowUpdateAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MaintenanceWindowUpdateAttributes maintenanceWindowUpdateAttributes = + (MaintenanceWindowUpdateAttributes) o; + return Objects.equals(this.endAt, maintenanceWindowUpdateAttributes.endAt) + && Objects.equals(this.name, maintenanceWindowUpdateAttributes.name) + && Objects.equals(this.query, maintenanceWindowUpdateAttributes.query) + && Objects.equals(this.startAt, maintenanceWindowUpdateAttributes.startAt) + && Objects.equals( + this.additionalProperties, maintenanceWindowUpdateAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(endAt, name, query, startAt, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MaintenanceWindowUpdateAttributes {\n"); + sb.append(" endAt: ").append(toIndentedString(endAt)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" query: ").append(toIndentedString(query)).append("\n"); + sb.append(" startAt: ").append(toIndentedString(startAt)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/MaintenanceWindowUpdateRequest.java b/src/main/java/com/datadog/api/client/v2/model/MaintenanceWindowUpdateRequest.java new file mode 100644 index 00000000000..56c5134196c --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/MaintenanceWindowUpdateRequest.java @@ -0,0 +1,147 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Request payload for updating a maintenance window. */ +@JsonPropertyOrder({MaintenanceWindowUpdateRequest.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class MaintenanceWindowUpdateRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private MaintenanceWindowUpdate data; + + public MaintenanceWindowUpdateRequest() {} + + @JsonCreator + public MaintenanceWindowUpdateRequest( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) MaintenanceWindowUpdate data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public MaintenanceWindowUpdateRequest data(MaintenanceWindowUpdate data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Data object for updating a maintenance window. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public MaintenanceWindowUpdate getData() { + return data; + } + + public void setData(MaintenanceWindowUpdate data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return MaintenanceWindowUpdateRequest + */ + @JsonAnySetter + public MaintenanceWindowUpdateRequest putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this MaintenanceWindowUpdateRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MaintenanceWindowUpdateRequest maintenanceWindowUpdateRequest = + (MaintenanceWindowUpdateRequest) o; + return Objects.equals(this.data, maintenanceWindowUpdateRequest.data) + && Objects.equals( + this.additionalProperties, maintenanceWindowUpdateRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MaintenanceWindowUpdateRequest {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/MaintenanceWindowsResponse.java b/src/main/java/com/datadog/api/client/v2/model/MaintenanceWindowsResponse.java new file mode 100644 index 00000000000..7ca5c129db7 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/MaintenanceWindowsResponse.java @@ -0,0 +1,155 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** Response containing a list of maintenance windows. */ +@JsonPropertyOrder({MaintenanceWindowsResponse.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class MaintenanceWindowsResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private List data = new ArrayList<>(); + + public MaintenanceWindowsResponse() {} + + @JsonCreator + public MaintenanceWindowsResponse( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) List data) { + this.data = data; + } + + public MaintenanceWindowsResponse data(List data) { + this.data = data; + for (MaintenanceWindow item : data) { + this.unparsed |= item.unparsed; + } + return this; + } + + public MaintenanceWindowsResponse addDataItem(MaintenanceWindow dataItem) { + this.data.add(dataItem); + this.unparsed |= dataItem.unparsed; + return this; + } + + /** + * List of maintenance windows. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return MaintenanceWindowsResponse + */ + @JsonAnySetter + public MaintenanceWindowsResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this MaintenanceWindowsResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MaintenanceWindowsResponse maintenanceWindowsResponse = (MaintenanceWindowsResponse) o; + return Objects.equals(this.data, maintenanceWindowsResponse.data) + && Objects.equals( + this.additionalProperties, maintenanceWindowsResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MaintenanceWindowsResponse {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ProjectFavorite.java b/src/main/java/com/datadog/api/client/v2/model/ProjectFavorite.java new file mode 100644 index 00000000000..fcdd6fece49 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProjectFavorite.java @@ -0,0 +1,178 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** + * Represents a case project that the current user has bookmarked for quick access. Favorited + * projects appear prominently in the Case Management UI. + */ +@JsonPropertyOrder({ProjectFavorite.JSON_PROPERTY_ID, ProjectFavorite.JSON_PROPERTY_TYPE}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ProjectFavorite { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private ProjectFavoriteResourceType type = ProjectFavoriteResourceType.PROJECT_FAVORITE; + + public ProjectFavorite() {} + + @JsonCreator + public ProjectFavorite( + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) ProjectFavoriteResourceType type) { + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public ProjectFavorite id(String id) { + this.id = id; + return this; + } + + /** + * The UUID of the favorited project. + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public ProjectFavorite type(ProjectFavoriteResourceType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * JSON:API resource type for project favorites. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ProjectFavoriteResourceType getType() { + return type; + } + + public void setType(ProjectFavoriteResourceType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return ProjectFavorite + */ + @JsonAnySetter + public ProjectFavorite putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this ProjectFavorite object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProjectFavorite projectFavorite = (ProjectFavorite) o; + return Objects.equals(this.id, projectFavorite.id) + && Objects.equals(this.type, projectFavorite.type) + && Objects.equals(this.additionalProperties, projectFavorite.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProjectFavorite {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ProjectFavoriteResourceType.java b/src/main/java/com/datadog/api/client/v2/model/ProjectFavoriteResourceType.java new file mode 100644 index 00000000000..18cfae73c9f --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProjectFavoriteResourceType.java @@ -0,0 +1,57 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** JSON:API resource type for project favorites. */ +@JsonSerialize(using = ProjectFavoriteResourceType.ProjectFavoriteResourceTypeSerializer.class) +public class ProjectFavoriteResourceType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("project_favorite")); + + public static final ProjectFavoriteResourceType PROJECT_FAVORITE = + new ProjectFavoriteResourceType("project_favorite"); + + ProjectFavoriteResourceType(String value) { + super(value, allowedValues); + } + + public static class ProjectFavoriteResourceTypeSerializer + extends StdSerializer { + public ProjectFavoriteResourceTypeSerializer(Class t) { + super(t); + } + + public ProjectFavoriteResourceTypeSerializer() { + this(null); + } + + @Override + public void serialize( + ProjectFavoriteResourceType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static ProjectFavoriteResourceType fromValue(String value) { + return new ProjectFavoriteResourceType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ProjectFavoritesResponse.java b/src/main/java/com/datadog/api/client/v2/model/ProjectFavoritesResponse.java new file mode 100644 index 00000000000..bc3678524f8 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProjectFavoritesResponse.java @@ -0,0 +1,154 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** Response containing the list of projects the current user has favorited. */ +@JsonPropertyOrder({ProjectFavoritesResponse.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ProjectFavoritesResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private List data = new ArrayList<>(); + + public ProjectFavoritesResponse() {} + + @JsonCreator + public ProjectFavoritesResponse( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) List data) { + this.data = data; + } + + public ProjectFavoritesResponse data(List data) { + this.data = data; + for (ProjectFavorite item : data) { + this.unparsed |= item.unparsed; + } + return this; + } + + public ProjectFavoritesResponse addDataItem(ProjectFavorite dataItem) { + this.data.add(dataItem); + this.unparsed |= dataItem.unparsed; + return this; + } + + /** + * List of project favorites. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return ProjectFavoritesResponse + */ + @JsonAnySetter + public ProjectFavoritesResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this ProjectFavoritesResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProjectFavoritesResponse projectFavoritesResponse = (ProjectFavoritesResponse) o; + return Objects.equals(this.data, projectFavoritesResponse.data) + && Objects.equals(this.additionalProperties, projectFavoritesResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProjectFavoritesResponse {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/TimelineCell.java b/src/main/java/com/datadog/api/client/v2/model/TimelineCell.java index d15aff100af..5bb74c91775 100644 --- a/src/main/java/com/datadog/api/client/v2/model/TimelineCell.java +++ b/src/main/java/com/datadog/api/client/v2/model/TimelineCell.java @@ -17,7 +17,10 @@ import java.util.Map; import java.util.Objects; -/** timeline cell */ +/** + * Attributes of a timeline cell, representing a single event in a case's chronological activity log + * (for example, a comment, status change, or assignment update). + */ @JsonPropertyOrder({ TimelineCell.JSON_PROPERTY_AUTHOR, TimelineCell.JSON_PROPERTY_CELL_CONTENT, @@ -55,7 +58,7 @@ public TimelineCell author(TimelineCellAuthor author) { } /** - * author of the timeline cell + * The author of the timeline cell. Currently only user authors are supported. * * @return author */ @@ -77,7 +80,7 @@ public TimelineCell cellContent(TimelineCellContent cellContent) { } /** - * timeline cell content + * The content payload of a timeline cell, varying by cell type. * * @return cellContent */ @@ -135,7 +138,8 @@ public TimelineCell type(TimelineCellType type) { } /** - * Timeline cell content type + * The type of content in the timeline cell. Currently only COMMENT is supported in + * this endpoint. * * @return type */ diff --git a/src/main/java/com/datadog/api/client/v2/model/TimelineCellAuthorUser.java b/src/main/java/com/datadog/api/client/v2/model/TimelineCellAuthorUser.java index c32c284e825..3b4d175a187 100644 --- a/src/main/java/com/datadog/api/client/v2/model/TimelineCellAuthorUser.java +++ b/src/main/java/com/datadog/api/client/v2/model/TimelineCellAuthorUser.java @@ -16,7 +16,7 @@ import java.util.Map; import java.util.Objects; -/** timeline cell user author */ +/** A user who authored a timeline cell. */ @JsonPropertyOrder({ TimelineCellAuthorUser.JSON_PROPERTY_CONTENT, TimelineCellAuthorUser.JSON_PROPERTY_TYPE @@ -38,7 +38,7 @@ public TimelineCellAuthorUser content(TimelineCellAuthorUserContent content) { } /** - * user author content. + * Profile information for the user who authored the timeline cell. * * @return content */ @@ -60,7 +60,7 @@ public TimelineCellAuthorUser type(TimelineCellAuthorUserType type) { } /** - * user author type. + * The type of timeline cell author. Currently only USER is supported. * * @return type */ diff --git a/src/main/java/com/datadog/api/client/v2/model/TimelineCellAuthorUserContent.java b/src/main/java/com/datadog/api/client/v2/model/TimelineCellAuthorUserContent.java index 6701cf1dc01..ebc39626746 100644 --- a/src/main/java/com/datadog/api/client/v2/model/TimelineCellAuthorUserContent.java +++ b/src/main/java/com/datadog/api/client/v2/model/TimelineCellAuthorUserContent.java @@ -16,7 +16,7 @@ import java.util.Map; import java.util.Objects; -/** user author content. */ +/** Profile information for the user who authored the timeline cell. */ @JsonPropertyOrder({ TimelineCellAuthorUserContent.JSON_PROPERTY_EMAIL, TimelineCellAuthorUserContent.JSON_PROPERTY_HANDLE, @@ -45,7 +45,7 @@ public TimelineCellAuthorUserContent email(String email) { } /** - * user email + * The email address of the user. * * @return email */ @@ -66,7 +66,7 @@ public TimelineCellAuthorUserContent handle(String handle) { } /** - * user handle + * The Datadog handle of the user. * * @return handle */ @@ -87,7 +87,7 @@ public TimelineCellAuthorUserContent id(String id) { } /** - * user UUID + * The UUID of the user. * * @return id */ @@ -108,7 +108,7 @@ public TimelineCellAuthorUserContent name(String name) { } /** - * user name + * The display name of the user. * * @return name */ diff --git a/src/main/java/com/datadog/api/client/v2/model/TimelineCellAuthorUserType.java b/src/main/java/com/datadog/api/client/v2/model/TimelineCellAuthorUserType.java index 3abcddbc17e..8eae5512e33 100644 --- a/src/main/java/com/datadog/api/client/v2/model/TimelineCellAuthorUserType.java +++ b/src/main/java/com/datadog/api/client/v2/model/TimelineCellAuthorUserType.java @@ -18,7 +18,7 @@ import java.util.HashSet; import java.util.Set; -/** user author type. */ +/** The type of timeline cell author. Currently only USER is supported. */ @JsonSerialize(using = TimelineCellAuthorUserType.TimelineCellAuthorUserTypeSerializer.class) public class TimelineCellAuthorUserType extends ModelEnum { diff --git a/src/main/java/com/datadog/api/client/v2/model/TimelineCellContentComment.java b/src/main/java/com/datadog/api/client/v2/model/TimelineCellContentComment.java index 5748841aeac..6281b34eb17 100644 --- a/src/main/java/com/datadog/api/client/v2/model/TimelineCellContentComment.java +++ b/src/main/java/com/datadog/api/client/v2/model/TimelineCellContentComment.java @@ -16,7 +16,7 @@ import java.util.Map; import java.util.Objects; -/** comment content */ +/** The content of a comment timeline cell. */ @JsonPropertyOrder({TimelineCellContentComment.JSON_PROPERTY_MESSAGE}) @jakarta.annotation.Generated( value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") @@ -31,7 +31,7 @@ public TimelineCellContentComment message(String message) { } /** - * comment message + * The text content of the comment. Supports Markdown formatting. * * @return message */ diff --git a/src/main/java/com/datadog/api/client/v2/model/TimelineCellResource.java b/src/main/java/com/datadog/api/client/v2/model/TimelineCellResource.java index 8384d21b7e5..924f7b1a66b 100644 --- a/src/main/java/com/datadog/api/client/v2/model/TimelineCellResource.java +++ b/src/main/java/com/datadog/api/client/v2/model/TimelineCellResource.java @@ -17,7 +17,7 @@ import java.util.Map; import java.util.Objects; -/** Timeline cell JSON:API resource */ +/** A timeline cell resource representing a single entry in a case's activity timeline. */ @JsonPropertyOrder({ TimelineCellResource.JSON_PROPERTY_ATTRIBUTES, TimelineCellResource.JSON_PROPERTY_ID, @@ -57,7 +57,8 @@ public TimelineCellResource attributes(TimelineCell attributes) { } /** - * timeline cell + * Attributes of a timeline cell, representing a single event in a case's chronological activity + * log (for example, a comment, status change, or assignment update). * * @return attributes */ @@ -98,7 +99,7 @@ public TimelineCellResource type(TimelineCellResourceType type) { } /** - * Timeline cell JSON:API resource type + * JSON:API resource type for timeline cells. * * @return type */ diff --git a/src/main/java/com/datadog/api/client/v2/model/TimelineCellResourceType.java b/src/main/java/com/datadog/api/client/v2/model/TimelineCellResourceType.java index eec695ab70a..654a3d1fcba 100644 --- a/src/main/java/com/datadog/api/client/v2/model/TimelineCellResourceType.java +++ b/src/main/java/com/datadog/api/client/v2/model/TimelineCellResourceType.java @@ -18,7 +18,7 @@ import java.util.HashSet; import java.util.Set; -/** Timeline cell JSON:API resource type */ +/** JSON:API resource type for timeline cells. */ @JsonSerialize(using = TimelineCellResourceType.TimelineCellResourceTypeSerializer.class) public class TimelineCellResourceType extends ModelEnum { diff --git a/src/main/java/com/datadog/api/client/v2/model/TimelineCellType.java b/src/main/java/com/datadog/api/client/v2/model/TimelineCellType.java index 4b0ee5d84a5..52501aa423c 100644 --- a/src/main/java/com/datadog/api/client/v2/model/TimelineCellType.java +++ b/src/main/java/com/datadog/api/client/v2/model/TimelineCellType.java @@ -18,7 +18,10 @@ import java.util.HashSet; import java.util.Set; -/** Timeline cell content type */ +/** + * The type of content in the timeline cell. Currently only COMMENT is supported in + * this endpoint. + */ @JsonSerialize(using = TimelineCellType.TimelineCellTypeSerializer.class) public class TimelineCellType extends ModelEnum { diff --git a/src/main/java/com/datadog/api/client/v2/model/TimelineResponse.java b/src/main/java/com/datadog/api/client/v2/model/TimelineResponse.java index f9066ca42e3..ddc1d966b06 100644 --- a/src/main/java/com/datadog/api/client/v2/model/TimelineResponse.java +++ b/src/main/java/com/datadog/api/client/v2/model/TimelineResponse.java @@ -18,7 +18,7 @@ import java.util.Map; import java.util.Objects; -/** Timeline response */ +/** Response containing the chronological list of timeline cells for a case. */ @JsonPropertyOrder({TimelineResponse.JSON_PROPERTY_DATA}) @jakarta.annotation.Generated( value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") diff --git a/src/test/resources/com/datadog/api/client/v2/api/case_management.feature b/src/test/resources/com/datadog/api/client/v2/api/case_management.feature index bd67a8ddf2c..04f9d8e0698 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/case_management.feature +++ b/src/test/resources/com/datadog/api/client/v2/api/case_management.feature @@ -10,6 +10,57 @@ 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 insights to a case returns "Bad Request" response + Given operation "AddCaseInsights" enabled + And new "AddCaseInsights" request + And request contains "case_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"insights": [{"ref": "/monitors/12345?q=total", "resource_id": "12345", "type": "SECURITY_SIGNAL"}]}, "type": "case"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/case-management + Scenario: Add insights to a case returns "Not Found" response + Given operation "AddCaseInsights" enabled + And new "AddCaseInsights" request + And request contains "case_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"insights": [{"ref": "/monitors/12345?q=total", "resource_id": "12345", "type": "SECURITY_SIGNAL"}]}, "type": "case"}} + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/case-management + Scenario: Add insights to a case returns "OK" response + Given operation "AddCaseInsights" enabled + And new "AddCaseInsights" request + And request contains "case_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"insights": [{"ref": "/monitors/12345?q=total", "resource_id": "12345", "type": "SECURITY_SIGNAL"}]}, "type": "case"}} + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/case-management + Scenario: Aggregate cases returns "Bad Request" response + Given operation "AggregateCases" enabled + And new "AggregateCases" request + And body with value {"data": {"attributes": {"group_by": {"groups": ["status"], "limit": 14}, "query_filter": "service:case-api"}, "type": "aggregate"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/case-management + Scenario: Aggregate cases returns "Not Found" response + Given operation "AggregateCases" enabled + And new "AggregateCases" request + And body with value {"data": {"attributes": {"group_by": {"groups": ["status"], "limit": 14}, "query_filter": "service:case-api"}, "type": "aggregate"}} + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/case-management + Scenario: Aggregate cases returns "OK" response + Given operation "AggregateCases" enabled + And new "AggregateCases" request + And body with value {"data": {"attributes": {"group_by": {"groups": ["status"], "limit": 14}, "query_filter": "service:case-api"}, "type": "aggregate"}} + When the request is sent + Then the response status is 200 OK + @team:DataDog/case-management Scenario: Archive case returns "Bad Request" response Given new "ArchiveCase" request @@ -64,6 +115,30 @@ Feature: Case Management When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/case-management + Scenario: Bulk update cases returns "Bad Request" response + Given operation "BulkUpdateCases" enabled + And new "BulkUpdateCases" request + And body with value {"data": {"attributes": {"case_ids": ["case-id-1", "case-id-2"], "payload": {"priority": "P1"}, "type": "priority"}, "type": "bulk"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/case-management + Scenario: Bulk update cases returns "Not Found" response + Given operation "BulkUpdateCases" enabled + And new "BulkUpdateCases" request + And body with value {"data": {"attributes": {"case_ids": ["case-id-1", "case-id-2"], "payload": {"priority": "P1"}, "type": "priority"}, "type": "bulk"}} + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/case-management + Scenario: Bulk update cases returns "OK" response + Given operation "BulkUpdateCases" enabled + And new "BulkUpdateCases" request + And body with value {"data": {"attributes": {"case_ids": ["case-id-1", "case-id-2"], "payload": {"priority": "P1"}, "type": "priority"}, "type": "bulk"}} + When the request is sent + Then the response status is 200 OK + @team:DataDog/case-management Scenario: Comment case returns "Bad Request" response Given new "CommentCase" request @@ -90,6 +165,27 @@ Feature: Case Management When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/case-management + Scenario: Count cases returns "Bad Request" response + Given operation "CountCases" enabled + And new "CountCases" request + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/case-management + Scenario: Count cases returns "Not Found" response + Given operation "CountCases" enabled + And new "CountCases" request + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/case-management + Scenario: Count cases returns "OK" response + Given operation "CountCases" enabled + And new "CountCases" request + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/case-management Scenario: Create Jira issue for case returns "Accepted" response Given operation "CreateCaseJiraIssue" enabled @@ -144,6 +240,30 @@ Feature: Case Management When the request is sent Then the response status is 404 Not Found + @generated @skip @team:DataDog/case-management + Scenario: Create a case link returns "Bad Request" response + Given operation "CreateCaseLink" enabled + And new "CreateCaseLink" request + And body with value {"data": {"attributes": {"child_entity_id": "4417921d-0866-4a38-822c-6f2a0f65f77d", "child_entity_type": "CASE", "parent_entity_id": "bf0cbac6-4c16-4cfb-b6bf-ca5e0ec37a4f", "parent_entity_type": "CASE", "relationship": "BLOCKS"}, "type": "link"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/case-management + Scenario: Create a case link returns "Created" response + Given operation "CreateCaseLink" enabled + And new "CreateCaseLink" request + And body with value {"data": {"attributes": {"child_entity_id": "4417921d-0866-4a38-822c-6f2a0f65f77d", "child_entity_type": "CASE", "parent_entity_id": "bf0cbac6-4c16-4cfb-b6bf-ca5e0ec37a4f", "parent_entity_type": "CASE", "relationship": "BLOCKS"}, "type": "link"}} + When the request is sent + Then the response status is 201 Created + + @generated @skip @team:DataDog/case-management + Scenario: Create a case link returns "Not Found" response + Given operation "CreateCaseLink" enabled + And new "CreateCaseLink" request + And body with value {"data": {"attributes": {"child_entity_id": "4417921d-0866-4a38-822c-6f2a0f65f77d", "child_entity_type": "CASE", "parent_entity_id": "bf0cbac6-4c16-4cfb-b6bf-ca5e0ec37a4f", "parent_entity_type": "CASE", "relationship": "BLOCKS"}, "type": "link"}} + When the request is sent + Then the response status is 404 Not Found + @team:DataDog/case-management Scenario: Create a case returns "Bad Request" response Given new "CreateCase" request @@ -170,6 +290,54 @@ Feature: Case Management When the request is sent Then the response status is 404 Not Found + @generated @skip @team:DataDog/case-management + Scenario: Create a case view returns "Bad Request" response + Given operation "CreateCaseView" enabled + And new "CreateCaseView" request + And body with value {"data": {"attributes": {"name": "Open bugs", "project_id": "e555e290-ed65-49bd-ae18-8acbfcf18db7", "query": "status:open type:bug"}, "type": "view"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/case-management + Scenario: Create a case view returns "Created" response + Given operation "CreateCaseView" enabled + And new "CreateCaseView" request + And body with value {"data": {"attributes": {"name": "Open bugs", "project_id": "e555e290-ed65-49bd-ae18-8acbfcf18db7", "query": "status:open type:bug"}, "type": "view"}} + When the request is sent + Then the response status is 201 Created + + @generated @skip @team:DataDog/case-management + Scenario: Create a case view returns "Not Found" response + Given operation "CreateCaseView" enabled + And new "CreateCaseView" request + And body with value {"data": {"attributes": {"name": "Open bugs", "project_id": "e555e290-ed65-49bd-ae18-8acbfcf18db7", "query": "status:open type:bug"}, "type": "view"}} + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/case-management + Scenario: Create a maintenance window returns "Bad Request" response + Given operation "CreateMaintenanceWindow" enabled + And new "CreateMaintenanceWindow" request + And body with value {"data": {"attributes": {"end_at": "2026-06-01T06:00:00Z", "name": "Weekly maintenance", "query": "project:SEC", "start_at": "2026-06-01T00:00:00Z"}, "type": "maintenance_window"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/case-management + Scenario: Create a maintenance window returns "Created" response + Given operation "CreateMaintenanceWindow" enabled + And new "CreateMaintenanceWindow" request + And body with value {"data": {"attributes": {"end_at": "2026-06-01T06:00:00Z", "name": "Weekly maintenance", "query": "project:SEC", "start_at": "2026-06-01T00:00:00Z"}, "type": "maintenance_window"}} + When the request is sent + Then the response status is 201 Created + + @generated @skip @team:DataDog/case-management + Scenario: Create a maintenance window returns "Not Found" response + Given operation "CreateMaintenanceWindow" enabled + And new "CreateMaintenanceWindow" request + And body with value {"data": {"attributes": {"end_at": "2026-06-01T06:00:00Z", "name": "Weekly maintenance", "query": "project:SEC", "start_at": "2026-06-01T00:00:00Z"}, "type": "maintenance_window"}} + When the request is sent + Then the response status is 404 Not Found + @generated @skip @team:DataDog/case-management Scenario: Create a notification rule returns "Bad Request" response Given new "CreateProjectNotificationRule" request @@ -215,6 +383,33 @@ Feature: Case Management When the request is sent Then the response status is 404 Not Found + @generated @skip @team:DataDog/case-management + Scenario: Create an automation rule returns "Bad Request" response + Given operation "CreateCaseAutomationRule" enabled + And new "CreateCaseAutomationRule" request + And request contains "project_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"action": {"data": {"handle": "workflow-handle-123"}, "type": "execute_workflow"}, "name": "Auto-assign workflow", "state": "ENABLED", "trigger": {"data": {}, "type": "case_created"}}, "type": "rule"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/case-management + Scenario: Create an automation rule returns "Created" response + Given operation "CreateCaseAutomationRule" enabled + And new "CreateCaseAutomationRule" request + And request contains "project_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"action": {"data": {"handle": "workflow-handle-123"}, "type": "execute_workflow"}, "name": "Auto-assign workflow", "state": "ENABLED", "trigger": {"data": {}, "type": "case_created"}}, "type": "rule"}} + When the request is sent + Then the response status is 201 Created + + @generated @skip @team:DataDog/case-management + Scenario: Create an automation rule returns "Not Found" response + Given operation "CreateCaseAutomationRule" enabled + And new "CreateCaseAutomationRule" request + And request contains "project_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"action": {"data": {"handle": "workflow-handle-123"}, "type": "execute_workflow"}, "name": "Auto-assign workflow", "state": "ENABLED", "trigger": {"data": {}, "type": "case_created"}}, "type": "rule"}} + When the request is sent + Then the response status is 404 Not Found + @generated @skip @team:DataDog/case-management Scenario: Create investigation notebook for case returns "Bad Request" response Given operation "CreateCaseNotebook" enabled @@ -242,6 +437,78 @@ Feature: Case Management When the request is sent Then the response status is 404 Not Found + @generated @skip @team:DataDog/case-management + Scenario: Delete a case link returns "Bad Request" response + Given operation "DeleteCaseLink" enabled + And new "DeleteCaseLink" request + And request contains "link_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: Delete a case link returns "No Content" response + Given operation "DeleteCaseLink" enabled + And new "DeleteCaseLink" request + And request contains "link_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: Delete a case link returns "Not Found" response + Given operation "DeleteCaseLink" enabled + And new "DeleteCaseLink" request + And request contains "link_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: Delete a case view returns "Bad Request" response + Given operation "DeleteCaseView" enabled + And new "DeleteCaseView" request + And request contains "view_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: Delete a case view returns "No Content" response + Given operation "DeleteCaseView" enabled + And new "DeleteCaseView" request + And request contains "view_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: Delete a case view returns "Not Found" response + Given operation "DeleteCaseView" enabled + And new "DeleteCaseView" request + And request contains "view_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: Delete a maintenance window returns "Bad Request" response + Given operation "DeleteMaintenanceWindow" enabled + And new "DeleteMaintenanceWindow" request + And request contains "maintenance_window_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: Delete a maintenance window returns "No Content" response + Given operation "DeleteMaintenanceWindow" enabled + And new "DeleteMaintenanceWindow" request + And request contains "maintenance_window_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: Delete a maintenance window returns "Not Found" response + Given operation "DeleteMaintenanceWindow" enabled + And new "DeleteMaintenanceWindow" request + And request contains "maintenance_window_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: Delete a notification rule returns "API error response" response Given new "DeleteProjectNotificationRule" request @@ -258,6 +525,24 @@ Feature: Case Management When the request is sent Then the response status is 204 No Content + @generated @skip @team:DataDog/case-management + Scenario: Delete an automation rule returns "No Content" response + Given operation "DeleteCaseAutomationRule" enabled + And new "DeleteCaseAutomationRule" request + And request contains "project_id" parameter from "REPLACE.ME" + And request contains "rule_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: Delete an automation rule returns "Not Found" response + Given operation "DeleteCaseAutomationRule" enabled + And new "DeleteCaseAutomationRule" request + And request contains "project_id" parameter from "REPLACE.ME" + And request contains "rule_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + @skip @team:DataDog/case-management Scenario: Delete case comment returns "Bad Request" response Given new "DeleteCaseComment" request @@ -306,6 +591,108 @@ Feature: Case Management When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/case-management + Scenario: Disable an automation rule returns "Bad Request" response + Given operation "DisableCaseAutomationRule" enabled + And new "DisableCaseAutomationRule" request + And request contains "project_id" parameter from "REPLACE.ME" + And request contains "rule_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: Disable an automation rule returns "Not Found" response + Given operation "DisableCaseAutomationRule" enabled + And new "DisableCaseAutomationRule" request + And request contains "project_id" parameter from "REPLACE.ME" + And request contains "rule_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: Disable an automation rule returns "OK" response + Given operation "DisableCaseAutomationRule" enabled + And new "DisableCaseAutomationRule" request + And request contains "project_id" parameter from "REPLACE.ME" + And request contains "rule_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/case-management + Scenario: Enable an automation rule returns "Bad Request" response + Given operation "EnableCaseAutomationRule" enabled + And new "EnableCaseAutomationRule" request + And request contains "project_id" parameter from "REPLACE.ME" + And request contains "rule_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: Enable an automation rule returns "Not Found" response + Given operation "EnableCaseAutomationRule" enabled + And new "EnableCaseAutomationRule" request + And request contains "project_id" parameter from "REPLACE.ME" + And request contains "rule_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: Enable an automation rule returns "OK" response + Given operation "EnableCaseAutomationRule" enabled + And new "EnableCaseAutomationRule" request + And request contains "project_id" parameter from "REPLACE.ME" + And request contains "rule_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/case-management + Scenario: Favorite a project returns "Bad Request" response + Given operation "FavoriteCaseProject" enabled + And new "FavoriteCaseProject" 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: Favorite a project returns "No Content" response + Given operation "FavoriteCaseProject" enabled + And new "FavoriteCaseProject" 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: Favorite a project returns "Not Found" response + Given operation "FavoriteCaseProject" enabled + And new "FavoriteCaseProject" 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: Get a case view returns "Bad Request" response + Given operation "GetCaseView" enabled + And new "GetCaseView" request + And request contains "view_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: Get a case view returns "Not Found" response + Given operation "GetCaseView" enabled + And new "GetCaseView" request + And request contains "view_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: Get a case view returns "OK" response + Given operation "GetCaseView" enabled + And new "GetCaseView" request + And request contains "view_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/case-management Scenario: Get all projects returns "Bad Request" response Given new "GetProjects" request @@ -324,6 +711,57 @@ Feature: Case Management When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/case-management + Scenario: Get an automation rule returns "Bad Request" response + Given operation "GetCaseAutomationRule" enabled + And new "GetCaseAutomationRule" request + And request contains "project_id" parameter from "REPLACE.ME" + And request contains "rule_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: Get an automation rule returns "Not Found" response + Given operation "GetCaseAutomationRule" enabled + And new "GetCaseAutomationRule" request + And request contains "project_id" parameter from "REPLACE.ME" + And request contains "rule_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: Get an automation rule returns "OK" response + Given operation "GetCaseAutomationRule" enabled + And new "GetCaseAutomationRule" request + And request contains "project_id" parameter from "REPLACE.ME" + And request contains "rule_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/case-management + Scenario: Get case timeline returns "Bad Request" response + Given operation "ListCaseTimeline" enabled + And new "ListCaseTimeline" request + And request contains "case_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: Get case timeline returns "Not Found" response + Given operation "ListCaseTimeline" enabled + And new "ListCaseTimeline" request + And request contains "case_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: Get case timeline returns "OK" response + Given operation "ListCaseTimeline" enabled + And new "ListCaseTimeline" request + And request contains "case_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/case-management Scenario: Get notification rules returns "Bad Request" response Given new "GetProjectNotificationRules" request @@ -452,6 +890,147 @@ Feature: Case Management When the request is sent Then the response status is 404 Not Found + @generated @skip @team:DataDog/case-management + Scenario: List automation rules returns "Bad Request" response + Given operation "ListCaseAutomationRules" enabled + And new "ListCaseAutomationRules" 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: List automation rules returns "Not Found" response + Given operation "ListCaseAutomationRules" enabled + And new "ListCaseAutomationRules" 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: List automation rules returns "OK" response + Given operation "ListCaseAutomationRules" enabled + And new "ListCaseAutomationRules" request + And request contains "project_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/case-management + Scenario: List case links returns "Bad Request" response + Given operation "ListCaseLinks" enabled + And new "ListCaseLinks" request + And request contains "entity_type" parameter from "REPLACE.ME" + And request contains "entity_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: List case links returns "Not Found" response + Given operation "ListCaseLinks" enabled + And new "ListCaseLinks" request + And request contains "entity_type" parameter from "REPLACE.ME" + And request contains "entity_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: List case links returns "OK" response + Given operation "ListCaseLinks" enabled + And new "ListCaseLinks" request + And request contains "entity_type" parameter from "REPLACE.ME" + And request contains "entity_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/case-management + Scenario: List case views returns "Bad Request" response + Given operation "ListCaseViews" enabled + And new "ListCaseViews" 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: List case views returns "Not Found" response + Given operation "ListCaseViews" enabled + And new "ListCaseViews" 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: List case views returns "OK" response + Given operation "ListCaseViews" enabled + And new "ListCaseViews" request + And request contains "project_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/case-management + Scenario: List case watchers returns "Bad Request" response + Given operation "ListCaseWatchers" enabled + And new "ListCaseWatchers" request + And request contains "case_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: List case watchers returns "Not Found" response + Given operation "ListCaseWatchers" enabled + And new "ListCaseWatchers" request + And request contains "case_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: List case watchers returns "OK" response + Given operation "ListCaseWatchers" enabled + And new "ListCaseWatchers" request + And request contains "case_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/case-management + Scenario: List maintenance windows returns "Bad Request" response + Given operation "ListMaintenanceWindows" enabled + And new "ListMaintenanceWindows" request + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/case-management + Scenario: List maintenance windows returns "Not Found" response + Given operation "ListMaintenanceWindows" enabled + And new "ListMaintenanceWindows" request + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/case-management + Scenario: List maintenance windows returns "OK" response + Given operation "ListMaintenanceWindows" enabled + And new "ListMaintenanceWindows" request + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/case-management + Scenario: List project favorites returns "Bad Request" response + Given operation "ListUserCaseProjectFavorites" enabled + And new "ListUserCaseProjectFavorites" request + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/case-management + Scenario: List project favorites returns "Not Found" response + Given operation "ListUserCaseProjectFavorites" enabled + And new "ListUserCaseProjectFavorites" request + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/case-management + Scenario: List project favorites returns "OK" response + Given operation "ListUserCaseProjectFavorites" enabled + And new "ListUserCaseProjectFavorites" request + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/case-management Scenario: Remove Jira issue link from case returns "Bad Request" response Given operation "UnlinkJiraIssue" enabled @@ -490,6 +1069,33 @@ Feature: Case Management When the request is sent Then the response status is 204 No Content + @generated @skip @team:DataDog/case-management + Scenario: Remove insights from a case returns "Bad Request" response + Given operation "RemoveCaseInsights" enabled + And new "RemoveCaseInsights" request + And request contains "case_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"insights": [{"ref": "/monitors/12345?q=total", "resource_id": "12345", "type": "SECURITY_SIGNAL"}]}, "type": "case"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/case-management + Scenario: Remove insights from a case returns "Not Found" response + Given operation "RemoveCaseInsights" enabled + And new "RemoveCaseInsights" request + And request contains "case_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"insights": [{"ref": "/monitors/12345?q=total", "resource_id": "12345", "type": "SECURITY_SIGNAL"}]}, "type": "case"}} + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/case-management + Scenario: Remove insights from a case returns "OK" response + Given operation "RemoveCaseInsights" enabled + And new "RemoveCaseInsights" request + And request contains "case_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"insights": [{"ref": "/monitors/12345?q=total", "resource_id": "12345", "type": "SECURITY_SIGNAL"}]}, "type": "case"}} + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/case-management Scenario: Search cases returns "Bad Request" response Given new "SearchCases" request @@ -569,6 +1175,111 @@ Feature: Case Management When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/case-management + Scenario: Unfavorite a project returns "Bad Request" response + Given operation "UnfavoriteCaseProject" enabled + And new "UnfavoriteCaseProject" 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: Unfavorite a project returns "No Content" response + Given operation "UnfavoriteCaseProject" enabled + And new "UnfavoriteCaseProject" 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: Unfavorite a project returns "Not Found" response + Given operation "UnfavoriteCaseProject" enabled + And new "UnfavoriteCaseProject" 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: Unwatch a case returns "Bad Request" response + Given operation "UnwatchCase" enabled + And new "UnwatchCase" request + And request contains "case_id" parameter from "REPLACE.ME" + And request contains "user_uuid" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/case-management + Scenario: Unwatch a case returns "No Content" response + Given operation "UnwatchCase" enabled + And new "UnwatchCase" request + And request contains "case_id" parameter from "REPLACE.ME" + And request contains "user_uuid" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 204 No Content + + @generated @skip @team:DataDog/case-management + Scenario: Unwatch a case returns "Not Found" response + Given operation "UnwatchCase" enabled + And new "UnwatchCase" request + And request contains "case_id" parameter from "REPLACE.ME" + And request contains "user_uuid" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/case-management + Scenario: Update a case view returns "Bad Request" response + Given operation "UpdateCaseView" enabled + And new "UpdateCaseView" request + And request contains "view_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {}, "type": "view"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/case-management + Scenario: Update a case view returns "Not Found" response + Given operation "UpdateCaseView" enabled + And new "UpdateCaseView" request + And request contains "view_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {}, "type": "view"}} + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/case-management + Scenario: Update a case view returns "OK" response + Given operation "UpdateCaseView" enabled + And new "UpdateCaseView" request + And request contains "view_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {}, "type": "view"}} + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/case-management + Scenario: Update a maintenance window returns "Bad Request" response + Given operation "UpdateMaintenanceWindow" enabled + And new "UpdateMaintenanceWindow" request + And request contains "maintenance_window_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {}, "type": "maintenance_window"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/case-management + Scenario: Update a maintenance window returns "Not Found" response + Given operation "UpdateMaintenanceWindow" enabled + And new "UpdateMaintenanceWindow" request + And request contains "maintenance_window_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {}, "type": "maintenance_window"}} + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/case-management + Scenario: Update a maintenance window returns "OK" response + Given operation "UpdateMaintenanceWindow" enabled + And new "UpdateMaintenanceWindow" request + And request contains "maintenance_window_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {}, "type": "maintenance_window"}} + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/case-management Scenario: Update a notification rule returns "Bad Request" response Given new "UpdateProjectNotificationRule" request @@ -622,6 +1333,36 @@ Feature: Case Management And the response "data" has field "id" And the response "data.attributes.name" is equal to "Updated Project Name {{ unique }}" + @generated @skip @team:DataDog/case-management + Scenario: Update an automation rule returns "Bad Request" response + Given operation "UpdateCaseAutomationRule" enabled + And new "UpdateCaseAutomationRule" request + And request contains "project_id" parameter from "REPLACE.ME" + And request contains "rule_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"action": {"data": {"handle": "workflow-handle-123"}, "type": "execute_workflow"}, "name": "Auto-assign workflow", "state": "ENABLED", "trigger": {"data": {}, "type": "case_created"}}, "type": "rule"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/case-management + Scenario: Update an automation rule returns "Not Found" response + Given operation "UpdateCaseAutomationRule" enabled + And new "UpdateCaseAutomationRule" request + And request contains "project_id" parameter from "REPLACE.ME" + And request contains "rule_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"action": {"data": {"handle": "workflow-handle-123"}, "type": "execute_workflow"}, "name": "Auto-assign workflow", "state": "ENABLED", "trigger": {"data": {}, "type": "case_created"}}, "type": "rule"}} + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/case-management + Scenario: Update an automation rule returns "OK" response + Given operation "UpdateCaseAutomationRule" enabled + And new "UpdateCaseAutomationRule" request + And request contains "project_id" parameter from "REPLACE.ME" + And request contains "rule_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"action": {"data": {"handle": "workflow-handle-123"}, "type": "execute_workflow"}, "name": "Auto-assign workflow", "state": "ENABLED", "trigger": {"data": {}, "type": "case_created"}}, "type": "rule"}} + When the request is sent + Then the response status is 200 OK + @skip @team:DataDog/case-management Scenario: Update case attributes returns "Bad Request" response Given new "UpdateAttributes" request @@ -648,6 +1389,36 @@ Feature: Case Management When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/case-management + Scenario: Update case comment returns "Bad Request" response + Given operation "UpdateCaseComment" enabled + And new "UpdateCaseComment" request + And request contains "case_id" parameter from "REPLACE.ME" + And request contains "cell_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"comment": "Updated comment text"}, "type": "case"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/case-management + Scenario: Update case comment returns "Not Found" response + Given operation "UpdateCaseComment" enabled + And new "UpdateCaseComment" request + And request contains "case_id" parameter from "REPLACE.ME" + And request contains "cell_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"comment": "Updated comment text"}, "type": "case"}} + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/case-management + Scenario: Update case comment returns "OK" response + Given operation "UpdateCaseComment" enabled + And new "UpdateCaseComment" request + And request contains "case_id" parameter from "REPLACE.ME" + And request contains "cell_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"comment": "Updated comment text"}, "type": "case"}} + When the request is sent + Then the response status is 200 OK + @skip @team:DataDog/case-management Scenario: Update case custom attribute returns "Bad Request" response Given new "UpdateCaseCustomAttribute" request @@ -708,6 +1479,33 @@ Feature: Case Management When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/case-management + Scenario: Update case due date returns "Bad Request" response + Given operation "UpdateCaseDueDate" enabled + And new "UpdateCaseDueDate" request + And request contains "case_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"due_date": "2026-12-31"}, "type": "case"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/case-management + Scenario: Update case due date returns "Not Found" response + Given operation "UpdateCaseDueDate" enabled + And new "UpdateCaseDueDate" request + And request contains "case_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"due_date": "2026-12-31"}, "type": "case"}} + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/case-management + Scenario: Update case due date returns "OK" response + Given operation "UpdateCaseDueDate" enabled + And new "UpdateCaseDueDate" request + And request contains "case_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"due_date": "2026-12-31"}, "type": "case"}} + When the request is sent + Then the response status is 200 OK + @team:DataDog/case-management Scenario: Update case priority returns "Bad Request" response Given new "UpdatePriority" request @@ -762,6 +1560,33 @@ Feature: Case Management When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/case-management + Scenario: Update case resolved reason returns "Bad Request" response + Given operation "UpdateCaseResolvedReason" enabled + And new "UpdateCaseResolvedReason" request + And request contains "case_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"security_resolved_reason": "FALSE_POSITIVE"}, "type": "case"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/case-management + Scenario: Update case resolved reason returns "Not Found" response + Given operation "UpdateCaseResolvedReason" enabled + And new "UpdateCaseResolvedReason" request + And request contains "case_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"security_resolved_reason": "FALSE_POSITIVE"}, "type": "case"}} + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/case-management + Scenario: Update case resolved reason returns "OK" response + Given operation "UpdateCaseResolvedReason" enabled + And new "UpdateCaseResolvedReason" request + And request contains "case_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"security_resolved_reason": "FALSE_POSITIVE"}, "type": "case"}} + When the request is sent + Then the response status is 200 OK + @team:DataDog/case-management Scenario: Update case status returns "Bad Request" response Given new "UpdateStatus" request @@ -814,3 +1639,30 @@ Feature: Case Management And body with value {"data": {"attributes": {"title": "[UPDATED] Memory leak investigation on API"}, "type": "case"}} When the request is sent Then the response status is 200 OK + + @generated @skip @team:DataDog/case-management + Scenario: Watch a case returns "Bad Request" response + Given operation "WatchCase" enabled + And new "WatchCase" request + And request contains "case_id" parameter from "REPLACE.ME" + And request contains "user_uuid" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/case-management + Scenario: Watch a case returns "Created" response + Given operation "WatchCase" enabled + And new "WatchCase" request + And request contains "case_id" parameter from "REPLACE.ME" + And request contains "user_uuid" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 201 Created + + @generated @skip @team:DataDog/case-management + Scenario: Watch a case returns "Not Found" response + Given operation "WatchCase" enabled + And new "WatchCase" request + And request contains "case_id" parameter from "REPLACE.ME" + And request contains "user_uuid" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found diff --git a/src/test/resources/com/datadog/api/client/v2/api/case_management_attribute.feature b/src/test/resources/com/datadog/api/client/v2/api/case_management_attribute.feature index 3ac06e724b7..47806e809c0 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/case_management_attribute.feature +++ b/src/test/resources/com/datadog/api/client/v2/api/case_management_attribute.feature @@ -75,3 +75,33 @@ Feature: Case Management Attribute Given new "GetAllCustomAttributes" request When the request is sent Then the response status is 200 OK + + @generated @skip @team:DataDog/case-management + Scenario: Update custom attribute config returns "Bad Request" response + Given operation "UpdateCustomAttributeConfig" enabled + And new "UpdateCustomAttributeConfig" request + And request contains "case_type_id" parameter from "REPLACE.ME" + And request contains "custom_attribute_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"description": "Updated description.", "display_name": "AWS Region", "type": "NUMBER", "type_data": {"options": [{"value": "us-east-1"}]}}, "type": "custom_attribute"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/case-management + Scenario: Update custom attribute config returns "Not Found" response + Given operation "UpdateCustomAttributeConfig" enabled + And new "UpdateCustomAttributeConfig" request + And request contains "case_type_id" parameter from "REPLACE.ME" + And request contains "custom_attribute_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"description": "Updated description.", "display_name": "AWS Region", "type": "NUMBER", "type_data": {"options": [{"value": "us-east-1"}]}}, "type": "custom_attribute"}} + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/case-management + Scenario: Update custom attribute config returns "OK" response + Given operation "UpdateCustomAttributeConfig" enabled + And new "UpdateCustomAttributeConfig" request + And request contains "case_type_id" parameter from "REPLACE.ME" + And request contains "custom_attribute_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"description": "Updated description.", "display_name": "AWS Region", "type": "NUMBER", "type_data": {"options": [{"value": "us-east-1"}]}}, "type": "custom_attribute"}} + When the request is sent + Then the response status is 200 OK diff --git a/src/test/resources/com/datadog/api/client/v2/api/case_management_type.feature b/src/test/resources/com/datadog/api/client/v2/api/case_management_type.feature index 0773d7d241b..260ac3d3c42 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/case_management_type.feature +++ b/src/test/resources/com/datadog/api/client/v2/api/case_management_type.feature @@ -44,3 +44,30 @@ Feature: Case Management Type Given new "GetAllCaseTypes" request When the request is sent Then the response status is 200 OK + + @generated @skip @team:DataDog/case-management + Scenario: Update a case type returns "Bad Request" response + Given operation "UpdateCaseType" enabled + And new "UpdateCaseType" request + And request contains "case_type_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"description": "Investigations done in case management", "emoji": "\ud83d\udd75\ud83c\udffb\u200d\u2642\ufe0f", "name": "Investigation"}, "type": "case_type"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/case-management + Scenario: Update a case type returns "Not Found" response + Given operation "UpdateCaseType" enabled + And new "UpdateCaseType" request + And request contains "case_type_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"description": "Investigations done in case management", "emoji": "\ud83d\udd75\ud83c\udffb\u200d\u2642\ufe0f", "name": "Investigation"}, "type": "case_type"}} + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/case-management + Scenario: Update a case type returns "OK" response + Given operation "UpdateCaseType" enabled + And new "UpdateCaseType" request + And request contains "case_type_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"description": "Investigations done in case management", "emoji": "\ud83d\udd75\ud83c\udffb\u200d\u2642\ufe0f", "name": "Investigation"}, "type": "case_type"}} + When the request is sent + Then the response status is 200 OK diff --git a/src/test/resources/com/datadog/api/client/v2/api/cloud_cost_management.feature b/src/test/resources/com/datadog/api/client/v2/api/cloud_cost_management.feature index 578dbb42001..ca812cbdf37 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/cloud_cost_management.feature +++ b/src/test/resources/com/datadog/api/client/v2/api/cloud_cost_management.feature @@ -190,6 +190,20 @@ Feature: Cloud Cost Management When the request is sent Then the response status is 404 Not Found + @generated @skip @team:DataDog/cloud-cost-management + Scenario: Delete a Cloud Cost Management tag description returns "Bad Request" response + Given new "DeleteCostTagDescriptionByKey" request + And request contains "tag_key" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/cloud-cost-management + Scenario: Delete a Cloud Cost Management tag description returns "No Content" response + Given new "DeleteCostTagDescriptionByKey" request + And request contains "tag_key" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 204 No Content + @team:DataDog/cloud-cost-management Scenario: Delete a budget returns "Bad Request" response Given new "DeleteBudget" request @@ -218,6 +232,20 @@ Feature: Cloud Cost Management When the request is sent Then the response status is 204 No Content + @generated @skip @team:DataDog/cloud-cost-management + Scenario: Generate a Cloud Cost Management tag description returns "Bad Request" response + Given new "GenerateCostTagDescriptionByKey" request + And request contains "tag_key" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/cloud-cost-management + Scenario: Generate a Cloud Cost Management tag description returns "OK" response + Given new "GenerateCostTagDescriptionByKey" request + And request contains "tag_key" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + @replay-only @team:DataDog/cloud-cost-management Scenario: Get Custom Costs File returns "OK" response Given new "GetCustomCostsFile" request @@ -250,6 +278,27 @@ Feature: Cloud Cost Management And the response "data.type" is equal to "gcp_uc_config" And the response "data.attributes.account_id" is equal to "123456_ABCDEF_123ABC" + @generated @skip @team:DataDog/cloud-cost-management + Scenario: Get a Cloud Cost Management tag description returns "Bad Request" response + Given new "GetCostTagDescriptionByKey" request + And request contains "tag_key" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/cloud-cost-management + Scenario: Get a Cloud Cost Management tag description returns "Not Found" response + Given new "GetCostTagDescriptionByKey" request + And request contains "tag_key" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/cloud-cost-management + Scenario: Get a Cloud Cost Management tag description returns "OK" response + Given new "GetCostTagDescriptionByKey" request + And request contains "tag_key" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/cloud-cost-management Scenario: Get a Cloud Cost Management tag key returns "Bad Request" response Given new "GetCostTagKey" request @@ -849,6 +898,22 @@ Feature: Cloud Cost Management When the request is sent Then the response status is 400 Bad Request + @generated @skip @team:DataDog/cloud-cost-management + Scenario: Upsert a Cloud Cost Management tag description returns "Bad Request" response + Given new "UpsertCostTagDescriptionByKey" request + And request contains "tag_key" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"cloud": "aws", "description": "AWS account that owns this cost."}, "id": "account_id", "type": "cost_tag_description"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/cloud-cost-management + Scenario: Upsert a Cloud Cost Management tag description returns "No Content" response + Given new "UpsertCostTagDescriptionByKey" request + And request contains "tag_key" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"cloud": "aws", "description": "AWS account that owns this cost."}, "id": "account_id", "type": "cost_tag_description"}} + When the request is sent + Then the response status is 204 No Content + @generated @skip @team:DataDog/cloud-cost-management Scenario: Validate CSV budget returns "OK" response Given new "ValidateCsvBudget" request diff --git a/src/test/resources/com/datadog/api/client/v2/api/undo.json b/src/test/resources/com/datadog/api/client/v2/api/undo.json index 5340dfec4c3..7e4c14fee2e 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/undo.json +++ b/src/test/resources/com/datadog/api/client/v2/api/undo.json @@ -790,6 +790,49 @@ "type": "safe" } }, + "AggregateCases": { + "tag": "Case Management", + "undo": { + "type": "safe" + } + }, + "BulkUpdateCases": { + "tag": "Case Management", + "undo": { + "type": "safe" + } + }, + "CountCases": { + "tag": "Case Management", + "undo": { + "type": "safe" + } + }, + "ListCaseLinks": { + "tag": "Case Management", + "undo": { + "type": "safe" + } + }, + "CreateCaseLink": { + "tag": "Case Management", + "undo": { + "operationId": "DeleteCaseLink", + "parameters": [ + { + "name": "link_id", + "source": "data.id" + } + ], + "type": "unsafe" + } + }, + "DeleteCaseLink": { + "tag": "Case Management", + "undo": { + "type": "idempotent" + } + }, "GetProjects": { "tag": "Case Management", "undo": { @@ -809,6 +852,12 @@ "type": "unsafe" } }, + "ListUserCaseProjectFavorites": { + "tag": "Case Management", + "undo": { + "type": "safe" + } + }, "DeleteProject": { "tag": "Case Management", "undo": { @@ -827,6 +876,25 @@ "type": "idempotent" } }, + "UnfavoriteCaseProject": { + "tag": "Case Management", + "undo": { + "type": "idempotent" + } + }, + "FavoriteCaseProject": { + "tag": "Case Management", + "undo": { + "operationId": "UnfavoriteCaseProject", + "parameters": [ + { + "name": "project_id", + "source": "path.project_id" + } + ], + "type": "unsafe" + } + }, "GetProjectNotificationRules": { "tag": "Case Management", "undo": { @@ -862,6 +930,59 @@ "type": "idempotent" } }, + "ListCaseAutomationRules": { + "tag": "Case Management", + "undo": { + "type": "safe" + } + }, + "CreateCaseAutomationRule": { + "tag": "Case Management", + "undo": { + "operationId": "DeleteCaseAutomationRule", + "parameters": [ + { + "name": "project_id", + "source": "path.project_id" + }, + { + "name": "rule_id", + "source": "data.id" + } + ], + "type": "unsafe" + } + }, + "DeleteCaseAutomationRule": { + "tag": "Case Management", + "undo": { + "type": "idempotent" + } + }, + "GetCaseAutomationRule": { + "tag": "Case Management", + "undo": { + "type": "safe" + } + }, + "UpdateCaseAutomationRule": { + "tag": "Case Management", + "undo": { + "type": "idempotent" + } + }, + "DisableCaseAutomationRule": { + "tag": "Case Management", + "undo": { + "type": "idempotent" + } + }, + "EnableCaseAutomationRule": { + "tag": "Case Management", + "undo": { + "type": "idempotent" + } + }, "GetAllCaseTypes": { "tag": "Case Management Type", "undo": { @@ -886,6 +1007,12 @@ "type": "idempotent" } }, + "UpdateCaseType": { + "tag": "Case Management Type", + "undo": { + "type": "idempotent" + } + }, "GetAllCustomAttributeConfigsByCaseType": { "tag": "Case Management Attribute", "undo": { @@ -904,6 +1031,49 @@ "type": "idempotent" } }, + "UpdateCustomAttributeConfig": { + "tag": "Case Management Attribute", + "undo": { + "type": "idempotent" + } + }, + "ListCaseViews": { + "tag": "Case Management", + "undo": { + "type": "safe" + } + }, + "CreateCaseView": { + "tag": "Case Management", + "undo": { + "operationId": "DeleteCaseView", + "parameters": [ + { + "name": "view_id", + "source": "data.id" + } + ], + "type": "unsafe" + } + }, + "DeleteCaseView": { + "tag": "Case Management", + "undo": { + "type": "idempotent" + } + }, + "GetCaseView": { + "tag": "Case Management", + "undo": { + "type": "safe" + } + }, + "UpdateCaseView": { + "tag": "Case Management", + "undo": { + "type": "idempotent" + } + }, "GetCase": { "tag": "Case Management", "undo": { @@ -940,6 +1110,12 @@ "type": "idempotent" } }, + "UpdateCaseComment": { + "tag": "Case Management", + "undo": { + "type": "idempotent" + } + }, "DeleteCaseCustomAttribute": { "tag": "Case Management", "undo": { @@ -958,6 +1134,24 @@ "type": "idempotent" } }, + "UpdateCaseDueDate": { + "tag": "Case Management", + "undo": { + "type": "idempotent" + } + }, + "RemoveCaseInsights": { + "tag": "Case Management", + "undo": { + "type": "idempotent" + } + }, + "AddCaseInsights": { + "tag": "Case Management", + "undo": { + "type": "safe" + } + }, "UpdatePriority": { "tag": "Case Management", "undo": { @@ -1014,12 +1208,24 @@ "type": "unsafe" } }, + "UpdateCaseResolvedReason": { + "tag": "Case Management", + "undo": { + "type": "idempotent" + } + }, "UpdateStatus": { "tag": "Case Management", "undo": { "type": "idempotent" } }, + "ListCaseTimeline": { + "tag": "Case Management", + "undo": { + "type": "safe" + } + }, "UpdateCaseTitle": { "tag": "Case Management", "undo": { @@ -1038,6 +1244,35 @@ "type": "idempotent" } }, + "ListCaseWatchers": { + "tag": "Case Management", + "undo": { + "type": "safe" + } + }, + "UnwatchCase": { + "tag": "Case Management", + "undo": { + "type": "idempotent" + } + }, + "WatchCase": { + "tag": "Case Management", + "undo": { + "operationId": "UnwatchCase", + "parameters": [ + { + "name": "case_id", + "source": "path.case_id" + }, + { + "name": "user_uuid", + "source": "path.user_uuid" + } + ], + "type": "unsafe" + } + }, "ListCatalogEntity": { "tag": "Software Catalog", "undo": { @@ -1597,6 +1832,30 @@ "type": "safe" } }, + "DeleteCostTagDescriptionByKey": { + "tag": "Cloud Cost Management", + "undo": { + "type": "idempotent" + } + }, + "GetCostTagDescriptionByKey": { + "tag": "Cloud Cost Management", + "undo": { + "type": "safe" + } + }, + "UpsertCostTagDescriptionByKey": { + "tag": "Cloud Cost Management", + "undo": { + "type": "idempotent" + } + }, + "GenerateCostTagDescriptionByKey": { + "tag": "Cloud Cost Management", + "undo": { + "type": "safe" + } + }, "ListCostTagKeys": { "tag": "Cloud Cost Management", "undo": { @@ -3864,6 +4123,37 @@ "type": "safe" } }, + "ListMaintenanceWindows": { + "tag": "Case Management", + "undo": { + "type": "safe" + } + }, + "CreateMaintenanceWindow": { + "tag": "Case Management", + "undo": { + "operationId": "DeleteMaintenanceWindow", + "parameters": [ + { + "name": "maintenance_window_id", + "source": "data.id" + } + ], + "type": "unsafe" + } + }, + "DeleteMaintenanceWindow": { + "tag": "Case Management", + "undo": { + "type": "idempotent" + } + }, + "UpdateMaintenanceWindow": { + "tag": "Case Management", + "undo": { + "type": "idempotent" + } + }, "ListTagConfigurations": { "tag": "Metrics", "undo": {