shipeasy-sdk 2.1.0 → 2.3.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 (171) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -0
  3. data/docs/skill/SKILL.md +6 -2
  4. data/lib/generators/shipeasy/install/USAGE +24 -0
  5. data/lib/generators/shipeasy/install/install_generator.rb +86 -0
  6. data/lib/generators/shipeasy/install/templates/initializer.rb.tt +41 -0
  7. data/lib/shipeasy/admin.rb +85 -0
  8. data/lib/shipeasy/sdk/version.rb +1 -1
  9. data/lib/shipeasy_admin/api/alert_rules_api.rb +292 -0
  10. data/lib/shipeasy_admin/api/attributes_api.rb +82 -0
  11. data/lib/shipeasy_admin/api/configs_api.rb +680 -0
  12. data/lib/shipeasy_admin/api/events_api.rb +438 -0
  13. data/lib/shipeasy_admin/api/experiments_api.rb +727 -0
  14. data/lib/shipeasy_admin/api/gates_api.rb +438 -0
  15. data/lib/shipeasy_admin/api/i18n_api.rb +507 -0
  16. data/lib/shipeasy_admin/api/killswitches_api.rb +526 -0
  17. data/lib/shipeasy_admin/api/metrics_api.rb +281 -0
  18. data/lib/shipeasy_admin/api/ops_api.rb +525 -0
  19. data/lib/shipeasy_admin/api/projects_api.rb +153 -0
  20. data/lib/shipeasy_admin/api/universes_api.rb +306 -0
  21. data/lib/shipeasy_admin/api_client.rb +441 -0
  22. data/lib/shipeasy_admin/api_error.rb +58 -0
  23. data/lib/shipeasy_admin/api_model_base.rb +88 -0
  24. data/lib/shipeasy_admin/configuration.rb +397 -0
  25. data/lib/shipeasy_admin/models/approve_event_request.rb +198 -0
  26. data/lib/shipeasy_admin/models/approve_event_response.rb +166 -0
  27. data/lib/shipeasy_admin/models/create_alert_rule_request.rb +408 -0
  28. data/lib/shipeasy_admin/models/create_alert_rule_response.rb +165 -0
  29. data/lib/shipeasy_admin/models/create_config_request.rb +280 -0
  30. data/lib/shipeasy_admin/models/create_config_response.rb +201 -0
  31. data/lib/shipeasy_admin/models/create_event_request.rb +253 -0
  32. data/lib/shipeasy_admin/models/create_event_response.rb +193 -0
  33. data/lib/shipeasy_admin/models/create_experiment_request.rb +869 -0
  34. data/lib/shipeasy_admin/models/create_experiment_request_goal_metric.rb +336 -0
  35. data/lib/shipeasy_admin/models/create_experiment_response.rb +212 -0
  36. data/lib/shipeasy_admin/models/create_gate_request.rb +529 -0
  37. data/lib/shipeasy_admin/models/create_gate_response.rb +212 -0
  38. data/lib/shipeasy_admin/models/create_i18n_profile_request.rb +188 -0
  39. data/lib/shipeasy_admin/models/create_i18n_profile_response.rb +193 -0
  40. data/lib/shipeasy_admin/models/create_killswitch_request.rb +263 -0
  41. data/lib/shipeasy_admin/models/create_killswitch_response.rb +201 -0
  42. data/lib/shipeasy_admin/models/create_metric_request.rb +415 -0
  43. data/lib/shipeasy_admin/models/create_metric_response.rb +193 -0
  44. data/lib/shipeasy_admin/models/create_ops_item_request.rb +287 -0
  45. data/lib/shipeasy_admin/models/create_ops_item_response.rb +177 -0
  46. data/lib/shipeasy_admin/models/create_universe_request.rb +289 -0
  47. data/lib/shipeasy_admin/models/create_universe_response.rb +212 -0
  48. data/lib/shipeasy_admin/models/delete_alert_rule_response.rb +188 -0
  49. data/lib/shipeasy_admin/models/delete_config_response.rb +188 -0
  50. data/lib/shipeasy_admin/models/delete_event_response.rb +189 -0
  51. data/lib/shipeasy_admin/models/delete_experiment_response.rb +188 -0
  52. data/lib/shipeasy_admin/models/delete_gate_response.rb +188 -0
  53. data/lib/shipeasy_admin/models/delete_killswitch_response.rb +188 -0
  54. data/lib/shipeasy_admin/models/delete_metric_response.rb +189 -0
  55. data/lib/shipeasy_admin/models/delete_universe_response.rb +188 -0
  56. data/lib/shipeasy_admin/models/disable_gate_response.rb +190 -0
  57. data/lib/shipeasy_admin/models/discard_config_draft_request.rb +190 -0
  58. data/lib/shipeasy_admin/models/discard_config_draft_response.rb +188 -0
  59. data/lib/shipeasy_admin/models/enable_gate_response.rb +190 -0
  60. data/lib/shipeasy_admin/models/error_response.rb +185 -0
  61. data/lib/shipeasy_admin/models/get_config_response.rb +351 -0
  62. data/lib/shipeasy_admin/models/get_current_project_response.rb +606 -0
  63. data/lib/shipeasy_admin/models/get_current_project_response_module_translations.rb +104 -0
  64. data/lib/shipeasy_admin/models/get_event_response.rb +344 -0
  65. data/lib/shipeasy_admin/models/get_experiment_response.rb +688 -0
  66. data/lib/shipeasy_admin/models/get_experiment_results_response.rb +243 -0
  67. data/lib/shipeasy_admin/models/get_experiment_results_response_experiment.rb +248 -0
  68. data/lib/shipeasy_admin/models/get_experiment_results_response_results_inner.rb +252 -0
  69. data/lib/shipeasy_admin/models/get_experiment_timeseries_response.rb +192 -0
  70. data/lib/shipeasy_admin/models/get_experiment_timeseries_response_experiment.rb +261 -0
  71. data/lib/shipeasy_admin/models/get_experiment_timeseries_response_series_inner.rb +278 -0
  72. data/lib/shipeasy_admin/models/get_killswitch_response.rb +270 -0
  73. data/lib/shipeasy_admin/models/get_metric_response.rb +378 -0
  74. data/lib/shipeasy_admin/models/get_ops_item_response.rb +349 -0
  75. data/lib/shipeasy_admin/models/link_pr_to_ops_item_request.rb +186 -0
  76. data/lib/shipeasy_admin/models/link_pr_to_ops_item_response.rb +166 -0
  77. data/lib/shipeasy_admin/models/list_alert_rules_response_inner.rb +478 -0
  78. data/lib/shipeasy_admin/models/list_alert_rules_response_inner_notify.rb +177 -0
  79. data/lib/shipeasy_admin/models/list_alert_rules_response_inner_notify_slack_channel.rb +211 -0
  80. data/lib/shipeasy_admin/models/list_attributes_response_inner.rb +176 -0
  81. data/lib/shipeasy_admin/models/list_config_activity_response_inner.rb +280 -0
  82. data/lib/shipeasy_admin/models/list_configs_response.rb +178 -0
  83. data/lib/shipeasy_admin/models/list_configs_response_data_inner.rb +351 -0
  84. data/lib/shipeasy_admin/models/list_configs_response_data_inner_drafts_value.rb +237 -0
  85. data/lib/shipeasy_admin/models/list_configs_response_data_inner_envs_value.rb +237 -0
  86. data/lib/shipeasy_admin/models/list_events_response_inner.rb +344 -0
  87. data/lib/shipeasy_admin/models/list_events_response_inner_properties_inner.rb +289 -0
  88. data/lib/shipeasy_admin/models/list_experiments_response.rb +178 -0
  89. data/lib/shipeasy_admin/models/list_experiments_response_data_inner.rb +688 -0
  90. data/lib/shipeasy_admin/models/list_experiments_response_data_inner_groups_inner.rb +258 -0
  91. data/lib/shipeasy_admin/models/list_gates_response.rb +178 -0
  92. data/lib/shipeasy_admin/models/list_gates_response_data_inner.rb +395 -0
  93. data/lib/shipeasy_admin/models/list_gates_response_data_inner_enabled.rb +104 -0
  94. data/lib/shipeasy_admin/models/list_gates_response_data_inner_rules_inner.rb +238 -0
  95. data/lib/shipeasy_admin/models/list_gates_response_data_inner_stack_inner.rb +105 -0
  96. data/lib/shipeasy_admin/models/list_gates_response_data_inner_stack_inner_one_of.rb +375 -0
  97. data/lib/shipeasy_admin/models/list_gates_response_data_inner_stack_inner_one_of1.rb +331 -0
  98. data/lib/shipeasy_admin/models/list_gates_response_data_inner_stack_inner_one_of_ramp.rb +319 -0
  99. data/lib/shipeasy_admin/models/list_i18n_drafts_response_inner.rb +272 -0
  100. data/lib/shipeasy_admin/models/list_i18n_keys_response.rb +195 -0
  101. data/lib/shipeasy_admin/models/list_i18n_keys_response_keys_inner.rb +284 -0
  102. data/lib/shipeasy_admin/models/list_i18n_profiles_response_inner.rb +224 -0
  103. data/lib/shipeasy_admin/models/list_killswitches_response.rb +178 -0
  104. data/lib/shipeasy_admin/models/list_killswitches_response_data_inner.rb +270 -0
  105. data/lib/shipeasy_admin/models/list_killswitches_response_data_inner_envs_value.rb +248 -0
  106. data/lib/shipeasy_admin/models/list_metrics_response_inner.rb +378 -0
  107. data/lib/shipeasy_admin/models/list_metrics_response_inner_query_ir.rb +295 -0
  108. data/lib/shipeasy_admin/models/list_metrics_response_inner_query_ir_agg.rb +113 -0
  109. data/lib/shipeasy_admin/models/list_metrics_response_inner_query_ir_agg_one_of.rb +188 -0
  110. data/lib/shipeasy_admin/models/list_metrics_response_inner_query_ir_agg_one_of1.rb +188 -0
  111. data/lib/shipeasy_admin/models/list_metrics_response_inner_query_ir_agg_one_of2.rb +188 -0
  112. data/lib/shipeasy_admin/models/list_metrics_response_inner_query_ir_agg_one_of3.rb +188 -0
  113. data/lib/shipeasy_admin/models/list_metrics_response_inner_query_ir_agg_one_of4.rb +188 -0
  114. data/lib/shipeasy_admin/models/list_metrics_response_inner_query_ir_agg_one_of5.rb +188 -0
  115. data/lib/shipeasy_admin/models/list_metrics_response_inner_query_ir_agg_one_of6.rb +188 -0
  116. data/lib/shipeasy_admin/models/list_metrics_response_inner_query_ir_agg_one_of7.rb +217 -0
  117. data/lib/shipeasy_admin/models/list_metrics_response_inner_query_ir_agg_one_of8.rb +233 -0
  118. data/lib/shipeasy_admin/models/list_metrics_response_inner_query_ir_agg_one_of9.rb +240 -0
  119. data/lib/shipeasy_admin/models/list_metrics_response_inner_query_ir_agg_one_of9_numerator.rb +266 -0
  120. data/lib/shipeasy_admin/models/list_metrics_response_inner_query_ir_agg_one_of9_numerator_filters_inner.rb +264 -0
  121. data/lib/shipeasy_admin/models/list_metrics_response_inner_query_ir_group_by.rb +228 -0
  122. data/lib/shipeasy_admin/models/list_ops_items_response_inner.rb +349 -0
  123. data/lib/shipeasy_admin/models/list_slack_channels_response.rb +195 -0
  124. data/lib/shipeasy_admin/models/list_slack_channels_response_channels_inner.rb +203 -0
  125. data/lib/shipeasy_admin/models/list_universes_response.rb +178 -0
  126. data/lib/shipeasy_admin/models/list_universes_response_data_inner.rb +305 -0
  127. data/lib/shipeasy_admin/models/notify_ops_request.rb +261 -0
  128. data/lib/shipeasy_admin/models/notify_ops_response.rb +193 -0
  129. data/lib/shipeasy_admin/models/publish_config_draft_request.rb +190 -0
  130. data/lib/shipeasy_admin/models/publish_config_draft_response.rb +260 -0
  131. data/lib/shipeasy_admin/models/publish_i18n_profile_request.rb +149 -0
  132. data/lib/shipeasy_admin/models/publish_i18n_profile_response.rb +404 -0
  133. data/lib/shipeasy_admin/models/push_i18n_keys_request.rb +205 -0
  134. data/lib/shipeasy_admin/models/push_i18n_keys_request_keys_inner.rb +192 -0
  135. data/lib/shipeasy_admin/models/push_i18n_keys_response.rb +261 -0
  136. data/lib/shipeasy_admin/models/reanalyze_experiment_response.rb +214 -0
  137. data/lib/shipeasy_admin/models/save_config_draft_request.rb +202 -0
  138. data/lib/shipeasy_admin/models/save_config_draft_response.rb +286 -0
  139. data/lib/shipeasy_admin/models/set_experiment_metrics_request.rb +168 -0
  140. data/lib/shipeasy_admin/models/set_experiment_metrics_request_metrics_inner.rb +216 -0
  141. data/lib/shipeasy_admin/models/set_experiment_metrics_response.rb +179 -0
  142. data/lib/shipeasy_admin/models/set_experiment_metrics_response_metrics_inner.rb +201 -0
  143. data/lib/shipeasy_admin/models/set_experiment_status_request.rb +190 -0
  144. data/lib/shipeasy_admin/models/set_experiment_status_response.rb +214 -0
  145. data/lib/shipeasy_admin/models/set_killswitch_switch_request.rb +264 -0
  146. data/lib/shipeasy_admin/models/set_killswitch_switch_response.rb +288 -0
  147. data/lib/shipeasy_admin/models/unset_killswitch_switch_request.rb +237 -0
  148. data/lib/shipeasy_admin/models/unset_killswitch_switch_response.rb +289 -0
  149. data/lib/shipeasy_admin/models/update_alert_rule_request.rb +306 -0
  150. data/lib/shipeasy_admin/models/update_alert_rule_response.rb +165 -0
  151. data/lib/shipeasy_admin/models/update_config_request.rb +198 -0
  152. data/lib/shipeasy_admin/models/update_config_response.rb +165 -0
  153. data/lib/shipeasy_admin/models/update_event_request.rb +198 -0
  154. data/lib/shipeasy_admin/models/update_event_response.rb +166 -0
  155. data/lib/shipeasy_admin/models/update_experiment_request.rb +746 -0
  156. data/lib/shipeasy_admin/models/update_experiment_response.rb +165 -0
  157. data/lib/shipeasy_admin/models/update_gate_request.rb +403 -0
  158. data/lib/shipeasy_admin/models/update_gate_response.rb +166 -0
  159. data/lib/shipeasy_admin/models/update_i18n_key_request.rb +176 -0
  160. data/lib/shipeasy_admin/models/update_i18n_key_response.rb +166 -0
  161. data/lib/shipeasy_admin/models/update_killswitch_request.rb +224 -0
  162. data/lib/shipeasy_admin/models/update_killswitch_response.rb +165 -0
  163. data/lib/shipeasy_admin/models/update_ops_item_request.rb +205 -0
  164. data/lib/shipeasy_admin/models/update_ops_item_response.rb +166 -0
  165. data/lib/shipeasy_admin/models/update_universe_request.rb +213 -0
  166. data/lib/shipeasy_admin/models/update_universe_response.rb +165 -0
  167. data/lib/shipeasy_admin/models/upsert_project_request.rb +222 -0
  168. data/lib/shipeasy_admin/models/upsert_project_response.rb +260 -0
  169. data/lib/shipeasy_admin/version.rb +15 -0
  170. data/lib/shipeasy_admin.rb +196 -0
  171. metadata +230 -2
