Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,6 @@ class AlertEventCustomAttributesLinksItemsCategory
RUNBOOK = "runbook".freeze
DOCUMENTATION = "documentation".freeze
DASHBOARD = "dashboard".freeze
RESOURCE = "resource".freeze
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand All @@ -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

Expand Down
Loading