You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
11
+
This product includes software developed at Datadog (https://www.datadoghq.com/).
12
+
Copyright 2020-Present Datadog, Inc.
13
+
14
+
=end
15
+
16
+
require'date'
17
+
require'time'
18
+
19
+
moduleDatadogAPIClient::V1
20
+
# Calendar interval definition.
21
+
classCalendarInterval
22
+
includeBaseGenericModel
23
+
24
+
# Alignment of the interval. Valid values depend on the interval type. For `day`, use hours (for example, `1am`, `2pm`, or `14`). For `week`, use day names (for example, `monday`). For `month`, use day-of-month ordinals (for example, `1st`, `15th`). For `year` or `quarter`, use month names (for example, `january`).
25
+
attr_accessor:alignment
26
+
27
+
# Quantity of the interval.
28
+
attr_accessor:quantity
29
+
30
+
# Timezone for the interval.
31
+
attr_accessor:timezone
32
+
33
+
# Type of calendar interval.
34
+
attr_reader:type
35
+
36
+
# Attribute mapping from ruby-style variable name to JSON key.
37
+
# @!visibility private
38
+
defself.attribute_map
39
+
{
40
+
:'alignment'=>:'alignment',
41
+
:'quantity'=>:'quantity',
42
+
:'timezone'=>:'timezone',
43
+
:'type'=>:'type'
44
+
}
45
+
end
46
+
47
+
# Attribute type mapping.
48
+
# @!visibility private
49
+
defself.openapi_types
50
+
{
51
+
:'alignment'=>:'String',
52
+
:'quantity'=>:'Integer',
53
+
:'timezone'=>:'String',
54
+
:'type'=>:'CalendarIntervalType'
55
+
}
56
+
end
57
+
58
+
# Initializes the object
59
+
# @param attributes [Hash] Model attributes in the form of hash
60
+
# @!visibility private
61
+
definitialize(attributes={})
62
+
if(!attributes.is_a?(Hash))
63
+
failArgumentError,"The input argument (attributes) must be a hash in `DatadogAPIClient::V1::CalendarInterval` initialize method"
64
+
end
65
+
66
+
# check to see if the attribute exists and convert string to symbol for hash key
failArgumentError,"`#{k}` is not a valid attribute in `DatadogAPIClient::V1::CalendarInterval`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
70
+
end
71
+
h[k.to_sym]=v
72
+
}
73
+
74
+
ifattributes.key?(:'alignment')
75
+
self.alignment=attributes[:'alignment']
76
+
end
77
+
78
+
ifattributes.key?(:'quantity')
79
+
self.quantity=attributes[:'quantity']
80
+
end
81
+
82
+
ifattributes.key?(:'timezone')
83
+
self.timezone=attributes[:'timezone']
84
+
end
85
+
86
+
ifattributes.key?(:'type')
87
+
self.type=attributes[:'type']
88
+
end
89
+
end
90
+
91
+
# Check to see if the all the properties in the model are valid
92
+
# @return true if the model is valid
93
+
# @!visibility private
94
+
defvalid?
95
+
returnfalseif@type.nil?
96
+
true
97
+
end
98
+
99
+
# Custom attribute writer method with validation
100
+
# @param type [Object] Object to be assigned
101
+
# @!visibility private
102
+
deftype=(type)
103
+
iftype.nil?
104
+
failArgumentError,'invalid value for "type", type cannot be nil.'
105
+
end
106
+
@type=type
107
+
end
108
+
109
+
# Checks equality by comparing each attribute.
110
+
# @param o [Object] Object to be compared
111
+
# @!visibility private
112
+
def ==(o)
113
+
returntrueifself.equal?(o)
114
+
self.class == o.class &&
115
+
alignment == o.alignment &&
116
+
quantity == o.quantity &&
117
+
timezone == o.timezone &&
118
+
type == o.type
119
+
end
120
+
121
+
# Calculates hash code according to all attributes.
0 commit comments