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,188 @@
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
+ class DiscardConfigDraftResponse < ApiModelBase
18
+ attr_accessor :ok
19
+
20
+ class EnumAttributeValidator
21
+ attr_reader :datatype
22
+ attr_reader :allowable_values
23
+
24
+ def initialize(datatype, allowable_values)
25
+ @allowable_values = allowable_values.map do |value|
26
+ case datatype.to_s
27
+ when /Integer/i
28
+ value.to_i
29
+ when /Float/i
30
+ value.to_f
31
+ else
32
+ value
33
+ end
34
+ end
35
+ end
36
+
37
+ def valid?(value)
38
+ !value || allowable_values.include?(value)
39
+ end
40
+ end
41
+
42
+ # Attribute mapping from ruby-style variable name to JSON key.
43
+ def self.attribute_map
44
+ {
45
+ :'ok' => :'ok'
46
+ }
47
+ end
48
+
49
+ # Returns attribute mapping this model knows about
50
+ def self.acceptable_attribute_map
51
+ attribute_map
52
+ end
53
+
54
+ # Returns all the JSON keys this model knows about
55
+ def self.acceptable_attributes
56
+ acceptable_attribute_map.values
57
+ end
58
+
59
+ # Attribute type mapping.
60
+ def self.openapi_types
61
+ {
62
+ :'ok' => :'Boolean'
63
+ }
64
+ end
65
+
66
+ # List of attributes with nullable: true
67
+ def self.openapi_nullable
68
+ Set.new([
69
+ ])
70
+ end
71
+
72
+ # Initializes the object
73
+ # @param [Hash] attributes Model attributes in the form of hash
74
+ def initialize(attributes = {})
75
+ if (!attributes.is_a?(Hash))
76
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Shipeasy::Admin::Generated::DiscardConfigDraftResponse` initialize method"
77
+ end
78
+
79
+ # check to see if the attribute exists and convert string to symbol for hash key
80
+ acceptable_attribute_map = self.class.acceptable_attribute_map
81
+ attributes = attributes.each_with_object({}) { |(k, v), h|
82
+ if (!acceptable_attribute_map.key?(k.to_sym))
83
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Shipeasy::Admin::Generated::DiscardConfigDraftResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
84
+ end
85
+ h[k.to_sym] = v
86
+ }
87
+
88
+ if attributes.key?(:'ok')
89
+ self.ok = attributes[:'ok']
90
+ else
91
+ self.ok = nil
92
+ end
93
+ end
94
+
95
+ # Show invalid properties with the reasons. Usually used together with valid?
96
+ # @return Array for valid properties with the reasons
97
+ def list_invalid_properties
98
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
99
+ invalid_properties = Array.new
100
+ if @ok.nil?
101
+ invalid_properties.push('invalid value for "ok", ok cannot be nil.')
102
+ end
103
+
104
+ invalid_properties
105
+ end
106
+
107
+ # Check to see if the all the properties in the model are valid
108
+ # @return true if the model is valid
109
+ def valid?
110
+ warn '[DEPRECATED] the `valid?` method is obsolete'
111
+ return false if @ok.nil?
112
+ ok_validator = EnumAttributeValidator.new('Boolean', ["true"])
113
+ return false unless ok_validator.valid?(@ok)
114
+ true
115
+ end
116
+
117
+ # Custom attribute writer method checking allowed values (enum).
118
+ # @param [Object] ok Object to be assigned
119
+ def ok=(ok)
120
+ validator = EnumAttributeValidator.new('Boolean', ["true"])
121
+ unless validator.valid?(ok)
122
+ fail ArgumentError, "invalid value for \"ok\", must be one of #{validator.allowable_values}."
123
+ end
124
+ @ok = ok
125
+ end
126
+
127
+ # Checks equality by comparing each attribute.
128
+ # @param [Object] Object to be compared
129
+ def ==(o)
130
+ return true if self.equal?(o)
131
+ self.class == o.class &&
132
+ ok == o.ok
133
+ end
134
+
135
+ # @see the `==` method
136
+ # @param [Object] Object to be compared
137
+ def eql?(o)
138
+ self == o
139
+ end
140
+
141
+ # Calculates hash code according to all attributes.
142
+ # @return [Integer] Hash code
143
+ def hash
144
+ [ok].hash
145
+ end
146
+
147
+ # Builds the object from hash
148
+ # @param [Hash] attributes Model attributes in the form of hash
149
+ # @return [Object] Returns the model itself
150
+ def self.build_from_hash(attributes)
151
+ return nil unless attributes.is_a?(Hash)
152
+ attributes = attributes.transform_keys(&:to_sym)
153
+ transformed_hash = {}
154
+ openapi_types.each_pair do |key, type|
155
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
156
+ transformed_hash["#{key}"] = nil
157
+ elsif type =~ /\AArray<(.*)>/i
158
+ # check to ensure the input is an array given that the attribute
159
+ # is documented as an array but the input is not
160
+ if attributes[attribute_map[key]].is_a?(Array)
161
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
162
+ end
163
+ elsif !attributes[attribute_map[key]].nil?
164
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
165
+ end
166
+ end
167
+ new(transformed_hash)
168
+ end
169
+
170
+ # Returns the object in the form of hash
171
+ # @return [Hash] Returns the object in the form of hash
172
+ def to_hash
173
+ hash = {}
174
+ self.class.attribute_map.each_pair do |attr, param|
175
+ value = self.send(attr)
176
+ if value.nil?
177
+ is_nullable = self.class.openapi_nullable.include?(attr)
178
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
179
+ end
180
+
181
+ hash[param] = _to_hash(value)
182
+ end
183
+ hash
184
+ end
185
+
186
+ end
187
+
188
+ end
@@ -0,0 +1,190 @@
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
+ class EnableGateResponse < ApiModelBase
18
+ attr_accessor :id
19
+
20
+ attr_accessor :enabled
21
+
22
+ # Attribute mapping from ruby-style variable name to JSON key.
23
+ def self.attribute_map
24
+ {
25
+ :'id' => :'id',
26
+ :'enabled' => :'enabled'
27
+ }
28
+ end
29
+
30
+ # Returns attribute mapping this model knows about
31
+ def self.acceptable_attribute_map
32
+ attribute_map
33
+ end
34
+
35
+ # Returns all the JSON keys this model knows about
36
+ def self.acceptable_attributes
37
+ acceptable_attribute_map.values
38
+ end
39
+
40
+ # Attribute type mapping.
41
+ def self.openapi_types
42
+ {
43
+ :'id' => :'String',
44
+ :'enabled' => :'Boolean'
45
+ }
46
+ end
47
+
48
+ # List of attributes with nullable: true
49
+ def self.openapi_nullable
50
+ Set.new([
51
+ ])
52
+ end
53
+
54
+ # Initializes the object
55
+ # @param [Hash] attributes Model attributes in the form of hash
56
+ def initialize(attributes = {})
57
+ if (!attributes.is_a?(Hash))
58
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Shipeasy::Admin::Generated::EnableGateResponse` initialize method"
59
+ end
60
+
61
+ # check to see if the attribute exists and convert string to symbol for hash key
62
+ acceptable_attribute_map = self.class.acceptable_attribute_map
63
+ attributes = attributes.each_with_object({}) { |(k, v), h|
64
+ if (!acceptable_attribute_map.key?(k.to_sym))
65
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Shipeasy::Admin::Generated::EnableGateResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
66
+ end
67
+ h[k.to_sym] = v
68
+ }
69
+
70
+ if attributes.key?(:'id')
71
+ self.id = attributes[:'id']
72
+ else
73
+ self.id = nil
74
+ end
75
+
76
+ if attributes.key?(:'enabled')
77
+ self.enabled = attributes[:'enabled']
78
+ else
79
+ self.enabled = nil
80
+ end
81
+ end
82
+
83
+ # Show invalid properties with the reasons. Usually used together with valid?
84
+ # @return Array for valid properties with the reasons
85
+ def list_invalid_properties
86
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
87
+ invalid_properties = Array.new
88
+ if @id.nil?
89
+ invalid_properties.push('invalid value for "id", id cannot be nil.')
90
+ end
91
+
92
+ if @enabled.nil?
93
+ invalid_properties.push('invalid value for "enabled", enabled cannot be nil.')
94
+ end
95
+
96
+ invalid_properties
97
+ end
98
+
99
+ # Check to see if the all the properties in the model are valid
100
+ # @return true if the model is valid
101
+ def valid?
102
+ warn '[DEPRECATED] the `valid?` method is obsolete'
103
+ return false if @id.nil?
104
+ return false if @enabled.nil?
105
+ true
106
+ end
107
+
108
+ # Custom attribute writer method with validation
109
+ # @param [Object] id Value to be assigned
110
+ def id=(id)
111
+ if id.nil?
112
+ fail ArgumentError, 'id cannot be nil'
113
+ end
114
+
115
+ @id = id
116
+ end
117
+
118
+ # Custom attribute writer method with validation
119
+ # @param [Object] enabled Value to be assigned
120
+ def enabled=(enabled)
121
+ if enabled.nil?
122
+ fail ArgumentError, 'enabled cannot be nil'
123
+ end
124
+
125
+ @enabled = enabled
126
+ end
127
+
128
+ # Checks equality by comparing each attribute.
129
+ # @param [Object] Object to be compared
130
+ def ==(o)
131
+ return true if self.equal?(o)
132
+ self.class == o.class &&
133
+ id == o.id &&
134
+ enabled == o.enabled
135
+ end
136
+
137
+ # @see the `==` method
138
+ # @param [Object] Object to be compared
139
+ def eql?(o)
140
+ self == o
141
+ end
142
+
143
+ # Calculates hash code according to all attributes.
144
+ # @return [Integer] Hash code
145
+ def hash
146
+ [id, enabled].hash
147
+ end
148
+
149
+ # Builds the object from hash
150
+ # @param [Hash] attributes Model attributes in the form of hash
151
+ # @return [Object] Returns the model itself
152
+ def self.build_from_hash(attributes)
153
+ return nil unless attributes.is_a?(Hash)
154
+ attributes = attributes.transform_keys(&:to_sym)
155
+ transformed_hash = {}
156
+ openapi_types.each_pair do |key, type|
157
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
158
+ transformed_hash["#{key}"] = nil
159
+ elsif type =~ /\AArray<(.*)>/i
160
+ # check to ensure the input is an array given that the attribute
161
+ # is documented as an array but the input is not
162
+ if attributes[attribute_map[key]].is_a?(Array)
163
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
164
+ end
165
+ elsif !attributes[attribute_map[key]].nil?
166
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
167
+ end
168
+ end
169
+ new(transformed_hash)
170
+ end
171
+
172
+ # Returns the object in the form of hash
173
+ # @return [Hash] Returns the object in the form of hash
174
+ def to_hash
175
+ hash = {}
176
+ self.class.attribute_map.each_pair do |attr, param|
177
+ value = self.send(attr)
178
+ if value.nil?
179
+ is_nullable = self.class.openapi_nullable.include?(attr)
180
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
181
+ end
182
+
183
+ hash[param] = _to_hash(value)
184
+ end
185
+ hash
186
+ end
187
+
188
+ end
189
+
190
+ end
@@ -0,0 +1,185 @@
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
+ class ErrorResponse < ApiModelBase
18
+ # Human-readable error message.
19
+ attr_accessor :error
20
+
21
+ # Stable machine code, when applicable.
22
+ attr_accessor :code
23
+
24
+ # Extra context (stack frames, validation details).
25
+ attr_accessor :detail
26
+
27
+ # Attribute mapping from ruby-style variable name to JSON key.
28
+ def self.attribute_map
29
+ {
30
+ :'error' => :'error',
31
+ :'code' => :'code',
32
+ :'detail' => :'detail'
33
+ }
34
+ end
35
+
36
+ # Returns attribute mapping this model knows about
37
+ def self.acceptable_attribute_map
38
+ attribute_map
39
+ end
40
+
41
+ # Returns all the JSON keys this model knows about
42
+ def self.acceptable_attributes
43
+ acceptable_attribute_map.values
44
+ end
45
+
46
+ # Attribute type mapping.
47
+ def self.openapi_types
48
+ {
49
+ :'error' => :'String',
50
+ :'code' => :'String',
51
+ :'detail' => :'String'
52
+ }
53
+ end
54
+
55
+ # List of attributes with nullable: true
56
+ def self.openapi_nullable
57
+ Set.new([
58
+ ])
59
+ end
60
+
61
+ # Initializes the object
62
+ # @param [Hash] attributes Model attributes in the form of hash
63
+ def initialize(attributes = {})
64
+ if (!attributes.is_a?(Hash))
65
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Shipeasy::Admin::Generated::ErrorResponse` initialize method"
66
+ end
67
+
68
+ # check to see if the attribute exists and convert string to symbol for hash key
69
+ acceptable_attribute_map = self.class.acceptable_attribute_map
70
+ attributes = attributes.each_with_object({}) { |(k, v), h|
71
+ if (!acceptable_attribute_map.key?(k.to_sym))
72
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Shipeasy::Admin::Generated::ErrorResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
73
+ end
74
+ h[k.to_sym] = v
75
+ }
76
+
77
+ if attributes.key?(:'error')
78
+ self.error = attributes[:'error']
79
+ else
80
+ self.error = nil
81
+ end
82
+
83
+ if attributes.key?(:'code')
84
+ self.code = attributes[:'code']
85
+ end
86
+
87
+ if attributes.key?(:'detail')
88
+ self.detail = attributes[:'detail']
89
+ end
90
+ end
91
+
92
+ # Show invalid properties with the reasons. Usually used together with valid?
93
+ # @return Array for valid properties with the reasons
94
+ def list_invalid_properties
95
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
96
+ invalid_properties = Array.new
97
+ if @error.nil?
98
+ invalid_properties.push('invalid value for "error", error cannot be nil.')
99
+ end
100
+
101
+ invalid_properties
102
+ end
103
+
104
+ # Check to see if the all the properties in the model are valid
105
+ # @return true if the model is valid
106
+ def valid?
107
+ warn '[DEPRECATED] the `valid?` method is obsolete'
108
+ return false if @error.nil?
109
+ true
110
+ end
111
+
112
+ # Custom attribute writer method with validation
113
+ # @param [Object] error Value to be assigned
114
+ def error=(error)
115
+ if error.nil?
116
+ fail ArgumentError, 'error cannot be nil'
117
+ end
118
+
119
+ @error = error
120
+ end
121
+
122
+ # Checks equality by comparing each attribute.
123
+ # @param [Object] Object to be compared
124
+ def ==(o)
125
+ return true if self.equal?(o)
126
+ self.class == o.class &&
127
+ error == o.error &&
128
+ code == o.code &&
129
+ detail == o.detail
130
+ end
131
+
132
+ # @see the `==` method
133
+ # @param [Object] Object to be compared
134
+ def eql?(o)
135
+ self == o
136
+ end
137
+
138
+ # Calculates hash code according to all attributes.
139
+ # @return [Integer] Hash code
140
+ def hash
141
+ [error, code, detail].hash
142
+ end
143
+
144
+ # Builds the object from hash
145
+ # @param [Hash] attributes Model attributes in the form of hash
146
+ # @return [Object] Returns the model itself
147
+ def self.build_from_hash(attributes)
148
+ return nil unless attributes.is_a?(Hash)
149
+ attributes = attributes.transform_keys(&:to_sym)
150
+ transformed_hash = {}
151
+ openapi_types.each_pair do |key, type|
152
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
153
+ transformed_hash["#{key}"] = nil
154
+ elsif type =~ /\AArray<(.*)>/i
155
+ # check to ensure the input is an array given that the attribute
156
+ # is documented as an array but the input is not
157
+ if attributes[attribute_map[key]].is_a?(Array)
158
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
159
+ end
160
+ elsif !attributes[attribute_map[key]].nil?
161
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
162
+ end
163
+ end
164
+ new(transformed_hash)
165
+ end
166
+
167
+ # Returns the object in the form of hash
168
+ # @return [Hash] Returns the object in the form of hash
169
+ def to_hash
170
+ hash = {}
171
+ self.class.attribute_map.each_pair do |attr, param|
172
+ value = self.send(attr)
173
+ if value.nil?
174
+ is_nullable = self.class.openapi_nullable.include?(attr)
175
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
176
+ end
177
+
178
+ hash[param] = _to_hash(value)
179
+ end
180
+ hash
181
+ end
182
+
183
+ end
184
+
185
+ end