diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index f11972d91d0..729282fcdc1 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -9117,6 +9117,10 @@ components: $ref: '#/components/schemas/ServiceNowTicket' status: $ref: '#/components/schemas/CaseStatus' + status_group: + $ref: '#/components/schemas/CaseStatusGroup' + status_name: + $ref: '#/components/schemas/CaseStatusName' title: description: Title example: Memory leak investigation on API @@ -9183,6 +9187,8 @@ components: type: string priority: $ref: '#/components/schemas/CasePriority' + status_name: + $ref: '#/components/schemas/CaseStatusName' title: description: Title example: Security breach investigation @@ -9351,7 +9357,9 @@ components: - PRIORITY - STATUS CaseStatus: - description: Case status + deprecated: true + description: Deprecated way of representing the case status, which only supports + OPEN, IN_PROGRESS, and CLOSED statuses. Use `status_name` instead. enum: - OPEN - IN_PROGRESS @@ -9362,6 +9370,23 @@ components: - OPEN - IN_PROGRESS - CLOSED + CaseStatusGroup: + description: Status group of the case. + enum: + - SG_OPEN + - SG_IN_PROGRESS + - SG_CLOSED + example: SG_OPEN + type: string + x-enum-varnames: + - SG_OPEN + - SG_IN_PROGRESS + - SG_CLOSED + CaseStatusName: + description: Status of the case. Must be one of the existing statuses for the + case's type. + example: Open + type: string CaseTrigger: description: Trigger a workflow from a Case. For automatic triggering a handle must be configured and the workflow must be published. @@ -9585,8 +9610,9 @@ components: properties: status: $ref: '#/components/schemas/CaseStatus' - required: - - status + deprecated: true + status_name: + $ref: '#/components/schemas/CaseStatusName' type: object CaseUpdateStatusRequest: description: Case update status request diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index 5cfdf83ee17..76284714aa7 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -1410,6 +1410,7 @@ def overrides "v2.cases_response_meta" => "CasesResponseMeta", "v2.cases_response_meta_pagination" => "CasesResponseMetaPagination", "v2.case_status" => "CaseStatus", + "v2.case_status_group" => "CaseStatusGroup", "v2.case_trigger" => "CaseTrigger", "v2.case_trigger_wrapper" => "CaseTriggerWrapper", "v2.case_type" => "CaseType", diff --git a/lib/datadog_api_client/v2/models/case_attributes.rb b/lib/datadog_api_client/v2/models/case_attributes.rb index 122121e1d1f..09da57a0014 100644 --- a/lib/datadog_api_client/v2/models/case_attributes.rb +++ b/lib/datadog_api_client/v2/models/case_attributes.rb @@ -54,9 +54,15 @@ class CaseAttributes # ServiceNow ticket attached to case attr_accessor :service_now_ticket - # Case status + # Deprecated way of representing the case status, which only supports OPEN, IN_PROGRESS, and CLOSED statuses. Use `status_name` instead. attr_accessor :status + # Status group of the case. + attr_accessor :status_group + + # Status of the case. Must be one of the existing statuses for the case's type. + attr_accessor :status_name + # Title attr_accessor :title @@ -84,6 +90,8 @@ def self.attribute_map :'priority' => :'priority', :'service_now_ticket' => :'service_now_ticket', :'status' => :'status', + :'status_group' => :'status_group', + :'status_name' => :'status_name', :'title' => :'title', :'type' => :'type', :'type_id' => :'type_id' @@ -106,6 +114,8 @@ def self.openapi_types :'priority' => :'CasePriority', :'service_now_ticket' => :'ServiceNowTicket', :'status' => :'CaseStatus', + :'status_group' => :'CaseStatusGroup', + :'status_name' => :'String', :'title' => :'String', :'type' => :'CaseType', :'type_id' => :'String' @@ -190,6 +200,14 @@ def initialize(attributes = {}) self.status = attributes[:'status'] end + if attributes.key?(:'status_group') + self.status_group = attributes[:'status_group'] + end + + if attributes.key?(:'status_name') + self.status_name = attributes[:'status_name'] + end + if attributes.key?(:'title') self.title = attributes[:'title'] end @@ -241,6 +259,8 @@ def ==(o) priority == o.priority && service_now_ticket == o.service_now_ticket && status == o.status && + status_group == o.status_group && + status_name == o.status_name && title == o.title && type == o.type && type_id == o.type_id && @@ -251,7 +271,7 @@ def ==(o) # @return [Integer] Hash code # @!visibility private def hash - [archived_at, attributes, closed_at, created_at, custom_attributes, description, jira_issue, key, modified_at, priority, service_now_ticket, status, title, type, type_id, additional_properties].hash + [archived_at, attributes, closed_at, created_at, custom_attributes, description, jira_issue, key, modified_at, priority, service_now_ticket, status, status_group, status_name, title, type, type_id, additional_properties].hash end end end diff --git a/lib/datadog_api_client/v2/models/case_create_attributes.rb b/lib/datadog_api_client/v2/models/case_create_attributes.rb index f67e98b5e41..a86396ccc7b 100644 --- a/lib/datadog_api_client/v2/models/case_create_attributes.rb +++ b/lib/datadog_api_client/v2/models/case_create_attributes.rb @@ -30,6 +30,9 @@ class CaseCreateAttributes # Case priority attr_accessor :priority + # Status of the case. Must be one of the existing statuses for the case's type. + attr_accessor :status_name + # Title attr_reader :title @@ -45,6 +48,7 @@ def self.attribute_map :'custom_attributes' => :'custom_attributes', :'description' => :'description', :'priority' => :'priority', + :'status_name' => :'status_name', :'title' => :'title', :'type_id' => :'type_id' } @@ -57,6 +61,7 @@ def self.openapi_types :'custom_attributes' => :'Hash', :'description' => :'String', :'priority' => :'CasePriority', + :'status_name' => :'String', :'title' => :'String', :'type_id' => :'String' } @@ -92,6 +97,10 @@ def initialize(attributes = {}) self.priority = attributes[:'priority'] end + if attributes.key?(:'status_name') + self.status_name = attributes[:'status_name'] + end + if attributes.key?(:'title') self.title = attributes[:'title'] end @@ -159,6 +168,7 @@ def ==(o) custom_attributes == o.custom_attributes && description == o.description && priority == o.priority && + status_name == o.status_name && title == o.title && type_id == o.type_id && additional_properties == o.additional_properties @@ -168,7 +178,7 @@ def ==(o) # @return [Integer] Hash code # @!visibility private def hash - [custom_attributes, description, priority, title, type_id, additional_properties].hash + [custom_attributes, description, priority, status_name, title, type_id, additional_properties].hash end end end diff --git a/lib/datadog_api_client/v2/models/case_status.rb b/lib/datadog_api_client/v2/models/case_status.rb index ebbe55a6c3b..c56853816c7 100644 --- a/lib/datadog_api_client/v2/models/case_status.rb +++ b/lib/datadog_api_client/v2/models/case_status.rb @@ -17,7 +17,9 @@ require 'time' module DatadogAPIClient::V2 - # Case status + # Deprecated way of representing the case status, which only supports OPEN, IN_PROGRESS, and CLOSED statuses. Use `status_name` instead. + # + # @deprecated This model is deprecated. class CaseStatus include BaseEnumModel diff --git a/lib/datadog_api_client/v2/models/case_status_group.rb b/lib/datadog_api_client/v2/models/case_status_group.rb new file mode 100644 index 00000000000..e4de0c15bb8 --- /dev/null +++ b/lib/datadog_api_client/v2/models/case_status_group.rb @@ -0,0 +1,28 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Status group of the case. + class CaseStatusGroup + include BaseEnumModel + + SG_OPEN = "SG_OPEN".freeze + SG_IN_PROGRESS = "SG_IN_PROGRESS".freeze + SG_CLOSED = "SG_CLOSED".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/case_update_status_attributes.rb b/lib/datadog_api_client/v2/models/case_update_status_attributes.rb index 7a84f60cc0b..4b7ec140038 100644 --- a/lib/datadog_api_client/v2/models/case_update_status_attributes.rb +++ b/lib/datadog_api_client/v2/models/case_update_status_attributes.rb @@ -21,8 +21,11 @@ module DatadogAPIClient::V2 class CaseUpdateStatusAttributes include BaseGenericModel - # Case status - attr_reader :status + # Deprecated way of representing the case status, which only supports OPEN, IN_PROGRESS, and CLOSED statuses. Use `status_name` instead. + attr_accessor :status + + # Status of the case. Must be one of the existing statuses for the case's type. + attr_accessor :status_name attr_accessor :additional_properties @@ -30,7 +33,8 @@ class CaseUpdateStatusAttributes # @!visibility private def self.attribute_map { - :'status' => :'status' + :'status' => :'status', + :'status_name' => :'status_name' } end @@ -38,7 +42,8 @@ def self.attribute_map # @!visibility private def self.openapi_types { - :'status' => :'CaseStatus' + :'status' => :'CaseStatus', + :'status_name' => :'String' } end @@ -63,24 +68,10 @@ def initialize(attributes = {}) if attributes.key?(:'status') self.status = attributes[:'status'] end - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - # @!visibility private - def valid? - return false if @status.nil? - true - end - # Custom attribute writer method with validation - # @param status [Object] Object to be assigned - # @!visibility private - def status=(status) - if status.nil? - fail ArgumentError, 'invalid value for "status", status cannot be nil.' + if attributes.key?(:'status_name') + self.status_name = attributes[:'status_name'] end - @status = status end # Returns the object in the form of hash, with additionalProperties support. @@ -110,6 +101,7 @@ def ==(o) return true if self.equal?(o) self.class == o.class && status == o.status && + status_name == o.status_name && additional_properties == o.additional_properties end @@ -117,7 +109,7 @@ def ==(o) # @return [Integer] Hash code # @!visibility private def hash - [status, additional_properties].hash + [status, status_name, additional_properties].hash end end end diff --git a/lib/datadog_api_client/v2/models/issue_case_attributes.rb b/lib/datadog_api_client/v2/models/issue_case_attributes.rb index bf40017fdc4..80daf998d46 100644 --- a/lib/datadog_api_client/v2/models/issue_case_attributes.rb +++ b/lib/datadog_api_client/v2/models/issue_case_attributes.rb @@ -54,7 +54,7 @@ class IssueCaseAttributes # Case priority attr_accessor :priority - # Case status + # Deprecated way of representing the case status, which only supports OPEN, IN_PROGRESS, and CLOSED statuses. Use `status_name` instead. attr_accessor :status # Title of the case.