Skip to content

Commit 93a308a

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Make id required in patch status pages request schemas, id and attributes required in post/patch status pages request schemas (#2952)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent 31b6c08 commit 93a308a

7 files changed

Lines changed: 130 additions & 19 deletions

.generator/schemas/v2/openapi.yaml

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13283,6 +13283,7 @@ components:
1328313283
type:
1328413284
$ref: '#/components/schemas/StatusPagesComponentGroupType'
1328513285
required:
13286+
- attributes
1328613287
- type
1328713288
type: object
1328813289
CreateComponentRequestDataAttributes:
@@ -13367,7 +13368,7 @@ components:
1336713368
properties:
1336813369
id:
1336913370
description: The ID of the group.
13370-
example: ''
13371+
example: 1234abcd-12ab-34cd-56ef-123456abcdef
1337113372
format: uuid
1337213373
type: string
1337313374
type:
@@ -13569,6 +13570,7 @@ components:
1356913570
type:
1357013571
$ref: '#/components/schemas/PatchDegradationRequestDataType'
1357113572
required:
13573+
- attributes
1357213574
- type
1357313575
type: object
1357413576
CreateDegradationRequestDataAttributes:
@@ -13604,7 +13606,7 @@ components:
1360413606
properties:
1360513607
id:
1360613608
description: The ID of the component. Must be a component of type `component`.
13607-
example: ''
13609+
example: 1234abcd-12ab-34cd-56ef-123456abcdef
1360813610
format: uuid
1360913611
type: string
1361013612
name:
@@ -14327,6 +14329,7 @@ components:
1432714329
type:
1432814330
$ref: '#/components/schemas/StatusPageDataType'
1432914331
required:
14332+
- attributes
1433014333
- type
1433114334
type: object
1433214335
CreateStatusPageRequestDataAttributes:
@@ -18391,7 +18394,7 @@ components:
1839118394
properties:
1839218395
id:
1839318396
description: The ID of the component.
18394-
example: ''
18397+
example: 1234abcd-12ab-34cd-56ef-123456abcdef
1839518398
format: uuid
1839618399
type: string
1839718400
name:
@@ -18436,7 +18439,7 @@ components:
1843618439
properties:
1843718440
id:
1843818441
description: Identifier of the component affected at the time of the update.
18439-
example: ''
18442+
example: 1234abcd-12ab-34cd-56ef-123456abcdef
1844018443
format: uuid
1844118444
type: string
1844218445
name:
@@ -18512,7 +18515,7 @@ components:
1851218515
properties:
1851318516
id:
1851418517
description: The ID of the status page.
18515-
example: ''
18518+
example: 1234abcd-12ab-34cd-56ef-123456abcdef
1851618519
format: uuid
1851718520
type: string
1851818521
type:
@@ -43661,11 +43664,14 @@ components:
4366143664
$ref: '#/components/schemas/PatchComponentRequestDataAttributes'
4366243665
id:
4366343666
description: The ID of the component.
43667+
example: 1234abcd-12ab-34cd-56ef-123456abcdef
4366443668
format: uuid
4366543669
type: string
4366643670
type:
4366743671
$ref: '#/components/schemas/StatusPagesComponentGroupType'
4366843672
required:
43673+
- attributes
43674+
- id
4366943675
- type
4367043676
type: object
4367143677
PatchComponentRequestDataAttributes:
@@ -43704,11 +43710,14 @@ components:
4370443710
$ref: '#/components/schemas/PatchDegradationRequestDataAttributes'
4370543711
id:
4370643712
description: The ID of the degradation.
43713+
example: 1234abcd-12ab-34cd-56ef-123456abcdef
4370743714
format: uuid
4370843715
type: string
4370943716
type:
4371043717
$ref: '#/components/schemas/PatchDegradationRequestDataType'
4371143718
required:
43719+
- attributes
43720+
- id
4371243721
- type
4371343722
type: object
4371443723
PatchDegradationRequestDataAttributes:
@@ -43739,7 +43748,7 @@ components:
4373943748
properties:
4374043749
id:
4374143750
description: The ID of the component. Must be a component of type `component`.
43742-
example: ''
43751+
example: 1234abcd-12ab-34cd-56ef-123456abcdef
4374343752
format: uuid
4374443753
type: string
4374543754
name:
@@ -43844,11 +43853,14 @@ components:
4384443853
$ref: '#/components/schemas/PatchStatusPageRequestDataAttributes'
4384543854
id:
4384643855
description: The ID of the status page.
43856+
example: 1234abcd-12ab-34cd-56ef-123456abcdef
4384743857
format: uuid
4384843858
type: string
4384943859
type:
4385043860
$ref: '#/components/schemas/StatusPageDataType'
4385143861
required:
43862+
- attributes
43863+
- id
4385243864
- type
4385343865
type: object
4385443866
PatchStatusPageRequestDataAttributes:
@@ -58776,7 +58788,7 @@ components:
5877658788
properties:
5877758789
id:
5877858790
description: The ID of the group the component belongs to.
58779-
example: ''
58791+
example: 1234abcd-12ab-34cd-56ef-123456abcdef
5878058792
format: uuid
5878158793
type: string
5878258794
type:
@@ -58815,7 +58827,7 @@ components:
5881558827
properties:
5881658828
id:
5881758829
description: The ID of the status page the component belongs to.
58818-
example: ''
58830+
example: 1234abcd-12ab-34cd-56ef-123456abcdef
5881958831
format: uuid
5882058832
type: string
5882158833
type:
@@ -58957,7 +58969,7 @@ components:
5895758969
nullable: true
5895858970
properties:
5895958971
id:
58960-
example: ''
58972+
example: 1234abcd-12ab-34cd-56ef-123456abcdef
5896158973
format: uuid
5896258974
type: string
5896358975
type:
@@ -58999,7 +59011,7 @@ components:
5899959011
properties:
5900059012
id:
5900159013
description: The ID of the status page.
59002-
example: ''
59014+
example: 1234abcd-12ab-34cd-56ef-123456abcdef
5900359015
format: uuid
5900459016
type: string
5900559017
type:

lib/datadog_api_client/v2/models/create_component_request_data.rb

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class CreateComponentRequestData
2222
include BaseGenericModel
2323

2424
# The supported attributes for creating a component.
25-
attr_accessor :attributes
25+
attr_reader :attributes
2626

2727
# The supported relationships for creating a component.
2828
attr_accessor :relationships
@@ -87,10 +87,21 @@ def initialize(attributes = {})
8787
# @return true if the model is valid
8888
# @!visibility private
8989
def valid?
90+
return false if @attributes.nil?
9091
return false if @type.nil?
9192
true
9293
end
9394

95+
# Custom attribute writer method with validation
96+
# @param attributes [Object] Object to be assigned
97+
# @!visibility private
98+
def attributes=(attributes)
99+
if attributes.nil?
100+
fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.'
101+
end
102+
@attributes = attributes
103+
end
104+
94105
# Custom attribute writer method with validation
95106
# @param type [Object] Object to be assigned
96107
# @!visibility private

lib/datadog_api_client/v2/models/create_degradation_request_data.rb

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class CreateDegradationRequestData
2222
include BaseGenericModel
2323

2424
# The supported attributes for creating a degradation.
25-
attr_accessor :attributes
25+
attr_reader :attributes
2626

2727
# Degradations resource type.
2828
attr_reader :type
@@ -78,10 +78,21 @@ def initialize(attributes = {})
7878
# @return true if the model is valid
7979
# @!visibility private
8080
def valid?
81+
return false if @attributes.nil?
8182
return false if @type.nil?
8283
true
8384
end
8485

86+
# Custom attribute writer method with validation
87+
# @param attributes [Object] Object to be assigned
88+
# @!visibility private
89+
def attributes=(attributes)
90+
if attributes.nil?
91+
fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.'
92+
end
93+
@attributes = attributes
94+
end
95+
8596
# Custom attribute writer method with validation
8697
# @param type [Object] Object to be assigned
8798
# @!visibility private

lib/datadog_api_client/v2/models/create_status_page_request_data.rb

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class CreateStatusPageRequestData
2222
include BaseGenericModel
2323

2424
# The supported attributes for creating a status page.
25-
attr_accessor :attributes
25+
attr_reader :attributes
2626

2727
# Status pages resource type.
2828
attr_reader :type
@@ -78,10 +78,21 @@ def initialize(attributes = {})
7878
# @return true if the model is valid
7979
# @!visibility private
8080
def valid?
81+
return false if @attributes.nil?
8182
return false if @type.nil?
8283
true
8384
end
8485

86+
# Custom attribute writer method with validation
87+
# @param attributes [Object] Object to be assigned
88+
# @!visibility private
89+
def attributes=(attributes)
90+
if attributes.nil?
91+
fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.'
92+
end
93+
@attributes = attributes
94+
end
95+
8596
# Custom attribute writer method with validation
8697
# @param type [Object] Object to be assigned
8798
# @!visibility private

lib/datadog_api_client/v2/models/patch_component_request_data.rb

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ class PatchComponentRequestData
2222
include BaseGenericModel
2323

2424
# The supported attributes for updating a component.
25-
attr_accessor :attributes
25+
attr_reader :attributes
2626

2727
# The ID of the component.
28-
attr_accessor :id
28+
attr_reader :id
2929

3030
# Components resource type.
3131
attr_reader :type
@@ -87,10 +87,32 @@ def initialize(attributes = {})
8787
# @return true if the model is valid
8888
# @!visibility private
8989
def valid?
90+
return false if @attributes.nil?
91+
return false if @id.nil?
9092
return false if @type.nil?
9193
true
9294
end
9395

96+
# Custom attribute writer method with validation
97+
# @param attributes [Object] Object to be assigned
98+
# @!visibility private
99+
def attributes=(attributes)
100+
if attributes.nil?
101+
fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.'
102+
end
103+
@attributes = attributes
104+
end
105+
106+
# Custom attribute writer method with validation
107+
# @param id [Object] Object to be assigned
108+
# @!visibility private
109+
def id=(id)
110+
if id.nil?
111+
fail ArgumentError, 'invalid value for "id", id cannot be nil.'
112+
end
113+
@id = id
114+
end
115+
94116
# Custom attribute writer method with validation
95117
# @param type [Object] Object to be assigned
96118
# @!visibility private

lib/datadog_api_client/v2/models/patch_degradation_request_data.rb

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ class PatchDegradationRequestData
2222
include BaseGenericModel
2323

2424
# The supported attributes for updating a degradation.
25-
attr_accessor :attributes
25+
attr_reader :attributes
2626

2727
# The ID of the degradation.
28-
attr_accessor :id
28+
attr_reader :id
2929

3030
# Degradations resource type.
3131
attr_reader :type
@@ -87,10 +87,32 @@ def initialize(attributes = {})
8787
# @return true if the model is valid
8888
# @!visibility private
8989
def valid?
90+
return false if @attributes.nil?
91+
return false if @id.nil?
9092
return false if @type.nil?
9193
true
9294
end
9395

96+
# Custom attribute writer method with validation
97+
# @param attributes [Object] Object to be assigned
98+
# @!visibility private
99+
def attributes=(attributes)
100+
if attributes.nil?
101+
fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.'
102+
end
103+
@attributes = attributes
104+
end
105+
106+
# Custom attribute writer method with validation
107+
# @param id [Object] Object to be assigned
108+
# @!visibility private
109+
def id=(id)
110+
if id.nil?
111+
fail ArgumentError, 'invalid value for "id", id cannot be nil.'
112+
end
113+
@id = id
114+
end
115+
94116
# Custom attribute writer method with validation
95117
# @param type [Object] Object to be assigned
96118
# @!visibility private

lib/datadog_api_client/v2/models/patch_status_page_request_data.rb

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ class PatchStatusPageRequestData
2222
include BaseGenericModel
2323

2424
# The supported attributes for updating a status page.
25-
attr_accessor :attributes
25+
attr_reader :attributes
2626

2727
# The ID of the status page.
28-
attr_accessor :id
28+
attr_reader :id
2929

3030
# Status pages resource type.
3131
attr_reader :type
@@ -87,10 +87,32 @@ def initialize(attributes = {})
8787
# @return true if the model is valid
8888
# @!visibility private
8989
def valid?
90+
return false if @attributes.nil?
91+
return false if @id.nil?
9092
return false if @type.nil?
9193
true
9294
end
9395

96+
# Custom attribute writer method with validation
97+
# @param attributes [Object] Object to be assigned
98+
# @!visibility private
99+
def attributes=(attributes)
100+
if attributes.nil?
101+
fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.'
102+
end
103+
@attributes = attributes
104+
end
105+
106+
# Custom attribute writer method with validation
107+
# @param id [Object] Object to be assigned
108+
# @!visibility private
109+
def id=(id)
110+
if id.nil?
111+
fail ArgumentError, 'invalid value for "id", id cannot be nil.'
112+
end
113+
@id = id
114+
end
115+
94116
# Custom attribute writer method with validation
95117
# @param type [Object] Object to be assigned
96118
# @!visibility private

0 commit comments

Comments
 (0)