diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index d22c0abd585..7fb28933e20 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -719,6 +719,14 @@ components: schema: default: false type: boolean + IncidentUserDefinedFieldIDPathParameter: + description: The ID of the incident user-defined field. + in: path + name: field_id + required: true + schema: + example: "00000000-0000-0000-0000-000000000000" + type: string Include: description: Include relationship data. explode: true @@ -31636,6 +31644,391 @@ components: type: $ref: "#/components/schemas/UsersType" type: object + IncidentUserDefinedFieldAttributesCreateRequest: + description: Attributes for creating an incident user-defined field. + properties: + category: + $ref: "#/components/schemas/IncidentUserDefinedFieldCategory" + collected: + $ref: "#/components/schemas/IncidentUserDefinedFieldCollected" + default_value: + description: The default value for the field. Must be one of the valid values when valid_values is set. + example: "critical" + nullable: true + type: string + display_name: + description: The human-readable name shown in the UI. Defaults to a formatted version of the name if not provided. + example: "Root Cause" + type: string + name: + description: The unique machine-readable name of the field. Must start with a letter or digit and contain only letters, digits, underscores, or periods. + example: "root_cause" + type: string + ordinal: + description: A decimal string representing the field's display order in the UI. + example: "1.5" + nullable: true + type: string + required: + description: When true, users must fill out this field on incidents. + example: false + type: boolean + tag_key: + description: For metric tag-type fields only, the metric tag key that powers the autocomplete options. + example: "datacenter" + nullable: true + type: string + type: + $ref: "#/components/schemas/IncidentUserDefinedFieldFieldType" + valid_values: + description: The list of allowed values for dropdown, multiselect, and autocomplete fields. Limited to 1000 values. + items: + $ref: "#/components/schemas/IncidentUserDefinedFieldValidValue" + type: array + required: + - name + - type + type: object + IncidentUserDefinedFieldAttributesResponse: + description: Attributes of an incident user-defined field. + properties: + attached_to: + description: The resource type this field is attached to. Always "incidents". + example: "incidents" + readOnly: true + type: string + category: + $ref: "#/components/schemas/IncidentUserDefinedFieldCategory" + collected: + $ref: "#/components/schemas/IncidentUserDefinedFieldCollected" + created: + description: Timestamp when the field was created. + example: "2026-03-18T08:40:05.185406Z" + format: date-time + readOnly: true + type: string + default_value: + description: The default value for the field. + example: "critical" + nullable: true + type: string + deleted: + description: Timestamp when the field was soft-deleted, or null if not deleted. + example: + format: date-time + nullable: true + readOnly: true + type: string + display_name: + description: The human-readable name shown in the UI. + example: "Root Cause" + type: string + metadata: + $ref: "#/components/schemas/IncidentUserDefinedFieldMetadata" + modified: + description: Timestamp when the field was last modified. + example: "2026-03-18T08:40:05.185406Z" + format: date-time + nullable: true + readOnly: true + type: string + name: + description: The unique machine-readable name of the field. + example: "root_cause" + type: string + ordinal: + description: A decimal string representing the field's display order in the UI. + example: "1.5" + nullable: true + type: string + prerequisite: + description: Reserved for future use. Always null. + example: + nullable: true + readOnly: true + type: string + required: + description: When true, users must fill out this field on incidents. + example: false + type: boolean + reserved: + description: When true, this field is reserved for system use and cannot be deleted. + example: false + readOnly: true + type: boolean + table_id: + description: Reserved for internal use. Always 0. + example: 0 + format: int64 + readOnly: true + type: integer + tag_key: + description: For metric tag-type fields only, the metric tag key that powers the autocomplete options. + example: + nullable: true + type: string + type: + description: The data type of the field. 1=dropdown, 2=multiselect, 3=textbox, 4=textarray, 5=metrictag, 6=autocomplete, 7=number, 8=datetime. + example: 3 + format: int32 + maximum: 8 + minimum: 1 + nullable: true + type: integer + valid_values: + description: The list of allowed values for dropdown, multiselect, and autocomplete fields. + items: + $ref: "#/components/schemas/IncidentUserDefinedFieldValidValue" + nullable: true + type: array + required: + - attached_to + - category + - collected + - created + - default_value + - deleted + - display_name + - metadata + - modified + - name + - ordinal + - prerequisite + - required + - reserved + - table_id + - tag_key + - type + - valid_values + type: object + IncidentUserDefinedFieldAttributesUpdateRequest: + description: Attributes for updating an incident user-defined field. All fields are optional. + properties: + category: + $ref: "#/components/schemas/IncidentUserDefinedFieldCategory" + collected: + $ref: "#/components/schemas/IncidentUserDefinedFieldCollected" + default_value: + description: The default value for the field. Must be one of the valid values when valid_values is set. + example: "critical" + nullable: true + type: string + display_name: + description: The human-readable name shown in the UI. + example: "Root Cause" + type: string + ordinal: + description: A decimal string representing the field's display order in the UI. + example: "1.5" + nullable: true + type: string + required: + description: When true, users must fill out this field on incidents. + example: false + nullable: true + type: boolean + valid_values: + description: The list of allowed values for dropdown and multiselect fields. Limited to 1000 values. + items: + $ref: "#/components/schemas/IncidentUserDefinedFieldValidValue" + nullable: true + type: array + type: object + IncidentUserDefinedFieldCategory: + description: The section in which the field appears. Use "what_happened" for impact-related fields or "why_it_happened" for root cause fields. When null, the field appears in the Attributes section. + enum: + - what_happened + - why_it_happened + example: what_happened + nullable: true + type: string + x-enum-varnames: + - WHAT_HAPPENED + - WHY_IT_HAPPENED + IncidentUserDefinedFieldCollected: + description: The lifecycle stage at which the app prompts users to fill out this field. Cannot be set on required fields. + enum: + - active + - stable + - resolved + - completed + example: active + nullable: true + type: string + x-enum-varnames: + - ACTIVE + - STABLE + - RESOLVED + - COMPLETED + IncidentUserDefinedFieldCreateData: + description: Data for creating an incident user-defined field. + properties: + attributes: + $ref: "#/components/schemas/IncidentUserDefinedFieldAttributesCreateRequest" + relationships: + $ref: "#/components/schemas/IncidentUserDefinedFieldCreateRelationships" + type: + $ref: "#/components/schemas/IncidentUserDefinedFieldType" + required: + - type + - attributes + - relationships + type: object + IncidentUserDefinedFieldCreateRelationships: + description: Relationships for creating an incident user-defined field. + properties: + incident_type: + $ref: "#/components/schemas/RelationshipToIncidentType" + required: + - incident_type + type: object + IncidentUserDefinedFieldCreateRequest: + description: Request body for creating an incident user-defined field. + properties: + data: + $ref: "#/components/schemas/IncidentUserDefinedFieldCreateData" + required: + - data + type: object + IncidentUserDefinedFieldFieldType: + description: The data type of the field. 1=dropdown, 2=multiselect, 3=textbox, 4=textarray, 5=metrictag, 6=autocomplete, 7=number, 8=datetime. + enum: + - 1 + - 2 + - 3 + - 4 + - 5 + - 6 + - 7 + - 8 + example: 3 + format: int32 + type: integer + x-enum-varnames: + - DROPDOWN + - MULTISELECT + - TEXTBOX + - TEXTARRAY + - METRICTAG + - AUTOCOMPLETE + - NUMBER + - DATETIME + IncidentUserDefinedFieldImportRequest: + description: Multipart form data for importing valid values for an incident user-defined field from a CSV file. + properties: + file: + description: A CSV file where each distinct value in the first column is imported as a valid value. + format: binary + type: string + type: object + IncidentUserDefinedFieldListMeta: + description: Pagination metadata for the user-defined field list response. + properties: + page_offset: + description: The offset of the current page. + example: 0 + format: int64 + type: integer + total: + description: The total number of items in the current page. + example: 5 + format: int64 + type: integer + required: + - page_offset + - total + type: object + IncidentUserDefinedFieldListResponse: + description: Response containing a list of incident user-defined fields. + properties: + data: + description: An array of user-defined field objects. + items: + $ref: "#/components/schemas/IncidentUserDefinedFieldResponseData" + type: array + meta: + $ref: "#/components/schemas/IncidentUserDefinedFieldListMeta" + required: + - data + - meta + type: object + IncidentUserDefinedFieldMetadata: + description: Metadata for autocomplete-type user-defined fields, describing how to populate autocomplete options. + nullable: true + properties: + category: + description: The category of the autocomplete source. + example: "teams_and_services" + type: string + search_limit_param: + description: The query parameter used to limit the number of autocomplete results. + example: "page[size]" + type: string + search_params: + additionalProperties: {} + description: Additional query parameters to include in the search URL. + type: object + search_query_param: + description: The query parameter used to pass typed input to the search URL. + example: "filter" + type: string + search_result_path: + description: The JSON path to the results in the response body. + example: "$.data[*].attributes.name" + type: string + search_url: + description: The URL used to populate autocomplete options. + example: "/api/v2/incidents/config/services" + type: string + required: + - category + - search_url + - search_query_param + - search_limit_param + - search_result_path + - search_params + type: object + IncidentUserDefinedFieldRelationships: + description: Relationships of an incident user-defined field. + properties: + created_by_user: + $ref: "#/components/schemas/RelationshipToUser" + incident_type: + $ref: "#/components/schemas/RelationshipToIncidentType" + last_modified_by_user: + $ref: "#/components/schemas/RelationshipToUser" + required: + - created_by_user + - last_modified_by_user + - incident_type + type: object + IncidentUserDefinedFieldResponse: + description: Response containing a single incident user-defined field. + properties: + data: + $ref: "#/components/schemas/IncidentUserDefinedFieldResponseData" + required: + - data + type: object + IncidentUserDefinedFieldResponseData: + description: Data object for an incident user-defined field response. + properties: + attributes: + $ref: "#/components/schemas/IncidentUserDefinedFieldAttributesResponse" + id: + description: The unique identifier of the user-defined field. + example: "00000000-0000-0000-0000-000000000000" + type: string + relationships: + $ref: "#/components/schemas/IncidentUserDefinedFieldRelationships" + type: + $ref: "#/components/schemas/IncidentUserDefinedFieldType" + required: + - id + - type + - attributes + - relationships + type: object IncidentUserDefinedFieldType: description: The incident user defined fields type. enum: @@ -31644,6 +32037,54 @@ components: type: string x-enum-varnames: - USER_DEFINED_FIELD + IncidentUserDefinedFieldUpdateData: + description: Data for updating an incident user-defined field. + properties: + attributes: + $ref: "#/components/schemas/IncidentUserDefinedFieldAttributesUpdateRequest" + id: + description: The unique identifier of the user-defined field to update. + example: "00000000-0000-0000-0000-000000000000" + type: string + type: + $ref: "#/components/schemas/IncidentUserDefinedFieldType" + required: + - id + - type + - attributes + type: object + IncidentUserDefinedFieldUpdateRequest: + description: Request body for updating an incident user-defined field. + properties: + data: + $ref: "#/components/schemas/IncidentUserDefinedFieldUpdateData" + required: + - data + type: object + IncidentUserDefinedFieldValidValue: + description: A valid value for an incident user-defined field. + properties: + description: + description: A detailed description of the valid value. + example: "A critical severity incident." + type: string + display_name: + description: The human-readable display name for this value. + example: "Critical" + type: string + short_description: + description: A short description of the valid value. + example: "Critical" + type: string + value: + description: The machine-readable value stored when this option is selected. + example: "critical" + type: string + required: + - display_name + - value + - description + type: object IncidentsResponse: description: Response with a list of incidents. properties: @@ -80471,6 +80912,109 @@ paths: x-unstable: |- **Note**: This endpoint is in public beta. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/incidents/config/fields/{field_id}/values/import: + post: + description: Import valid values for an incident user-defined field from a CSV file. Only supported for dropdown, multiselect, and autocomplete field types. + operationId: ImportIncidentUserDefinedFieldValues + parameters: + - $ref: "#/components/parameters/IncidentUserDefinedFieldIDPathParameter" + - description: When "true", "True", or "1", replaces all existing valid values with the imported values. Otherwise, appends the imported values to the existing list. + in: query + name: replace_values + schema: + example: "true" + type: string + requestBody: + content: + multipart/form-data: + schema: + $ref: "#/components/schemas/IncidentUserDefinedFieldImportRequest" + description: CSV file containing the values to import. + required: true + responses: + "201": + content: + application/json: + examples: + default: + value: + data: + attributes: + attached_to: "incidents" + category: "what_happened" + collected: + created: "2026-03-18T08:40:04.437887Z" + default_value: + deleted: + display_name: "Root Cause" + metadata: + modified: "2026-03-18T08:40:05.000000Z" + name: "root_cause" + ordinal: "1.1" + prerequisite: + required: false + reserved: false + table_id: 0 + tag_key: + type: 1 + valid_values: + - description: "A bug in the service code." + display_name: "Service Bug" + value: "service_bug" + - description: "An error caused by a human." + display_name: "Human Error" + value: "human_error" + id: "6f8f42e0-6a84-4495-9a24-6decb0a87de0" + relationships: + created_by_user: + data: + id: "00000000-0000-0000-0000-000000000001" + type: "users" + incident_type: + data: + id: "7459c30c-c661-4171-9474-db3a486377b2" + type: "incident_types" + last_modified_by_user: + data: + id: "00000000-0000-0000-0000-000000000001" + type: "users" + type: "user_defined_field" + schema: + $ref: "#/components/schemas/IncidentUserDefinedFieldResponse" + description: CREATED + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "401": + $ref: "#/components/responses/UnauthorizedResponse" + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Not Found + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - incident_settings_write + summary: Import values for an incident user-defined field + tags: + - Incidents + x-permission: + operator: OR + permissions: + - incident_settings_write + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). /api/v2/incidents/config/global/incident-handles: delete: description: Delete a global incident handle. @@ -81428,6 +81972,440 @@ paths: x-unstable: |- **Note**: This endpoint is in public beta. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/incidents/config/user-defined-fields: + get: + description: Get a list of all incident user-defined fields. + operationId: ListIncidentUserDefinedFields + parameters: + - description: The number of results to return per page. Must be between 0 and 1000. + in: query + name: page[size] + schema: + default: 1000 + format: int64 + maximum: 1000 + minimum: 0 + type: integer + - description: The page number to retrieve, starting at 0. + in: query + name: page[number] + schema: + default: 0 + format: int64 + minimum: 0 + type: integer + - description: When true, include soft-deleted fields in the response. + in: query + name: include-deleted + schema: + default: false + type: boolean + - description: Filter results to fields associated with the given incident type UUID. + in: query + name: filter[incident-type] + schema: + type: string + - description: Comma-separated list of related resources to include. Supported values are "last_modified_by_user", "created_by_user", and "incident_type". + in: query + name: include + schema: + type: string + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - attributes: + attached_to: "incidents" + category: "what_happened" + collected: "active" + created: "2026-03-18T08:40:04.437887Z" + default_value: + deleted: + display_name: "Root Cause" + metadata: + modified: "2026-03-18T08:40:04.437887Z" + name: "root_cause" + ordinal: "1.1" + prerequisite: + required: false + reserved: false + table_id: 0 + tag_key: + type: 1 + valid_values: + - description: "A bug in the service code." + display_name: "Service Bug" + value: "service_bug" + id: "6f8f42e0-6a84-4495-9a24-6decb0a87de0" + relationships: + created_by_user: + data: + id: "00000000-0000-0000-0000-000000000001" + type: "users" + incident_type: + data: + id: "7459c30c-c661-4171-9474-db3a486377b2" + type: "incident_types" + last_modified_by_user: + data: + id: "00000000-0000-0000-0000-000000000001" + type: "users" + type: "user_defined_field" + meta: + page_offset: 0 + total: 1 + schema: + $ref: "#/components/schemas/IncidentUserDefinedFieldListResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "401": + $ref: "#/components/responses/UnauthorizedResponse" + "403": + $ref: "#/components/responses/ForbiddenResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - incident_read + summary: Get a list of incident user-defined fields + tags: + - Incidents + x-permission: + operator: AND + permissions: + - incident_read + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + post: + description: Create an incident user-defined field. + operationId: CreateIncidentUserDefinedField + parameters: + - description: Comma-separated list of related resources to include. Supported values are "last_modified_by_user", "created_by_user", and "incident_type". + in: query + name: include + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/IncidentUserDefinedFieldCreateRequest" + description: Incident user-defined field payload. + required: true + responses: + "201": + content: + application/json: + examples: + default: + value: + data: + attributes: + attached_to: "incidents" + category: + collected: + created: "2026-03-18T08:40:05.185406Z" + default_value: + deleted: + display_name: "Root Cause" + metadata: + modified: "2026-03-18T08:40:05.185406Z" + name: "root_cause" + ordinal: "9" + prerequisite: + required: false + reserved: false + table_id: 0 + tag_key: + type: 3 + valid_values: + id: "82263487-b540-4c12-8797-58ac1d4fed17" + relationships: + created_by_user: + data: + id: "2f2c94fe-cd6e-4f8e-b9c7-d5755aca09a6" + type: "users" + incident_type: + data: + id: "7459c30c-c661-4171-9474-db3a486377b2" + type: "incident_types" + last_modified_by_user: + data: + id: "2f2c94fe-cd6e-4f8e-b9c7-d5755aca09a6" + type: "users" + type: "user_defined_field" + schema: + $ref: "#/components/schemas/IncidentUserDefinedFieldResponse" + description: CREATED + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "401": + $ref: "#/components/responses/UnauthorizedResponse" + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Not Found + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - incident_settings_write + summary: Create an incident user-defined field + tags: + - Incidents + x-codegen-request-body-name: body + x-permission: + operator: AND + permissions: + - incident_settings_write + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/incidents/config/user-defined-fields/{field_id}: + delete: + description: Delete an incident user-defined field. + operationId: DeleteIncidentUserDefinedField + parameters: + - $ref: "#/components/parameters/IncidentUserDefinedFieldIDPathParameter" + responses: + "204": + description: No Content + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "401": + $ref: "#/components/responses/UnauthorizedResponse" + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Not Found + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - incident_settings_write + summary: Delete an incident user-defined field + tags: + - Incidents + x-permission: + operator: AND + permissions: + - incident_settings_write + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + get: + description: Get details of an incident user-defined field. + operationId: GetIncidentUserDefinedField + parameters: + - $ref: "#/components/parameters/IncidentUserDefinedFieldIDPathParameter" + - description: Comma-separated list of related resources to include. Supported values are "last_modified_by_user", "created_by_user", and "incident_type". + in: query + name: include + schema: + type: string + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + attached_to: "incidents" + category: "what_happened" + collected: "active" + created: "2026-03-18T08:40:04.437887Z" + default_value: + deleted: + display_name: "Root Cause" + metadata: + modified: "2026-03-18T08:40:04.437887Z" + name: "root_cause" + ordinal: "1.1" + prerequisite: + required: false + reserved: false + table_id: 0 + tag_key: + type: 1 + valid_values: + - description: "A bug in the service code." + display_name: "Service Bug" + value: "service_bug" + id: "6f8f42e0-6a84-4495-9a24-6decb0a87de0" + relationships: + created_by_user: + data: + id: "00000000-0000-0000-0000-000000000001" + type: "users" + incident_type: + data: + id: "7459c30c-c661-4171-9474-db3a486377b2" + type: "incident_types" + last_modified_by_user: + data: + id: "00000000-0000-0000-0000-000000000001" + type: "users" + type: "user_defined_field" + schema: + $ref: "#/components/schemas/IncidentUserDefinedFieldResponse" + description: OK + "401": + $ref: "#/components/responses/UnauthorizedResponse" + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Not Found + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - incident_read + summary: Get an incident user-defined field + tags: + - Incidents + x-permission: + operator: AND + permissions: + - incident_read + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + patch: + description: Update an incident user-defined field. + operationId: UpdateIncidentUserDefinedField + parameters: + - $ref: "#/components/parameters/IncidentUserDefinedFieldIDPathParameter" + - description: Comma-separated list of related resources to include. Supported values are "last_modified_by_user", "created_by_user", and "incident_type". + in: query + name: include + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/IncidentUserDefinedFieldUpdateRequest" + description: Incident user-defined field update payload. + required: true + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + attached_to: "incidents" + category: "what_happened" + collected: + created: "2026-03-18T08:39:49.913895Z" + default_value: + deleted: + display_name: "Root Cause" + metadata: + modified: "2026-03-18T08:39:49.922909Z" + name: "root_cause" + ordinal: "8" + prerequisite: + required: false + reserved: false + table_id: 0 + tag_key: + type: 3 + valid_values: + id: "13a731a3-a010-450e-b6a3-3d450a26170c" + relationships: + created_by_user: + data: + id: "8e7d4859-0916-4df8-b51c-5f5a4ea7815e" + type: "users" + incident_type: + data: + id: "95edc42f-c55d-46fa-92a1-a182646454af" + type: "incident_types" + last_modified_by_user: + data: + id: "8e7d4859-0916-4df8-b51c-5f5a4ea7815e" + type: "users" + type: "user_defined_field" + schema: + $ref: "#/components/schemas/IncidentUserDefinedFieldResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "401": + $ref: "#/components/responses/UnauthorizedResponse" + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Not Found + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - incident_settings_write + summary: Update an incident user-defined field + tags: + - Incidents + x-codegen-request-body-name: body + x-permission: + operator: AND + permissions: + - incident_settings_write + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). /api/v2/incidents/import: post: description: |- diff --git a/examples/v2/incidents/CreateIncidentUserDefinedField.java b/examples/v2/incidents/CreateIncidentUserDefinedField.java new file mode 100644 index 00000000000..e1f69193ddc --- /dev/null +++ b/examples/v2/incidents/CreateIncidentUserDefinedField.java @@ -0,0 +1,70 @@ +// Create an incident user-defined field returns "CREATED" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.IncidentsApi; +import com.datadog.api.client.v2.model.IncidentTypeType; +import com.datadog.api.client.v2.model.IncidentUserDefinedFieldAttributesCreateRequest; +import com.datadog.api.client.v2.model.IncidentUserDefinedFieldCategory; +import com.datadog.api.client.v2.model.IncidentUserDefinedFieldCollected; +import com.datadog.api.client.v2.model.IncidentUserDefinedFieldCreateData; +import com.datadog.api.client.v2.model.IncidentUserDefinedFieldCreateRelationships; +import com.datadog.api.client.v2.model.IncidentUserDefinedFieldCreateRequest; +import com.datadog.api.client.v2.model.IncidentUserDefinedFieldFieldType; +import com.datadog.api.client.v2.model.IncidentUserDefinedFieldResponse; +import com.datadog.api.client.v2.model.IncidentUserDefinedFieldType; +import com.datadog.api.client.v2.model.IncidentUserDefinedFieldValidValue; +import com.datadog.api.client.v2.model.RelationshipToIncidentType; +import com.datadog.api.client.v2.model.RelationshipToIncidentTypeData; +import java.util.Collections; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.createIncidentUserDefinedField", true); + IncidentsApi apiInstance = new IncidentsApi(defaultClient); + + IncidentUserDefinedFieldCreateRequest body = + new IncidentUserDefinedFieldCreateRequest() + .data( + new IncidentUserDefinedFieldCreateData() + .attributes( + new IncidentUserDefinedFieldAttributesCreateRequest() + .category(IncidentUserDefinedFieldCategory.WHAT_HAPPENED) + .collected(IncidentUserDefinedFieldCollected.ACTIVE) + .defaultValue("critical") + .displayName("Root Cause") + .name("root_cause") + .ordinal("1.5") + .required(false) + .tagKey("datacenter") + .type(IncidentUserDefinedFieldFieldType.TEXTBOX) + .validValues( + Collections.singletonList( + new IncidentUserDefinedFieldValidValue() + .description("A critical severity incident.") + .displayName("Critical") + .shortDescription("Critical") + .value("critical")))) + .relationships( + new IncidentUserDefinedFieldCreateRelationships() + .incidentType( + new RelationshipToIncidentType() + .data( + new RelationshipToIncidentTypeData() + .id("00000000-0000-0000-0000-000000000000") + .type(IncidentTypeType.INCIDENT_TYPES)))) + .type(IncidentUserDefinedFieldType.USER_DEFINED_FIELD)); + + try { + IncidentUserDefinedFieldResponse result = apiInstance.createIncidentUserDefinedField(body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling IncidentsApi#createIncidentUserDefinedField"); + 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/incidents/DeleteIncidentUserDefinedField.java b/examples/v2/incidents/DeleteIncidentUserDefinedField.java new file mode 100644 index 00000000000..61ac501a915 --- /dev/null +++ b/examples/v2/incidents/DeleteIncidentUserDefinedField.java @@ -0,0 +1,23 @@ +// Delete an incident user-defined field returns "No Content" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.IncidentsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.deleteIncidentUserDefinedField", true); + IncidentsApi apiInstance = new IncidentsApi(defaultClient); + + try { + apiInstance.deleteIncidentUserDefinedField("00000000-0000-0000-0000-000000000000"); + } catch (ApiException e) { + System.err.println("Exception when calling IncidentsApi#deleteIncidentUserDefinedField"); + 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/incidents/GetIncidentUserDefinedField.java b/examples/v2/incidents/GetIncidentUserDefinedField.java new file mode 100644 index 00000000000..21244f35aa8 --- /dev/null +++ b/examples/v2/incidents/GetIncidentUserDefinedField.java @@ -0,0 +1,26 @@ +// Get an incident user-defined field returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.IncidentsApi; +import com.datadog.api.client.v2.model.IncidentUserDefinedFieldResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.getIncidentUserDefinedField", true); + IncidentsApi apiInstance = new IncidentsApi(defaultClient); + + try { + IncidentUserDefinedFieldResponse result = + apiInstance.getIncidentUserDefinedField("00000000-0000-0000-0000-000000000000"); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling IncidentsApi#getIncidentUserDefinedField"); + 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/incidents/ImportIncidentUserDefinedFieldValues.java b/examples/v2/incidents/ImportIncidentUserDefinedFieldValues.java new file mode 100644 index 00000000000..7c0a9fb5134 --- /dev/null +++ b/examples/v2/incidents/ImportIncidentUserDefinedFieldValues.java @@ -0,0 +1,27 @@ +// Import values for an incident user-defined field returns "CREATED" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.IncidentsApi; +import com.datadog.api.client.v2.model.IncidentUserDefinedFieldResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.importIncidentUserDefinedFieldValues", true); + IncidentsApi apiInstance = new IncidentsApi(defaultClient); + + try { + IncidentUserDefinedFieldResponse result = + apiInstance.importIncidentUserDefinedFieldValues("00000000-0000-0000-0000-000000000000"); + System.out.println(result); + } catch (ApiException e) { + System.err.println( + "Exception when calling IncidentsApi#importIncidentUserDefinedFieldValues"); + 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/incidents/ListIncidentUserDefinedFields.java b/examples/v2/incidents/ListIncidentUserDefinedFields.java new file mode 100644 index 00000000000..cd5584b755c --- /dev/null +++ b/examples/v2/incidents/ListIncidentUserDefinedFields.java @@ -0,0 +1,25 @@ +// Get a list of incident user-defined fields returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.IncidentsApi; +import com.datadog.api.client.v2.model.IncidentUserDefinedFieldListResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.listIncidentUserDefinedFields", true); + IncidentsApi apiInstance = new IncidentsApi(defaultClient); + + try { + IncidentUserDefinedFieldListResponse result = apiInstance.listIncidentUserDefinedFields(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling IncidentsApi#listIncidentUserDefinedFields"); + 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/incidents/UpdateIncidentUserDefinedField.java b/examples/v2/incidents/UpdateIncidentUserDefinedField.java new file mode 100644 index 00000000000..71dade0c41a --- /dev/null +++ b/examples/v2/incidents/UpdateIncidentUserDefinedField.java @@ -0,0 +1,56 @@ +// Update an incident user-defined field returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.IncidentsApi; +import com.datadog.api.client.v2.model.IncidentUserDefinedFieldAttributesUpdateRequest; +import com.datadog.api.client.v2.model.IncidentUserDefinedFieldCategory; +import com.datadog.api.client.v2.model.IncidentUserDefinedFieldCollected; +import com.datadog.api.client.v2.model.IncidentUserDefinedFieldResponse; +import com.datadog.api.client.v2.model.IncidentUserDefinedFieldType; +import com.datadog.api.client.v2.model.IncidentUserDefinedFieldUpdateData; +import com.datadog.api.client.v2.model.IncidentUserDefinedFieldUpdateRequest; +import com.datadog.api.client.v2.model.IncidentUserDefinedFieldValidValue; +import java.util.Collections; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.updateIncidentUserDefinedField", true); + IncidentsApi apiInstance = new IncidentsApi(defaultClient); + + IncidentUserDefinedFieldUpdateRequest body = + new IncidentUserDefinedFieldUpdateRequest() + .data( + new IncidentUserDefinedFieldUpdateData() + .attributes( + new IncidentUserDefinedFieldAttributesUpdateRequest() + .category(IncidentUserDefinedFieldCategory.WHAT_HAPPENED) + .collected(IncidentUserDefinedFieldCollected.ACTIVE) + .defaultValue("critical") + .displayName("Root Cause") + .ordinal("1.5") + .required(false) + .validValues( + Collections.singletonList( + new IncidentUserDefinedFieldValidValue() + .description("A critical severity incident.") + .displayName("Critical") + .shortDescription("Critical") + .value("critical")))) + .id("00000000-0000-0000-0000-000000000000") + .type(IncidentUserDefinedFieldType.USER_DEFINED_FIELD)); + + try { + IncidentUserDefinedFieldResponse result = + apiInstance.updateIncidentUserDefinedField("00000000-0000-0000-0000-000000000000", body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling IncidentsApi#updateIncidentUserDefinedField"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/src/main/java/com/datadog/api/client/ApiClient.java b/src/main/java/com/datadog/api/client/ApiClient.java index 154be7692e9..af5218151bf 100644 --- a/src/main/java/com/datadog/api/client/ApiClient.java +++ b/src/main/java/com/datadog/api/client/ApiClient.java @@ -839,6 +839,7 @@ public class ApiClient { put("v2.createIncidentPostmortemTemplate", false); put("v2.createIncidentTodo", false); put("v2.createIncidentType", false); + put("v2.createIncidentUserDefinedField", false); put("v2.deleteGlobalIncidentHandle", false); put("v2.deleteIncident", false); put("v2.deleteIncidentAttachment", false); @@ -848,6 +849,7 @@ public class ApiClient { put("v2.deleteIncidentPostmortemTemplate", false); put("v2.deleteIncidentTodo", false); put("v2.deleteIncidentType", false); + put("v2.deleteIncidentUserDefinedField", false); put("v2.getGlobalIncidentSettings", false); put("v2.getIncident", false); put("v2.getIncidentIntegration", false); @@ -856,7 +858,9 @@ public class ApiClient { put("v2.getIncidentPostmortemTemplate", false); put("v2.getIncidentTodo", false); put("v2.getIncidentType", false); + put("v2.getIncidentUserDefinedField", false); put("v2.importIncident", false); + put("v2.importIncidentUserDefinedFieldValues", false); put("v2.listGlobalIncidentHandles", false); put("v2.listIncidentAttachments", false); put("v2.listIncidentIntegrations", false); @@ -866,6 +870,7 @@ public class ApiClient { put("v2.listIncidents", false); put("v2.listIncidentTodos", false); put("v2.listIncidentTypes", false); + put("v2.listIncidentUserDefinedFields", false); put("v2.searchIncidents", false); put("v2.updateGlobalIncidentHandle", false); put("v2.updateGlobalIncidentSettings", false); @@ -877,6 +882,7 @@ public class ApiClient { put("v2.updateIncidentPostmortemTemplate", false); put("v2.updateIncidentTodo", false); put("v2.updateIncidentType", false); + put("v2.updateIncidentUserDefinedField", false); put("v2.createAWSAccountCCMConfig", false); put("v2.deleteAWSAccountCCMConfig", false); put("v2.getAWSAccountCCMConfig", false); diff --git a/src/main/java/com/datadog/api/client/v2/api/IncidentsApi.java b/src/main/java/com/datadog/api/client/v2/api/IncidentsApi.java index 1ca7db02399..4f1305a0342 100644 --- a/src/main/java/com/datadog/api/client/v2/api/IncidentsApi.java +++ b/src/main/java/com/datadog/api/client/v2/api/IncidentsApi.java @@ -46,6 +46,10 @@ import com.datadog.api.client.v2.model.IncidentTypePatchRequest; import com.datadog.api.client.v2.model.IncidentTypeResponse; import com.datadog.api.client.v2.model.IncidentUpdateRequest; +import com.datadog.api.client.v2.model.IncidentUserDefinedFieldCreateRequest; +import com.datadog.api.client.v2.model.IncidentUserDefinedFieldListResponse; +import com.datadog.api.client.v2.model.IncidentUserDefinedFieldResponse; +import com.datadog.api.client.v2.model.IncidentUserDefinedFieldUpdateRequest; import com.datadog.api.client.v2.model.IncidentsResponse; import com.datadog.api.client.v2.model.PatchAttachmentRequest; import com.datadog.api.client.v2.model.PatchIncidentNotificationTemplateRequest; @@ -56,6 +60,7 @@ import com.datadog.api.client.v2.model.PutIncidentNotificationRuleRequest; import jakarta.ws.rs.client.Invocation; import jakarta.ws.rs.core.GenericType; +import java.io.File; import java.util.ArrayList; import java.util.HashMap; import java.util.LinkedHashMap; @@ -2115,6 +2120,232 @@ public CompletableFuture> createIncidentTypeWi new GenericType() {}); } + /** Manage optional parameters to createIncidentUserDefinedField. */ + public static class CreateIncidentUserDefinedFieldOptionalParameters { + private String include; + + /** + * Set include. + * + * @param include Comma-separated list of related resources to include. Supported values are + * "last_modified_by_user", "created_by_user", and "incident_type". (optional) + * @return CreateIncidentUserDefinedFieldOptionalParameters + */ + public CreateIncidentUserDefinedFieldOptionalParameters include(String include) { + this.include = include; + return this; + } + } + + /** + * Create an incident user-defined field. + * + *

