Skip to content

Commit 401a6ed

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
[STTSPG-987] Add 'required' label to Maintenance Attributes for Status Pages (#3254)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent 543edad commit 401a6ed

2 files changed

Lines changed: 70 additions & 5 deletions

File tree

.generator/schemas/v2/openapi.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16546,10 +16546,12 @@ components:
1654616546
properties:
1654716547
completed_date:
1654816548
description: Timestamp of when the maintenance was completed.
16549+
example: "2026-02-18T19:51:13.332360075Z"
1654916550
format: date-time
1655016551
type: string
1655116552
completed_description:
1655216553
description: The description shown when the maintenance is completed.
16554+
example: "We have completed maintenance on the API to improve performance."
1655316555
type: string
1655416556
components_affected:
1655516557
description: The components affected by the maintenance.
@@ -16558,12 +16560,15 @@ components:
1655816560
type: array
1655916561
in_progress_description:
1656016562
description: The description shown while the maintenance is in progress.
16563+
example: "We are currently performing maintenance on the API to improve performance."
1656116564
type: string
1656216565
scheduled_description:
1656316566
description: The description shown when the maintenance is scheduled.
16567+
example: "We will be performing maintenance on the API to improve performance."
1656416568
type: string
1656516569
start_date:
1656616570
description: Timestamp of when the maintenance is scheduled to start.
16571+
example: "2026-02-18T19:21:13.332360075Z"
1656716572
format: date-time
1656816573
type: string
1656916574
title:
@@ -16573,6 +16578,11 @@ components:
1657316578
required:
1657416579
- components_affected
1657516580
- title
16581+
- completed_date
16582+
- completed_description
16583+
- scheduled_description
16584+
- start_date
16585+
- in_progress_description
1657616586
type: object
1657716587
CreateMaintenanceRequestDataAttributesComponentsAffectedItems:
1657816588
description: A component affected by a maintenance.

lib/datadog_api_client/v2/models/create_maintenance_request_data_attributes.rb

Lines changed: 60 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,22 +22,22 @@ class CreateMaintenanceRequestDataAttributes
2222
include BaseGenericModel
2323

2424
# Timestamp of when the maintenance was completed.
25-
attr_accessor :completed_date
25+
attr_reader :completed_date
2626

2727
# The description shown when the maintenance is completed.
28-
attr_accessor :completed_description
28+
attr_reader :completed_description
2929

3030
# The components affected by the maintenance.
3131
attr_reader :components_affected
3232

3333
# The description shown while the maintenance is in progress.
34-
attr_accessor :in_progress_description
34+
attr_reader :in_progress_description
3535

3636
# The description shown when the maintenance is scheduled.
37-
attr_accessor :scheduled_description
37+
attr_reader :scheduled_description
3838

3939
# Timestamp of when the maintenance is scheduled to start.
40-
attr_accessor :start_date
40+
attr_reader :start_date
4141

4242
# The title of the maintenance.
4343
attr_reader :title
@@ -125,11 +125,36 @@ def initialize(attributes = {})
125125
# @return true if the model is valid
126126
# @!visibility private
127127
def valid?
128+
return false if @completed_date.nil?
129+
return false if @completed_description.nil?
128130
return false if @components_affected.nil?
131+
return false if @in_progress_description.nil?
132+
return false if @scheduled_description.nil?
133+
return false if @start_date.nil?
129134
return false if @title.nil?
130135
true
131136
end
132137

138+
# Custom attribute writer method with validation
139+
# @param completed_date [Object] Object to be assigned
140+
# @!visibility private
141+
def completed_date=(completed_date)
142+
if completed_date.nil?
143+
fail ArgumentError, 'invalid value for "completed_date", completed_date cannot be nil.'
144+
end
145+
@completed_date = completed_date
146+
end
147+
148+
# Custom attribute writer method with validation
149+
# @param completed_description [Object] Object to be assigned
150+
# @!visibility private
151+
def completed_description=(completed_description)
152+
if completed_description.nil?
153+
fail ArgumentError, 'invalid value for "completed_description", completed_description cannot be nil.'
154+
end
155+
@completed_description = completed_description
156+
end
157+
133158
# Custom attribute writer method with validation
134159
# @param components_affected [Object] Object to be assigned
135160
# @!visibility private
@@ -140,6 +165,36 @@ def components_affected=(components_affected)
140165
@components_affected = components_affected
141166
end
142167

168+
# Custom attribute writer method with validation
169+
# @param in_progress_description [Object] Object to be assigned
170+
# @!visibility private
171+
def in_progress_description=(in_progress_description)
172+
if in_progress_description.nil?
173+
fail ArgumentError, 'invalid value for "in_progress_description", in_progress_description cannot be nil.'
174+
end
175+
@in_progress_description = in_progress_description
176+
end
177+
178+
# Custom attribute writer method with validation
179+
# @param scheduled_description [Object] Object to be assigned
180+
# @!visibility private
181+
def scheduled_description=(scheduled_description)
182+
if scheduled_description.nil?
183+
fail ArgumentError, 'invalid value for "scheduled_description", scheduled_description cannot be nil.'
184+
end
185+
@scheduled_description = scheduled_description
186+
end
187+
188+
# Custom attribute writer method with validation
189+
# @param start_date [Object] Object to be assigned
190+
# @!visibility private
191+
def start_date=(start_date)
192+
if start_date.nil?
193+
fail ArgumentError, 'invalid value for "start_date", start_date cannot be nil.'
194+
end
195+
@start_date = start_date
196+
end
197+
143198
# Custom attribute writer method with validation
144199
# @param title [Object] Object to be assigned
145200
# @!visibility private

0 commit comments

Comments
 (0)