incident_io_api 4.0.0 → 4.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (72) hide show
  1. checksums.yaml +4 -4
  2. data/lib/incident_io/api/alert_grouping_preferences_v3_api.rb +367 -0
  3. data/lib/incident_io/api/alert_rules_v3_api.rb +367 -0
  4. data/lib/incident_io/api/team_grouping_preferences_v3_api.rb +364 -0
  5. data/lib/incident_io/models/alert_grouping_conditional_branch_v3.rb +204 -0
  6. data/lib/incident_io/models/alert_grouping_default_branch_v3.rb +165 -0
  7. data/lib/incident_io/models/alert_grouping_preference_v3.rb +368 -0
  8. data/lib/incident_io/models/alert_grouping_preferences_create_payload_v3.rb +225 -0
  9. data/lib/incident_io/models/alert_grouping_preferences_create_result_v3.rb +164 -0
  10. data/lib/incident_io/models/alert_grouping_preferences_list_result_v3.rb +192 -0
  11. data/lib/incident_io/models/alert_grouping_preferences_show_result_v3.rb +164 -0
  12. data/lib/incident_io/models/alert_grouping_preferences_update_payload_v3.rb +198 -0
  13. data/lib/incident_io/models/alert_grouping_preferences_update_result_v3.rb +164 -0
  14. data/lib/incident_io/models/alert_grouping_settings_v3.rb +246 -0
  15. data/lib/incident_io/models/alert_rule_action_v3.rb +240 -0
  16. data/lib/incident_io/models/alert_rule_block_v3.rb +222 -0
  17. data/lib/incident_io/models/alert_rule_branch_v3.rb +254 -0
  18. data/lib/incident_io/models/alert_rule_create_incident_action_v3.rb +177 -0
  19. data/lib/incident_io/models/alert_rule_escalate_action_v3.rb +215 -0
  20. data/lib/incident_io/models/alert_rule_nested_branch_v3.rb +242 -0
  21. data/lib/incident_io/models/alert_rule_post_action_v3.rb +202 -0
  22. data/lib/incident_io/models/alert_rule_set_v3.rb +351 -0
  23. data/lib/incident_io/models/alert_rules_create_payload_v3.rb +225 -0
  24. data/lib/incident_io/models/alert_rules_create_result_v3.rb +164 -0
  25. data/lib/incident_io/models/alert_rules_list_result_v3.rb +192 -0
  26. data/lib/incident_io/models/alert_rules_show_result_v3.rb +164 -0
  27. data/lib/incident_io/models/alert_rules_update_payload_v3.rb +198 -0
  28. data/lib/incident_io/models/alert_rules_update_result_v3.rb +164 -0
  29. data/lib/incident_io/models/team_grouping_preference_v3.rb +300 -0
  30. data/lib/incident_io/models/team_grouping_preferences_create_payload_v3.rb +191 -0
  31. data/lib/incident_io/models/team_grouping_preferences_create_result_v3.rb +164 -0
  32. data/lib/incident_io/models/team_grouping_preferences_list_result_v3.rb +192 -0
  33. data/lib/incident_io/models/team_grouping_preferences_show_result_v3.rb +164 -0
  34. data/lib/incident_io/models/team_grouping_preferences_update_payload_v3.rb +191 -0
  35. data/lib/incident_io/models/team_grouping_preferences_update_result_v3.rb +164 -0
  36. data/lib/incident_io/models/webhooks_private_alert_created_v1_response_body.rb +1 -1
  37. data/lib/incident_io/models/webhooks_private_alert_resolved_v1_response_body.rb +1 -1
  38. data/lib/incident_io/models/webhooks_private_escalation_created_v1_response_body.rb +1 -1
  39. data/lib/incident_io/models/webhooks_private_escalation_status_updated_v1_response_body.rb +1 -1
  40. data/lib/incident_io/models/webhooks_private_incident_action_created_v1_response_body.rb +1 -1
  41. data/lib/incident_io/models/webhooks_private_incident_action_updated_v1_response_body.rb +1 -1
  42. data/lib/incident_io/models/webhooks_private_incident_follow_up_created_v1_response_body.rb +1 -1
  43. data/lib/incident_io/models/webhooks_private_incident_follow_up_created_v2_response_body.rb +1 -1
  44. data/lib/incident_io/models/webhooks_private_incident_follow_up_updated_v1_response_body.rb +1 -1
  45. data/lib/incident_io/models/webhooks_private_incident_follow_up_updated_v2_response_body.rb +1 -1
  46. data/lib/incident_io/models/webhooks_private_incident_incident_created_v2_response_body.rb +1 -1
  47. data/lib/incident_io/models/webhooks_private_incident_incident_updated_v2_response_body.rb +1 -1
  48. data/lib/incident_io/models/webhooks_private_incident_membership_granted_v1_response_body.rb +1 -1
  49. data/lib/incident_io/models/webhooks_private_incident_membership_revoked_v1_response_body.rb +1 -1
  50. data/lib/incident_io/models/webhooks_private_incident_postmortem_document_status_updated_v1_response_body.rb +1 -1
  51. data/lib/incident_io/models/webhooks_public_alert_created_v1_response_body.rb +1 -1
  52. data/lib/incident_io/models/webhooks_public_alert_resolved_v1_response_body.rb +1 -1
  53. data/lib/incident_io/models/webhooks_public_escalation_created_v1_response_body.rb +1 -1
  54. data/lib/incident_io/models/webhooks_public_escalation_status_updated_v1_response_body.rb +1 -1
  55. data/lib/incident_io/models/webhooks_public_incident_action_created_v1_response_body.rb +1 -1
  56. data/lib/incident_io/models/webhooks_public_incident_action_updated_v1_response_body.rb +1 -1
  57. data/lib/incident_io/models/webhooks_public_incident_follow_up_created_v1_response_body.rb +1 -1
  58. data/lib/incident_io/models/webhooks_public_incident_follow_up_created_v2_response_body.rb +1 -1
  59. data/lib/incident_io/models/webhooks_public_incident_follow_up_updated_v1_response_body.rb +1 -1
  60. data/lib/incident_io/models/webhooks_public_incident_follow_up_updated_v2_response_body.rb +1 -1
  61. data/lib/incident_io/models/webhooks_public_incident_incident_created_v2_response_body.rb +1 -1
  62. data/lib/incident_io/models/webhooks_public_incident_incident_status_updated_v2_response_body.rb +1 -1
  63. data/lib/incident_io/models/webhooks_public_incident_incident_updated_v2_response_body.rb +1 -1
  64. data/lib/incident_io/models/webhooks_public_incident_postmortem_document_status_updated_v1_response_body.rb +1 -1
  65. data/lib/incident_io/models/webhooks_schedule_created_v1_response_body.rb +1 -1
  66. data/lib/incident_io/models/webhooks_schedule_deleted_v1_response_body.rb +1 -1
  67. data/lib/incident_io/models/webhooks_schedule_shift_change_v1_response_body.rb +1 -1
  68. data/lib/incident_io/models/webhooks_schedule_updated_v1_response_body.rb +1 -1
  69. data/lib/incident_io/models/webhooks_status_page_incident_update_shared_v1_response_body.rb +1 -1
  70. data/lib/incident_io/version.rb +1 -1
  71. data/lib/incident_io.rb +34 -0
  72. metadata +36 -2