See {@link #createIncidentUserDefinedFieldWithHttpInfo}. + * + * @param body Incident user-defined field payload. (required) + * @return IncidentUserDefinedFieldResponse + * @throws ApiException if fails to make API call + */ + public IncidentUserDefinedFieldResponse createIncidentUserDefinedField( + IncidentUserDefinedFieldCreateRequest body) throws ApiException { + return createIncidentUserDefinedFieldWithHttpInfo( + body, new CreateIncidentUserDefinedFieldOptionalParameters()) + .getData(); + } + + /** + * Create an incident user-defined field. + * + *

See {@link #createIncidentUserDefinedFieldWithHttpInfoAsync}. + * + * @param body Incident user-defined field payload. (required) + * @return CompletableFuture<IncidentUserDefinedFieldResponse> + */ + public CompletableFuture createIncidentUserDefinedFieldAsync( + IncidentUserDefinedFieldCreateRequest body) { + return createIncidentUserDefinedFieldWithHttpInfoAsync( + body, new CreateIncidentUserDefinedFieldOptionalParameters()) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Create an incident user-defined field. + * + *

See {@link #createIncidentUserDefinedFieldWithHttpInfo}. + * + * @param body Incident user-defined field payload. (required) + * @param parameters Optional parameters for the request. + * @return IncidentUserDefinedFieldResponse + * @throws ApiException if fails to make API call + */ + public IncidentUserDefinedFieldResponse createIncidentUserDefinedField( + IncidentUserDefinedFieldCreateRequest body, + CreateIncidentUserDefinedFieldOptionalParameters parameters) + throws ApiException { + return createIncidentUserDefinedFieldWithHttpInfo(body, parameters).getData(); + } + + /** + * Create an incident user-defined field. + * + *

See {@link #createIncidentUserDefinedFieldWithHttpInfoAsync}. + * + * @param body Incident user-defined field payload. (required) + * @param parameters Optional parameters for the request. + * @return CompletableFuture<IncidentUserDefinedFieldResponse> + */ + public CompletableFuture createIncidentUserDefinedFieldAsync( + IncidentUserDefinedFieldCreateRequest body, + CreateIncidentUserDefinedFieldOptionalParameters parameters) { + return createIncidentUserDefinedFieldWithHttpInfoAsync(body, parameters) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Create an incident user-defined field. + * + * @param body Incident user-defined field payload. (required) + * @param parameters Optional parameters for the request. + * @return ApiResponse<IncidentUserDefinedFieldResponse> + * @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 createIncidentUserDefinedFieldWithHttpInfo( + IncidentUserDefinedFieldCreateRequest body, + CreateIncidentUserDefinedFieldOptionalParameters parameters) + throws ApiException { + // Check if unstable operation is enabled + String operationId = "createIncidentUserDefinedField"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = body; + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException( + 400, "Missing the required parameter 'body' when calling createIncidentUserDefinedField"); + } + String include = parameters.include; + // create path and map variables + String localVarPath = "/api/v2/incidents/config/user-defined-fields"; + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "include", include)); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.IncidentsApi.createIncidentUserDefinedField", + localVarPath, + localVarQueryParams, + 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 an incident user-defined field. + * + *

See {@link #createIncidentUserDefinedFieldWithHttpInfo}. + * + * @param body Incident user-defined field payload. (required) + * @param parameters Optional parameters for the request. + * @return CompletableFuture<ApiResponse<IncidentUserDefinedFieldResponse>> + */ + public CompletableFuture> + createIncidentUserDefinedFieldWithHttpInfoAsync( + IncidentUserDefinedFieldCreateRequest body, + CreateIncidentUserDefinedFieldOptionalParameters parameters) { + // Check if unstable operation is enabled + String operationId = "createIncidentUserDefinedField"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = body; + + // verify the required parameter 'body' is set + if (body == null) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'body' when calling createIncidentUserDefinedField")); + return result; + } + String include = parameters.include; + // create path and map variables + String localVarPath = "/api/v2/incidents/config/user-defined-fields"; + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "include", include)); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.IncidentsApi.createIncidentUserDefinedField", + localVarPath, + localVarQueryParams, + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + } catch (ApiException ex) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "POST", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + /** * Delete global incident handle. * @@ -3849,26 +4080,27 @@ public CompletableFuture> deleteIncidentTypeWithHttpInfoAsync( } /** - * Get global incident settings. + * Delete an incident user-defined field. * - *

See {@link #getGlobalIncidentSettingsWithHttpInfo}. + *

See {@link #deleteIncidentUserDefinedFieldWithHttpInfo}. * - * @return GlobalIncidentSettingsResponse + * @param fieldId The ID of the incident user-defined field. (required) * @throws ApiException if fails to make API call */ - public GlobalIncidentSettingsResponse getGlobalIncidentSettings() throws ApiException { - return getGlobalIncidentSettingsWithHttpInfo().getData(); + public void deleteIncidentUserDefinedField(String fieldId) throws ApiException { + deleteIncidentUserDefinedFieldWithHttpInfo(fieldId); } /** - * Get global incident settings. + * Delete an incident user-defined field. * - *

See {@link #getGlobalIncidentSettingsWithHttpInfoAsync}. + *

See {@link #deleteIncidentUserDefinedFieldWithHttpInfoAsync}. * - * @return CompletableFuture<GlobalIncidentSettingsResponse> + * @param fieldId The ID of the incident user-defined field. (required) + * @return CompletableFuture */ - public CompletableFuture getGlobalIncidentSettingsAsync() { - return getGlobalIncidentSettingsWithHttpInfoAsync() + public CompletableFuture deleteIncidentUserDefinedFieldAsync(String fieldId) { + return deleteIncidentUserDefinedFieldWithHttpInfoAsync(fieldId) .thenApply( response -> { return response.getData(); @@ -3876,77 +4108,103 @@ public CompletableFuture getGlobalIncidentSettin } /** - * Retrieve global incident settings for the organization. + * Delete an incident user-defined field. * - * @return ApiResponse<GlobalIncidentSettingsResponse> + * @param fieldId The ID of the incident user-defined field. (required) + * @return ApiResponse<Void> * @throws ApiException if fails to make API call * @http.response.details * * * - * + * * + * + * + * * *
Response details
Status Code Description Response Headers
200 OK -
204 No Content -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
404 Not Found -
429 Too many requests -
*/ - public ApiResponse getGlobalIncidentSettingsWithHttpInfo() + public ApiResponse deleteIncidentUserDefinedFieldWithHttpInfo(String fieldId) throws ApiException { // Check if unstable operation is enabled - String operationId = "getGlobalIncidentSettings"; + String operationId = "deleteIncidentUserDefinedField"; if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); } else { throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); } Object localVarPostBody = null; + + // verify the required parameter 'fieldId' is set + if (fieldId == null) { + throw new ApiException( + 400, + "Missing the required parameter 'fieldId' when calling deleteIncidentUserDefinedField"); + } // create path and map variables - String localVarPath = "/api/v2/incidents/config/global/settings"; + String localVarPath = + "/api/v2/incidents/config/user-defined-fields/{field_id}" + .replaceAll("\\{" + "field_id" + "\\}", apiClient.escapeString(fieldId.toString())); Map localVarHeaderParams = new HashMap(); Invocation.Builder builder = apiClient.createBuilder( - "v2.IncidentsApi.getGlobalIncidentSettings", + "v2.IncidentsApi.deleteIncidentUserDefinedField", localVarPath, new ArrayList(), localVarHeaderParams, new HashMap(), - new String[] {"application/json"}, - new String[] {"apiKeyAuth", "appKeyAuth"}); + new String[] {"*/*"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); return apiClient.invokeAPI( - "GET", + "DELETE", builder, localVarHeaderParams, new String[] {}, localVarPostBody, new HashMap(), false, - new GenericType() {}); + null); } /** - * Get global incident settings. + * Delete an incident user-defined field. * - *

See {@link #getGlobalIncidentSettingsWithHttpInfo}. + *

See {@link #deleteIncidentUserDefinedFieldWithHttpInfo}. * - * @return CompletableFuture<ApiResponse<GlobalIncidentSettingsResponse>> + * @param fieldId The ID of the incident user-defined field. (required) + * @return CompletableFuture<ApiResponse<Void>> */ - public CompletableFuture> - getGlobalIncidentSettingsWithHttpInfoAsync() { + public CompletableFuture> deleteIncidentUserDefinedFieldWithHttpInfoAsync( + String fieldId) { // Check if unstable operation is enabled - String operationId = "getGlobalIncidentSettings"; + String operationId = "deleteIncidentUserDefinedField"; if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); } else { - CompletableFuture> result = - new CompletableFuture<>(); + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); return result; } Object localVarPostBody = null; + + // verify the required parameter 'fieldId' is set + if (fieldId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'fieldId' when calling" + + " deleteIncidentUserDefinedField")); + return result; + } // create path and map variables - String localVarPath = "/api/v2/incidents/config/global/settings"; + String localVarPath = + "/api/v2/incidents/config/user-defined-fields/{field_id}" + .replaceAll("\\{" + "field_id" + "\\}", apiClient.escapeString(fieldId.toString())); Map localVarHeaderParams = new HashMap(); @@ -3954,58 +4212,187 @@ public ApiResponse getGlobalIncidentSettingsWith try { builder = apiClient.createBuilder( - "v2.IncidentsApi.getGlobalIncidentSettings", + "v2.IncidentsApi.deleteIncidentUserDefinedField", localVarPath, new ArrayList(), localVarHeaderParams, new HashMap(), - new String[] {"application/json"}, - new String[] {"apiKeyAuth", "appKeyAuth"}); + new String[] {"*/*"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); } catch (ApiException ex) { - CompletableFuture> result = - new CompletableFuture<>(); + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally(ex); return result; } return apiClient.invokeAPIAsync( - "GET", + "DELETE", builder, localVarHeaderParams, new String[] {}, localVarPostBody, new HashMap(), false, - new GenericType() {}); - } - - /** Manage optional parameters to getIncident. */ - public static class GetIncidentOptionalParameters { - private List include; - - /** - * Set include. - * - * @param include Specifies which types of related objects should be included in the response. - * (optional) - * @return GetIncidentOptionalParameters - */ - public GetIncidentOptionalParameters include(List include) { - this.include = include; - return this; - } + null); } /** - * Get the details of an incident. + * Get global incident settings. * - *

See {@link #getIncidentWithHttpInfo}. + *

See {@link #getGlobalIncidentSettingsWithHttpInfo}. * - * @param incidentId The UUID of the incident. (required) - * @return IncidentResponse + * @return GlobalIncidentSettingsResponse * @throws ApiException if fails to make API call */ - public IncidentResponse getIncident(String incidentId) throws ApiException { - return getIncidentWithHttpInfo(incidentId, new GetIncidentOptionalParameters()).getData(); + public GlobalIncidentSettingsResponse getGlobalIncidentSettings() throws ApiException { + return getGlobalIncidentSettingsWithHttpInfo().getData(); + } + + /** + * Get global incident settings. + * + *

See {@link #getGlobalIncidentSettingsWithHttpInfoAsync}. + * + * @return CompletableFuture<GlobalIncidentSettingsResponse> + */ + public CompletableFuture getGlobalIncidentSettingsAsync() { + return getGlobalIncidentSettingsWithHttpInfoAsync() + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Retrieve global incident settings for the organization. + * + * @return ApiResponse<GlobalIncidentSettingsResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
429 Too many requests -
+ */ + public ApiResponse getGlobalIncidentSettingsWithHttpInfo() + throws ApiException { + // Check if unstable operation is enabled + String operationId = "getGlobalIncidentSettings"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = null; + // create path and map variables + String localVarPath = "/api/v2/incidents/config/global/settings"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.IncidentsApi.getGlobalIncidentSettings", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Get global incident settings. + * + *

See {@link #getGlobalIncidentSettingsWithHttpInfo}. + * + * @return CompletableFuture<ApiResponse<GlobalIncidentSettingsResponse>> + */ + public CompletableFuture> + getGlobalIncidentSettingsWithHttpInfoAsync() { + // Check if unstable operation is enabled + String operationId = "getGlobalIncidentSettings"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = null; + // create path and map variables + String localVarPath = "/api/v2/incidents/config/global/settings"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.IncidentsApi.getGlobalIncidentSettings", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** Manage optional parameters to getIncident. */ + public static class GetIncidentOptionalParameters { + private List include; + + /** + * Set include. + * + * @param include Specifies which types of related objects should be included in the response. + * (optional) + * @return GetIncidentOptionalParameters + */ + public GetIncidentOptionalParameters include(List include) { + this.include = include; + return this; + } + } + + /** + * Get the details of an incident. + * + *

See {@link #getIncidentWithHttpInfo}. + * + * @param incidentId The UUID of the incident. (required) + * @return IncidentResponse + * @throws ApiException if fails to make API call + */ + public IncidentResponse getIncident(String incidentId) throws ApiException { + return getIncidentWithHttpInfo(incidentId, new GetIncidentOptionalParameters()).getData(); } /** @@ -5325,6 +5712,231 @@ public CompletableFuture> getIncidentTypeWithH new GenericType() {}); } + /** Manage optional parameters to getIncidentUserDefinedField. */ + public static class GetIncidentUserDefinedFieldOptionalParameters { + private String include; + + /** + * Set include. + * + * @param include Comma-separated list of related resources to include. Supported values are + * "last_modified_by_user", "created_by_user", and "incident_type". (optional) + * @return GetIncidentUserDefinedFieldOptionalParameters + */ + public GetIncidentUserDefinedFieldOptionalParameters include(String include) { + this.include = include; + return this; + } + } + + /** + * Get an incident user-defined field. + * + *

See {@link #getIncidentUserDefinedFieldWithHttpInfo}. + * + * @param fieldId The ID of the incident user-defined field. (required) + * @return IncidentUserDefinedFieldResponse + * @throws ApiException if fails to make API call + */ + public IncidentUserDefinedFieldResponse getIncidentUserDefinedField(String fieldId) + throws ApiException { + return getIncidentUserDefinedFieldWithHttpInfo( + fieldId, new GetIncidentUserDefinedFieldOptionalParameters()) + .getData(); + } + + /** + * Get an incident user-defined field. + * + *

See {@link #getIncidentUserDefinedFieldWithHttpInfoAsync}. + * + * @param fieldId The ID of the incident user-defined field. (required) + * @return CompletableFuture<IncidentUserDefinedFieldResponse> + */ + public CompletableFuture getIncidentUserDefinedFieldAsync( + String fieldId) { + return getIncidentUserDefinedFieldWithHttpInfoAsync( + fieldId, new GetIncidentUserDefinedFieldOptionalParameters()) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Get an incident user-defined field. + * + *

See {@link #getIncidentUserDefinedFieldWithHttpInfo}. + * + * @param fieldId The ID of the incident user-defined field. (required) + * @param parameters Optional parameters for the request. + * @return IncidentUserDefinedFieldResponse + * @throws ApiException if fails to make API call + */ + public IncidentUserDefinedFieldResponse getIncidentUserDefinedField( + String fieldId, GetIncidentUserDefinedFieldOptionalParameters parameters) + throws ApiException { + return getIncidentUserDefinedFieldWithHttpInfo(fieldId, parameters).getData(); + } + + /** + * Get an incident user-defined field. + * + *

See {@link #getIncidentUserDefinedFieldWithHttpInfoAsync}. + * + * @param fieldId The ID of the incident user-defined field. (required) + * @param parameters Optional parameters for the request. + * @return CompletableFuture<IncidentUserDefinedFieldResponse> + */ + public CompletableFuture getIncidentUserDefinedFieldAsync( + String fieldId, GetIncidentUserDefinedFieldOptionalParameters parameters) { + return getIncidentUserDefinedFieldWithHttpInfoAsync(fieldId, parameters) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Get details of an incident user-defined field. + * + * @param fieldId The ID of the incident user-defined field. (required) + * @param parameters Optional parameters for the request. + * @return ApiResponse<IncidentUserDefinedFieldResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
401 Unauthorized -
403 Forbidden -
404 Not Found -
429 Too many requests -
+ */ + public ApiResponse getIncidentUserDefinedFieldWithHttpInfo( + String fieldId, GetIncidentUserDefinedFieldOptionalParameters parameters) + throws ApiException { + // Check if unstable operation is enabled + String operationId = "getIncidentUserDefinedField"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = null; + + // verify the required parameter 'fieldId' is set + if (fieldId == null) { + throw new ApiException( + 400, "Missing the required parameter 'fieldId' when calling getIncidentUserDefinedField"); + } + String include = parameters.include; + // create path and map variables + String localVarPath = + "/api/v2/incidents/config/user-defined-fields/{field_id}" + .replaceAll("\\{" + "field_id" + "\\}", apiClient.escapeString(fieldId.toString())); + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "include", include)); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.IncidentsApi.getIncidentUserDefinedField", + localVarPath, + localVarQueryParams, + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + return apiClient.invokeAPI( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Get an incident user-defined field. + * + *

See {@link #getIncidentUserDefinedFieldWithHttpInfo}. + * + * @param fieldId The ID of the incident user-defined field. (required) + * @param parameters Optional parameters for the request. + * @return CompletableFuture<ApiResponse<IncidentUserDefinedFieldResponse>> + */ + public CompletableFuture> + getIncidentUserDefinedFieldWithHttpInfoAsync( + String fieldId, GetIncidentUserDefinedFieldOptionalParameters parameters) { + // Check if unstable operation is enabled + String operationId = "getIncidentUserDefinedField"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = null; + + // verify the required parameter 'fieldId' is set + if (fieldId == null) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'fieldId' when calling getIncidentUserDefinedField")); + return result; + } + String include = parameters.include; + // create path and map variables + String localVarPath = + "/api/v2/incidents/config/user-defined-fields/{field_id}" + .replaceAll("\\{" + "field_id" + "\\}", apiClient.escapeString(fieldId.toString())); + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "include", include)); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.IncidentsApi.getIncidentUserDefinedField", + localVarPath, + localVarQueryParams, + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + } catch (ApiException ex) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + /** Manage optional parameters to importIncident. */ public static class ImportIncidentOptionalParameters { private List include; @@ -5387,17 +5999,250 @@ public IncidentImportResponse importIncident( } /** - * Import an incident. + * Import an incident. + * + *

See {@link #importIncidentWithHttpInfoAsync}. + * + * @param body Incident import payload. (required) + * @param parameters Optional parameters for the request. + * @return CompletableFuture<IncidentImportResponse> + */ + public CompletableFuture importIncidentAsync( + IncidentImportRequest body, ImportIncidentOptionalParameters parameters) { + return importIncidentWithHttpInfoAsync(body, parameters) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Import an incident from an external system. This endpoint allows you to create incidents with + * historical data such as custom timestamps for detection, declaration, and resolution. Imported + * incidents do not execute integrations or notification rules. + * + * @param body Incident import payload. (required) + * @param parameters Optional parameters for the request. + * @return ApiResponse<IncidentImportResponse> + * @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 importIncidentWithHttpInfo( + IncidentImportRequest body, ImportIncidentOptionalParameters parameters) throws ApiException { + // Check if unstable operation is enabled + String operationId = "importIncident"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = body; + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException( + 400, "Missing the required parameter 'body' when calling importIncident"); + } + List include = parameters.include; + // create path and map variables + String localVarPath = "/api/v2/incidents/import"; + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("csv", "include", include)); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.IncidentsApi.importIncident", + localVarPath, + localVarQueryParams, + 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() {}); + } + + /** + * Import an incident. + * + *

See {@link #importIncidentWithHttpInfo}. + * + * @param body Incident import payload. (required) + * @param parameters Optional parameters for the request. + * @return CompletableFuture<ApiResponse<IncidentImportResponse>> + */ + public CompletableFuture> importIncidentWithHttpInfoAsync( + IncidentImportRequest body, ImportIncidentOptionalParameters parameters) { + // Check if unstable operation is enabled + String operationId = "importIncident"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = body; + + // verify the required parameter 'body' is set + if (body == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'body' when calling importIncident")); + return result; + } + List include = parameters.include; + // create path and map variables + String localVarPath = "/api/v2/incidents/import"; + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("csv", "include", include)); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.IncidentsApi.importIncident", + localVarPath, + localVarQueryParams, + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "POST", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** Manage optional parameters to importIncidentUserDefinedFieldValues. */ + public static class ImportIncidentUserDefinedFieldValuesOptionalParameters { + private File file; + private String replaceValues; + + /** + * Set file. + * + * @param file A CSV file where each distinct value in the first column is imported as a valid + * value. (optional) + * @return ImportIncidentUserDefinedFieldValuesOptionalParameters + */ + public ImportIncidentUserDefinedFieldValuesOptionalParameters file(File file) { + this.file = file; + return this; + } + + /** + * Set replaceValues. + * + * @param replaceValues When "true", "True", or "1", replaces all existing valid values with the + * imported values. Otherwise, appends the imported values to the existing list. (optional) + * @return ImportIncidentUserDefinedFieldValuesOptionalParameters + */ + public ImportIncidentUserDefinedFieldValuesOptionalParameters replaceValues( + String replaceValues) { + this.replaceValues = replaceValues; + return this; + } + } + + /** + * Import values for an incident user-defined field. + * + *

See {@link #importIncidentUserDefinedFieldValuesWithHttpInfo}. + * + * @param fieldId The ID of the incident user-defined field. (required) + * @return IncidentUserDefinedFieldResponse + * @throws ApiException if fails to make API call + */ + public IncidentUserDefinedFieldResponse importIncidentUserDefinedFieldValues(String fieldId) + throws ApiException { + return importIncidentUserDefinedFieldValuesWithHttpInfo( + fieldId, new ImportIncidentUserDefinedFieldValuesOptionalParameters()) + .getData(); + } + + /** + * Import values for an incident user-defined field. + * + *

See {@link #importIncidentUserDefinedFieldValuesWithHttpInfoAsync}. + * + * @param fieldId The ID of the incident user-defined field. (required) + * @return CompletableFuture<IncidentUserDefinedFieldResponse> + */ + public CompletableFuture + importIncidentUserDefinedFieldValuesAsync(String fieldId) { + return importIncidentUserDefinedFieldValuesWithHttpInfoAsync( + fieldId, new ImportIncidentUserDefinedFieldValuesOptionalParameters()) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Import values for an incident user-defined field. + * + *

See {@link #importIncidentUserDefinedFieldValuesWithHttpInfo}. + * + * @param fieldId The ID of the incident user-defined field. (required) + * @param parameters Optional parameters for the request. + * @return IncidentUserDefinedFieldResponse + * @throws ApiException if fails to make API call + */ + public IncidentUserDefinedFieldResponse importIncidentUserDefinedFieldValues( + String fieldId, ImportIncidentUserDefinedFieldValuesOptionalParameters parameters) + throws ApiException { + return importIncidentUserDefinedFieldValuesWithHttpInfo(fieldId, parameters).getData(); + } + + /** + * Import values for an incident user-defined field. * - *

See {@link #importIncidentWithHttpInfoAsync}. + *

See {@link #importIncidentUserDefinedFieldValuesWithHttpInfoAsync}. * - * @param body Incident import payload. (required) + * @param fieldId The ID of the incident user-defined field. (required) * @param parameters Optional parameters for the request. - * @return CompletableFuture<IncidentImportResponse> + * @return CompletableFuture<IncidentUserDefinedFieldResponse> */ - public CompletableFuture importIncidentAsync( - IncidentImportRequest body, ImportIncidentOptionalParameters parameters) { - return importIncidentWithHttpInfoAsync(body, parameters) + public CompletableFuture + importIncidentUserDefinedFieldValuesAsync( + String fieldId, ImportIncidentUserDefinedFieldValuesOptionalParameters parameters) { + return importIncidentUserDefinedFieldValuesWithHttpInfoAsync(fieldId, parameters) .thenApply( response -> { return response.getData(); @@ -5405,13 +6250,12 @@ public CompletableFuture importIncidentAsync( } /** - * Import an incident from an external system. This endpoint allows you to create incidents with - * historical data such as custom timestamps for detection, declaration, and resolution. Imported - * incidents do not execute integrations or notification rules. + * Import valid values for an incident user-defined field from a CSV file. Only supported for + * dropdown, multiselect, and autocomplete field types. * - * @param body Incident import payload. (required) + * @param fieldId The ID of the incident user-defined field. (required) * @param parameters Optional parameters for the request. - * @return ApiResponse<IncidentImportResponse> + * @return ApiResponse<IncidentUserDefinedFieldResponse> * @throws ApiException if fails to make API call * @http.response.details * @@ -5425,34 +6269,45 @@ public CompletableFuture importIncidentAsync( * *
429 Too many requests -
*/ - public ApiResponse importIncidentWithHttpInfo( - IncidentImportRequest body, ImportIncidentOptionalParameters parameters) throws ApiException { + public ApiResponse + importIncidentUserDefinedFieldValuesWithHttpInfo( + String fieldId, ImportIncidentUserDefinedFieldValuesOptionalParameters parameters) + throws ApiException { // Check if unstable operation is enabled - String operationId = "importIncident"; + String operationId = "importIncidentUserDefinedFieldValues"; if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); } else { throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); } - Object localVarPostBody = body; + Object localVarPostBody = null; - // verify the required parameter 'body' is set - if (body == null) { + // verify the required parameter 'fieldId' is set + if (fieldId == null) { throw new ApiException( - 400, "Missing the required parameter 'body' when calling importIncident"); + 400, + "Missing the required parameter 'fieldId' when calling" + + " importIncidentUserDefinedFieldValues"); } - List include = parameters.include; + File file = parameters.file; + String replaceValues = parameters.replaceValues; // create path and map variables - String localVarPath = "/api/v2/incidents/import"; + String localVarPath = + "/api/v2/incidents/config/fields/{field_id}/values/import" + .replaceAll("\\{" + "field_id" + "\\}", apiClient.escapeString(fieldId.toString())); List localVarQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); + Map localVarFormParams = new HashMap(); - localVarQueryParams.addAll(apiClient.parameterToPairs("csv", "include", include)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "replace_values", replaceValues)); + if (file != null) { + localVarFormParams.put("file", file); + } Invocation.Builder builder = apiClient.createBuilder( - "v2.IncidentsApi.importIncident", + "v2.IncidentsApi.importIncidentUserDefinedFieldValues", localVarPath, localVarQueryParams, localVarHeaderParams, @@ -5463,58 +6318,70 @@ public ApiResponse importIncidentWithHttpInfo( "POST", builder, localVarHeaderParams, - new String[] {"application/json"}, + new String[] {"multipart/form-data"}, localVarPostBody, - new HashMap(), + localVarFormParams, false, - new GenericType() {}); + new GenericType() {}); } /** - * Import an incident. + * Import values for an incident user-defined field. * - *

See {@link #importIncidentWithHttpInfo}. + *

See {@link #importIncidentUserDefinedFieldValuesWithHttpInfo}. * - * @param body Incident import payload. (required) + * @param fieldId The ID of the incident user-defined field. (required) * @param parameters Optional parameters for the request. - * @return CompletableFuture<ApiResponse<IncidentImportResponse>> + * @return CompletableFuture<ApiResponse<IncidentUserDefinedFieldResponse>> */ - public CompletableFuture> importIncidentWithHttpInfoAsync( - IncidentImportRequest body, ImportIncidentOptionalParameters parameters) { + public CompletableFuture> + importIncidentUserDefinedFieldValuesWithHttpInfoAsync( + String fieldId, ImportIncidentUserDefinedFieldValuesOptionalParameters parameters) { // Check if unstable operation is enabled - String operationId = "importIncident"; + String operationId = "importIncidentUserDefinedFieldValues"; if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); } else { - CompletableFuture> result = new CompletableFuture<>(); + CompletableFuture> result = + new CompletableFuture<>(); result.completeExceptionally( new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); return result; } - Object localVarPostBody = body; + Object localVarPostBody = null; - // verify the required parameter 'body' is set - if (body == null) { - CompletableFuture> result = new CompletableFuture<>(); + // verify the required parameter 'fieldId' is set + if (fieldId == null) { + CompletableFuture> result = + new CompletableFuture<>(); result.completeExceptionally( new ApiException( - 400, "Missing the required parameter 'body' when calling importIncident")); + 400, + "Missing the required parameter 'fieldId' when calling" + + " importIncidentUserDefinedFieldValues")); return result; } - List include = parameters.include; + File file = parameters.file; + String replaceValues = parameters.replaceValues; // create path and map variables - String localVarPath = "/api/v2/incidents/import"; + String localVarPath = + "/api/v2/incidents/config/fields/{field_id}/values/import" + .replaceAll("\\{" + "field_id" + "\\}", apiClient.escapeString(fieldId.toString())); List localVarQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); + Map localVarFormParams = new HashMap(); - localVarQueryParams.addAll(apiClient.parameterToPairs("csv", "include", include)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "replace_values", replaceValues)); + if (file != null) { + localVarFormParams.put("file", file); + } Invocation.Builder builder; try { builder = apiClient.createBuilder( - "v2.IncidentsApi.importIncident", + "v2.IncidentsApi.importIncidentUserDefinedFieldValues", localVarPath, localVarQueryParams, localVarHeaderParams, @@ -5522,7 +6389,8 @@ public CompletableFuture> importIncidentWith new String[] {"application/json"}, new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); } catch (ApiException ex) { - CompletableFuture> result = new CompletableFuture<>(); + CompletableFuture> result = + new CompletableFuture<>(); result.completeExceptionally(ex); return result; } @@ -5530,11 +6398,11 @@ public CompletableFuture> importIncidentWith "POST", builder, localVarHeaderParams, - new String[] {"application/json"}, + new String[] {"multipart/form-data"}, localVarPostBody, - new HashMap(), + localVarFormParams, false, - new GenericType() {}); + new GenericType() {}); } /** Manage optional parameters to listGlobalIncidentHandles. */ @@ -7310,37 +8178,281 @@ public static class ListIncidentTypesOptionalParameters { /** * Set includeDeleted. * - * @param includeDeleted Include deleted incident types in the response. (optional, default to - * false) - * @return ListIncidentTypesOptionalParameters + * @param includeDeleted Include deleted incident types in the response. (optional, default to + * false) + * @return ListIncidentTypesOptionalParameters + */ + public ListIncidentTypesOptionalParameters includeDeleted(Boolean includeDeleted) { + this.includeDeleted = includeDeleted; + return this; + } + } + + /** + * Get a list of incident types. + * + *

See {@link #listIncidentTypesWithHttpInfo}. + * + * @return IncidentTypeListResponse + * @throws ApiException if fails to make API call + */ + public IncidentTypeListResponse listIncidentTypes() throws ApiException { + return listIncidentTypesWithHttpInfo(new ListIncidentTypesOptionalParameters()).getData(); + } + + /** + * Get a list of incident types. + * + *

See {@link #listIncidentTypesWithHttpInfoAsync}. + * + * @return CompletableFuture<IncidentTypeListResponse> + */ + public CompletableFuture listIncidentTypesAsync() { + return listIncidentTypesWithHttpInfoAsync(new ListIncidentTypesOptionalParameters()) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Get a list of incident types. + * + *

See {@link #listIncidentTypesWithHttpInfo}. + * + * @param parameters Optional parameters for the request. + * @return IncidentTypeListResponse + * @throws ApiException if fails to make API call + */ + public IncidentTypeListResponse listIncidentTypes(ListIncidentTypesOptionalParameters parameters) + throws ApiException { + return listIncidentTypesWithHttpInfo(parameters).getData(); + } + + /** + * Get a list of incident types. + * + *

See {@link #listIncidentTypesWithHttpInfoAsync}. + * + * @param parameters Optional parameters for the request. + * @return CompletableFuture<IncidentTypeListResponse> + */ + public CompletableFuture listIncidentTypesAsync( + ListIncidentTypesOptionalParameters parameters) { + return listIncidentTypesWithHttpInfoAsync(parameters) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Get all incident types. + * + * @param parameters Optional parameters for the request. + * @return ApiResponse<IncidentTypeListResponse> + * @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 -
429 Too many requests -
+ */ + public ApiResponse listIncidentTypesWithHttpInfo( + ListIncidentTypesOptionalParameters parameters) throws ApiException { + // Check if unstable operation is enabled + String operationId = "listIncidentTypes"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = null; + Boolean includeDeleted = parameters.includeDeleted; + // create path and map variables + String localVarPath = "/api/v2/incidents/config/types"; + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "include_deleted", includeDeleted)); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.IncidentsApi.listIncidentTypes", + localVarPath, + localVarQueryParams, + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + return apiClient.invokeAPI( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Get a list of incident types. + * + *

See {@link #listIncidentTypesWithHttpInfo}. + * + * @param parameters Optional parameters for the request. + * @return CompletableFuture<ApiResponse<IncidentTypeListResponse>> + */ + public CompletableFuture> + listIncidentTypesWithHttpInfoAsync(ListIncidentTypesOptionalParameters parameters) { + // Check if unstable operation is enabled + String operationId = "listIncidentTypes"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = null; + Boolean includeDeleted = parameters.includeDeleted; + // create path and map variables + String localVarPath = "/api/v2/incidents/config/types"; + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "include_deleted", includeDeleted)); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.IncidentsApi.listIncidentTypes", + localVarPath, + localVarQueryParams, + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** Manage optional parameters to listIncidentUserDefinedFields. */ + public static class ListIncidentUserDefinedFieldsOptionalParameters { + private Long pageSize; + private Long pageNumber; + private Boolean includeDeleted; + private String filterIncidentType; + private String include; + + /** + * Set pageSize. + * + * @param pageSize The number of results to return per page. Must be between 0 and 1000. + * (optional, default to 1000) + * @return ListIncidentUserDefinedFieldsOptionalParameters + */ + public ListIncidentUserDefinedFieldsOptionalParameters pageSize(Long pageSize) { + this.pageSize = pageSize; + return this; + } + + /** + * Set pageNumber. + * + * @param pageNumber The page number to retrieve, starting at 0. (optional, default to 0) + * @return ListIncidentUserDefinedFieldsOptionalParameters + */ + public ListIncidentUserDefinedFieldsOptionalParameters pageNumber(Long pageNumber) { + this.pageNumber = pageNumber; + return this; + } + + /** + * Set includeDeleted. + * + * @param includeDeleted When true, include soft-deleted fields in the response. (optional, + * default to false) + * @return ListIncidentUserDefinedFieldsOptionalParameters */ - public ListIncidentTypesOptionalParameters includeDeleted(Boolean includeDeleted) { + public ListIncidentUserDefinedFieldsOptionalParameters includeDeleted(Boolean includeDeleted) { this.includeDeleted = includeDeleted; return this; } + + /** + * Set filterIncidentType. + * + * @param filterIncidentType Filter results to fields associated with the given incident type + * UUID. (optional) + * @return ListIncidentUserDefinedFieldsOptionalParameters + */ + public ListIncidentUserDefinedFieldsOptionalParameters filterIncidentType( + String filterIncidentType) { + this.filterIncidentType = filterIncidentType; + return this; + } + + /** + * Set include. + * + * @param include Comma-separated list of related resources to include. Supported values are + * "last_modified_by_user", "created_by_user", and "incident_type". (optional) + * @return ListIncidentUserDefinedFieldsOptionalParameters + */ + public ListIncidentUserDefinedFieldsOptionalParameters include(String include) { + this.include = include; + return this; + } } /** - * Get a list of incident types. + * Get a list of incident user-defined fields. * - *

See {@link #listIncidentTypesWithHttpInfo}. + *

See {@link #listIncidentUserDefinedFieldsWithHttpInfo}. * - * @return IncidentTypeListResponse + * @return IncidentUserDefinedFieldListResponse * @throws ApiException if fails to make API call */ - public IncidentTypeListResponse listIncidentTypes() throws ApiException { - return listIncidentTypesWithHttpInfo(new ListIncidentTypesOptionalParameters()).getData(); + public IncidentUserDefinedFieldListResponse listIncidentUserDefinedFields() throws ApiException { + return listIncidentUserDefinedFieldsWithHttpInfo( + new ListIncidentUserDefinedFieldsOptionalParameters()) + .getData(); } /** - * Get a list of incident types. + * Get a list of incident user-defined fields. * - *

See {@link #listIncidentTypesWithHttpInfoAsync}. + *

See {@link #listIncidentUserDefinedFieldsWithHttpInfoAsync}. * - * @return CompletableFuture<IncidentTypeListResponse> + * @return CompletableFuture<IncidentUserDefinedFieldListResponse> */ - public CompletableFuture listIncidentTypesAsync() { - return listIncidentTypesWithHttpInfoAsync(new ListIncidentTypesOptionalParameters()) + public CompletableFuture + listIncidentUserDefinedFieldsAsync() { + return listIncidentUserDefinedFieldsWithHttpInfoAsync( + new ListIncidentUserDefinedFieldsOptionalParameters()) .thenApply( response -> { return response.getData(); @@ -7348,30 +8460,30 @@ public CompletableFuture listIncidentTypesAsync() { } /** - * Get a list of incident types. + * Get a list of incident user-defined fields. * - *

See {@link #listIncidentTypesWithHttpInfo}. + *

See {@link #listIncidentUserDefinedFieldsWithHttpInfo}. * * @param parameters Optional parameters for the request. - * @return IncidentTypeListResponse + * @return IncidentUserDefinedFieldListResponse * @throws ApiException if fails to make API call */ - public IncidentTypeListResponse listIncidentTypes(ListIncidentTypesOptionalParameters parameters) - throws ApiException { - return listIncidentTypesWithHttpInfo(parameters).getData(); + public IncidentUserDefinedFieldListResponse listIncidentUserDefinedFields( + ListIncidentUserDefinedFieldsOptionalParameters parameters) throws ApiException { + return listIncidentUserDefinedFieldsWithHttpInfo(parameters).getData(); } /** - * Get a list of incident types. + * Get a list of incident user-defined fields. * - *

See {@link #listIncidentTypesWithHttpInfoAsync}. + *

See {@link #listIncidentUserDefinedFieldsWithHttpInfoAsync}. * * @param parameters Optional parameters for the request. - * @return CompletableFuture<IncidentTypeListResponse> + * @return CompletableFuture<IncidentUserDefinedFieldListResponse> */ - public CompletableFuture listIncidentTypesAsync( - ListIncidentTypesOptionalParameters parameters) { - return listIncidentTypesWithHttpInfoAsync(parameters) + public CompletableFuture listIncidentUserDefinedFieldsAsync( + ListIncidentUserDefinedFieldsOptionalParameters parameters) { + return listIncidentUserDefinedFieldsWithHttpInfoAsync(parameters) .thenApply( response -> { return response.getData(); @@ -7379,10 +8491,10 @@ public CompletableFuture listIncidentTypesAsync( } /** - * Get all incident types. + * Get a list of all incident user-defined fields. * * @param parameters Optional parameters for the request. - * @return ApiResponse<IncidentTypeListResponse> + * @return ApiResponse<IncidentUserDefinedFieldListResponse> * @throws ApiException if fails to make API call * @http.response.details * @@ -7395,28 +8507,38 @@ public CompletableFuture listIncidentTypesAsync( * *
429 Too many requests -
*/ - public ApiResponse listIncidentTypesWithHttpInfo( - ListIncidentTypesOptionalParameters parameters) throws ApiException { + public ApiResponse + listIncidentUserDefinedFieldsWithHttpInfo( + ListIncidentUserDefinedFieldsOptionalParameters parameters) throws ApiException { // Check if unstable operation is enabled - String operationId = "listIncidentTypes"; + String operationId = "listIncidentUserDefinedFields"; if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); } else { throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); } Object localVarPostBody = null; + Long pageSize = parameters.pageSize; + Long pageNumber = parameters.pageNumber; Boolean includeDeleted = parameters.includeDeleted; + String filterIncidentType = parameters.filterIncidentType; + String include = parameters.include; // create path and map variables - String localVarPath = "/api/v2/incidents/config/types"; + String localVarPath = "/api/v2/incidents/config/user-defined-fields"; List localVarQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "include_deleted", includeDeleted)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[size]", pageSize)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[number]", pageNumber)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "include-deleted", includeDeleted)); + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "filter[incident-type]", filterIncidentType)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "include", include)); Invocation.Builder builder = apiClient.createBuilder( - "v2.IncidentsApi.listIncidentTypes", + "v2.IncidentsApi.listIncidentUserDefinedFields", localVarPath, localVarQueryParams, localVarHeaderParams, @@ -7431,44 +8553,55 @@ public ApiResponse listIncidentTypesWithHttpInfo( localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * Get a list of incident types. + * Get a list of incident user-defined fields. * - *

See {@link #listIncidentTypesWithHttpInfo}. + *

See {@link #listIncidentUserDefinedFieldsWithHttpInfo}. * * @param parameters Optional parameters for the request. - * @return CompletableFuture<ApiResponse<IncidentTypeListResponse>> + * @return CompletableFuture<ApiResponse<IncidentUserDefinedFieldListResponse>> */ - public CompletableFuture> - listIncidentTypesWithHttpInfoAsync(ListIncidentTypesOptionalParameters parameters) { + public CompletableFuture> + listIncidentUserDefinedFieldsWithHttpInfoAsync( + ListIncidentUserDefinedFieldsOptionalParameters parameters) { // Check if unstable operation is enabled - String operationId = "listIncidentTypes"; + String operationId = "listIncidentUserDefinedFields"; if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); } else { - CompletableFuture> result = new CompletableFuture<>(); + CompletableFuture> result = + new CompletableFuture<>(); result.completeExceptionally( new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); return result; } Object localVarPostBody = null; + Long pageSize = parameters.pageSize; + Long pageNumber = parameters.pageNumber; Boolean includeDeleted = parameters.includeDeleted; + String filterIncidentType = parameters.filterIncidentType; + String include = parameters.include; // create path and map variables - String localVarPath = "/api/v2/incidents/config/types"; + String localVarPath = "/api/v2/incidents/config/user-defined-fields"; List localVarQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "include_deleted", includeDeleted)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[size]", pageSize)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[number]", pageNumber)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "include-deleted", includeDeleted)); + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "filter[incident-type]", filterIncidentType)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "include", include)); Invocation.Builder builder; try { builder = apiClient.createBuilder( - "v2.IncidentsApi.listIncidentTypes", + "v2.IncidentsApi.listIncidentUserDefinedFields", localVarPath, localVarQueryParams, localVarHeaderParams, @@ -7476,7 +8609,8 @@ public ApiResponse listIncidentTypesWithHttpInfo( new String[] {"application/json"}, new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); } catch (ApiException ex) { - CompletableFuture> result = new CompletableFuture<>(); + CompletableFuture> result = + new CompletableFuture<>(); result.completeExceptionally(ex); return result; } @@ -7488,7 +8622,7 @@ public ApiResponse listIncidentTypesWithHttpInfo( localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** Manage optional parameters to searchIncidents. */ @@ -10025,4 +11159,263 @@ public CompletableFuture> updateIncidentTypeWi false, new GenericType() {}); } + + /** Manage optional parameters to updateIncidentUserDefinedField. */ + public static class UpdateIncidentUserDefinedFieldOptionalParameters { + private String include; + + /** + * Set include. + * + * @param include Comma-separated list of related resources to include. Supported values are + * "last_modified_by_user", "created_by_user", and "incident_type". (optional) + * @return UpdateIncidentUserDefinedFieldOptionalParameters + */ + public UpdateIncidentUserDefinedFieldOptionalParameters include(String include) { + this.include = include; + return this; + } + } + + /** + * Update an incident user-defined field. + * + *

See {@link #updateIncidentUserDefinedFieldWithHttpInfo}. + * + * @param fieldId The ID of the incident user-defined field. (required) + * @param body Incident user-defined field update payload. (required) + * @return IncidentUserDefinedFieldResponse + * @throws ApiException if fails to make API call + */ + public IncidentUserDefinedFieldResponse updateIncidentUserDefinedField( + String fieldId, IncidentUserDefinedFieldUpdateRequest body) throws ApiException { + return updateIncidentUserDefinedFieldWithHttpInfo( + fieldId, body, new UpdateIncidentUserDefinedFieldOptionalParameters()) + .getData(); + } + + /** + * Update an incident user-defined field. + * + *

See {@link #updateIncidentUserDefinedFieldWithHttpInfoAsync}. + * + * @param fieldId The ID of the incident user-defined field. (required) + * @param body Incident user-defined field update payload. (required) + * @return CompletableFuture<IncidentUserDefinedFieldResponse> + */ + public CompletableFuture updateIncidentUserDefinedFieldAsync( + String fieldId, IncidentUserDefinedFieldUpdateRequest body) { + return updateIncidentUserDefinedFieldWithHttpInfoAsync( + fieldId, body, new UpdateIncidentUserDefinedFieldOptionalParameters()) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Update an incident user-defined field. + * + *

See {@link #updateIncidentUserDefinedFieldWithHttpInfo}. + * + * @param fieldId The ID of the incident user-defined field. (required) + * @param body Incident user-defined field update payload. (required) + * @param parameters Optional parameters for the request. + * @return IncidentUserDefinedFieldResponse + * @throws ApiException if fails to make API call + */ + public IncidentUserDefinedFieldResponse updateIncidentUserDefinedField( + String fieldId, + IncidentUserDefinedFieldUpdateRequest body, + UpdateIncidentUserDefinedFieldOptionalParameters parameters) + throws ApiException { + return updateIncidentUserDefinedFieldWithHttpInfo(fieldId, body, parameters).getData(); + } + + /** + * Update an incident user-defined field. + * + *

See {@link #updateIncidentUserDefinedFieldWithHttpInfoAsync}. + * + * @param fieldId The ID of the incident user-defined field. (required) + * @param body Incident user-defined field update payload. (required) + * @param parameters Optional parameters for the request. + * @return CompletableFuture<IncidentUserDefinedFieldResponse> + */ + public CompletableFuture updateIncidentUserDefinedFieldAsync( + String fieldId, + IncidentUserDefinedFieldUpdateRequest body, + UpdateIncidentUserDefinedFieldOptionalParameters parameters) { + return updateIncidentUserDefinedFieldWithHttpInfoAsync(fieldId, body, parameters) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Update an incident user-defined field. + * + * @param fieldId The ID of the incident user-defined field. (required) + * @param body Incident user-defined field update payload. (required) + * @param parameters Optional parameters for the request. + * @return ApiResponse<IncidentUserDefinedFieldResponse> + * @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 updateIncidentUserDefinedFieldWithHttpInfo( + String fieldId, + IncidentUserDefinedFieldUpdateRequest body, + UpdateIncidentUserDefinedFieldOptionalParameters parameters) + throws ApiException { + // Check if unstable operation is enabled + String operationId = "updateIncidentUserDefinedField"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = body; + + // verify the required parameter 'fieldId' is set + if (fieldId == null) { + throw new ApiException( + 400, + "Missing the required parameter 'fieldId' when calling updateIncidentUserDefinedField"); + } + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException( + 400, "Missing the required parameter 'body' when calling updateIncidentUserDefinedField"); + } + String include = parameters.include; + // create path and map variables + String localVarPath = + "/api/v2/incidents/config/user-defined-fields/{field_id}" + .replaceAll("\\{" + "field_id" + "\\}", apiClient.escapeString(fieldId.toString())); + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "include", include)); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.IncidentsApi.updateIncidentUserDefinedField", + localVarPath, + localVarQueryParams, + 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 an incident user-defined field. + * + *

See {@link #updateIncidentUserDefinedFieldWithHttpInfo}. + * + * @param fieldId The ID of the incident user-defined field. (required) + * @param body Incident user-defined field update payload. (required) + * @param parameters Optional parameters for the request. + * @return CompletableFuture<ApiResponse<IncidentUserDefinedFieldResponse>> + */ + public CompletableFuture> + updateIncidentUserDefinedFieldWithHttpInfoAsync( + String fieldId, + IncidentUserDefinedFieldUpdateRequest body, + UpdateIncidentUserDefinedFieldOptionalParameters parameters) { + // Check if unstable operation is enabled + String operationId = "updateIncidentUserDefinedField"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = body; + + // verify the required parameter 'fieldId' is set + if (fieldId == null) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'fieldId' when calling" + + " updateIncidentUserDefinedField")); + 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 updateIncidentUserDefinedField")); + return result; + } + String include = parameters.include; + // create path and map variables + String localVarPath = + "/api/v2/incidents/config/user-defined-fields/{field_id}" + .replaceAll("\\{" + "field_id" + "\\}", apiClient.escapeString(fieldId.toString())); + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "include", include)); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.IncidentsApi.updateIncidentUserDefinedField", + localVarPath, + localVarQueryParams, + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + } catch (ApiException ex) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "PATCH", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } } diff --git a/src/main/java/com/datadog/api/client/v2/model/IncidentUserDefinedFieldAttributesCreateRequest.java b/src/main/java/com/datadog/api/client/v2/model/IncidentUserDefinedFieldAttributesCreateRequest.java new file mode 100644 index 00000000000..01ce20723d8 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/IncidentUserDefinedFieldAttributesCreateRequest.java @@ -0,0 +1,499 @@ +/* + * 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; +import org.openapitools.jackson.nullable.JsonNullable; + +/** Attributes for creating an incident user-defined field. */ +@JsonPropertyOrder({ + IncidentUserDefinedFieldAttributesCreateRequest.JSON_PROPERTY_CATEGORY, + IncidentUserDefinedFieldAttributesCreateRequest.JSON_PROPERTY_COLLECTED, + IncidentUserDefinedFieldAttributesCreateRequest.JSON_PROPERTY_DEFAULT_VALUE, + IncidentUserDefinedFieldAttributesCreateRequest.JSON_PROPERTY_DISPLAY_NAME, + IncidentUserDefinedFieldAttributesCreateRequest.JSON_PROPERTY_NAME, + IncidentUserDefinedFieldAttributesCreateRequest.JSON_PROPERTY_ORDINAL, + IncidentUserDefinedFieldAttributesCreateRequest.JSON_PROPERTY_REQUIRED, + IncidentUserDefinedFieldAttributesCreateRequest.JSON_PROPERTY_TAG_KEY, + IncidentUserDefinedFieldAttributesCreateRequest.JSON_PROPERTY_TYPE, + IncidentUserDefinedFieldAttributesCreateRequest.JSON_PROPERTY_VALID_VALUES +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class IncidentUserDefinedFieldAttributesCreateRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_CATEGORY = "category"; + private JsonNullable category = + JsonNullable.undefined(); + + public static final String JSON_PROPERTY_COLLECTED = "collected"; + private JsonNullable collected = + JsonNullable.undefined(); + + public static final String JSON_PROPERTY_DEFAULT_VALUE = "default_value"; + private JsonNullable defaultValue = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_DISPLAY_NAME = "display_name"; + private String displayName; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_ORDINAL = "ordinal"; + private JsonNullable ordinal = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_REQUIRED = "required"; + private Boolean required; + + public static final String JSON_PROPERTY_TAG_KEY = "tag_key"; + private JsonNullable tagKey = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_TYPE = "type"; + private IncidentUserDefinedFieldFieldType type; + + public static final String JSON_PROPERTY_VALID_VALUES = "valid_values"; + private List validValues = null; + + public IncidentUserDefinedFieldAttributesCreateRequest() {} + + @JsonCreator + public IncidentUserDefinedFieldAttributesCreateRequest( + @JsonProperty(required = true, value = JSON_PROPERTY_NAME) String name, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) + IncidentUserDefinedFieldFieldType type) { + this.name = name; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public IncidentUserDefinedFieldAttributesCreateRequest category( + IncidentUserDefinedFieldCategory category) { + this.category = JsonNullable.of(category); + return this; + } + + /** + * The section in which the field appears. Use "what_happened" for impact-related fields or + * "why_it_happened" for root cause fields. When null, the field appears in the Attributes + * section. + * + * @return category + */ + @jakarta.annotation.Nullable + @JsonIgnore + public IncidentUserDefinedFieldCategory getCategory() { + return category.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_CATEGORY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getCategory_JsonNullable() { + return category; + } + + @JsonProperty(JSON_PROPERTY_CATEGORY) + public void setCategory_JsonNullable(JsonNullable category) { + this.category = category; + } + + public void setCategory(IncidentUserDefinedFieldCategory category) { + if (!category.isValid()) { + this.unparsed = true; + } + this.category = JsonNullable.of(category); + } + + public IncidentUserDefinedFieldAttributesCreateRequest collected( + IncidentUserDefinedFieldCollected collected) { + this.collected = JsonNullable.of(collected); + return this; + } + + /** + * The lifecycle stage at which the app prompts users to fill out this field. Cannot be set on + * required fields. + * + * @return collected + */ + @jakarta.annotation.Nullable + @JsonIgnore + public IncidentUserDefinedFieldCollected getCollected() { + return collected.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_COLLECTED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getCollected_JsonNullable() { + return collected; + } + + @JsonProperty(JSON_PROPERTY_COLLECTED) + public void setCollected_JsonNullable(JsonNullable collected) { + this.collected = collected; + } + + public void setCollected(IncidentUserDefinedFieldCollected collected) { + if (!collected.isValid()) { + this.unparsed = true; + } + this.collected = JsonNullable.of(collected); + } + + public IncidentUserDefinedFieldAttributesCreateRequest defaultValue(String defaultValue) { + this.defaultValue = JsonNullable.of(defaultValue); + return this; + } + + /** + * The default value for the field. Must be one of the valid values when valid_values is set. + * + * @return defaultValue + */ + @jakarta.annotation.Nullable + @JsonIgnore + public String getDefaultValue() { + return defaultValue.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_DEFAULT_VALUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getDefaultValue_JsonNullable() { + return defaultValue; + } + + @JsonProperty(JSON_PROPERTY_DEFAULT_VALUE) + public void setDefaultValue_JsonNullable(JsonNullable defaultValue) { + this.defaultValue = defaultValue; + } + + public void setDefaultValue(String defaultValue) { + this.defaultValue = JsonNullable.of(defaultValue); + } + + public IncidentUserDefinedFieldAttributesCreateRequest displayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * The human-readable name shown in the UI. Defaults to a formatted version of the name if not + * provided. + * + * @return displayName + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DISPLAY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDisplayName() { + return displayName; + } + + public void setDisplayName(String displayName) { + this.displayName = displayName; + } + + public IncidentUserDefinedFieldAttributesCreateRequest name(String name) { + this.name = name; + return this; + } + + /** + * The unique machine-readable name of the field. Must start with a letter or digit and contain + * only letters, digits, underscores, or periods. + * + * @return name + */ + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public IncidentUserDefinedFieldAttributesCreateRequest ordinal(String ordinal) { + this.ordinal = JsonNullable.of(ordinal); + return this; + } + + /** + * A decimal string representing the field's display order in the UI. + * + * @return ordinal + */ + @jakarta.annotation.Nullable + @JsonIgnore + public String getOrdinal() { + return ordinal.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_ORDINAL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getOrdinal_JsonNullable() { + return ordinal; + } + + @JsonProperty(JSON_PROPERTY_ORDINAL) + public void setOrdinal_JsonNullable(JsonNullable ordinal) { + this.ordinal = ordinal; + } + + public void setOrdinal(String ordinal) { + this.ordinal = JsonNullable.of(ordinal); + } + + public IncidentUserDefinedFieldAttributesCreateRequest required(Boolean required) { + this.required = required; + return this; + } + + /** + * When true, users must fill out this field on incidents. + * + * @return required + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_REQUIRED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getRequired() { + return required; + } + + public void setRequired(Boolean required) { + this.required = required; + } + + public IncidentUserDefinedFieldAttributesCreateRequest tagKey(String tagKey) { + this.tagKey = JsonNullable.of(tagKey); + return this; + } + + /** + * For metric tag-type fields only, the metric tag key that powers the autocomplete options. + * + * @return tagKey + */ + @jakarta.annotation.Nullable + @JsonIgnore + public String getTagKey() { + return tagKey.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_TAG_KEY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getTagKey_JsonNullable() { + return tagKey; + } + + @JsonProperty(JSON_PROPERTY_TAG_KEY) + public void setTagKey_JsonNullable(JsonNullable tagKey) { + this.tagKey = tagKey; + } + + public void setTagKey(String tagKey) { + this.tagKey = JsonNullable.of(tagKey); + } + + public IncidentUserDefinedFieldAttributesCreateRequest type( + IncidentUserDefinedFieldFieldType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * The data type of the field. 1=dropdown, 2=multiselect, 3=textbox, 4=textarray, 5=metrictag, + * 6=autocomplete, 7=number, 8=datetime. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public IncidentUserDefinedFieldFieldType getType() { + return type; + } + + public void setType(IncidentUserDefinedFieldFieldType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + public IncidentUserDefinedFieldAttributesCreateRequest validValues( + List validValues) { + this.validValues = validValues; + for (IncidentUserDefinedFieldValidValue item : validValues) { + this.unparsed |= item.unparsed; + } + return this; + } + + public IncidentUserDefinedFieldAttributesCreateRequest addValidValuesItem( + IncidentUserDefinedFieldValidValue validValuesItem) { + if (this.validValues == null) { + this.validValues = new ArrayList<>(); + } + this.validValues.add(validValuesItem); + this.unparsed |= validValuesItem.unparsed; + return this; + } + + /** + * The list of allowed values for dropdown, multiselect, and autocomplete fields. Limited to 1000 + * values. + * + * @return validValues + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_VALID_VALUES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getValidValues() { + return validValues; + } + + public void setValidValues(List validValues) { + this.validValues = validValues; + } + + /** + * 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 IncidentUserDefinedFieldAttributesCreateRequest + */ + @JsonAnySetter + public IncidentUserDefinedFieldAttributesCreateRequest 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 IncidentUserDefinedFieldAttributesCreateRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IncidentUserDefinedFieldAttributesCreateRequest + incidentUserDefinedFieldAttributesCreateRequest = + (IncidentUserDefinedFieldAttributesCreateRequest) o; + return Objects.equals(this.category, incidentUserDefinedFieldAttributesCreateRequest.category) + && Objects.equals(this.collected, incidentUserDefinedFieldAttributesCreateRequest.collected) + && Objects.equals( + this.defaultValue, incidentUserDefinedFieldAttributesCreateRequest.defaultValue) + && Objects.equals( + this.displayName, incidentUserDefinedFieldAttributesCreateRequest.displayName) + && Objects.equals(this.name, incidentUserDefinedFieldAttributesCreateRequest.name) + && Objects.equals(this.ordinal, incidentUserDefinedFieldAttributesCreateRequest.ordinal) + && Objects.equals(this.required, incidentUserDefinedFieldAttributesCreateRequest.required) + && Objects.equals(this.tagKey, incidentUserDefinedFieldAttributesCreateRequest.tagKey) + && Objects.equals(this.type, incidentUserDefinedFieldAttributesCreateRequest.type) + && Objects.equals( + this.validValues, incidentUserDefinedFieldAttributesCreateRequest.validValues) + && Objects.equals( + this.additionalProperties, + incidentUserDefinedFieldAttributesCreateRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + category, + collected, + defaultValue, + displayName, + name, + ordinal, + required, + tagKey, + type, + validValues, + additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IncidentUserDefinedFieldAttributesCreateRequest {\n"); + sb.append(" category: ").append(toIndentedString(category)).append("\n"); + sb.append(" collected: ").append(toIndentedString(collected)).append("\n"); + sb.append(" defaultValue: ").append(toIndentedString(defaultValue)).append("\n"); + sb.append(" displayName: ").append(toIndentedString(displayName)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" ordinal: ").append(toIndentedString(ordinal)).append("\n"); + sb.append(" required: ").append(toIndentedString(required)).append("\n"); + sb.append(" tagKey: ").append(toIndentedString(tagKey)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" validValues: ").append(toIndentedString(validValues)).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/IncidentUserDefinedFieldAttributesResponse.java b/src/main/java/com/datadog/api/client/v2/model/IncidentUserDefinedFieldAttributesResponse.java new file mode 100644 index 00000000000..235c4293299 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/IncidentUserDefinedFieldAttributesResponse.java @@ -0,0 +1,656 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** Attributes of an incident user-defined field. */ +@JsonPropertyOrder({ + IncidentUserDefinedFieldAttributesResponse.JSON_PROPERTY_ATTACHED_TO, + IncidentUserDefinedFieldAttributesResponse.JSON_PROPERTY_CATEGORY, + IncidentUserDefinedFieldAttributesResponse.JSON_PROPERTY_COLLECTED, + IncidentUserDefinedFieldAttributesResponse.JSON_PROPERTY_CREATED, + IncidentUserDefinedFieldAttributesResponse.JSON_PROPERTY_DEFAULT_VALUE, + IncidentUserDefinedFieldAttributesResponse.JSON_PROPERTY_DELETED, + IncidentUserDefinedFieldAttributesResponse.JSON_PROPERTY_DISPLAY_NAME, + IncidentUserDefinedFieldAttributesResponse.JSON_PROPERTY_METADATA, + IncidentUserDefinedFieldAttributesResponse.JSON_PROPERTY_MODIFIED, + IncidentUserDefinedFieldAttributesResponse.JSON_PROPERTY_NAME, + IncidentUserDefinedFieldAttributesResponse.JSON_PROPERTY_ORDINAL, + IncidentUserDefinedFieldAttributesResponse.JSON_PROPERTY_PREREQUISITE, + IncidentUserDefinedFieldAttributesResponse.JSON_PROPERTY_REQUIRED, + IncidentUserDefinedFieldAttributesResponse.JSON_PROPERTY_RESERVED, + IncidentUserDefinedFieldAttributesResponse.JSON_PROPERTY_TABLE_ID, + IncidentUserDefinedFieldAttributesResponse.JSON_PROPERTY_TAG_KEY, + IncidentUserDefinedFieldAttributesResponse.JSON_PROPERTY_TYPE, + IncidentUserDefinedFieldAttributesResponse.JSON_PROPERTY_VALID_VALUES +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class IncidentUserDefinedFieldAttributesResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTACHED_TO = "attached_to"; + private String attachedTo; + + public static final String JSON_PROPERTY_CATEGORY = "category"; + private IncidentUserDefinedFieldCategory category; + + public static final String JSON_PROPERTY_COLLECTED = "collected"; + private IncidentUserDefinedFieldCollected collected; + + public static final String JSON_PROPERTY_CREATED = "created"; + private OffsetDateTime created; + + public static final String JSON_PROPERTY_DEFAULT_VALUE = "default_value"; + private String defaultValue; + + public static final String JSON_PROPERTY_DELETED = "deleted"; + private OffsetDateTime deleted; + + public static final String JSON_PROPERTY_DISPLAY_NAME = "display_name"; + private String displayName; + + public static final String JSON_PROPERTY_METADATA = "metadata"; + private IncidentUserDefinedFieldMetadata metadata; + + public static final String JSON_PROPERTY_MODIFIED = "modified"; + private OffsetDateTime modified; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_ORDINAL = "ordinal"; + private String ordinal; + + public static final String JSON_PROPERTY_PREREQUISITE = "prerequisite"; + private String prerequisite; + + public static final String JSON_PROPERTY_REQUIRED = "required"; + private Boolean required; + + public static final String JSON_PROPERTY_RESERVED = "reserved"; + private Boolean reserved; + + public static final String JSON_PROPERTY_TABLE_ID = "table_id"; + private Long tableId; + + public static final String JSON_PROPERTY_TAG_KEY = "tag_key"; + private String tagKey; + + public static final String JSON_PROPERTY_TYPE = "type"; + private Integer type; + + public static final String JSON_PROPERTY_VALID_VALUES = "valid_values"; + private List validValues = new ArrayList<>(); + + public IncidentUserDefinedFieldAttributesResponse() {} + + @JsonCreator + public IncidentUserDefinedFieldAttributesResponse( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTACHED_TO) String attachedTo, + @JsonProperty(required = true, value = JSON_PROPERTY_CATEGORY) + IncidentUserDefinedFieldCategory category, + @JsonProperty(required = true, value = JSON_PROPERTY_COLLECTED) + IncidentUserDefinedFieldCollected collected, + @JsonProperty(required = true, value = JSON_PROPERTY_CREATED) OffsetDateTime created, + @JsonProperty(required = true, value = JSON_PROPERTY_DEFAULT_VALUE) String defaultValue, + @JsonProperty(required = true, value = JSON_PROPERTY_DELETED) OffsetDateTime deleted, + @JsonProperty(required = true, value = JSON_PROPERTY_DISPLAY_NAME) String displayName, + @JsonProperty(required = true, value = JSON_PROPERTY_METADATA) + IncidentUserDefinedFieldMetadata metadata, + @JsonProperty(required = true, value = JSON_PROPERTY_MODIFIED) OffsetDateTime modified, + @JsonProperty(required = true, value = JSON_PROPERTY_NAME) String name, + @JsonProperty(required = true, value = JSON_PROPERTY_ORDINAL) String ordinal, + @JsonProperty(required = true, value = JSON_PROPERTY_PREREQUISITE) String prerequisite, + @JsonProperty(required = true, value = JSON_PROPERTY_REQUIRED) Boolean required, + @JsonProperty(required = true, value = JSON_PROPERTY_RESERVED) Boolean reserved, + @JsonProperty(required = true, value = JSON_PROPERTY_TABLE_ID) Long tableId, + @JsonProperty(required = true, value = JSON_PROPERTY_TAG_KEY) String tagKey, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) Integer type, + @JsonProperty(required = true, value = JSON_PROPERTY_VALID_VALUES) + List validValues) { + this.attachedTo = attachedTo; + this.category = category; + if (category != null) { + this.unparsed |= !category.isValid(); + } + this.collected = collected; + if (collected != null) { + this.unparsed |= !collected.isValid(); + } + this.created = created; + this.defaultValue = defaultValue; + if (defaultValue != null) {} + this.deleted = deleted; + if (deleted != null) {} + this.displayName = displayName; + this.metadata = metadata; + if (metadata != null) { + this.unparsed |= metadata.unparsed; + } + this.modified = modified; + if (modified != null) {} + this.name = name; + this.ordinal = ordinal; + if (ordinal != null) {} + this.prerequisite = prerequisite; + if (prerequisite != null) {} + this.required = required; + this.reserved = reserved; + this.tableId = tableId; + this.tagKey = tagKey; + if (tagKey != null) {} + this.type = type; + if (type != null) {} + this.validValues = validValues; + if (validValues != null) {} + } + + /** + * The resource type this field is attached to. Always "incidents". + * + * @return attachedTo + */ + @JsonProperty(JSON_PROPERTY_ATTACHED_TO) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getAttachedTo() { + return attachedTo; + } + + public IncidentUserDefinedFieldAttributesResponse category( + IncidentUserDefinedFieldCategory category) { + this.category = category; + if (category != null) { + this.unparsed |= !category.isValid(); + } + return this; + } + + /** + * The section in which the field appears. Use "what_happened" for impact-related fields or + * "why_it_happened" for root cause fields. When null, the field appears in the Attributes + * section. + * + * @return category + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CATEGORY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public IncidentUserDefinedFieldCategory getCategory() { + return category; + } + + public void setCategory(IncidentUserDefinedFieldCategory category) { + if (!category.isValid()) { + this.unparsed = true; + } + this.category = category; + } + + public IncidentUserDefinedFieldAttributesResponse collected( + IncidentUserDefinedFieldCollected collected) { + this.collected = collected; + if (collected != null) { + this.unparsed |= !collected.isValid(); + } + return this; + } + + /** + * The lifecycle stage at which the app prompts users to fill out this field. Cannot be set on + * required fields. + * + * @return collected + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_COLLECTED) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public IncidentUserDefinedFieldCollected getCollected() { + return collected; + } + + public void setCollected(IncidentUserDefinedFieldCollected collected) { + if (!collected.isValid()) { + this.unparsed = true; + } + this.collected = collected; + } + + /** + * Timestamp when the field was created. + * + * @return created + */ + @JsonProperty(JSON_PROPERTY_CREATED) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public OffsetDateTime getCreated() { + return created; + } + + public IncidentUserDefinedFieldAttributesResponse defaultValue(String defaultValue) { + this.defaultValue = defaultValue; + if (defaultValue != null) {} + return this; + } + + /** + * The default value for the field. + * + * @return defaultValue + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DEFAULT_VALUE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getDefaultValue() { + return defaultValue; + } + + public void setDefaultValue(String defaultValue) { + this.defaultValue = defaultValue; + } + + /** + * Timestamp when the field was soft-deleted, or null if not deleted. + * + * @return deleted + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DELETED) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public OffsetDateTime getDeleted() { + return deleted; + } + + public IncidentUserDefinedFieldAttributesResponse displayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * The human-readable name shown in the UI. + * + * @return displayName + */ + @JsonProperty(JSON_PROPERTY_DISPLAY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getDisplayName() { + return displayName; + } + + public void setDisplayName(String displayName) { + this.displayName = displayName; + } + + public IncidentUserDefinedFieldAttributesResponse metadata( + IncidentUserDefinedFieldMetadata metadata) { + this.metadata = metadata; + if (metadata != null) { + this.unparsed |= metadata.unparsed; + } + return this; + } + + /** + * Metadata for autocomplete-type user-defined fields, describing how to populate autocomplete + * options. + * + * @return metadata + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_METADATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public IncidentUserDefinedFieldMetadata getMetadata() { + return metadata; + } + + public void setMetadata(IncidentUserDefinedFieldMetadata metadata) { + this.metadata = metadata; + } + + /** + * Timestamp when the field was last modified. + * + * @return modified + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MODIFIED) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public OffsetDateTime getModified() { + return modified; + } + + public IncidentUserDefinedFieldAttributesResponse name(String name) { + this.name = name; + return this; + } + + /** + * The unique machine-readable name of the field. + * + * @return name + */ + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public IncidentUserDefinedFieldAttributesResponse ordinal(String ordinal) { + this.ordinal = ordinal; + if (ordinal != null) {} + return this; + } + + /** + * A decimal string representing the field's display order in the UI. + * + * @return ordinal + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ORDINAL) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getOrdinal() { + return ordinal; + } + + public void setOrdinal(String ordinal) { + this.ordinal = ordinal; + } + + /** + * Reserved for future use. Always null. + * + * @return prerequisite + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PREREQUISITE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getPrerequisite() { + return prerequisite; + } + + public IncidentUserDefinedFieldAttributesResponse required(Boolean required) { + this.required = required; + return this; + } + + /** + * When true, users must fill out this field on incidents. + * + * @return required + */ + @JsonProperty(JSON_PROPERTY_REQUIRED) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Boolean getRequired() { + return required; + } + + public void setRequired(Boolean required) { + this.required = required; + } + + /** + * When true, this field is reserved for system use and cannot be deleted. + * + * @return reserved + */ + @JsonProperty(JSON_PROPERTY_RESERVED) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Boolean getReserved() { + return reserved; + } + + /** + * Reserved for internal use. Always 0. + * + * @return tableId + */ + @JsonProperty(JSON_PROPERTY_TABLE_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Long getTableId() { + return tableId; + } + + public IncidentUserDefinedFieldAttributesResponse tagKey(String tagKey) { + this.tagKey = tagKey; + if (tagKey != null) {} + return this; + } + + /** + * For metric tag-type fields only, the metric tag key that powers the autocomplete options. + * + * @return tagKey + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TAG_KEY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getTagKey() { + return tagKey; + } + + public void setTagKey(String tagKey) { + this.tagKey = tagKey; + } + + public IncidentUserDefinedFieldAttributesResponse type(Integer type) { + this.type = type; + if (type != null) {} + return this; + } + + /** + * The data type of the field. 1=dropdown, 2=multiselect, 3=textbox, 4=textarray, 5=metrictag, + * 6=autocomplete, 7=number, 8=datetime. minimum: 1 maximum: 8 + * + * @return type + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Integer getType() { + return type; + } + + public void setType(Integer type) { + this.type = type; + } + + public IncidentUserDefinedFieldAttributesResponse validValues( + List validValues) { + this.validValues = validValues; + for (IncidentUserDefinedFieldValidValue item : validValues) { + this.unparsed |= item.unparsed; + } + return this; + } + + public IncidentUserDefinedFieldAttributesResponse addValidValuesItem( + IncidentUserDefinedFieldValidValue validValuesItem) { + this.validValues.add(validValuesItem); + this.unparsed |= validValuesItem.unparsed; + return this; + } + + /** + * The list of allowed values for dropdown, multiselect, and autocomplete fields. + * + * @return validValues + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_VALID_VALUES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getValidValues() { + return validValues; + } + + public void setValidValues(List validValues) { + this.validValues = validValues; + } + + /** + * 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 IncidentUserDefinedFieldAttributesResponse + */ + @JsonAnySetter + public IncidentUserDefinedFieldAttributesResponse 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 IncidentUserDefinedFieldAttributesResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IncidentUserDefinedFieldAttributesResponse incidentUserDefinedFieldAttributesResponse = + (IncidentUserDefinedFieldAttributesResponse) o; + return Objects.equals(this.attachedTo, incidentUserDefinedFieldAttributesResponse.attachedTo) + && Objects.equals(this.category, incidentUserDefinedFieldAttributesResponse.category) + && Objects.equals(this.collected, incidentUserDefinedFieldAttributesResponse.collected) + && Objects.equals(this.created, incidentUserDefinedFieldAttributesResponse.created) + && Objects.equals( + this.defaultValue, incidentUserDefinedFieldAttributesResponse.defaultValue) + && Objects.equals(this.deleted, incidentUserDefinedFieldAttributesResponse.deleted) + && Objects.equals(this.displayName, incidentUserDefinedFieldAttributesResponse.displayName) + && Objects.equals(this.metadata, incidentUserDefinedFieldAttributesResponse.metadata) + && Objects.equals(this.modified, incidentUserDefinedFieldAttributesResponse.modified) + && Objects.equals(this.name, incidentUserDefinedFieldAttributesResponse.name) + && Objects.equals(this.ordinal, incidentUserDefinedFieldAttributesResponse.ordinal) + && Objects.equals( + this.prerequisite, incidentUserDefinedFieldAttributesResponse.prerequisite) + && Objects.equals(this.required, incidentUserDefinedFieldAttributesResponse.required) + && Objects.equals(this.reserved, incidentUserDefinedFieldAttributesResponse.reserved) + && Objects.equals(this.tableId, incidentUserDefinedFieldAttributesResponse.tableId) + && Objects.equals(this.tagKey, incidentUserDefinedFieldAttributesResponse.tagKey) + && Objects.equals(this.type, incidentUserDefinedFieldAttributesResponse.type) + && Objects.equals(this.validValues, incidentUserDefinedFieldAttributesResponse.validValues) + && Objects.equals( + this.additionalProperties, + incidentUserDefinedFieldAttributesResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + attachedTo, + category, + collected, + created, + defaultValue, + deleted, + displayName, + metadata, + modified, + name, + ordinal, + prerequisite, + required, + reserved, + tableId, + tagKey, + type, + validValues, + additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IncidentUserDefinedFieldAttributesResponse {\n"); + sb.append(" attachedTo: ").append(toIndentedString(attachedTo)).append("\n"); + sb.append(" category: ").append(toIndentedString(category)).append("\n"); + sb.append(" collected: ").append(toIndentedString(collected)).append("\n"); + sb.append(" created: ").append(toIndentedString(created)).append("\n"); + sb.append(" defaultValue: ").append(toIndentedString(defaultValue)).append("\n"); + sb.append(" deleted: ").append(toIndentedString(deleted)).append("\n"); + sb.append(" displayName: ").append(toIndentedString(displayName)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" modified: ").append(toIndentedString(modified)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" ordinal: ").append(toIndentedString(ordinal)).append("\n"); + sb.append(" prerequisite: ").append(toIndentedString(prerequisite)).append("\n"); + sb.append(" required: ").append(toIndentedString(required)).append("\n"); + sb.append(" reserved: ").append(toIndentedString(reserved)).append("\n"); + sb.append(" tableId: ").append(toIndentedString(tableId)).append("\n"); + sb.append(" tagKey: ").append(toIndentedString(tagKey)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" validValues: ").append(toIndentedString(validValues)).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/IncidentUserDefinedFieldAttributesUpdateRequest.java b/src/main/java/com/datadog/api/client/v2/model/IncidentUserDefinedFieldAttributesUpdateRequest.java new file mode 100644 index 00000000000..60e906c1c82 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/IncidentUserDefinedFieldAttributesUpdateRequest.java @@ -0,0 +1,408 @@ +/* + * 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; +import org.openapitools.jackson.nullable.JsonNullable; + +/** Attributes for updating an incident user-defined field. All fields are optional. */ +@JsonPropertyOrder({ + IncidentUserDefinedFieldAttributesUpdateRequest.JSON_PROPERTY_CATEGORY, + IncidentUserDefinedFieldAttributesUpdateRequest.JSON_PROPERTY_COLLECTED, + IncidentUserDefinedFieldAttributesUpdateRequest.JSON_PROPERTY_DEFAULT_VALUE, + IncidentUserDefinedFieldAttributesUpdateRequest.JSON_PROPERTY_DISPLAY_NAME, + IncidentUserDefinedFieldAttributesUpdateRequest.JSON_PROPERTY_ORDINAL, + IncidentUserDefinedFieldAttributesUpdateRequest.JSON_PROPERTY_REQUIRED, + IncidentUserDefinedFieldAttributesUpdateRequest.JSON_PROPERTY_VALID_VALUES +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class IncidentUserDefinedFieldAttributesUpdateRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_CATEGORY = "category"; + private JsonNullable category = + JsonNullable.undefined(); + + public static final String JSON_PROPERTY_COLLECTED = "collected"; + private JsonNullable collected = + JsonNullable.undefined(); + + public static final String JSON_PROPERTY_DEFAULT_VALUE = "default_value"; + private JsonNullable defaultValue = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_DISPLAY_NAME = "display_name"; + private String displayName; + + public static final String JSON_PROPERTY_ORDINAL = "ordinal"; + private JsonNullable ordinal = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_REQUIRED = "required"; + private JsonNullable required = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_VALID_VALUES = "valid_values"; + private JsonNullable> validValues = + JsonNullable.>undefined(); + + public IncidentUserDefinedFieldAttributesUpdateRequest category( + IncidentUserDefinedFieldCategory category) { + this.category = JsonNullable.of(category); + return this; + } + + /** + * The section in which the field appears. Use "what_happened" for impact-related fields or + * "why_it_happened" for root cause fields. When null, the field appears in the Attributes + * section. + * + * @return category + */ + @jakarta.annotation.Nullable + @JsonIgnore + public IncidentUserDefinedFieldCategory getCategory() { + return category.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_CATEGORY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getCategory_JsonNullable() { + return category; + } + + @JsonProperty(JSON_PROPERTY_CATEGORY) + public void setCategory_JsonNullable(JsonNullable category) { + this.category = category; + } + + public void setCategory(IncidentUserDefinedFieldCategory category) { + if (!category.isValid()) { + this.unparsed = true; + } + this.category = JsonNullable.of(category); + } + + public IncidentUserDefinedFieldAttributesUpdateRequest collected( + IncidentUserDefinedFieldCollected collected) { + this.collected = JsonNullable.of(collected); + return this; + } + + /** + * The lifecycle stage at which the app prompts users to fill out this field. Cannot be set on + * required fields. + * + * @return collected + */ + @jakarta.annotation.Nullable + @JsonIgnore + public IncidentUserDefinedFieldCollected getCollected() { + return collected.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_COLLECTED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getCollected_JsonNullable() { + return collected; + } + + @JsonProperty(JSON_PROPERTY_COLLECTED) + public void setCollected_JsonNullable(JsonNullable collected) { + this.collected = collected; + } + + public void setCollected(IncidentUserDefinedFieldCollected collected) { + if (!collected.isValid()) { + this.unparsed = true; + } + this.collected = JsonNullable.of(collected); + } + + public IncidentUserDefinedFieldAttributesUpdateRequest defaultValue(String defaultValue) { + this.defaultValue = JsonNullable.of(defaultValue); + return this; + } + + /** + * The default value for the field. Must be one of the valid values when valid_values is set. + * + * @return defaultValue + */ + @jakarta.annotation.Nullable + @JsonIgnore + public String getDefaultValue() { + return defaultValue.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_DEFAULT_VALUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getDefaultValue_JsonNullable() { + return defaultValue; + } + + @JsonProperty(JSON_PROPERTY_DEFAULT_VALUE) + public void setDefaultValue_JsonNullable(JsonNullable defaultValue) { + this.defaultValue = defaultValue; + } + + public void setDefaultValue(String defaultValue) { + this.defaultValue = JsonNullable.of(defaultValue); + } + + public IncidentUserDefinedFieldAttributesUpdateRequest displayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * The human-readable name shown in the UI. + * + * @return displayName + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DISPLAY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDisplayName() { + return displayName; + } + + public void setDisplayName(String displayName) { + this.displayName = displayName; + } + + public IncidentUserDefinedFieldAttributesUpdateRequest ordinal(String ordinal) { + this.ordinal = JsonNullable.of(ordinal); + return this; + } + + /** + * A decimal string representing the field's display order in the UI. + * + * @return ordinal + */ + @jakarta.annotation.Nullable + @JsonIgnore + public String getOrdinal() { + return ordinal.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_ORDINAL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getOrdinal_JsonNullable() { + return ordinal; + } + + @JsonProperty(JSON_PROPERTY_ORDINAL) + public void setOrdinal_JsonNullable(JsonNullable ordinal) { + this.ordinal = ordinal; + } + + public void setOrdinal(String ordinal) { + this.ordinal = JsonNullable.of(ordinal); + } + + public IncidentUserDefinedFieldAttributesUpdateRequest required(Boolean required) { + this.required = JsonNullable.of(required); + return this; + } + + /** + * When true, users must fill out this field on incidents. + * + * @return required + */ + @jakarta.annotation.Nullable + @JsonIgnore + public Boolean getRequired() { + return required.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_REQUIRED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getRequired_JsonNullable() { + return required; + } + + @JsonProperty(JSON_PROPERTY_REQUIRED) + public void setRequired_JsonNullable(JsonNullable required) { + this.required = required; + } + + public void setRequired(Boolean required) { + this.required = JsonNullable.of(required); + } + + public IncidentUserDefinedFieldAttributesUpdateRequest validValues( + List validValues) { + this.validValues = JsonNullable.>of(validValues); + return this; + } + + public IncidentUserDefinedFieldAttributesUpdateRequest addValidValuesItem( + IncidentUserDefinedFieldValidValue validValuesItem) { + if (this.validValues == null || !this.validValues.isPresent()) { + this.validValues = + JsonNullable.>of(new ArrayList<>()); + } + try { + this.validValues.get().add(validValuesItem); + } catch (java.util.NoSuchElementException e) { + // this can never happen, as we make sure above that the value is present + } + return this; + } + + /** + * The list of allowed values for dropdown and multiselect fields. Limited to 1000 values. + * + * @return validValues + */ + @jakarta.annotation.Nullable + @JsonIgnore + public List getValidValues() { + return validValues.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_VALID_VALUES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable> getValidValues_JsonNullable() { + return validValues; + } + + @JsonProperty(JSON_PROPERTY_VALID_VALUES) + public void setValidValues_JsonNullable( + JsonNullable> validValues) { + this.validValues = validValues; + } + + public void setValidValues(List validValues) { + this.validValues = JsonNullable.>of(validValues); + } + + /** + * 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 IncidentUserDefinedFieldAttributesUpdateRequest + */ + @JsonAnySetter + public IncidentUserDefinedFieldAttributesUpdateRequest 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 IncidentUserDefinedFieldAttributesUpdateRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IncidentUserDefinedFieldAttributesUpdateRequest + incidentUserDefinedFieldAttributesUpdateRequest = + (IncidentUserDefinedFieldAttributesUpdateRequest) o; + return Objects.equals(this.category, incidentUserDefinedFieldAttributesUpdateRequest.category) + && Objects.equals(this.collected, incidentUserDefinedFieldAttributesUpdateRequest.collected) + && Objects.equals( + this.defaultValue, incidentUserDefinedFieldAttributesUpdateRequest.defaultValue) + && Objects.equals( + this.displayName, incidentUserDefinedFieldAttributesUpdateRequest.displayName) + && Objects.equals(this.ordinal, incidentUserDefinedFieldAttributesUpdateRequest.ordinal) + && Objects.equals(this.required, incidentUserDefinedFieldAttributesUpdateRequest.required) + && Objects.equals( + this.validValues, incidentUserDefinedFieldAttributesUpdateRequest.validValues) + && Objects.equals( + this.additionalProperties, + incidentUserDefinedFieldAttributesUpdateRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + category, + collected, + defaultValue, + displayName, + ordinal, + required, + validValues, + additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IncidentUserDefinedFieldAttributesUpdateRequest {\n"); + sb.append(" category: ").append(toIndentedString(category)).append("\n"); + sb.append(" collected: ").append(toIndentedString(collected)).append("\n"); + sb.append(" defaultValue: ").append(toIndentedString(defaultValue)).append("\n"); + sb.append(" displayName: ").append(toIndentedString(displayName)).append("\n"); + sb.append(" ordinal: ").append(toIndentedString(ordinal)).append("\n"); + sb.append(" required: ").append(toIndentedString(required)).append("\n"); + sb.append(" validValues: ").append(toIndentedString(validValues)).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/IncidentUserDefinedFieldCategory.java b/src/main/java/com/datadog/api/client/v2/model/IncidentUserDefinedFieldCategory.java new file mode 100644 index 00000000000..b65a62a0b4b --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/IncidentUserDefinedFieldCategory.java @@ -0,0 +1,63 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** + * The section in which the field appears. Use "what_happened" for impact-related fields or + * "why_it_happened" for root cause fields. When null, the field appears in the Attributes section. + */ +@JsonSerialize( + using = IncidentUserDefinedFieldCategory.IncidentUserDefinedFieldCategorySerializer.class) +public class IncidentUserDefinedFieldCategory extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("what_happened", "why_it_happened")); + + public static final IncidentUserDefinedFieldCategory WHAT_HAPPENED = + new IncidentUserDefinedFieldCategory("what_happened"); + public static final IncidentUserDefinedFieldCategory WHY_IT_HAPPENED = + new IncidentUserDefinedFieldCategory("why_it_happened"); + + IncidentUserDefinedFieldCategory(String value) { + super(value, allowedValues); + } + + public static class IncidentUserDefinedFieldCategorySerializer + extends StdSerializer { + public IncidentUserDefinedFieldCategorySerializer(Class t) { + super(t); + } + + public IncidentUserDefinedFieldCategorySerializer() { + this(null); + } + + @Override + public void serialize( + IncidentUserDefinedFieldCategory value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static IncidentUserDefinedFieldCategory fromValue(String value) { + return new IncidentUserDefinedFieldCategory(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/IncidentUserDefinedFieldCollected.java b/src/main/java/com/datadog/api/client/v2/model/IncidentUserDefinedFieldCollected.java new file mode 100644 index 00000000000..b1db08009a6 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/IncidentUserDefinedFieldCollected.java @@ -0,0 +1,67 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** + * The lifecycle stage at which the app prompts users to fill out this field. Cannot be set on + * required fields. + */ +@JsonSerialize( + using = IncidentUserDefinedFieldCollected.IncidentUserDefinedFieldCollectedSerializer.class) +public class IncidentUserDefinedFieldCollected extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("active", "stable", "resolved", "completed")); + + public static final IncidentUserDefinedFieldCollected ACTIVE = + new IncidentUserDefinedFieldCollected("active"); + public static final IncidentUserDefinedFieldCollected STABLE = + new IncidentUserDefinedFieldCollected("stable"); + public static final IncidentUserDefinedFieldCollected RESOLVED = + new IncidentUserDefinedFieldCollected("resolved"); + public static final IncidentUserDefinedFieldCollected COMPLETED = + new IncidentUserDefinedFieldCollected("completed"); + + IncidentUserDefinedFieldCollected(String value) { + super(value, allowedValues); + } + + public static class IncidentUserDefinedFieldCollectedSerializer + extends StdSerializer { + public IncidentUserDefinedFieldCollectedSerializer(Class t) { + super(t); + } + + public IncidentUserDefinedFieldCollectedSerializer() { + this(null); + } + + @Override + public void serialize( + IncidentUserDefinedFieldCollected value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static IncidentUserDefinedFieldCollected fromValue(String value) { + return new IncidentUserDefinedFieldCollected(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/IncidentUserDefinedFieldCreateData.java b/src/main/java/com/datadog/api/client/v2/model/IncidentUserDefinedFieldCreateData.java new file mode 100644 index 00000000000..4c21e04b9b2 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/IncidentUserDefinedFieldCreateData.java @@ -0,0 +1,217 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Data for creating an incident user-defined field. */ +@JsonPropertyOrder({ + IncidentUserDefinedFieldCreateData.JSON_PROPERTY_ATTRIBUTES, + IncidentUserDefinedFieldCreateData.JSON_PROPERTY_RELATIONSHIPS, + IncidentUserDefinedFieldCreateData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class IncidentUserDefinedFieldCreateData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private IncidentUserDefinedFieldAttributesCreateRequest attributes; + + public static final String JSON_PROPERTY_RELATIONSHIPS = "relationships"; + private IncidentUserDefinedFieldCreateRelationships relationships; + + public static final String JSON_PROPERTY_TYPE = "type"; + private IncidentUserDefinedFieldType type; + + public IncidentUserDefinedFieldCreateData() {} + + @JsonCreator + public IncidentUserDefinedFieldCreateData( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + IncidentUserDefinedFieldAttributesCreateRequest attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_RELATIONSHIPS) + IncidentUserDefinedFieldCreateRelationships relationships, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) + IncidentUserDefinedFieldType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.relationships = relationships; + this.unparsed |= relationships.unparsed; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public IncidentUserDefinedFieldCreateData attributes( + IncidentUserDefinedFieldAttributesCreateRequest attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes for creating an incident user-defined field. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public IncidentUserDefinedFieldAttributesCreateRequest getAttributes() { + return attributes; + } + + public void setAttributes(IncidentUserDefinedFieldAttributesCreateRequest attributes) { + this.attributes = attributes; + } + + public IncidentUserDefinedFieldCreateData relationships( + IncidentUserDefinedFieldCreateRelationships relationships) { + this.relationships = relationships; + this.unparsed |= relationships.unparsed; + return this; + } + + /** + * Relationships for creating an incident user-defined field. + * + * @return relationships + */ + @JsonProperty(JSON_PROPERTY_RELATIONSHIPS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public IncidentUserDefinedFieldCreateRelationships getRelationships() { + return relationships; + } + + public void setRelationships(IncidentUserDefinedFieldCreateRelationships relationships) { + this.relationships = relationships; + } + + public IncidentUserDefinedFieldCreateData type(IncidentUserDefinedFieldType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * The incident user defined fields type. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public IncidentUserDefinedFieldType getType() { + return type; + } + + public void setType(IncidentUserDefinedFieldType 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 IncidentUserDefinedFieldCreateData + */ + @JsonAnySetter + public IncidentUserDefinedFieldCreateData 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 IncidentUserDefinedFieldCreateData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IncidentUserDefinedFieldCreateData incidentUserDefinedFieldCreateData = + (IncidentUserDefinedFieldCreateData) o; + return Objects.equals(this.attributes, incidentUserDefinedFieldCreateData.attributes) + && Objects.equals(this.relationships, incidentUserDefinedFieldCreateData.relationships) + && Objects.equals(this.type, incidentUserDefinedFieldCreateData.type) + && Objects.equals( + this.additionalProperties, incidentUserDefinedFieldCreateData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, relationships, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IncidentUserDefinedFieldCreateData {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" relationships: ").append(toIndentedString(relationships)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/IncidentUserDefinedFieldCreateRelationships.java b/src/main/java/com/datadog/api/client/v2/model/IncidentUserDefinedFieldCreateRelationships.java new file mode 100644 index 00000000000..c4ae0386d3c --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/IncidentUserDefinedFieldCreateRelationships.java @@ -0,0 +1,152 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Relationships for creating an incident user-defined field. */ +@JsonPropertyOrder({IncidentUserDefinedFieldCreateRelationships.JSON_PROPERTY_INCIDENT_TYPE}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class IncidentUserDefinedFieldCreateRelationships { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_INCIDENT_TYPE = "incident_type"; + private RelationshipToIncidentType incidentType; + + public IncidentUserDefinedFieldCreateRelationships() {} + + @JsonCreator + public IncidentUserDefinedFieldCreateRelationships( + @JsonProperty(required = true, value = JSON_PROPERTY_INCIDENT_TYPE) + RelationshipToIncidentType incidentType) { + this.incidentType = incidentType; + this.unparsed |= incidentType.unparsed; + } + + public IncidentUserDefinedFieldCreateRelationships incidentType( + RelationshipToIncidentType incidentType) { + this.incidentType = incidentType; + this.unparsed |= incidentType.unparsed; + return this; + } + + /** + * Relationship to an incident type. + * + * @return incidentType + */ + @JsonProperty(JSON_PROPERTY_INCIDENT_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public RelationshipToIncidentType getIncidentType() { + return incidentType; + } + + public void setIncidentType(RelationshipToIncidentType incidentType) { + this.incidentType = incidentType; + } + + /** + * 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 IncidentUserDefinedFieldCreateRelationships + */ + @JsonAnySetter + public IncidentUserDefinedFieldCreateRelationships 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 IncidentUserDefinedFieldCreateRelationships object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IncidentUserDefinedFieldCreateRelationships incidentUserDefinedFieldCreateRelationships = + (IncidentUserDefinedFieldCreateRelationships) o; + return Objects.equals( + this.incidentType, incidentUserDefinedFieldCreateRelationships.incidentType) + && Objects.equals( + this.additionalProperties, + incidentUserDefinedFieldCreateRelationships.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(incidentType, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IncidentUserDefinedFieldCreateRelationships {\n"); + sb.append(" incidentType: ").append(toIndentedString(incidentType)).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/IncidentUserDefinedFieldCreateRequest.java b/src/main/java/com/datadog/api/client/v2/model/IncidentUserDefinedFieldCreateRequest.java new file mode 100644 index 00000000000..1652cec616a --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/IncidentUserDefinedFieldCreateRequest.java @@ -0,0 +1,148 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Request body for creating an incident user-defined field. */ +@JsonPropertyOrder({IncidentUserDefinedFieldCreateRequest.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class IncidentUserDefinedFieldCreateRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private IncidentUserDefinedFieldCreateData data; + + public IncidentUserDefinedFieldCreateRequest() {} + + @JsonCreator + public IncidentUserDefinedFieldCreateRequest( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) + IncidentUserDefinedFieldCreateData data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public IncidentUserDefinedFieldCreateRequest data(IncidentUserDefinedFieldCreateData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Data for creating an incident user-defined field. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public IncidentUserDefinedFieldCreateData getData() { + return data; + } + + public void setData(IncidentUserDefinedFieldCreateData 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 IncidentUserDefinedFieldCreateRequest + */ + @JsonAnySetter + public IncidentUserDefinedFieldCreateRequest 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 IncidentUserDefinedFieldCreateRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IncidentUserDefinedFieldCreateRequest incidentUserDefinedFieldCreateRequest = + (IncidentUserDefinedFieldCreateRequest) o; + return Objects.equals(this.data, incidentUserDefinedFieldCreateRequest.data) + && Objects.equals( + this.additionalProperties, incidentUserDefinedFieldCreateRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IncidentUserDefinedFieldCreateRequest {\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/IncidentUserDefinedFieldFieldType.java b/src/main/java/com/datadog/api/client/v2/model/IncidentUserDefinedFieldFieldType.java new file mode 100644 index 00000000000..8070cdf8475 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/IncidentUserDefinedFieldFieldType.java @@ -0,0 +1,75 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** + * The data type of the field. 1=dropdown, 2=multiselect, 3=textbox, 4=textarray, 5=metrictag, + * 6=autocomplete, 7=number, 8=datetime. + */ +@JsonSerialize( + using = IncidentUserDefinedFieldFieldType.IncidentUserDefinedFieldFieldTypeSerializer.class) +public class IncidentUserDefinedFieldFieldType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList(1, 2, 3, 4, 5, 6, 7, 8)); + + public static final IncidentUserDefinedFieldFieldType DROPDOWN = + new IncidentUserDefinedFieldFieldType(1); + public static final IncidentUserDefinedFieldFieldType MULTISELECT = + new IncidentUserDefinedFieldFieldType(2); + public static final IncidentUserDefinedFieldFieldType TEXTBOX = + new IncidentUserDefinedFieldFieldType(3); + public static final IncidentUserDefinedFieldFieldType TEXTARRAY = + new IncidentUserDefinedFieldFieldType(4); + public static final IncidentUserDefinedFieldFieldType METRICTAG = + new IncidentUserDefinedFieldFieldType(5); + public static final IncidentUserDefinedFieldFieldType AUTOCOMPLETE = + new IncidentUserDefinedFieldFieldType(6); + public static final IncidentUserDefinedFieldFieldType NUMBER = + new IncidentUserDefinedFieldFieldType(7); + public static final IncidentUserDefinedFieldFieldType DATETIME = + new IncidentUserDefinedFieldFieldType(8); + + IncidentUserDefinedFieldFieldType(Integer value) { + super(value, allowedValues); + } + + public static class IncidentUserDefinedFieldFieldTypeSerializer + extends StdSerializer { + public IncidentUserDefinedFieldFieldTypeSerializer(Class t) { + super(t); + } + + public IncidentUserDefinedFieldFieldTypeSerializer() { + this(null); + } + + @Override + public void serialize( + IncidentUserDefinedFieldFieldType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static IncidentUserDefinedFieldFieldType fromValue(Integer value) { + return new IncidentUserDefinedFieldFieldType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/IncidentUserDefinedFieldImportRequest.java b/src/main/java/com/datadog/api/client/v2/model/IncidentUserDefinedFieldImportRequest.java new file mode 100644 index 00000000000..a7c055f6de1 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/IncidentUserDefinedFieldImportRequest.java @@ -0,0 +1,141 @@ +/* + * 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.io.File; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** + * Multipart form data for importing valid values for an incident user-defined field from a CSV + * file. + */ +@JsonPropertyOrder({IncidentUserDefinedFieldImportRequest.JSON_PROPERTY_FILE}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class IncidentUserDefinedFieldImportRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_FILE = "file"; + private File file; + + public IncidentUserDefinedFieldImportRequest file(File file) { + this.file = file; + return this; + } + + /** + * A CSV file where each distinct value in the first column is imported as a valid value. + * + * @return file + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FILE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public File getFile() { + return file; + } + + public void setFile(File file) { + this.file = file; + } + + /** + * 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 IncidentUserDefinedFieldImportRequest + */ + @JsonAnySetter + public IncidentUserDefinedFieldImportRequest 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 IncidentUserDefinedFieldImportRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IncidentUserDefinedFieldImportRequest incidentUserDefinedFieldImportRequest = + (IncidentUserDefinedFieldImportRequest) o; + return Objects.equals(this.file, incidentUserDefinedFieldImportRequest.file) + && Objects.equals( + this.additionalProperties, incidentUserDefinedFieldImportRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(file, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IncidentUserDefinedFieldImportRequest {\n"); + sb.append(" file: ").append(toIndentedString(file)).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/IncidentUserDefinedFieldListMeta.java b/src/main/java/com/datadog/api/client/v2/model/IncidentUserDefinedFieldListMeta.java new file mode 100644 index 00000000000..70613797efa --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/IncidentUserDefinedFieldListMeta.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; + +/** Pagination metadata for the user-defined field list response. */ +@JsonPropertyOrder({ + IncidentUserDefinedFieldListMeta.JSON_PROPERTY_PAGE_OFFSET, + IncidentUserDefinedFieldListMeta.JSON_PROPERTY_TOTAL +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class IncidentUserDefinedFieldListMeta { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_PAGE_OFFSET = "page_offset"; + private Long pageOffset; + + public static final String JSON_PROPERTY_TOTAL = "total"; + private Long total; + + public IncidentUserDefinedFieldListMeta() {} + + @JsonCreator + public IncidentUserDefinedFieldListMeta( + @JsonProperty(required = true, value = JSON_PROPERTY_PAGE_OFFSET) Long pageOffset, + @JsonProperty(required = true, value = JSON_PROPERTY_TOTAL) Long total) { + this.pageOffset = pageOffset; + this.total = total; + } + + public IncidentUserDefinedFieldListMeta pageOffset(Long pageOffset) { + this.pageOffset = pageOffset; + return this; + } + + /** + * The offset of the current page. + * + * @return pageOffset + */ + @JsonProperty(JSON_PROPERTY_PAGE_OFFSET) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Long getPageOffset() { + return pageOffset; + } + + public void setPageOffset(Long pageOffset) { + this.pageOffset = pageOffset; + } + + public IncidentUserDefinedFieldListMeta total(Long total) { + this.total = total; + return this; + } + + /** + * The total number of items in the current page. + * + * @return total + */ + @JsonProperty(JSON_PROPERTY_TOTAL) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Long getTotal() { + return total; + } + + public void setTotal(Long total) { + this.total = total; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return IncidentUserDefinedFieldListMeta + */ + @JsonAnySetter + public IncidentUserDefinedFieldListMeta 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 IncidentUserDefinedFieldListMeta object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IncidentUserDefinedFieldListMeta incidentUserDefinedFieldListMeta = + (IncidentUserDefinedFieldListMeta) o; + return Objects.equals(this.pageOffset, incidentUserDefinedFieldListMeta.pageOffset) + && Objects.equals(this.total, incidentUserDefinedFieldListMeta.total) + && Objects.equals( + this.additionalProperties, incidentUserDefinedFieldListMeta.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(pageOffset, total, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IncidentUserDefinedFieldListMeta {\n"); + sb.append(" pageOffset: ").append(toIndentedString(pageOffset)).append("\n"); + sb.append(" total: ").append(toIndentedString(total)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/IncidentUserDefinedFieldListResponse.java b/src/main/java/com/datadog/api/client/v2/model/IncidentUserDefinedFieldListResponse.java new file mode 100644 index 00000000000..43da5b3be5f --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/IncidentUserDefinedFieldListResponse.java @@ -0,0 +1,192 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** Response containing a list of incident user-defined fields. */ +@JsonPropertyOrder({ + IncidentUserDefinedFieldListResponse.JSON_PROPERTY_DATA, + IncidentUserDefinedFieldListResponse.JSON_PROPERTY_META +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class IncidentUserDefinedFieldListResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private List data = new ArrayList<>(); + + public static final String JSON_PROPERTY_META = "meta"; + private IncidentUserDefinedFieldListMeta meta; + + public IncidentUserDefinedFieldListResponse() {} + + @JsonCreator + public IncidentUserDefinedFieldListResponse( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) + List data, + @JsonProperty(required = true, value = JSON_PROPERTY_META) + IncidentUserDefinedFieldListMeta meta) { + this.data = data; + this.meta = meta; + this.unparsed |= meta.unparsed; + } + + public IncidentUserDefinedFieldListResponse data( + List data) { + this.data = data; + for (IncidentUserDefinedFieldResponseData item : data) { + this.unparsed |= item.unparsed; + } + return this; + } + + public IncidentUserDefinedFieldListResponse addDataItem( + IncidentUserDefinedFieldResponseData dataItem) { + this.data.add(dataItem); + this.unparsed |= dataItem.unparsed; + return this; + } + + /** + * An array of user-defined field objects. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } + + public IncidentUserDefinedFieldListResponse meta(IncidentUserDefinedFieldListMeta meta) { + this.meta = meta; + this.unparsed |= meta.unparsed; + return this; + } + + /** + * Pagination metadata for the user-defined field list response. + * + * @return meta + */ + @JsonProperty(JSON_PROPERTY_META) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public IncidentUserDefinedFieldListMeta getMeta() { + return meta; + } + + public void setMeta(IncidentUserDefinedFieldListMeta meta) { + this.meta = meta; + } + + /** + * 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 IncidentUserDefinedFieldListResponse + */ + @JsonAnySetter + public IncidentUserDefinedFieldListResponse 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 IncidentUserDefinedFieldListResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IncidentUserDefinedFieldListResponse incidentUserDefinedFieldListResponse = + (IncidentUserDefinedFieldListResponse) o; + return Objects.equals(this.data, incidentUserDefinedFieldListResponse.data) + && Objects.equals(this.meta, incidentUserDefinedFieldListResponse.meta) + && Objects.equals( + this.additionalProperties, incidentUserDefinedFieldListResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, meta, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IncidentUserDefinedFieldListResponse {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" meta: ").append(toIndentedString(meta)).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/IncidentUserDefinedFieldMetadata.java b/src/main/java/com/datadog/api/client/v2/model/IncidentUserDefinedFieldMetadata.java new file mode 100644 index 00000000000..6e5846983c8 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/IncidentUserDefinedFieldMetadata.java @@ -0,0 +1,306 @@ +/* + * 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; + +/** + * Metadata for autocomplete-type user-defined fields, describing how to populate autocomplete + * options. + */ +@JsonPropertyOrder({ + IncidentUserDefinedFieldMetadata.JSON_PROPERTY_CATEGORY, + IncidentUserDefinedFieldMetadata.JSON_PROPERTY_SEARCH_LIMIT_PARAM, + IncidentUserDefinedFieldMetadata.JSON_PROPERTY_SEARCH_PARAMS, + IncidentUserDefinedFieldMetadata.JSON_PROPERTY_SEARCH_QUERY_PARAM, + IncidentUserDefinedFieldMetadata.JSON_PROPERTY_SEARCH_RESULT_PATH, + IncidentUserDefinedFieldMetadata.JSON_PROPERTY_SEARCH_URL +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class IncidentUserDefinedFieldMetadata { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_CATEGORY = "category"; + private String category; + + public static final String JSON_PROPERTY_SEARCH_LIMIT_PARAM = "search_limit_param"; + private String searchLimitParam; + + public static final String JSON_PROPERTY_SEARCH_PARAMS = "search_params"; + private Map searchParams = new HashMap(); + + public static final String JSON_PROPERTY_SEARCH_QUERY_PARAM = "search_query_param"; + private String searchQueryParam; + + public static final String JSON_PROPERTY_SEARCH_RESULT_PATH = "search_result_path"; + private String searchResultPath; + + public static final String JSON_PROPERTY_SEARCH_URL = "search_url"; + private String searchUrl; + + public IncidentUserDefinedFieldMetadata() {} + + @JsonCreator + public IncidentUserDefinedFieldMetadata( + @JsonProperty(required = true, value = JSON_PROPERTY_CATEGORY) String category, + @JsonProperty(required = true, value = JSON_PROPERTY_SEARCH_LIMIT_PARAM) + String searchLimitParam, + @JsonProperty(required = true, value = JSON_PROPERTY_SEARCH_PARAMS) + Map searchParams, + @JsonProperty(required = true, value = JSON_PROPERTY_SEARCH_QUERY_PARAM) + String searchQueryParam, + @JsonProperty(required = true, value = JSON_PROPERTY_SEARCH_RESULT_PATH) + String searchResultPath, + @JsonProperty(required = true, value = JSON_PROPERTY_SEARCH_URL) String searchUrl) { + this.category = category; + this.searchLimitParam = searchLimitParam; + this.searchParams = searchParams; + this.searchQueryParam = searchQueryParam; + this.searchResultPath = searchResultPath; + this.searchUrl = searchUrl; + } + + public IncidentUserDefinedFieldMetadata category(String category) { + this.category = category; + return this; + } + + /** + * The category of the autocomplete source. + * + * @return category + */ + @JsonProperty(JSON_PROPERTY_CATEGORY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getCategory() { + return category; + } + + public void setCategory(String category) { + this.category = category; + } + + public IncidentUserDefinedFieldMetadata searchLimitParam(String searchLimitParam) { + this.searchLimitParam = searchLimitParam; + return this; + } + + /** + * The query parameter used to limit the number of autocomplete results. + * + * @return searchLimitParam + */ + @JsonProperty(JSON_PROPERTY_SEARCH_LIMIT_PARAM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getSearchLimitParam() { + return searchLimitParam; + } + + public void setSearchLimitParam(String searchLimitParam) { + this.searchLimitParam = searchLimitParam; + } + + public IncidentUserDefinedFieldMetadata searchParams(Map searchParams) { + this.searchParams = searchParams; + return this; + } + + public IncidentUserDefinedFieldMetadata putSearchParamsItem(String key, Object searchParamsItem) { + this.searchParams.put(key, searchParamsItem); + return this; + } + + /** + * Additional query parameters to include in the search URL. + * + * @return searchParams + */ + @JsonProperty(JSON_PROPERTY_SEARCH_PARAMS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Map getSearchParams() { + return searchParams; + } + + public void setSearchParams(Map searchParams) { + this.searchParams = searchParams; + } + + public IncidentUserDefinedFieldMetadata searchQueryParam(String searchQueryParam) { + this.searchQueryParam = searchQueryParam; + return this; + } + + /** + * The query parameter used to pass typed input to the search URL. + * + * @return searchQueryParam + */ + @JsonProperty(JSON_PROPERTY_SEARCH_QUERY_PARAM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getSearchQueryParam() { + return searchQueryParam; + } + + public void setSearchQueryParam(String searchQueryParam) { + this.searchQueryParam = searchQueryParam; + } + + public IncidentUserDefinedFieldMetadata searchResultPath(String searchResultPath) { + this.searchResultPath = searchResultPath; + return this; + } + + /** + * The JSON path to the results in the response body. + * + * @return searchResultPath + */ + @JsonProperty(JSON_PROPERTY_SEARCH_RESULT_PATH) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getSearchResultPath() { + return searchResultPath; + } + + public void setSearchResultPath(String searchResultPath) { + this.searchResultPath = searchResultPath; + } + + public IncidentUserDefinedFieldMetadata searchUrl(String searchUrl) { + this.searchUrl = searchUrl; + return this; + } + + /** + * The URL used to populate autocomplete options. + * + * @return searchUrl + */ + @JsonProperty(JSON_PROPERTY_SEARCH_URL) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getSearchUrl() { + return searchUrl; + } + + public void setSearchUrl(String searchUrl) { + this.searchUrl = searchUrl; + } + + /** + * 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 IncidentUserDefinedFieldMetadata + */ + @JsonAnySetter + public IncidentUserDefinedFieldMetadata 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 IncidentUserDefinedFieldMetadata object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IncidentUserDefinedFieldMetadata incidentUserDefinedFieldMetadata = + (IncidentUserDefinedFieldMetadata) o; + return Objects.equals(this.category, incidentUserDefinedFieldMetadata.category) + && Objects.equals(this.searchLimitParam, incidentUserDefinedFieldMetadata.searchLimitParam) + && Objects.equals(this.searchParams, incidentUserDefinedFieldMetadata.searchParams) + && Objects.equals(this.searchQueryParam, incidentUserDefinedFieldMetadata.searchQueryParam) + && Objects.equals(this.searchResultPath, incidentUserDefinedFieldMetadata.searchResultPath) + && Objects.equals(this.searchUrl, incidentUserDefinedFieldMetadata.searchUrl) + && Objects.equals( + this.additionalProperties, incidentUserDefinedFieldMetadata.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + category, + searchLimitParam, + searchParams, + searchQueryParam, + searchResultPath, + searchUrl, + additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IncidentUserDefinedFieldMetadata {\n"); + sb.append(" category: ").append(toIndentedString(category)).append("\n"); + sb.append(" searchLimitParam: ").append(toIndentedString(searchLimitParam)).append("\n"); + sb.append(" searchParams: ").append(toIndentedString(searchParams)).append("\n"); + sb.append(" searchQueryParam: ").append(toIndentedString(searchQueryParam)).append("\n"); + sb.append(" searchResultPath: ").append(toIndentedString(searchResultPath)).append("\n"); + sb.append(" searchUrl: ").append(toIndentedString(searchUrl)).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/IncidentUserDefinedFieldRelationships.java b/src/main/java/com/datadog/api/client/v2/model/IncidentUserDefinedFieldRelationships.java new file mode 100644 index 00000000000..af527cfba3f --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/IncidentUserDefinedFieldRelationships.java @@ -0,0 +1,215 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Relationships of an incident user-defined field. */ +@JsonPropertyOrder({ + IncidentUserDefinedFieldRelationships.JSON_PROPERTY_CREATED_BY_USER, + IncidentUserDefinedFieldRelationships.JSON_PROPERTY_INCIDENT_TYPE, + IncidentUserDefinedFieldRelationships.JSON_PROPERTY_LAST_MODIFIED_BY_USER +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class IncidentUserDefinedFieldRelationships { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_CREATED_BY_USER = "created_by_user"; + private RelationshipToUser createdByUser; + + public static final String JSON_PROPERTY_INCIDENT_TYPE = "incident_type"; + private RelationshipToIncidentType incidentType; + + public static final String JSON_PROPERTY_LAST_MODIFIED_BY_USER = "last_modified_by_user"; + private RelationshipToUser lastModifiedByUser; + + public IncidentUserDefinedFieldRelationships() {} + + @JsonCreator + public IncidentUserDefinedFieldRelationships( + @JsonProperty(required = true, value = JSON_PROPERTY_CREATED_BY_USER) + RelationshipToUser createdByUser, + @JsonProperty(required = true, value = JSON_PROPERTY_INCIDENT_TYPE) + RelationshipToIncidentType incidentType, + @JsonProperty(required = true, value = JSON_PROPERTY_LAST_MODIFIED_BY_USER) + RelationshipToUser lastModifiedByUser) { + this.createdByUser = createdByUser; + this.unparsed |= createdByUser.unparsed; + this.incidentType = incidentType; + this.unparsed |= incidentType.unparsed; + this.lastModifiedByUser = lastModifiedByUser; + this.unparsed |= lastModifiedByUser.unparsed; + } + + public IncidentUserDefinedFieldRelationships createdByUser(RelationshipToUser createdByUser) { + this.createdByUser = createdByUser; + this.unparsed |= createdByUser.unparsed; + return this; + } + + /** + * Relationship to user. + * + * @return createdByUser + */ + @JsonProperty(JSON_PROPERTY_CREATED_BY_USER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public RelationshipToUser getCreatedByUser() { + return createdByUser; + } + + public void setCreatedByUser(RelationshipToUser createdByUser) { + this.createdByUser = createdByUser; + } + + public IncidentUserDefinedFieldRelationships incidentType( + RelationshipToIncidentType incidentType) { + this.incidentType = incidentType; + this.unparsed |= incidentType.unparsed; + return this; + } + + /** + * Relationship to an incident type. + * + * @return incidentType + */ + @JsonProperty(JSON_PROPERTY_INCIDENT_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public RelationshipToIncidentType getIncidentType() { + return incidentType; + } + + public void setIncidentType(RelationshipToIncidentType incidentType) { + this.incidentType = incidentType; + } + + public IncidentUserDefinedFieldRelationships lastModifiedByUser( + RelationshipToUser lastModifiedByUser) { + this.lastModifiedByUser = lastModifiedByUser; + this.unparsed |= lastModifiedByUser.unparsed; + return this; + } + + /** + * Relationship to user. + * + * @return lastModifiedByUser + */ + @JsonProperty(JSON_PROPERTY_LAST_MODIFIED_BY_USER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public RelationshipToUser getLastModifiedByUser() { + return lastModifiedByUser; + } + + public void setLastModifiedByUser(RelationshipToUser lastModifiedByUser) { + this.lastModifiedByUser = lastModifiedByUser; + } + + /** + * 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 IncidentUserDefinedFieldRelationships + */ + @JsonAnySetter + public IncidentUserDefinedFieldRelationships 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 IncidentUserDefinedFieldRelationships object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IncidentUserDefinedFieldRelationships incidentUserDefinedFieldRelationships = + (IncidentUserDefinedFieldRelationships) o; + return Objects.equals(this.createdByUser, incidentUserDefinedFieldRelationships.createdByUser) + && Objects.equals(this.incidentType, incidentUserDefinedFieldRelationships.incidentType) + && Objects.equals( + this.lastModifiedByUser, incidentUserDefinedFieldRelationships.lastModifiedByUser) + && Objects.equals( + this.additionalProperties, incidentUserDefinedFieldRelationships.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(createdByUser, incidentType, lastModifiedByUser, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IncidentUserDefinedFieldRelationships {\n"); + sb.append(" createdByUser: ").append(toIndentedString(createdByUser)).append("\n"); + sb.append(" incidentType: ").append(toIndentedString(incidentType)).append("\n"); + sb.append(" lastModifiedByUser: ").append(toIndentedString(lastModifiedByUser)).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/IncidentUserDefinedFieldResponse.java b/src/main/java/com/datadog/api/client/v2/model/IncidentUserDefinedFieldResponse.java new file mode 100644 index 00000000000..aa879d41e96 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/IncidentUserDefinedFieldResponse.java @@ -0,0 +1,148 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Response containing a single incident user-defined field. */ +@JsonPropertyOrder({IncidentUserDefinedFieldResponse.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class IncidentUserDefinedFieldResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private IncidentUserDefinedFieldResponseData data; + + public IncidentUserDefinedFieldResponse() {} + + @JsonCreator + public IncidentUserDefinedFieldResponse( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) + IncidentUserDefinedFieldResponseData data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public IncidentUserDefinedFieldResponse data(IncidentUserDefinedFieldResponseData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Data object for an incident user-defined field response. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public IncidentUserDefinedFieldResponseData getData() { + return data; + } + + public void setData(IncidentUserDefinedFieldResponseData 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 IncidentUserDefinedFieldResponse + */ + @JsonAnySetter + public IncidentUserDefinedFieldResponse 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 IncidentUserDefinedFieldResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IncidentUserDefinedFieldResponse incidentUserDefinedFieldResponse = + (IncidentUserDefinedFieldResponse) o; + return Objects.equals(this.data, incidentUserDefinedFieldResponse.data) + && Objects.equals( + this.additionalProperties, incidentUserDefinedFieldResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IncidentUserDefinedFieldResponse {\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/IncidentUserDefinedFieldResponseData.java b/src/main/java/com/datadog/api/client/v2/model/IncidentUserDefinedFieldResponseData.java new file mode 100644 index 00000000000..66f3daf7bc1 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/IncidentUserDefinedFieldResponseData.java @@ -0,0 +1,245 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Data object for an incident user-defined field response. */ +@JsonPropertyOrder({ + IncidentUserDefinedFieldResponseData.JSON_PROPERTY_ATTRIBUTES, + IncidentUserDefinedFieldResponseData.JSON_PROPERTY_ID, + IncidentUserDefinedFieldResponseData.JSON_PROPERTY_RELATIONSHIPS, + IncidentUserDefinedFieldResponseData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class IncidentUserDefinedFieldResponseData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private IncidentUserDefinedFieldAttributesResponse attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_RELATIONSHIPS = "relationships"; + private IncidentUserDefinedFieldRelationships relationships; + + public static final String JSON_PROPERTY_TYPE = "type"; + private IncidentUserDefinedFieldType type; + + public IncidentUserDefinedFieldResponseData() {} + + @JsonCreator + public IncidentUserDefinedFieldResponseData( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + IncidentUserDefinedFieldAttributesResponse attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_RELATIONSHIPS) + IncidentUserDefinedFieldRelationships relationships, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) + IncidentUserDefinedFieldType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.id = id; + this.relationships = relationships; + this.unparsed |= relationships.unparsed; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public IncidentUserDefinedFieldResponseData attributes( + IncidentUserDefinedFieldAttributesResponse attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes of an incident user-defined field. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public IncidentUserDefinedFieldAttributesResponse getAttributes() { + return attributes; + } + + public void setAttributes(IncidentUserDefinedFieldAttributesResponse attributes) { + this.attributes = attributes; + } + + public IncidentUserDefinedFieldResponseData id(String id) { + this.id = id; + return this; + } + + /** + * The unique identifier of the user-defined field. + * + * @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 IncidentUserDefinedFieldResponseData relationships( + IncidentUserDefinedFieldRelationships relationships) { + this.relationships = relationships; + this.unparsed |= relationships.unparsed; + return this; + } + + /** + * Relationships of an incident user-defined field. + * + * @return relationships + */ + @JsonProperty(JSON_PROPERTY_RELATIONSHIPS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public IncidentUserDefinedFieldRelationships getRelationships() { + return relationships; + } + + public void setRelationships(IncidentUserDefinedFieldRelationships relationships) { + this.relationships = relationships; + } + + public IncidentUserDefinedFieldResponseData type(IncidentUserDefinedFieldType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * The incident user defined fields type. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public IncidentUserDefinedFieldType getType() { + return type; + } + + public void setType(IncidentUserDefinedFieldType 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 IncidentUserDefinedFieldResponseData + */ + @JsonAnySetter + public IncidentUserDefinedFieldResponseData 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 IncidentUserDefinedFieldResponseData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IncidentUserDefinedFieldResponseData incidentUserDefinedFieldResponseData = + (IncidentUserDefinedFieldResponseData) o; + return Objects.equals(this.attributes, incidentUserDefinedFieldResponseData.attributes) + && Objects.equals(this.id, incidentUserDefinedFieldResponseData.id) + && Objects.equals(this.relationships, incidentUserDefinedFieldResponseData.relationships) + && Objects.equals(this.type, incidentUserDefinedFieldResponseData.type) + && Objects.equals( + this.additionalProperties, incidentUserDefinedFieldResponseData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, relationships, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IncidentUserDefinedFieldResponseData {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" relationships: ").append(toIndentedString(relationships)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/IncidentUserDefinedFieldUpdateData.java b/src/main/java/com/datadog/api/client/v2/model/IncidentUserDefinedFieldUpdateData.java new file mode 100644 index 00000000000..6b686dc7fd1 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/IncidentUserDefinedFieldUpdateData.java @@ -0,0 +1,213 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Data for updating an incident user-defined field. */ +@JsonPropertyOrder({ + IncidentUserDefinedFieldUpdateData.JSON_PROPERTY_ATTRIBUTES, + IncidentUserDefinedFieldUpdateData.JSON_PROPERTY_ID, + IncidentUserDefinedFieldUpdateData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class IncidentUserDefinedFieldUpdateData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private IncidentUserDefinedFieldAttributesUpdateRequest attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private IncidentUserDefinedFieldType type; + + public IncidentUserDefinedFieldUpdateData() {} + + @JsonCreator + public IncidentUserDefinedFieldUpdateData( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + IncidentUserDefinedFieldAttributesUpdateRequest attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) + IncidentUserDefinedFieldType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public IncidentUserDefinedFieldUpdateData attributes( + IncidentUserDefinedFieldAttributesUpdateRequest attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes for updating an incident user-defined field. All fields are optional. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public IncidentUserDefinedFieldAttributesUpdateRequest getAttributes() { + return attributes; + } + + public void setAttributes(IncidentUserDefinedFieldAttributesUpdateRequest attributes) { + this.attributes = attributes; + } + + public IncidentUserDefinedFieldUpdateData id(String id) { + this.id = id; + return this; + } + + /** + * The unique identifier of the user-defined field to update. + * + * @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 IncidentUserDefinedFieldUpdateData type(IncidentUserDefinedFieldType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * The incident user defined fields type. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public IncidentUserDefinedFieldType getType() { + return type; + } + + public void setType(IncidentUserDefinedFieldType 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 IncidentUserDefinedFieldUpdateData + */ + @JsonAnySetter + public IncidentUserDefinedFieldUpdateData 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 IncidentUserDefinedFieldUpdateData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IncidentUserDefinedFieldUpdateData incidentUserDefinedFieldUpdateData = + (IncidentUserDefinedFieldUpdateData) o; + return Objects.equals(this.attributes, incidentUserDefinedFieldUpdateData.attributes) + && Objects.equals(this.id, incidentUserDefinedFieldUpdateData.id) + && Objects.equals(this.type, incidentUserDefinedFieldUpdateData.type) + && Objects.equals( + this.additionalProperties, incidentUserDefinedFieldUpdateData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IncidentUserDefinedFieldUpdateData {\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/IncidentUserDefinedFieldUpdateRequest.java b/src/main/java/com/datadog/api/client/v2/model/IncidentUserDefinedFieldUpdateRequest.java new file mode 100644 index 00000000000..7b9b449347c --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/IncidentUserDefinedFieldUpdateRequest.java @@ -0,0 +1,148 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Request body for updating an incident user-defined field. */ +@JsonPropertyOrder({IncidentUserDefinedFieldUpdateRequest.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class IncidentUserDefinedFieldUpdateRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private IncidentUserDefinedFieldUpdateData data; + + public IncidentUserDefinedFieldUpdateRequest() {} + + @JsonCreator + public IncidentUserDefinedFieldUpdateRequest( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) + IncidentUserDefinedFieldUpdateData data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public IncidentUserDefinedFieldUpdateRequest data(IncidentUserDefinedFieldUpdateData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Data for updating an incident user-defined field. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public IncidentUserDefinedFieldUpdateData getData() { + return data; + } + + public void setData(IncidentUserDefinedFieldUpdateData 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 IncidentUserDefinedFieldUpdateRequest + */ + @JsonAnySetter + public IncidentUserDefinedFieldUpdateRequest 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 IncidentUserDefinedFieldUpdateRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IncidentUserDefinedFieldUpdateRequest incidentUserDefinedFieldUpdateRequest = + (IncidentUserDefinedFieldUpdateRequest) o; + return Objects.equals(this.data, incidentUserDefinedFieldUpdateRequest.data) + && Objects.equals( + this.additionalProperties, incidentUserDefinedFieldUpdateRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IncidentUserDefinedFieldUpdateRequest {\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/IncidentUserDefinedFieldValidValue.java b/src/main/java/com/datadog/api/client/v2/model/IncidentUserDefinedFieldValidValue.java new file mode 100644 index 00000000000..2404b187334 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/IncidentUserDefinedFieldValidValue.java @@ -0,0 +1,231 @@ +/* + * 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 valid value for an incident user-defined field. */ +@JsonPropertyOrder({ + IncidentUserDefinedFieldValidValue.JSON_PROPERTY_DESCRIPTION, + IncidentUserDefinedFieldValidValue.JSON_PROPERTY_DISPLAY_NAME, + IncidentUserDefinedFieldValidValue.JSON_PROPERTY_SHORT_DESCRIPTION, + IncidentUserDefinedFieldValidValue.JSON_PROPERTY_VALUE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class IncidentUserDefinedFieldValidValue { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DESCRIPTION = "description"; + private String description; + + public static final String JSON_PROPERTY_DISPLAY_NAME = "display_name"; + private String displayName; + + public static final String JSON_PROPERTY_SHORT_DESCRIPTION = "short_description"; + private String shortDescription; + + public static final String JSON_PROPERTY_VALUE = "value"; + private String value; + + public IncidentUserDefinedFieldValidValue() {} + + @JsonCreator + public IncidentUserDefinedFieldValidValue( + @JsonProperty(required = true, value = JSON_PROPERTY_DESCRIPTION) String description, + @JsonProperty(required = true, value = JSON_PROPERTY_DISPLAY_NAME) String displayName, + @JsonProperty(required = true, value = JSON_PROPERTY_VALUE) String value) { + this.description = description; + this.displayName = displayName; + this.value = value; + } + + public IncidentUserDefinedFieldValidValue description(String description) { + this.description = description; + return this; + } + + /** + * A detailed description of the valid value. + * + * @return description + */ + @JsonProperty(JSON_PROPERTY_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public IncidentUserDefinedFieldValidValue displayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * The human-readable display name for this value. + * + * @return displayName + */ + @JsonProperty(JSON_PROPERTY_DISPLAY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getDisplayName() { + return displayName; + } + + public void setDisplayName(String displayName) { + this.displayName = displayName; + } + + public IncidentUserDefinedFieldValidValue shortDescription(String shortDescription) { + this.shortDescription = shortDescription; + return this; + } + + /** + * A short description of the valid value. + * + * @return shortDescription + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SHORT_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getShortDescription() { + return shortDescription; + } + + public void setShortDescription(String shortDescription) { + this.shortDescription = shortDescription; + } + + public IncidentUserDefinedFieldValidValue value(String value) { + this.value = value; + return this; + } + + /** + * The machine-readable value stored when this option is selected. + * + * @return value + */ + @JsonProperty(JSON_PROPERTY_VALUE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return IncidentUserDefinedFieldValidValue + */ + @JsonAnySetter + public IncidentUserDefinedFieldValidValue 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 IncidentUserDefinedFieldValidValue object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IncidentUserDefinedFieldValidValue incidentUserDefinedFieldValidValue = + (IncidentUserDefinedFieldValidValue) o; + return Objects.equals(this.description, incidentUserDefinedFieldValidValue.description) + && Objects.equals(this.displayName, incidentUserDefinedFieldValidValue.displayName) + && Objects.equals( + this.shortDescription, incidentUserDefinedFieldValidValue.shortDescription) + && Objects.equals(this.value, incidentUserDefinedFieldValidValue.value) + && Objects.equals( + this.additionalProperties, incidentUserDefinedFieldValidValue.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(description, displayName, shortDescription, value, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IncidentUserDefinedFieldValidValue {\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" displayName: ").append(toIndentedString(displayName)).append("\n"); + sb.append(" shortDescription: ").append(toIndentedString(shortDescription)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/test/resources/com/datadog/api/client/v2/api/incidents.feature b/src/test/resources/com/datadog/api/client/v2/api/incidents.feature index 8b804137aff..1a9d0863a84 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/incidents.feature +++ b/src/test/resources/com/datadog/api/client/v2/api/incidents.feature @@ -186,6 +186,30 @@ Feature: Incidents When the request is sent Then the response status is 404 Not Found + @generated @skip @team:DataDog/incident-app + Scenario: Create an incident user-defined field returns "Bad Request" response + Given operation "CreateIncidentUserDefinedField" enabled + And new "CreateIncidentUserDefinedField" request + And body with value {"data": {"attributes": {"category": "what_happened", "collected": "active", "default_value": "critical", "display_name": "Root Cause", "name": "root_cause", "ordinal": "1.5", "required": false, "tag_key": "datacenter", "type": 3, "valid_values": [{"description": "A critical severity incident.", "display_name": "Critical", "short_description": "Critical", "value": "critical"}]}, "relationships": {"incident_type": {"data": {"id": "00000000-0000-0000-0000-000000000000", "type": "incident_types"}}}, "type": "user_defined_field"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/incident-app + Scenario: Create an incident user-defined field returns "CREATED" response + Given operation "CreateIncidentUserDefinedField" enabled + And new "CreateIncidentUserDefinedField" request + And body with value {"data": {"attributes": {"category": "what_happened", "collected": "active", "default_value": "critical", "display_name": "Root Cause", "name": "root_cause", "ordinal": "1.5", "required": false, "tag_key": "datacenter", "type": 3, "valid_values": [{"description": "A critical severity incident.", "display_name": "Critical", "short_description": "Critical", "value": "critical"}]}, "relationships": {"incident_type": {"data": {"id": "00000000-0000-0000-0000-000000000000", "type": "incident_types"}}}, "type": "user_defined_field"}} + When the request is sent + Then the response status is 201 CREATED + + @generated @skip @team:DataDog/incident-app + Scenario: Create an incident user-defined field returns "Not Found" response + Given operation "CreateIncidentUserDefinedField" enabled + And new "CreateIncidentUserDefinedField" request + And body with value {"data": {"attributes": {"category": "what_happened", "collected": "active", "default_value": "critical", "display_name": "Root Cause", "name": "root_cause", "ordinal": "1.5", "required": false, "tag_key": "datacenter", "type": 3, "valid_values": [{"description": "A critical severity incident.", "display_name": "Critical", "short_description": "Critical", "value": "critical"}]}, "relationships": {"incident_type": {"data": {"id": "00000000-0000-0000-0000-000000000000", "type": "incident_types"}}}, "type": "user_defined_field"}} + When the request is sent + Then the response status is 404 Not Found + @generated @skip @team:DataDog/incident-app Scenario: Create global incident handle returns "Bad Request" response Given operation "CreateGlobalIncidentHandle" enabled @@ -482,6 +506,30 @@ Feature: Incidents When the request is sent Then the response status is 204 OK + @generated @skip @team:DataDog/incident-app + Scenario: Delete an incident user-defined field returns "Bad Request" response + Given operation "DeleteIncidentUserDefinedField" enabled + And new "DeleteIncidentUserDefinedField" request + And request contains "field_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/incident-app + Scenario: Delete an incident user-defined field returns "No Content" response + Given operation "DeleteIncidentUserDefinedField" enabled + And new "DeleteIncidentUserDefinedField" request + And request contains "field_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 204 No Content + + @generated @skip @team:DataDog/incident-app + Scenario: Delete an incident user-defined field returns "Not Found" response + Given operation "DeleteIncidentUserDefinedField" enabled + And new "DeleteIncidentUserDefinedField" request + And request contains "field_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + @generated @skip @team:DataDog/incident-app Scenario: Delete global incident handle returns "Bad Request" response Given operation "DeleteGlobalIncidentHandle" enabled @@ -647,6 +695,20 @@ Feature: Incidents When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/incident-app + Scenario: Get a list of incident user-defined fields returns "Bad Request" response + Given operation "ListIncidentUserDefinedFields" enabled + And new "ListIncidentUserDefinedFields" request + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/incident-app + Scenario: Get a list of incident user-defined fields returns "OK" response + Given operation "ListIncidentUserDefinedFields" enabled + And new "ListIncidentUserDefinedFields" request + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/incident-app Scenario: Get a list of incidents returns "Bad Request" response Given operation "ListIncidents" enabled @@ -703,6 +765,22 @@ Feature: Incidents When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/incident-app + Scenario: Get an incident user-defined field returns "Not Found" response + Given operation "GetIncidentUserDefinedField" enabled + And new "GetIncidentUserDefinedField" request + And request contains "field_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/incident-app + Scenario: Get an incident user-defined field returns "OK" response + Given operation "GetIncidentUserDefinedField" enabled + And new "GetIncidentUserDefinedField" request + And request contains "field_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/incident-app Scenario: Get global incident settings returns "Bad Request" response Given operation "GetGlobalIncidentSettings" enabled @@ -927,6 +1005,30 @@ Feature: Incidents When the request is sent Then the response status is 404 Not Found + @generated @skip @team:DataDog/incident-app + Scenario: Import values for an incident user-defined field returns "Bad Request" response + Given operation "ImportIncidentUserDefinedFieldValues" enabled + And new "ImportIncidentUserDefinedFieldValues" request + And request contains "field_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/incident-app + Scenario: Import values for an incident user-defined field returns "CREATED" response + Given operation "ImportIncidentUserDefinedFieldValues" enabled + And new "ImportIncidentUserDefinedFieldValues" request + And request contains "field_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 201 CREATED + + @generated @skip @team:DataDog/incident-app + Scenario: Import values for an incident user-defined field returns "Not Found" response + Given operation "ImportIncidentUserDefinedFieldValues" enabled + And new "ImportIncidentUserDefinedFieldValues" request + And request contains "field_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + @generated @skip @team:DataDog/incident-app Scenario: List an incident's impacts returns "Bad Request" response Given new "ListIncidentImpacts" request @@ -1243,6 +1345,33 @@ Feature: Incidents When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/incident-app + Scenario: Update an incident user-defined field returns "Bad Request" response + Given operation "UpdateIncidentUserDefinedField" enabled + And new "UpdateIncidentUserDefinedField" request + And request contains "field_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"category": "what_happened", "collected": "active", "default_value": "critical", "display_name": "Root Cause", "ordinal": "1.5", "required": false, "valid_values": [{"description": "A critical severity incident.", "display_name": "Critical", "short_description": "Critical", "value": "critical"}]}, "id": "00000000-0000-0000-0000-000000000000", "type": "user_defined_field"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/incident-app + Scenario: Update an incident user-defined field returns "Not Found" response + Given operation "UpdateIncidentUserDefinedField" enabled + And new "UpdateIncidentUserDefinedField" request + And request contains "field_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"category": "what_happened", "collected": "active", "default_value": "critical", "display_name": "Root Cause", "ordinal": "1.5", "required": false, "valid_values": [{"description": "A critical severity incident.", "display_name": "Critical", "short_description": "Critical", "value": "critical"}]}, "id": "00000000-0000-0000-0000-000000000000", "type": "user_defined_field"}} + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/incident-app + Scenario: Update an incident user-defined field returns "OK" response + Given operation "UpdateIncidentUserDefinedField" enabled + And new "UpdateIncidentUserDefinedField" request + And request contains "field_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"category": "what_happened", "collected": "active", "default_value": "critical", "display_name": "Root Cause", "ordinal": "1.5", "required": false, "valid_values": [{"description": "A critical severity incident.", "display_name": "Critical", "short_description": "Critical", "value": "critical"}]}, "id": "00000000-0000-0000-0000-000000000000", "type": "user_defined_field"}} + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/incident-app Scenario: Update global incident handle returns "Bad Request" response Given operation "UpdateGlobalIncidentHandle" enabled 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 a04c9b283b9..c6a4a578ac1 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 @@ -1782,6 +1782,12 @@ "type": "unsafe" } }, + "ImportIncidentUserDefinedFieldValues": { + "tag": "Incidents", + "undo": { + "type": "unsafe" + } + }, "DeleteGlobalIncidentHandle": { "tag": "Incidents", "undo": { @@ -1968,6 +1974,43 @@ "type": "idempotent" } }, + "ListIncidentUserDefinedFields": { + "tag": "Incidents", + "undo": { + "type": "safe" + } + }, + "CreateIncidentUserDefinedField": { + "tag": "Incidents", + "undo": { + "operationId": "DeleteIncidentUserDefinedField", + "parameters": [ + { + "name": "field_id", + "source": "data.id" + } + ], + "type": "unsafe" + } + }, + "DeleteIncidentUserDefinedField": { + "tag": "Incidents", + "undo": { + "type": "idempotent" + } + }, + "GetIncidentUserDefinedField": { + "tag": "Incidents", + "undo": { + "type": "safe" + } + }, + "UpdateIncidentUserDefinedField": { + "tag": "Incidents", + "undo": { + "type": "idempotent" + } + }, "ImportIncident": { "tag": "Incidents", "undo": {