From f67504a38acd059893d73d45053cdc67e7154a7c Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Thu, 29 Jan 2026 13:01:01 +0000 Subject: [PATCH] Regenerate client from commit 26ef048 of spec repo --- .generator/schemas/v2/openapi.yaml | 812 +++++++++++++++++- docs/datadog_api_client.v2.model.rst | 336 ++++++++ examples/v2/case-management/CreateProject.py | 1 + .../CreateProjectNotificationRule.py | 42 + .../DeleteProjectNotificationRule.py | 14 + .../GetProjectNotificationRules.py | 15 + examples/v2/case-management/UpdateProject.py | 26 + .../UpdateProjectNotificationRule.py | 41 + .../v2/api/case_management_api.py | 251 ++++++ src/datadog_api_client/v2/model/any_value.py | 42 + .../v2/model/any_value_item.py | 36 + .../v2/model/any_value_object.py | 15 + .../v2/model/auto_close_inactive_cases.py | 48 ++ .../model/auto_transition_assigned_cases.py | 36 + .../v2/model/case_notification_rule.py | 56 ++ .../case_notification_rule_attributes.py | 72 ++ .../v2/model/case_notification_rule_create.py | 54 ++ ...ase_notification_rule_create_attributes.py | 71 ++ .../case_notification_rule_create_request.py | 40 + .../model/case_notification_rule_recipient.py | 54 ++ .../case_notification_rule_recipient_data.py | 136 +++ .../case_notification_rule_resource_type.py | 35 + .../model/case_notification_rule_response.py | 42 + .../model/case_notification_rule_trigger.py | 54 ++ .../case_notification_rule_trigger_data.py | 80 ++ .../v2/model/case_notification_rule_update.py | 56 ++ .../case_notification_rule_update_request.py | 40 + .../model/case_notification_rules_response.py | 42 + .../v2/model/integration_incident.py | 92 ++ ...tegration_incident_field_mappings_items.py | 48 ++ .../integration_incident_severity_config.py | 36 + .../v2/model/integration_jira.py | 74 ++ .../model/integration_jira_auto_creation.py | 36 + .../v2/model/integration_jira_metadata.py | 56 ++ .../v2/model/integration_jira_sync.py | 54 ++ .../model/integration_jira_sync_due_date.py | 45 + .../model/integration_jira_sync_properties.py | 114 +++ ...ies_custom_fields_additional_properties.py | 63 ++ .../v2/model/integration_monitor.py | 64 ++ .../v2/model/integration_on_call.py | 66 ++ ...ration_on_call_escalation_queries_items.py | 74 ++ ...on_call_escalation_queries_items_target.py | 56 ++ .../v2/model/integration_service_now.py | 80 ++ .../integration_service_now_auto_creation.py | 36 + .../integration_service_now_sync_config.py | 58 ++ ..._service_now_sync_config139772721534496.py | 70 ++ ...ration_service_now_sync_config_priority.py | 56 ++ .../v2/model/project_attributes.py | 49 +- .../v2/model/project_columns_config.py | 42 + .../project_columns_config_columns_items.py | 66 ++ ...oject_columns_config_columns_items_sort.py | 43 + .../v2/model/project_create_attributes.py | 28 +- .../v2/model/project_notification_settings.py | 104 +++ .../v2/model/project_settings.py | 116 +++ .../v2/model/project_update.py | 53 ++ .../v2/model/project_update_attributes.py | 80 ++ .../v2/model/project_update_request.py | 40 + .../v2/model/sync_property.py | 36 + .../v2/model/sync_property_with_mapping.py | 56 ++ src/datadog_api_client/v2/models/__init__.py | 106 +++ ...roject_returns_bad_request_response.frozen | 1 + ..._project_returns_bad_request_response.yaml | 21 + ..._project_returns_not_found_response.frozen | 1 + ..._a_project_returns_not_found_response.yaml | 21 + ...pdate_a_project_returns_ok_response.frozen | 1 + ..._update_a_project_returns_ok_response.yaml | 21 + tests/v2/features/case_management.feature | 120 ++- tests/v2/features/given.json | 30 + tests/v2/features/undo.json | 41 + 69 files changed, 4793 insertions(+), 8 deletions(-) create mode 100644 examples/v2/case-management/CreateProjectNotificationRule.py create mode 100644 examples/v2/case-management/DeleteProjectNotificationRule.py create mode 100644 examples/v2/case-management/GetProjectNotificationRules.py create mode 100644 examples/v2/case-management/UpdateProject.py create mode 100644 examples/v2/case-management/UpdateProjectNotificationRule.py create mode 100644 src/datadog_api_client/v2/model/any_value.py create mode 100644 src/datadog_api_client/v2/model/any_value_item.py create mode 100644 src/datadog_api_client/v2/model/any_value_object.py create mode 100644 src/datadog_api_client/v2/model/auto_close_inactive_cases.py create mode 100644 src/datadog_api_client/v2/model/auto_transition_assigned_cases.py create mode 100644 src/datadog_api_client/v2/model/case_notification_rule.py create mode 100644 src/datadog_api_client/v2/model/case_notification_rule_attributes.py create mode 100644 src/datadog_api_client/v2/model/case_notification_rule_create.py create mode 100644 src/datadog_api_client/v2/model/case_notification_rule_create_attributes.py create mode 100644 src/datadog_api_client/v2/model/case_notification_rule_create_request.py create mode 100644 src/datadog_api_client/v2/model/case_notification_rule_recipient.py create mode 100644 src/datadog_api_client/v2/model/case_notification_rule_recipient_data.py create mode 100644 src/datadog_api_client/v2/model/case_notification_rule_resource_type.py create mode 100644 src/datadog_api_client/v2/model/case_notification_rule_response.py create mode 100644 src/datadog_api_client/v2/model/case_notification_rule_trigger.py create mode 100644 src/datadog_api_client/v2/model/case_notification_rule_trigger_data.py create mode 100644 src/datadog_api_client/v2/model/case_notification_rule_update.py create mode 100644 src/datadog_api_client/v2/model/case_notification_rule_update_request.py create mode 100644 src/datadog_api_client/v2/model/case_notification_rules_response.py create mode 100644 src/datadog_api_client/v2/model/integration_incident.py create mode 100644 src/datadog_api_client/v2/model/integration_incident_field_mappings_items.py create mode 100644 src/datadog_api_client/v2/model/integration_incident_severity_config.py create mode 100644 src/datadog_api_client/v2/model/integration_jira.py create mode 100644 src/datadog_api_client/v2/model/integration_jira_auto_creation.py create mode 100644 src/datadog_api_client/v2/model/integration_jira_metadata.py create mode 100644 src/datadog_api_client/v2/model/integration_jira_sync.py create mode 100644 src/datadog_api_client/v2/model/integration_jira_sync_due_date.py create mode 100644 src/datadog_api_client/v2/model/integration_jira_sync_properties.py create mode 100644 src/datadog_api_client/v2/model/integration_jira_sync_properties_custom_fields_additional_properties.py create mode 100644 src/datadog_api_client/v2/model/integration_monitor.py create mode 100644 src/datadog_api_client/v2/model/integration_on_call.py create mode 100644 src/datadog_api_client/v2/model/integration_on_call_escalation_queries_items.py create mode 100644 src/datadog_api_client/v2/model/integration_on_call_escalation_queries_items_target.py create mode 100644 src/datadog_api_client/v2/model/integration_service_now.py create mode 100644 src/datadog_api_client/v2/model/integration_service_now_auto_creation.py create mode 100644 src/datadog_api_client/v2/model/integration_service_now_sync_config.py create mode 100644 src/datadog_api_client/v2/model/integration_service_now_sync_config139772721534496.py create mode 100644 src/datadog_api_client/v2/model/integration_service_now_sync_config_priority.py create mode 100644 src/datadog_api_client/v2/model/project_columns_config.py create mode 100644 src/datadog_api_client/v2/model/project_columns_config_columns_items.py create mode 100644 src/datadog_api_client/v2/model/project_columns_config_columns_items_sort.py create mode 100644 src/datadog_api_client/v2/model/project_notification_settings.py create mode 100644 src/datadog_api_client/v2/model/project_settings.py create mode 100644 src/datadog_api_client/v2/model/project_update.py create mode 100644 src/datadog_api_client/v2/model/project_update_attributes.py create mode 100644 src/datadog_api_client/v2/model/project_update_request.py create mode 100644 src/datadog_api_client/v2/model/sync_property.py create mode 100644 src/datadog_api_client/v2/model/sync_property_with_mapping.py create mode 100644 tests/v2/cassettes/test_scenarios/test_update_a_project_returns_bad_request_response.frozen create mode 100644 tests/v2/cassettes/test_scenarios/test_update_a_project_returns_bad_request_response.yaml create mode 100644 tests/v2/cassettes/test_scenarios/test_update_a_project_returns_not_found_response.frozen create mode 100644 tests/v2/cassettes/test_scenarios/test_update_a_project_returns_not_found_response.yaml create mode 100644 tests/v2/cassettes/test_scenarios/test_update_a_project_returns_ok_response.frozen create mode 100644 tests/v2/cassettes/test_scenarios/test_update_a_project_returns_ok_response.yaml diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 147e01bf6b..9a80dea5bb 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -764,6 +764,14 @@ components: required: false schema: type: string + NotificationRuleIDPathParameter: + description: Notification Rule UUID + example: e555e290-ed65-49bd-ae18-8acbfcf18db7 + in: path + name: notification_rule_id + required: true + schema: + type: string OnDemandTaskId: description: The UUID of the task. example: 6d09294c-9ad9-42fd-a759-a0c1599b4828 @@ -3198,6 +3206,36 @@ components: required: - type type: object + AnyValue: + description: Represents any valid JSON value. + nullable: true + oneOf: + - $ref: '#/components/schemas/AnyValueString' + - $ref: '#/components/schemas/AnyValueNumber' + - $ref: '#/components/schemas/AnyValueObject' + - $ref: '#/components/schemas/AnyValueArray' + - $ref: '#/components/schemas/AnyValueBoolean' + type: object + AnyValueArray: + items: + $ref: '#/components/schemas/AnyValueItem' + type: array + AnyValueBoolean: + type: boolean + AnyValueItem: + oneOf: + - $ref: '#/components/schemas/AnyValueString' + - $ref: '#/components/schemas/AnyValueNumber' + - $ref: '#/components/schemas/AnyValueObject' + - $ref: '#/components/schemas/AnyValueBoolean' + AnyValueNumber: + format: double + type: number + AnyValueObject: + additionalProperties: {} + type: object + AnyValueString: + type: string ApiID: description: API identifier. example: 90646597-5fdb-4a17-a240-647003f8c028 @@ -5960,6 +5998,24 @@ components: type: string x-enum-varnames: - AUTHN_MAPPINGS + AutoCloseInactiveCases: + description: Auto-close inactive cases settings + properties: + enabled: + description: Whether auto-close is enabled + type: boolean + max_inactive_time_in_secs: + description: Maximum inactive time in seconds before auto-closing + format: int64 + type: integer + type: object + AutoTransitionAssignedCases: + description: Auto-transition assigned cases settings + properties: + auto_transition_assigned_cases_on_self_assigned: + description: Whether to auto-transition cases when self-assigned + type: boolean + type: object AwsAccountId: description: The ID of the AWS account. example: '123456789012' @@ -9417,6 +9473,214 @@ components: type: string x-enum-varnames: - PROJECTS + CaseNotificationRule: + description: A notification rule for case management + properties: + attributes: + $ref: '#/components/schemas/CaseNotificationRuleAttributes' + id: + description: The notification rule's identifier + example: aeadc05e-98a8-11ec-ac2c-da7ad0900001 + type: string + type: + $ref: '#/components/schemas/CaseNotificationRuleResourceType' + required: + - id + - type + - attributes + type: object + CaseNotificationRuleAttributes: + description: Notification rule attributes + properties: + is_enabled: + description: Whether the notification rule is enabled + type: boolean + query: + description: Query to filter cases for this notification rule + type: string + recipients: + description: List of notification recipients + items: + $ref: '#/components/schemas/CaseNotificationRuleRecipient' + type: array + triggers: + description: List of triggers for this notification rule + items: + $ref: '#/components/schemas/CaseNotificationRuleTrigger' + type: array + type: object + CaseNotificationRuleCreate: + description: Notification rule create + properties: + attributes: + $ref: '#/components/schemas/CaseNotificationRuleCreateAttributes' + type: + $ref: '#/components/schemas/CaseNotificationRuleResourceType' + required: + - attributes + - type + type: object + CaseNotificationRuleCreateAttributes: + description: Notification rule creation attributes + properties: + is_enabled: + default: true + description: Whether the notification rule is enabled + type: boolean + query: + description: Query to filter cases for this notification rule + type: string + recipients: + description: List of notification recipients + items: + $ref: '#/components/schemas/CaseNotificationRuleRecipient' + type: array + triggers: + description: List of triggers for this notification rule + items: + $ref: '#/components/schemas/CaseNotificationRuleTrigger' + type: array + required: + - recipients + - triggers + type: object + CaseNotificationRuleCreateRequest: + description: Notification rule create request + properties: + data: + $ref: '#/components/schemas/CaseNotificationRuleCreate' + required: + - data + type: object + CaseNotificationRuleRecipient: + description: Notification rule recipient + properties: + data: + $ref: '#/components/schemas/CaseNotificationRuleRecipientData' + type: + description: Type of recipient (SLACK_CHANNEL, EMAIL, HTTP, PAGERDUTY_SERVICE, + MS_TEAMS_CHANNEL) + example: EMAIL + type: string + type: object + CaseNotificationRuleRecipientData: + description: Recipient data + properties: + channel: + description: Slack channel name + type: string + channel_id: + description: Slack channel ID + type: string + channel_name: + description: Microsoft Teams channel name + type: string + connector_name: + description: Microsoft Teams connector name + type: string + email: + description: Email address + type: string + name: + description: HTTP webhook name + type: string + service_name: + description: PagerDuty service name + type: string + team_id: + description: Microsoft Teams team ID + type: string + team_name: + description: Microsoft Teams team name + type: string + tenant_id: + description: Microsoft Teams tenant ID + type: string + tenant_name: + description: Microsoft Teams tenant name + type: string + workspace: + description: Slack workspace name + type: string + workspace_id: + description: Slack workspace ID + type: string + type: object + CaseNotificationRuleResourceType: + default: notification_rule + description: Notification rule resource type + enum: + - notification_rule + example: notification_rule + type: string + x-enum-varnames: + - NOTIFICATION_RULE + CaseNotificationRuleResponse: + description: Notification rule response + properties: + data: + $ref: '#/components/schemas/CaseNotificationRule' + type: object + CaseNotificationRuleTrigger: + description: Notification rule trigger + properties: + data: + $ref: '#/components/schemas/CaseNotificationRuleTriggerData' + type: + description: Type of trigger (CASE_CREATED, STATUS_TRANSITIONED, ATTRIBUTE_VALUE_CHANGED, + EVENT_CORRELATION_SIGNAL_CORRELATED) + example: CASE_CREATED + type: string + type: object + CaseNotificationRuleTriggerData: + description: Trigger data + properties: + change_type: + description: Change type (added, removed, changed) + type: string + field: + description: Field name for attribute value changed trigger + type: string + from_status: + description: Status ID to transition from + type: string + from_status_name: + description: Status name to transition from + type: string + to_status: + description: Status ID to transition to + type: string + to_status_name: + description: Status name to transition to + type: string + type: object + CaseNotificationRuleUpdate: + description: Notification rule update + properties: + attributes: + $ref: '#/components/schemas/CaseNotificationRuleAttributes' + type: + $ref: '#/components/schemas/CaseNotificationRuleResourceType' + required: + - type + type: object + CaseNotificationRuleUpdateRequest: + description: Notification rule update request + properties: + data: + $ref: '#/components/schemas/CaseNotificationRuleUpdate' + required: + - data + type: object + CaseNotificationRulesResponse: + description: Response with notification rules + properties: + data: + description: Notification rules data + items: + $ref: '#/components/schemas/CaseNotificationRule' + type: array + type: object CaseObjectAttributes: additionalProperties: items: @@ -30458,6 +30722,212 @@ components: type: string type: array type: object + IntegrationIncident: + description: Incident integration settings + properties: + auto_escalation_query: + description: Query for auto-escalation + type: string + default_incident_commander: + description: Default incident commander + type: string + enabled: + description: Whether incident integration is enabled + type: boolean + field_mappings: + items: + $ref: '#/components/schemas/IntegrationIncidentFieldMappingsItems' + type: array + incident_type: + description: Incident type + type: string + severity_config: + $ref: '#/components/schemas/IntegrationIncidentSeverityConfig' + type: object + IntegrationIncidentFieldMappingsItems: + properties: + case_field: + type: string + incident_user_defined_field_id: + type: string + type: object + IntegrationIncidentSeverityConfig: + properties: + priority_mapping: + additionalProperties: + type: string + type: object + type: object + IntegrationJira: + description: Jira integration settings + properties: + auto_creation: + $ref: '#/components/schemas/IntegrationJiraAutoCreation' + enabled: + description: Whether Jira integration is enabled + type: boolean + metadata: + $ref: '#/components/schemas/IntegrationJiraMetadata' + sync: + $ref: '#/components/schemas/IntegrationJiraSync' + type: object + IntegrationJiraAutoCreation: + properties: + enabled: + type: boolean + type: object + IntegrationJiraMetadata: + properties: + account_id: + type: string + issue_type_id: + type: string + project_id: + type: string + type: object + IntegrationJiraSync: + properties: + enabled: + type: boolean + properties: + $ref: '#/components/schemas/IntegrationJiraSyncProperties' + type: object + IntegrationJiraSyncDueDate: + properties: + jira_field_id: + type: string + sync_type: + type: string + type: object + IntegrationJiraSyncProperties: + properties: + assignee: + $ref: '#/components/schemas/SyncProperty' + comments: + $ref: '#/components/schemas/SyncProperty' + custom_fields: + additionalProperties: + $ref: '#/components/schemas/IntegrationJiraSyncPropertiesCustomFieldsAdditionalProperties' + type: object + description: + $ref: '#/components/schemas/SyncProperty' + due_date: + $ref: '#/components/schemas/IntegrationJiraSyncDueDate' + priority: + $ref: '#/components/schemas/SyncPropertyWithMapping' + status: + $ref: '#/components/schemas/SyncPropertyWithMapping' + title: + $ref: '#/components/schemas/SyncProperty' + type: object + IntegrationJiraSyncPropertiesCustomFieldsAdditionalProperties: + properties: + sync_type: + type: string + value: + $ref: '#/components/schemas/AnyValue' + type: object + IntegrationMonitor: + description: Monitor integration settings + properties: + auto_resolve_enabled: + description: Whether auto-resolve is enabled + type: boolean + case_type_id: + description: Case type ID for monitor integration + type: string + enabled: + description: Whether monitor integration is enabled + type: boolean + handle: + description: Monitor handle + type: string + type: object + IntegrationOnCall: + description: On-Call integration settings + properties: + auto_assign_on_call: + description: Whether to auto-assign on-call + type: boolean + enabled: + description: Whether On-Call integration is enabled + type: boolean + escalation_queries: + items: + $ref: '#/components/schemas/IntegrationOnCallEscalationQueriesItems' + type: array + type: object + IntegrationOnCallEscalationQueriesItems: + properties: + enabled: + type: boolean + id: + type: string + query: + type: string + target: + $ref: '#/components/schemas/IntegrationOnCallEscalationQueriesItemsTarget' + type: object + IntegrationOnCallEscalationQueriesItemsTarget: + properties: + dynamic_team_paging: + type: boolean + team_id: + type: string + user_id: + type: string + type: object + IntegrationServiceNow: + description: ServiceNow integration settings + properties: + assignment_group: + description: Assignment group + type: string + auto_creation: + $ref: '#/components/schemas/IntegrationServiceNowAutoCreation' + enabled: + description: Whether ServiceNow integration is enabled + type: boolean + instance_name: + description: ServiceNow instance name + type: string + sync_config: + $ref: '#/components/schemas/IntegrationServiceNowSyncConfig' + type: object + IntegrationServiceNowAutoCreation: + properties: + enabled: + type: boolean + type: object + IntegrationServiceNowSyncConfig: + properties: + enabled: + type: boolean + properties: + $ref: '#/components/schemas/IntegrationServiceNowSyncConfig139772721534496' + type: object + IntegrationServiceNowSyncConfig139772721534496: + properties: + comments: + $ref: '#/components/schemas/SyncProperty' + priority: + $ref: '#/components/schemas/IntegrationServiceNowSyncConfigPriority' + status: + $ref: '#/components/schemas/SyncPropertyWithMapping' + type: object + IntegrationServiceNowSyncConfigPriority: + properties: + impact_mapping: + additionalProperties: + type: string + type: object + sync_type: + type: string + urgency_mapping: + additionalProperties: + type: string + type: object + type: object InterfaceAttributes: description: The interface attributes properties: @@ -44797,14 +45267,52 @@ components: ProjectAttributes: description: Project attributes properties: + columns_config: + $ref: '#/components/schemas/ProjectColumnsConfig' + enabled_custom_case_types: + description: List of enabled custom case type IDs + items: + type: string + type: array key: description: The project's key example: CASEM type: string name: description: Project's name + example: Security Investigation + type: string + restricted: + description: Whether the project is restricted + type: boolean + settings: + $ref: '#/components/schemas/ProjectSettings' + type: object + ProjectColumnsConfig: + description: Project columns configuration + properties: + columns: + items: + $ref: '#/components/schemas/ProjectColumnsConfigColumnsItems' + type: array + type: object + ProjectColumnsConfigColumnsItems: + properties: + sort: + $ref: '#/components/schemas/ProjectColumnsConfigColumnsItemsSort' + sort_field: + type: string + type: type: string type: object + ProjectColumnsConfigColumnsItemsSort: + properties: + ascending: + type: boolean + priority: + format: int64 + type: integer + type: object ProjectCreate: description: Project create properties: @@ -44819,14 +45327,22 @@ components: ProjectCreateAttributes: description: Project creation attributes properties: + enabled_custom_case_types: + description: List of enabled custom case type IDs + items: + type: string + type: array key: description: Project's key. Cannot be "CASE" example: SEC type: string name: - description: name + description: Project name example: Security Investigation type: string + team_uuid: + description: Team UUID to associate with the project + type: string required: - name - key @@ -44839,6 +45355,32 @@ components: required: - data type: object + ProjectNotificationSettings: + description: Project notification settings + properties: + destinations: + description: Notification destinations (1=email, 2=slack, 3=in-app) + items: + type: integer + type: array + enabled: + description: Whether notifications are enabled + type: boolean + notify_on_case_assignment: + type: boolean + notify_on_case_closed: + type: boolean + notify_on_case_comment: + type: boolean + notify_on_case_comment_mention: + type: boolean + notify_on_case_priority_change: + type: boolean + notify_on_case_status_change: + type: boolean + notify_on_case_unassignment: + type: boolean + type: object ProjectRelationship: description: Relationship to project properties: @@ -44883,6 +45425,63 @@ components: data: $ref: '#/components/schemas/Project' type: object + ProjectSettings: + description: Project settings + properties: + auto_close_inactive_cases: + $ref: '#/components/schemas/AutoCloseInactiveCases' + auto_transition_assigned_cases: + $ref: '#/components/schemas/AutoTransitionAssignedCases' + integration_incident: + $ref: '#/components/schemas/IntegrationIncident' + integration_jira: + $ref: '#/components/schemas/IntegrationJira' + integration_monitor: + $ref: '#/components/schemas/IntegrationMonitor' + integration_on_call: + $ref: '#/components/schemas/IntegrationOnCall' + integration_service_now: + $ref: '#/components/schemas/IntegrationServiceNow' + notification: + $ref: '#/components/schemas/ProjectNotificationSettings' + type: object + ProjectUpdate: + description: Project update + properties: + attributes: + $ref: '#/components/schemas/ProjectUpdateAttributes' + type: + $ref: '#/components/schemas/ProjectResourceType' + required: + - type + type: object + ProjectUpdateAttributes: + description: Project update attributes + properties: + columns_config: + $ref: '#/components/schemas/ProjectColumnsConfig' + enabled_custom_case_types: + description: List of enabled custom case type IDs + items: + type: string + type: array + name: + description: Project name + type: string + settings: + $ref: '#/components/schemas/ProjectSettings' + team_uuid: + description: Team UUID to associate with the project + type: string + type: object + ProjectUpdateRequest: + description: Project update request + properties: + data: + $ref: '#/components/schemas/ProjectUpdate' + required: + - data + type: object ProjectedCost: description: Projected Cost data. properties: @@ -59245,6 +59844,26 @@ components: suppression: $ref: '#/components/schemas/SecurityMonitoringSuppressionAttributes' type: object + SyncProperty: + description: Sync property configuration + properties: + sync_type: + type: string + type: object + SyncPropertyWithMapping: + description: Sync property with mapping configuration + properties: + mapping: + additionalProperties: + type: string + type: object + name_mapping: + additionalProperties: + type: string + type: object + sync_type: + type: string + type: object SyntheticsGlobalVariable: description: Synthetic global variable. properties: @@ -69566,6 +70185,197 @@ paths: summary: Get the details of a project tags: - Case Management + patch: + description: Update a project. + operationId: UpdateProject + parameters: + - $ref: '#/components/parameters/ProjectIDPathParameter' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ProjectUpdateRequest' + description: Project payload + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ProjectResponse' + 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 project + tags: + - Case Management + /api/v2/cases/projects/{project_id}/notification_rules: + get: + description: Get all notification rules for a project. + operationId: GetProjectNotificationRules + parameters: + - description: Project UUID + example: e555e290-ed65-49bd-ae18-8acbfcf18db7 + in: path + name: project_id + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/CaseNotificationRulesResponse' + 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 notification rules + tags: + - Case Management + post: + description: Create a notification rule for a project. + operationId: CreateProjectNotificationRule + parameters: + - description: Project UUID + example: e555e290-ed65-49bd-ae18-8acbfcf18db7 + in: path + name: project_id + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CaseNotificationRuleCreateRequest' + description: Notification rule payload + required: true + responses: + '201': + content: + application/json: + schema: + $ref: '#/components/schemas/CaseNotificationRuleResponse' + 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 notification rule + tags: + - Case Management + /api/v2/cases/projects/{project_id}/notification_rules/{notification_rule_id}: + delete: + description: Delete a notification rule using the notification rule's `id`. + operationId: DeleteProjectNotificationRule + parameters: + - description: Project UUID + example: e555e290-ed65-49bd-ae18-8acbfcf18db7 + in: path + name: project_id + required: true + schema: + type: string + - $ref: '#/components/parameters/NotificationRuleIDPathParameter' + responses: + '204': + description: No Content + '403': + $ref: '#/components/responses/ForbiddenResponse' + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: API error response + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - cases_write + summary: Delete a notification rule + tags: + - Case Management + put: + description: Update a notification rule. + operationId: UpdateProjectNotificationRule + parameters: + - description: Project UUID + example: e555e290-ed65-49bd-ae18-8acbfcf18db7 + in: path + name: project_id + required: true + schema: + type: string + - $ref: '#/components/parameters/NotificationRuleIDPathParameter' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CaseNotificationRuleUpdateRequest' + description: Notification rule payload + required: true + 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: Update a notification rule + tags: + - Case Management /api/v2/cases/types: get: description: Get all case types diff --git a/docs/datadog_api_client.v2.model.rst b/docs/datadog_api_client.v2.model.rst index 41d22bb2b4..e659e489a8 100644 --- a/docs/datadog_api_client.v2.model.rst +++ b/docs/datadog_api_client.v2.model.rst @@ -382,6 +382,27 @@ datadog\_api\_client.v2.model.anthropic\_integration\_update module :members: :show-inheritance: +datadog\_api\_client.v2.model.any\_value module +----------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.any_value + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.any\_value\_item module +----------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.any_value_item + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.any\_value\_object module +------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.any_value_object + :members: + :show-inheritance: + datadog\_api\_client.v2.model.api\_error\_response module --------------------------------------------------------- @@ -1579,6 +1600,20 @@ datadog\_api\_client.v2.model.authn\_mappings\_type module :members: :show-inheritance: +datadog\_api\_client.v2.model.auto\_close\_inactive\_cases module +----------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.auto_close_inactive_cases + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.auto\_transition\_assigned\_cases module +---------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.auto_transition_assigned_cases + :members: + :show-inheritance: + datadog\_api\_client.v2.model.aws\_account\_create\_request module ------------------------------------------------------------------ @@ -3021,6 +3056,104 @@ datadog\_api\_client.v2.model.case\_management\_project\_data\_type module :members: :show-inheritance: +datadog\_api\_client.v2.model.case\_notification\_rule module +------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.case_notification_rule + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.case\_notification\_rule\_attributes module +------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.case_notification_rule_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.case\_notification\_rule\_create module +--------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.case_notification_rule_create + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.case\_notification\_rule\_create\_attributes module +--------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.case_notification_rule_create_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.case\_notification\_rule\_create\_request module +------------------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.case_notification_rule_create_request + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.case\_notification\_rule\_recipient module +------------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.case_notification_rule_recipient + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.case\_notification\_rule\_recipient\_data module +------------------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.case_notification_rule_recipient_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.case\_notification\_rule\_resource\_type module +----------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.case_notification_rule_resource_type + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.case\_notification\_rule\_response module +----------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.case_notification_rule_response + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.case\_notification\_rule\_trigger module +---------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.case_notification_rule_trigger + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.case\_notification\_rule\_trigger\_data module +---------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.case_notification_rule_trigger_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.case\_notification\_rule\_update module +--------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.case_notification_rule_update + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.case\_notification\_rule\_update\_request module +------------------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.case_notification_rule_update_request + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.case\_notification\_rules\_response module +------------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.case_notification_rules_response + :members: + :show-inheritance: + datadog\_api\_client.v2.model.case\_object\_attributes module ------------------------------------------------------------- @@ -12898,6 +13031,139 @@ datadog\_api\_client.v2.model.intake\_payload\_accepted module :members: :show-inheritance: +datadog\_api\_client.v2.model.integration\_incident module +---------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.integration_incident + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.integration\_incident\_field\_mappings\_items module +---------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.integration_incident_field_mappings_items + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.integration\_incident\_severity\_config module +---------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.integration_incident_severity_config + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.integration\_jira module +------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.integration_jira + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.integration\_jira\_auto\_creation module +---------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.integration_jira_auto_creation + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.integration\_jira\_metadata module +---------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.integration_jira_metadata + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.integration\_jira\_sync module +------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.integration_jira_sync + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.integration\_jira\_sync\_due\_date module +----------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.integration_jira_sync_due_date + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.integration\_jira\_sync\_properties module +------------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.integration_jira_sync_properties + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.integration\_jira\_sync\_properties\_custom\_fields\_additional\_properties module +---------------------------------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.integration_jira_sync_properties_custom_fields_additional_properties + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.integration\_monitor module +--------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.integration_monitor + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.integration\_on\_call module +---------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.integration_on_call + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.integration\_on\_call\_escalation\_queries\_items module +-------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.integration_on_call_escalation_queries_items + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.integration\_on\_call\_escalation\_queries\_items\_target module +---------------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.integration_on_call_escalation_queries_items_target + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.integration\_service\_now module +-------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.integration_service_now + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.integration\_service\_now\_auto\_creation module +------------------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.integration_service_now_auto_creation + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.integration\_service\_now\_sync\_config module +---------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.integration_service_now_sync_config + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.integration\_service\_now\_sync\_config139772721534496 module +------------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.integration_service_now_sync_config139772721534496 + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.integration\_service\_now\_sync\_config\_priority module +-------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.integration_service_now_sync_config_priority + :members: + :show-inheritance: + datadog\_api\_client.v2.model.interface\_attributes module ---------------------------------------------------------- @@ -19443,6 +19709,27 @@ datadog\_api\_client.v2.model.project\_attributes module :members: :show-inheritance: +datadog\_api\_client.v2.model.project\_columns\_config module +------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.project_columns_config + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.project\_columns\_config\_columns\_items module +----------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.project_columns_config_columns_items + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.project\_columns\_config\_columns\_items\_sort module +----------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.project_columns_config_columns_items_sort + :members: + :show-inheritance: + datadog\_api\_client.v2.model.project\_create module ---------------------------------------------------- @@ -19464,6 +19751,13 @@ datadog\_api\_client.v2.model.project\_create\_request module :members: :show-inheritance: +datadog\_api\_client.v2.model.project\_notification\_settings module +-------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.project_notification_settings + :members: + :show-inheritance: + datadog\_api\_client.v2.model.project\_relationship module ---------------------------------------------------------- @@ -19499,6 +19793,34 @@ datadog\_api\_client.v2.model.project\_response module :members: :show-inheritance: +datadog\_api\_client.v2.model.project\_settings module +------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.project_settings + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.project\_update module +---------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.project_update + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.project\_update\_attributes module +---------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.project_update_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.project\_update\_request module +------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.project_update_request + :members: + :show-inheritance: + datadog\_api\_client.v2.model.projected\_cost module ---------------------------------------------------- @@ -25995,6 +26317,20 @@ datadog\_api\_client.v2.model.suppression\_versions module :members: :show-inheritance: +datadog\_api\_client.v2.model.sync\_property module +--------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.sync_property + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.sync\_property\_with\_mapping module +------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.sync_property_with_mapping + :members: + :show-inheritance: + datadog\_api\_client.v2.model.synthetics\_global\_variable module ----------------------------------------------------------------- diff --git a/examples/v2/case-management/CreateProject.py b/examples/v2/case-management/CreateProject.py index d9e42665a2..717f5ad724 100644 --- a/examples/v2/case-management/CreateProject.py +++ b/examples/v2/case-management/CreateProject.py @@ -12,6 +12,7 @@ body = ProjectCreateRequest( data=ProjectCreate( attributes=ProjectCreateAttributes( + enabled_custom_case_types=[], key="SEC", name="Security Investigation", ), diff --git a/examples/v2/case-management/CreateProjectNotificationRule.py b/examples/v2/case-management/CreateProjectNotificationRule.py new file mode 100644 index 0000000000..5ec4badcd4 --- /dev/null +++ b/examples/v2/case-management/CreateProjectNotificationRule.py @@ -0,0 +1,42 @@ +""" +Create a notification rule returns "CREATED" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.case_management_api import CaseManagementApi +from datadog_api_client.v2.model.case_notification_rule_create import CaseNotificationRuleCreate +from datadog_api_client.v2.model.case_notification_rule_create_attributes import CaseNotificationRuleCreateAttributes +from datadog_api_client.v2.model.case_notification_rule_create_request import CaseNotificationRuleCreateRequest +from datadog_api_client.v2.model.case_notification_rule_recipient import CaseNotificationRuleRecipient +from datadog_api_client.v2.model.case_notification_rule_recipient_data import CaseNotificationRuleRecipientData +from datadog_api_client.v2.model.case_notification_rule_resource_type import CaseNotificationRuleResourceType +from datadog_api_client.v2.model.case_notification_rule_trigger import CaseNotificationRuleTrigger +from datadog_api_client.v2.model.case_notification_rule_trigger_data import CaseNotificationRuleTriggerData + +body = CaseNotificationRuleCreateRequest( + data=CaseNotificationRuleCreate( + attributes=CaseNotificationRuleCreateAttributes( + is_enabled=True, + recipients=[ + CaseNotificationRuleRecipient( + data=CaseNotificationRuleRecipientData(), + type="EMAIL", + ), + ], + triggers=[ + CaseNotificationRuleTrigger( + data=CaseNotificationRuleTriggerData(), + type="CASE_CREATED", + ), + ], + ), + type=CaseNotificationRuleResourceType.NOTIFICATION_RULE, + ), +) + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = CaseManagementApi(api_client) + response = api_instance.create_project_notification_rule(project_id="project_id", body=body) + + print(response) diff --git a/examples/v2/case-management/DeleteProjectNotificationRule.py b/examples/v2/case-management/DeleteProjectNotificationRule.py new file mode 100644 index 0000000000..0796e46c48 --- /dev/null +++ b/examples/v2/case-management/DeleteProjectNotificationRule.py @@ -0,0 +1,14 @@ +""" +Delete a notification rule returns "No Content" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.case_management_api import CaseManagementApi + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = CaseManagementApi(api_client) + api_instance.delete_project_notification_rule( + project_id="project_id", + notification_rule_id="notification_rule_id", + ) diff --git a/examples/v2/case-management/GetProjectNotificationRules.py b/examples/v2/case-management/GetProjectNotificationRules.py new file mode 100644 index 0000000000..3beba45190 --- /dev/null +++ b/examples/v2/case-management/GetProjectNotificationRules.py @@ -0,0 +1,15 @@ +""" +Get notification rules returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.case_management_api import CaseManagementApi + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = CaseManagementApi(api_client) + response = api_instance.get_project_notification_rules( + project_id="project_id", + ) + + print(response) diff --git a/examples/v2/case-management/UpdateProject.py b/examples/v2/case-management/UpdateProject.py new file mode 100644 index 0000000000..bf2dddee27 --- /dev/null +++ b/examples/v2/case-management/UpdateProject.py @@ -0,0 +1,26 @@ +""" +Update a project returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.case_management_api import CaseManagementApi +from datadog_api_client.v2.model.project_resource_type import ProjectResourceType +from datadog_api_client.v2.model.project_update import ProjectUpdate +from datadog_api_client.v2.model.project_update_attributes import ProjectUpdateAttributes +from datadog_api_client.v2.model.project_update_request import ProjectUpdateRequest + +body = ProjectUpdateRequest( + data=ProjectUpdate( + type=ProjectResourceType.PROJECT, + attributes=ProjectUpdateAttributes( + name="Updated Project Name Example-Case-Management", + ), + ), +) + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = CaseManagementApi(api_client) + response = api_instance.update_project(project_id="d4bbe1af-f36e-42f1-87c1-493ca35c320e", body=body) + + print(response) diff --git a/examples/v2/case-management/UpdateProjectNotificationRule.py b/examples/v2/case-management/UpdateProjectNotificationRule.py new file mode 100644 index 0000000000..dfe92fe13e --- /dev/null +++ b/examples/v2/case-management/UpdateProjectNotificationRule.py @@ -0,0 +1,41 @@ +""" +Update a notification rule returns "No Content" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.case_management_api import CaseManagementApi +from datadog_api_client.v2.model.case_notification_rule_attributes import CaseNotificationRuleAttributes +from datadog_api_client.v2.model.case_notification_rule_recipient import CaseNotificationRuleRecipient +from datadog_api_client.v2.model.case_notification_rule_recipient_data import CaseNotificationRuleRecipientData +from datadog_api_client.v2.model.case_notification_rule_resource_type import CaseNotificationRuleResourceType +from datadog_api_client.v2.model.case_notification_rule_trigger import CaseNotificationRuleTrigger +from datadog_api_client.v2.model.case_notification_rule_trigger_data import CaseNotificationRuleTriggerData +from datadog_api_client.v2.model.case_notification_rule_update import CaseNotificationRuleUpdate +from datadog_api_client.v2.model.case_notification_rule_update_request import CaseNotificationRuleUpdateRequest + +body = CaseNotificationRuleUpdateRequest( + data=CaseNotificationRuleUpdate( + attributes=CaseNotificationRuleAttributes( + recipients=[ + CaseNotificationRuleRecipient( + data=CaseNotificationRuleRecipientData(), + type="EMAIL", + ), + ], + triggers=[ + CaseNotificationRuleTrigger( + data=CaseNotificationRuleTriggerData(), + type="CASE_CREATED", + ), + ], + ), + type=CaseNotificationRuleResourceType.NOTIFICATION_RULE, + ), +) + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = CaseManagementApi(api_client) + api_instance.update_project_notification_rule( + project_id="project_id", notification_rule_id="notification_rule_id", body=body + ) diff --git a/src/datadog_api_client/v2/api/case_management_api.py b/src/datadog_api_client/v2/api/case_management_api.py index bb4974cfe6..27cee1a0fa 100644 --- a/src/datadog_api_client/v2/api/case_management_api.py +++ b/src/datadog_api_client/v2/api/case_management_api.py @@ -22,6 +22,11 @@ from datadog_api_client.v2.model.projects_response import ProjectsResponse from datadog_api_client.v2.model.project_response import ProjectResponse from datadog_api_client.v2.model.project_create_request import ProjectCreateRequest +from datadog_api_client.v2.model.project_update_request import ProjectUpdateRequest +from datadog_api_client.v2.model.case_notification_rules_response import CaseNotificationRulesResponse +from datadog_api_client.v2.model.case_notification_rule_response import CaseNotificationRuleResponse +from datadog_api_client.v2.model.case_notification_rule_create_request import CaseNotificationRuleCreateRequest +from datadog_api_client.v2.model.case_notification_rule_update_request import CaseNotificationRuleUpdateRequest from datadog_api_client.v2.model.case_empty_request import CaseEmptyRequest from datadog_api_client.v2.model.case_assign_request import CaseAssignRequest from datadog_api_client.v2.model.case_update_attributes_request import CaseUpdateAttributesRequest @@ -162,6 +167,32 @@ def __init__(self, api_client=None): api_client=api_client, ) + self._create_project_notification_rule_endpoint = _Endpoint( + settings={ + "response_type": (CaseNotificationRuleResponse,), + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/cases/projects/{project_id}/notification_rules", + "operation_id": "create_project_notification_rule", + "http_method": "POST", + "version": "v2", + }, + params_map={ + "project_id": { + "required": True, + "openapi_types": (str,), + "attribute": "project_id", + "location": "path", + }, + "body": { + "required": True, + "openapi_types": (CaseNotificationRuleCreateRequest,), + "location": "body", + }, + }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, + api_client=api_client, + ) + self._delete_case_comment_endpoint = _Endpoint( settings={ "response_type": None, @@ -243,6 +274,35 @@ def __init__(self, api_client=None): api_client=api_client, ) + self._delete_project_notification_rule_endpoint = _Endpoint( + settings={ + "response_type": None, + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/cases/projects/{project_id}/notification_rules/{notification_rule_id}", + "operation_id": "delete_project_notification_rule", + "http_method": "DELETE", + "version": "v2", + }, + params_map={ + "project_id": { + "required": True, + "openapi_types": (str,), + "attribute": "project_id", + "location": "path", + }, + "notification_rule_id": { + "required": True, + "openapi_types": (str,), + "attribute": "notification_rule_id", + "location": "path", + }, + }, + headers_map={ + "accept": ["*/*"], + }, + api_client=api_client, + ) + self._get_case_endpoint = _Endpoint( settings={ "response_type": (CaseResponse,), @@ -289,6 +349,29 @@ def __init__(self, api_client=None): api_client=api_client, ) + self._get_project_notification_rules_endpoint = _Endpoint( + settings={ + "response_type": (CaseNotificationRulesResponse,), + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/cases/projects/{project_id}/notification_rules", + "operation_id": "get_project_notification_rules", + "http_method": "GET", + "version": "v2", + }, + params_map={ + "project_id": { + "required": True, + "openapi_types": (str,), + "attribute": "project_id", + "location": "path", + }, + }, + headers_map={ + "accept": ["application/json"], + }, + api_client=api_client, + ) + self._get_projects_endpoint = _Endpoint( settings={ "response_type": (ProjectsResponse,), @@ -535,6 +618,64 @@ def __init__(self, api_client=None): api_client=api_client, ) + self._update_project_endpoint = _Endpoint( + settings={ + "response_type": (ProjectResponse,), + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/cases/projects/{project_id}", + "operation_id": "update_project", + "http_method": "PATCH", + "version": "v2", + }, + params_map={ + "project_id": { + "required": True, + "openapi_types": (str,), + "attribute": "project_id", + "location": "path", + }, + "body": { + "required": True, + "openapi_types": (ProjectUpdateRequest,), + "location": "body", + }, + }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, + api_client=api_client, + ) + + self._update_project_notification_rule_endpoint = _Endpoint( + settings={ + "response_type": None, + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/cases/projects/{project_id}/notification_rules/{notification_rule_id}", + "operation_id": "update_project_notification_rule", + "http_method": "PUT", + "version": "v2", + }, + params_map={ + "project_id": { + "required": True, + "openapi_types": (str,), + "attribute": "project_id", + "location": "path", + }, + "notification_rule_id": { + "required": True, + "openapi_types": (str,), + "attribute": "notification_rule_id", + "location": "path", + }, + "body": { + "required": True, + "openapi_types": (CaseNotificationRuleUpdateRequest,), + "location": "body", + }, + }, + headers_map={"accept": ["*/*"], "content_type": ["application/json"]}, + api_client=api_client, + ) + self._update_status_endpoint = _Endpoint( settings={ "response_type": (CaseResponse,), @@ -661,6 +802,28 @@ def create_project( return self._create_project_endpoint.call_with_http_info(**kwargs) + def create_project_notification_rule( + self, + project_id: str, + body: CaseNotificationRuleCreateRequest, + ) -> CaseNotificationRuleResponse: + """Create a notification rule. + + Create a notification rule for a project. + + :param project_id: Project UUID + :type project_id: str + :param body: Notification rule payload + :type body: CaseNotificationRuleCreateRequest + :rtype: CaseNotificationRuleResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["project_id"] = project_id + + kwargs["body"] = body + + return self._create_project_notification_rule_endpoint.call_with_http_info(**kwargs) + def delete_case_comment( self, case_id: str, @@ -722,6 +885,28 @@ def delete_project( return self._delete_project_endpoint.call_with_http_info(**kwargs) + def delete_project_notification_rule( + self, + project_id: str, + notification_rule_id: str, + ) -> None: + """Delete a notification rule. + + Delete a notification rule using the notification rule's ``id``. + + :param project_id: Project UUID + :type project_id: str + :param notification_rule_id: Notification Rule UUID + :type notification_rule_id: str + :rtype: None + """ + kwargs: Dict[str, Any] = {} + kwargs["project_id"] = project_id + + kwargs["notification_rule_id"] = notification_rule_id + + return self._delete_project_notification_rule_endpoint.call_with_http_info(**kwargs) + def get_case( self, case_id: str, @@ -756,6 +941,23 @@ def get_project( return self._get_project_endpoint.call_with_http_info(**kwargs) + def get_project_notification_rules( + self, + project_id: str, + ) -> CaseNotificationRulesResponse: + """Get notification rules. + + Get all notification rules for a project. + + :param project_id: Project UUID + :type project_id: str + :rtype: CaseNotificationRulesResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["project_id"] = project_id + + return self._get_project_notification_rules_endpoint.call_with_http_info(**kwargs) + def get_projects( self, ) -> ProjectsResponse: @@ -1025,6 +1227,55 @@ def update_priority( return self._update_priority_endpoint.call_with_http_info(**kwargs) + def update_project( + self, + project_id: str, + body: ProjectUpdateRequest, + ) -> ProjectResponse: + """Update a project. + + Update a project. + + :param project_id: Project UUID + :type project_id: str + :param body: Project payload + :type body: ProjectUpdateRequest + :rtype: ProjectResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["project_id"] = project_id + + kwargs["body"] = body + + return self._update_project_endpoint.call_with_http_info(**kwargs) + + def update_project_notification_rule( + self, + project_id: str, + notification_rule_id: str, + body: CaseNotificationRuleUpdateRequest, + ) -> None: + """Update a notification rule. + + Update a notification rule. + + :param project_id: Project UUID + :type project_id: str + :param notification_rule_id: Notification Rule UUID + :type notification_rule_id: str + :param body: Notification rule payload + :type body: CaseNotificationRuleUpdateRequest + :rtype: None + """ + kwargs: Dict[str, Any] = {} + kwargs["project_id"] = project_id + + kwargs["notification_rule_id"] = notification_rule_id + + kwargs["body"] = body + + return self._update_project_notification_rule_endpoint.call_with_http_info(**kwargs) + def update_status( self, case_id: str, diff --git a/src/datadog_api_client/v2/model/any_value.py b/src/datadog_api_client/v2/model/any_value.py new file mode 100644 index 0000000000..a51932d3da --- /dev/null +++ b/src/datadog_api_client/v2/model/any_value.py @@ -0,0 +1,42 @@ +# 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. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelComposed, + cached_property, +) + + +class AnyValue(ModelComposed): + _nullable = True + + def __init__(self, **kwargs): + """ + Represents any valid JSON value. + """ + super().__init__(kwargs) + + @cached_property + def _composed_schemas(_): + # we need this here to make our import statements work + # we must store _composed_schemas in here so the code is only run + # when we invoke this method. If we kept this at the class + # level we would get an error because the class level + # code would be run when this module is imported, and these composed + # classes don't exist yet because their module has not finished + # loading + from datadog_api_client.v2.model.any_value_object import AnyValueObject + from datadog_api_client.v2.model.any_value_item import AnyValueItem + + return { + "oneOf": [ + str, + float, + AnyValueObject, + [AnyValueItem], + bool, + ], + } diff --git a/src/datadog_api_client/v2/model/any_value_item.py b/src/datadog_api_client/v2/model/any_value_item.py new file mode 100644 index 0000000000..a806e14c64 --- /dev/null +++ b/src/datadog_api_client/v2/model/any_value_item.py @@ -0,0 +1,36 @@ +# 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. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelComposed, + cached_property, +) + + +class AnyValueItem(ModelComposed): + def __init__(self, **kwargs): + """ """ + super().__init__(kwargs) + + @cached_property + def _composed_schemas(_): + # we need this here to make our import statements work + # we must store _composed_schemas in here so the code is only run + # when we invoke this method. If we kept this at the class + # level we would get an error because the class level + # code would be run when this module is imported, and these composed + # classes don't exist yet because their module has not finished + # loading + from datadog_api_client.v2.model.any_value_object import AnyValueObject + + return { + "oneOf": [ + str, + float, + AnyValueObject, + bool, + ], + } diff --git a/src/datadog_api_client/v2/model/any_value_object.py b/src/datadog_api_client/v2/model/any_value_object.py new file mode 100644 index 0000000000..a56a7703a5 --- /dev/null +++ b/src/datadog_api_client/v2/model/any_value_object.py @@ -0,0 +1,15 @@ +# 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. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelNormal, +) + + +class AnyValueObject(ModelNormal): + def __init__(self_, **kwargs): + """ """ + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/auto_close_inactive_cases.py b/src/datadog_api_client/v2/model/auto_close_inactive_cases.py new file mode 100644 index 0000000000..3b99462054 --- /dev/null +++ b/src/datadog_api_client/v2/model/auto_close_inactive_cases.py @@ -0,0 +1,48 @@ +# 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. +from __future__ import annotations + +from typing import Union + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +class AutoCloseInactiveCases(ModelNormal): + @cached_property + def openapi_types(_): + return { + "enabled": (bool,), + "max_inactive_time_in_secs": (int,), + } + + attribute_map = { + "enabled": "enabled", + "max_inactive_time_in_secs": "max_inactive_time_in_secs", + } + + def __init__( + self_, + enabled: Union[bool, UnsetType] = unset, + max_inactive_time_in_secs: Union[int, UnsetType] = unset, + **kwargs, + ): + """ + Auto-close inactive cases settings + + :param enabled: Whether auto-close is enabled + :type enabled: bool, optional + + :param max_inactive_time_in_secs: Maximum inactive time in seconds before auto-closing + :type max_inactive_time_in_secs: int, optional + """ + if enabled is not unset: + kwargs["enabled"] = enabled + if max_inactive_time_in_secs is not unset: + kwargs["max_inactive_time_in_secs"] = max_inactive_time_in_secs + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/auto_transition_assigned_cases.py b/src/datadog_api_client/v2/model/auto_transition_assigned_cases.py new file mode 100644 index 0000000000..0212ca96d9 --- /dev/null +++ b/src/datadog_api_client/v2/model/auto_transition_assigned_cases.py @@ -0,0 +1,36 @@ +# 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. +from __future__ import annotations + +from typing import Union + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +class AutoTransitionAssignedCases(ModelNormal): + @cached_property + def openapi_types(_): + return { + "auto_transition_assigned_cases_on_self_assigned": (bool,), + } + + attribute_map = { + "auto_transition_assigned_cases_on_self_assigned": "auto_transition_assigned_cases_on_self_assigned", + } + + def __init__(self_, auto_transition_assigned_cases_on_self_assigned: Union[bool, UnsetType] = unset, **kwargs): + """ + Auto-transition assigned cases settings + + :param auto_transition_assigned_cases_on_self_assigned: Whether to auto-transition cases when self-assigned + :type auto_transition_assigned_cases_on_self_assigned: bool, optional + """ + if auto_transition_assigned_cases_on_self_assigned is not unset: + kwargs["auto_transition_assigned_cases_on_self_assigned"] = auto_transition_assigned_cases_on_self_assigned + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/case_notification_rule.py b/src/datadog_api_client/v2/model/case_notification_rule.py new file mode 100644 index 0000000000..300aebbfac --- /dev/null +++ b/src/datadog_api_client/v2/model/case_notification_rule.py @@ -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. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.case_notification_rule_attributes import CaseNotificationRuleAttributes + from datadog_api_client.v2.model.case_notification_rule_resource_type import CaseNotificationRuleResourceType + + +class CaseNotificationRule(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.case_notification_rule_attributes import CaseNotificationRuleAttributes + from datadog_api_client.v2.model.case_notification_rule_resource_type import CaseNotificationRuleResourceType + + return { + "attributes": (CaseNotificationRuleAttributes,), + "id": (str,), + "type": (CaseNotificationRuleResourceType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "type": "type", + } + + def __init__( + self_, attributes: CaseNotificationRuleAttributes, id: str, type: CaseNotificationRuleResourceType, **kwargs + ): + """ + A notification rule for case management + + :param attributes: Notification rule attributes + :type attributes: CaseNotificationRuleAttributes + + :param id: The notification rule's identifier + :type id: str + + :param type: Notification rule resource type + :type type: CaseNotificationRuleResourceType + """ + super().__init__(kwargs) + + self_.attributes = attributes + self_.id = id + self_.type = type diff --git a/src/datadog_api_client/v2/model/case_notification_rule_attributes.py b/src/datadog_api_client/v2/model/case_notification_rule_attributes.py new file mode 100644 index 0000000000..2434628418 --- /dev/null +++ b/src/datadog_api_client/v2/model/case_notification_rule_attributes.py @@ -0,0 +1,72 @@ +# 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. +from __future__ import annotations + +from typing import List, Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.case_notification_rule_recipient import CaseNotificationRuleRecipient + from datadog_api_client.v2.model.case_notification_rule_trigger import CaseNotificationRuleTrigger + + +class CaseNotificationRuleAttributes(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.case_notification_rule_recipient import CaseNotificationRuleRecipient + from datadog_api_client.v2.model.case_notification_rule_trigger import CaseNotificationRuleTrigger + + return { + "is_enabled": (bool,), + "query": (str,), + "recipients": ([CaseNotificationRuleRecipient],), + "triggers": ([CaseNotificationRuleTrigger],), + } + + attribute_map = { + "is_enabled": "is_enabled", + "query": "query", + "recipients": "recipients", + "triggers": "triggers", + } + + def __init__( + self_, + is_enabled: Union[bool, UnsetType] = unset, + query: Union[str, UnsetType] = unset, + recipients: Union[List[CaseNotificationRuleRecipient], UnsetType] = unset, + triggers: Union[List[CaseNotificationRuleTrigger], UnsetType] = unset, + **kwargs, + ): + """ + Notification rule attributes + + :param is_enabled: Whether the notification rule is enabled + :type is_enabled: bool, optional + + :param query: Query to filter cases for this notification rule + :type query: str, optional + + :param recipients: List of notification recipients + :type recipients: [CaseNotificationRuleRecipient], optional + + :param triggers: List of triggers for this notification rule + :type triggers: [CaseNotificationRuleTrigger], optional + """ + if is_enabled is not unset: + kwargs["is_enabled"] = is_enabled + if query is not unset: + kwargs["query"] = query + if recipients is not unset: + kwargs["recipients"] = recipients + if triggers is not unset: + kwargs["triggers"] = triggers + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/case_notification_rule_create.py b/src/datadog_api_client/v2/model/case_notification_rule_create.py new file mode 100644 index 0000000000..71409577d0 --- /dev/null +++ b/src/datadog_api_client/v2/model/case_notification_rule_create.py @@ -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. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.case_notification_rule_create_attributes import ( + CaseNotificationRuleCreateAttributes, + ) + from datadog_api_client.v2.model.case_notification_rule_resource_type import CaseNotificationRuleResourceType + + +class CaseNotificationRuleCreate(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.case_notification_rule_create_attributes import ( + CaseNotificationRuleCreateAttributes, + ) + from datadog_api_client.v2.model.case_notification_rule_resource_type import CaseNotificationRuleResourceType + + return { + "attributes": (CaseNotificationRuleCreateAttributes,), + "type": (CaseNotificationRuleResourceType,), + } + + attribute_map = { + "attributes": "attributes", + "type": "type", + } + + def __init__( + self_, attributes: CaseNotificationRuleCreateAttributes, type: CaseNotificationRuleResourceType, **kwargs + ): + """ + Notification rule create + + :param attributes: Notification rule creation attributes + :type attributes: CaseNotificationRuleCreateAttributes + + :param type: Notification rule resource type + :type type: CaseNotificationRuleResourceType + """ + super().__init__(kwargs) + + self_.attributes = attributes + self_.type = type diff --git a/src/datadog_api_client/v2/model/case_notification_rule_create_attributes.py b/src/datadog_api_client/v2/model/case_notification_rule_create_attributes.py new file mode 100644 index 0000000000..a07a72585a --- /dev/null +++ b/src/datadog_api_client/v2/model/case_notification_rule_create_attributes.py @@ -0,0 +1,71 @@ +# 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. +from __future__ import annotations + +from typing import List, Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.case_notification_rule_recipient import CaseNotificationRuleRecipient + from datadog_api_client.v2.model.case_notification_rule_trigger import CaseNotificationRuleTrigger + + +class CaseNotificationRuleCreateAttributes(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.case_notification_rule_recipient import CaseNotificationRuleRecipient + from datadog_api_client.v2.model.case_notification_rule_trigger import CaseNotificationRuleTrigger + + return { + "is_enabled": (bool,), + "query": (str,), + "recipients": ([CaseNotificationRuleRecipient],), + "triggers": ([CaseNotificationRuleTrigger],), + } + + attribute_map = { + "is_enabled": "is_enabled", + "query": "query", + "recipients": "recipients", + "triggers": "triggers", + } + + def __init__( + self_, + recipients: List[CaseNotificationRuleRecipient], + triggers: List[CaseNotificationRuleTrigger], + is_enabled: Union[bool, UnsetType] = unset, + query: Union[str, UnsetType] = unset, + **kwargs, + ): + """ + Notification rule creation attributes + + :param is_enabled: Whether the notification rule is enabled + :type is_enabled: bool, optional + + :param query: Query to filter cases for this notification rule + :type query: str, optional + + :param recipients: List of notification recipients + :type recipients: [CaseNotificationRuleRecipient] + + :param triggers: List of triggers for this notification rule + :type triggers: [CaseNotificationRuleTrigger] + """ + if is_enabled is not unset: + kwargs["is_enabled"] = is_enabled + if query is not unset: + kwargs["query"] = query + super().__init__(kwargs) + + self_.recipients = recipients + self_.triggers = triggers diff --git a/src/datadog_api_client/v2/model/case_notification_rule_create_request.py b/src/datadog_api_client/v2/model/case_notification_rule_create_request.py new file mode 100644 index 0000000000..8dff7aea8c --- /dev/null +++ b/src/datadog_api_client/v2/model/case_notification_rule_create_request.py @@ -0,0 +1,40 @@ +# 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. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.case_notification_rule_create import CaseNotificationRuleCreate + + +class CaseNotificationRuleCreateRequest(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.case_notification_rule_create import CaseNotificationRuleCreate + + return { + "data": (CaseNotificationRuleCreate,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: CaseNotificationRuleCreate, **kwargs): + """ + Notification rule create request + + :param data: Notification rule create + :type data: CaseNotificationRuleCreate + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/case_notification_rule_recipient.py b/src/datadog_api_client/v2/model/case_notification_rule_recipient.py new file mode 100644 index 0000000000..6116c61567 --- /dev/null +++ b/src/datadog_api_client/v2/model/case_notification_rule_recipient.py @@ -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. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.case_notification_rule_recipient_data import CaseNotificationRuleRecipientData + + +class CaseNotificationRuleRecipient(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.case_notification_rule_recipient_data import CaseNotificationRuleRecipientData + + return { + "data": (CaseNotificationRuleRecipientData,), + "type": (str,), + } + + attribute_map = { + "data": "data", + "type": "type", + } + + def __init__( + self_, + data: Union[CaseNotificationRuleRecipientData, UnsetType] = unset, + type: Union[str, UnsetType] = unset, + **kwargs, + ): + """ + Notification rule recipient + + :param data: Recipient data + :type data: CaseNotificationRuleRecipientData, optional + + :param type: Type of recipient (SLACK_CHANNEL, EMAIL, HTTP, PAGERDUTY_SERVICE, MS_TEAMS_CHANNEL) + :type type: str, optional + """ + if data is not unset: + kwargs["data"] = data + if type is not unset: + kwargs["type"] = type + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/case_notification_rule_recipient_data.py b/src/datadog_api_client/v2/model/case_notification_rule_recipient_data.py new file mode 100644 index 0000000000..c96eb46879 --- /dev/null +++ b/src/datadog_api_client/v2/model/case_notification_rule_recipient_data.py @@ -0,0 +1,136 @@ +# 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. +from __future__ import annotations + +from typing import Union + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +class CaseNotificationRuleRecipientData(ModelNormal): + @cached_property + def openapi_types(_): + return { + "channel": (str,), + "channel_id": (str,), + "channel_name": (str,), + "connector_name": (str,), + "email": (str,), + "name": (str,), + "service_name": (str,), + "team_id": (str,), + "team_name": (str,), + "tenant_id": (str,), + "tenant_name": (str,), + "workspace": (str,), + "workspace_id": (str,), + } + + attribute_map = { + "channel": "channel", + "channel_id": "channel_id", + "channel_name": "channel_name", + "connector_name": "connector_name", + "email": "email", + "name": "name", + "service_name": "service_name", + "team_id": "team_id", + "team_name": "team_name", + "tenant_id": "tenant_id", + "tenant_name": "tenant_name", + "workspace": "workspace", + "workspace_id": "workspace_id", + } + + def __init__( + self_, + channel: Union[str, UnsetType] = unset, + channel_id: Union[str, UnsetType] = unset, + channel_name: Union[str, UnsetType] = unset, + connector_name: Union[str, UnsetType] = unset, + email: Union[str, UnsetType] = unset, + name: Union[str, UnsetType] = unset, + service_name: Union[str, UnsetType] = unset, + team_id: Union[str, UnsetType] = unset, + team_name: Union[str, UnsetType] = unset, + tenant_id: Union[str, UnsetType] = unset, + tenant_name: Union[str, UnsetType] = unset, + workspace: Union[str, UnsetType] = unset, + workspace_id: Union[str, UnsetType] = unset, + **kwargs, + ): + """ + Recipient data + + :param channel: Slack channel name + :type channel: str, optional + + :param channel_id: Slack channel ID + :type channel_id: str, optional + + :param channel_name: Microsoft Teams channel name + :type channel_name: str, optional + + :param connector_name: Microsoft Teams connector name + :type connector_name: str, optional + + :param email: Email address + :type email: str, optional + + :param name: HTTP webhook name + :type name: str, optional + + :param service_name: PagerDuty service name + :type service_name: str, optional + + :param team_id: Microsoft Teams team ID + :type team_id: str, optional + + :param team_name: Microsoft Teams team name + :type team_name: str, optional + + :param tenant_id: Microsoft Teams tenant ID + :type tenant_id: str, optional + + :param tenant_name: Microsoft Teams tenant name + :type tenant_name: str, optional + + :param workspace: Slack workspace name + :type workspace: str, optional + + :param workspace_id: Slack workspace ID + :type workspace_id: str, optional + """ + if channel is not unset: + kwargs["channel"] = channel + if channel_id is not unset: + kwargs["channel_id"] = channel_id + if channel_name is not unset: + kwargs["channel_name"] = channel_name + if connector_name is not unset: + kwargs["connector_name"] = connector_name + if email is not unset: + kwargs["email"] = email + if name is not unset: + kwargs["name"] = name + if service_name is not unset: + kwargs["service_name"] = service_name + if team_id is not unset: + kwargs["team_id"] = team_id + if team_name is not unset: + kwargs["team_name"] = team_name + if tenant_id is not unset: + kwargs["tenant_id"] = tenant_id + if tenant_name is not unset: + kwargs["tenant_name"] = tenant_name + if workspace is not unset: + kwargs["workspace"] = workspace + if workspace_id is not unset: + kwargs["workspace_id"] = workspace_id + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/case_notification_rule_resource_type.py b/src/datadog_api_client/v2/model/case_notification_rule_resource_type.py new file mode 100644 index 0000000000..f197fbc5ef --- /dev/null +++ b/src/datadog_api_client/v2/model/case_notification_rule_resource_type.py @@ -0,0 +1,35 @@ +# 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. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class CaseNotificationRuleResourceType(ModelSimple): + """ + Notification rule resource type + + :param value: If omitted defaults to "notification_rule". Must be one of ["notification_rule"]. + :type value: str + """ + + allowed_values = { + "notification_rule", + } + NOTIFICATION_RULE: ClassVar["CaseNotificationRuleResourceType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +CaseNotificationRuleResourceType.NOTIFICATION_RULE = CaseNotificationRuleResourceType("notification_rule") diff --git a/src/datadog_api_client/v2/model/case_notification_rule_response.py b/src/datadog_api_client/v2/model/case_notification_rule_response.py new file mode 100644 index 0000000000..cc6cc4a0b0 --- /dev/null +++ b/src/datadog_api_client/v2/model/case_notification_rule_response.py @@ -0,0 +1,42 @@ +# 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. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.case_notification_rule import CaseNotificationRule + + +class CaseNotificationRuleResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.case_notification_rule import CaseNotificationRule + + return { + "data": (CaseNotificationRule,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: Union[CaseNotificationRule, UnsetType] = unset, **kwargs): + """ + Notification rule response + + :param data: A notification rule for case management + :type data: CaseNotificationRule, optional + """ + if data is not unset: + kwargs["data"] = data + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/case_notification_rule_trigger.py b/src/datadog_api_client/v2/model/case_notification_rule_trigger.py new file mode 100644 index 0000000000..e8f99a382d --- /dev/null +++ b/src/datadog_api_client/v2/model/case_notification_rule_trigger.py @@ -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. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.case_notification_rule_trigger_data import CaseNotificationRuleTriggerData + + +class CaseNotificationRuleTrigger(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.case_notification_rule_trigger_data import CaseNotificationRuleTriggerData + + return { + "data": (CaseNotificationRuleTriggerData,), + "type": (str,), + } + + attribute_map = { + "data": "data", + "type": "type", + } + + def __init__( + self_, + data: Union[CaseNotificationRuleTriggerData, UnsetType] = unset, + type: Union[str, UnsetType] = unset, + **kwargs, + ): + """ + Notification rule trigger + + :param data: Trigger data + :type data: CaseNotificationRuleTriggerData, optional + + :param type: Type of trigger (CASE_CREATED, STATUS_TRANSITIONED, ATTRIBUTE_VALUE_CHANGED, EVENT_CORRELATION_SIGNAL_CORRELATED) + :type type: str, optional + """ + if data is not unset: + kwargs["data"] = data + if type is not unset: + kwargs["type"] = type + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/case_notification_rule_trigger_data.py b/src/datadog_api_client/v2/model/case_notification_rule_trigger_data.py new file mode 100644 index 0000000000..ef92679f70 --- /dev/null +++ b/src/datadog_api_client/v2/model/case_notification_rule_trigger_data.py @@ -0,0 +1,80 @@ +# 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. +from __future__ import annotations + +from typing import Union + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +class CaseNotificationRuleTriggerData(ModelNormal): + @cached_property + def openapi_types(_): + return { + "change_type": (str,), + "field": (str,), + "from_status": (str,), + "from_status_name": (str,), + "to_status": (str,), + "to_status_name": (str,), + } + + attribute_map = { + "change_type": "change_type", + "field": "field", + "from_status": "from_status", + "from_status_name": "from_status_name", + "to_status": "to_status", + "to_status_name": "to_status_name", + } + + def __init__( + self_, + change_type: Union[str, UnsetType] = unset, + field: Union[str, UnsetType] = unset, + from_status: Union[str, UnsetType] = unset, + from_status_name: Union[str, UnsetType] = unset, + to_status: Union[str, UnsetType] = unset, + to_status_name: Union[str, UnsetType] = unset, + **kwargs, + ): + """ + Trigger data + + :param change_type: Change type (added, removed, changed) + :type change_type: str, optional + + :param field: Field name for attribute value changed trigger + :type field: str, optional + + :param from_status: Status ID to transition from + :type from_status: str, optional + + :param from_status_name: Status name to transition from + :type from_status_name: str, optional + + :param to_status: Status ID to transition to + :type to_status: str, optional + + :param to_status_name: Status name to transition to + :type to_status_name: str, optional + """ + if change_type is not unset: + kwargs["change_type"] = change_type + if field is not unset: + kwargs["field"] = field + if from_status is not unset: + kwargs["from_status"] = from_status + if from_status_name is not unset: + kwargs["from_status_name"] = from_status_name + if to_status is not unset: + kwargs["to_status"] = to_status + if to_status_name is not unset: + kwargs["to_status_name"] = to_status_name + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/case_notification_rule_update.py b/src/datadog_api_client/v2/model/case_notification_rule_update.py new file mode 100644 index 0000000000..f179d5d36b --- /dev/null +++ b/src/datadog_api_client/v2/model/case_notification_rule_update.py @@ -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. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.case_notification_rule_attributes import CaseNotificationRuleAttributes + from datadog_api_client.v2.model.case_notification_rule_resource_type import CaseNotificationRuleResourceType + + +class CaseNotificationRuleUpdate(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.case_notification_rule_attributes import CaseNotificationRuleAttributes + from datadog_api_client.v2.model.case_notification_rule_resource_type import CaseNotificationRuleResourceType + + return { + "attributes": (CaseNotificationRuleAttributes,), + "type": (CaseNotificationRuleResourceType,), + } + + attribute_map = { + "attributes": "attributes", + "type": "type", + } + + def __init__( + self_, + type: CaseNotificationRuleResourceType, + attributes: Union[CaseNotificationRuleAttributes, UnsetType] = unset, + **kwargs, + ): + """ + Notification rule update + + :param attributes: Notification rule attributes + :type attributes: CaseNotificationRuleAttributes, optional + + :param type: Notification rule resource type + :type type: CaseNotificationRuleResourceType + """ + if attributes is not unset: + kwargs["attributes"] = attributes + super().__init__(kwargs) + + self_.type = type diff --git a/src/datadog_api_client/v2/model/case_notification_rule_update_request.py b/src/datadog_api_client/v2/model/case_notification_rule_update_request.py new file mode 100644 index 0000000000..8f5d7662ab --- /dev/null +++ b/src/datadog_api_client/v2/model/case_notification_rule_update_request.py @@ -0,0 +1,40 @@ +# 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. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.case_notification_rule_update import CaseNotificationRuleUpdate + + +class CaseNotificationRuleUpdateRequest(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.case_notification_rule_update import CaseNotificationRuleUpdate + + return { + "data": (CaseNotificationRuleUpdate,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: CaseNotificationRuleUpdate, **kwargs): + """ + Notification rule update request + + :param data: Notification rule update + :type data: CaseNotificationRuleUpdate + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/case_notification_rules_response.py b/src/datadog_api_client/v2/model/case_notification_rules_response.py new file mode 100644 index 0000000000..db9aac9421 --- /dev/null +++ b/src/datadog_api_client/v2/model/case_notification_rules_response.py @@ -0,0 +1,42 @@ +# 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. +from __future__ import annotations + +from typing import List, Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.case_notification_rule import CaseNotificationRule + + +class CaseNotificationRulesResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.case_notification_rule import CaseNotificationRule + + return { + "data": ([CaseNotificationRule],), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: Union[List[CaseNotificationRule], UnsetType] = unset, **kwargs): + """ + Response with notification rules + + :param data: Notification rules data + :type data: [CaseNotificationRule], optional + """ + if data is not unset: + kwargs["data"] = data + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/integration_incident.py b/src/datadog_api_client/v2/model/integration_incident.py new file mode 100644 index 0000000000..10a674ba91 --- /dev/null +++ b/src/datadog_api_client/v2/model/integration_incident.py @@ -0,0 +1,92 @@ +# 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. +from __future__ import annotations + +from typing import List, Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.integration_incident_field_mappings_items import ( + IntegrationIncidentFieldMappingsItems, + ) + from datadog_api_client.v2.model.integration_incident_severity_config import IntegrationIncidentSeverityConfig + + +class IntegrationIncident(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.integration_incident_field_mappings_items import ( + IntegrationIncidentFieldMappingsItems, + ) + from datadog_api_client.v2.model.integration_incident_severity_config import IntegrationIncidentSeverityConfig + + return { + "auto_escalation_query": (str,), + "default_incident_commander": (str,), + "enabled": (bool,), + "field_mappings": ([IntegrationIncidentFieldMappingsItems],), + "incident_type": (str,), + "severity_config": (IntegrationIncidentSeverityConfig,), + } + + attribute_map = { + "auto_escalation_query": "auto_escalation_query", + "default_incident_commander": "default_incident_commander", + "enabled": "enabled", + "field_mappings": "field_mappings", + "incident_type": "incident_type", + "severity_config": "severity_config", + } + + def __init__( + self_, + auto_escalation_query: Union[str, UnsetType] = unset, + default_incident_commander: Union[str, UnsetType] = unset, + enabled: Union[bool, UnsetType] = unset, + field_mappings: Union[List[IntegrationIncidentFieldMappingsItems], UnsetType] = unset, + incident_type: Union[str, UnsetType] = unset, + severity_config: Union[IntegrationIncidentSeverityConfig, UnsetType] = unset, + **kwargs, + ): + """ + Incident integration settings + + :param auto_escalation_query: Query for auto-escalation + :type auto_escalation_query: str, optional + + :param default_incident_commander: Default incident commander + :type default_incident_commander: str, optional + + :param enabled: Whether incident integration is enabled + :type enabled: bool, optional + + :param field_mappings: + :type field_mappings: [IntegrationIncidentFieldMappingsItems], optional + + :param incident_type: Incident type + :type incident_type: str, optional + + :param severity_config: + :type severity_config: IntegrationIncidentSeverityConfig, optional + """ + if auto_escalation_query is not unset: + kwargs["auto_escalation_query"] = auto_escalation_query + if default_incident_commander is not unset: + kwargs["default_incident_commander"] = default_incident_commander + if enabled is not unset: + kwargs["enabled"] = enabled + if field_mappings is not unset: + kwargs["field_mappings"] = field_mappings + if incident_type is not unset: + kwargs["incident_type"] = incident_type + if severity_config is not unset: + kwargs["severity_config"] = severity_config + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/integration_incident_field_mappings_items.py b/src/datadog_api_client/v2/model/integration_incident_field_mappings_items.py new file mode 100644 index 0000000000..af6c5dcf26 --- /dev/null +++ b/src/datadog_api_client/v2/model/integration_incident_field_mappings_items.py @@ -0,0 +1,48 @@ +# 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. +from __future__ import annotations + +from typing import Union + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +class IntegrationIncidentFieldMappingsItems(ModelNormal): + @cached_property + def openapi_types(_): + return { + "case_field": (str,), + "incident_user_defined_field_id": (str,), + } + + attribute_map = { + "case_field": "case_field", + "incident_user_defined_field_id": "incident_user_defined_field_id", + } + + def __init__( + self_, + case_field: Union[str, UnsetType] = unset, + incident_user_defined_field_id: Union[str, UnsetType] = unset, + **kwargs, + ): + """ + + + :param case_field: + :type case_field: str, optional + + :param incident_user_defined_field_id: + :type incident_user_defined_field_id: str, optional + """ + if case_field is not unset: + kwargs["case_field"] = case_field + if incident_user_defined_field_id is not unset: + kwargs["incident_user_defined_field_id"] = incident_user_defined_field_id + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/integration_incident_severity_config.py b/src/datadog_api_client/v2/model/integration_incident_severity_config.py new file mode 100644 index 0000000000..b8a470278a --- /dev/null +++ b/src/datadog_api_client/v2/model/integration_incident_severity_config.py @@ -0,0 +1,36 @@ +# 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. +from __future__ import annotations + +from typing import Dict, Union + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +class IntegrationIncidentSeverityConfig(ModelNormal): + @cached_property + def openapi_types(_): + return { + "priority_mapping": ({str: (str,)},), + } + + attribute_map = { + "priority_mapping": "priority_mapping", + } + + def __init__(self_, priority_mapping: Union[Dict[str, str], UnsetType] = unset, **kwargs): + """ + + + :param priority_mapping: + :type priority_mapping: {str: (str,)}, optional + """ + if priority_mapping is not unset: + kwargs["priority_mapping"] = priority_mapping + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/integration_jira.py b/src/datadog_api_client/v2/model/integration_jira.py new file mode 100644 index 0000000000..1cfa6a0480 --- /dev/null +++ b/src/datadog_api_client/v2/model/integration_jira.py @@ -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. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.integration_jira_auto_creation import IntegrationJiraAutoCreation + from datadog_api_client.v2.model.integration_jira_metadata import IntegrationJiraMetadata + from datadog_api_client.v2.model.integration_jira_sync import IntegrationJiraSync + + +class IntegrationJira(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.integration_jira_auto_creation import IntegrationJiraAutoCreation + from datadog_api_client.v2.model.integration_jira_metadata import IntegrationJiraMetadata + from datadog_api_client.v2.model.integration_jira_sync import IntegrationJiraSync + + return { + "auto_creation": (IntegrationJiraAutoCreation,), + "enabled": (bool,), + "metadata": (IntegrationJiraMetadata,), + "sync": (IntegrationJiraSync,), + } + + attribute_map = { + "auto_creation": "auto_creation", + "enabled": "enabled", + "metadata": "metadata", + "sync": "sync", + } + + def __init__( + self_, + auto_creation: Union[IntegrationJiraAutoCreation, UnsetType] = unset, + enabled: Union[bool, UnsetType] = unset, + metadata: Union[IntegrationJiraMetadata, UnsetType] = unset, + sync: Union[IntegrationJiraSync, UnsetType] = unset, + **kwargs, + ): + """ + Jira integration settings + + :param auto_creation: + :type auto_creation: IntegrationJiraAutoCreation, optional + + :param enabled: Whether Jira integration is enabled + :type enabled: bool, optional + + :param metadata: + :type metadata: IntegrationJiraMetadata, optional + + :param sync: + :type sync: IntegrationJiraSync, optional + """ + if auto_creation is not unset: + kwargs["auto_creation"] = auto_creation + if enabled is not unset: + kwargs["enabled"] = enabled + if metadata is not unset: + kwargs["metadata"] = metadata + if sync is not unset: + kwargs["sync"] = sync + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/integration_jira_auto_creation.py b/src/datadog_api_client/v2/model/integration_jira_auto_creation.py new file mode 100644 index 0000000000..ea71a29452 --- /dev/null +++ b/src/datadog_api_client/v2/model/integration_jira_auto_creation.py @@ -0,0 +1,36 @@ +# 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. +from __future__ import annotations + +from typing import Union + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +class IntegrationJiraAutoCreation(ModelNormal): + @cached_property + def openapi_types(_): + return { + "enabled": (bool,), + } + + attribute_map = { + "enabled": "enabled", + } + + def __init__(self_, enabled: Union[bool, UnsetType] = unset, **kwargs): + """ + + + :param enabled: + :type enabled: bool, optional + """ + if enabled is not unset: + kwargs["enabled"] = enabled + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/integration_jira_metadata.py b/src/datadog_api_client/v2/model/integration_jira_metadata.py new file mode 100644 index 0000000000..d9c80fb5ce --- /dev/null +++ b/src/datadog_api_client/v2/model/integration_jira_metadata.py @@ -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. +from __future__ import annotations + +from typing import Union + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +class IntegrationJiraMetadata(ModelNormal): + @cached_property + def openapi_types(_): + return { + "account_id": (str,), + "issue_type_id": (str,), + "project_id": (str,), + } + + attribute_map = { + "account_id": "account_id", + "issue_type_id": "issue_type_id", + "project_id": "project_id", + } + + def __init__( + self_, + account_id: Union[str, UnsetType] = unset, + issue_type_id: Union[str, UnsetType] = unset, + project_id: Union[str, UnsetType] = unset, + **kwargs, + ): + """ + + + :param account_id: + :type account_id: str, optional + + :param issue_type_id: + :type issue_type_id: str, optional + + :param project_id: + :type project_id: str, optional + """ + if account_id is not unset: + kwargs["account_id"] = account_id + if issue_type_id is not unset: + kwargs["issue_type_id"] = issue_type_id + if project_id is not unset: + kwargs["project_id"] = project_id + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/integration_jira_sync.py b/src/datadog_api_client/v2/model/integration_jira_sync.py new file mode 100644 index 0000000000..61cdfe1cc7 --- /dev/null +++ b/src/datadog_api_client/v2/model/integration_jira_sync.py @@ -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. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.integration_jira_sync_properties import IntegrationJiraSyncProperties + + +class IntegrationJiraSync(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.integration_jira_sync_properties import IntegrationJiraSyncProperties + + return { + "enabled": (bool,), + "properties": (IntegrationJiraSyncProperties,), + } + + attribute_map = { + "enabled": "enabled", + "properties": "properties", + } + + def __init__( + self_, + enabled: Union[bool, UnsetType] = unset, + properties: Union[IntegrationJiraSyncProperties, UnsetType] = unset, + **kwargs, + ): + """ + + + :param enabled: + :type enabled: bool, optional + + :param properties: + :type properties: IntegrationJiraSyncProperties, optional + """ + if enabled is not unset: + kwargs["enabled"] = enabled + if properties is not unset: + kwargs["properties"] = properties + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/integration_jira_sync_due_date.py b/src/datadog_api_client/v2/model/integration_jira_sync_due_date.py new file mode 100644 index 0000000000..6fe92b0a56 --- /dev/null +++ b/src/datadog_api_client/v2/model/integration_jira_sync_due_date.py @@ -0,0 +1,45 @@ +# 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. +from __future__ import annotations + +from typing import Union + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +class IntegrationJiraSyncDueDate(ModelNormal): + @cached_property + def openapi_types(_): + return { + "jira_field_id": (str,), + "sync_type": (str,), + } + + attribute_map = { + "jira_field_id": "jira_field_id", + "sync_type": "sync_type", + } + + def __init__( + self_, jira_field_id: Union[str, UnsetType] = unset, sync_type: Union[str, UnsetType] = unset, **kwargs + ): + """ + + + :param jira_field_id: + :type jira_field_id: str, optional + + :param sync_type: + :type sync_type: str, optional + """ + if jira_field_id is not unset: + kwargs["jira_field_id"] = jira_field_id + if sync_type is not unset: + kwargs["sync_type"] = sync_type + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/integration_jira_sync_properties.py b/src/datadog_api_client/v2/model/integration_jira_sync_properties.py new file mode 100644 index 0000000000..536fad19a6 --- /dev/null +++ b/src/datadog_api_client/v2/model/integration_jira_sync_properties.py @@ -0,0 +1,114 @@ +# 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. +from __future__ import annotations + +from typing import Dict, Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.sync_property import SyncProperty + from datadog_api_client.v2.model.integration_jira_sync_properties_custom_fields_additional_properties import ( + IntegrationJiraSyncPropertiesCustomFieldsAdditionalProperties, + ) + from datadog_api_client.v2.model.integration_jira_sync_due_date import IntegrationJiraSyncDueDate + from datadog_api_client.v2.model.sync_property_with_mapping import SyncPropertyWithMapping + + +class IntegrationJiraSyncProperties(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.sync_property import SyncProperty + from datadog_api_client.v2.model.integration_jira_sync_properties_custom_fields_additional_properties import ( + IntegrationJiraSyncPropertiesCustomFieldsAdditionalProperties, + ) + from datadog_api_client.v2.model.integration_jira_sync_due_date import IntegrationJiraSyncDueDate + from datadog_api_client.v2.model.sync_property_with_mapping import SyncPropertyWithMapping + + return { + "assignee": (SyncProperty,), + "comments": (SyncProperty,), + "custom_fields": ({str: (IntegrationJiraSyncPropertiesCustomFieldsAdditionalProperties,)},), + "description": (SyncProperty,), + "due_date": (IntegrationJiraSyncDueDate,), + "priority": (SyncPropertyWithMapping,), + "status": (SyncPropertyWithMapping,), + "title": (SyncProperty,), + } + + attribute_map = { + "assignee": "assignee", + "comments": "comments", + "custom_fields": "custom_fields", + "description": "description", + "due_date": "due_date", + "priority": "priority", + "status": "status", + "title": "title", + } + + def __init__( + self_, + assignee: Union[SyncProperty, UnsetType] = unset, + comments: Union[SyncProperty, UnsetType] = unset, + custom_fields: Union[ + Dict[str, IntegrationJiraSyncPropertiesCustomFieldsAdditionalProperties], UnsetType + ] = unset, + description: Union[SyncProperty, UnsetType] = unset, + due_date: Union[IntegrationJiraSyncDueDate, UnsetType] = unset, + priority: Union[SyncPropertyWithMapping, UnsetType] = unset, + status: Union[SyncPropertyWithMapping, UnsetType] = unset, + title: Union[SyncProperty, UnsetType] = unset, + **kwargs, + ): + """ + + + :param assignee: Sync property configuration + :type assignee: SyncProperty, optional + + :param comments: Sync property configuration + :type comments: SyncProperty, optional + + :param custom_fields: + :type custom_fields: {str: (IntegrationJiraSyncPropertiesCustomFieldsAdditionalProperties,)}, optional + + :param description: Sync property configuration + :type description: SyncProperty, optional + + :param due_date: + :type due_date: IntegrationJiraSyncDueDate, optional + + :param priority: Sync property with mapping configuration + :type priority: SyncPropertyWithMapping, optional + + :param status: Sync property with mapping configuration + :type status: SyncPropertyWithMapping, optional + + :param title: Sync property configuration + :type title: SyncProperty, optional + """ + if assignee is not unset: + kwargs["assignee"] = assignee + if comments is not unset: + kwargs["comments"] = comments + if custom_fields is not unset: + kwargs["custom_fields"] = custom_fields + if description is not unset: + kwargs["description"] = description + if due_date is not unset: + kwargs["due_date"] = due_date + if priority is not unset: + kwargs["priority"] = priority + if status is not unset: + kwargs["status"] = status + if title is not unset: + kwargs["title"] = title + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/integration_jira_sync_properties_custom_fields_additional_properties.py b/src/datadog_api_client/v2/model/integration_jira_sync_properties_custom_fields_additional_properties.py new file mode 100644 index 0000000000..858cb7758f --- /dev/null +++ b/src/datadog_api_client/v2/model/integration_jira_sync_properties_custom_fields_additional_properties.py @@ -0,0 +1,63 @@ +# 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. +from __future__ import annotations + +from typing import List, Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + none_type, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.any_value import AnyValue + from datadog_api_client.v2.model.any_value_object import AnyValueObject + from datadog_api_client.v2.model.any_value_item import AnyValueItem + + +class IntegrationJiraSyncPropertiesCustomFieldsAdditionalProperties(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.any_value import AnyValue + + return { + "sync_type": (str,), + "value": (AnyValue,), + } + + attribute_map = { + "sync_type": "sync_type", + "value": "value", + } + + def __init__( + self_, + sync_type: Union[str, UnsetType] = unset, + value: Union[ + Union[ + AnyValue, str, float, AnyValueObject, List[Union[AnyValueItem, str, float, AnyValueObject, bool]], bool + ], + none_type, + UnsetType, + ] = unset, + **kwargs, + ): + """ + + + :param sync_type: + :type sync_type: str, optional + + :param value: Represents any valid JSON value. + :type value: AnyValue, none_type, optional + """ + if sync_type is not unset: + kwargs["sync_type"] = sync_type + if value is not unset: + kwargs["value"] = value + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/integration_monitor.py b/src/datadog_api_client/v2/model/integration_monitor.py new file mode 100644 index 0000000000..583f85d73c --- /dev/null +++ b/src/datadog_api_client/v2/model/integration_monitor.py @@ -0,0 +1,64 @@ +# 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. +from __future__ import annotations + +from typing import Union + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +class IntegrationMonitor(ModelNormal): + @cached_property + def openapi_types(_): + return { + "auto_resolve_enabled": (bool,), + "case_type_id": (str,), + "enabled": (bool,), + "handle": (str,), + } + + attribute_map = { + "auto_resolve_enabled": "auto_resolve_enabled", + "case_type_id": "case_type_id", + "enabled": "enabled", + "handle": "handle", + } + + def __init__( + self_, + auto_resolve_enabled: Union[bool, UnsetType] = unset, + case_type_id: Union[str, UnsetType] = unset, + enabled: Union[bool, UnsetType] = unset, + handle: Union[str, UnsetType] = unset, + **kwargs, + ): + """ + Monitor integration settings + + :param auto_resolve_enabled: Whether auto-resolve is enabled + :type auto_resolve_enabled: bool, optional + + :param case_type_id: Case type ID for monitor integration + :type case_type_id: str, optional + + :param enabled: Whether monitor integration is enabled + :type enabled: bool, optional + + :param handle: Monitor handle + :type handle: str, optional + """ + if auto_resolve_enabled is not unset: + kwargs["auto_resolve_enabled"] = auto_resolve_enabled + if case_type_id is not unset: + kwargs["case_type_id"] = case_type_id + if enabled is not unset: + kwargs["enabled"] = enabled + if handle is not unset: + kwargs["handle"] = handle + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/integration_on_call.py b/src/datadog_api_client/v2/model/integration_on_call.py new file mode 100644 index 0000000000..2579dfd7af --- /dev/null +++ b/src/datadog_api_client/v2/model/integration_on_call.py @@ -0,0 +1,66 @@ +# 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. +from __future__ import annotations + +from typing import List, Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.integration_on_call_escalation_queries_items import ( + IntegrationOnCallEscalationQueriesItems, + ) + + +class IntegrationOnCall(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.integration_on_call_escalation_queries_items import ( + IntegrationOnCallEscalationQueriesItems, + ) + + return { + "auto_assign_on_call": (bool,), + "enabled": (bool,), + "escalation_queries": ([IntegrationOnCallEscalationQueriesItems],), + } + + attribute_map = { + "auto_assign_on_call": "auto_assign_on_call", + "enabled": "enabled", + "escalation_queries": "escalation_queries", + } + + def __init__( + self_, + auto_assign_on_call: Union[bool, UnsetType] = unset, + enabled: Union[bool, UnsetType] = unset, + escalation_queries: Union[List[IntegrationOnCallEscalationQueriesItems], UnsetType] = unset, + **kwargs, + ): + """ + On-Call integration settings + + :param auto_assign_on_call: Whether to auto-assign on-call + :type auto_assign_on_call: bool, optional + + :param enabled: Whether On-Call integration is enabled + :type enabled: bool, optional + + :param escalation_queries: + :type escalation_queries: [IntegrationOnCallEscalationQueriesItems], optional + """ + if auto_assign_on_call is not unset: + kwargs["auto_assign_on_call"] = auto_assign_on_call + if enabled is not unset: + kwargs["enabled"] = enabled + if escalation_queries is not unset: + kwargs["escalation_queries"] = escalation_queries + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/integration_on_call_escalation_queries_items.py b/src/datadog_api_client/v2/model/integration_on_call_escalation_queries_items.py new file mode 100644 index 0000000000..d28386944a --- /dev/null +++ b/src/datadog_api_client/v2/model/integration_on_call_escalation_queries_items.py @@ -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. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.integration_on_call_escalation_queries_items_target import ( + IntegrationOnCallEscalationQueriesItemsTarget, + ) + + +class IntegrationOnCallEscalationQueriesItems(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.integration_on_call_escalation_queries_items_target import ( + IntegrationOnCallEscalationQueriesItemsTarget, + ) + + return { + "enabled": (bool,), + "id": (str,), + "query": (str,), + "target": (IntegrationOnCallEscalationQueriesItemsTarget,), + } + + attribute_map = { + "enabled": "enabled", + "id": "id", + "query": "query", + "target": "target", + } + + def __init__( + self_, + enabled: Union[bool, UnsetType] = unset, + id: Union[str, UnsetType] = unset, + query: Union[str, UnsetType] = unset, + target: Union[IntegrationOnCallEscalationQueriesItemsTarget, UnsetType] = unset, + **kwargs, + ): + """ + + + :param enabled: + :type enabled: bool, optional + + :param id: + :type id: str, optional + + :param query: + :type query: str, optional + + :param target: + :type target: IntegrationOnCallEscalationQueriesItemsTarget, optional + """ + if enabled is not unset: + kwargs["enabled"] = enabled + if id is not unset: + kwargs["id"] = id + if query is not unset: + kwargs["query"] = query + if target is not unset: + kwargs["target"] = target + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/integration_on_call_escalation_queries_items_target.py b/src/datadog_api_client/v2/model/integration_on_call_escalation_queries_items_target.py new file mode 100644 index 0000000000..d9cf0d3d3c --- /dev/null +++ b/src/datadog_api_client/v2/model/integration_on_call_escalation_queries_items_target.py @@ -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. +from __future__ import annotations + +from typing import Union + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +class IntegrationOnCallEscalationQueriesItemsTarget(ModelNormal): + @cached_property + def openapi_types(_): + return { + "dynamic_team_paging": (bool,), + "team_id": (str,), + "user_id": (str,), + } + + attribute_map = { + "dynamic_team_paging": "dynamic_team_paging", + "team_id": "team_id", + "user_id": "user_id", + } + + def __init__( + self_, + dynamic_team_paging: Union[bool, UnsetType] = unset, + team_id: Union[str, UnsetType] = unset, + user_id: Union[str, UnsetType] = unset, + **kwargs, + ): + """ + + + :param dynamic_team_paging: + :type dynamic_team_paging: bool, optional + + :param team_id: + :type team_id: str, optional + + :param user_id: + :type user_id: str, optional + """ + if dynamic_team_paging is not unset: + kwargs["dynamic_team_paging"] = dynamic_team_paging + if team_id is not unset: + kwargs["team_id"] = team_id + if user_id is not unset: + kwargs["user_id"] = user_id + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/integration_service_now.py b/src/datadog_api_client/v2/model/integration_service_now.py new file mode 100644 index 0000000000..9b8d297148 --- /dev/null +++ b/src/datadog_api_client/v2/model/integration_service_now.py @@ -0,0 +1,80 @@ +# 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. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.integration_service_now_auto_creation import IntegrationServiceNowAutoCreation + from datadog_api_client.v2.model.integration_service_now_sync_config import IntegrationServiceNowSyncConfig + + +class IntegrationServiceNow(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.integration_service_now_auto_creation import IntegrationServiceNowAutoCreation + from datadog_api_client.v2.model.integration_service_now_sync_config import IntegrationServiceNowSyncConfig + + return { + "assignment_group": (str,), + "auto_creation": (IntegrationServiceNowAutoCreation,), + "enabled": (bool,), + "instance_name": (str,), + "sync_config": (IntegrationServiceNowSyncConfig,), + } + + attribute_map = { + "assignment_group": "assignment_group", + "auto_creation": "auto_creation", + "enabled": "enabled", + "instance_name": "instance_name", + "sync_config": "sync_config", + } + + def __init__( + self_, + assignment_group: Union[str, UnsetType] = unset, + auto_creation: Union[IntegrationServiceNowAutoCreation, UnsetType] = unset, + enabled: Union[bool, UnsetType] = unset, + instance_name: Union[str, UnsetType] = unset, + sync_config: Union[IntegrationServiceNowSyncConfig, UnsetType] = unset, + **kwargs, + ): + """ + ServiceNow integration settings + + :param assignment_group: Assignment group + :type assignment_group: str, optional + + :param auto_creation: + :type auto_creation: IntegrationServiceNowAutoCreation, optional + + :param enabled: Whether ServiceNow integration is enabled + :type enabled: bool, optional + + :param instance_name: ServiceNow instance name + :type instance_name: str, optional + + :param sync_config: + :type sync_config: IntegrationServiceNowSyncConfig, optional + """ + if assignment_group is not unset: + kwargs["assignment_group"] = assignment_group + if auto_creation is not unset: + kwargs["auto_creation"] = auto_creation + if enabled is not unset: + kwargs["enabled"] = enabled + if instance_name is not unset: + kwargs["instance_name"] = instance_name + if sync_config is not unset: + kwargs["sync_config"] = sync_config + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/integration_service_now_auto_creation.py b/src/datadog_api_client/v2/model/integration_service_now_auto_creation.py new file mode 100644 index 0000000000..79e21829ad --- /dev/null +++ b/src/datadog_api_client/v2/model/integration_service_now_auto_creation.py @@ -0,0 +1,36 @@ +# 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. +from __future__ import annotations + +from typing import Union + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +class IntegrationServiceNowAutoCreation(ModelNormal): + @cached_property + def openapi_types(_): + return { + "enabled": (bool,), + } + + attribute_map = { + "enabled": "enabled", + } + + def __init__(self_, enabled: Union[bool, UnsetType] = unset, **kwargs): + """ + + + :param enabled: + :type enabled: bool, optional + """ + if enabled is not unset: + kwargs["enabled"] = enabled + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/integration_service_now_sync_config.py b/src/datadog_api_client/v2/model/integration_service_now_sync_config.py new file mode 100644 index 0000000000..6042332ba9 --- /dev/null +++ b/src/datadog_api_client/v2/model/integration_service_now_sync_config.py @@ -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. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.integration_service_now_sync_config139772721534496 import ( + IntegrationServiceNowSyncConfig139772721534496, + ) + + +class IntegrationServiceNowSyncConfig(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.integration_service_now_sync_config139772721534496 import ( + IntegrationServiceNowSyncConfig139772721534496, + ) + + return { + "enabled": (bool,), + "properties": (IntegrationServiceNowSyncConfig139772721534496,), + } + + attribute_map = { + "enabled": "enabled", + "properties": "properties", + } + + def __init__( + self_, + enabled: Union[bool, UnsetType] = unset, + properties: Union[IntegrationServiceNowSyncConfig139772721534496, UnsetType] = unset, + **kwargs, + ): + """ + + + :param enabled: + :type enabled: bool, optional + + :param properties: + :type properties: IntegrationServiceNowSyncConfig139772721534496, optional + """ + if enabled is not unset: + kwargs["enabled"] = enabled + if properties is not unset: + kwargs["properties"] = properties + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/integration_service_now_sync_config139772721534496.py b/src/datadog_api_client/v2/model/integration_service_now_sync_config139772721534496.py new file mode 100644 index 0000000000..5b142ff2fc --- /dev/null +++ b/src/datadog_api_client/v2/model/integration_service_now_sync_config139772721534496.py @@ -0,0 +1,70 @@ +# 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. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.sync_property import SyncProperty + from datadog_api_client.v2.model.integration_service_now_sync_config_priority import ( + IntegrationServiceNowSyncConfigPriority, + ) + from datadog_api_client.v2.model.sync_property_with_mapping import SyncPropertyWithMapping + + +class IntegrationServiceNowSyncConfig139772721534496(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.sync_property import SyncProperty + from datadog_api_client.v2.model.integration_service_now_sync_config_priority import ( + IntegrationServiceNowSyncConfigPriority, + ) + from datadog_api_client.v2.model.sync_property_with_mapping import SyncPropertyWithMapping + + return { + "comments": (SyncProperty,), + "priority": (IntegrationServiceNowSyncConfigPriority,), + "status": (SyncPropertyWithMapping,), + } + + attribute_map = { + "comments": "comments", + "priority": "priority", + "status": "status", + } + + def __init__( + self_, + comments: Union[SyncProperty, UnsetType] = unset, + priority: Union[IntegrationServiceNowSyncConfigPriority, UnsetType] = unset, + status: Union[SyncPropertyWithMapping, UnsetType] = unset, + **kwargs, + ): + """ + + + :param comments: Sync property configuration + :type comments: SyncProperty, optional + + :param priority: + :type priority: IntegrationServiceNowSyncConfigPriority, optional + + :param status: Sync property with mapping configuration + :type status: SyncPropertyWithMapping, optional + """ + if comments is not unset: + kwargs["comments"] = comments + if priority is not unset: + kwargs["priority"] = priority + if status is not unset: + kwargs["status"] = status + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/integration_service_now_sync_config_priority.py b/src/datadog_api_client/v2/model/integration_service_now_sync_config_priority.py new file mode 100644 index 0000000000..67347e78f8 --- /dev/null +++ b/src/datadog_api_client/v2/model/integration_service_now_sync_config_priority.py @@ -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. +from __future__ import annotations + +from typing import Dict, Union + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +class IntegrationServiceNowSyncConfigPriority(ModelNormal): + @cached_property + def openapi_types(_): + return { + "impact_mapping": ({str: (str,)},), + "sync_type": (str,), + "urgency_mapping": ({str: (str,)},), + } + + attribute_map = { + "impact_mapping": "impact_mapping", + "sync_type": "sync_type", + "urgency_mapping": "urgency_mapping", + } + + def __init__( + self_, + impact_mapping: Union[Dict[str, str], UnsetType] = unset, + sync_type: Union[str, UnsetType] = unset, + urgency_mapping: Union[Dict[str, str], UnsetType] = unset, + **kwargs, + ): + """ + + + :param impact_mapping: + :type impact_mapping: {str: (str,)}, optional + + :param sync_type: + :type sync_type: str, optional + + :param urgency_mapping: + :type urgency_mapping: {str: (str,)}, optional + """ + if impact_mapping is not unset: + kwargs["impact_mapping"] = impact_mapping + if sync_type is not unset: + kwargs["sync_type"] = sync_type + if urgency_mapping is not unset: + kwargs["urgency_mapping"] = urgency_mapping + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/project_attributes.py b/src/datadog_api_client/v2/model/project_attributes.py index 5ab7c79194..425a8a133e 100644 --- a/src/datadog_api_client/v2/model/project_attributes.py +++ b/src/datadog_api_client/v2/model/project_attributes.py @@ -3,7 +3,7 @@ # Copyright 2019-Present Datadog, Inc. from __future__ import annotations -from typing import Union +from typing import List, Union, TYPE_CHECKING from datadog_api_client.model_utils import ( ModelNormal, @@ -13,31 +13,76 @@ ) +if TYPE_CHECKING: + from datadog_api_client.v2.model.project_columns_config import ProjectColumnsConfig + from datadog_api_client.v2.model.project_settings import ProjectSettings + + class ProjectAttributes(ModelNormal): @cached_property def openapi_types(_): + from datadog_api_client.v2.model.project_columns_config import ProjectColumnsConfig + from datadog_api_client.v2.model.project_settings import ProjectSettings + return { + "columns_config": (ProjectColumnsConfig,), + "enabled_custom_case_types": ([str],), "key": (str,), "name": (str,), + "restricted": (bool,), + "settings": (ProjectSettings,), } attribute_map = { + "columns_config": "columns_config", + "enabled_custom_case_types": "enabled_custom_case_types", "key": "key", "name": "name", + "restricted": "restricted", + "settings": "settings", } - def __init__(self_, key: Union[str, UnsetType] = unset, name: Union[str, UnsetType] = unset, **kwargs): + def __init__( + self_, + columns_config: Union[ProjectColumnsConfig, UnsetType] = unset, + enabled_custom_case_types: Union[List[str], UnsetType] = unset, + key: Union[str, UnsetType] = unset, + name: Union[str, UnsetType] = unset, + restricted: Union[bool, UnsetType] = unset, + settings: Union[ProjectSettings, UnsetType] = unset, + **kwargs, + ): """ Project attributes + :param columns_config: Project columns configuration + :type columns_config: ProjectColumnsConfig, optional + + :param enabled_custom_case_types: List of enabled custom case type IDs + :type enabled_custom_case_types: [str], optional + :param key: The project's key :type key: str, optional :param name: Project's name :type name: str, optional + + :param restricted: Whether the project is restricted + :type restricted: bool, optional + + :param settings: Project settings + :type settings: ProjectSettings, optional """ + if columns_config is not unset: + kwargs["columns_config"] = columns_config + if enabled_custom_case_types is not unset: + kwargs["enabled_custom_case_types"] = enabled_custom_case_types if key is not unset: kwargs["key"] = key if name is not unset: kwargs["name"] = name + if restricted is not unset: + kwargs["restricted"] = restricted + if settings is not unset: + kwargs["settings"] = settings super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/project_columns_config.py b/src/datadog_api_client/v2/model/project_columns_config.py new file mode 100644 index 0000000000..24bd5a5098 --- /dev/null +++ b/src/datadog_api_client/v2/model/project_columns_config.py @@ -0,0 +1,42 @@ +# 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. +from __future__ import annotations + +from typing import List, Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.project_columns_config_columns_items import ProjectColumnsConfigColumnsItems + + +class ProjectColumnsConfig(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.project_columns_config_columns_items import ProjectColumnsConfigColumnsItems + + return { + "columns": ([ProjectColumnsConfigColumnsItems],), + } + + attribute_map = { + "columns": "columns", + } + + def __init__(self_, columns: Union[List[ProjectColumnsConfigColumnsItems], UnsetType] = unset, **kwargs): + """ + Project columns configuration + + :param columns: + :type columns: [ProjectColumnsConfigColumnsItems], optional + """ + if columns is not unset: + kwargs["columns"] = columns + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/project_columns_config_columns_items.py b/src/datadog_api_client/v2/model/project_columns_config_columns_items.py new file mode 100644 index 0000000000..c9057f0e98 --- /dev/null +++ b/src/datadog_api_client/v2/model/project_columns_config_columns_items.py @@ -0,0 +1,66 @@ +# 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. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.project_columns_config_columns_items_sort import ( + ProjectColumnsConfigColumnsItemsSort, + ) + + +class ProjectColumnsConfigColumnsItems(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.project_columns_config_columns_items_sort import ( + ProjectColumnsConfigColumnsItemsSort, + ) + + return { + "sort": (ProjectColumnsConfigColumnsItemsSort,), + "sort_field": (str,), + "type": (str,), + } + + attribute_map = { + "sort": "sort", + "sort_field": "sort_field", + "type": "type", + } + + def __init__( + self_, + sort: Union[ProjectColumnsConfigColumnsItemsSort, UnsetType] = unset, + sort_field: Union[str, UnsetType] = unset, + type: Union[str, UnsetType] = unset, + **kwargs, + ): + """ + + + :param sort: + :type sort: ProjectColumnsConfigColumnsItemsSort, optional + + :param sort_field: + :type sort_field: str, optional + + :param type: + :type type: str, optional + """ + if sort is not unset: + kwargs["sort"] = sort + if sort_field is not unset: + kwargs["sort_field"] = sort_field + if type is not unset: + kwargs["type"] = type + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/project_columns_config_columns_items_sort.py b/src/datadog_api_client/v2/model/project_columns_config_columns_items_sort.py new file mode 100644 index 0000000000..e65dbfa68f --- /dev/null +++ b/src/datadog_api_client/v2/model/project_columns_config_columns_items_sort.py @@ -0,0 +1,43 @@ +# 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. +from __future__ import annotations + +from typing import Union + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +class ProjectColumnsConfigColumnsItemsSort(ModelNormal): + @cached_property + def openapi_types(_): + return { + "ascending": (bool,), + "priority": (int,), + } + + attribute_map = { + "ascending": "ascending", + "priority": "priority", + } + + def __init__(self_, ascending: Union[bool, UnsetType] = unset, priority: Union[int, UnsetType] = unset, **kwargs): + """ + + + :param ascending: + :type ascending: bool, optional + + :param priority: + :type priority: int, optional + """ + if ascending is not unset: + kwargs["ascending"] = ascending + if priority is not unset: + kwargs["priority"] = priority + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/project_create_attributes.py b/src/datadog_api_client/v2/model/project_create_attributes.py index 0ddc8e2567..8167dd0e6e 100644 --- a/src/datadog_api_client/v2/model/project_create_attributes.py +++ b/src/datadog_api_client/v2/model/project_create_attributes.py @@ -3,10 +3,13 @@ # Copyright 2019-Present Datadog, Inc. from __future__ import annotations +from typing import List, Union from datadog_api_client.model_utils import ( ModelNormal, cached_property, + unset, + UnsetType, ) @@ -14,25 +17,46 @@ class ProjectCreateAttributes(ModelNormal): @cached_property def openapi_types(_): return { + "enabled_custom_case_types": ([str],), "key": (str,), "name": (str,), + "team_uuid": (str,), } attribute_map = { + "enabled_custom_case_types": "enabled_custom_case_types", "key": "key", "name": "name", + "team_uuid": "team_uuid", } - def __init__(self_, key: str, name: str, **kwargs): + def __init__( + self_, + key: str, + name: str, + enabled_custom_case_types: Union[List[str], UnsetType] = unset, + team_uuid: Union[str, UnsetType] = unset, + **kwargs, + ): """ Project creation attributes + :param enabled_custom_case_types: List of enabled custom case type IDs + :type enabled_custom_case_types: [str], optional + :param key: Project's key. Cannot be "CASE" :type key: str - :param name: name + :param name: Project name :type name: str + + :param team_uuid: Team UUID to associate with the project + :type team_uuid: str, optional """ + if enabled_custom_case_types is not unset: + kwargs["enabled_custom_case_types"] = enabled_custom_case_types + if team_uuid is not unset: + kwargs["team_uuid"] = team_uuid super().__init__(kwargs) self_.key = key diff --git a/src/datadog_api_client/v2/model/project_notification_settings.py b/src/datadog_api_client/v2/model/project_notification_settings.py new file mode 100644 index 0000000000..b8405ef812 --- /dev/null +++ b/src/datadog_api_client/v2/model/project_notification_settings.py @@ -0,0 +1,104 @@ +# 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. +from __future__ import annotations + +from typing import List, Union + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +class ProjectNotificationSettings(ModelNormal): + @cached_property + def openapi_types(_): + return { + "destinations": ([int],), + "enabled": (bool,), + "notify_on_case_assignment": (bool,), + "notify_on_case_closed": (bool,), + "notify_on_case_comment": (bool,), + "notify_on_case_comment_mention": (bool,), + "notify_on_case_priority_change": (bool,), + "notify_on_case_status_change": (bool,), + "notify_on_case_unassignment": (bool,), + } + + attribute_map = { + "destinations": "destinations", + "enabled": "enabled", + "notify_on_case_assignment": "notify_on_case_assignment", + "notify_on_case_closed": "notify_on_case_closed", + "notify_on_case_comment": "notify_on_case_comment", + "notify_on_case_comment_mention": "notify_on_case_comment_mention", + "notify_on_case_priority_change": "notify_on_case_priority_change", + "notify_on_case_status_change": "notify_on_case_status_change", + "notify_on_case_unassignment": "notify_on_case_unassignment", + } + + def __init__( + self_, + destinations: Union[List[int], UnsetType] = unset, + enabled: Union[bool, UnsetType] = unset, + notify_on_case_assignment: Union[bool, UnsetType] = unset, + notify_on_case_closed: Union[bool, UnsetType] = unset, + notify_on_case_comment: Union[bool, UnsetType] = unset, + notify_on_case_comment_mention: Union[bool, UnsetType] = unset, + notify_on_case_priority_change: Union[bool, UnsetType] = unset, + notify_on_case_status_change: Union[bool, UnsetType] = unset, + notify_on_case_unassignment: Union[bool, UnsetType] = unset, + **kwargs, + ): + """ + Project notification settings + + :param destinations: Notification destinations (1=email, 2=slack, 3=in-app) + :type destinations: [int], optional + + :param enabled: Whether notifications are enabled + :type enabled: bool, optional + + :param notify_on_case_assignment: + :type notify_on_case_assignment: bool, optional + + :param notify_on_case_closed: + :type notify_on_case_closed: bool, optional + + :param notify_on_case_comment: + :type notify_on_case_comment: bool, optional + + :param notify_on_case_comment_mention: + :type notify_on_case_comment_mention: bool, optional + + :param notify_on_case_priority_change: + :type notify_on_case_priority_change: bool, optional + + :param notify_on_case_status_change: + :type notify_on_case_status_change: bool, optional + + :param notify_on_case_unassignment: + :type notify_on_case_unassignment: bool, optional + """ + if destinations is not unset: + kwargs["destinations"] = destinations + if enabled is not unset: + kwargs["enabled"] = enabled + if notify_on_case_assignment is not unset: + kwargs["notify_on_case_assignment"] = notify_on_case_assignment + if notify_on_case_closed is not unset: + kwargs["notify_on_case_closed"] = notify_on_case_closed + if notify_on_case_comment is not unset: + kwargs["notify_on_case_comment"] = notify_on_case_comment + if notify_on_case_comment_mention is not unset: + kwargs["notify_on_case_comment_mention"] = notify_on_case_comment_mention + if notify_on_case_priority_change is not unset: + kwargs["notify_on_case_priority_change"] = notify_on_case_priority_change + if notify_on_case_status_change is not unset: + kwargs["notify_on_case_status_change"] = notify_on_case_status_change + if notify_on_case_unassignment is not unset: + kwargs["notify_on_case_unassignment"] = notify_on_case_unassignment + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/project_settings.py b/src/datadog_api_client/v2/model/project_settings.py new file mode 100644 index 0000000000..51af6b2002 --- /dev/null +++ b/src/datadog_api_client/v2/model/project_settings.py @@ -0,0 +1,116 @@ +# 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. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.auto_close_inactive_cases import AutoCloseInactiveCases + from datadog_api_client.v2.model.auto_transition_assigned_cases import AutoTransitionAssignedCases + from datadog_api_client.v2.model.integration_incident import IntegrationIncident + from datadog_api_client.v2.model.integration_jira import IntegrationJira + from datadog_api_client.v2.model.integration_monitor import IntegrationMonitor + from datadog_api_client.v2.model.integration_on_call import IntegrationOnCall + from datadog_api_client.v2.model.integration_service_now import IntegrationServiceNow + from datadog_api_client.v2.model.project_notification_settings import ProjectNotificationSettings + + +class ProjectSettings(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.auto_close_inactive_cases import AutoCloseInactiveCases + from datadog_api_client.v2.model.auto_transition_assigned_cases import AutoTransitionAssignedCases + from datadog_api_client.v2.model.integration_incident import IntegrationIncident + from datadog_api_client.v2.model.integration_jira import IntegrationJira + from datadog_api_client.v2.model.integration_monitor import IntegrationMonitor + from datadog_api_client.v2.model.integration_on_call import IntegrationOnCall + from datadog_api_client.v2.model.integration_service_now import IntegrationServiceNow + from datadog_api_client.v2.model.project_notification_settings import ProjectNotificationSettings + + return { + "auto_close_inactive_cases": (AutoCloseInactiveCases,), + "auto_transition_assigned_cases": (AutoTransitionAssignedCases,), + "integration_incident": (IntegrationIncident,), + "integration_jira": (IntegrationJira,), + "integration_monitor": (IntegrationMonitor,), + "integration_on_call": (IntegrationOnCall,), + "integration_service_now": (IntegrationServiceNow,), + "notification": (ProjectNotificationSettings,), + } + + attribute_map = { + "auto_close_inactive_cases": "auto_close_inactive_cases", + "auto_transition_assigned_cases": "auto_transition_assigned_cases", + "integration_incident": "integration_incident", + "integration_jira": "integration_jira", + "integration_monitor": "integration_monitor", + "integration_on_call": "integration_on_call", + "integration_service_now": "integration_service_now", + "notification": "notification", + } + + def __init__( + self_, + auto_close_inactive_cases: Union[AutoCloseInactiveCases, UnsetType] = unset, + auto_transition_assigned_cases: Union[AutoTransitionAssignedCases, UnsetType] = unset, + integration_incident: Union[IntegrationIncident, UnsetType] = unset, + integration_jira: Union[IntegrationJira, UnsetType] = unset, + integration_monitor: Union[IntegrationMonitor, UnsetType] = unset, + integration_on_call: Union[IntegrationOnCall, UnsetType] = unset, + integration_service_now: Union[IntegrationServiceNow, UnsetType] = unset, + notification: Union[ProjectNotificationSettings, UnsetType] = unset, + **kwargs, + ): + """ + Project settings + + :param auto_close_inactive_cases: Auto-close inactive cases settings + :type auto_close_inactive_cases: AutoCloseInactiveCases, optional + + :param auto_transition_assigned_cases: Auto-transition assigned cases settings + :type auto_transition_assigned_cases: AutoTransitionAssignedCases, optional + + :param integration_incident: Incident integration settings + :type integration_incident: IntegrationIncident, optional + + :param integration_jira: Jira integration settings + :type integration_jira: IntegrationJira, optional + + :param integration_monitor: Monitor integration settings + :type integration_monitor: IntegrationMonitor, optional + + :param integration_on_call: On-Call integration settings + :type integration_on_call: IntegrationOnCall, optional + + :param integration_service_now: ServiceNow integration settings + :type integration_service_now: IntegrationServiceNow, optional + + :param notification: Project notification settings + :type notification: ProjectNotificationSettings, optional + """ + if auto_close_inactive_cases is not unset: + kwargs["auto_close_inactive_cases"] = auto_close_inactive_cases + if auto_transition_assigned_cases is not unset: + kwargs["auto_transition_assigned_cases"] = auto_transition_assigned_cases + if integration_incident is not unset: + kwargs["integration_incident"] = integration_incident + if integration_jira is not unset: + kwargs["integration_jira"] = integration_jira + if integration_monitor is not unset: + kwargs["integration_monitor"] = integration_monitor + if integration_on_call is not unset: + kwargs["integration_on_call"] = integration_on_call + if integration_service_now is not unset: + kwargs["integration_service_now"] = integration_service_now + if notification is not unset: + kwargs["notification"] = notification + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/project_update.py b/src/datadog_api_client/v2/model/project_update.py new file mode 100644 index 0000000000..af23d83ff7 --- /dev/null +++ b/src/datadog_api_client/v2/model/project_update.py @@ -0,0 +1,53 @@ +# 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. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.project_update_attributes import ProjectUpdateAttributes + from datadog_api_client.v2.model.project_resource_type import ProjectResourceType + + +class ProjectUpdate(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.project_update_attributes import ProjectUpdateAttributes + from datadog_api_client.v2.model.project_resource_type import ProjectResourceType + + return { + "attributes": (ProjectUpdateAttributes,), + "type": (ProjectResourceType,), + } + + attribute_map = { + "attributes": "attributes", + "type": "type", + } + + def __init__( + self_, type: ProjectResourceType, attributes: Union[ProjectUpdateAttributes, UnsetType] = unset, **kwargs + ): + """ + Project update + + :param attributes: Project update attributes + :type attributes: ProjectUpdateAttributes, optional + + :param type: Project resource type + :type type: ProjectResourceType + """ + if attributes is not unset: + kwargs["attributes"] = attributes + super().__init__(kwargs) + + self_.type = type diff --git a/src/datadog_api_client/v2/model/project_update_attributes.py b/src/datadog_api_client/v2/model/project_update_attributes.py new file mode 100644 index 0000000000..c0650100a2 --- /dev/null +++ b/src/datadog_api_client/v2/model/project_update_attributes.py @@ -0,0 +1,80 @@ +# 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. +from __future__ import annotations + +from typing import List, Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.project_columns_config import ProjectColumnsConfig + from datadog_api_client.v2.model.project_settings import ProjectSettings + + +class ProjectUpdateAttributes(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.project_columns_config import ProjectColumnsConfig + from datadog_api_client.v2.model.project_settings import ProjectSettings + + return { + "columns_config": (ProjectColumnsConfig,), + "enabled_custom_case_types": ([str],), + "name": (str,), + "settings": (ProjectSettings,), + "team_uuid": (str,), + } + + attribute_map = { + "columns_config": "columns_config", + "enabled_custom_case_types": "enabled_custom_case_types", + "name": "name", + "settings": "settings", + "team_uuid": "team_uuid", + } + + def __init__( + self_, + columns_config: Union[ProjectColumnsConfig, UnsetType] = unset, + enabled_custom_case_types: Union[List[str], UnsetType] = unset, + name: Union[str, UnsetType] = unset, + settings: Union[ProjectSettings, UnsetType] = unset, + team_uuid: Union[str, UnsetType] = unset, + **kwargs, + ): + """ + Project update attributes + + :param columns_config: Project columns configuration + :type columns_config: ProjectColumnsConfig, optional + + :param enabled_custom_case_types: List of enabled custom case type IDs + :type enabled_custom_case_types: [str], optional + + :param name: Project name + :type name: str, optional + + :param settings: Project settings + :type settings: ProjectSettings, optional + + :param team_uuid: Team UUID to associate with the project + :type team_uuid: str, optional + """ + if columns_config is not unset: + kwargs["columns_config"] = columns_config + if enabled_custom_case_types is not unset: + kwargs["enabled_custom_case_types"] = enabled_custom_case_types + if name is not unset: + kwargs["name"] = name + if settings is not unset: + kwargs["settings"] = settings + if team_uuid is not unset: + kwargs["team_uuid"] = team_uuid + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/project_update_request.py b/src/datadog_api_client/v2/model/project_update_request.py new file mode 100644 index 0000000000..907229a657 --- /dev/null +++ b/src/datadog_api_client/v2/model/project_update_request.py @@ -0,0 +1,40 @@ +# 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. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.project_update import ProjectUpdate + + +class ProjectUpdateRequest(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.project_update import ProjectUpdate + + return { + "data": (ProjectUpdate,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: ProjectUpdate, **kwargs): + """ + Project update request + + :param data: Project update + :type data: ProjectUpdate + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/sync_property.py b/src/datadog_api_client/v2/model/sync_property.py new file mode 100644 index 0000000000..d507aa6d6a --- /dev/null +++ b/src/datadog_api_client/v2/model/sync_property.py @@ -0,0 +1,36 @@ +# 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. +from __future__ import annotations + +from typing import Union + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +class SyncProperty(ModelNormal): + @cached_property + def openapi_types(_): + return { + "sync_type": (str,), + } + + attribute_map = { + "sync_type": "sync_type", + } + + def __init__(self_, sync_type: Union[str, UnsetType] = unset, **kwargs): + """ + Sync property configuration + + :param sync_type: + :type sync_type: str, optional + """ + if sync_type is not unset: + kwargs["sync_type"] = sync_type + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/sync_property_with_mapping.py b/src/datadog_api_client/v2/model/sync_property_with_mapping.py new file mode 100644 index 0000000000..f9464f15f0 --- /dev/null +++ b/src/datadog_api_client/v2/model/sync_property_with_mapping.py @@ -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. +from __future__ import annotations + +from typing import Dict, Union + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +class SyncPropertyWithMapping(ModelNormal): + @cached_property + def openapi_types(_): + return { + "mapping": ({str: (str,)},), + "name_mapping": ({str: (str,)},), + "sync_type": (str,), + } + + attribute_map = { + "mapping": "mapping", + "name_mapping": "name_mapping", + "sync_type": "sync_type", + } + + def __init__( + self_, + mapping: Union[Dict[str, str], UnsetType] = unset, + name_mapping: Union[Dict[str, str], UnsetType] = unset, + sync_type: Union[str, UnsetType] = unset, + **kwargs, + ): + """ + Sync property with mapping configuration + + :param mapping: + :type mapping: {str: (str,)}, optional + + :param name_mapping: + :type name_mapping: {str: (str,)}, optional + + :param sync_type: + :type sync_type: str, optional + """ + if mapping is not unset: + kwargs["mapping"] = mapping + if name_mapping is not unset: + kwargs["name_mapping"] = name_mapping + if sync_type is not unset: + kwargs["sync_type"] = sync_type + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/models/__init__.py b/src/datadog_api_client/v2/models/__init__.py index 010c5fb61c..f2bfd4079c 100644 --- a/src/datadog_api_client/v2/models/__init__.py +++ b/src/datadog_api_client/v2/models/__init__.py @@ -156,6 +156,9 @@ from datadog_api_client.v2.model.anthropic_integration import AnthropicIntegration from datadog_api_client.v2.model.anthropic_integration_type import AnthropicIntegrationType from datadog_api_client.v2.model.anthropic_integration_update import AnthropicIntegrationUpdate +from datadog_api_client.v2.model.any_value import AnyValue +from datadog_api_client.v2.model.any_value_item import AnyValueItem +from datadog_api_client.v2.model.any_value_object import AnyValueObject from datadog_api_client.v2.model.apm_retention_filter_type import ApmRetentionFilterType from datadog_api_client.v2.model.app_builder_event import AppBuilderEvent from datadog_api_client.v2.model.app_builder_event_name import AppBuilderEventName @@ -417,6 +420,8 @@ from datadog_api_client.v2.model.authn_mappings_response import AuthNMappingsResponse from datadog_api_client.v2.model.authn_mappings_sort import AuthNMappingsSort from datadog_api_client.v2.model.authn_mappings_type import AuthNMappingsType +from datadog_api_client.v2.model.auto_close_inactive_cases import AutoCloseInactiveCases +from datadog_api_client.v2.model.auto_transition_assigned_cases import AutoTransitionAssignedCases from datadog_api_client.v2.model.aws_cur_config import AwsCURConfig from datadog_api_client.v2.model.aws_cur_config_attributes import AwsCURConfigAttributes from datadog_api_client.v2.model.aws_cur_config_patch_data import AwsCURConfigPatchData @@ -669,6 +674,20 @@ from datadog_api_client.v2.model.case_management_project import CaseManagementProject from datadog_api_client.v2.model.case_management_project_data import CaseManagementProjectData from datadog_api_client.v2.model.case_management_project_data_type import CaseManagementProjectDataType +from datadog_api_client.v2.model.case_notification_rule import CaseNotificationRule +from datadog_api_client.v2.model.case_notification_rule_attributes import CaseNotificationRuleAttributes +from datadog_api_client.v2.model.case_notification_rule_create import CaseNotificationRuleCreate +from datadog_api_client.v2.model.case_notification_rule_create_attributes import CaseNotificationRuleCreateAttributes +from datadog_api_client.v2.model.case_notification_rule_create_request import CaseNotificationRuleCreateRequest +from datadog_api_client.v2.model.case_notification_rule_recipient import CaseNotificationRuleRecipient +from datadog_api_client.v2.model.case_notification_rule_recipient_data import CaseNotificationRuleRecipientData +from datadog_api_client.v2.model.case_notification_rule_resource_type import CaseNotificationRuleResourceType +from datadog_api_client.v2.model.case_notification_rule_response import CaseNotificationRuleResponse +from datadog_api_client.v2.model.case_notification_rule_trigger import CaseNotificationRuleTrigger +from datadog_api_client.v2.model.case_notification_rule_trigger_data import CaseNotificationRuleTriggerData +from datadog_api_client.v2.model.case_notification_rule_update import CaseNotificationRuleUpdate +from datadog_api_client.v2.model.case_notification_rule_update_request import CaseNotificationRuleUpdateRequest +from datadog_api_client.v2.model.case_notification_rules_response import CaseNotificationRulesResponse from datadog_api_client.v2.model.case_object_attributes import CaseObjectAttributes from datadog_api_client.v2.model.case_priority import CasePriority from datadog_api_client.v2.model.case_relationships import CaseRelationships @@ -2472,6 +2491,35 @@ from datadog_api_client.v2.model.input_schema_parameters import InputSchemaParameters from datadog_api_client.v2.model.input_schema_parameters_type import InputSchemaParametersType from datadog_api_client.v2.model.intake_payload_accepted import IntakePayloadAccepted +from datadog_api_client.v2.model.integration_incident import IntegrationIncident +from datadog_api_client.v2.model.integration_incident_field_mappings_items import IntegrationIncidentFieldMappingsItems +from datadog_api_client.v2.model.integration_incident_severity_config import IntegrationIncidentSeverityConfig +from datadog_api_client.v2.model.integration_jira import IntegrationJira +from datadog_api_client.v2.model.integration_jira_auto_creation import IntegrationJiraAutoCreation +from datadog_api_client.v2.model.integration_jira_metadata import IntegrationJiraMetadata +from datadog_api_client.v2.model.integration_jira_sync import IntegrationJiraSync +from datadog_api_client.v2.model.integration_jira_sync_due_date import IntegrationJiraSyncDueDate +from datadog_api_client.v2.model.integration_jira_sync_properties import IntegrationJiraSyncProperties +from datadog_api_client.v2.model.integration_jira_sync_properties_custom_fields_additional_properties import ( + IntegrationJiraSyncPropertiesCustomFieldsAdditionalProperties, +) +from datadog_api_client.v2.model.integration_monitor import IntegrationMonitor +from datadog_api_client.v2.model.integration_on_call import IntegrationOnCall +from datadog_api_client.v2.model.integration_on_call_escalation_queries_items import ( + IntegrationOnCallEscalationQueriesItems, +) +from datadog_api_client.v2.model.integration_on_call_escalation_queries_items_target import ( + IntegrationOnCallEscalationQueriesItemsTarget, +) +from datadog_api_client.v2.model.integration_service_now import IntegrationServiceNow +from datadog_api_client.v2.model.integration_service_now_auto_creation import IntegrationServiceNowAutoCreation +from datadog_api_client.v2.model.integration_service_now_sync_config import IntegrationServiceNowSyncConfig +from datadog_api_client.v2.model.integration_service_now_sync_config139772721534496 import ( + IntegrationServiceNowSyncConfig139772721534496, +) +from datadog_api_client.v2.model.integration_service_now_sync_config_priority import ( + IntegrationServiceNowSyncConfigPriority, +) from datadog_api_client.v2.model.interface_attributes import InterfaceAttributes from datadog_api_client.v2.model.interface_attributes_status import InterfaceAttributesStatus from datadog_api_client.v2.model.issue import Issue @@ -3985,14 +4033,22 @@ ) from datadog_api_client.v2.model.project import Project from datadog_api_client.v2.model.project_attributes import ProjectAttributes +from datadog_api_client.v2.model.project_columns_config import ProjectColumnsConfig +from datadog_api_client.v2.model.project_columns_config_columns_items import ProjectColumnsConfigColumnsItems +from datadog_api_client.v2.model.project_columns_config_columns_items_sort import ProjectColumnsConfigColumnsItemsSort from datadog_api_client.v2.model.project_create import ProjectCreate from datadog_api_client.v2.model.project_create_attributes import ProjectCreateAttributes from datadog_api_client.v2.model.project_create_request import ProjectCreateRequest +from datadog_api_client.v2.model.project_notification_settings import ProjectNotificationSettings from datadog_api_client.v2.model.project_relationship import ProjectRelationship from datadog_api_client.v2.model.project_relationship_data import ProjectRelationshipData from datadog_api_client.v2.model.project_relationships import ProjectRelationships from datadog_api_client.v2.model.project_resource_type import ProjectResourceType from datadog_api_client.v2.model.project_response import ProjectResponse +from datadog_api_client.v2.model.project_settings import ProjectSettings +from datadog_api_client.v2.model.project_update import ProjectUpdate +from datadog_api_client.v2.model.project_update_attributes import ProjectUpdateAttributes +from datadog_api_client.v2.model.project_update_request import ProjectUpdateRequest from datadog_api_client.v2.model.projected_cost import ProjectedCost from datadog_api_client.v2.model.projected_cost_attributes import ProjectedCostAttributes from datadog_api_client.v2.model.projected_cost_response import ProjectedCostResponse @@ -5296,6 +5352,8 @@ from datadog_api_client.v2.model.suite_search_response_type import SuiteSearchResponseType from datadog_api_client.v2.model.suppression_version_history import SuppressionVersionHistory from datadog_api_client.v2.model.suppression_versions import SuppressionVersions +from datadog_api_client.v2.model.sync_property import SyncProperty +from datadog_api_client.v2.model.sync_property_with_mapping import SyncPropertyWithMapping from datadog_api_client.v2.model.synthetics_global_variable import SyntheticsGlobalVariable from datadog_api_client.v2.model.synthetics_global_variable_attributes import SyntheticsGlobalVariableAttributes from datadog_api_client.v2.model.synthetics_global_variable_options import SyntheticsGlobalVariableOptions @@ -5927,6 +5985,9 @@ "AnthropicIntegration", "AnthropicIntegrationType", "AnthropicIntegrationUpdate", + "AnyValue", + "AnyValueItem", + "AnyValueObject", "ApmRetentionFilterType", "AppBuilderEvent", "AppBuilderEventName", @@ -6082,6 +6143,8 @@ "AuthNMappingsResponse", "AuthNMappingsSort", "AuthNMappingsType", + "AutoCloseInactiveCases", + "AutoTransitionAssignedCases", "AwsCURConfig", "AwsCURConfigAttributes", "AwsCURConfigPatchData", @@ -6292,6 +6355,20 @@ "CaseManagementProject", "CaseManagementProjectData", "CaseManagementProjectDataType", + "CaseNotificationRule", + "CaseNotificationRuleAttributes", + "CaseNotificationRuleCreate", + "CaseNotificationRuleCreateAttributes", + "CaseNotificationRuleCreateRequest", + "CaseNotificationRuleRecipient", + "CaseNotificationRuleRecipientData", + "CaseNotificationRuleResourceType", + "CaseNotificationRuleResponse", + "CaseNotificationRuleTrigger", + "CaseNotificationRuleTriggerData", + "CaseNotificationRuleUpdate", + "CaseNotificationRuleUpdateRequest", + "CaseNotificationRulesResponse", "CaseObjectAttributes", "CasePriority", "CaseRelationships", @@ -7639,6 +7716,25 @@ "InputSchemaParameters", "InputSchemaParametersType", "IntakePayloadAccepted", + "IntegrationIncident", + "IntegrationIncidentFieldMappingsItems", + "IntegrationIncidentSeverityConfig", + "IntegrationJira", + "IntegrationJiraAutoCreation", + "IntegrationJiraMetadata", + "IntegrationJiraSync", + "IntegrationJiraSyncDueDate", + "IntegrationJiraSyncProperties", + "IntegrationJiraSyncPropertiesCustomFieldsAdditionalProperties", + "IntegrationMonitor", + "IntegrationOnCall", + "IntegrationOnCallEscalationQueriesItems", + "IntegrationOnCallEscalationQueriesItemsTarget", + "IntegrationServiceNow", + "IntegrationServiceNowAutoCreation", + "IntegrationServiceNowSyncConfig", + "IntegrationServiceNowSyncConfig139772721534496", + "IntegrationServiceNowSyncConfigPriority", "InterfaceAttributes", "InterfaceAttributesStatus", "Issue", @@ -8566,14 +8662,22 @@ "ProductAnalyticsServerSideEventItemUsr", "Project", "ProjectAttributes", + "ProjectColumnsConfig", + "ProjectColumnsConfigColumnsItems", + "ProjectColumnsConfigColumnsItemsSort", "ProjectCreate", "ProjectCreateAttributes", "ProjectCreateRequest", + "ProjectNotificationSettings", "ProjectRelationship", "ProjectRelationshipData", "ProjectRelationships", "ProjectResourceType", "ProjectResponse", + "ProjectSettings", + "ProjectUpdate", + "ProjectUpdateAttributes", + "ProjectUpdateRequest", "ProjectedCost", "ProjectedCostAttributes", "ProjectedCostResponse", @@ -9507,6 +9611,8 @@ "SuiteSearchResponseType", "SuppressionVersionHistory", "SuppressionVersions", + "SyncProperty", + "SyncPropertyWithMapping", "SyntheticsGlobalVariable", "SyntheticsGlobalVariableAttributes", "SyntheticsGlobalVariableOptions", diff --git a/tests/v2/cassettes/test_scenarios/test_update_a_project_returns_bad_request_response.frozen b/tests/v2/cassettes/test_scenarios/test_update_a_project_returns_bad_request_response.frozen new file mode 100644 index 0000000000..57657a05d9 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_update_a_project_returns_bad_request_response.frozen @@ -0,0 +1 @@ +2026-01-28T12:51:16.724Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_update_a_project_returns_bad_request_response.yaml b/tests/v2/cassettes/test_scenarios/test_update_a_project_returns_bad_request_response.yaml new file mode 100644 index 0000000000..b422d0e059 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_update_a_project_returns_bad_request_response.yaml @@ -0,0 +1,21 @@ +interactions: +- request: + body: '{"data":{"type":"invalid_type"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: PATCH + uri: https://api.datadoghq.com/api/v2/cases/projects/d4bbe1af-f36e-42f1-87c1-493ca35c320e + response: + body: + string: '{"errors":[{"status":"400","title":"Bad Request","detail":"got type + \"invalid_type\" expected one of \"project\""}]}' + headers: + content-type: + - application/vnd.api+json + status: + code: 400 + message: Bad Request +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_update_a_project_returns_not_found_response.frozen b/tests/v2/cassettes/test_scenarios/test_update_a_project_returns_not_found_response.frozen new file mode 100644 index 0000000000..cf21958a60 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_update_a_project_returns_not_found_response.frozen @@ -0,0 +1 @@ +2026-01-28T12:51:17.270Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_update_a_project_returns_not_found_response.yaml b/tests/v2/cassettes/test_scenarios/test_update_a_project_returns_not_found_response.yaml new file mode 100644 index 0000000000..ff37c4fd00 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_update_a_project_returns_not_found_response.yaml @@ -0,0 +1,21 @@ +interactions: +- request: + body: '{"data":{"attributes":{"name":"Updated Project Name"},"type":"project"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: PATCH + uri: https://api.datadoghq.com/api/v2/cases/projects/67d80aa3-36ff-44b9-a694-c501a7591737 + response: + body: + string: '{"errors":[{"code":"resource_not_found","title":"failed to get project: + project not found"}]}' + headers: + content-type: + - application/vnd.api+json + status: + code: 404 + message: Not Found +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_update_a_project_returns_ok_response.frozen b/tests/v2/cassettes/test_scenarios/test_update_a_project_returns_ok_response.frozen new file mode 100644 index 0000000000..b19d06ed2d --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_update_a_project_returns_ok_response.frozen @@ -0,0 +1 @@ +2026-01-28T12:51:17.621Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_update_a_project_returns_ok_response.yaml b/tests/v2/cassettes/test_scenarios/test_update_a_project_returns_ok_response.yaml new file mode 100644 index 0000000000..4fca4cd281 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_update_a_project_returns_ok_response.yaml @@ -0,0 +1,21 @@ +interactions: +- request: + body: '{"data":{"attributes":{"name":"Updated Project Name Test-Update_a_project_returns_OK_response-1769604677"},"type":"project"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: PATCH + uri: https://api.datadoghq.com/api/v2/cases/projects/d4bbe1af-f36e-42f1-87c1-493ca35c320e + response: + body: + string: '{"data":{"id":"d4bbe1af-f36e-42f1-87c1-493ca35c320e","type":"project","attributes":{"key":"DDFC","name":"Updated + Project Name Test-Update_a_project_returns_OK_response-1769604677","restricted":false,"settings":{"notification":{"enabled":true,"destinations":[1],"notify_on_case_assignment":true,"notify_on_case_unassignment":true,"notify_on_case_closed":true,"notify_on_case_priority_change":true,"notify_on_case_comment":true,"notify_on_case_comment_mention":true,"notify_on_case_status_change":true}}}}}' + headers: + content-type: + - application/vnd.api+json + status: + code: 200 + message: OK +version: 1 diff --git a/tests/v2/features/case_management.feature b/tests/v2/features/case_management.feature index 2f23915567..7e26a5815f 100644 --- a/tests/v2/features/case_management.feature +++ b/tests/v2/features/case_management.feature @@ -116,27 +116,67 @@ 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 notification rule returns "Bad Request" response + Given new "CreateProjectNotificationRule" request + And request contains "project_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"is_enabled": true, "recipients": [{"data": {}, "type": "EMAIL"}], "triggers": [{"data": {}, "type": "CASE_CREATED"}]}, "type": "notification_rule"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/case-management + Scenario: Create a notification rule returns "CREATED" response + Given new "CreateProjectNotificationRule" request + And request contains "project_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"is_enabled": true, "recipients": [{"data": {}, "type": "EMAIL"}], "triggers": [{"data": {}, "type": "CASE_CREATED"}]}, "type": "notification_rule"}} + When the request is sent + Then the response status is 201 CREATED + + @generated @skip @team:DataDog/case-management + Scenario: Create a notification rule returns "Not Found" response + Given new "CreateProjectNotificationRule" request + And request contains "project_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"is_enabled": true, "recipients": [{"data": {}, "type": "EMAIL"}], "triggers": [{"data": {}, "type": "CASE_CREATED"}]}, "type": "notification_rule"}} + When the request is sent + Then the response status is 404 Not Found + @generated @skip @team:DataDog/case-management Scenario: Create a project returns "Bad Request" response Given new "CreateProject" request - And body with value {"data": {"attributes": {"key": "SEC", "name": "Security Investigation"}, "type": "project"}} + And body with value {"data": {"attributes": {"enabled_custom_case_types": [], "key": "SEC", "name": "Security Investigation"}, "type": "project"}} When the request is sent Then the response status is 400 Bad Request @generated @skip @team:DataDog/case-management Scenario: Create a project returns "CREATED" response Given new "CreateProject" request - And body with value {"data": {"attributes": {"key": "SEC", "name": "Security Investigation"}, "type": "project"}} + And body with value {"data": {"attributes": {"enabled_custom_case_types": [], "key": "SEC", "name": "Security Investigation"}, "type": "project"}} When the request is sent Then the response status is 201 CREATED @generated @skip @team:DataDog/case-management Scenario: Create a project returns "Not Found" response Given new "CreateProject" request - And body with value {"data": {"attributes": {"key": "SEC", "name": "Security Investigation"}, "type": "project"}} + And body with value {"data": {"attributes": {"enabled_custom_case_types": [], "key": "SEC", "name": "Security Investigation"}, "type": "project"}} 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 + And request contains "project_id" parameter from "REPLACE.ME" + And request contains "notification_rule_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 API error response + + @generated @skip @team:DataDog/case-management + Scenario: Delete a notification rule returns "No Content" response + Given new "DeleteProjectNotificationRule" request + And request contains "project_id" parameter from "REPLACE.ME" + And request contains "notification_rule_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 204 No Content + @skip @team:DataDog/case-management Scenario: Delete case comment returns "Bad Request" response Given new "DeleteCaseComment" request @@ -203,6 +243,27 @@ Feature: Case Management 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 + 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: Get notification rules returns "Not Found" response + Given new "GetProjectNotificationRules" 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 notification rules returns "OK" response + Given new "GetProjectNotificationRules" request + And request contains "project_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + @skip @team:DataDog/case-management Scenario: Get the details of a case returns "Bad Request" response Given new "GetCase" request @@ -337,6 +398,59 @@ Feature: Case Management 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 + And request contains "project_id" parameter from "REPLACE.ME" + And request contains "notification_rule_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"recipients": [{"data": {}, "type": "EMAIL"}], "triggers": [{"data": {}, "type": "CASE_CREATED"}]}, "type": "notification_rule"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/case-management + Scenario: Update a notification rule returns "No Content" response + Given new "UpdateProjectNotificationRule" request + And request contains "project_id" parameter from "REPLACE.ME" + And request contains "notification_rule_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"recipients": [{"data": {}, "type": "EMAIL"}], "triggers": [{"data": {}, "type": "CASE_CREATED"}]}, "type": "notification_rule"}} + When the request is sent + Then the response status is 204 No Content + + @generated @skip @team:DataDog/case-management + Scenario: Update a notification rule returns "Not Found" response + Given new "UpdateProjectNotificationRule" request + And request contains "project_id" parameter from "REPLACE.ME" + And request contains "notification_rule_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"recipients": [{"data": {}, "type": "EMAIL"}], "triggers": [{"data": {}, "type": "CASE_CREATED"}]}, "type": "notification_rule"}} + When the request is sent + Then the response status is 404 Not Found + + @team:DataDog/case-management + Scenario: Update a project returns "Bad Request" response + Given new "UpdateProject" request + And request contains "project_id" parameter with value "d4bbe1af-f36e-42f1-87c1-493ca35c320e" + And body with value {"data": {"type": "invalid_type"}} + When the request is sent + Then the response status is 400 Bad Request + + @team:DataDog/case-management + Scenario: Update a project returns "Not Found" response + Given new "UpdateProject" request + And request contains "project_id" parameter with value "67d80aa3-36ff-44b9-a694-c501a7591737" + And body with value {"data": {"type": "project", "attributes": {"name": "Updated Project Name"}}} + When the request is sent + Then the response status is 404 Not Found + + @team:DataDog/case-management + Scenario: Update a project returns "OK" response + Given new "UpdateProject" request + And request contains "project_id" parameter with value "d4bbe1af-f36e-42f1-87c1-493ca35c320e" + And body with value {"data": {"type": "project", "attributes": {"name": "Updated Project Name {{ unique }}"}}} + When the request is sent + Then the response status is 200 OK + And the response "data" has field "id" + And the response "data.attributes.name" is equal to "Updated Project Name {{ unique }}" + @skip @team:DataDog/case-management Scenario: Update case attributes returns "Bad Request" response Given new "UpdateAttributes" request diff --git a/tests/v2/features/given.json b/tests/v2/features/given.json index 1d65907ff1..3605ca7f8e 100644 --- a/tests/v2/features/given.json +++ b/tests/v2/features/given.json @@ -190,6 +190,36 @@ "tag": "Case Management", "operationId": "CreateCase" }, + { + "parameters": [ + { + "name": "body", + "value": "{\n \"data\": {\n \"type\": \"project\",\n \"attributes\": {\n \"key\": \"TST\",\n \"name\": \"Test Project {{ unique }}\"\n }\n }\n}" + } + ], + "source": "data", + "step": "there is a valid \"project\" in the system", + "key": "project", + "tag": "Case Management", + "operationId": "CreateProject" + }, + { + "parameters": [ + { + "name": "project_id", + "value": "d4bbe1af-f36e-42f1-87c1-493ca35c320e" + }, + { + "name": "body", + "value": "{\n \"data\": {\n \"type\": \"notification_rule\",\n \"attributes\": {\n \"is_enabled\": true,\n \"triggers\": [{\"type\": \"CASE_CREATED\", \"data\": {}}],\n \"recipients\": [{\"type\": \"EMAIL\", \"data\": {\"email\": \"test-{{ unique }}@example.com\"}}]\n }\n }\n}" + } + ], + "source": "data", + "step": "there is a valid \"case_notification_rule\" in the system", + "key": "case_notification_rule", + "tag": "Case Management", + "operationId": "CreateProjectNotificationRule" + }, { "parameters": [ { diff --git a/tests/v2/features/undo.json b/tests/v2/features/undo.json index 5a347bddf1..6387dae5fa 100644 --- a/tests/v2/features/undo.json +++ b/tests/v2/features/undo.json @@ -693,6 +693,47 @@ "type": "safe" } }, + "UpdateProject": { + "tag": "Case Management", + "undo": { + "type": "idempotent" + } + }, + "GetProjectNotificationRules": { + "tag": "Case Management", + "undo": { + "type": "safe" + } + }, + "CreateProjectNotificationRule": { + "tag": "Case Management", + "undo": { + "operationId": "DeleteProjectNotificationRule", + "parameters": [ + { + "name": "project_id", + "source": "path.project_id" + }, + { + "name": "notification_rule_id", + "source": "data.id" + } + ], + "type": "unsafe" + } + }, + "DeleteProjectNotificationRule": { + "tag": "Case Management", + "undo": { + "type": "idempotent" + } + }, + "UpdateProjectNotificationRule": { + "tag": "Case Management", + "undo": { + "type": "idempotent" + } + }, "GetAllCaseTypes": { "tag": "Case Management Type", "undo": {