seatschart 0.2.0 → 0.4.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 (117) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +199 -19
  3. data/lib/seatschart/api/audit_api.rb +2 -2
  4. data/lib/seatschart/api/auth_api.rb +81 -4
  5. data/lib/seatschart/api/billing_api.rb +4 -0
  6. data/lib/seatschart/api/charts_api.rb +810 -77
  7. data/lib/seatschart/api/embed_api.rb +5 -5
  8. data/lib/seatschart/api/embed_origins_api.rb +63 -2
  9. data/lib/seatschart/api/event_log_api.rb +2 -2
  10. data/lib/seatschart/api/events_api.rb +1491 -175
  11. data/lib/seatschart/api/health_api.rb +244 -0
  12. data/lib/seatschart/api/map_designer_api.rb +11 -9
  13. data/lib/seatschart/api/public_api.rb +356 -6
  14. data/lib/seatschart/api/sandboxes_api.rb +672 -0
  15. data/lib/seatschart/api/seasons_api.rb +344 -36
  16. data/lib/seatschart/api/seats_api.rb +10 -10
  17. data/lib/seatschart/api/usage_api.rb +18 -15
  18. data/lib/seatschart/api/webhooks_api.rb +2 -2
  19. data/lib/seatschart/api/workspace_api.rb +1815 -363
  20. data/lib/seatschart/models/api_error.rb +4 -4
  21. data/lib/seatschart/models/delete_api_sandboxes_by_sandbox_id200_response.rb +255 -0
  22. data/lib/seatschart/models/delete_api_workspaces_by_workspace_id_keys_by_key_id200_response.rb +237 -0
  23. data/lib/seatschart/models/get_api_monitoring_requests200_response.rb +62 -4
  24. data/lib/seatschart/models/get_api_monitoring_requests200_response_points_inner.rb +21 -4
  25. data/lib/seatschart/models/get_api_sandboxes200_response.rb +239 -0
  26. data/lib/seatschart/models/get_api_sandboxes200_response_items_inner.rb +431 -0
  27. data/lib/seatschart/models/get_api_sandboxes200_response_items_inner_rate_limits.rb +270 -0
  28. data/lib/seatschart/models/get_api_sandboxes200_response_items_inner_usage.rb +287 -0
  29. data/lib/seatschart/models/get_api_status200_response.rb +387 -0
  30. data/lib/seatschart/models/get_api_status200_response_components_inner.rb +330 -0
  31. data/lib/seatschart/models/get_api_status200_response_components_inner_days_inner.rb +301 -0
  32. data/lib/seatschart/models/get_api_status200_response_incidents_inner.rb +374 -0
  33. data/lib/seatschart/models/get_api_status200_response_maintenance_inner.rb +350 -0
  34. data/lib/seatschart/models/get_api_status503_response.rb +271 -0
  35. data/lib/seatschart/models/get_api_workspace_buyer_extra_data200_response.rb +241 -0
  36. data/lib/seatschart/models/get_api_workspace_defaults200_response.rb +254 -0
  37. data/lib/seatschart/models/get_api_workspace_defaults200_response_renderer.rb +246 -0
  38. data/lib/seatschart/models/get_api_workspace_defaults200_response_renderer_built_in.rb +270 -0
  39. data/lib/seatschart/models/get_api_workspaces200_response_items_inner.rb +80 -5
  40. data/lib/seatschart/models/get_api_workspaces_by_workspace_id_keys200_response.rb +239 -0
  41. data/lib/seatschart/models/get_api_workspaces_by_workspace_id_keys200_response_api_keys_inner.rb +321 -0
  42. data/lib/seatschart/models/get_api_workspaces_created_by_api_parameter.rb +103 -0
  43. data/lib/seatschart/models/get_api_workspaces_overview_created_by_api_parameter.rb +103 -0
  44. data/lib/seatschart/models/patch_api_events_by_event_id_request.rb +12 -2
  45. data/lib/seatschart/models/patch_api_seasons_by_season_id_request.rb +15 -5
  46. data/lib/seatschart/models/patch_api_workspace_chart_validation_request_severities.rb +25 -4
  47. data/lib/seatschart/models/patch_api_workspace_defaults_request.rb +224 -0
  48. data/lib/seatschart/models/patch_api_workspace_defaults_request_renderer.rb +249 -0
  49. data/lib/seatschart/models/patch_api_workspace_settings_request.rb +6 -6
  50. data/lib/seatschart/models/patch_api_workspaces_by_workspace_id_keys_by_key_id200_response.rb +221 -0
  51. data/lib/seatschart/models/patch_api_workspaces_by_workspace_id_keys_by_key_id_request.rb +292 -0
  52. data/lib/seatschart/models/patch_api_workspaces_by_workspace_id_request.rb +288 -0
  53. data/lib/seatschart/models/post_api_auth_new_workspace_request.rb +294 -0
  54. data/lib/seatschart/models/post_api_charts_by_chart_id_actions_copy_to_workspace_request.rb +39 -1
  55. data/lib/seatschart/models/post_api_charts_by_chart_id_actions_validate_request.rb +1 -0
  56. data/lib/seatschart/models/post_api_charts_by_chart_id_map_publish422_response_issues_inner.rb +64 -6
  57. data/lib/seatschart/models/post_api_charts_by_chart_id_map_publish_request.rb +1 -1
  58. data/lib/seatschart/models/post_api_embed_tokens_request.rb +18 -15
  59. data/lib/seatschart/models/post_api_embed_tokens_request_safe_mode_options.rb +226 -0
  60. data/lib/seatschart/models/post_api_events_actions_edit_for_sale_config_request.rb +251 -0
  61. data/lib/seatschart/models/post_api_events_actions_edit_for_sale_config_request_events_inner.rb +322 -0
  62. data/lib/seatschart/models/post_api_events_bulk_request_events_inner.rb +42 -1
  63. data/lib/seatschart/models/post_api_events_by_event_id_actions_edit_for_sale_config_request.rb +277 -0
  64. data/lib/seatschart/models/post_api_events_by_event_id_actions_edit_for_sale_config_request_for_sale_inner.rb +319 -0
  65. data/lib/seatschart/models/post_api_events_by_event_id_map_publish_request.rb +215 -0
  66. data/lib/seatschart/models/post_api_events_request.rb +42 -1
  67. data/lib/seatschart/models/{patch_api_events_by_event_id_request_categories_inner.rb → post_api_events_request_categories_inner.rb} +3 -3
  68. data/lib/seatschart/models/post_api_extract_seats200_response.rb +459 -0
  69. data/lib/seatschart/models/post_api_extract_seats200_response_seats_inner.rb +323 -0
  70. data/lib/seatschart/models/post_api_extract_seats200_response_suggested_inner.rb +320 -0
  71. data/lib/seatschart/models/post_api_extract_seats_request.rb +124 -4
  72. data/lib/seatschart/models/post_api_extract_seats_request_examples.rb +105 -0
  73. data/lib/seatschart/models/post_api_extract_seats_request_examples_any_of_inner.rb +293 -0
  74. data/lib/seatschart/models/post_api_extract_seats_request_negatives.rb +105 -0
  75. data/lib/seatschart/models/post_api_extract_seats_request_region.rb +105 -0
  76. data/lib/seatschart/models/{put_api_charts_by_chart_id_map_draft_request.rb → post_api_extract_seats_request_region_any_of.rb} +111 -96
  77. data/lib/seatschart/models/post_api_sandboxes201_response.rb +245 -0
  78. data/lib/seatschart/models/post_api_sandboxes201_response_admin_key.rb +286 -0
  79. data/lib/seatschart/models/post_api_sandboxes201_response_copied.rb +313 -0
  80. data/lib/seatschart/models/post_api_sandboxes201_response_copied_charts_inner.rb +281 -0
  81. data/lib/seatschart/models/post_api_sandboxes201_response_copied_events_inner.rb +281 -0
  82. data/lib/seatschart/models/post_api_sandboxes201_response_copied_events_with_own_map_inner.rb +265 -0
  83. data/lib/seatschart/models/post_api_sandboxes201_response_copied_key_conflicts_inner.rb +287 -0
  84. data/lib/seatschart/models/post_api_sandboxes201_response_copied_seasons_inner.rb +312 -0
  85. data/lib/seatschart/models/post_api_sandboxes_by_sandbox_id_actions_copy_from_production200_response.rb +313 -0
  86. data/lib/seatschart/models/post_api_sandboxes_by_sandbox_id_actions_copy_from_production_request.rb +255 -0
  87. data/lib/seatschart/models/post_api_sandboxes_by_sandbox_id_actions_join200_response.rb +271 -0
  88. data/lib/seatschart/models/post_api_sandboxes_by_sandbox_id_actions_reset200_response.rb +268 -0
  89. data/lib/seatschart/models/post_api_sandboxes_by_sandbox_id_actions_reset_request.rb +225 -0
  90. data/lib/seatschart/models/post_api_sandboxes_by_sandbox_id_admin_key201_response.rb +253 -0
  91. data/lib/seatschart/models/post_api_sandboxes_by_sandbox_id_admin_key201_response_api_key.rb +286 -0
  92. data/lib/seatschart/models/post_api_sandboxes_by_sandbox_id_admin_key_request.rb +252 -0
  93. data/lib/seatschart/models/post_api_sandboxes_request.rb +319 -0
  94. data/lib/seatschart/models/post_api_seasons_request.rb +14 -4
  95. data/lib/seatschart/models/post_api_seats_confirm_request.rb +5 -5
  96. data/lib/seatschart/models/post_api_seats_release_request.rb +5 -5
  97. data/lib/seatschart/models/post_api_seats_reserve_request.rb +5 -5
  98. data/lib/seatschart/models/post_api_workspaces200_response.rb +468 -0
  99. data/lib/seatschart/models/post_api_workspaces200_response_api_key.rb +332 -0
  100. data/lib/seatschart/models/post_api_workspaces200_response_template.rb +260 -0
  101. data/lib/seatschart/models/post_api_workspaces200_response_template_webhooks_inner.rb +284 -0
  102. data/lib/seatschart/models/post_api_workspaces_by_workspace_id_actions_delete200_response.rb +319 -0
  103. data/lib/seatschart/models/post_api_workspaces_by_workspace_id_actions_delete_request.rb +281 -0
  104. data/lib/seatschart/models/post_api_workspaces_by_workspace_id_invitations_request.rb +300 -0
  105. data/lib/seatschart/models/post_api_workspaces_by_workspace_id_keys201_response.rb +237 -0
  106. data/lib/seatschart/models/post_api_workspaces_by_workspace_id_keys201_response_api_key.rb +338 -0
  107. data/lib/seatschart/models/post_api_workspaces_by_workspace_id_keys_request.rb +299 -0
  108. data/lib/seatschart/models/post_api_workspaces_request.rb +101 -5
  109. data/lib/seatschart/models/post_api_workspaces_request_issue_key.rb +294 -0
  110. data/lib/seatschart/models/put_api_workspace_buyer_extra_data_request.rb +260 -0
  111. data/lib/seatschart/models/put_internal_status_notices_request.rb +242 -0
  112. data/lib/seatschart/models/put_internal_status_notices_request_notices_inner.rb +445 -0
  113. data/lib/seatschart/retry.rb +106 -7
  114. data/lib/seatschart/version.rb +1 -1
  115. data/lib/seatschart.rb +73 -3
  116. metadata +75 -5
  117. data/lib/seatschart/api/default_api.rb +0 -763
