diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index f731f36b7945..0922b3812569 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -3109,12 +3109,14 @@ components: - runbook - documentation - dashboard + - resource example: runbook type: string x-enum-varnames: - RUNBOOK - DOCUMENTATION - DASHBOARD + - RESOURCE AlertEventCustomAttributesPriority: default: '5' description: The priority of the alert. @@ -10383,9 +10385,11 @@ components: properties: name: description: The name of the resource that was changed. Limited to 128 characters. + Must contain at least one non-whitespace character. example: fallback_payments_test maxLength: 128 minLength: 1 + pattern: .*\S.* type: string type: $ref: '#/components/schemas/ChangeEventCustomAttributesChangedResourceType' diff --git a/lib/datadog_api_client/v2/models/alert_event_custom_attributes_links_items_category.rb b/lib/datadog_api_client/v2/models/alert_event_custom_attributes_links_items_category.rb index e6f75a46ae95..06561850a664 100644 --- a/lib/datadog_api_client/v2/models/alert_event_custom_attributes_links_items_category.rb +++ b/lib/datadog_api_client/v2/models/alert_event_custom_attributes_links_items_category.rb @@ -24,5 +24,6 @@ class AlertEventCustomAttributesLinksItemsCategory RUNBOOK = "runbook".freeze DOCUMENTATION = "documentation".freeze DASHBOARD = "dashboard".freeze + RESOURCE = "resource".freeze end end diff --git a/lib/datadog_api_client/v2/models/change_event_custom_attributes_changed_resource.rb b/lib/datadog_api_client/v2/models/change_event_custom_attributes_changed_resource.rb index e9291fea283d..2e95833a763f 100644 --- a/lib/datadog_api_client/v2/models/change_event_custom_attributes_changed_resource.rb +++ b/lib/datadog_api_client/v2/models/change_event_custom_attributes_changed_resource.rb @@ -21,7 +21,7 @@ module DatadogAPIClient::V2 class ChangeEventCustomAttributesChangedResource include BaseGenericModel - # The name of the resource that was changed. Limited to 128 characters. + # The name of the resource that was changed. Limited to 128 characters. Must contain at least one non-whitespace character. attr_reader :name # The type of the resource that was changed. @@ -77,6 +77,8 @@ def valid? return false if @name.nil? return false if @name.to_s.length > 128 return false if @name.to_s.length < 1 + pattern = Regexp.new(/.*\S.*/) + return false if @name !~ pattern return false if @type.nil? true end @@ -94,6 +96,10 @@ def name=(name) if name.to_s.length < 1 fail ArgumentError, 'invalid value for "name", the character length must be great than or equal to 1.' end + pattern = Regexp.new(/.*\S.*/) + if name !~ pattern + fail ArgumentError, "invalid value for \"name\", must conform to the pattern #{pattern}." + end @name = name end