diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 70523726660..d80c9380ccc 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 @@ -5960,6 +5968,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 +9443,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, pager_duty_service, + microsoft_teams_channel) + example: slack_channel + 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 (status_transitioned, case_created, attribute_value_changed, + etc.) + example: status_transitioned + 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: @@ -30455,6 +30689,209 @@ 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/IntegrationJiraSync139772721530016' + type: object + IntegrationJiraSync139772721530016: + properties: + assignee: + $ref: '#/components/schemas/SyncProperty' + comments: + $ref: '#/components/schemas/SyncProperty' + custom_fields: + additionalProperties: + properties: + sync_type: + type: string + value: {} + type: object + 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 + IntegrationJiraSyncDueDate: + properties: + jira_field_id: + type: string + sync_type: + type: string + 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: @@ -44755,13 +45192,51 @@ 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 @@ -44777,14 +45252,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 @@ -44797,6 +45280,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: @@ -44841,6 +45350,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: @@ -59203,6 +59769,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: @@ -69523,6 +70109,201 @@ 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: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/CaseNotificationRuleResponse' + 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 notification rule + tags: + - Case Management /api/v2/cases/types: get: description: Get all case types diff --git a/examples/v2/case-management/CreateProjectNotificationRule.java b/examples/v2/case-management/CreateProjectNotificationRule.java new file mode 100644 index 00000000000..9c69a8d69e6 --- /dev/null +++ b/examples/v2/case-management/CreateProjectNotificationRule.java @@ -0,0 +1,56 @@ +// Create a notification rule returns "CREATED" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.CaseManagementApi; +import com.datadog.api.client.v2.model.CaseNotificationRuleCreate; +import com.datadog.api.client.v2.model.CaseNotificationRuleCreateAttributes; +import com.datadog.api.client.v2.model.CaseNotificationRuleCreateRequest; +import com.datadog.api.client.v2.model.CaseNotificationRuleRecipient; +import com.datadog.api.client.v2.model.CaseNotificationRuleRecipientData; +import com.datadog.api.client.v2.model.CaseNotificationRuleResourceType; +import com.datadog.api.client.v2.model.CaseNotificationRuleResponse; +import com.datadog.api.client.v2.model.CaseNotificationRuleTrigger; +import java.util.Collections; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + CaseManagementApi apiInstance = new CaseManagementApi(defaultClient); + + // there is a valid "project" in the system + String PROJECT_ID = System.getenv("PROJECT_ID"); + + CaseNotificationRuleCreateRequest body = + new CaseNotificationRuleCreateRequest() + .data( + new CaseNotificationRuleCreate() + .type(CaseNotificationRuleResourceType.NOTIFICATION_RULE) + .attributes( + new CaseNotificationRuleCreateAttributes() + .isEnabled(true) + .recipients( + Collections.singletonList( + new CaseNotificationRuleRecipient() + .type("email") + .data( + new CaseNotificationRuleRecipientData() + .email( + "test-Example-Case-Management@example.com")))) + .triggers( + Collections.singletonList( + new CaseNotificationRuleTrigger().type("case_created"))))); + + try { + CaseNotificationRuleResponse result = + apiInstance.createProjectNotificationRule(PROJECT_ID, body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling CaseManagementApi#createProjectNotificationRule"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/case-management/DeleteProjectNotificationRule.java b/examples/v2/case-management/DeleteProjectNotificationRule.java new file mode 100644 index 00000000000..bf6a9d261d7 --- /dev/null +++ b/examples/v2/case-management/DeleteProjectNotificationRule.java @@ -0,0 +1,28 @@ +// Delete a notification rule returns "No Content" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.CaseManagementApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + CaseManagementApi apiInstance = new CaseManagementApi(defaultClient); + + // there is a valid "project" in the system + String PROJECT_ID = System.getenv("PROJECT_ID"); + + // there is a valid "case_notification_rule" in the system + String CASE_NOTIFICATION_RULE_ID = System.getenv("CASE_NOTIFICATION_RULE_ID"); + + try { + apiInstance.deleteProjectNotificationRule(PROJECT_ID, CASE_NOTIFICATION_RULE_ID); + } catch (ApiException e) { + System.err.println("Exception when calling CaseManagementApi#deleteProjectNotificationRule"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/case-management/GetProjectNotificationRules.java b/examples/v2/case-management/GetProjectNotificationRules.java new file mode 100644 index 00000000000..f40db559df1 --- /dev/null +++ b/examples/v2/case-management/GetProjectNotificationRules.java @@ -0,0 +1,27 @@ +// Get notification rules returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.CaseManagementApi; +import com.datadog.api.client.v2.model.CaseNotificationRulesResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + CaseManagementApi apiInstance = new CaseManagementApi(defaultClient); + + // there is a valid "project" in the system + String PROJECT_ID = System.getenv("PROJECT_ID"); + + try { + CaseNotificationRulesResponse result = apiInstance.getProjectNotificationRules(PROJECT_ID); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling CaseManagementApi#getProjectNotificationRules"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/case-management/UpdateProject.java b/examples/v2/case-management/UpdateProject.java new file mode 100644 index 00000000000..ba1f4347213 --- /dev/null +++ b/examples/v2/case-management/UpdateProject.java @@ -0,0 +1,40 @@ +// Update a project returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.CaseManagementApi; +import com.datadog.api.client.v2.model.ProjectResourceType; +import com.datadog.api.client.v2.model.ProjectResponse; +import com.datadog.api.client.v2.model.ProjectUpdate; +import com.datadog.api.client.v2.model.ProjectUpdateAttributes; +import com.datadog.api.client.v2.model.ProjectUpdateRequest; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + CaseManagementApi apiInstance = new CaseManagementApi(defaultClient); + + // there is a valid "project" in the system + String PROJECT_ID = System.getenv("PROJECT_ID"); + + ProjectUpdateRequest body = + new ProjectUpdateRequest() + .data( + new ProjectUpdate() + .type(ProjectResourceType.PROJECT) + .attributes( + new ProjectUpdateAttributes() + .name("Updated Project Name Example-Case-Management"))); + + try { + ProjectResponse result = apiInstance.updateProject(PROJECT_ID, body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling CaseManagementApi#updateProject"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/case-management/UpdateProjectNotificationRule.java b/examples/v2/case-management/UpdateProjectNotificationRule.java new file mode 100644 index 00000000000..be49bd55fa3 --- /dev/null +++ b/examples/v2/case-management/UpdateProjectNotificationRule.java @@ -0,0 +1,42 @@ +// Update a notification rule returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.CaseManagementApi; +import com.datadog.api.client.v2.model.CaseNotificationRuleAttributes; +import com.datadog.api.client.v2.model.CaseNotificationRuleResourceType; +import com.datadog.api.client.v2.model.CaseNotificationRuleResponse; +import com.datadog.api.client.v2.model.CaseNotificationRuleUpdate; +import com.datadog.api.client.v2.model.CaseNotificationRuleUpdateRequest; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + CaseManagementApi apiInstance = new CaseManagementApi(defaultClient); + + // there is a valid "project" in the system + String PROJECT_ID = System.getenv("PROJECT_ID"); + + // there is a valid "case_notification_rule" in the system + String CASE_NOTIFICATION_RULE_ID = System.getenv("CASE_NOTIFICATION_RULE_ID"); + + CaseNotificationRuleUpdateRequest body = + new CaseNotificationRuleUpdateRequest() + .data( + new CaseNotificationRuleUpdate() + .type(CaseNotificationRuleResourceType.NOTIFICATION_RULE) + .attributes(new CaseNotificationRuleAttributes().isEnabled(false))); + + try { + CaseNotificationRuleResponse result = + apiInstance.updateProjectNotificationRule(PROJECT_ID, CASE_NOTIFICATION_RULE_ID, body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling CaseManagementApi#updateProjectNotificationRule"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/src/main/java/com/datadog/api/client/v2/api/CaseManagementApi.java b/src/main/java/com/datadog/api/client/v2/api/CaseManagementApi.java index 5143d6939ab..516e7d2bb0e 100644 --- a/src/main/java/com/datadog/api/client/v2/api/CaseManagementApi.java +++ b/src/main/java/com/datadog/api/client/v2/api/CaseManagementApi.java @@ -10,6 +10,10 @@ import com.datadog.api.client.v2.model.CaseCommentRequest; import com.datadog.api.client.v2.model.CaseCreateRequest; import com.datadog.api.client.v2.model.CaseEmptyRequest; +import com.datadog.api.client.v2.model.CaseNotificationRuleCreateRequest; +import com.datadog.api.client.v2.model.CaseNotificationRuleResponse; +import com.datadog.api.client.v2.model.CaseNotificationRuleUpdateRequest; +import com.datadog.api.client.v2.model.CaseNotificationRulesResponse; import com.datadog.api.client.v2.model.CaseResponse; import com.datadog.api.client.v2.model.CaseSortableField; import com.datadog.api.client.v2.model.CaseUpdateAttributesRequest; @@ -21,6 +25,7 @@ import com.datadog.api.client.v2.model.CasesResponse; import com.datadog.api.client.v2.model.ProjectCreateRequest; import com.datadog.api.client.v2.model.ProjectResponse; +import com.datadog.api.client.v2.model.ProjectUpdateRequest; import com.datadog.api.client.v2.model.ProjectsResponse; import com.datadog.api.client.v2.model.TimelineResponse; import jakarta.ws.rs.client.Invocation; @@ -789,6 +794,172 @@ public CompletableFuture> createProjectWithHttpInfo new GenericType() {}); } + /** + * Create a notification rule. + * + *

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

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