@@ -0,0 +1,237 @@
1
+ =begin
2
+ #SeatsChart API
3
+
4
+ #Seat inventory and locking API for B2B2C integrations. Authenticate using `x-api-key` (partners) or `Authorization: Bearer` with an HS256 JWT.
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.11.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module SeatsChart
17
+ class PostApiWorkspacesByWorkspaceIdKeys201Response
18
+ attr_accessor :api_key
19
+
20
+ attr_accessor :warning
21
+
22
+ # Attribute mapping from ruby-style variable name to JSON key.
23
+ def self.attribute_map
24
+ {
25
+ :'api_key' => :'apiKey',
26
+ :'warning' => :'warning'
27
+ }
28
+ end
29
+
30
+ # Returns all the JSON keys this model knows about
31
+ def self.acceptable_attributes
32
+ attribute_map.values
33
+ end
34
+
35
+ # Attribute type mapping.
36
+ def self.openapi_types
37
+ {
38
+ :'api_key' => :'PostApiWorkspacesByWorkspaceIdKeys201ResponseApiKey',
39
+ :'warning' => :'String'
40
+ }
41
+ end
42
+
43
+ # List of attributes with nullable: true
44
+ def self.openapi_nullable
45
+ Set.new([
46
+ ])
47
+ end
48
+
49
+ # Initializes the object
50
+ # @param [Hash] attributes Model attributes in the form of hash
51
+ def initialize(attributes = {})
52
+ if (!attributes.is_a?(Hash))
53
+ fail ArgumentError, "The input argument (attributes) must be a hash in `SeatsChart::PostApiWorkspacesByWorkspaceIdKeys201Response` initialize method"
54
+ end
55
+
56
+ # check to see if the attribute exists and convert string to symbol for hash key
57
+ attributes = attributes.each_with_object({}) { |(k, v), h|
58
+ if (!self.class.attribute_map.key?(k.to_sym))
59
+ fail ArgumentError, "`#{k}` is not a valid attribute in `SeatsChart::PostApiWorkspacesByWorkspaceIdKeys201Response`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
60
+ end
61
+ h[k.to_sym] = v
62
+ }
63
+
64
+ if attributes.key?(:'api_key')
65
+ self.api_key = attributes[:'api_key']
66
+ else
67
+ self.api_key = nil
68
+ end
69
+
70
+ if attributes.key?(:'warning')
71
+ self.warning = attributes[:'warning']
72
+ else
73
+ self.warning = nil
74
+ end
75
+ end
76
+
77
+ # Show invalid properties with the reasons. Usually used together with valid?
78
+ # @return Array for valid properties with the reasons
79
+ def list_invalid_properties
80
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
81
+ invalid_properties = Array.new
82
+ if @api_key.nil?
83
+ invalid_properties.push('invalid value for "api_key", api_key cannot be nil.')
84
+ end
85
+
86
+ if @warning.nil?
87
+ invalid_properties.push('invalid value for "warning", warning cannot be nil.')
88
+ end
89
+
90
+ invalid_properties
91
+ end
92
+
93
+ # Check to see if the all the properties in the model are valid
94
+ # @return true if the model is valid
95
+ def valid?
96
+ warn '[DEPRECATED] the `valid?` method is obsolete'
97
+ return false if @api_key.nil?
98
+ return false if @warning.nil?
99
+ true
100
+ end
101
+
102
+ # Checks equality by comparing each attribute.
103
+ # @param [Object] Object to be compared
104
+ def ==(o)
105
+ return true if self.equal?(o)
106
+ self.class == o.class &&
107
+ api_key == o.api_key &&
108
+ warning == o.warning
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
+ [api_key, warning].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
+ # Deserializes the data based on type
147
+ # @param string type Data type
148
+ # @param string value Value to be deserialized
149
+ # @return [Object] Deserialized data
150
+ def self._deserialize(type, value)
151
+ case type.to_sym
152
+ when :Time
153
+ Time.parse(value)
154
+ when :Date
155
+ Date.parse(value)
156
+ when :String
157
+ value.to_s
158
+ when :Integer
159
+ value.to_i
160
+ when :Float
161
+ value.to_f
162
+ when :Boolean
163
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
164
+ true
165
+ else
166
+ false
167
+ end
168
+ when :Object
169
+ # generic object (usually a Hash), return directly
170
+ value
171
+ when /\AArray<(?<inner_type>.+)>\z/
172
+ inner_type = Regexp.last_match[:inner_type]
173
+ value.map { |v| _deserialize(inner_type, v) }
174
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
175
+ k_type = Regexp.last_match[:k_type]
176
+ v_type = Regexp.last_match[:v_type]
177
+ {}.tap do |hash|
178
+ value.each do |k, v|
179
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
180
+ end
181
+ end
182
+ else # model
183
+ # models (e.g. Pet) or oneOf
184
+ klass = SeatsChart.const_get(type)
185
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
186
+ end
187
+ end
188
+
189
+ # Returns the string representation of the object
190
+ # @return [String] String presentation of the object
191
+ def to_s
192
+ to_hash.to_s
193
+ end
194
+
195
+ # to_body is an alias to to_hash (backward compatibility)
196
+ # @return [Hash] Returns the object in the form of hash
197
+ def to_body
198
+ to_hash
199
+ end
200
+
201
+ # Returns the object in the form of hash
202
+ # @return [Hash] Returns the object in the form of hash
203
+ def to_hash
204
+ hash = {}
205
+ self.class.attribute_map.each_pair do |attr, param|
206
+ value = self.send(attr)
207
+ if value.nil?
208
+ is_nullable = self.class.openapi_nullable.include?(attr)
209
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
210
+ end
211
+
212
+ hash[param] = _to_hash(value)
213
+ end
214
+ hash
215
+ end
216
+
217
+ # Outputs non-array value in the form of hash
218
+ # For object, use to_hash. Otherwise, just return the value
219
+ # @param [Object] value Any valid value
220
+ # @return [Hash] Returns the value in the form of hash
221
+ def _to_hash(value)
222
+ if value.is_a?(Array)
223
+ value.compact.map { |v| _to_hash(v) }
224
+ elsif value.is_a?(Hash)
225
+ {}.tap do |hash|
226
+ value.each { |k, v| hash[k] = _to_hash(v) }
227
+ end
228
+ elsif value.respond_to? :to_hash
229
+ value.to_hash
230
+ else
231
+ value
232
+ end
233
+ end
234
+
235
+ end
236
+
237
+ end
@@ -0,0 +1,338 @@
1
+ =begin
2
+ #SeatsChart API
3
+
4
+ #Seat inventory and locking API for B2B2C integrations. Authenticate using `x-api-key` (partners) or `Authorization: Bearer` with an HS256 JWT.
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.11.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module SeatsChart
17
+ class PostApiWorkspacesByWorkspaceIdKeys201ResponseApiKey
18
+ attr_accessor :id
19
+
20
+ attr_accessor :name
21
+
22
+ # Non-secret fingerprint (`sk_live_1a2b3c4d…`).
23
+ attr_accessor :prefix
24
+
25
+ attr_accessor :created_at
26
+
27
+ attr_accessor :scopes
28
+
29
+ attr_accessor :full_access
30
+
31
+ # A workspace admin key (read only here).
32
+ attr_accessor :workspace_admin
33
+
34
+ # Shown once.
35
+ attr_accessor :secret
36
+
37
+ # Attribute mapping from ruby-style variable name to JSON key.
38
+ def self.attribute_map
39
+ {
40
+ :'id' => :'id',
41
+ :'name' => :'name',
42
+ :'prefix' => :'prefix',
43
+ :'created_at' => :'createdAt',
44
+ :'scopes' => :'scopes',
45
+ :'full_access' => :'fullAccess',
46
+ :'workspace_admin' => :'workspaceAdmin',
47
+ :'secret' => :'secret'
48
+ }
49
+ end
50
+
51
+ # Returns all the JSON keys this model knows about
52
+ def self.acceptable_attributes
53
+ attribute_map.values
54
+ end
55
+
56
+ # Attribute type mapping.
57
+ def self.openapi_types
58
+ {
59
+ :'id' => :'String',
60
+ :'name' => :'String',
61
+ :'prefix' => :'String',
62
+ :'created_at' => :'Time',
63
+ :'scopes' => :'Array<String>',
64
+ :'full_access' => :'Boolean',
65
+ :'workspace_admin' => :'Boolean',
66
+ :'secret' => :'String'
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 `SeatsChart::PostApiWorkspacesByWorkspaceIdKeys201ResponseApiKey` initialize method"
81
+ end
82
+
83
+ # check to see if the attribute exists and convert string to symbol for hash key
84
+ attributes = attributes.each_with_object({}) { |(k, v), h|
85
+ if (!self.class.attribute_map.key?(k.to_sym))
86
+ fail ArgumentError, "`#{k}` is not a valid attribute in `SeatsChart::PostApiWorkspacesByWorkspaceIdKeys201ResponseApiKey`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
87
+ end
88
+ h[k.to_sym] = v
89
+ }
90
+
91
+ if attributes.key?(:'id')
92
+ self.id = attributes[:'id']
93
+ else
94
+ self.id = nil
95
+ end
96
+
97
+ if attributes.key?(:'name')
98
+ self.name = attributes[:'name']
99
+ else
100
+ self.name = nil
101
+ end
102
+
103
+ if attributes.key?(:'prefix')
104
+ self.prefix = attributes[:'prefix']
105
+ else
106
+ self.prefix = nil
107
+ end
108
+
109
+ if attributes.key?(:'created_at')
110
+ self.created_at = attributes[:'created_at']
111
+ else
112
+ self.created_at = nil
113
+ end
114
+
115
+ if attributes.key?(:'scopes')
116
+ if (value = attributes[:'scopes']).is_a?(Array)
117
+ self.scopes = value
118
+ end
119
+ else
120
+ self.scopes = nil
121
+ end
122
+
123
+ if attributes.key?(:'full_access')
124
+ self.full_access = attributes[:'full_access']
125
+ else
126
+ self.full_access = nil
127
+ end
128
+
129
+ if attributes.key?(:'workspace_admin')
130
+ self.workspace_admin = attributes[:'workspace_admin']
131
+ else
132
+ self.workspace_admin = nil
133
+ end
134
+
135
+ if attributes.key?(:'secret')
136
+ self.secret = attributes[:'secret']
137
+ else
138
+ self.secret = nil
139
+ end
140
+ end
141
+
142
+ # Show invalid properties with the reasons. Usually used together with valid?
143
+ # @return Array for valid properties with the reasons
144
+ def list_invalid_properties
145
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
146
+ invalid_properties = Array.new
147
+ if @id.nil?
148
+ invalid_properties.push('invalid value for "id", id cannot be nil.')
149
+ end
150
+
151
+ if @name.nil?
152
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
153
+ end
154
+
155
+ if @prefix.nil?
156
+ invalid_properties.push('invalid value for "prefix", prefix cannot be nil.')
157
+ end
158
+
159
+ if @created_at.nil?
160
+ invalid_properties.push('invalid value for "created_at", created_at cannot be nil.')
161
+ end
162
+
163
+ if @scopes.nil?
164
+ invalid_properties.push('invalid value for "scopes", scopes cannot be nil.')
165
+ end
166
+
167
+ if @full_access.nil?
168
+ invalid_properties.push('invalid value for "full_access", full_access cannot be nil.')
169
+ end
170
+
171
+ if @workspace_admin.nil?
172
+ invalid_properties.push('invalid value for "workspace_admin", workspace_admin cannot be nil.')
173
+ end
174
+
175
+ if @secret.nil?
176
+ invalid_properties.push('invalid value for "secret", secret cannot be nil.')
177
+ end
178
+
179
+ invalid_properties
180
+ end
181
+
182
+ # Check to see if the all the properties in the model are valid
183
+ # @return true if the model is valid
184
+ def valid?
185
+ warn '[DEPRECATED] the `valid?` method is obsolete'
186
+ return false if @id.nil?
187
+ return false if @name.nil?
188
+ return false if @prefix.nil?
189
+ return false if @created_at.nil?
190
+ return false if @scopes.nil?
191
+ return false if @full_access.nil?
192
+ return false if @workspace_admin.nil?
193
+ return false if @secret.nil?
194
+ true
195
+ end
196
+
197
+ # Checks equality by comparing each attribute.
198
+ # @param [Object] Object to be compared
199
+ def ==(o)
200
+ return true if self.equal?(o)
201
+ self.class == o.class &&
202
+ id == o.id &&
203
+ name == o.name &&
204
+ prefix == o.prefix &&
205
+ created_at == o.created_at &&
206
+ scopes == o.scopes &&
207
+ full_access == o.full_access &&
208
+ workspace_admin == o.workspace_admin &&
209
+ secret == o.secret
210
+ end
211
+
212
+ # @see the `==` method
213
+ # @param [Object] Object to be compared
214
+ def eql?(o)
215
+ self == o
216
+ end
217
+
218
+ # Calculates hash code according to all attributes.
219
+ # @return [Integer] Hash code
220
+ def hash
221
+ [id, name, prefix, created_at, scopes, full_access, workspace_admin, secret].hash
222
+ end
223
+
224
+ # Builds the object from hash
225
+ # @param [Hash] attributes Model attributes in the form of hash
226
+ # @return [Object] Returns the model itself
227
+ def self.build_from_hash(attributes)
228
+ return nil unless attributes.is_a?(Hash)
229
+ attributes = attributes.transform_keys(&:to_sym)
230
+ transformed_hash = {}
231
+ openapi_types.each_pair do |key, type|
232
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
233
+ transformed_hash["#{key}"] = nil
234
+ elsif type =~ /\AArray<(.*)>/i
235
+ # check to ensure the input is an array given that the attribute
236
+ # is documented as an array but the input is not
237
+ if attributes[attribute_map[key]].is_a?(Array)
238
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
239
+ end
240
+ elsif !attributes[attribute_map[key]].nil?
241
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
242
+ end
243
+ end
244
+ new(transformed_hash)
245
+ end
246
+
247
+ # Deserializes the data based on type
248
+ # @param string type Data type
249
+ # @param string value Value to be deserialized
250
+ # @return [Object] Deserialized data
251
+ def self._deserialize(type, value)
252
+ case type.to_sym
253
+ when :Time
254
+ Time.parse(value)
255
+ when :Date
256
+ Date.parse(value)
257
+ when :String
258
+ value.to_s
259
+ when :Integer
260
+ value.to_i
261
+ when :Float
262
+ value.to_f
263
+ when :Boolean
264
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
265
+ true
266
+ else
267
+ false
268
+ end
269
+ when :Object
270
+ # generic object (usually a Hash), return directly
271
+ value
272
+ when /\AArray<(?<inner_type>.+)>\z/
273
+ inner_type = Regexp.last_match[:inner_type]
274
+ value.map { |v| _deserialize(inner_type, v) }
275
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
276
+ k_type = Regexp.last_match[:k_type]
277
+ v_type = Regexp.last_match[:v_type]
278
+ {}.tap do |hash|
279
+ value.each do |k, v|
280
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
281
+ end
282
+ end
283
+ else # model
284
+ # models (e.g. Pet) or oneOf
285
+ klass = SeatsChart.const_get(type)
286
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
287
+ end
288
+ end
289
+
290
+ # Returns the string representation of the object
291
+ # @return [String] String presentation of the object
292
+ def to_s
293
+ to_hash.to_s
294
+ end
295
+
296
+ # to_body is an alias to to_hash (backward compatibility)
297
+ # @return [Hash] Returns the object in the form of hash
298
+ def to_body
299
+ to_hash
300
+ end
301
+
302
+ # Returns the object in the form of hash
303
+ # @return [Hash] Returns the object in the form of hash
304
+ def to_hash
305
+ hash = {}
306
+ self.class.attribute_map.each_pair do |attr, param|
307
+ value = self.send(attr)
308
+ if value.nil?
309
+ is_nullable = self.class.openapi_nullable.include?(attr)
310
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
311
+ end
312
+
313
+ hash[param] = _to_hash(value)
314
+ end
315
+ hash
316
+ end
317
+
318
+ # Outputs non-array value in the form of hash
319
+ # For object, use to_hash. Otherwise, just return the value
320
+ # @param [Object] value Any valid value
321
+ # @return [Hash] Returns the value in the form of hash
322
+ def _to_hash(value)
323
+ if value.is_a?(Array)
324
+ value.compact.map { |v| _to_hash(v) }
325
+ elsif value.is_a?(Hash)
326
+ {}.tap do |hash|
327
+ value.each { |k, v| hash[k] = _to_hash(v) }
328
+ end
329
+ elsif value.respond_to? :to_hash
330
+ value.to_hash
331
+ else
332
+ value
333
+ end
334
+ end
335
+
336
+ end
337
+
338
+ end