@@ -0,0 +1,198 @@
1
+ =begin
2
+ #incident.io
3
+
4
+ #Ruby client for the incident.io API.
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.25.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module IncidentIo
17
+ class AlertRulesUpdatePayloadV3 < ApiModelBase
18
+ # The blocks of rules, in order. Every block runs for an alert.
19
+ attr_accessor :blocks
20
+
21
+ # Expressions the blocks' conditions and actions reference. Omit it when the rules use none.
22
+ attr_accessor :expressions
23
+
24
+ attr_accessor :message_template
25
+
26
+ # The version this update writes. When set, it must be one more than the set's current version, so two editors can't overwrite each other. When omitted, the update applies to the current version.
27
+ attr_accessor :version
28
+
29
+ # Attribute mapping from ruby-style variable name to JSON key.
30
+ def self.attribute_map
31
+ {
32
+ :'blocks' => :'blocks',
33
+ :'expressions' => :'expressions',
34
+ :'message_template' => :'message_template',
35
+ :'version' => :'version'
36
+ }
37
+ end
38
+
39
+ # Returns attribute mapping this model knows about
40
+ def self.acceptable_attribute_map
41
+ attribute_map
42
+ end
43
+
44
+ # Returns all the JSON keys this model knows about
45
+ def self.acceptable_attributes
46
+ acceptable_attribute_map.values
47
+ end
48
+
49
+ # Attribute type mapping.
50
+ def self.openapi_types
51
+ {
52
+ :'blocks' => :'Array<AlertRuleBlockV3>',
53
+ :'expressions' => :'Array<ExpressionPayloadV3>',
54
+ :'message_template' => :'EngineParamBindingPayloadV3',
55
+ :'version' => :'Integer'
56
+ }
57
+ end
58
+
59
+ # List of attributes with nullable: true
60
+ def self.openapi_nullable
61
+ Set.new([
62
+ ])
63
+ end
64
+
65
+ # Initializes the object
66
+ # @param [Hash] attributes Model attributes in the form of hash
67
+ def initialize(attributes = {})
68
+ if (!attributes.is_a?(Hash))
69
+ fail ArgumentError, "The input argument (attributes) must be a hash in `IncidentIo::AlertRulesUpdatePayloadV3` initialize method"
70
+ end
71
+
72
+ # check to see if the attribute exists and convert string to symbol for hash key
73
+ acceptable_attribute_map = self.class.acceptable_attribute_map
74
+ attributes = attributes.each_with_object({}) { |(k, v), h|
75
+ if (!acceptable_attribute_map.key?(k.to_sym))
76
+ fail ArgumentError, "`#{k}` is not a valid attribute in `IncidentIo::AlertRulesUpdatePayloadV3`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
77
+ end
78
+ h[k.to_sym] = v
79
+ }
80
+
81
+ if attributes.key?(:'blocks')
82
+ if (value = attributes[:'blocks']).is_a?(Array)
83
+ self.blocks = value
84
+ end
85
+ else
86
+ self.blocks = nil
87
+ end
88
+
89
+ if attributes.key?(:'expressions')
90
+ if (value = attributes[:'expressions']).is_a?(Array)
91
+ self.expressions = value
92
+ end
93
+ end
94
+
95
+ if attributes.key?(:'message_template')
96
+ self.message_template = attributes[:'message_template']
97
+ end
98
+
99
+ if attributes.key?(:'version')
100
+ self.version = attributes[:'version']
101
+ end
102
+ end
103
+
104
+ # Show invalid properties with the reasons. Usually used together with valid?
105
+ # @return Array for valid properties with the reasons
106
+ def list_invalid_properties
107
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
108
+ invalid_properties = Array.new
109
+ if @blocks.nil?
110
+ invalid_properties.push('invalid value for "blocks", blocks cannot be nil.')
111
+ end
112
+
113
+ invalid_properties
114
+ end
115
+
116
+ # Check to see if the all the properties in the model are valid
117
+ # @return true if the model is valid
118
+ def valid?
119
+ warn '[DEPRECATED] the `valid?` method is obsolete'
120
+ return false if @blocks.nil?
121
+ true
122
+ end
123
+
124
+ # Custom attribute writer method with validation
125
+ # @param [Object] blocks Value to be assigned
126
+ def blocks=(blocks)
127
+ if blocks.nil?
128
+ fail ArgumentError, 'blocks cannot be nil'
129
+ end
130
+
131
+ @blocks = blocks
132
+ end
133
+
134
+ # Checks equality by comparing each attribute.
135
+ # @param [Object] Object to be compared
136
+ def ==(o)
137
+ return true if self.equal?(o)
138
+ self.class == o.class &&
139
+ blocks == o.blocks &&
140
+ expressions == o.expressions &&
141
+ message_template == o.message_template &&
142
+ version == o.version
143
+ end
144
+
145
+ # @see the `==` method
146
+ # @param [Object] Object to be compared
147
+ def eql?(o)
148
+ self == o
149
+ end
150
+
151
+ # Calculates hash code according to all attributes.
152
+ # @return [Integer] Hash code
153
+ def hash
154
+ [blocks, expressions, message_template, version].hash
155
+ end
156
+
157
+ # Builds the object from hash
158
+ # @param [Hash] attributes Model attributes in the form of hash
159
+ # @return [Object] Returns the model itself
160
+ def self.build_from_hash(attributes)
161
+ return nil unless attributes.is_a?(Hash)
162
+ attributes = attributes.transform_keys(&:to_sym)
163
+ transformed_hash = {}
164
+ openapi_types.each_pair do |key, type|
165
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
166
+ transformed_hash["#{key}"] = nil
167
+ elsif type =~ /\AArray<(.*)>/i
168
+ # check to ensure the input is an array given that the attribute
169
+ # is documented as an array but the input is not
170
+ if attributes[attribute_map[key]].is_a?(Array)
171
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
172
+ end
173
+ elsif !attributes[attribute_map[key]].nil?
174
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
175
+ end
176
+ end
177
+ new(transformed_hash)
178
+ end
179
+
180
+ # Returns the object in the form of hash
181
+ # @return [Hash] Returns the object in the form of hash
182
+ def to_hash
183
+ hash = {}
184
+ self.class.attribute_map.each_pair do |attr, param|
185
+ value = self.send(attr)
186
+ if value.nil?
187
+ is_nullable = self.class.openapi_nullable.include?(attr)
188
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
189
+ end
190
+
191
+ hash[param] = _to_hash(value)
192
+ end
193
+ hash
194
+ end
195
+
196
+ end
197
+
198
+ end
@@ -0,0 +1,164 @@
1
+ =begin
2
+ #incident.io
3
+
4
+ #Ruby client for the incident.io API.
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.25.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module IncidentIo
17
+ class AlertRulesUpdateResultV3 < ApiModelBase
18
+ attr_accessor :alert_rule_set
19
+
20
+ # Attribute mapping from ruby-style variable name to JSON key.
21
+ def self.attribute_map
22
+ {
23
+ :'alert_rule_set' => :'alert_rule_set'
24
+ }
25
+ end
26
+
27
+ # Returns attribute mapping this model knows about
28
+ def self.acceptable_attribute_map
29
+ attribute_map
30
+ end
31
+
32
+ # Returns all the JSON keys this model knows about
33
+ def self.acceptable_attributes
34
+ acceptable_attribute_map.values
35
+ end
36
+
37
+ # Attribute type mapping.
38
+ def self.openapi_types
39
+ {
40
+ :'alert_rule_set' => :'AlertRuleSetV3'
41
+ }
42
+ end
43
+
44
+ # List of attributes with nullable: true
45
+ def self.openapi_nullable
46
+ Set.new([
47
+ ])
48
+ end
49
+
50
+ # Initializes the object
51
+ # @param [Hash] attributes Model attributes in the form of hash
52
+ def initialize(attributes = {})
53
+ if (!attributes.is_a?(Hash))
54
+ fail ArgumentError, "The input argument (attributes) must be a hash in `IncidentIo::AlertRulesUpdateResultV3` initialize method"
55
+ end
56
+
57
+ # check to see if the attribute exists and convert string to symbol for hash key
58
+ acceptable_attribute_map = self.class.acceptable_attribute_map
59
+ attributes = attributes.each_with_object({}) { |(k, v), h|
60
+ if (!acceptable_attribute_map.key?(k.to_sym))
61
+ fail ArgumentError, "`#{k}` is not a valid attribute in `IncidentIo::AlertRulesUpdateResultV3`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
62
+ end
63
+ h[k.to_sym] = v
64
+ }
65
+
66
+ if attributes.key?(:'alert_rule_set')
67
+ self.alert_rule_set = attributes[:'alert_rule_set']
68
+ else
69
+ self.alert_rule_set = nil
70
+ end
71
+ end
72
+
73
+ # Show invalid properties with the reasons. Usually used together with valid?
74
+ # @return Array for valid properties with the reasons
75
+ def list_invalid_properties
76
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
77
+ invalid_properties = Array.new
78
+ if @alert_rule_set.nil?
79
+ invalid_properties.push('invalid value for "alert_rule_set", alert_rule_set cannot be nil.')
80
+ end
81
+
82
+ invalid_properties
83
+ end
84
+
85
+ # Check to see if the all the properties in the model are valid
86
+ # @return true if the model is valid
87
+ def valid?
88
+ warn '[DEPRECATED] the `valid?` method is obsolete'
89
+ return false if @alert_rule_set.nil?
90
+ true
91
+ end
92
+
93
+ # Custom attribute writer method with validation
94
+ # @param [Object] alert_rule_set Value to be assigned
95
+ def alert_rule_set=(alert_rule_set)
96
+ if alert_rule_set.nil?
97
+ fail ArgumentError, 'alert_rule_set cannot be nil'
98
+ end
99
+
100
+ @alert_rule_set = alert_rule_set
101
+ end
102
+
103
+ # Checks equality by comparing each attribute.
104
+ # @param [Object] Object to be compared
105
+ def ==(o)
106
+ return true if self.equal?(o)
107
+ self.class == o.class &&
108
+ alert_rule_set == o.alert_rule_set
109
+ end
110
+
111
+ # @see the `==` method
112
+ # @param [Object] Object to be compared
113
+ def eql?(o)
114
+ self == o
115
+ end
116
+
117
+ # Calculates hash code according to all attributes.
118
+ # @return [Integer] Hash code
119
+ def hash
120
+ [alert_rule_set].hash
121
+ end
122
+
123
+ # Builds the object from hash
124
+ # @param [Hash] attributes Model attributes in the form of hash
125
+ # @return [Object] Returns the model itself
126
+ def self.build_from_hash(attributes)
127
+ return nil unless attributes.is_a?(Hash)
128
+ attributes = attributes.transform_keys(&:to_sym)
129
+ transformed_hash = {}
130
+ openapi_types.each_pair do |key, type|
131
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
132
+ transformed_hash["#{key}"] = nil
133
+ elsif type =~ /\AArray<(.*)>/i
134
+ # check to ensure the input is an array given that the attribute
135
+ # is documented as an array but the input is not
136
+ if attributes[attribute_map[key]].is_a?(Array)
137
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
138
+ end
139
+ elsif !attributes[attribute_map[key]].nil?
140
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
141
+ end
142
+ end
143
+ new(transformed_hash)
144
+ end
145
+
146
+ # Returns the object in the form of hash
147
+ # @return [Hash] Returns the object in the form of hash
148
+ def to_hash
149
+ hash = {}
150
+ self.class.attribute_map.each_pair do |attr, param|
151
+ value = self.send(attr)
152
+ if value.nil?
153
+ is_nullable = self.class.openapi_nullable.include?(attr)
154
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
155
+ end
156
+
157
+ hash[param] = _to_hash(value)
158
+ end
159
+ hash
160
+ end
161
+
162
+ end
163
+
164
+ end
@@ -0,0 +1,300 @@
1
+ =begin
2
+ #incident.io
3
+
4
+ #Ruby client for the incident.io API.
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.25.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module IncidentIo
17
+ # A team's alert grouping preference, which takes priority over the default grouping of every alert route its alerts match
18
+ class TeamGroupingPreferenceV3 < ApiModelBase
19
+ # When this preference was created
20
+ attr_accessor :created_at
21
+
22
+ attr_accessor :default
23
+
24
+ # Unique identifier for this preference
25
+ attr_accessor :id
26
+
27
+ # The catalog entry ID of the team this preference belongs to
28
+ attr_accessor :team_id
29
+
30
+ # When this preference was last updated
31
+ attr_accessor :updated_at
32
+
33
+ # The current version number, incremented on each update
34
+ attr_accessor :version
35
+
36
+ # Attribute mapping from ruby-style variable name to JSON key.
37
+ def self.attribute_map
38
+ {
39
+ :'created_at' => :'created_at',
40
+ :'default' => :'default',
41
+ :'id' => :'id',
42
+ :'team_id' => :'team_id',
43
+ :'updated_at' => :'updated_at',
44
+ :'version' => :'version'
45
+ }
46
+ end
47
+
48
+ # Returns attribute mapping this model knows about
49
+ def self.acceptable_attribute_map
50
+ attribute_map
51
+ end
52
+
53
+ # Returns all the JSON keys this model knows about
54
+ def self.acceptable_attributes
55
+ acceptable_attribute_map.values
56
+ end
57
+
58
+ # Attribute type mapping.
59
+ def self.openapi_types
60
+ {
61
+ :'created_at' => :'Time',
62
+ :'default' => :'AlertGroupingDefaultBranchV3',
63
+ :'id' => :'String',
64
+ :'team_id' => :'String',
65
+ :'updated_at' => :'Time',
66
+ :'version' => :'Integer'
67
+ }
68
+ end
69
+
70
+ # List of attributes with nullable: true
71
+ def self.openapi_nullable
72
+ Set.new([
73
+ ])
74
+ end
75
+
76
+ # Initializes the object
77
+ # @param [Hash] attributes Model attributes in the form of hash
78
+ def initialize(attributes = {})
79
+ if (!attributes.is_a?(Hash))
80
+ fail ArgumentError, "The input argument (attributes) must be a hash in `IncidentIo::TeamGroupingPreferenceV3` initialize method"
81
+ end
82
+
83
+ # check to see if the attribute exists and convert string to symbol for hash key
84
+ acceptable_attribute_map = self.class.acceptable_attribute_map
85
+ attributes = attributes.each_with_object({}) { |(k, v), h|
86
+ if (!acceptable_attribute_map.key?(k.to_sym))
87
+ fail ArgumentError, "`#{k}` is not a valid attribute in `IncidentIo::TeamGroupingPreferenceV3`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
88
+ end
89
+ h[k.to_sym] = v
90
+ }
91
+
92
+ if attributes.key?(:'created_at')
93
+ self.created_at = attributes[:'created_at']
94
+ else
95
+ self.created_at = nil
96
+ end
97
+
98
+ if attributes.key?(:'default')
99
+ self.default = attributes[:'default']
100
+ else
101
+ self.default = nil
102
+ end
103
+
104
+ if attributes.key?(:'id')
105
+ self.id = attributes[:'id']
106
+ else
107
+ self.id = nil
108
+ end
109
+
110
+ if attributes.key?(:'team_id')
111
+ self.team_id = attributes[:'team_id']
112
+ else
113
+ self.team_id = nil
114
+ end
115
+
116
+ if attributes.key?(:'updated_at')
117
+ self.updated_at = attributes[:'updated_at']
118
+ else
119
+ self.updated_at = nil
120
+ end
121
+
122
+ if attributes.key?(:'version')
123
+ self.version = attributes[:'version']
124
+ else
125
+ self.version = nil
126
+ end
127
+ end
128
+
129
+ # Show invalid properties with the reasons. Usually used together with valid?
130
+ # @return Array for valid properties with the reasons
131
+ def list_invalid_properties
132
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
133
+ invalid_properties = Array.new
134
+ if @created_at.nil?
135
+ invalid_properties.push('invalid value for "created_at", created_at cannot be nil.')
136
+ end
137
+
138
+ if @default.nil?
139
+ invalid_properties.push('invalid value for "default", default cannot be nil.')
140
+ end
141
+
142
+ if @id.nil?
143
+ invalid_properties.push('invalid value for "id", id cannot be nil.')
144
+ end
145
+
146
+ if @team_id.nil?
147
+ invalid_properties.push('invalid value for "team_id", team_id cannot be nil.')
148
+ end
149
+
150
+ if @updated_at.nil?
151
+ invalid_properties.push('invalid value for "updated_at", updated_at cannot be nil.')
152
+ end
153
+
154
+ if @version.nil?
155
+ invalid_properties.push('invalid value for "version", version cannot be nil.')
156
+ end
157
+
158
+ invalid_properties
159
+ end
160
+
161
+ # Check to see if the all the properties in the model are valid
162
+ # @return true if the model is valid
163
+ def valid?
164
+ warn '[DEPRECATED] the `valid?` method is obsolete'
165
+ return false if @created_at.nil?
166
+ return false if @default.nil?
167
+ return false if @id.nil?
168
+ return false if @team_id.nil?
169
+ return false if @updated_at.nil?
170
+ return false if @version.nil?
171
+ true
172
+ end
173
+
174
+ # Custom attribute writer method with validation
175
+ # @param [Object] created_at Value to be assigned
176
+ def created_at=(created_at)
177
+ if created_at.nil?
178
+ fail ArgumentError, 'created_at cannot be nil'
179
+ end
180
+
181
+ @created_at = created_at
182
+ end
183
+
184
+ # Custom attribute writer method with validation
185
+ # @param [Object] default Value to be assigned
186
+ def default=(default)
187
+ if default.nil?
188
+ fail ArgumentError, 'default cannot be nil'
189
+ end
190
+
191
+ @default = default
192
+ end
193
+
194
+ # Custom attribute writer method with validation
195
+ # @param [Object] id Value to be assigned
196
+ def id=(id)
197
+ if id.nil?
198
+ fail ArgumentError, 'id cannot be nil'
199
+ end
200
+
201
+ @id = id
202
+ end
203
+
204
+ # Custom attribute writer method with validation
205
+ # @param [Object] team_id Value to be assigned
206
+ def team_id=(team_id)
207
+ if team_id.nil?
208
+ fail ArgumentError, 'team_id cannot be nil'
209
+ end
210
+
211
+ @team_id = team_id
212
+ end
213
+
214
+ # Custom attribute writer method with validation
215
+ # @param [Object] updated_at Value to be assigned
216
+ def updated_at=(updated_at)
217
+ if updated_at.nil?
218
+ fail ArgumentError, 'updated_at cannot be nil'
219
+ end
220
+
221
+ @updated_at = updated_at
222
+ end
223
+
224
+ # Custom attribute writer method with validation
225
+ # @param [Object] version Value to be assigned
226
+ def version=(version)
227
+ if version.nil?
228
+ fail ArgumentError, 'version cannot be nil'
229
+ end
230
+
231
+ @version = version
232
+ end
233
+
234
+ # Checks equality by comparing each attribute.
235
+ # @param [Object] Object to be compared
236
+ def ==(o)
237
+ return true if self.equal?(o)
238
+ self.class == o.class &&
239
+ created_at == o.created_at &&
240
+ default == o.default &&
241
+ id == o.id &&
242
+ team_id == o.team_id &&
243
+ updated_at == o.updated_at &&
244
+ version == o.version
245
+ end
246
+
247
+ # @see the `==` method
248
+ # @param [Object] Object to be compared
249
+ def eql?(o)
250
+ self == o
251
+ end
252
+
253
+ # Calculates hash code according to all attributes.
254
+ # @return [Integer] Hash code
255
+ def hash
256
+ [created_at, default, id, team_id, updated_at, version].hash
257
+ end
258
+
259
+ # Builds the object from hash
260
+ # @param [Hash] attributes Model attributes in the form of hash
261
+ # @return [Object] Returns the model itself
262
+ def self.build_from_hash(attributes)
263
+ return nil unless attributes.is_a?(Hash)
264
+ attributes = attributes.transform_keys(&:to_sym)
265
+ transformed_hash = {}
266
+ openapi_types.each_pair do |key, type|
267
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
268
+ transformed_hash["#{key}"] = nil
269
+ elsif type =~ /\AArray<(.*)>/i
270
+ # check to ensure the input is an array given that the attribute
271
+ # is documented as an array but the input is not
272
+ if attributes[attribute_map[key]].is_a?(Array)
273
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
274
+ end
275
+ elsif !attributes[attribute_map[key]].nil?
276
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
277
+ end
278
+ end
279
+ new(transformed_hash)
280
+ end
281
+
282
+ # Returns the object in the form of hash
283
+ # @return [Hash] Returns the object in the form of hash
284
+ def to_hash
285
+ hash = {}
286
+ self.class.attribute_map.each_pair do |attr, param|
287
+ value = self.send(attr)
288
+ if value.nil?
289
+ is_nullable = self.class.openapi_nullable.include?(attr)
290
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
291
+ end
292
+
293
+ hash[param] = _to_hash(value)
294
+ end
295
+ hash
296
+ end
297
+
298
+ end
299
+
300
+ end