@@ -0,0 +1,344 @@
1
+ =begin
2
+ #Shipeasy Admin API
3
+
4
+ #REST API for managing feature gates, experiments, configs, universes, and killswitches in a Shipeasy project. Authenticate with an admin SDK key (`Authorization: Bearer sdk_admin_…`) and scope every request to a project via the `X-Project-Id` header. Mint admin keys via `POST /api/admin/keys` with `type: \"admin\"`. Keys expire after 90 days; rotate with the `revoke` action.
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.23.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Shipeasy::Admin::Generated
17
+ # A catalogued event.
18
+ class ListEventsResponseInner < ApiModelBase
19
+ # Stable opaque event id.
20
+ attr_accessor :id
21
+
22
+ # Event name — the handle metric queries reference.
23
+ attr_accessor :name
24
+
25
+ # Optional folder name used to group items in the dashboard. Part of the SDK lookup key: an item in folder `checkout` named `new-cart` is referenced as `checkout/new-cart` from the SDK.
26
+ attr_accessor :folder
27
+
28
+ # Human-readable description, or `null` if none set.
29
+ attr_accessor :description
30
+
31
+ # Typed properties declared on the event.
32
+ attr_accessor :properties
33
+
34
+ # `1` if this is an auto-discovered name awaiting approval (metrics on it fail until approved), `0` if approved/usable.
35
+ attr_accessor :pending
36
+
37
+ # ISO-8601 timestamp of creation.
38
+ attr_accessor :created_at
39
+
40
+ # Attribute mapping from ruby-style variable name to JSON key.
41
+ def self.attribute_map
42
+ {
43
+ :'id' => :'id',
44
+ :'name' => :'name',
45
+ :'folder' => :'folder',
46
+ :'description' => :'description',
47
+ :'properties' => :'properties',
48
+ :'pending' => :'pending',
49
+ :'created_at' => :'createdAt'
50
+ }
51
+ end
52
+
53
+ # Returns attribute mapping this model knows about
54
+ def self.acceptable_attribute_map
55
+ attribute_map
56
+ end
57
+
58
+ # Returns all the JSON keys this model knows about
59
+ def self.acceptable_attributes
60
+ acceptable_attribute_map.values
61
+ end
62
+
63
+ # Attribute type mapping.
64
+ def self.openapi_types
65
+ {
66
+ :'id' => :'String',
67
+ :'name' => :'String',
68
+ :'folder' => :'String',
69
+ :'description' => :'String',
70
+ :'properties' => :'Array<ListEventsResponseInnerPropertiesInner>',
71
+ :'pending' => :'Integer',
72
+ :'created_at' => :'String'
73
+ }
74
+ end
75
+
76
+ # List of attributes with nullable: true
77
+ def self.openapi_nullable
78
+ Set.new([
79
+ :'folder',
80
+ :'description',
81
+ ])
82
+ end
83
+
84
+ # Initializes the object
85
+ # @param [Hash] attributes Model attributes in the form of hash
86
+ def initialize(attributes = {})
87
+ if (!attributes.is_a?(Hash))
88
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Shipeasy::Admin::Generated::ListEventsResponseInner` initialize method"
89
+ end
90
+
91
+ # check to see if the attribute exists and convert string to symbol for hash key
92
+ acceptable_attribute_map = self.class.acceptable_attribute_map
93
+ attributes = attributes.each_with_object({}) { |(k, v), h|
94
+ if (!acceptable_attribute_map.key?(k.to_sym))
95
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Shipeasy::Admin::Generated::ListEventsResponseInner`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
96
+ end
97
+ h[k.to_sym] = v
98
+ }
99
+
100
+ if attributes.key?(:'id')
101
+ self.id = attributes[:'id']
102
+ else
103
+ self.id = nil
104
+ end
105
+
106
+ if attributes.key?(:'name')
107
+ self.name = attributes[:'name']
108
+ else
109
+ self.name = nil
110
+ end
111
+
112
+ if attributes.key?(:'folder')
113
+ self.folder = attributes[:'folder']
114
+ end
115
+
116
+ if attributes.key?(:'description')
117
+ self.description = attributes[:'description']
118
+ else
119
+ self.description = nil
120
+ end
121
+
122
+ if attributes.key?(:'properties')
123
+ if (value = attributes[:'properties']).is_a?(Array)
124
+ self.properties = value
125
+ end
126
+ else
127
+ self.properties = nil
128
+ end
129
+
130
+ if attributes.key?(:'pending')
131
+ self.pending = attributes[:'pending']
132
+ else
133
+ self.pending = nil
134
+ end
135
+
136
+ if attributes.key?(:'created_at')
137
+ self.created_at = attributes[:'created_at']
138
+ else
139
+ self.created_at = nil
140
+ end
141
+ end
142
+
143
+ # Show invalid properties with the reasons. Usually used together with valid?
144
+ # @return Array for valid properties with the reasons
145
+ def list_invalid_properties
146
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
147
+ invalid_properties = Array.new
148
+ if @id.nil?
149
+ invalid_properties.push('invalid value for "id", id cannot be nil.')
150
+ end
151
+
152
+ if @name.nil?
153
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
154
+ end
155
+
156
+ if !@folder.nil? && @folder.to_s.length > 256
157
+ invalid_properties.push('invalid value for "folder", the character length must be smaller than or equal to 256.')
158
+ end
159
+
160
+ pattern = Regexp.new(/^[a-zA-Z0-9_-]+$/)
161
+ if !@folder.nil? && @folder !~ pattern
162
+ invalid_properties.push("invalid value for \"folder\", must conform to the pattern #{pattern}.")
163
+ end
164
+
165
+ if @properties.nil?
166
+ invalid_properties.push('invalid value for "properties", properties cannot be nil.')
167
+ end
168
+
169
+ if @pending.nil?
170
+ invalid_properties.push('invalid value for "pending", pending cannot be nil.')
171
+ end
172
+
173
+ if @pending > 9007199254740991
174
+ invalid_properties.push('invalid value for "pending", must be smaller than or equal to 9007199254740991.')
175
+ end
176
+
177
+ if @pending < -9007199254740991
178
+ invalid_properties.push('invalid value for "pending", must be greater than or equal to -9007199254740991.')
179
+ end
180
+
181
+ if @created_at.nil?
182
+ invalid_properties.push('invalid value for "created_at", created_at cannot be nil.')
183
+ end
184
+
185
+ invalid_properties
186
+ end
187
+
188
+ # Check to see if the all the properties in the model are valid
189
+ # @return true if the model is valid
190
+ def valid?
191
+ warn '[DEPRECATED] the `valid?` method is obsolete'
192
+ return false if @id.nil?
193
+ return false if @name.nil?
194
+ return false if !@folder.nil? && @folder.to_s.length > 256
195
+ return false if !@folder.nil? && @folder !~ Regexp.new(/^[a-zA-Z0-9_-]+$/)
196
+ return false if @properties.nil?
197
+ return false if @pending.nil?
198
+ return false if @pending > 9007199254740991
199
+ return false if @pending < -9007199254740991
200
+ return false if @created_at.nil?
201
+ true
202
+ end
203
+
204
+ # Custom attribute writer method with validation
205
+ # @param [Object] id Value to be assigned
206
+ def id=(id)
207
+ if id.nil?
208
+ fail ArgumentError, 'id cannot be nil'
209
+ end
210
+
211
+ @id = id
212
+ end
213
+
214
+ # Custom attribute writer method with validation
215
+ # @param [Object] name Value to be assigned
216
+ def name=(name)
217
+ if name.nil?
218
+ fail ArgumentError, 'name cannot be nil'
219
+ end
220
+
221
+ @name = name
222
+ end
223
+
224
+ # Custom attribute writer method with validation
225
+ # @param [Object] folder Value to be assigned
226
+ def folder=(folder)
227
+ if !folder.nil? && folder.to_s.length > 256
228
+ fail ArgumentError, 'invalid value for "folder", the character length must be smaller than or equal to 256.'
229
+ end
230
+
231
+ pattern = Regexp.new(/^[a-zA-Z0-9_-]+$/)
232
+ if !folder.nil? && folder !~ pattern
233
+ fail ArgumentError, "invalid value for \"folder\", must conform to the pattern #{pattern}."
234
+ end
235
+
236
+ @folder = folder
237
+ end
238
+
239
+ # Custom attribute writer method with validation
240
+ # @param [Object] properties Value to be assigned
241
+ def properties=(properties)
242
+ if properties.nil?
243
+ fail ArgumentError, 'properties cannot be nil'
244
+ end
245
+
246
+ @properties = properties
247
+ end
248
+
249
+ # Custom attribute writer method with validation
250
+ # @param [Object] pending Value to be assigned
251
+ def pending=(pending)
252
+ if pending.nil?
253
+ fail ArgumentError, 'pending cannot be nil'
254
+ end
255
+
256
+ if pending > 9007199254740991
257
+ fail ArgumentError, 'invalid value for "pending", must be smaller than or equal to 9007199254740991.'
258
+ end
259
+
260
+ if pending < -9007199254740991
261
+ fail ArgumentError, 'invalid value for "pending", must be greater than or equal to -9007199254740991.'
262
+ end
263
+
264
+ @pending = pending
265
+ end
266
+
267
+ # Custom attribute writer method with validation
268
+ # @param [Object] created_at Value to be assigned
269
+ def created_at=(created_at)
270
+ if created_at.nil?
271
+ fail ArgumentError, 'created_at cannot be nil'
272
+ end
273
+
274
+ @created_at = created_at
275
+ end
276
+
277
+ # Checks equality by comparing each attribute.
278
+ # @param [Object] Object to be compared
279
+ def ==(o)
280
+ return true if self.equal?(o)
281
+ self.class == o.class &&
282
+ id == o.id &&
283
+ name == o.name &&
284
+ folder == o.folder &&
285
+ description == o.description &&
286
+ properties == o.properties &&
287
+ pending == o.pending &&
288
+ created_at == o.created_at
289
+ end
290
+
291
+ # @see the `==` method
292
+ # @param [Object] Object to be compared
293
+ def eql?(o)
294
+ self == o
295
+ end
296
+
297
+ # Calculates hash code according to all attributes.
298
+ # @return [Integer] Hash code
299
+ def hash
300
+ [id, name, folder, description, properties, pending, created_at].hash
301
+ end
302
+
303
+ # Builds the object from hash
304
+ # @param [Hash] attributes Model attributes in the form of hash
305
+ # @return [Object] Returns the model itself
306
+ def self.build_from_hash(attributes)
307
+ return nil unless attributes.is_a?(Hash)
308
+ attributes = attributes.transform_keys(&:to_sym)
309
+ transformed_hash = {}
310
+ openapi_types.each_pair do |key, type|
311
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
312
+ transformed_hash["#{key}"] = nil
313
+ elsif type =~ /\AArray<(.*)>/i
314
+ # check to ensure the input is an array given that the attribute
315
+ # is documented as an array but the input is not
316
+ if attributes[attribute_map[key]].is_a?(Array)
317
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
318
+ end
319
+ elsif !attributes[attribute_map[key]].nil?
320
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
321
+ end
322
+ end
323
+ new(transformed_hash)
324
+ end
325
+
326
+ # Returns the object in the form of hash
327
+ # @return [Hash] Returns the object in the form of hash
328
+ def to_hash
329
+ hash = {}
330
+ self.class.attribute_map.each_pair do |attr, param|
331
+ value = self.send(attr)
332
+ if value.nil?
333
+ is_nullable = self.class.openapi_nullable.include?(attr)
334
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
335
+ end
336
+
337
+ hash[param] = _to_hash(value)
338
+ end
339
+ hash
340
+ end
341
+
342
+ end
343
+
344
+ end
@@ -0,0 +1,289 @@
1
+ =begin
2
+ #Shipeasy Admin API
3
+
4
+ #REST API for managing feature gates, experiments, configs, universes, and killswitches in a Shipeasy project. Authenticate with an admin SDK key (`Authorization: Bearer sdk_admin_…`) and scope every request to a project via the `X-Project-Id` header. Mint admin keys via `POST /api/admin/keys` with `type: \"admin\"`. Keys expire after 90 days; rotate with the `revoke` action.
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.23.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Shipeasy::Admin::Generated
17
+ # One typed property declared on a catalogued event.
18
+ class ListEventsResponseInnerPropertiesInner < ApiModelBase
19
+ # Property key, e.g. `amount` or `plan`.
20
+ attr_accessor :name
21
+
22
+ # Value type of the property as recorded on the event.
23
+ attr_accessor :type
24
+
25
+ # Whether the property must be present on every emitted event.
26
+ attr_accessor :required
27
+
28
+ # Human-readable description of the property.
29
+ attr_accessor :description
30
+
31
+ class EnumAttributeValidator
32
+ attr_reader :datatype
33
+ attr_reader :allowable_values
34
+
35
+ def initialize(datatype, allowable_values)
36
+ @allowable_values = allowable_values.map do |value|
37
+ case datatype.to_s
38
+ when /Integer/i
39
+ value.to_i
40
+ when /Float/i
41
+ value.to_f
42
+ else
43
+ value
44
+ end
45
+ end
46
+ end
47
+
48
+ def valid?(value)
49
+ !value || allowable_values.include?(value)
50
+ end
51
+ end
52
+
53
+ # Attribute mapping from ruby-style variable name to JSON key.
54
+ def self.attribute_map
55
+ {
56
+ :'name' => :'name',
57
+ :'type' => :'type',
58
+ :'required' => :'required',
59
+ :'description' => :'description'
60
+ }
61
+ end
62
+
63
+ # Returns attribute mapping this model knows about
64
+ def self.acceptable_attribute_map
65
+ attribute_map
66
+ end
67
+
68
+ # Returns all the JSON keys this model knows about
69
+ def self.acceptable_attributes
70
+ acceptable_attribute_map.values
71
+ end
72
+
73
+ # Attribute type mapping.
74
+ def self.openapi_types
75
+ {
76
+ :'name' => :'String',
77
+ :'type' => :'String',
78
+ :'required' => :'Boolean',
79
+ :'description' => :'String'
80
+ }
81
+ end
82
+
83
+ # List of attributes with nullable: true
84
+ def self.openapi_nullable
85
+ Set.new([
86
+ ])
87
+ end
88
+
89
+ # Initializes the object
90
+ # @param [Hash] attributes Model attributes in the form of hash
91
+ def initialize(attributes = {})
92
+ if (!attributes.is_a?(Hash))
93
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Shipeasy::Admin::Generated::ListEventsResponseInnerPropertiesInner` initialize method"
94
+ end
95
+
96
+ # check to see if the attribute exists and convert string to symbol for hash key
97
+ acceptable_attribute_map = self.class.acceptable_attribute_map
98
+ attributes = attributes.each_with_object({}) { |(k, v), h|
99
+ if (!acceptable_attribute_map.key?(k.to_sym))
100
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Shipeasy::Admin::Generated::ListEventsResponseInnerPropertiesInner`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
101
+ end
102
+ h[k.to_sym] = v
103
+ }
104
+
105
+ if attributes.key?(:'name')
106
+ self.name = attributes[:'name']
107
+ else
108
+ self.name = nil
109
+ end
110
+
111
+ if attributes.key?(:'type')
112
+ self.type = attributes[:'type']
113
+ else
114
+ self.type = nil
115
+ end
116
+
117
+ if attributes.key?(:'required')
118
+ self.required = attributes[:'required']
119
+ else
120
+ self.required = false
121
+ end
122
+
123
+ if attributes.key?(:'description')
124
+ self.description = attributes[:'description']
125
+ else
126
+ self.description = ''
127
+ end
128
+ end
129
+
130
+ # Show invalid properties with the reasons. Usually used together with valid?
131
+ # @return Array for valid properties with the reasons
132
+ def list_invalid_properties
133
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
134
+ invalid_properties = Array.new
135
+ if @name.nil?
136
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
137
+ end
138
+
139
+ if @name.to_s.length > 64
140
+ invalid_properties.push('invalid value for "name", the character length must be smaller than or equal to 64.')
141
+ end
142
+
143
+ if @name.to_s.length < 1
144
+ invalid_properties.push('invalid value for "name", the character length must be greater than or equal to 1.')
145
+ end
146
+
147
+ if @type.nil?
148
+ invalid_properties.push('invalid value for "type", type cannot be nil.')
149
+ end
150
+
151
+ if @required.nil?
152
+ invalid_properties.push('invalid value for "required", required cannot be nil.')
153
+ end
154
+
155
+ if @description.nil?
156
+ invalid_properties.push('invalid value for "description", description cannot be nil.')
157
+ end
158
+
159
+ invalid_properties
160
+ end
161
+
162
+ # Check to see if the all the properties in the model are valid
163
+ # @return true if the model is valid
164
+ def valid?
165
+ warn '[DEPRECATED] the `valid?` method is obsolete'
166
+ return false if @name.nil?
167
+ return false if @name.to_s.length > 64
168
+ return false if @name.to_s.length < 1
169
+ return false if @type.nil?
170
+ type_validator = EnumAttributeValidator.new('String', ["string", "number", "boolean"])
171
+ return false unless type_validator.valid?(@type)
172
+ return false if @required.nil?
173
+ return false if @description.nil?
174
+ true
175
+ end
176
+
177
+ # Custom attribute writer method with validation
178
+ # @param [Object] name Value to be assigned
179
+ def name=(name)
180
+ if name.nil?
181
+ fail ArgumentError, 'name cannot be nil'
182
+ end
183
+
184
+ if name.to_s.length > 64
185
+ fail ArgumentError, 'invalid value for "name", the character length must be smaller than or equal to 64.'
186
+ end
187
+
188
+ if name.to_s.length < 1
189
+ fail ArgumentError, 'invalid value for "name", the character length must be greater than or equal to 1.'
190
+ end
191
+
192
+ @name = name
193
+ end
194
+
195
+ # Custom attribute writer method checking allowed values (enum).
196
+ # @param [Object] type Object to be assigned
197
+ def type=(type)
198
+ validator = EnumAttributeValidator.new('String', ["string", "number", "boolean"])
199
+ unless validator.valid?(type)
200
+ fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}."
201
+ end
202
+ @type = type
203
+ end
204
+
205
+ # Custom attribute writer method with validation
206
+ # @param [Object] required Value to be assigned
207
+ def required=(required)
208
+ if required.nil?
209
+ fail ArgumentError, 'required cannot be nil'
210
+ end
211
+
212
+ @required = required
213
+ end
214
+
215
+ # Custom attribute writer method with validation
216
+ # @param [Object] description Value to be assigned
217
+ def description=(description)
218
+ if description.nil?
219
+ fail ArgumentError, 'description cannot be nil'
220
+ end
221
+
222
+ @description = description
223
+ end
224
+
225
+ # Checks equality by comparing each attribute.
226
+ # @param [Object] Object to be compared
227
+ def ==(o)
228
+ return true if self.equal?(o)
229
+ self.class == o.class &&
230
+ name == o.name &&
231
+ type == o.type &&
232
+ required == o.required &&
233
+ description == o.description
234
+ end
235
+
236
+ # @see the `==` method
237
+ # @param [Object] Object to be compared
238
+ def eql?(o)
239
+ self == o
240
+ end
241
+
242
+ # Calculates hash code according to all attributes.
243
+ # @return [Integer] Hash code
244
+ def hash
245
+ [name, type, required, description].hash
246
+ end
247
+
248
+ # Builds the object from hash
249
+ # @param [Hash] attributes Model attributes in the form of hash
250
+ # @return [Object] Returns the model itself
251
+ def self.build_from_hash(attributes)
252
+ return nil unless attributes.is_a?(Hash)
253
+ attributes = attributes.transform_keys(&:to_sym)
254
+ transformed_hash = {}
255
+ openapi_types.each_pair do |key, type|
256
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
257
+ transformed_hash["#{key}"] = nil
258
+ elsif type =~ /\AArray<(.*)>/i
259
+ # check to ensure the input is an array given that the attribute
260
+ # is documented as an array but the input is not
261
+ if attributes[attribute_map[key]].is_a?(Array)
262
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
263
+ end
264
+ elsif !attributes[attribute_map[key]].nil?
265
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
266
+ end
267
+ end
268
+ new(transformed_hash)
269
+ end
270
+
271
+ # Returns the object in the form of hash
272
+ # @return [Hash] Returns the object in the form of hash
273
+ def to_hash
274
+ hash = {}
275
+ self.class.attribute_map.each_pair do |attr, param|
276
+ value = self.send(attr)
277
+ if value.nil?
278
+ is_nullable = self.class.openapi_nullable.include?(attr)
279
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
280
+ end
281
+
282
+ hash[param] = _to_hash(value)
283
+ end
284
+ hash
285
+ end
286
+
287
+ end
288
+
289
+ end