See {@link #createProjectNotificationRuleWithHttpInfo}. + * + * @param projectId Project UUID (required) + * @param body Notification rule payload (required) + * @return CompletableFuture<ApiResponse<CaseNotificationRuleResponse>> + */ + public CompletableFuture> + createProjectNotificationRuleWithHttpInfoAsync( + String projectId, CaseNotificationRuleCreateRequest body) { + Object localVarPostBody = body; + + // verify the required parameter 'projectId' is set + if (projectId == null) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'projectId' when calling" + + " createProjectNotificationRule")); + return result; + } + + // verify the required parameter 'body' is set + if (body == null) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'body' when calling createProjectNotificationRule")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/cases/projects/{project_id}/notification_rules" + .replaceAll("\\{" + "project_id" + "\\}", apiClient.escapeString(projectId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.CaseManagementApi.createProjectNotificationRule", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + } catch (ApiException ex) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "POST", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + /** * Delete case comment. * @@ -1246,6 +1417,174 @@ public CompletableFuture> deleteProjectWithHttpInfoAsync(Strin null); } + /** + * Delete a notification rule. + * + *

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

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

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

See {@link #getProjectsWithHttpInfo}. + *

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

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

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

See {@link #getProjectsWithHttpInfo}. + * + * @return ProjectsResponse + * @throws ApiException if fails to make API call + */ + public ProjectsResponse getProjects() throws ApiException { + return getProjectsWithHttpInfo().getData(); } /** @@ -3048,6 +3531,362 @@ public CompletableFuture> updatePriorityWithHttpInfoAs new GenericType() {}); } + /** + * Update a project. + * + *

See {@link #updateProjectWithHttpInfo}. + * + * @param projectId Project UUID (required) + * @param body Project payload (required) + * @return ProjectResponse + * @throws ApiException if fails to make API call + */ + public ProjectResponse updateProject(String projectId, ProjectUpdateRequest body) + throws ApiException { + return updateProjectWithHttpInfo(projectId, body).getData(); + } + + /** + * Update a project. + * + *

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

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

See {@link #updateProjectNotificationRuleWithHttpInfo}. + * + * @param projectId Project UUID (required) + * @param notificationRuleId Notification Rule UUID (required) + * @param body Notification rule payload (required) + * @return CaseNotificationRuleResponse + * @throws ApiException if fails to make API call + */ + public CaseNotificationRuleResponse updateProjectNotificationRule( + String projectId, String notificationRuleId, CaseNotificationRuleUpdateRequest body) + throws ApiException { + return updateProjectNotificationRuleWithHttpInfo(projectId, notificationRuleId, body).getData(); + } + + /** + * Update a notification rule. + * + *

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

See {@link #updateProjectNotificationRuleWithHttpInfo}. + * + * @param projectId Project UUID (required) + * @param notificationRuleId Notification Rule UUID (required) + * @param body Notification rule payload (required) + * @return CompletableFuture<ApiResponse<CaseNotificationRuleResponse>> + */ + public CompletableFuture> + updateProjectNotificationRuleWithHttpInfoAsync( + String projectId, String notificationRuleId, CaseNotificationRuleUpdateRequest body) { + Object localVarPostBody = body; + + // verify the required parameter 'projectId' is set + if (projectId == null) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'projectId' when calling" + + " updateProjectNotificationRule")); + return result; + } + + // verify the required parameter 'notificationRuleId' is set + if (notificationRuleId == null) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'notificationRuleId' when calling" + + " updateProjectNotificationRule")); + return result; + } + + // verify the required parameter 'body' is set + if (body == null) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'body' when calling updateProjectNotificationRule")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/cases/projects/{project_id}/notification_rules/{notification_rule_id}" + .replaceAll("\\{" + "project_id" + "\\}", apiClient.escapeString(projectId.toString())) + .replaceAll( + "\\{" + "notification_rule_id" + "\\}", + apiClient.escapeString(notificationRuleId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.CaseManagementApi.updateProjectNotificationRule", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + } catch (ApiException ex) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "PUT", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + /** * Update case status. * diff --git a/src/main/java/com/datadog/api/client/v2/model/AutoCloseInactiveCases.java b/src/main/java/com/datadog/api/client/v2/model/AutoCloseInactiveCases.java new file mode 100644 index 00000000000..6190c50ceaa --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/AutoCloseInactiveCases.java @@ -0,0 +1,166 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Auto-close inactive cases settings */ +@JsonPropertyOrder({ + AutoCloseInactiveCases.JSON_PROPERTY_ENABLED, + AutoCloseInactiveCases.JSON_PROPERTY_MAX_INACTIVE_TIME_IN_SECS +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class AutoCloseInactiveCases { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ENABLED = "enabled"; + private Boolean enabled; + + public static final String JSON_PROPERTY_MAX_INACTIVE_TIME_IN_SECS = "max_inactive_time_in_secs"; + private Long maxInactiveTimeInSecs; + + public AutoCloseInactiveCases enabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Whether auto-close is enabled + * + * @return enabled + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ENABLED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnabled() { + return enabled; + } + + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + + public AutoCloseInactiveCases maxInactiveTimeInSecs(Long maxInactiveTimeInSecs) { + this.maxInactiveTimeInSecs = maxInactiveTimeInSecs; + return this; + } + + /** + * Maximum inactive time in seconds before auto-closing + * + * @return maxInactiveTimeInSecs + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MAX_INACTIVE_TIME_IN_SECS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getMaxInactiveTimeInSecs() { + return maxInactiveTimeInSecs; + } + + public void setMaxInactiveTimeInSecs(Long maxInactiveTimeInSecs) { + this.maxInactiveTimeInSecs = maxInactiveTimeInSecs; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return AutoCloseInactiveCases + */ + @JsonAnySetter + public AutoCloseInactiveCases putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this AutoCloseInactiveCases object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AutoCloseInactiveCases autoCloseInactiveCases = (AutoCloseInactiveCases) o; + return Objects.equals(this.enabled, autoCloseInactiveCases.enabled) + && Objects.equals(this.maxInactiveTimeInSecs, autoCloseInactiveCases.maxInactiveTimeInSecs) + && Objects.equals(this.additionalProperties, autoCloseInactiveCases.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(enabled, maxInactiveTimeInSecs, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AutoCloseInactiveCases {\n"); + sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); + sb.append(" maxInactiveTimeInSecs: ") + .append(toIndentedString(maxInactiveTimeInSecs)) + .append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/AutoTransitionAssignedCases.java b/src/main/java/com/datadog/api/client/v2/model/AutoTransitionAssignedCases.java new file mode 100644 index 00000000000..453a13a79ce --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/AutoTransitionAssignedCases.java @@ -0,0 +1,145 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Auto-transition assigned cases settings */ +@JsonPropertyOrder({ + AutoTransitionAssignedCases.JSON_PROPERTY_AUTO_TRANSITION_ASSIGNED_CASES_ON_SELF_ASSIGNED +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class AutoTransitionAssignedCases { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_AUTO_TRANSITION_ASSIGNED_CASES_ON_SELF_ASSIGNED = + "auto_transition_assigned_cases_on_self_assigned"; + private Boolean autoTransitionAssignedCasesOnSelfAssigned; + + public AutoTransitionAssignedCases autoTransitionAssignedCasesOnSelfAssigned( + Boolean autoTransitionAssignedCasesOnSelfAssigned) { + this.autoTransitionAssignedCasesOnSelfAssigned = autoTransitionAssignedCasesOnSelfAssigned; + return this; + } + + /** + * Whether to auto-transition cases when self-assigned + * + * @return autoTransitionAssignedCasesOnSelfAssigned + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_AUTO_TRANSITION_ASSIGNED_CASES_ON_SELF_ASSIGNED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getAutoTransitionAssignedCasesOnSelfAssigned() { + return autoTransitionAssignedCasesOnSelfAssigned; + } + + public void setAutoTransitionAssignedCasesOnSelfAssigned( + Boolean autoTransitionAssignedCasesOnSelfAssigned) { + this.autoTransitionAssignedCasesOnSelfAssigned = autoTransitionAssignedCasesOnSelfAssigned; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return AutoTransitionAssignedCases + */ + @JsonAnySetter + public AutoTransitionAssignedCases putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this AutoTransitionAssignedCases object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AutoTransitionAssignedCases autoTransitionAssignedCases = (AutoTransitionAssignedCases) o; + return Objects.equals( + this.autoTransitionAssignedCasesOnSelfAssigned, + autoTransitionAssignedCases.autoTransitionAssignedCasesOnSelfAssigned) + && Objects.equals( + this.additionalProperties, autoTransitionAssignedCases.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(autoTransitionAssignedCasesOnSelfAssigned, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AutoTransitionAssignedCases {\n"); + sb.append(" autoTransitionAssignedCasesOnSelfAssigned: ") + .append(toIndentedString(autoTransitionAssignedCasesOnSelfAssigned)) + .append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CaseNotificationRule.java b/src/main/java/com/datadog/api/client/v2/model/CaseNotificationRule.java new file mode 100644 index 00000000000..6c055410876 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CaseNotificationRule.java @@ -0,0 +1,211 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** A notification rule for case management */ +@JsonPropertyOrder({ + CaseNotificationRule.JSON_PROPERTY_ATTRIBUTES, + CaseNotificationRule.JSON_PROPERTY_ID, + CaseNotificationRule.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CaseNotificationRule { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private CaseNotificationRuleAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private CaseNotificationRuleResourceType type = + CaseNotificationRuleResourceType.NOTIFICATION_RULE; + + public CaseNotificationRule() {} + + @JsonCreator + public CaseNotificationRule( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + CaseNotificationRuleAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) + CaseNotificationRuleResourceType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public CaseNotificationRule attributes(CaseNotificationRuleAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Notification rule attributes + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public CaseNotificationRuleAttributes getAttributes() { + return attributes; + } + + public void setAttributes(CaseNotificationRuleAttributes attributes) { + this.attributes = attributes; + } + + public CaseNotificationRule id(String id) { + this.id = id; + return this; + } + + /** + * The notification rule's identifier + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public CaseNotificationRule type(CaseNotificationRuleResourceType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Notification rule resource type + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public CaseNotificationRuleResourceType getType() { + return type; + } + + public void setType(CaseNotificationRuleResourceType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return CaseNotificationRule + */ + @JsonAnySetter + public CaseNotificationRule putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this CaseNotificationRule object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CaseNotificationRule caseNotificationRule = (CaseNotificationRule) o; + return Objects.equals(this.attributes, caseNotificationRule.attributes) + && Objects.equals(this.id, caseNotificationRule.id) + && Objects.equals(this.type, caseNotificationRule.type) + && Objects.equals(this.additionalProperties, caseNotificationRule.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CaseNotificationRule {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CaseNotificationRuleAttributes.java b/src/main/java/com/datadog/api/client/v2/model/CaseNotificationRuleAttributes.java new file mode 100644 index 00000000000..f173b690d53 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CaseNotificationRuleAttributes.java @@ -0,0 +1,247 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** Notification rule attributes */ +@JsonPropertyOrder({ + CaseNotificationRuleAttributes.JSON_PROPERTY_IS_ENABLED, + CaseNotificationRuleAttributes.JSON_PROPERTY_QUERY, + CaseNotificationRuleAttributes.JSON_PROPERTY_RECIPIENTS, + CaseNotificationRuleAttributes.JSON_PROPERTY_TRIGGERS +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CaseNotificationRuleAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_IS_ENABLED = "is_enabled"; + private Boolean isEnabled; + + public static final String JSON_PROPERTY_QUERY = "query"; + private String query; + + public static final String JSON_PROPERTY_RECIPIENTS = "recipients"; + private List recipients = null; + + public static final String JSON_PROPERTY_TRIGGERS = "triggers"; + private List triggers = null; + + public CaseNotificationRuleAttributes isEnabled(Boolean isEnabled) { + this.isEnabled = isEnabled; + return this; + } + + /** + * Whether the notification rule is enabled + * + * @return isEnabled + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_IS_ENABLED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsEnabled() { + return isEnabled; + } + + public void setIsEnabled(Boolean isEnabled) { + this.isEnabled = isEnabled; + } + + public CaseNotificationRuleAttributes query(String query) { + this.query = query; + return this; + } + + /** + * Query to filter cases for this notification rule + * + * @return query + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_QUERY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getQuery() { + return query; + } + + public void setQuery(String query) { + this.query = query; + } + + public CaseNotificationRuleAttributes recipients(List recipients) { + this.recipients = recipients; + for (CaseNotificationRuleRecipient item : recipients) { + this.unparsed |= item.unparsed; + } + return this; + } + + public CaseNotificationRuleAttributes addRecipientsItem( + CaseNotificationRuleRecipient recipientsItem) { + if (this.recipients == null) { + this.recipients = new ArrayList<>(); + } + this.recipients.add(recipientsItem); + this.unparsed |= recipientsItem.unparsed; + return this; + } + + /** + * List of notification recipients + * + * @return recipients + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_RECIPIENTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getRecipients() { + return recipients; + } + + public void setRecipients(List recipients) { + this.recipients = recipients; + } + + public CaseNotificationRuleAttributes triggers(List triggers) { + this.triggers = triggers; + for (CaseNotificationRuleTrigger item : triggers) { + this.unparsed |= item.unparsed; + } + return this; + } + + public CaseNotificationRuleAttributes addTriggersItem(CaseNotificationRuleTrigger triggersItem) { + if (this.triggers == null) { + this.triggers = new ArrayList<>(); + } + this.triggers.add(triggersItem); + this.unparsed |= triggersItem.unparsed; + return this; + } + + /** + * List of triggers for this notification rule + * + * @return triggers + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TRIGGERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getTriggers() { + return triggers; + } + + public void setTriggers(List triggers) { + this.triggers = triggers; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return CaseNotificationRuleAttributes + */ + @JsonAnySetter + public CaseNotificationRuleAttributes putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this CaseNotificationRuleAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CaseNotificationRuleAttributes caseNotificationRuleAttributes = + (CaseNotificationRuleAttributes) o; + return Objects.equals(this.isEnabled, caseNotificationRuleAttributes.isEnabled) + && Objects.equals(this.query, caseNotificationRuleAttributes.query) + && Objects.equals(this.recipients, caseNotificationRuleAttributes.recipients) + && Objects.equals(this.triggers, caseNotificationRuleAttributes.triggers) + && Objects.equals( + this.additionalProperties, caseNotificationRuleAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(isEnabled, query, recipients, triggers, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CaseNotificationRuleAttributes {\n"); + sb.append(" isEnabled: ").append(toIndentedString(isEnabled)).append("\n"); + sb.append(" query: ").append(toIndentedString(query)).append("\n"); + sb.append(" recipients: ").append(toIndentedString(recipients)).append("\n"); + sb.append(" triggers: ").append(toIndentedString(triggers)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CaseNotificationRuleCreate.java b/src/main/java/com/datadog/api/client/v2/model/CaseNotificationRuleCreate.java new file mode 100644 index 00000000000..fe882dd07f1 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CaseNotificationRuleCreate.java @@ -0,0 +1,184 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Notification rule create */ +@JsonPropertyOrder({ + CaseNotificationRuleCreate.JSON_PROPERTY_ATTRIBUTES, + CaseNotificationRuleCreate.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CaseNotificationRuleCreate { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private CaseNotificationRuleCreateAttributes attributes; + + public static final String JSON_PROPERTY_TYPE = "type"; + private CaseNotificationRuleResourceType type = + CaseNotificationRuleResourceType.NOTIFICATION_RULE; + + public CaseNotificationRuleCreate() {} + + @JsonCreator + public CaseNotificationRuleCreate( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + CaseNotificationRuleCreateAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) + CaseNotificationRuleResourceType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public CaseNotificationRuleCreate attributes(CaseNotificationRuleCreateAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Notification rule creation attributes + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public CaseNotificationRuleCreateAttributes getAttributes() { + return attributes; + } + + public void setAttributes(CaseNotificationRuleCreateAttributes attributes) { + this.attributes = attributes; + } + + public CaseNotificationRuleCreate type(CaseNotificationRuleResourceType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Notification rule resource type + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public CaseNotificationRuleResourceType getType() { + return type; + } + + public void setType(CaseNotificationRuleResourceType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return CaseNotificationRuleCreate + */ + @JsonAnySetter + public CaseNotificationRuleCreate putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this CaseNotificationRuleCreate object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CaseNotificationRuleCreate caseNotificationRuleCreate = (CaseNotificationRuleCreate) o; + return Objects.equals(this.attributes, caseNotificationRuleCreate.attributes) + && Objects.equals(this.type, caseNotificationRuleCreate.type) + && Objects.equals( + this.additionalProperties, caseNotificationRuleCreate.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CaseNotificationRuleCreate {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CaseNotificationRuleCreateAttributes.java b/src/main/java/com/datadog/api/client/v2/model/CaseNotificationRuleCreateAttributes.java new file mode 100644 index 00000000000..ae2b34c706f --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CaseNotificationRuleCreateAttributes.java @@ -0,0 +1,254 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** Notification rule creation attributes */ +@JsonPropertyOrder({ + CaseNotificationRuleCreateAttributes.JSON_PROPERTY_IS_ENABLED, + CaseNotificationRuleCreateAttributes.JSON_PROPERTY_QUERY, + CaseNotificationRuleCreateAttributes.JSON_PROPERTY_RECIPIENTS, + CaseNotificationRuleCreateAttributes.JSON_PROPERTY_TRIGGERS +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CaseNotificationRuleCreateAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_IS_ENABLED = "is_enabled"; + private Boolean isEnabled = true; + + public static final String JSON_PROPERTY_QUERY = "query"; + private String query; + + public static final String JSON_PROPERTY_RECIPIENTS = "recipients"; + private List recipients = new ArrayList<>(); + + public static final String JSON_PROPERTY_TRIGGERS = "triggers"; + private List triggers = new ArrayList<>(); + + public CaseNotificationRuleCreateAttributes() {} + + @JsonCreator + public CaseNotificationRuleCreateAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_RECIPIENTS) + List recipients, + @JsonProperty(required = true, value = JSON_PROPERTY_TRIGGERS) + List triggers) { + this.recipients = recipients; + this.triggers = triggers; + } + + public CaseNotificationRuleCreateAttributes isEnabled(Boolean isEnabled) { + this.isEnabled = isEnabled; + return this; + } + + /** + * Whether the notification rule is enabled + * + * @return isEnabled + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_IS_ENABLED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsEnabled() { + return isEnabled; + } + + public void setIsEnabled(Boolean isEnabled) { + this.isEnabled = isEnabled; + } + + public CaseNotificationRuleCreateAttributes query(String query) { + this.query = query; + return this; + } + + /** + * Query to filter cases for this notification rule + * + * @return query + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_QUERY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getQuery() { + return query; + } + + public void setQuery(String query) { + this.query = query; + } + + public CaseNotificationRuleCreateAttributes recipients( + List recipients) { + this.recipients = recipients; + for (CaseNotificationRuleRecipient item : recipients) { + this.unparsed |= item.unparsed; + } + return this; + } + + public CaseNotificationRuleCreateAttributes addRecipientsItem( + CaseNotificationRuleRecipient recipientsItem) { + this.recipients.add(recipientsItem); + this.unparsed |= recipientsItem.unparsed; + return this; + } + + /** + * List of notification recipients + * + * @return recipients + */ + @JsonProperty(JSON_PROPERTY_RECIPIENTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getRecipients() { + return recipients; + } + + public void setRecipients(List recipients) { + this.recipients = recipients; + } + + public CaseNotificationRuleCreateAttributes triggers(List triggers) { + this.triggers = triggers; + for (CaseNotificationRuleTrigger item : triggers) { + this.unparsed |= item.unparsed; + } + return this; + } + + public CaseNotificationRuleCreateAttributes addTriggersItem( + CaseNotificationRuleTrigger triggersItem) { + this.triggers.add(triggersItem); + this.unparsed |= triggersItem.unparsed; + return this; + } + + /** + * List of triggers for this notification rule + * + * @return triggers + */ + @JsonProperty(JSON_PROPERTY_TRIGGERS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getTriggers() { + return triggers; + } + + public void setTriggers(List triggers) { + this.triggers = triggers; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return CaseNotificationRuleCreateAttributes + */ + @JsonAnySetter + public CaseNotificationRuleCreateAttributes putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this CaseNotificationRuleCreateAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CaseNotificationRuleCreateAttributes caseNotificationRuleCreateAttributes = + (CaseNotificationRuleCreateAttributes) o; + return Objects.equals(this.isEnabled, caseNotificationRuleCreateAttributes.isEnabled) + && Objects.equals(this.query, caseNotificationRuleCreateAttributes.query) + && Objects.equals(this.recipients, caseNotificationRuleCreateAttributes.recipients) + && Objects.equals(this.triggers, caseNotificationRuleCreateAttributes.triggers) + && Objects.equals( + this.additionalProperties, caseNotificationRuleCreateAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(isEnabled, query, recipients, triggers, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CaseNotificationRuleCreateAttributes {\n"); + sb.append(" isEnabled: ").append(toIndentedString(isEnabled)).append("\n"); + sb.append(" query: ").append(toIndentedString(query)).append("\n"); + sb.append(" recipients: ").append(toIndentedString(recipients)).append("\n"); + sb.append(" triggers: ").append(toIndentedString(triggers)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CaseNotificationRuleCreateRequest.java b/src/main/java/com/datadog/api/client/v2/model/CaseNotificationRuleCreateRequest.java new file mode 100644 index 00000000000..4239f997d1d --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CaseNotificationRuleCreateRequest.java @@ -0,0 +1,147 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Notification rule create request */ +@JsonPropertyOrder({CaseNotificationRuleCreateRequest.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CaseNotificationRuleCreateRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private CaseNotificationRuleCreate data; + + public CaseNotificationRuleCreateRequest() {} + + @JsonCreator + public CaseNotificationRuleCreateRequest( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) CaseNotificationRuleCreate data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public CaseNotificationRuleCreateRequest data(CaseNotificationRuleCreate data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Notification rule create + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public CaseNotificationRuleCreate getData() { + return data; + } + + public void setData(CaseNotificationRuleCreate data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return CaseNotificationRuleCreateRequest + */ + @JsonAnySetter + public CaseNotificationRuleCreateRequest putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this CaseNotificationRuleCreateRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CaseNotificationRuleCreateRequest caseNotificationRuleCreateRequest = + (CaseNotificationRuleCreateRequest) o; + return Objects.equals(this.data, caseNotificationRuleCreateRequest.data) + && Objects.equals( + this.additionalProperties, caseNotificationRuleCreateRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CaseNotificationRuleCreateRequest {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CaseNotificationRuleRecipient.java b/src/main/java/com/datadog/api/client/v2/model/CaseNotificationRuleRecipient.java new file mode 100644 index 00000000000..6b2fd0ed40c --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CaseNotificationRuleRecipient.java @@ -0,0 +1,166 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Notification rule recipient */ +@JsonPropertyOrder({ + CaseNotificationRuleRecipient.JSON_PROPERTY_DATA, + CaseNotificationRuleRecipient.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CaseNotificationRuleRecipient { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private CaseNotificationRuleRecipientData data; + + public static final String JSON_PROPERTY_TYPE = "type"; + private String type; + + public CaseNotificationRuleRecipient data(CaseNotificationRuleRecipientData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Recipient data + * + * @return data + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public CaseNotificationRuleRecipientData getData() { + return data; + } + + public void setData(CaseNotificationRuleRecipientData data) { + this.data = data; + } + + public CaseNotificationRuleRecipient type(String type) { + this.type = type; + return this; + } + + /** + * Type of recipient (slack_channel, email, http, pager_duty_service, microsoft_teams_channel) + * + * @return type + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return CaseNotificationRuleRecipient + */ + @JsonAnySetter + public CaseNotificationRuleRecipient putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this CaseNotificationRuleRecipient object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CaseNotificationRuleRecipient caseNotificationRuleRecipient = (CaseNotificationRuleRecipient) o; + return Objects.equals(this.data, caseNotificationRuleRecipient.data) + && Objects.equals(this.type, caseNotificationRuleRecipient.type) + && Objects.equals( + this.additionalProperties, caseNotificationRuleRecipient.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CaseNotificationRuleRecipient {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CaseNotificationRuleRecipientData.java b/src/main/java/com/datadog/api/client/v2/model/CaseNotificationRuleRecipientData.java new file mode 100644 index 00000000000..7e488d206bc --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CaseNotificationRuleRecipientData.java @@ -0,0 +1,477 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Recipient data */ +@JsonPropertyOrder({ + CaseNotificationRuleRecipientData.JSON_PROPERTY_CHANNEL, + CaseNotificationRuleRecipientData.JSON_PROPERTY_CHANNEL_ID, + CaseNotificationRuleRecipientData.JSON_PROPERTY_CHANNEL_NAME, + CaseNotificationRuleRecipientData.JSON_PROPERTY_CONNECTOR_NAME, + CaseNotificationRuleRecipientData.JSON_PROPERTY_EMAIL, + CaseNotificationRuleRecipientData.JSON_PROPERTY_NAME, + CaseNotificationRuleRecipientData.JSON_PROPERTY_SERVICE_NAME, + CaseNotificationRuleRecipientData.JSON_PROPERTY_TEAM_ID, + CaseNotificationRuleRecipientData.JSON_PROPERTY_TEAM_NAME, + CaseNotificationRuleRecipientData.JSON_PROPERTY_TENANT_ID, + CaseNotificationRuleRecipientData.JSON_PROPERTY_TENANT_NAME, + CaseNotificationRuleRecipientData.JSON_PROPERTY_WORKSPACE, + CaseNotificationRuleRecipientData.JSON_PROPERTY_WORKSPACE_ID +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CaseNotificationRuleRecipientData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_CHANNEL = "channel"; + private String channel; + + public static final String JSON_PROPERTY_CHANNEL_ID = "channel_id"; + private String channelId; + + public static final String JSON_PROPERTY_CHANNEL_NAME = "channel_name"; + private String channelName; + + public static final String JSON_PROPERTY_CONNECTOR_NAME = "connector_name"; + private String connectorName; + + public static final String JSON_PROPERTY_EMAIL = "email"; + private String email; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_SERVICE_NAME = "service_name"; + private String serviceName; + + public static final String JSON_PROPERTY_TEAM_ID = "team_id"; + private String teamId; + + public static final String JSON_PROPERTY_TEAM_NAME = "team_name"; + private String teamName; + + public static final String JSON_PROPERTY_TENANT_ID = "tenant_id"; + private String tenantId; + + public static final String JSON_PROPERTY_TENANT_NAME = "tenant_name"; + private String tenantName; + + public static final String JSON_PROPERTY_WORKSPACE = "workspace"; + private String workspace; + + public static final String JSON_PROPERTY_WORKSPACE_ID = "workspace_id"; + private String workspaceId; + + public CaseNotificationRuleRecipientData channel(String channel) { + this.channel = channel; + return this; + } + + /** + * Slack channel name + * + * @return channel + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CHANNEL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getChannel() { + return channel; + } + + public void setChannel(String channel) { + this.channel = channel; + } + + public CaseNotificationRuleRecipientData channelId(String channelId) { + this.channelId = channelId; + return this; + } + + /** + * Slack channel ID + * + * @return channelId + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CHANNEL_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getChannelId() { + return channelId; + } + + public void setChannelId(String channelId) { + this.channelId = channelId; + } + + public CaseNotificationRuleRecipientData channelName(String channelName) { + this.channelName = channelName; + return this; + } + + /** + * Microsoft Teams channel name + * + * @return channelName + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CHANNEL_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getChannelName() { + return channelName; + } + + public void setChannelName(String channelName) { + this.channelName = channelName; + } + + public CaseNotificationRuleRecipientData connectorName(String connectorName) { + this.connectorName = connectorName; + return this; + } + + /** + * Microsoft Teams connector name + * + * @return connectorName + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CONNECTOR_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getConnectorName() { + return connectorName; + } + + public void setConnectorName(String connectorName) { + this.connectorName = connectorName; + } + + public CaseNotificationRuleRecipientData email(String email) { + this.email = email; + return this; + } + + /** + * Email address + * + * @return email + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EMAIL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getEmail() { + return email; + } + + public void setEmail(String email) { + this.email = email; + } + + public CaseNotificationRuleRecipientData name(String name) { + this.name = name; + return this; + } + + /** + * HTTP webhook name + * + * @return name + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public CaseNotificationRuleRecipientData serviceName(String serviceName) { + this.serviceName = serviceName; + return this; + } + + /** + * PagerDuty service name + * + * @return serviceName + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SERVICE_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getServiceName() { + return serviceName; + } + + public void setServiceName(String serviceName) { + this.serviceName = serviceName; + } + + public CaseNotificationRuleRecipientData teamId(String teamId) { + this.teamId = teamId; + return this; + } + + /** + * Microsoft Teams team ID + * + * @return teamId + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TEAM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getTeamId() { + return teamId; + } + + public void setTeamId(String teamId) { + this.teamId = teamId; + } + + public CaseNotificationRuleRecipientData teamName(String teamName) { + this.teamName = teamName; + return this; + } + + /** + * Microsoft Teams team name + * + * @return teamName + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TEAM_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getTeamName() { + return teamName; + } + + public void setTeamName(String teamName) { + this.teamName = teamName; + } + + public CaseNotificationRuleRecipientData tenantId(String tenantId) { + this.tenantId = tenantId; + return this; + } + + /** + * Microsoft Teams tenant ID + * + * @return tenantId + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TENANT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getTenantId() { + return tenantId; + } + + public void setTenantId(String tenantId) { + this.tenantId = tenantId; + } + + public CaseNotificationRuleRecipientData tenantName(String tenantName) { + this.tenantName = tenantName; + return this; + } + + /** + * Microsoft Teams tenant name + * + * @return tenantName + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TENANT_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getTenantName() { + return tenantName; + } + + public void setTenantName(String tenantName) { + this.tenantName = tenantName; + } + + public CaseNotificationRuleRecipientData workspace(String workspace) { + this.workspace = workspace; + return this; + } + + /** + * Slack workspace name + * + * @return workspace + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_WORKSPACE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getWorkspace() { + return workspace; + } + + public void setWorkspace(String workspace) { + this.workspace = workspace; + } + + public CaseNotificationRuleRecipientData workspaceId(String workspaceId) { + this.workspaceId = workspaceId; + return this; + } + + /** + * Slack workspace ID + * + * @return workspaceId + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_WORKSPACE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getWorkspaceId() { + return workspaceId; + } + + public void setWorkspaceId(String workspaceId) { + this.workspaceId = workspaceId; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return CaseNotificationRuleRecipientData + */ + @JsonAnySetter + public CaseNotificationRuleRecipientData putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this CaseNotificationRuleRecipientData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CaseNotificationRuleRecipientData caseNotificationRuleRecipientData = + (CaseNotificationRuleRecipientData) o; + return Objects.equals(this.channel, caseNotificationRuleRecipientData.channel) + && Objects.equals(this.channelId, caseNotificationRuleRecipientData.channelId) + && Objects.equals(this.channelName, caseNotificationRuleRecipientData.channelName) + && Objects.equals(this.connectorName, caseNotificationRuleRecipientData.connectorName) + && Objects.equals(this.email, caseNotificationRuleRecipientData.email) + && Objects.equals(this.name, caseNotificationRuleRecipientData.name) + && Objects.equals(this.serviceName, caseNotificationRuleRecipientData.serviceName) + && Objects.equals(this.teamId, caseNotificationRuleRecipientData.teamId) + && Objects.equals(this.teamName, caseNotificationRuleRecipientData.teamName) + && Objects.equals(this.tenantId, caseNotificationRuleRecipientData.tenantId) + && Objects.equals(this.tenantName, caseNotificationRuleRecipientData.tenantName) + && Objects.equals(this.workspace, caseNotificationRuleRecipientData.workspace) + && Objects.equals(this.workspaceId, caseNotificationRuleRecipientData.workspaceId) + && Objects.equals( + this.additionalProperties, caseNotificationRuleRecipientData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + channel, + channelId, + channelName, + connectorName, + email, + name, + serviceName, + teamId, + teamName, + tenantId, + tenantName, + workspace, + workspaceId, + additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CaseNotificationRuleRecipientData {\n"); + sb.append(" channel: ").append(toIndentedString(channel)).append("\n"); + sb.append(" channelId: ").append(toIndentedString(channelId)).append("\n"); + sb.append(" channelName: ").append(toIndentedString(channelName)).append("\n"); + sb.append(" connectorName: ").append(toIndentedString(connectorName)).append("\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" serviceName: ").append(toIndentedString(serviceName)).append("\n"); + sb.append(" teamId: ").append(toIndentedString(teamId)).append("\n"); + sb.append(" teamName: ").append(toIndentedString(teamName)).append("\n"); + sb.append(" tenantId: ").append(toIndentedString(tenantId)).append("\n"); + sb.append(" tenantName: ").append(toIndentedString(tenantName)).append("\n"); + sb.append(" workspace: ").append(toIndentedString(workspace)).append("\n"); + sb.append(" workspaceId: ").append(toIndentedString(workspaceId)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CaseNotificationRuleResourceType.java b/src/main/java/com/datadog/api/client/v2/model/CaseNotificationRuleResourceType.java new file mode 100644 index 00000000000..e08ca631fdf --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CaseNotificationRuleResourceType.java @@ -0,0 +1,58 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** Notification rule resource type */ +@JsonSerialize( + using = CaseNotificationRuleResourceType.CaseNotificationRuleResourceTypeSerializer.class) +public class CaseNotificationRuleResourceType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("notification_rule")); + + public static final CaseNotificationRuleResourceType NOTIFICATION_RULE = + new CaseNotificationRuleResourceType("notification_rule"); + + CaseNotificationRuleResourceType(String value) { + super(value, allowedValues); + } + + public static class CaseNotificationRuleResourceTypeSerializer + extends StdSerializer { + public CaseNotificationRuleResourceTypeSerializer(Class t) { + super(t); + } + + public CaseNotificationRuleResourceTypeSerializer() { + this(null); + } + + @Override + public void serialize( + CaseNotificationRuleResourceType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static CaseNotificationRuleResourceType fromValue(String value) { + return new CaseNotificationRuleResourceType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CaseNotificationRuleResponse.java b/src/main/java/com/datadog/api/client/v2/model/CaseNotificationRuleResponse.java new file mode 100644 index 00000000000..0b0e1e71fb8 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CaseNotificationRuleResponse.java @@ -0,0 +1,137 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Notification rule response */ +@JsonPropertyOrder({CaseNotificationRuleResponse.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CaseNotificationRuleResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private CaseNotificationRule data; + + public CaseNotificationRuleResponse data(CaseNotificationRule data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * A notification rule for case management + * + * @return data + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public CaseNotificationRule getData() { + return data; + } + + public void setData(CaseNotificationRule data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return CaseNotificationRuleResponse + */ + @JsonAnySetter + public CaseNotificationRuleResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this CaseNotificationRuleResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CaseNotificationRuleResponse caseNotificationRuleResponse = (CaseNotificationRuleResponse) o; + return Objects.equals(this.data, caseNotificationRuleResponse.data) + && Objects.equals( + this.additionalProperties, caseNotificationRuleResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CaseNotificationRuleResponse {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CaseNotificationRuleTrigger.java b/src/main/java/com/datadog/api/client/v2/model/CaseNotificationRuleTrigger.java new file mode 100644 index 00000000000..eeeaeada876 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CaseNotificationRuleTrigger.java @@ -0,0 +1,166 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Notification rule trigger */ +@JsonPropertyOrder({ + CaseNotificationRuleTrigger.JSON_PROPERTY_DATA, + CaseNotificationRuleTrigger.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CaseNotificationRuleTrigger { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private CaseNotificationRuleTriggerData data; + + public static final String JSON_PROPERTY_TYPE = "type"; + private String type; + + public CaseNotificationRuleTrigger data(CaseNotificationRuleTriggerData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Trigger data + * + * @return data + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public CaseNotificationRuleTriggerData getData() { + return data; + } + + public void setData(CaseNotificationRuleTriggerData data) { + this.data = data; + } + + public CaseNotificationRuleTrigger type(String type) { + this.type = type; + return this; + } + + /** + * Type of trigger (status_transitioned, case_created, attribute_value_changed, etc.) + * + * @return type + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return CaseNotificationRuleTrigger + */ + @JsonAnySetter + public CaseNotificationRuleTrigger putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this CaseNotificationRuleTrigger object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CaseNotificationRuleTrigger caseNotificationRuleTrigger = (CaseNotificationRuleTrigger) o; + return Objects.equals(this.data, caseNotificationRuleTrigger.data) + && Objects.equals(this.type, caseNotificationRuleTrigger.type) + && Objects.equals( + this.additionalProperties, caseNotificationRuleTrigger.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CaseNotificationRuleTrigger {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CaseNotificationRuleTriggerData.java b/src/main/java/com/datadog/api/client/v2/model/CaseNotificationRuleTriggerData.java new file mode 100644 index 00000000000..25e63fd762c --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CaseNotificationRuleTriggerData.java @@ -0,0 +1,281 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Trigger data */ +@JsonPropertyOrder({ + CaseNotificationRuleTriggerData.JSON_PROPERTY_CHANGE_TYPE, + CaseNotificationRuleTriggerData.JSON_PROPERTY_FIELD, + CaseNotificationRuleTriggerData.JSON_PROPERTY_FROM_STATUS, + CaseNotificationRuleTriggerData.JSON_PROPERTY_FROM_STATUS_NAME, + CaseNotificationRuleTriggerData.JSON_PROPERTY_TO_STATUS, + CaseNotificationRuleTriggerData.JSON_PROPERTY_TO_STATUS_NAME +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CaseNotificationRuleTriggerData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_CHANGE_TYPE = "change_type"; + private String changeType; + + public static final String JSON_PROPERTY_FIELD = "field"; + private String field; + + public static final String JSON_PROPERTY_FROM_STATUS = "from_status"; + private String fromStatus; + + public static final String JSON_PROPERTY_FROM_STATUS_NAME = "from_status_name"; + private String fromStatusName; + + public static final String JSON_PROPERTY_TO_STATUS = "to_status"; + private String toStatus; + + public static final String JSON_PROPERTY_TO_STATUS_NAME = "to_status_name"; + private String toStatusName; + + public CaseNotificationRuleTriggerData changeType(String changeType) { + this.changeType = changeType; + return this; + } + + /** + * Change type (added, removed, changed) + * + * @return changeType + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CHANGE_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getChangeType() { + return changeType; + } + + public void setChangeType(String changeType) { + this.changeType = changeType; + } + + public CaseNotificationRuleTriggerData field(String field) { + this.field = field; + return this; + } + + /** + * Field name for attribute value changed trigger + * + * @return field + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FIELD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getField() { + return field; + } + + public void setField(String field) { + this.field = field; + } + + public CaseNotificationRuleTriggerData fromStatus(String fromStatus) { + this.fromStatus = fromStatus; + return this; + } + + /** + * Status ID to transition from + * + * @return fromStatus + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FROM_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getFromStatus() { + return fromStatus; + } + + public void setFromStatus(String fromStatus) { + this.fromStatus = fromStatus; + } + + public CaseNotificationRuleTriggerData fromStatusName(String fromStatusName) { + this.fromStatusName = fromStatusName; + return this; + } + + /** + * Status name to transition from + * + * @return fromStatusName + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FROM_STATUS_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getFromStatusName() { + return fromStatusName; + } + + public void setFromStatusName(String fromStatusName) { + this.fromStatusName = fromStatusName; + } + + public CaseNotificationRuleTriggerData toStatus(String toStatus) { + this.toStatus = toStatus; + return this; + } + + /** + * Status ID to transition to + * + * @return toStatus + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TO_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getToStatus() { + return toStatus; + } + + public void setToStatus(String toStatus) { + this.toStatus = toStatus; + } + + public CaseNotificationRuleTriggerData toStatusName(String toStatusName) { + this.toStatusName = toStatusName; + return this; + } + + /** + * Status name to transition to + * + * @return toStatusName + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TO_STATUS_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getToStatusName() { + return toStatusName; + } + + public void setToStatusName(String toStatusName) { + this.toStatusName = toStatusName; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return CaseNotificationRuleTriggerData + */ + @JsonAnySetter + public CaseNotificationRuleTriggerData putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this CaseNotificationRuleTriggerData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CaseNotificationRuleTriggerData caseNotificationRuleTriggerData = + (CaseNotificationRuleTriggerData) o; + return Objects.equals(this.changeType, caseNotificationRuleTriggerData.changeType) + && Objects.equals(this.field, caseNotificationRuleTriggerData.field) + && Objects.equals(this.fromStatus, caseNotificationRuleTriggerData.fromStatus) + && Objects.equals(this.fromStatusName, caseNotificationRuleTriggerData.fromStatusName) + && Objects.equals(this.toStatus, caseNotificationRuleTriggerData.toStatus) + && Objects.equals(this.toStatusName, caseNotificationRuleTriggerData.toStatusName) + && Objects.equals( + this.additionalProperties, caseNotificationRuleTriggerData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + changeType, + field, + fromStatus, + fromStatusName, + toStatus, + toStatusName, + additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CaseNotificationRuleTriggerData {\n"); + sb.append(" changeType: ").append(toIndentedString(changeType)).append("\n"); + sb.append(" field: ").append(toIndentedString(field)).append("\n"); + sb.append(" fromStatus: ").append(toIndentedString(fromStatus)).append("\n"); + sb.append(" fromStatusName: ").append(toIndentedString(fromStatusName)).append("\n"); + sb.append(" toStatus: ").append(toIndentedString(toStatus)).append("\n"); + sb.append(" toStatusName: ").append(toIndentedString(toStatusName)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CaseNotificationRuleUpdate.java b/src/main/java/com/datadog/api/client/v2/model/CaseNotificationRuleUpdate.java new file mode 100644 index 00000000000..83da39fe2b0 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CaseNotificationRuleUpdate.java @@ -0,0 +1,181 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Notification rule update */ +@JsonPropertyOrder({ + CaseNotificationRuleUpdate.JSON_PROPERTY_ATTRIBUTES, + CaseNotificationRuleUpdate.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CaseNotificationRuleUpdate { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private CaseNotificationRuleAttributes attributes; + + public static final String JSON_PROPERTY_TYPE = "type"; + private CaseNotificationRuleResourceType type = + CaseNotificationRuleResourceType.NOTIFICATION_RULE; + + public CaseNotificationRuleUpdate() {} + + @JsonCreator + public CaseNotificationRuleUpdate( + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) + CaseNotificationRuleResourceType type) { + this.type = type; + this.unparsed |= !type.isValid(); + } + + public CaseNotificationRuleUpdate attributes(CaseNotificationRuleAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Notification rule attributes + * + * @return attributes + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public CaseNotificationRuleAttributes getAttributes() { + return attributes; + } + + public void setAttributes(CaseNotificationRuleAttributes attributes) { + this.attributes = attributes; + } + + public CaseNotificationRuleUpdate type(CaseNotificationRuleResourceType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Notification rule resource type + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public CaseNotificationRuleResourceType getType() { + return type; + } + + public void setType(CaseNotificationRuleResourceType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return CaseNotificationRuleUpdate + */ + @JsonAnySetter + public CaseNotificationRuleUpdate putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this CaseNotificationRuleUpdate object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CaseNotificationRuleUpdate caseNotificationRuleUpdate = (CaseNotificationRuleUpdate) o; + return Objects.equals(this.attributes, caseNotificationRuleUpdate.attributes) + && Objects.equals(this.type, caseNotificationRuleUpdate.type) + && Objects.equals( + this.additionalProperties, caseNotificationRuleUpdate.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CaseNotificationRuleUpdate {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CaseNotificationRuleUpdateRequest.java b/src/main/java/com/datadog/api/client/v2/model/CaseNotificationRuleUpdateRequest.java new file mode 100644 index 00000000000..2ca5bd3fba5 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CaseNotificationRuleUpdateRequest.java @@ -0,0 +1,147 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Notification rule update request */ +@JsonPropertyOrder({CaseNotificationRuleUpdateRequest.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CaseNotificationRuleUpdateRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private CaseNotificationRuleUpdate data; + + public CaseNotificationRuleUpdateRequest() {} + + @JsonCreator + public CaseNotificationRuleUpdateRequest( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) CaseNotificationRuleUpdate data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public CaseNotificationRuleUpdateRequest data(CaseNotificationRuleUpdate data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Notification rule update + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public CaseNotificationRuleUpdate getData() { + return data; + } + + public void setData(CaseNotificationRuleUpdate data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return CaseNotificationRuleUpdateRequest + */ + @JsonAnySetter + public CaseNotificationRuleUpdateRequest putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this CaseNotificationRuleUpdateRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CaseNotificationRuleUpdateRequest caseNotificationRuleUpdateRequest = + (CaseNotificationRuleUpdateRequest) o; + return Objects.equals(this.data, caseNotificationRuleUpdateRequest.data) + && Objects.equals( + this.additionalProperties, caseNotificationRuleUpdateRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CaseNotificationRuleUpdateRequest {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CaseNotificationRulesResponse.java b/src/main/java/com/datadog/api/client/v2/model/CaseNotificationRulesResponse.java new file mode 100644 index 00000000000..3d709834836 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CaseNotificationRulesResponse.java @@ -0,0 +1,150 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** Response with notification rules */ +@JsonPropertyOrder({CaseNotificationRulesResponse.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CaseNotificationRulesResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private List data = null; + + public CaseNotificationRulesResponse data(List data) { + this.data = data; + for (CaseNotificationRule item : data) { + this.unparsed |= item.unparsed; + } + return this; + } + + public CaseNotificationRulesResponse addDataItem(CaseNotificationRule dataItem) { + if (this.data == null) { + this.data = new ArrayList<>(); + } + this.data.add(dataItem); + this.unparsed |= dataItem.unparsed; + return this; + } + + /** + * Notification rules data + * + * @return data + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return CaseNotificationRulesResponse + */ + @JsonAnySetter + public CaseNotificationRulesResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this CaseNotificationRulesResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CaseNotificationRulesResponse caseNotificationRulesResponse = (CaseNotificationRulesResponse) o; + return Objects.equals(this.data, caseNotificationRulesResponse.data) + && Objects.equals( + this.additionalProperties, caseNotificationRulesResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CaseNotificationRulesResponse {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/IntegrationIncident.java b/src/main/java/com/datadog/api/client/v2/model/IntegrationIncident.java new file mode 100644 index 00000000000..781116b7b10 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/IntegrationIncident.java @@ -0,0 +1,302 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** Incident integration settings */ +@JsonPropertyOrder({ + IntegrationIncident.JSON_PROPERTY_AUTO_ESCALATION_QUERY, + IntegrationIncident.JSON_PROPERTY_DEFAULT_INCIDENT_COMMANDER, + IntegrationIncident.JSON_PROPERTY_ENABLED, + IntegrationIncident.JSON_PROPERTY_FIELD_MAPPINGS, + IntegrationIncident.JSON_PROPERTY_INCIDENT_TYPE, + IntegrationIncident.JSON_PROPERTY_SEVERITY_CONFIG +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class IntegrationIncident { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_AUTO_ESCALATION_QUERY = "auto_escalation_query"; + private String autoEscalationQuery; + + public static final String JSON_PROPERTY_DEFAULT_INCIDENT_COMMANDER = + "default_incident_commander"; + private String defaultIncidentCommander; + + public static final String JSON_PROPERTY_ENABLED = "enabled"; + private Boolean enabled; + + public static final String JSON_PROPERTY_FIELD_MAPPINGS = "field_mappings"; + private List fieldMappings = null; + + public static final String JSON_PROPERTY_INCIDENT_TYPE = "incident_type"; + private String incidentType; + + public static final String JSON_PROPERTY_SEVERITY_CONFIG = "severity_config"; + private IntegrationIncidentSeverityConfig severityConfig; + + public IntegrationIncident autoEscalationQuery(String autoEscalationQuery) { + this.autoEscalationQuery = autoEscalationQuery; + return this; + } + + /** + * Query for auto-escalation + * + * @return autoEscalationQuery + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_AUTO_ESCALATION_QUERY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAutoEscalationQuery() { + return autoEscalationQuery; + } + + public void setAutoEscalationQuery(String autoEscalationQuery) { + this.autoEscalationQuery = autoEscalationQuery; + } + + public IntegrationIncident defaultIncidentCommander(String defaultIncidentCommander) { + this.defaultIncidentCommander = defaultIncidentCommander; + return this; + } + + /** + * Default incident commander + * + * @return defaultIncidentCommander + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DEFAULT_INCIDENT_COMMANDER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDefaultIncidentCommander() { + return defaultIncidentCommander; + } + + public void setDefaultIncidentCommander(String defaultIncidentCommander) { + this.defaultIncidentCommander = defaultIncidentCommander; + } + + public IntegrationIncident enabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Whether incident integration is enabled + * + * @return enabled + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ENABLED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnabled() { + return enabled; + } + + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + + public IntegrationIncident fieldMappings( + List fieldMappings) { + this.fieldMappings = fieldMappings; + for (IntegrationIncidentFieldMappingsItems item : fieldMappings) { + this.unparsed |= item.unparsed; + } + return this; + } + + public IntegrationIncident addFieldMappingsItem( + IntegrationIncidentFieldMappingsItems fieldMappingsItem) { + if (this.fieldMappings == null) { + this.fieldMappings = new ArrayList<>(); + } + this.fieldMappings.add(fieldMappingsItem); + this.unparsed |= fieldMappingsItem.unparsed; + return this; + } + + /** + * GetfieldMappings + * + * @return fieldMappings + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FIELD_MAPPINGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getFieldMappings() { + return fieldMappings; + } + + public void setFieldMappings(List fieldMappings) { + this.fieldMappings = fieldMappings; + } + + public IntegrationIncident incidentType(String incidentType) { + this.incidentType = incidentType; + return this; + } + + /** + * Incident type + * + * @return incidentType + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_INCIDENT_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getIncidentType() { + return incidentType; + } + + public void setIncidentType(String incidentType) { + this.incidentType = incidentType; + } + + public IntegrationIncident severityConfig(IntegrationIncidentSeverityConfig severityConfig) { + this.severityConfig = severityConfig; + this.unparsed |= severityConfig.unparsed; + return this; + } + + /** + * GetseverityConfig + * + * @return severityConfig + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SEVERITY_CONFIG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public IntegrationIncidentSeverityConfig getSeverityConfig() { + return severityConfig; + } + + public void setSeverityConfig(IntegrationIncidentSeverityConfig severityConfig) { + this.severityConfig = severityConfig; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return IntegrationIncident + */ + @JsonAnySetter + public IntegrationIncident putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this IntegrationIncident object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IntegrationIncident integrationIncident = (IntegrationIncident) o; + return Objects.equals(this.autoEscalationQuery, integrationIncident.autoEscalationQuery) + && Objects.equals( + this.defaultIncidentCommander, integrationIncident.defaultIncidentCommander) + && Objects.equals(this.enabled, integrationIncident.enabled) + && Objects.equals(this.fieldMappings, integrationIncident.fieldMappings) + && Objects.equals(this.incidentType, integrationIncident.incidentType) + && Objects.equals(this.severityConfig, integrationIncident.severityConfig) + && Objects.equals(this.additionalProperties, integrationIncident.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + autoEscalationQuery, + defaultIncidentCommander, + enabled, + fieldMappings, + incidentType, + severityConfig, + additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IntegrationIncident {\n"); + sb.append(" autoEscalationQuery: ") + .append(toIndentedString(autoEscalationQuery)) + .append("\n"); + sb.append(" defaultIncidentCommander: ") + .append(toIndentedString(defaultIncidentCommander)) + .append("\n"); + sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); + sb.append(" fieldMappings: ").append(toIndentedString(fieldMappings)).append("\n"); + sb.append(" incidentType: ").append(toIndentedString(incidentType)).append("\n"); + sb.append(" severityConfig: ").append(toIndentedString(severityConfig)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/IntegrationIncidentFieldMappingsItems.java b/src/main/java/com/datadog/api/client/v2/model/IntegrationIncidentFieldMappingsItems.java new file mode 100644 index 00000000000..f8d09e3eff1 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/IntegrationIncidentFieldMappingsItems.java @@ -0,0 +1,172 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** */ +@JsonPropertyOrder({ + IntegrationIncidentFieldMappingsItems.JSON_PROPERTY_CASE_FIELD, + IntegrationIncidentFieldMappingsItems.JSON_PROPERTY_INCIDENT_USER_DEFINED_FIELD_ID +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class IntegrationIncidentFieldMappingsItems { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_CASE_FIELD = "case_field"; + private String caseField; + + public static final String JSON_PROPERTY_INCIDENT_USER_DEFINED_FIELD_ID = + "incident_user_defined_field_id"; + private String incidentUserDefinedFieldId; + + public IntegrationIncidentFieldMappingsItems caseField(String caseField) { + this.caseField = caseField; + return this; + } + + /** + * GetcaseField + * + * @return caseField + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CASE_FIELD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCaseField() { + return caseField; + } + + public void setCaseField(String caseField) { + this.caseField = caseField; + } + + public IntegrationIncidentFieldMappingsItems incidentUserDefinedFieldId( + String incidentUserDefinedFieldId) { + this.incidentUserDefinedFieldId = incidentUserDefinedFieldId; + return this; + } + + /** + * GetincidentUserDefinedFieldId + * + * @return incidentUserDefinedFieldId + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_INCIDENT_USER_DEFINED_FIELD_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getIncidentUserDefinedFieldId() { + return incidentUserDefinedFieldId; + } + + public void setIncidentUserDefinedFieldId(String incidentUserDefinedFieldId) { + this.incidentUserDefinedFieldId = incidentUserDefinedFieldId; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return IntegrationIncidentFieldMappingsItems + */ + @JsonAnySetter + public IntegrationIncidentFieldMappingsItems putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this IntegrationIncidentFieldMappingsItems object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IntegrationIncidentFieldMappingsItems integrationIncidentFieldMappingsItems = + (IntegrationIncidentFieldMappingsItems) o; + return Objects.equals(this.caseField, integrationIncidentFieldMappingsItems.caseField) + && Objects.equals( + this.incidentUserDefinedFieldId, + integrationIncidentFieldMappingsItems.incidentUserDefinedFieldId) + && Objects.equals( + this.additionalProperties, integrationIncidentFieldMappingsItems.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(caseField, incidentUserDefinedFieldId, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IntegrationIncidentFieldMappingsItems {\n"); + sb.append(" caseField: ").append(toIndentedString(caseField)).append("\n"); + sb.append(" incidentUserDefinedFieldId: ") + .append(toIndentedString(incidentUserDefinedFieldId)) + .append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/IntegrationIncidentSeverityConfig.java b/src/main/java/com/datadog/api/client/v2/model/IntegrationIncidentSeverityConfig.java new file mode 100644 index 00000000000..2e2ca450072 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/IntegrationIncidentSeverityConfig.java @@ -0,0 +1,146 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** */ +@JsonPropertyOrder({IntegrationIncidentSeverityConfig.JSON_PROPERTY_PRIORITY_MAPPING}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class IntegrationIncidentSeverityConfig { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_PRIORITY_MAPPING = "priority_mapping"; + private Map priorityMapping = null; + + public IntegrationIncidentSeverityConfig priorityMapping(Map priorityMapping) { + this.priorityMapping = priorityMapping; + return this; + } + + public IntegrationIncidentSeverityConfig putPriorityMappingItem( + String key, String priorityMappingItem) { + if (this.priorityMapping == null) { + this.priorityMapping = new HashMap<>(); + } + this.priorityMapping.put(key, priorityMappingItem); + return this; + } + + /** + * GetpriorityMapping + * + * @return priorityMapping + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PRIORITY_MAPPING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getPriorityMapping() { + return priorityMapping; + } + + public void setPriorityMapping(Map priorityMapping) { + this.priorityMapping = priorityMapping; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return IntegrationIncidentSeverityConfig + */ + @JsonAnySetter + public IntegrationIncidentSeverityConfig putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this IntegrationIncidentSeverityConfig object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IntegrationIncidentSeverityConfig integrationIncidentSeverityConfig = + (IntegrationIncidentSeverityConfig) o; + return Objects.equals(this.priorityMapping, integrationIncidentSeverityConfig.priorityMapping) + && Objects.equals( + this.additionalProperties, integrationIncidentSeverityConfig.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(priorityMapping, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IntegrationIncidentSeverityConfig {\n"); + sb.append(" priorityMapping: ").append(toIndentedString(priorityMapping)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/IntegrationJira.java b/src/main/java/com/datadog/api/client/v2/model/IntegrationJira.java new file mode 100644 index 00000000000..1e021cb4cbc --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/IntegrationJira.java @@ -0,0 +1,221 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Jira integration settings */ +@JsonPropertyOrder({ + IntegrationJira.JSON_PROPERTY_AUTO_CREATION, + IntegrationJira.JSON_PROPERTY_ENABLED, + IntegrationJira.JSON_PROPERTY_METADATA, + IntegrationJira.JSON_PROPERTY_SYNC +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class IntegrationJira { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_AUTO_CREATION = "auto_creation"; + private IntegrationJiraAutoCreation autoCreation; + + public static final String JSON_PROPERTY_ENABLED = "enabled"; + private Boolean enabled; + + public static final String JSON_PROPERTY_METADATA = "metadata"; + private IntegrationJiraMetadata metadata; + + public static final String JSON_PROPERTY_SYNC = "sync"; + private IntegrationJiraSync sync; + + public IntegrationJira autoCreation(IntegrationJiraAutoCreation autoCreation) { + this.autoCreation = autoCreation; + this.unparsed |= autoCreation.unparsed; + return this; + } + + /** + * GetautoCreation + * + * @return autoCreation + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_AUTO_CREATION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public IntegrationJiraAutoCreation getAutoCreation() { + return autoCreation; + } + + public void setAutoCreation(IntegrationJiraAutoCreation autoCreation) { + this.autoCreation = autoCreation; + } + + public IntegrationJira enabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Whether Jira integration is enabled + * + * @return enabled + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ENABLED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnabled() { + return enabled; + } + + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + + public IntegrationJira metadata(IntegrationJiraMetadata metadata) { + this.metadata = metadata; + this.unparsed |= metadata.unparsed; + return this; + } + + /** + * Getmetadata + * + * @return metadata + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_METADATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public IntegrationJiraMetadata getMetadata() { + return metadata; + } + + public void setMetadata(IntegrationJiraMetadata metadata) { + this.metadata = metadata; + } + + public IntegrationJira sync(IntegrationJiraSync sync) { + this.sync = sync; + this.unparsed |= sync.unparsed; + return this; + } + + /** + * Getsync + * + * @return sync + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SYNC) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public IntegrationJiraSync getSync() { + return sync; + } + + public void setSync(IntegrationJiraSync sync) { + this.sync = sync; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return IntegrationJira + */ + @JsonAnySetter + public IntegrationJira putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this IntegrationJira object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IntegrationJira integrationJira = (IntegrationJira) o; + return Objects.equals(this.autoCreation, integrationJira.autoCreation) + && Objects.equals(this.enabled, integrationJira.enabled) + && Objects.equals(this.metadata, integrationJira.metadata) + && Objects.equals(this.sync, integrationJira.sync) + && Objects.equals(this.additionalProperties, integrationJira.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(autoCreation, enabled, metadata, sync, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IntegrationJira {\n"); + sb.append(" autoCreation: ").append(toIndentedString(autoCreation)).append("\n"); + sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" sync: ").append(toIndentedString(sync)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/IntegrationJiraAutoCreation.java b/src/main/java/com/datadog/api/client/v2/model/IntegrationJiraAutoCreation.java new file mode 100644 index 00000000000..b407e14b716 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/IntegrationJiraAutoCreation.java @@ -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. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** */ +@JsonPropertyOrder({IntegrationJiraAutoCreation.JSON_PROPERTY_ENABLED}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class IntegrationJiraAutoCreation { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ENABLED = "enabled"; + private Boolean enabled; + + public IntegrationJiraAutoCreation enabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Getenabled + * + * @return enabled + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ENABLED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnabled() { + return enabled; + } + + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return IntegrationJiraAutoCreation + */ + @JsonAnySetter + public IntegrationJiraAutoCreation putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this IntegrationJiraAutoCreation object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IntegrationJiraAutoCreation integrationJiraAutoCreation = (IntegrationJiraAutoCreation) o; + return Objects.equals(this.enabled, integrationJiraAutoCreation.enabled) + && Objects.equals( + this.additionalProperties, integrationJiraAutoCreation.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(enabled, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IntegrationJiraAutoCreation {\n"); + sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/IntegrationJiraMetadata.java b/src/main/java/com/datadog/api/client/v2/model/IntegrationJiraMetadata.java new file mode 100644 index 00000000000..427f5a899f8 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/IntegrationJiraMetadata.java @@ -0,0 +1,191 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** */ +@JsonPropertyOrder({ + IntegrationJiraMetadata.JSON_PROPERTY_ACCOUNT_ID, + IntegrationJiraMetadata.JSON_PROPERTY_ISSUE_TYPE_ID, + IntegrationJiraMetadata.JSON_PROPERTY_PROJECT_ID +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class IntegrationJiraMetadata { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ACCOUNT_ID = "account_id"; + private String accountId; + + public static final String JSON_PROPERTY_ISSUE_TYPE_ID = "issue_type_id"; + private String issueTypeId; + + public static final String JSON_PROPERTY_PROJECT_ID = "project_id"; + private String projectId; + + public IntegrationJiraMetadata accountId(String accountId) { + this.accountId = accountId; + return this; + } + + /** + * GetaccountId + * + * @return accountId + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ACCOUNT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAccountId() { + return accountId; + } + + public void setAccountId(String accountId) { + this.accountId = accountId; + } + + public IntegrationJiraMetadata issueTypeId(String issueTypeId) { + this.issueTypeId = issueTypeId; + return this; + } + + /** + * GetissueTypeId + * + * @return issueTypeId + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ISSUE_TYPE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getIssueTypeId() { + return issueTypeId; + } + + public void setIssueTypeId(String issueTypeId) { + this.issueTypeId = issueTypeId; + } + + public IntegrationJiraMetadata projectId(String projectId) { + this.projectId = projectId; + return this; + } + + /** + * GetprojectId + * + * @return projectId + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PROJECT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getProjectId() { + return projectId; + } + + public void setProjectId(String projectId) { + this.projectId = projectId; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return IntegrationJiraMetadata + */ + @JsonAnySetter + public IntegrationJiraMetadata putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this IntegrationJiraMetadata object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IntegrationJiraMetadata integrationJiraMetadata = (IntegrationJiraMetadata) o; + return Objects.equals(this.accountId, integrationJiraMetadata.accountId) + && Objects.equals(this.issueTypeId, integrationJiraMetadata.issueTypeId) + && Objects.equals(this.projectId, integrationJiraMetadata.projectId) + && Objects.equals(this.additionalProperties, integrationJiraMetadata.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(accountId, issueTypeId, projectId, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IntegrationJiraMetadata {\n"); + sb.append(" accountId: ").append(toIndentedString(accountId)).append("\n"); + sb.append(" issueTypeId: ").append(toIndentedString(issueTypeId)).append("\n"); + sb.append(" projectId: ").append(toIndentedString(projectId)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/IntegrationJiraSync.java b/src/main/java/com/datadog/api/client/v2/model/IntegrationJiraSync.java new file mode 100644 index 00000000000..e153cdf1888 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/IntegrationJiraSync.java @@ -0,0 +1,165 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** */ +@JsonPropertyOrder({ + IntegrationJiraSync.JSON_PROPERTY_ENABLED, + IntegrationJiraSync.JSON_PROPERTY_PROPERTIES +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class IntegrationJiraSync { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ENABLED = "enabled"; + private Boolean enabled; + + public static final String JSON_PROPERTY_PROPERTIES = "properties"; + private IntegrationJiraSync139772721530016 properties; + + public IntegrationJiraSync enabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Getenabled + * + * @return enabled + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ENABLED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnabled() { + return enabled; + } + + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + + public IntegrationJiraSync properties(IntegrationJiraSync139772721530016 properties) { + this.properties = properties; + this.unparsed |= properties.unparsed; + return this; + } + + /** + * Getproperties + * + * @return properties + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PROPERTIES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public IntegrationJiraSync139772721530016 getProperties() { + return properties; + } + + public void setProperties(IntegrationJiraSync139772721530016 properties) { + this.properties = properties; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return IntegrationJiraSync + */ + @JsonAnySetter + public IntegrationJiraSync putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this IntegrationJiraSync object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IntegrationJiraSync integrationJiraSync = (IntegrationJiraSync) o; + return Objects.equals(this.enabled, integrationJiraSync.enabled) + && Objects.equals(this.properties, integrationJiraSync.properties) + && Objects.equals(this.additionalProperties, integrationJiraSync.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(enabled, properties, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IntegrationJiraSync {\n"); + sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); + sb.append(" properties: ").append(toIndentedString(properties)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/IntegrationJiraSync139772721530016.java b/src/main/java/com/datadog/api/client/v2/model/IntegrationJiraSync139772721530016.java new file mode 100644 index 00000000000..fb07c55beb6 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/IntegrationJiraSync139772721530016.java @@ -0,0 +1,353 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** */ +@JsonPropertyOrder({ + IntegrationJiraSync139772721530016.JSON_PROPERTY_ASSIGNEE, + IntegrationJiraSync139772721530016.JSON_PROPERTY_COMMENTS, + IntegrationJiraSync139772721530016.JSON_PROPERTY_CUSTOM_FIELDS, + IntegrationJiraSync139772721530016.JSON_PROPERTY_DESCRIPTION, + IntegrationJiraSync139772721530016.JSON_PROPERTY_DUE_DATE, + IntegrationJiraSync139772721530016.JSON_PROPERTY_PRIORITY, + IntegrationJiraSync139772721530016.JSON_PROPERTY_STATUS, + IntegrationJiraSync139772721530016.JSON_PROPERTY_TITLE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class IntegrationJiraSync139772721530016 { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ASSIGNEE = "assignee"; + private SyncProperty assignee; + + public static final String JSON_PROPERTY_COMMENTS = "comments"; + private SyncProperty comments; + + public static final String JSON_PROPERTY_CUSTOM_FIELDS = "custom_fields"; + private Map customFields = null; + + public static final String JSON_PROPERTY_DESCRIPTION = "description"; + private SyncProperty description; + + public static final String JSON_PROPERTY_DUE_DATE = "due_date"; + private IntegrationJiraSyncDueDate dueDate; + + public static final String JSON_PROPERTY_PRIORITY = "priority"; + private SyncPropertyWithMapping priority; + + public static final String JSON_PROPERTY_STATUS = "status"; + private SyncPropertyWithMapping status; + + public static final String JSON_PROPERTY_TITLE = "title"; + private SyncProperty title; + + public IntegrationJiraSync139772721530016 assignee(SyncProperty assignee) { + this.assignee = assignee; + this.unparsed |= assignee.unparsed; + return this; + } + + /** + * Sync property configuration + * + * @return assignee + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ASSIGNEE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public SyncProperty getAssignee() { + return assignee; + } + + public void setAssignee(SyncProperty assignee) { + this.assignee = assignee; + } + + public IntegrationJiraSync139772721530016 comments(SyncProperty comments) { + this.comments = comments; + this.unparsed |= comments.unparsed; + return this; + } + + /** + * Sync property configuration + * + * @return comments + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_COMMENTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public SyncProperty getComments() { + return comments; + } + + public void setComments(SyncProperty comments) { + this.comments = comments; + } + + public IntegrationJiraSync139772721530016 customFields(Map customFields) { + this.customFields = customFields; + return this; + } + + public IntegrationJiraSync139772721530016 putCustomFieldsItem( + String key, Object customFieldsItem) { + if (this.customFields == null) { + this.customFields = new HashMap<>(); + } + this.customFields.put(key, customFieldsItem); + return this; + } + + /** + * GetcustomFields + * + * @return customFields + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getCustomFields() { + return customFields; + } + + public void setCustomFields(Map customFields) { + this.customFields = customFields; + } + + public IntegrationJiraSync139772721530016 description(SyncProperty description) { + this.description = description; + this.unparsed |= description.unparsed; + return this; + } + + /** + * Sync property configuration + * + * @return description + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public SyncProperty getDescription() { + return description; + } + + public void setDescription(SyncProperty description) { + this.description = description; + } + + public IntegrationJiraSync139772721530016 dueDate(IntegrationJiraSyncDueDate dueDate) { + this.dueDate = dueDate; + this.unparsed |= dueDate.unparsed; + return this; + } + + /** + * GetdueDate + * + * @return dueDate + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DUE_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public IntegrationJiraSyncDueDate getDueDate() { + return dueDate; + } + + public void setDueDate(IntegrationJiraSyncDueDate dueDate) { + this.dueDate = dueDate; + } + + public IntegrationJiraSync139772721530016 priority(SyncPropertyWithMapping priority) { + this.priority = priority; + this.unparsed |= priority.unparsed; + return this; + } + + /** + * Sync property with mapping configuration + * + * @return priority + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PRIORITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public SyncPropertyWithMapping getPriority() { + return priority; + } + + public void setPriority(SyncPropertyWithMapping priority) { + this.priority = priority; + } + + public IntegrationJiraSync139772721530016 status(SyncPropertyWithMapping status) { + this.status = status; + this.unparsed |= status.unparsed; + return this; + } + + /** + * Sync property with mapping configuration + * + * @return status + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public SyncPropertyWithMapping getStatus() { + return status; + } + + public void setStatus(SyncPropertyWithMapping status) { + this.status = status; + } + + public IntegrationJiraSync139772721530016 title(SyncProperty title) { + this.title = title; + this.unparsed |= title.unparsed; + return this; + } + + /** + * Sync property configuration + * + * @return title + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public SyncProperty getTitle() { + return title; + } + + public void setTitle(SyncProperty title) { + this.title = title; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return IntegrationJiraSync139772721530016 + */ + @JsonAnySetter + public IntegrationJiraSync139772721530016 putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this IntegrationJiraSync139772721530016 object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IntegrationJiraSync139772721530016 integrationJiraSync139772721530016 = + (IntegrationJiraSync139772721530016) o; + return Objects.equals(this.assignee, integrationJiraSync139772721530016.assignee) + && Objects.equals(this.comments, integrationJiraSync139772721530016.comments) + && Objects.equals(this.customFields, integrationJiraSync139772721530016.customFields) + && Objects.equals(this.description, integrationJiraSync139772721530016.description) + && Objects.equals(this.dueDate, integrationJiraSync139772721530016.dueDate) + && Objects.equals(this.priority, integrationJiraSync139772721530016.priority) + && Objects.equals(this.status, integrationJiraSync139772721530016.status) + && Objects.equals(this.title, integrationJiraSync139772721530016.title) + && Objects.equals( + this.additionalProperties, integrationJiraSync139772721530016.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + assignee, + comments, + customFields, + description, + dueDate, + priority, + status, + title, + additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IntegrationJiraSync139772721530016 {\n"); + sb.append(" assignee: ").append(toIndentedString(assignee)).append("\n"); + sb.append(" comments: ").append(toIndentedString(comments)).append("\n"); + sb.append(" customFields: ").append(toIndentedString(customFields)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" dueDate: ").append(toIndentedString(dueDate)).append("\n"); + sb.append(" priority: ").append(toIndentedString(priority)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" title: ").append(toIndentedString(title)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/IntegrationJiraSyncDueDate.java b/src/main/java/com/datadog/api/client/v2/model/IntegrationJiraSyncDueDate.java new file mode 100644 index 00000000000..2b71ad1d964 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/IntegrationJiraSyncDueDate.java @@ -0,0 +1,165 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** */ +@JsonPropertyOrder({ + IntegrationJiraSyncDueDate.JSON_PROPERTY_JIRA_FIELD_ID, + IntegrationJiraSyncDueDate.JSON_PROPERTY_SYNC_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class IntegrationJiraSyncDueDate { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_JIRA_FIELD_ID = "jira_field_id"; + private String jiraFieldId; + + public static final String JSON_PROPERTY_SYNC_TYPE = "sync_type"; + private String syncType; + + public IntegrationJiraSyncDueDate jiraFieldId(String jiraFieldId) { + this.jiraFieldId = jiraFieldId; + return this; + } + + /** + * GetjiraFieldId + * + * @return jiraFieldId + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_JIRA_FIELD_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getJiraFieldId() { + return jiraFieldId; + } + + public void setJiraFieldId(String jiraFieldId) { + this.jiraFieldId = jiraFieldId; + } + + public IntegrationJiraSyncDueDate syncType(String syncType) { + this.syncType = syncType; + return this; + } + + /** + * GetsyncType + * + * @return syncType + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SYNC_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSyncType() { + return syncType; + } + + public void setSyncType(String syncType) { + this.syncType = syncType; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return IntegrationJiraSyncDueDate + */ + @JsonAnySetter + public IntegrationJiraSyncDueDate putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this IntegrationJiraSyncDueDate object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IntegrationJiraSyncDueDate integrationJiraSyncDueDate = (IntegrationJiraSyncDueDate) o; + return Objects.equals(this.jiraFieldId, integrationJiraSyncDueDate.jiraFieldId) + && Objects.equals(this.syncType, integrationJiraSyncDueDate.syncType) + && Objects.equals( + this.additionalProperties, integrationJiraSyncDueDate.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(jiraFieldId, syncType, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IntegrationJiraSyncDueDate {\n"); + sb.append(" jiraFieldId: ").append(toIndentedString(jiraFieldId)).append("\n"); + sb.append(" syncType: ").append(toIndentedString(syncType)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/IntegrationMonitor.java b/src/main/java/com/datadog/api/client/v2/model/IntegrationMonitor.java new file mode 100644 index 00000000000..734b6c3f966 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/IntegrationMonitor.java @@ -0,0 +1,218 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Monitor integration settings */ +@JsonPropertyOrder({ + IntegrationMonitor.JSON_PROPERTY_AUTO_RESOLVE_ENABLED, + IntegrationMonitor.JSON_PROPERTY_CASE_TYPE_ID, + IntegrationMonitor.JSON_PROPERTY_ENABLED, + IntegrationMonitor.JSON_PROPERTY_HANDLE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class IntegrationMonitor { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_AUTO_RESOLVE_ENABLED = "auto_resolve_enabled"; + private Boolean autoResolveEnabled; + + public static final String JSON_PROPERTY_CASE_TYPE_ID = "case_type_id"; + private String caseTypeId; + + public static final String JSON_PROPERTY_ENABLED = "enabled"; + private Boolean enabled; + + public static final String JSON_PROPERTY_HANDLE = "handle"; + private String handle; + + public IntegrationMonitor autoResolveEnabled(Boolean autoResolveEnabled) { + this.autoResolveEnabled = autoResolveEnabled; + return this; + } + + /** + * Whether auto-resolve is enabled + * + * @return autoResolveEnabled + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_AUTO_RESOLVE_ENABLED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getAutoResolveEnabled() { + return autoResolveEnabled; + } + + public void setAutoResolveEnabled(Boolean autoResolveEnabled) { + this.autoResolveEnabled = autoResolveEnabled; + } + + public IntegrationMonitor caseTypeId(String caseTypeId) { + this.caseTypeId = caseTypeId; + return this; + } + + /** + * Case type ID for monitor integration + * + * @return caseTypeId + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CASE_TYPE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCaseTypeId() { + return caseTypeId; + } + + public void setCaseTypeId(String caseTypeId) { + this.caseTypeId = caseTypeId; + } + + public IntegrationMonitor enabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Whether monitor integration is enabled + * + * @return enabled + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ENABLED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnabled() { + return enabled; + } + + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + + public IntegrationMonitor handle(String handle) { + this.handle = handle; + return this; + } + + /** + * Monitor handle + * + * @return handle + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_HANDLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getHandle() { + return handle; + } + + public void setHandle(String handle) { + this.handle = handle; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return IntegrationMonitor + */ + @JsonAnySetter + public IntegrationMonitor putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this IntegrationMonitor object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IntegrationMonitor integrationMonitor = (IntegrationMonitor) o; + return Objects.equals(this.autoResolveEnabled, integrationMonitor.autoResolveEnabled) + && Objects.equals(this.caseTypeId, integrationMonitor.caseTypeId) + && Objects.equals(this.enabled, integrationMonitor.enabled) + && Objects.equals(this.handle, integrationMonitor.handle) + && Objects.equals(this.additionalProperties, integrationMonitor.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(autoResolveEnabled, caseTypeId, enabled, handle, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IntegrationMonitor {\n"); + sb.append(" autoResolveEnabled: ").append(toIndentedString(autoResolveEnabled)).append("\n"); + sb.append(" caseTypeId: ").append(toIndentedString(caseTypeId)).append("\n"); + sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); + sb.append(" handle: ").append(toIndentedString(handle)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/IntegrationOnCall.java b/src/main/java/com/datadog/api/client/v2/model/IntegrationOnCall.java new file mode 100644 index 00000000000..b39097b1585 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/IntegrationOnCall.java @@ -0,0 +1,208 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** On-Call integration settings */ +@JsonPropertyOrder({ + IntegrationOnCall.JSON_PROPERTY_AUTO_ASSIGN_ON_CALL, + IntegrationOnCall.JSON_PROPERTY_ENABLED, + IntegrationOnCall.JSON_PROPERTY_ESCALATION_QUERIES +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class IntegrationOnCall { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_AUTO_ASSIGN_ON_CALL = "auto_assign_on_call"; + private Boolean autoAssignOnCall; + + public static final String JSON_PROPERTY_ENABLED = "enabled"; + private Boolean enabled; + + public static final String JSON_PROPERTY_ESCALATION_QUERIES = "escalation_queries"; + private List escalationQueries = null; + + public IntegrationOnCall autoAssignOnCall(Boolean autoAssignOnCall) { + this.autoAssignOnCall = autoAssignOnCall; + return this; + } + + /** + * Whether to auto-assign on-call + * + * @return autoAssignOnCall + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_AUTO_ASSIGN_ON_CALL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getAutoAssignOnCall() { + return autoAssignOnCall; + } + + public void setAutoAssignOnCall(Boolean autoAssignOnCall) { + this.autoAssignOnCall = autoAssignOnCall; + } + + public IntegrationOnCall enabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Whether On-Call integration is enabled + * + * @return enabled + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ENABLED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnabled() { + return enabled; + } + + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + + public IntegrationOnCall escalationQueries( + List escalationQueries) { + this.escalationQueries = escalationQueries; + for (IntegrationOnCallEscalationQueriesItems item : escalationQueries) { + this.unparsed |= item.unparsed; + } + return this; + } + + public IntegrationOnCall addEscalationQueriesItem( + IntegrationOnCallEscalationQueriesItems escalationQueriesItem) { + if (this.escalationQueries == null) { + this.escalationQueries = new ArrayList<>(); + } + this.escalationQueries.add(escalationQueriesItem); + this.unparsed |= escalationQueriesItem.unparsed; + return this; + } + + /** + * GetescalationQueries + * + * @return escalationQueries + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ESCALATION_QUERIES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getEscalationQueries() { + return escalationQueries; + } + + public void setEscalationQueries( + List escalationQueries) { + this.escalationQueries = escalationQueries; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return IntegrationOnCall + */ + @JsonAnySetter + public IntegrationOnCall putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this IntegrationOnCall object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IntegrationOnCall integrationOnCall = (IntegrationOnCall) o; + return Objects.equals(this.autoAssignOnCall, integrationOnCall.autoAssignOnCall) + && Objects.equals(this.enabled, integrationOnCall.enabled) + && Objects.equals(this.escalationQueries, integrationOnCall.escalationQueries) + && Objects.equals(this.additionalProperties, integrationOnCall.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(autoAssignOnCall, enabled, escalationQueries, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IntegrationOnCall {\n"); + sb.append(" autoAssignOnCall: ").append(toIndentedString(autoAssignOnCall)).append("\n"); + sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); + sb.append(" escalationQueries: ").append(toIndentedString(escalationQueries)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/IntegrationOnCallEscalationQueriesItems.java b/src/main/java/com/datadog/api/client/v2/model/IntegrationOnCallEscalationQueriesItems.java new file mode 100644 index 00000000000..c8a43cdd7f3 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/IntegrationOnCallEscalationQueriesItems.java @@ -0,0 +1,223 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** */ +@JsonPropertyOrder({ + IntegrationOnCallEscalationQueriesItems.JSON_PROPERTY_ENABLED, + IntegrationOnCallEscalationQueriesItems.JSON_PROPERTY_ID, + IntegrationOnCallEscalationQueriesItems.JSON_PROPERTY_QUERY, + IntegrationOnCallEscalationQueriesItems.JSON_PROPERTY_TARGET +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class IntegrationOnCallEscalationQueriesItems { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ENABLED = "enabled"; + private Boolean enabled; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_QUERY = "query"; + private String query; + + public static final String JSON_PROPERTY_TARGET = "target"; + private IntegrationOnCallEscalationQueriesItemsTarget target; + + public IntegrationOnCallEscalationQueriesItems enabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Getenabled + * + * @return enabled + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ENABLED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnabled() { + return enabled; + } + + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + + public IntegrationOnCallEscalationQueriesItems id(String id) { + this.id = id; + return this; + } + + /** + * Getid + * + * @return id + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public IntegrationOnCallEscalationQueriesItems query(String query) { + this.query = query; + return this; + } + + /** + * Getquery + * + * @return query + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_QUERY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getQuery() { + return query; + } + + public void setQuery(String query) { + this.query = query; + } + + public IntegrationOnCallEscalationQueriesItems target( + IntegrationOnCallEscalationQueriesItemsTarget target) { + this.target = target; + this.unparsed |= target.unparsed; + return this; + } + + /** + * Gettarget + * + * @return target + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TARGET) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public IntegrationOnCallEscalationQueriesItemsTarget getTarget() { + return target; + } + + public void setTarget(IntegrationOnCallEscalationQueriesItemsTarget target) { + this.target = target; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return IntegrationOnCallEscalationQueriesItems + */ + @JsonAnySetter + public IntegrationOnCallEscalationQueriesItems putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this IntegrationOnCallEscalationQueriesItems object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IntegrationOnCallEscalationQueriesItems integrationOnCallEscalationQueriesItems = + (IntegrationOnCallEscalationQueriesItems) o; + return Objects.equals(this.enabled, integrationOnCallEscalationQueriesItems.enabled) + && Objects.equals(this.id, integrationOnCallEscalationQueriesItems.id) + && Objects.equals(this.query, integrationOnCallEscalationQueriesItems.query) + && Objects.equals(this.target, integrationOnCallEscalationQueriesItems.target) + && Objects.equals( + this.additionalProperties, + integrationOnCallEscalationQueriesItems.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(enabled, id, query, target, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IntegrationOnCallEscalationQueriesItems {\n"); + sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" query: ").append(toIndentedString(query)).append("\n"); + sb.append(" target: ").append(toIndentedString(target)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/IntegrationOnCallEscalationQueriesItemsTarget.java b/src/main/java/com/datadog/api/client/v2/model/IntegrationOnCallEscalationQueriesItemsTarget.java new file mode 100644 index 00000000000..57a72828dfc --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/IntegrationOnCallEscalationQueriesItemsTarget.java @@ -0,0 +1,197 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** */ +@JsonPropertyOrder({ + IntegrationOnCallEscalationQueriesItemsTarget.JSON_PROPERTY_DYNAMIC_TEAM_PAGING, + IntegrationOnCallEscalationQueriesItemsTarget.JSON_PROPERTY_TEAM_ID, + IntegrationOnCallEscalationQueriesItemsTarget.JSON_PROPERTY_USER_ID +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class IntegrationOnCallEscalationQueriesItemsTarget { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DYNAMIC_TEAM_PAGING = "dynamic_team_paging"; + private Boolean dynamicTeamPaging; + + public static final String JSON_PROPERTY_TEAM_ID = "team_id"; + private String teamId; + + public static final String JSON_PROPERTY_USER_ID = "user_id"; + private String userId; + + public IntegrationOnCallEscalationQueriesItemsTarget dynamicTeamPaging( + Boolean dynamicTeamPaging) { + this.dynamicTeamPaging = dynamicTeamPaging; + return this; + } + + /** + * GetdynamicTeamPaging + * + * @return dynamicTeamPaging + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DYNAMIC_TEAM_PAGING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getDynamicTeamPaging() { + return dynamicTeamPaging; + } + + public void setDynamicTeamPaging(Boolean dynamicTeamPaging) { + this.dynamicTeamPaging = dynamicTeamPaging; + } + + public IntegrationOnCallEscalationQueriesItemsTarget teamId(String teamId) { + this.teamId = teamId; + return this; + } + + /** + * GetteamId + * + * @return teamId + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TEAM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getTeamId() { + return teamId; + } + + public void setTeamId(String teamId) { + this.teamId = teamId; + } + + public IntegrationOnCallEscalationQueriesItemsTarget userId(String userId) { + this.userId = userId; + return this; + } + + /** + * GetuserId + * + * @return userId + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_USER_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getUserId() { + return userId; + } + + public void setUserId(String userId) { + this.userId = userId; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return IntegrationOnCallEscalationQueriesItemsTarget + */ + @JsonAnySetter + public IntegrationOnCallEscalationQueriesItemsTarget putAdditionalProperty( + String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this IntegrationOnCallEscalationQueriesItemsTarget object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IntegrationOnCallEscalationQueriesItemsTarget integrationOnCallEscalationQueriesItemsTarget = + (IntegrationOnCallEscalationQueriesItemsTarget) o; + return Objects.equals( + this.dynamicTeamPaging, integrationOnCallEscalationQueriesItemsTarget.dynamicTeamPaging) + && Objects.equals(this.teamId, integrationOnCallEscalationQueriesItemsTarget.teamId) + && Objects.equals(this.userId, integrationOnCallEscalationQueriesItemsTarget.userId) + && Objects.equals( + this.additionalProperties, + integrationOnCallEscalationQueriesItemsTarget.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(dynamicTeamPaging, teamId, userId, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IntegrationOnCallEscalationQueriesItemsTarget {\n"); + sb.append(" dynamicTeamPaging: ").append(toIndentedString(dynamicTeamPaging)).append("\n"); + sb.append(" teamId: ").append(toIndentedString(teamId)).append("\n"); + sb.append(" userId: ").append(toIndentedString(userId)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/IntegrationServiceNow.java b/src/main/java/com/datadog/api/client/v2/model/IntegrationServiceNow.java new file mode 100644 index 00000000000..5f58debf7cf --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/IntegrationServiceNow.java @@ -0,0 +1,248 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** ServiceNow integration settings */ +@JsonPropertyOrder({ + IntegrationServiceNow.JSON_PROPERTY_ASSIGNMENT_GROUP, + IntegrationServiceNow.JSON_PROPERTY_AUTO_CREATION, + IntegrationServiceNow.JSON_PROPERTY_ENABLED, + IntegrationServiceNow.JSON_PROPERTY_INSTANCE_NAME, + IntegrationServiceNow.JSON_PROPERTY_SYNC_CONFIG +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class IntegrationServiceNow { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ASSIGNMENT_GROUP = "assignment_group"; + private String assignmentGroup; + + public static final String JSON_PROPERTY_AUTO_CREATION = "auto_creation"; + private IntegrationServiceNowAutoCreation autoCreation; + + public static final String JSON_PROPERTY_ENABLED = "enabled"; + private Boolean enabled; + + public static final String JSON_PROPERTY_INSTANCE_NAME = "instance_name"; + private String instanceName; + + public static final String JSON_PROPERTY_SYNC_CONFIG = "sync_config"; + private IntegrationServiceNowSyncConfig syncConfig; + + public IntegrationServiceNow assignmentGroup(String assignmentGroup) { + this.assignmentGroup = assignmentGroup; + return this; + } + + /** + * Assignment group + * + * @return assignmentGroup + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ASSIGNMENT_GROUP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAssignmentGroup() { + return assignmentGroup; + } + + public void setAssignmentGroup(String assignmentGroup) { + this.assignmentGroup = assignmentGroup; + } + + public IntegrationServiceNow autoCreation(IntegrationServiceNowAutoCreation autoCreation) { + this.autoCreation = autoCreation; + this.unparsed |= autoCreation.unparsed; + return this; + } + + /** + * GetautoCreation + * + * @return autoCreation + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_AUTO_CREATION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public IntegrationServiceNowAutoCreation getAutoCreation() { + return autoCreation; + } + + public void setAutoCreation(IntegrationServiceNowAutoCreation autoCreation) { + this.autoCreation = autoCreation; + } + + public IntegrationServiceNow enabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Whether ServiceNow integration is enabled + * + * @return enabled + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ENABLED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnabled() { + return enabled; + } + + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + + public IntegrationServiceNow instanceName(String instanceName) { + this.instanceName = instanceName; + return this; + } + + /** + * ServiceNow instance name + * + * @return instanceName + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_INSTANCE_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getInstanceName() { + return instanceName; + } + + public void setInstanceName(String instanceName) { + this.instanceName = instanceName; + } + + public IntegrationServiceNow syncConfig(IntegrationServiceNowSyncConfig syncConfig) { + this.syncConfig = syncConfig; + this.unparsed |= syncConfig.unparsed; + return this; + } + + /** + * GetsyncConfig + * + * @return syncConfig + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SYNC_CONFIG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public IntegrationServiceNowSyncConfig getSyncConfig() { + return syncConfig; + } + + public void setSyncConfig(IntegrationServiceNowSyncConfig syncConfig) { + this.syncConfig = syncConfig; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return IntegrationServiceNow + */ + @JsonAnySetter + public IntegrationServiceNow putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this IntegrationServiceNow object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IntegrationServiceNow integrationServiceNow = (IntegrationServiceNow) o; + return Objects.equals(this.assignmentGroup, integrationServiceNow.assignmentGroup) + && Objects.equals(this.autoCreation, integrationServiceNow.autoCreation) + && Objects.equals(this.enabled, integrationServiceNow.enabled) + && Objects.equals(this.instanceName, integrationServiceNow.instanceName) + && Objects.equals(this.syncConfig, integrationServiceNow.syncConfig) + && Objects.equals(this.additionalProperties, integrationServiceNow.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + assignmentGroup, autoCreation, enabled, instanceName, syncConfig, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IntegrationServiceNow {\n"); + sb.append(" assignmentGroup: ").append(toIndentedString(assignmentGroup)).append("\n"); + sb.append(" autoCreation: ").append(toIndentedString(autoCreation)).append("\n"); + sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); + sb.append(" instanceName: ").append(toIndentedString(instanceName)).append("\n"); + sb.append(" syncConfig: ").append(toIndentedString(syncConfig)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/IntegrationServiceNowAutoCreation.java b/src/main/java/com/datadog/api/client/v2/model/IntegrationServiceNowAutoCreation.java new file mode 100644 index 00000000000..d45e95d2992 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/IntegrationServiceNowAutoCreation.java @@ -0,0 +1,137 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** */ +@JsonPropertyOrder({IntegrationServiceNowAutoCreation.JSON_PROPERTY_ENABLED}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class IntegrationServiceNowAutoCreation { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ENABLED = "enabled"; + private Boolean enabled; + + public IntegrationServiceNowAutoCreation enabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Getenabled + * + * @return enabled + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ENABLED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnabled() { + return enabled; + } + + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return IntegrationServiceNowAutoCreation + */ + @JsonAnySetter + public IntegrationServiceNowAutoCreation putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this IntegrationServiceNowAutoCreation object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IntegrationServiceNowAutoCreation integrationServiceNowAutoCreation = + (IntegrationServiceNowAutoCreation) o; + return Objects.equals(this.enabled, integrationServiceNowAutoCreation.enabled) + && Objects.equals( + this.additionalProperties, integrationServiceNowAutoCreation.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(enabled, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IntegrationServiceNowAutoCreation {\n"); + sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/IntegrationServiceNowSyncConfig.java b/src/main/java/com/datadog/api/client/v2/model/IntegrationServiceNowSyncConfig.java new file mode 100644 index 00000000000..c53e49dfe12 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/IntegrationServiceNowSyncConfig.java @@ -0,0 +1,168 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** */ +@JsonPropertyOrder({ + IntegrationServiceNowSyncConfig.JSON_PROPERTY_ENABLED, + IntegrationServiceNowSyncConfig.JSON_PROPERTY_PROPERTIES +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class IntegrationServiceNowSyncConfig { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ENABLED = "enabled"; + private Boolean enabled; + + public static final String JSON_PROPERTY_PROPERTIES = "properties"; + private IntegrationServiceNowSyncConfig139772721534496 properties; + + public IntegrationServiceNowSyncConfig enabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Getenabled + * + * @return enabled + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ENABLED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnabled() { + return enabled; + } + + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + + public IntegrationServiceNowSyncConfig properties( + IntegrationServiceNowSyncConfig139772721534496 properties) { + this.properties = properties; + this.unparsed |= properties.unparsed; + return this; + } + + /** + * Getproperties + * + * @return properties + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PROPERTIES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public IntegrationServiceNowSyncConfig139772721534496 getProperties() { + return properties; + } + + public void setProperties(IntegrationServiceNowSyncConfig139772721534496 properties) { + this.properties = properties; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return IntegrationServiceNowSyncConfig + */ + @JsonAnySetter + public IntegrationServiceNowSyncConfig putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this IntegrationServiceNowSyncConfig object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IntegrationServiceNowSyncConfig integrationServiceNowSyncConfig = + (IntegrationServiceNowSyncConfig) o; + return Objects.equals(this.enabled, integrationServiceNowSyncConfig.enabled) + && Objects.equals(this.properties, integrationServiceNowSyncConfig.properties) + && Objects.equals( + this.additionalProperties, integrationServiceNowSyncConfig.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(enabled, properties, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IntegrationServiceNowSyncConfig {\n"); + sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); + sb.append(" properties: ").append(toIndentedString(properties)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/IntegrationServiceNowSyncConfig139772721534496.java b/src/main/java/com/datadog/api/client/v2/model/IntegrationServiceNowSyncConfig139772721534496.java new file mode 100644 index 00000000000..9df49db70c8 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/IntegrationServiceNowSyncConfig139772721534496.java @@ -0,0 +1,199 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** */ +@JsonPropertyOrder({ + IntegrationServiceNowSyncConfig139772721534496.JSON_PROPERTY_COMMENTS, + IntegrationServiceNowSyncConfig139772721534496.JSON_PROPERTY_PRIORITY, + IntegrationServiceNowSyncConfig139772721534496.JSON_PROPERTY_STATUS +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class IntegrationServiceNowSyncConfig139772721534496 { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_COMMENTS = "comments"; + private SyncProperty comments; + + public static final String JSON_PROPERTY_PRIORITY = "priority"; + private IntegrationServiceNowSyncConfigPriority priority; + + public static final String JSON_PROPERTY_STATUS = "status"; + private SyncPropertyWithMapping status; + + public IntegrationServiceNowSyncConfig139772721534496 comments(SyncProperty comments) { + this.comments = comments; + this.unparsed |= comments.unparsed; + return this; + } + + /** + * Sync property configuration + * + * @return comments + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_COMMENTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public SyncProperty getComments() { + return comments; + } + + public void setComments(SyncProperty comments) { + this.comments = comments; + } + + public IntegrationServiceNowSyncConfig139772721534496 priority( + IntegrationServiceNowSyncConfigPriority priority) { + this.priority = priority; + this.unparsed |= priority.unparsed; + return this; + } + + /** + * Getpriority + * + * @return priority + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PRIORITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public IntegrationServiceNowSyncConfigPriority getPriority() { + return priority; + } + + public void setPriority(IntegrationServiceNowSyncConfigPriority priority) { + this.priority = priority; + } + + public IntegrationServiceNowSyncConfig139772721534496 status(SyncPropertyWithMapping status) { + this.status = status; + this.unparsed |= status.unparsed; + return this; + } + + /** + * Sync property with mapping configuration + * + * @return status + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public SyncPropertyWithMapping getStatus() { + return status; + } + + public void setStatus(SyncPropertyWithMapping status) { + this.status = status; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return IntegrationServiceNowSyncConfig139772721534496 + */ + @JsonAnySetter + public IntegrationServiceNowSyncConfig139772721534496 putAdditionalProperty( + String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this IntegrationServiceNowSyncConfig139772721534496 object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IntegrationServiceNowSyncConfig139772721534496 integrationServiceNowSyncConfig139772721534496 = + (IntegrationServiceNowSyncConfig139772721534496) o; + return Objects.equals(this.comments, integrationServiceNowSyncConfig139772721534496.comments) + && Objects.equals(this.priority, integrationServiceNowSyncConfig139772721534496.priority) + && Objects.equals(this.status, integrationServiceNowSyncConfig139772721534496.status) + && Objects.equals( + this.additionalProperties, + integrationServiceNowSyncConfig139772721534496.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(comments, priority, status, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IntegrationServiceNowSyncConfig139772721534496 {\n"); + sb.append(" comments: ").append(toIndentedString(comments)).append("\n"); + sb.append(" priority: ").append(toIndentedString(priority)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/IntegrationServiceNowSyncConfigPriority.java b/src/main/java/com/datadog/api/client/v2/model/IntegrationServiceNowSyncConfigPriority.java new file mode 100644 index 00000000000..66a06fb3e6f --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/IntegrationServiceNowSyncConfigPriority.java @@ -0,0 +1,214 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** */ +@JsonPropertyOrder({ + IntegrationServiceNowSyncConfigPriority.JSON_PROPERTY_IMPACT_MAPPING, + IntegrationServiceNowSyncConfigPriority.JSON_PROPERTY_SYNC_TYPE, + IntegrationServiceNowSyncConfigPriority.JSON_PROPERTY_URGENCY_MAPPING +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class IntegrationServiceNowSyncConfigPriority { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_IMPACT_MAPPING = "impact_mapping"; + private Map impactMapping = null; + + public static final String JSON_PROPERTY_SYNC_TYPE = "sync_type"; + private String syncType; + + public static final String JSON_PROPERTY_URGENCY_MAPPING = "urgency_mapping"; + private Map urgencyMapping = null; + + public IntegrationServiceNowSyncConfigPriority impactMapping(Map impactMapping) { + this.impactMapping = impactMapping; + return this; + } + + public IntegrationServiceNowSyncConfigPriority putImpactMappingItem( + String key, String impactMappingItem) { + if (this.impactMapping == null) { + this.impactMapping = new HashMap<>(); + } + this.impactMapping.put(key, impactMappingItem); + return this; + } + + /** + * GetimpactMapping + * + * @return impactMapping + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_IMPACT_MAPPING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getImpactMapping() { + return impactMapping; + } + + public void setImpactMapping(Map impactMapping) { + this.impactMapping = impactMapping; + } + + public IntegrationServiceNowSyncConfigPriority syncType(String syncType) { + this.syncType = syncType; + return this; + } + + /** + * GetsyncType + * + * @return syncType + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SYNC_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSyncType() { + return syncType; + } + + public void setSyncType(String syncType) { + this.syncType = syncType; + } + + public IntegrationServiceNowSyncConfigPriority urgencyMapping( + Map urgencyMapping) { + this.urgencyMapping = urgencyMapping; + return this; + } + + public IntegrationServiceNowSyncConfigPriority putUrgencyMappingItem( + String key, String urgencyMappingItem) { + if (this.urgencyMapping == null) { + this.urgencyMapping = new HashMap<>(); + } + this.urgencyMapping.put(key, urgencyMappingItem); + return this; + } + + /** + * GeturgencyMapping + * + * @return urgencyMapping + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_URGENCY_MAPPING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getUrgencyMapping() { + return urgencyMapping; + } + + public void setUrgencyMapping(Map urgencyMapping) { + this.urgencyMapping = urgencyMapping; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return IntegrationServiceNowSyncConfigPriority + */ + @JsonAnySetter + public IntegrationServiceNowSyncConfigPriority putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this IntegrationServiceNowSyncConfigPriority object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IntegrationServiceNowSyncConfigPriority integrationServiceNowSyncConfigPriority = + (IntegrationServiceNowSyncConfigPriority) o; + return Objects.equals(this.impactMapping, integrationServiceNowSyncConfigPriority.impactMapping) + && Objects.equals(this.syncType, integrationServiceNowSyncConfigPriority.syncType) + && Objects.equals( + this.urgencyMapping, integrationServiceNowSyncConfigPriority.urgencyMapping) + && Objects.equals( + this.additionalProperties, + integrationServiceNowSyncConfigPriority.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(impactMapping, syncType, urgencyMapping, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IntegrationServiceNowSyncConfigPriority {\n"); + sb.append(" impactMapping: ").append(toIndentedString(impactMapping)).append("\n"); + sb.append(" syncType: ").append(toIndentedString(syncType)).append("\n"); + sb.append(" urgencyMapping: ").append(toIndentedString(urgencyMapping)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ProjectAttributes.java b/src/main/java/com/datadog/api/client/v2/model/ProjectAttributes.java index af5132d96e0..df4dba7e01f 100644 --- a/src/main/java/com/datadog/api/client/v2/model/ProjectAttributes.java +++ b/src/main/java/com/datadog/api/client/v2/model/ProjectAttributes.java @@ -12,22 +12,94 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; import java.util.HashMap; +import java.util.List; import java.util.Map; import java.util.Objects; /** Project attributes */ -@JsonPropertyOrder({ProjectAttributes.JSON_PROPERTY_KEY, ProjectAttributes.JSON_PROPERTY_NAME}) +@JsonPropertyOrder({ + ProjectAttributes.JSON_PROPERTY_COLUMNS_CONFIG, + ProjectAttributes.JSON_PROPERTY_ENABLED_CUSTOM_CASE_TYPES, + ProjectAttributes.JSON_PROPERTY_KEY, + ProjectAttributes.JSON_PROPERTY_NAME, + ProjectAttributes.JSON_PROPERTY_RESTRICTED, + ProjectAttributes.JSON_PROPERTY_SETTINGS +}) @jakarta.annotation.Generated( value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") public class ProjectAttributes { @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_COLUMNS_CONFIG = "columns_config"; + private ProjectColumnsConfig columnsConfig; + + public static final String JSON_PROPERTY_ENABLED_CUSTOM_CASE_TYPES = "enabled_custom_case_types"; + private List enabledCustomCaseTypes = null; + public static final String JSON_PROPERTY_KEY = "key"; private String key; public static final String JSON_PROPERTY_NAME = "name"; private String name; + public static final String JSON_PROPERTY_RESTRICTED = "restricted"; + private Boolean restricted; + + public static final String JSON_PROPERTY_SETTINGS = "settings"; + private ProjectSettings settings; + + public ProjectAttributes columnsConfig(ProjectColumnsConfig columnsConfig) { + this.columnsConfig = columnsConfig; + this.unparsed |= columnsConfig.unparsed; + return this; + } + + /** + * Project columns configuration + * + * @return columnsConfig + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_COLUMNS_CONFIG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ProjectColumnsConfig getColumnsConfig() { + return columnsConfig; + } + + public void setColumnsConfig(ProjectColumnsConfig columnsConfig) { + this.columnsConfig = columnsConfig; + } + + public ProjectAttributes enabledCustomCaseTypes(List enabledCustomCaseTypes) { + this.enabledCustomCaseTypes = enabledCustomCaseTypes; + return this; + } + + public ProjectAttributes addEnabledCustomCaseTypesItem(String enabledCustomCaseTypesItem) { + if (this.enabledCustomCaseTypes == null) { + this.enabledCustomCaseTypes = new ArrayList<>(); + } + this.enabledCustomCaseTypes.add(enabledCustomCaseTypesItem); + return this; + } + + /** + * List of enabled custom case type IDs + * + * @return enabledCustomCaseTypes + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ENABLED_CUSTOM_CASE_TYPES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getEnabledCustomCaseTypes() { + return enabledCustomCaseTypes; + } + + public void setEnabledCustomCaseTypes(List enabledCustomCaseTypes) { + this.enabledCustomCaseTypes = enabledCustomCaseTypes; + } + public ProjectAttributes key(String key) { this.key = key; return this; @@ -70,6 +142,49 @@ public void setName(String name) { this.name = name; } + public ProjectAttributes restricted(Boolean restricted) { + this.restricted = restricted; + return this; + } + + /** + * Whether the project is restricted + * + * @return restricted + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_RESTRICTED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getRestricted() { + return restricted; + } + + public void setRestricted(Boolean restricted) { + this.restricted = restricted; + } + + public ProjectAttributes settings(ProjectSettings settings) { + this.settings = settings; + this.unparsed |= settings.unparsed; + return this; + } + + /** + * Project settings + * + * @return settings + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SETTINGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ProjectSettings getSettings() { + return settings; + } + + public void setSettings(ProjectSettings settings) { + this.settings = settings; + } + /** * A container for additional, undeclared properties. This is a holder for any undeclared * properties as specified with the 'additionalProperties' keyword in the OAS document. @@ -126,22 +241,39 @@ public boolean equals(Object o) { return false; } ProjectAttributes projectAttributes = (ProjectAttributes) o; - return Objects.equals(this.key, projectAttributes.key) + return Objects.equals(this.columnsConfig, projectAttributes.columnsConfig) + && Objects.equals(this.enabledCustomCaseTypes, projectAttributes.enabledCustomCaseTypes) + && Objects.equals(this.key, projectAttributes.key) && Objects.equals(this.name, projectAttributes.name) + && Objects.equals(this.restricted, projectAttributes.restricted) + && Objects.equals(this.settings, projectAttributes.settings) && Objects.equals(this.additionalProperties, projectAttributes.additionalProperties); } @Override public int hashCode() { - return Objects.hash(key, name, additionalProperties); + return Objects.hash( + columnsConfig, + enabledCustomCaseTypes, + key, + name, + restricted, + settings, + additionalProperties); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class ProjectAttributes {\n"); + sb.append(" columnsConfig: ").append(toIndentedString(columnsConfig)).append("\n"); + sb.append(" enabledCustomCaseTypes: ") + .append(toIndentedString(enabledCustomCaseTypes)) + .append("\n"); sb.append(" key: ").append(toIndentedString(key)).append("\n"); sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" restricted: ").append(toIndentedString(restricted)).append("\n"); + sb.append(" settings: ").append(toIndentedString(settings)).append("\n"); sb.append(" additionalProperties: ") .append(toIndentedString(additionalProperties)) .append("\n"); diff --git a/src/main/java/com/datadog/api/client/v2/model/ProjectColumnsConfig.java b/src/main/java/com/datadog/api/client/v2/model/ProjectColumnsConfig.java new file mode 100644 index 00000000000..839de448d91 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProjectColumnsConfig.java @@ -0,0 +1,149 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** Project columns configuration */ +@JsonPropertyOrder({ProjectColumnsConfig.JSON_PROPERTY_COLUMNS}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ProjectColumnsConfig { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_COLUMNS = "columns"; + private List columns = null; + + public ProjectColumnsConfig columns(List columns) { + this.columns = columns; + for (ProjectColumnsConfigColumnsItems item : columns) { + this.unparsed |= item.unparsed; + } + return this; + } + + public ProjectColumnsConfig addColumnsItem(ProjectColumnsConfigColumnsItems columnsItem) { + if (this.columns == null) { + this.columns = new ArrayList<>(); + } + this.columns.add(columnsItem); + this.unparsed |= columnsItem.unparsed; + return this; + } + + /** + * Getcolumns + * + * @return columns + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_COLUMNS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getColumns() { + return columns; + } + + public void setColumns(List columns) { + this.columns = columns; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return ProjectColumnsConfig + */ + @JsonAnySetter + public ProjectColumnsConfig putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this ProjectColumnsConfig object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProjectColumnsConfig projectColumnsConfig = (ProjectColumnsConfig) o; + return Objects.equals(this.columns, projectColumnsConfig.columns) + && Objects.equals(this.additionalProperties, projectColumnsConfig.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(columns, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProjectColumnsConfig {\n"); + sb.append(" columns: ").append(toIndentedString(columns)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ProjectColumnsConfigColumnsItems.java b/src/main/java/com/datadog/api/client/v2/model/ProjectColumnsConfigColumnsItems.java new file mode 100644 index 00000000000..bcc93199cca --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProjectColumnsConfigColumnsItems.java @@ -0,0 +1,194 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** */ +@JsonPropertyOrder({ + ProjectColumnsConfigColumnsItems.JSON_PROPERTY_SORT, + ProjectColumnsConfigColumnsItems.JSON_PROPERTY_SORT_FIELD, + ProjectColumnsConfigColumnsItems.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ProjectColumnsConfigColumnsItems { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_SORT = "sort"; + private ProjectColumnsConfigColumnsItemsSort sort; + + public static final String JSON_PROPERTY_SORT_FIELD = "sort_field"; + private String sortField; + + public static final String JSON_PROPERTY_TYPE = "type"; + private String type; + + public ProjectColumnsConfigColumnsItems sort(ProjectColumnsConfigColumnsItemsSort sort) { + this.sort = sort; + this.unparsed |= sort.unparsed; + return this; + } + + /** + * Getsort + * + * @return sort + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SORT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ProjectColumnsConfigColumnsItemsSort getSort() { + return sort; + } + + public void setSort(ProjectColumnsConfigColumnsItemsSort sort) { + this.sort = sort; + } + + public ProjectColumnsConfigColumnsItems sortField(String sortField) { + this.sortField = sortField; + return this; + } + + /** + * GetsortField + * + * @return sortField + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SORT_FIELD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSortField() { + return sortField; + } + + public void setSortField(String sortField) { + this.sortField = sortField; + } + + public ProjectColumnsConfigColumnsItems type(String type) { + this.type = type; + return this; + } + + /** + * Gettype + * + * @return type + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return ProjectColumnsConfigColumnsItems + */ + @JsonAnySetter + public ProjectColumnsConfigColumnsItems putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this ProjectColumnsConfigColumnsItems object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProjectColumnsConfigColumnsItems projectColumnsConfigColumnsItems = + (ProjectColumnsConfigColumnsItems) o; + return Objects.equals(this.sort, projectColumnsConfigColumnsItems.sort) + && Objects.equals(this.sortField, projectColumnsConfigColumnsItems.sortField) + && Objects.equals(this.type, projectColumnsConfigColumnsItems.type) + && Objects.equals( + this.additionalProperties, projectColumnsConfigColumnsItems.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(sort, sortField, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProjectColumnsConfigColumnsItems {\n"); + sb.append(" sort: ").append(toIndentedString(sort)).append("\n"); + sb.append(" sortField: ").append(toIndentedString(sortField)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ProjectColumnsConfigColumnsItemsSort.java b/src/main/java/com/datadog/api/client/v2/model/ProjectColumnsConfigColumnsItemsSort.java new file mode 100644 index 00000000000..ea72c232d85 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProjectColumnsConfigColumnsItemsSort.java @@ -0,0 +1,166 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** */ +@JsonPropertyOrder({ + ProjectColumnsConfigColumnsItemsSort.JSON_PROPERTY_ASCENDING, + ProjectColumnsConfigColumnsItemsSort.JSON_PROPERTY_PRIORITY +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ProjectColumnsConfigColumnsItemsSort { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ASCENDING = "ascending"; + private Boolean ascending; + + public static final String JSON_PROPERTY_PRIORITY = "priority"; + private Long priority; + + public ProjectColumnsConfigColumnsItemsSort ascending(Boolean ascending) { + this.ascending = ascending; + return this; + } + + /** + * Getascending + * + * @return ascending + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ASCENDING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getAscending() { + return ascending; + } + + public void setAscending(Boolean ascending) { + this.ascending = ascending; + } + + public ProjectColumnsConfigColumnsItemsSort priority(Long priority) { + this.priority = priority; + return this; + } + + /** + * Getpriority + * + * @return priority + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PRIORITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getPriority() { + return priority; + } + + public void setPriority(Long priority) { + this.priority = priority; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return ProjectColumnsConfigColumnsItemsSort + */ + @JsonAnySetter + public ProjectColumnsConfigColumnsItemsSort putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this ProjectColumnsConfigColumnsItemsSort object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProjectColumnsConfigColumnsItemsSort projectColumnsConfigColumnsItemsSort = + (ProjectColumnsConfigColumnsItemsSort) o; + return Objects.equals(this.ascending, projectColumnsConfigColumnsItemsSort.ascending) + && Objects.equals(this.priority, projectColumnsConfigColumnsItemsSort.priority) + && Objects.equals( + this.additionalProperties, projectColumnsConfigColumnsItemsSort.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(ascending, priority, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProjectColumnsConfigColumnsItemsSort {\n"); + sb.append(" ascending: ").append(toIndentedString(ascending)).append("\n"); + sb.append(" priority: ").append(toIndentedString(priority)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ProjectCreateAttributes.java b/src/main/java/com/datadog/api/client/v2/model/ProjectCreateAttributes.java index abc3b5fb2d3..3914daff759 100644 --- a/src/main/java/com/datadog/api/client/v2/model/ProjectCreateAttributes.java +++ b/src/main/java/com/datadog/api/client/v2/model/ProjectCreateAttributes.java @@ -13,25 +13,35 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; import java.util.HashMap; +import java.util.List; import java.util.Map; import java.util.Objects; /** Project creation attributes */ @JsonPropertyOrder({ + ProjectCreateAttributes.JSON_PROPERTY_ENABLED_CUSTOM_CASE_TYPES, ProjectCreateAttributes.JSON_PROPERTY_KEY, - ProjectCreateAttributes.JSON_PROPERTY_NAME + ProjectCreateAttributes.JSON_PROPERTY_NAME, + ProjectCreateAttributes.JSON_PROPERTY_TEAM_UUID }) @jakarta.annotation.Generated( value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") public class ProjectCreateAttributes { @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ENABLED_CUSTOM_CASE_TYPES = "enabled_custom_case_types"; + private List enabledCustomCaseTypes = null; + public static final String JSON_PROPERTY_KEY = "key"; private String key; public static final String JSON_PROPERTY_NAME = "name"; private String name; + public static final String JSON_PROPERTY_TEAM_UUID = "team_uuid"; + private String teamUuid; + public ProjectCreateAttributes() {} @JsonCreator @@ -42,6 +52,35 @@ public ProjectCreateAttributes( this.name = name; } + public ProjectCreateAttributes enabledCustomCaseTypes(List enabledCustomCaseTypes) { + this.enabledCustomCaseTypes = enabledCustomCaseTypes; + return this; + } + + public ProjectCreateAttributes addEnabledCustomCaseTypesItem(String enabledCustomCaseTypesItem) { + if (this.enabledCustomCaseTypes == null) { + this.enabledCustomCaseTypes = new ArrayList<>(); + } + this.enabledCustomCaseTypes.add(enabledCustomCaseTypesItem); + return this; + } + + /** + * List of enabled custom case type IDs + * + * @return enabledCustomCaseTypes + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ENABLED_CUSTOM_CASE_TYPES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getEnabledCustomCaseTypes() { + return enabledCustomCaseTypes; + } + + public void setEnabledCustomCaseTypes(List enabledCustomCaseTypes) { + this.enabledCustomCaseTypes = enabledCustomCaseTypes; + } + public ProjectCreateAttributes key(String key) { this.key = key; return this; @@ -68,7 +107,7 @@ public ProjectCreateAttributes name(String name) { } /** - * name + * Project name * * @return name */ @@ -82,6 +121,27 @@ public void setName(String name) { this.name = name; } + public ProjectCreateAttributes teamUuid(String teamUuid) { + this.teamUuid = teamUuid; + return this; + } + + /** + * Team UUID to associate with the project + * + * @return teamUuid + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TEAM_UUID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getTeamUuid() { + return teamUuid; + } + + public void setTeamUuid(String teamUuid) { + this.teamUuid = teamUuid; + } + /** * A container for additional, undeclared properties. This is a holder for any undeclared * properties as specified with the 'additionalProperties' keyword in the OAS document. @@ -138,22 +198,29 @@ public boolean equals(Object o) { return false; } ProjectCreateAttributes projectCreateAttributes = (ProjectCreateAttributes) o; - return Objects.equals(this.key, projectCreateAttributes.key) + return Objects.equals( + this.enabledCustomCaseTypes, projectCreateAttributes.enabledCustomCaseTypes) + && Objects.equals(this.key, projectCreateAttributes.key) && Objects.equals(this.name, projectCreateAttributes.name) + && Objects.equals(this.teamUuid, projectCreateAttributes.teamUuid) && Objects.equals(this.additionalProperties, projectCreateAttributes.additionalProperties); } @Override public int hashCode() { - return Objects.hash(key, name, additionalProperties); + return Objects.hash(enabledCustomCaseTypes, key, name, teamUuid, additionalProperties); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class ProjectCreateAttributes {\n"); + sb.append(" enabledCustomCaseTypes: ") + .append(toIndentedString(enabledCustomCaseTypes)) + .append("\n"); sb.append(" key: ").append(toIndentedString(key)).append("\n"); sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" teamUuid: ").append(toIndentedString(teamUuid)).append("\n"); sb.append(" additionalProperties: ") .append(toIndentedString(additionalProperties)) .append("\n"); diff --git a/src/main/java/com/datadog/api/client/v2/model/ProjectNotificationSettings.java b/src/main/java/com/datadog/api/client/v2/model/ProjectNotificationSettings.java new file mode 100644 index 00000000000..57683ca17cd --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProjectNotificationSettings.java @@ -0,0 +1,397 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** Project notification settings */ +@JsonPropertyOrder({ + ProjectNotificationSettings.JSON_PROPERTY_DESTINATIONS, + ProjectNotificationSettings.JSON_PROPERTY_ENABLED, + ProjectNotificationSettings.JSON_PROPERTY_NOTIFY_ON_CASE_ASSIGNMENT, + ProjectNotificationSettings.JSON_PROPERTY_NOTIFY_ON_CASE_CLOSED, + ProjectNotificationSettings.JSON_PROPERTY_NOTIFY_ON_CASE_COMMENT, + ProjectNotificationSettings.JSON_PROPERTY_NOTIFY_ON_CASE_COMMENT_MENTION, + ProjectNotificationSettings.JSON_PROPERTY_NOTIFY_ON_CASE_PRIORITY_CHANGE, + ProjectNotificationSettings.JSON_PROPERTY_NOTIFY_ON_CASE_STATUS_CHANGE, + ProjectNotificationSettings.JSON_PROPERTY_NOTIFY_ON_CASE_UNASSIGNMENT +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ProjectNotificationSettings { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DESTINATIONS = "destinations"; + private List destinations = null; + + public static final String JSON_PROPERTY_ENABLED = "enabled"; + private Boolean enabled; + + public static final String JSON_PROPERTY_NOTIFY_ON_CASE_ASSIGNMENT = "notify_on_case_assignment"; + private Boolean notifyOnCaseAssignment; + + public static final String JSON_PROPERTY_NOTIFY_ON_CASE_CLOSED = "notify_on_case_closed"; + private Boolean notifyOnCaseClosed; + + public static final String JSON_PROPERTY_NOTIFY_ON_CASE_COMMENT = "notify_on_case_comment"; + private Boolean notifyOnCaseComment; + + public static final String JSON_PROPERTY_NOTIFY_ON_CASE_COMMENT_MENTION = + "notify_on_case_comment_mention"; + private Boolean notifyOnCaseCommentMention; + + public static final String JSON_PROPERTY_NOTIFY_ON_CASE_PRIORITY_CHANGE = + "notify_on_case_priority_change"; + private Boolean notifyOnCasePriorityChange; + + public static final String JSON_PROPERTY_NOTIFY_ON_CASE_STATUS_CHANGE = + "notify_on_case_status_change"; + private Boolean notifyOnCaseStatusChange; + + public static final String JSON_PROPERTY_NOTIFY_ON_CASE_UNASSIGNMENT = + "notify_on_case_unassignment"; + private Boolean notifyOnCaseUnassignment; + + public ProjectNotificationSettings destinations(List destinations) { + this.destinations = destinations; + return this; + } + + public ProjectNotificationSettings addDestinationsItem(Integer destinationsItem) { + if (this.destinations == null) { + this.destinations = new ArrayList<>(); + } + this.destinations.add(destinationsItem); + return this; + } + + /** + * Notification destinations (1=email, 2=slack, 3=in-app) + * + * @return destinations + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DESTINATIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getDestinations() { + return destinations; + } + + public void setDestinations(List destinations) { + this.destinations = destinations; + } + + public ProjectNotificationSettings enabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Whether notifications are enabled + * + * @return enabled + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ENABLED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnabled() { + return enabled; + } + + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + + public ProjectNotificationSettings notifyOnCaseAssignment(Boolean notifyOnCaseAssignment) { + this.notifyOnCaseAssignment = notifyOnCaseAssignment; + return this; + } + + /** + * GetnotifyOnCaseAssignment + * + * @return notifyOnCaseAssignment + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NOTIFY_ON_CASE_ASSIGNMENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getNotifyOnCaseAssignment() { + return notifyOnCaseAssignment; + } + + public void setNotifyOnCaseAssignment(Boolean notifyOnCaseAssignment) { + this.notifyOnCaseAssignment = notifyOnCaseAssignment; + } + + public ProjectNotificationSettings notifyOnCaseClosed(Boolean notifyOnCaseClosed) { + this.notifyOnCaseClosed = notifyOnCaseClosed; + return this; + } + + /** + * GetnotifyOnCaseClosed + * + * @return notifyOnCaseClosed + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NOTIFY_ON_CASE_CLOSED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getNotifyOnCaseClosed() { + return notifyOnCaseClosed; + } + + public void setNotifyOnCaseClosed(Boolean notifyOnCaseClosed) { + this.notifyOnCaseClosed = notifyOnCaseClosed; + } + + public ProjectNotificationSettings notifyOnCaseComment(Boolean notifyOnCaseComment) { + this.notifyOnCaseComment = notifyOnCaseComment; + return this; + } + + /** + * GetnotifyOnCaseComment + * + * @return notifyOnCaseComment + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NOTIFY_ON_CASE_COMMENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getNotifyOnCaseComment() { + return notifyOnCaseComment; + } + + public void setNotifyOnCaseComment(Boolean notifyOnCaseComment) { + this.notifyOnCaseComment = notifyOnCaseComment; + } + + public ProjectNotificationSettings notifyOnCaseCommentMention( + Boolean notifyOnCaseCommentMention) { + this.notifyOnCaseCommentMention = notifyOnCaseCommentMention; + return this; + } + + /** + * GetnotifyOnCaseCommentMention + * + * @return notifyOnCaseCommentMention + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NOTIFY_ON_CASE_COMMENT_MENTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getNotifyOnCaseCommentMention() { + return notifyOnCaseCommentMention; + } + + public void setNotifyOnCaseCommentMention(Boolean notifyOnCaseCommentMention) { + this.notifyOnCaseCommentMention = notifyOnCaseCommentMention; + } + + public ProjectNotificationSettings notifyOnCasePriorityChange( + Boolean notifyOnCasePriorityChange) { + this.notifyOnCasePriorityChange = notifyOnCasePriorityChange; + return this; + } + + /** + * GetnotifyOnCasePriorityChange + * + * @return notifyOnCasePriorityChange + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NOTIFY_ON_CASE_PRIORITY_CHANGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getNotifyOnCasePriorityChange() { + return notifyOnCasePriorityChange; + } + + public void setNotifyOnCasePriorityChange(Boolean notifyOnCasePriorityChange) { + this.notifyOnCasePriorityChange = notifyOnCasePriorityChange; + } + + public ProjectNotificationSettings notifyOnCaseStatusChange(Boolean notifyOnCaseStatusChange) { + this.notifyOnCaseStatusChange = notifyOnCaseStatusChange; + return this; + } + + /** + * GetnotifyOnCaseStatusChange + * + * @return notifyOnCaseStatusChange + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NOTIFY_ON_CASE_STATUS_CHANGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getNotifyOnCaseStatusChange() { + return notifyOnCaseStatusChange; + } + + public void setNotifyOnCaseStatusChange(Boolean notifyOnCaseStatusChange) { + this.notifyOnCaseStatusChange = notifyOnCaseStatusChange; + } + + public ProjectNotificationSettings notifyOnCaseUnassignment(Boolean notifyOnCaseUnassignment) { + this.notifyOnCaseUnassignment = notifyOnCaseUnassignment; + return this; + } + + /** + * GetnotifyOnCaseUnassignment + * + * @return notifyOnCaseUnassignment + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NOTIFY_ON_CASE_UNASSIGNMENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getNotifyOnCaseUnassignment() { + return notifyOnCaseUnassignment; + } + + public void setNotifyOnCaseUnassignment(Boolean notifyOnCaseUnassignment) { + this.notifyOnCaseUnassignment = notifyOnCaseUnassignment; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return ProjectNotificationSettings + */ + @JsonAnySetter + public ProjectNotificationSettings putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this ProjectNotificationSettings object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProjectNotificationSettings projectNotificationSettings = (ProjectNotificationSettings) o; + return Objects.equals(this.destinations, projectNotificationSettings.destinations) + && Objects.equals(this.enabled, projectNotificationSettings.enabled) + && Objects.equals( + this.notifyOnCaseAssignment, projectNotificationSettings.notifyOnCaseAssignment) + && Objects.equals(this.notifyOnCaseClosed, projectNotificationSettings.notifyOnCaseClosed) + && Objects.equals(this.notifyOnCaseComment, projectNotificationSettings.notifyOnCaseComment) + && Objects.equals( + this.notifyOnCaseCommentMention, projectNotificationSettings.notifyOnCaseCommentMention) + && Objects.equals( + this.notifyOnCasePriorityChange, projectNotificationSettings.notifyOnCasePriorityChange) + && Objects.equals( + this.notifyOnCaseStatusChange, projectNotificationSettings.notifyOnCaseStatusChange) + && Objects.equals( + this.notifyOnCaseUnassignment, projectNotificationSettings.notifyOnCaseUnassignment) + && Objects.equals( + this.additionalProperties, projectNotificationSettings.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + destinations, + enabled, + notifyOnCaseAssignment, + notifyOnCaseClosed, + notifyOnCaseComment, + notifyOnCaseCommentMention, + notifyOnCasePriorityChange, + notifyOnCaseStatusChange, + notifyOnCaseUnassignment, + additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProjectNotificationSettings {\n"); + sb.append(" destinations: ").append(toIndentedString(destinations)).append("\n"); + sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); + sb.append(" notifyOnCaseAssignment: ") + .append(toIndentedString(notifyOnCaseAssignment)) + .append("\n"); + sb.append(" notifyOnCaseClosed: ").append(toIndentedString(notifyOnCaseClosed)).append("\n"); + sb.append(" notifyOnCaseComment: ") + .append(toIndentedString(notifyOnCaseComment)) + .append("\n"); + sb.append(" notifyOnCaseCommentMention: ") + .append(toIndentedString(notifyOnCaseCommentMention)) + .append("\n"); + sb.append(" notifyOnCasePriorityChange: ") + .append(toIndentedString(notifyOnCasePriorityChange)) + .append("\n"); + sb.append(" notifyOnCaseStatusChange: ") + .append(toIndentedString(notifyOnCaseStatusChange)) + .append("\n"); + sb.append(" notifyOnCaseUnassignment: ") + .append(toIndentedString(notifyOnCaseUnassignment)) + .append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ProjectSettings.java b/src/main/java/com/datadog/api/client/v2/model/ProjectSettings.java new file mode 100644 index 00000000000..5c8d67b8b3d --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProjectSettings.java @@ -0,0 +1,355 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Project settings */ +@JsonPropertyOrder({ + ProjectSettings.JSON_PROPERTY_AUTO_CLOSE_INACTIVE_CASES, + ProjectSettings.JSON_PROPERTY_AUTO_TRANSITION_ASSIGNED_CASES, + ProjectSettings.JSON_PROPERTY_INTEGRATION_INCIDENT, + ProjectSettings.JSON_PROPERTY_INTEGRATION_JIRA, + ProjectSettings.JSON_PROPERTY_INTEGRATION_MONITOR, + ProjectSettings.JSON_PROPERTY_INTEGRATION_ON_CALL, + ProjectSettings.JSON_PROPERTY_INTEGRATION_SERVICE_NOW, + ProjectSettings.JSON_PROPERTY_NOTIFICATION +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ProjectSettings { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_AUTO_CLOSE_INACTIVE_CASES = "auto_close_inactive_cases"; + private AutoCloseInactiveCases autoCloseInactiveCases; + + public static final String JSON_PROPERTY_AUTO_TRANSITION_ASSIGNED_CASES = + "auto_transition_assigned_cases"; + private AutoTransitionAssignedCases autoTransitionAssignedCases; + + public static final String JSON_PROPERTY_INTEGRATION_INCIDENT = "integration_incident"; + private IntegrationIncident integrationIncident; + + public static final String JSON_PROPERTY_INTEGRATION_JIRA = "integration_jira"; + private IntegrationJira integrationJira; + + public static final String JSON_PROPERTY_INTEGRATION_MONITOR = "integration_monitor"; + private IntegrationMonitor integrationMonitor; + + public static final String JSON_PROPERTY_INTEGRATION_ON_CALL = "integration_on_call"; + private IntegrationOnCall integrationOnCall; + + public static final String JSON_PROPERTY_INTEGRATION_SERVICE_NOW = "integration_service_now"; + private IntegrationServiceNow integrationServiceNow; + + public static final String JSON_PROPERTY_NOTIFICATION = "notification"; + private ProjectNotificationSettings notification; + + public ProjectSettings autoCloseInactiveCases(AutoCloseInactiveCases autoCloseInactiveCases) { + this.autoCloseInactiveCases = autoCloseInactiveCases; + this.unparsed |= autoCloseInactiveCases.unparsed; + return this; + } + + /** + * Auto-close inactive cases settings + * + * @return autoCloseInactiveCases + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_AUTO_CLOSE_INACTIVE_CASES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public AutoCloseInactiveCases getAutoCloseInactiveCases() { + return autoCloseInactiveCases; + } + + public void setAutoCloseInactiveCases(AutoCloseInactiveCases autoCloseInactiveCases) { + this.autoCloseInactiveCases = autoCloseInactiveCases; + } + + public ProjectSettings autoTransitionAssignedCases( + AutoTransitionAssignedCases autoTransitionAssignedCases) { + this.autoTransitionAssignedCases = autoTransitionAssignedCases; + this.unparsed |= autoTransitionAssignedCases.unparsed; + return this; + } + + /** + * Auto-transition assigned cases settings + * + * @return autoTransitionAssignedCases + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_AUTO_TRANSITION_ASSIGNED_CASES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public AutoTransitionAssignedCases getAutoTransitionAssignedCases() { + return autoTransitionAssignedCases; + } + + public void setAutoTransitionAssignedCases( + AutoTransitionAssignedCases autoTransitionAssignedCases) { + this.autoTransitionAssignedCases = autoTransitionAssignedCases; + } + + public ProjectSettings integrationIncident(IntegrationIncident integrationIncident) { + this.integrationIncident = integrationIncident; + this.unparsed |= integrationIncident.unparsed; + return this; + } + + /** + * Incident integration settings + * + * @return integrationIncident + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_INTEGRATION_INCIDENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public IntegrationIncident getIntegrationIncident() { + return integrationIncident; + } + + public void setIntegrationIncident(IntegrationIncident integrationIncident) { + this.integrationIncident = integrationIncident; + } + + public ProjectSettings integrationJira(IntegrationJira integrationJira) { + this.integrationJira = integrationJira; + this.unparsed |= integrationJira.unparsed; + return this; + } + + /** + * Jira integration settings + * + * @return integrationJira + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_INTEGRATION_JIRA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public IntegrationJira getIntegrationJira() { + return integrationJira; + } + + public void setIntegrationJira(IntegrationJira integrationJira) { + this.integrationJira = integrationJira; + } + + public ProjectSettings integrationMonitor(IntegrationMonitor integrationMonitor) { + this.integrationMonitor = integrationMonitor; + this.unparsed |= integrationMonitor.unparsed; + return this; + } + + /** + * Monitor integration settings + * + * @return integrationMonitor + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_INTEGRATION_MONITOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public IntegrationMonitor getIntegrationMonitor() { + return integrationMonitor; + } + + public void setIntegrationMonitor(IntegrationMonitor integrationMonitor) { + this.integrationMonitor = integrationMonitor; + } + + public ProjectSettings integrationOnCall(IntegrationOnCall integrationOnCall) { + this.integrationOnCall = integrationOnCall; + this.unparsed |= integrationOnCall.unparsed; + return this; + } + + /** + * On-Call integration settings + * + * @return integrationOnCall + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_INTEGRATION_ON_CALL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public IntegrationOnCall getIntegrationOnCall() { + return integrationOnCall; + } + + public void setIntegrationOnCall(IntegrationOnCall integrationOnCall) { + this.integrationOnCall = integrationOnCall; + } + + public ProjectSettings integrationServiceNow(IntegrationServiceNow integrationServiceNow) { + this.integrationServiceNow = integrationServiceNow; + this.unparsed |= integrationServiceNow.unparsed; + return this; + } + + /** + * ServiceNow integration settings + * + * @return integrationServiceNow + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_INTEGRATION_SERVICE_NOW) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public IntegrationServiceNow getIntegrationServiceNow() { + return integrationServiceNow; + } + + public void setIntegrationServiceNow(IntegrationServiceNow integrationServiceNow) { + this.integrationServiceNow = integrationServiceNow; + } + + public ProjectSettings notification(ProjectNotificationSettings notification) { + this.notification = notification; + this.unparsed |= notification.unparsed; + return this; + } + + /** + * Project notification settings + * + * @return notification + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NOTIFICATION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ProjectNotificationSettings getNotification() { + return notification; + } + + public void setNotification(ProjectNotificationSettings notification) { + this.notification = notification; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return ProjectSettings + */ + @JsonAnySetter + public ProjectSettings putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this ProjectSettings object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProjectSettings projectSettings = (ProjectSettings) o; + return Objects.equals(this.autoCloseInactiveCases, projectSettings.autoCloseInactiveCases) + && Objects.equals( + this.autoTransitionAssignedCases, projectSettings.autoTransitionAssignedCases) + && Objects.equals(this.integrationIncident, projectSettings.integrationIncident) + && Objects.equals(this.integrationJira, projectSettings.integrationJira) + && Objects.equals(this.integrationMonitor, projectSettings.integrationMonitor) + && Objects.equals(this.integrationOnCall, projectSettings.integrationOnCall) + && Objects.equals(this.integrationServiceNow, projectSettings.integrationServiceNow) + && Objects.equals(this.notification, projectSettings.notification) + && Objects.equals(this.additionalProperties, projectSettings.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + autoCloseInactiveCases, + autoTransitionAssignedCases, + integrationIncident, + integrationJira, + integrationMonitor, + integrationOnCall, + integrationServiceNow, + notification, + additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProjectSettings {\n"); + sb.append(" autoCloseInactiveCases: ") + .append(toIndentedString(autoCloseInactiveCases)) + .append("\n"); + sb.append(" autoTransitionAssignedCases: ") + .append(toIndentedString(autoTransitionAssignedCases)) + .append("\n"); + sb.append(" integrationIncident: ") + .append(toIndentedString(integrationIncident)) + .append("\n"); + sb.append(" integrationJira: ").append(toIndentedString(integrationJira)).append("\n"); + sb.append(" integrationMonitor: ").append(toIndentedString(integrationMonitor)).append("\n"); + sb.append(" integrationOnCall: ").append(toIndentedString(integrationOnCall)).append("\n"); + sb.append(" integrationServiceNow: ") + .append(toIndentedString(integrationServiceNow)) + .append("\n"); + sb.append(" notification: ").append(toIndentedString(notification)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ProjectUpdate.java b/src/main/java/com/datadog/api/client/v2/model/ProjectUpdate.java new file mode 100644 index 00000000000..a5592e60909 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProjectUpdate.java @@ -0,0 +1,175 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Project update */ +@JsonPropertyOrder({ProjectUpdate.JSON_PROPERTY_ATTRIBUTES, ProjectUpdate.JSON_PROPERTY_TYPE}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ProjectUpdate { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private ProjectUpdateAttributes attributes; + + public static final String JSON_PROPERTY_TYPE = "type"; + private ProjectResourceType type = ProjectResourceType.PROJECT; + + public ProjectUpdate() {} + + @JsonCreator + public ProjectUpdate( + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) ProjectResourceType type) { + this.type = type; + this.unparsed |= !type.isValid(); + } + + public ProjectUpdate attributes(ProjectUpdateAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Project update attributes + * + * @return attributes + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ProjectUpdateAttributes getAttributes() { + return attributes; + } + + public void setAttributes(ProjectUpdateAttributes attributes) { + this.attributes = attributes; + } + + public ProjectUpdate type(ProjectResourceType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Project resource type + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ProjectResourceType getType() { + return type; + } + + public void setType(ProjectResourceType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return ProjectUpdate + */ + @JsonAnySetter + public ProjectUpdate putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this ProjectUpdate object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProjectUpdate projectUpdate = (ProjectUpdate) o; + return Objects.equals(this.attributes, projectUpdate.attributes) + && Objects.equals(this.type, projectUpdate.type) + && Objects.equals(this.additionalProperties, projectUpdate.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProjectUpdate {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ProjectUpdateAttributes.java b/src/main/java/com/datadog/api/client/v2/model/ProjectUpdateAttributes.java new file mode 100644 index 00000000000..1513136f5b8 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProjectUpdateAttributes.java @@ -0,0 +1,261 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** Project update attributes */ +@JsonPropertyOrder({ + ProjectUpdateAttributes.JSON_PROPERTY_COLUMNS_CONFIG, + ProjectUpdateAttributes.JSON_PROPERTY_ENABLED_CUSTOM_CASE_TYPES, + ProjectUpdateAttributes.JSON_PROPERTY_NAME, + ProjectUpdateAttributes.JSON_PROPERTY_SETTINGS, + ProjectUpdateAttributes.JSON_PROPERTY_TEAM_UUID +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ProjectUpdateAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_COLUMNS_CONFIG = "columns_config"; + private ProjectColumnsConfig columnsConfig; + + public static final String JSON_PROPERTY_ENABLED_CUSTOM_CASE_TYPES = "enabled_custom_case_types"; + private List enabledCustomCaseTypes = null; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_SETTINGS = "settings"; + private ProjectSettings settings; + + public static final String JSON_PROPERTY_TEAM_UUID = "team_uuid"; + private String teamUuid; + + public ProjectUpdateAttributes columnsConfig(ProjectColumnsConfig columnsConfig) { + this.columnsConfig = columnsConfig; + this.unparsed |= columnsConfig.unparsed; + return this; + } + + /** + * Project columns configuration + * + * @return columnsConfig + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_COLUMNS_CONFIG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ProjectColumnsConfig getColumnsConfig() { + return columnsConfig; + } + + public void setColumnsConfig(ProjectColumnsConfig columnsConfig) { + this.columnsConfig = columnsConfig; + } + + public ProjectUpdateAttributes enabledCustomCaseTypes(List enabledCustomCaseTypes) { + this.enabledCustomCaseTypes = enabledCustomCaseTypes; + return this; + } + + public ProjectUpdateAttributes addEnabledCustomCaseTypesItem(String enabledCustomCaseTypesItem) { + if (this.enabledCustomCaseTypes == null) { + this.enabledCustomCaseTypes = new ArrayList<>(); + } + this.enabledCustomCaseTypes.add(enabledCustomCaseTypesItem); + return this; + } + + /** + * List of enabled custom case type IDs + * + * @return enabledCustomCaseTypes + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ENABLED_CUSTOM_CASE_TYPES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getEnabledCustomCaseTypes() { + return enabledCustomCaseTypes; + } + + public void setEnabledCustomCaseTypes(List enabledCustomCaseTypes) { + this.enabledCustomCaseTypes = enabledCustomCaseTypes; + } + + public ProjectUpdateAttributes name(String name) { + this.name = name; + return this; + } + + /** + * Project name + * + * @return name + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public ProjectUpdateAttributes settings(ProjectSettings settings) { + this.settings = settings; + this.unparsed |= settings.unparsed; + return this; + } + + /** + * Project settings + * + * @return settings + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SETTINGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ProjectSettings getSettings() { + return settings; + } + + public void setSettings(ProjectSettings settings) { + this.settings = settings; + } + + public ProjectUpdateAttributes teamUuid(String teamUuid) { + this.teamUuid = teamUuid; + return this; + } + + /** + * Team UUID to associate with the project + * + * @return teamUuid + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TEAM_UUID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getTeamUuid() { + return teamUuid; + } + + public void setTeamUuid(String teamUuid) { + this.teamUuid = teamUuid; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return ProjectUpdateAttributes + */ + @JsonAnySetter + public ProjectUpdateAttributes putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this ProjectUpdateAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProjectUpdateAttributes projectUpdateAttributes = (ProjectUpdateAttributes) o; + return Objects.equals(this.columnsConfig, projectUpdateAttributes.columnsConfig) + && Objects.equals( + this.enabledCustomCaseTypes, projectUpdateAttributes.enabledCustomCaseTypes) + && Objects.equals(this.name, projectUpdateAttributes.name) + && Objects.equals(this.settings, projectUpdateAttributes.settings) + && Objects.equals(this.teamUuid, projectUpdateAttributes.teamUuid) + && Objects.equals(this.additionalProperties, projectUpdateAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + columnsConfig, enabledCustomCaseTypes, name, settings, teamUuid, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProjectUpdateAttributes {\n"); + sb.append(" columnsConfig: ").append(toIndentedString(columnsConfig)).append("\n"); + sb.append(" enabledCustomCaseTypes: ") + .append(toIndentedString(enabledCustomCaseTypes)) + .append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" settings: ").append(toIndentedString(settings)).append("\n"); + sb.append(" teamUuid: ").append(toIndentedString(teamUuid)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ProjectUpdateRequest.java b/src/main/java/com/datadog/api/client/v2/model/ProjectUpdateRequest.java new file mode 100644 index 00000000000..c0036f85f06 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProjectUpdateRequest.java @@ -0,0 +1,145 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Project update request */ +@JsonPropertyOrder({ProjectUpdateRequest.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ProjectUpdateRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private ProjectUpdate data; + + public ProjectUpdateRequest() {} + + @JsonCreator + public ProjectUpdateRequest( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) ProjectUpdate data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public ProjectUpdateRequest data(ProjectUpdate data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Project update + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ProjectUpdate getData() { + return data; + } + + public void setData(ProjectUpdate data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return ProjectUpdateRequest + */ + @JsonAnySetter + public ProjectUpdateRequest putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this ProjectUpdateRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProjectUpdateRequest projectUpdateRequest = (ProjectUpdateRequest) o; + return Objects.equals(this.data, projectUpdateRequest.data) + && Objects.equals(this.additionalProperties, projectUpdateRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProjectUpdateRequest {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/SyncProperty.java b/src/main/java/com/datadog/api/client/v2/model/SyncProperty.java new file mode 100644 index 00000000000..6456547be8f --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/SyncProperty.java @@ -0,0 +1,135 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Sync property configuration */ +@JsonPropertyOrder({SyncProperty.JSON_PROPERTY_SYNC_TYPE}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class SyncProperty { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_SYNC_TYPE = "sync_type"; + private String syncType; + + public SyncProperty syncType(String syncType) { + this.syncType = syncType; + return this; + } + + /** + * GetsyncType + * + * @return syncType + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SYNC_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSyncType() { + return syncType; + } + + public void setSyncType(String syncType) { + this.syncType = syncType; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return SyncProperty + */ + @JsonAnySetter + public SyncProperty putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this SyncProperty object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SyncProperty syncProperty = (SyncProperty) o; + return Objects.equals(this.syncType, syncProperty.syncType) + && Objects.equals(this.additionalProperties, syncProperty.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(syncType, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SyncProperty {\n"); + sb.append(" syncType: ").append(toIndentedString(syncType)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/SyncPropertyWithMapping.java b/src/main/java/com/datadog/api/client/v2/model/SyncPropertyWithMapping.java new file mode 100644 index 00000000000..1dc600d5501 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/SyncPropertyWithMapping.java @@ -0,0 +1,207 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Sync property with mapping configuration */ +@JsonPropertyOrder({ + SyncPropertyWithMapping.JSON_PROPERTY_MAPPING, + SyncPropertyWithMapping.JSON_PROPERTY_NAME_MAPPING, + SyncPropertyWithMapping.JSON_PROPERTY_SYNC_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class SyncPropertyWithMapping { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_MAPPING = "mapping"; + private Map mapping = null; + + public static final String JSON_PROPERTY_NAME_MAPPING = "name_mapping"; + private Map nameMapping = null; + + public static final String JSON_PROPERTY_SYNC_TYPE = "sync_type"; + private String syncType; + + public SyncPropertyWithMapping mapping(Map mapping) { + this.mapping = mapping; + return this; + } + + public SyncPropertyWithMapping putMappingItem(String key, String mappingItem) { + if (this.mapping == null) { + this.mapping = new HashMap<>(); + } + this.mapping.put(key, mappingItem); + return this; + } + + /** + * Getmapping + * + * @return mapping + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MAPPING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getMapping() { + return mapping; + } + + public void setMapping(Map mapping) { + this.mapping = mapping; + } + + public SyncPropertyWithMapping nameMapping(Map nameMapping) { + this.nameMapping = nameMapping; + return this; + } + + public SyncPropertyWithMapping putNameMappingItem(String key, String nameMappingItem) { + if (this.nameMapping == null) { + this.nameMapping = new HashMap<>(); + } + this.nameMapping.put(key, nameMappingItem); + return this; + } + + /** + * GetnameMapping + * + * @return nameMapping + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NAME_MAPPING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getNameMapping() { + return nameMapping; + } + + public void setNameMapping(Map nameMapping) { + this.nameMapping = nameMapping; + } + + public SyncPropertyWithMapping syncType(String syncType) { + this.syncType = syncType; + return this; + } + + /** + * GetsyncType + * + * @return syncType + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SYNC_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSyncType() { + return syncType; + } + + public void setSyncType(String syncType) { + this.syncType = syncType; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return SyncPropertyWithMapping + */ + @JsonAnySetter + public SyncPropertyWithMapping putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this SyncPropertyWithMapping object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SyncPropertyWithMapping syncPropertyWithMapping = (SyncPropertyWithMapping) o; + return Objects.equals(this.mapping, syncPropertyWithMapping.mapping) + && Objects.equals(this.nameMapping, syncPropertyWithMapping.nameMapping) + && Objects.equals(this.syncType, syncPropertyWithMapping.syncType) + && Objects.equals(this.additionalProperties, syncPropertyWithMapping.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(mapping, nameMapping, syncType, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SyncPropertyWithMapping {\n"); + sb.append(" mapping: ").append(toIndentedString(mapping)).append("\n"); + sb.append(" nameMapping: ").append(toIndentedString(nameMapping)).append("\n"); + sb.append(" syncType: ").append(toIndentedString(syncType)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/test/resources/com/datadog/api/client/v2/api/case_management.feature b/src/test/resources/com/datadog/api/client/v2/api/case_management.feature index 2f239155671..85169a3fcae 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/case_management.feature +++ b/src/test/resources/com/datadog/api/client/v2/api/case_management.feature @@ -116,24 +116,79 @@ Feature: Case Management When the request is sent Then the response status is 404 Not Found + @team:DataDog/case-management + Scenario: Create a notification rule returns "Bad Request" response + Given new "CreateProjectNotificationRule" request + And there is a valid "project" in the system + And request contains "project_id" parameter from "project.id" + And body with value {"data": {"type": "notification_rule", "attributes": {"recipients": [], "triggers": []}}} + When the request is sent + Then the response status is 400 Bad Request + + @team:DataDog/case-management + Scenario: Create a notification rule returns "CREATED" response + Given new "CreateProjectNotificationRule" request + And there is a valid "project" in the system + And request contains "project_id" parameter from "project.id" + And body with value {"data": {"type": "notification_rule", "attributes": {"is_enabled": true, "recipients": [{"type": "email", "data": {"email": "test-{{ unique }}@example.com"}}], "triggers": [{"type": "case_created"}]}}} + When the request is sent + Then the response status is 201 CREATED + And the response "data" has field "id" + And the response "data.attributes.is_enabled" is equal to true + + @team:DataDog/case-management + Scenario: Create a notification rule returns "Not Found" response + Given new "CreateProjectNotificationRule" request + And request contains "project_id" parameter with value "67d80aa3-36ff-44b9-a694-c501a7591737" + And body with value {"data": {"type": "notification_rule", "attributes": {"is_enabled": true, "recipients": [{"type": "email", "data": {"email": "test@example.com"}}], "triggers": [{"type": "case_created"}]}}} + 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 + + @team:DataDog/case-management + Scenario: Delete a notification rule returns "No Content" response + Given new "DeleteProjectNotificationRule" request + And there is a valid "project" in the system + And there is a valid "case_notification_rule" in the system + And request contains "project_id" parameter from "project.id" + And request contains "notification_rule_id" parameter from "case_notification_rule.id" + When the request is sent + Then the response status is 204 No Content + + @team:DataDog/case-management + Scenario: Delete a notification rule returns "Not Found" response + Given new "DeleteProjectNotificationRule" request + And there is a valid "project" in the system + And request contains "project_id" parameter from "project.id" + And request contains "notification_rule_id" parameter with value "67d80aa3-36ff-44b9-a694-c501a7591737" When the request is sent Then the response status is 404 Not Found @@ -203,6 +258,28 @@ 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 + + @team:DataDog/case-management + Scenario: Get notification rules returns "Not Found" response + Given new "GetProjectNotificationRules" request + And request contains "project_id" parameter with value "67d80aa3-36ff-44b9-a694-c501a7591737" + When the request is sent + Then the response status is 404 Not Found + + @team:DataDog/case-management + Scenario: Get notification rules returns "OK" response + Given new "GetProjectNotificationRules" request + And there is a valid "project" in the system + And request contains "project_id" parameter from "project.id" + 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 +414,68 @@ Feature: Case Management When the request is sent Then the response status is 200 OK + @team:DataDog/case-management + Scenario: Update a notification rule returns "Bad Request" response + Given new "UpdateProjectNotificationRule" request + And there is a valid "project" in the system + And there is a valid "case_notification_rule" in the system + And request contains "project_id" parameter from "project.id" + And request contains "notification_rule_id" parameter from "case_notification_rule.id" + 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 notification rule returns "Not Found" response + Given new "UpdateProjectNotificationRule" request + And there is a valid "project" in the system + And request contains "project_id" parameter from "project.id" + And request contains "notification_rule_id" parameter with value "67d80aa3-36ff-44b9-a694-c501a7591737" + And body with value {"data": {"type": "notification_rule", "attributes": {"is_enabled": false}}} + When the request is sent + Then the response status is 404 Not Found + + @team:DataDog/case-management + Scenario: Update a notification rule returns "OK" response + Given new "UpdateProjectNotificationRule" request + And there is a valid "project" in the system + And there is a valid "case_notification_rule" in the system + And request contains "project_id" parameter from "project.id" + And request contains "notification_rule_id" parameter from "case_notification_rule.id" + And body with value {"data": {"type": "notification_rule", "attributes": {"is_enabled": false}}} + When the request is sent + Then the response status is 200 OK + And the response "data" has field "id" + And the response "data.attributes.is_enabled" is equal to false + + @team:DataDog/case-management + Scenario: Update a project returns "Bad Request" response + Given new "UpdateProject" request + And there is a valid "project" in the system + And request contains "project_id" parameter from "project.id" + 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 there is a valid "project" in the system + And request contains "project_id" parameter from "project.id" + 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/src/test/resources/com/datadog/api/client/v2/api/given.json b/src/test/resources/com/datadog/api/client/v2/api/given.json index 1d65907ff13..a241d808226 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/given.json +++ b/src/test/resources/com/datadog/api/client/v2/api/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", + "source": "project.id" + }, + { + "name": "body", + "value": "{\n \"data\": {\n \"type\": \"notification_rule\",\n \"attributes\": {\n \"is_enabled\": true,\n \"triggers\": [{\"type\": \"case_created\"}],\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/src/test/resources/com/datadog/api/client/v2/api/undo.json b/src/test/resources/com/datadog/api/client/v2/api/undo.json index 5a347bddf11..6387dae5fac 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/undo.json +++ b/src/test/resources/com/datadog/api/client/v2/api/undo.json @@ -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": {