rbflagr 0.1.2 → 1.1.12

Sign up to get free protection for your applications and to get access to all the features.
Files changed (69) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +1 -1
  3. data/README.md +17 -7
  4. data/docs/CreateFlagRequest.md +2 -0
  5. data/docs/CreateTagRequest.md +8 -0
  6. data/docs/Distribution.md +0 -1
  7. data/docs/EvalContext.md +4 -2
  8. data/docs/EvalResult.md +8 -7
  9. data/docs/EvaluationBatchRequest.md +3 -1
  10. data/docs/EvaluationEntity.md +1 -1
  11. data/docs/ExportApi.md +97 -0
  12. data/docs/Flag.md +7 -0
  13. data/docs/FlagApi.md +46 -1
  14. data/docs/Health.md +8 -0
  15. data/docs/HealthApi.md +9 -6
  16. data/docs/PutFlagRequest.md +5 -1
  17. data/docs/PutVariantRequest.md +1 -1
  18. data/docs/Tag.md +9 -0
  19. data/docs/TagApi.md +198 -0
  20. data/lib/rbflagr/api/constraint_api.rb +3 -3
  21. data/lib/rbflagr/api/distribution_api.rb +3 -3
  22. data/lib/rbflagr/api/evaluation_api.rb +3 -3
  23. data/lib/rbflagr/api/export_api.rb +118 -0
  24. data/lib/rbflagr/api/flag_api.rb +56 -3
  25. data/lib/rbflagr/api/health_api.rb +15 -12
  26. data/lib/rbflagr/api/segment_api.rb +3 -3
  27. data/lib/rbflagr/api/tag_api.rb +253 -0
  28. data/lib/rbflagr/api/variant_api.rb +3 -3
  29. data/lib/rbflagr/api_client.rb +8 -6
  30. data/lib/rbflagr/api_error.rb +3 -3
  31. data/lib/rbflagr/configuration.rb +5 -5
  32. data/lib/rbflagr/models/constraint.rb +5 -4
  33. data/lib/rbflagr/models/create_constraint_request.rb +5 -4
  34. data/lib/rbflagr/models/create_flag_request.rb +29 -8
  35. data/lib/rbflagr/models/create_segment_request.rb +5 -4
  36. data/lib/rbflagr/models/create_tag_request.rb +208 -0
  37. data/lib/rbflagr/models/create_variant_request.rb +5 -4
  38. data/lib/rbflagr/models/distribution.rb +6 -29
  39. data/lib/rbflagr/models/error.rb +5 -4
  40. data/lib/rbflagr/models/eval_context.rb +35 -44
  41. data/lib/rbflagr/models/eval_debug_log.rb +5 -4
  42. data/lib/rbflagr/models/eval_result.rb +15 -135
  43. data/lib/rbflagr/models/evaluation_batch_request.rb +34 -13
  44. data/lib/rbflagr/models/evaluation_batch_response.rb +5 -4
  45. data/lib/rbflagr/models/evaluation_entity.rb +5 -28
  46. data/lib/rbflagr/models/flag.rb +92 -8
  47. data/lib/rbflagr/models/flag_snapshot.rb +5 -4
  48. data/lib/rbflagr/models/health.rb +184 -0
  49. data/lib/rbflagr/models/put_distributions_request.rb +5 -4
  50. data/lib/rbflagr/models/put_flag_request.rb +49 -20
  51. data/lib/rbflagr/models/put_segment_reorder_request.rb +5 -4
  52. data/lib/rbflagr/models/put_segment_request.rb +5 -4
  53. data/lib/rbflagr/models/put_variant_request.rb +5 -9
  54. data/lib/rbflagr/models/segment.rb +5 -4
  55. data/lib/rbflagr/models/segment_debug_log.rb +5 -4
  56. data/lib/rbflagr/models/set_flag_enabled_request.rb +5 -4
  57. data/lib/rbflagr/models/tag.rb +232 -0
  58. data/lib/rbflagr/models/variant.rb +5 -4
  59. data/lib/rbflagr/version.rb +4 -4
  60. data/lib/rbflagr.rb +8 -3
  61. data/rbflagr.gemspec +5 -4
  62. data/spec/api/export_api_spec.rb +45 -0
  63. data/spec/api/tag_api_spec.rb +79 -0
  64. data/spec/models/create_tag_request_spec.rb +41 -0
  65. data/spec/models/health_spec.rb +41 -0
  66. data/spec/models/tag_spec.rb +47 -0
  67. data/swagger.yaml +309 -43
  68. data/swagger_ruby.json +1 -1
  69. metadata +72 -32
@@ -1,12 +1,12 @@
1
1
  =begin
2
2
  #Flagr
3
3
 
4
- #Flagr is a feature flagging, A/B testing and dynamic configuration microservice
4
+ #Flagr is a feature flagging, A/B testing and dynamic configuration microservice. The base path for all the APIs is \"/api/v1\".
5
5
 
6
- OpenAPI spec version: 1.0.8
6
+ OpenAPI spec version: 1.1.12
7
7
 
8
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
9
- Swagger Codegen version: 2.4.0-SNAPSHOT
9
+ Swagger Codegen version: 2.4.21
10
10
 
11
11
  =end
12
12
 
@@ -107,7 +107,7 @@ module Flagr
107
107
  return nil unless attributes.is_a?(Hash)
108
108
  self.class.swagger_types.each_pair do |key, type|
109
109
  if type =~ /\AArray<(.*)>/i
110
- # check to ensure the input is an array given that the the attribute
110
+ # check to ensure the input is an array given that the attribute
111
111
  # is documented as an array but the input is not
112
112
  if attributes[self.class.attribute_map[key]].is_a?(Array)
113
113
  self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
@@ -203,5 +203,6 @@ module Flagr
203
203
  value
204
204
  end
205
205
  end
206
+
206
207
  end
207
208
  end
@@ -1,12 +1,12 @@
1
1
  =begin
2
2
  #Flagr
3
3
 
4
- #Flagr is a feature flagging, A/B testing and dynamic configuration microservice
4
+ #Flagr is a feature flagging, A/B testing and dynamic configuration microservice. The base path for all the APIs is \"/api/v1\".
5
5
 
6
- OpenAPI spec version: 1.0.8
6
+ OpenAPI spec version: 1.1.12
7
7
 
8
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
9
- Swagger Codegen version: 2.4.0-SNAPSHOT
9
+ Swagger Codegen version: 2.4.21
10
10
 
11
11
  =end
12
12
 
@@ -23,8 +23,15 @@ module Flagr
23
23
 
24
24
  attr_accessor :enable_debug
25
25
 
26
+ # flagID
26
27
  attr_accessor :flag_id
27
28
 
29
+ # flagKey. flagID or flagKey will resolve to the same flag. Either works.
30
+ attr_accessor :flag_key
31
+
32
+ # flagTags. flagTags looks up flags by tag. Either works.
33
+ attr_accessor :flag_tags
34
+
28
35
  # Attribute mapping from ruby-style variable name to JSON key.
29
36
  def self.attribute_map
30
37
  {
@@ -32,7 +39,9 @@ module Flagr
32
39
  :'entity_type' => :'entityType',
33
40
  :'entity_context' => :'entityContext',
34
41
  :'enable_debug' => :'enableDebug',
35
- :'flag_id' => :'flagID'
42
+ :'flag_id' => :'flagID',
43
+ :'flag_key' => :'flagKey',
44
+ :'flag_tags' => :'flagTags'
36
45
  }
37
46
  end
38
47
 
@@ -43,7 +52,9 @@ module Flagr
43
52
  :'entity_type' => :'String',
44
53
  :'entity_context' => :'Object',
45
54
  :'enable_debug' => :'BOOLEAN',
46
- :'flag_id' => :'Integer'
55
+ :'flag_id' => :'Integer',
56
+ :'flag_key' => :'String',
57
+ :'flag_tags' => :'Array<String>'
47
58
  }
48
59
  end
49
60
 
@@ -74,25 +85,23 @@ module Flagr
74
85
  if attributes.has_key?(:'flagID')
75
86
  self.flag_id = attributes[:'flagID']
76
87
  end
88
+
89
+ if attributes.has_key?(:'flagKey')
90
+ self.flag_key = attributes[:'flagKey']
91
+ end
92
+
93
+ if attributes.has_key?(:'flagTags')
94
+ if (value = attributes[:'flagTags']).is_a?(Array)
95
+ self.flag_tags = value
96
+ end
97
+ end
77
98
  end
78
99
 
79
100
  # Show invalid properties with the reasons. Usually used together with valid?
80
101
  # @return Array for valid properties with the reasons
81
102
  def list_invalid_properties
82
103
  invalid_properties = Array.new
83
- if @entity_type.nil?
84
- invalid_properties.push('invalid value for "entity_type", entity_type cannot be nil.')
85
- end
86
-
87
- if @entity_type.to_s.length < 1
88
- invalid_properties.push('invalid value for "entity_type", the character length must be great than or equal to 1.')
89
- end
90
-
91
- if @flag_id.nil?
92
- invalid_properties.push('invalid value for "flag_id", flag_id cannot be nil.')
93
- end
94
-
95
- if @flag_id < 1
104
+ if !@flag_id.nil? && @flag_id < 1
96
105
  invalid_properties.push('invalid value for "flag_id", must be greater than or equal to 1.')
97
106
  end
98
107
 
@@ -102,35 +111,14 @@ module Flagr
102
111
  # Check to see if the all the properties in the model are valid
103
112
  # @return true if the model is valid
104
113
  def valid?
105
- return false if @entity_type.nil?
106
- return false if @entity_type.to_s.length < 1
107
- return false if @flag_id.nil?
108
- return false if @flag_id < 1
114
+ return false if !@flag_id.nil? && @flag_id < 1
109
115
  true
110
116
  end
111
117
 
112
- # Custom attribute writer method with validation
113
- # @param [Object] entity_type Value to be assigned
114
- def entity_type=(entity_type)
115
- if entity_type.nil?
116
- fail ArgumentError, 'entity_type cannot be nil'
117
- end
118
-
119
- if entity_type.to_s.length < 1
120
- fail ArgumentError, 'invalid value for "entity_type", the character length must be great than or equal to 1.'
121
- end
122
-
123
- @entity_type = entity_type
124
- end
125
-
126
118
  # Custom attribute writer method with validation
127
119
  # @param [Object] flag_id Value to be assigned
128
120
  def flag_id=(flag_id)
129
- if flag_id.nil?
130
- fail ArgumentError, 'flag_id cannot be nil'
131
- end
132
-
133
- if flag_id < 1
121
+ if !flag_id.nil? && flag_id < 1
134
122
  fail ArgumentError, 'invalid value for "flag_id", must be greater than or equal to 1.'
135
123
  end
136
124
 
@@ -146,7 +134,9 @@ module Flagr
146
134
  entity_type == o.entity_type &&
147
135
  entity_context == o.entity_context &&
148
136
  enable_debug == o.enable_debug &&
149
- flag_id == o.flag_id
137
+ flag_id == o.flag_id &&
138
+ flag_key == o.flag_key &&
139
+ flag_tags == o.flag_tags
150
140
  end
151
141
 
152
142
  # @see the `==` method
@@ -158,7 +148,7 @@ module Flagr
158
148
  # Calculates hash code according to all attributes.
159
149
  # @return [Fixnum] Hash code
160
150
  def hash
161
- [entity_id, entity_type, entity_context, enable_debug, flag_id].hash
151
+ [entity_id, entity_type, entity_context, enable_debug, flag_id, flag_key, flag_tags].hash
162
152
  end
163
153
 
164
154
  # Builds the object from hash
@@ -168,7 +158,7 @@ module Flagr
168
158
  return nil unless attributes.is_a?(Hash)
169
159
  self.class.swagger_types.each_pair do |key, type|
170
160
  if type =~ /\AArray<(.*)>/i
171
- # check to ensure the input is an array given that the the attribute
161
+ # check to ensure the input is an array given that the attribute
172
162
  # is documented as an array but the input is not
173
163
  if attributes[self.class.attribute_map[key]].is_a?(Array)
174
164
  self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
@@ -264,5 +254,6 @@ module Flagr
264
254
  value
265
255
  end
266
256
  end
257
+
267
258
  end
268
259
  end
@@ -1,12 +1,12 @@
1
1
  =begin
2
2
  #Flagr
3
3
 
4
- #Flagr is a feature flagging, A/B testing and dynamic configuration microservice
4
+ #Flagr is a feature flagging, A/B testing and dynamic configuration microservice. The base path for all the APIs is \"/api/v1\".
5
5
 
6
- OpenAPI spec version: 1.0.8
6
+ OpenAPI spec version: 1.1.12
7
7
 
8
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
9
- Swagger Codegen version: 2.4.0-SNAPSHOT
9
+ Swagger Codegen version: 2.4.21
10
10
 
11
11
  =end
12
12
 
@@ -94,7 +94,7 @@ module Flagr
94
94
  return nil unless attributes.is_a?(Hash)
95
95
  self.class.swagger_types.each_pair do |key, type|
96
96
  if type =~ /\AArray<(.*)>/i
97
- # check to ensure the input is an array given that the the attribute
97
+ # check to ensure the input is an array given that the attribute
98
98
  # is documented as an array but the input is not
99
99
  if attributes[self.class.attribute_map[key]].is_a?(Array)
100
100
  self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
@@ -190,5 +190,6 @@ module Flagr
190
190
  value
191
191
  end
192
192
  end
193
+
193
194
  end
194
195
  end
@@ -1,12 +1,12 @@
1
1
  =begin
2
2
  #Flagr
3
3
 
4
- #Flagr is a feature flagging, A/B testing and dynamic configuration microservice
4
+ #Flagr is a feature flagging, A/B testing and dynamic configuration microservice. The base path for all the APIs is \"/api/v1\".
5
5
 
6
- OpenAPI spec version: 1.0.8
6
+ OpenAPI spec version: 1.1.12
7
7
 
8
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
9
- Swagger Codegen version: 2.4.0-SNAPSHOT
9
+ Swagger Codegen version: 2.4.21
10
10
 
11
11
  =end
12
12
 
@@ -16,6 +16,8 @@ module Flagr
16
16
  class EvalResult
17
17
  attr_accessor :flag_id
18
18
 
19
+ attr_accessor :flag_key
20
+
19
21
  attr_accessor :flag_snapshot_id
20
22
 
21
23
  attr_accessor :segment_id
@@ -36,6 +38,7 @@ module Flagr
36
38
  def self.attribute_map
37
39
  {
38
40
  :'flag_id' => :'flagID',
41
+ :'flag_key' => :'flagKey',
39
42
  :'flag_snapshot_id' => :'flagSnapshotID',
40
43
  :'segment_id' => :'segmentID',
41
44
  :'variant_id' => :'variantID',
@@ -51,6 +54,7 @@ module Flagr
51
54
  def self.swagger_types
52
55
  {
53
56
  :'flag_id' => :'Integer',
57
+ :'flag_key' => :'String',
54
58
  :'flag_snapshot_id' => :'Integer',
55
59
  :'segment_id' => :'Integer',
56
60
  :'variant_id' => :'Integer',
@@ -74,6 +78,10 @@ module Flagr
74
78
  self.flag_id = attributes[:'flagID']
75
79
  end
76
80
 
81
+ if attributes.has_key?(:'flagKey')
82
+ self.flag_key = attributes[:'flagKey']
83
+ end
84
+
77
85
  if attributes.has_key?(:'flagSnapshotID')
78
86
  self.flag_snapshot_id = attributes[:'flagSnapshotID']
79
87
  end
@@ -111,151 +119,22 @@ module Flagr
111
119
  # @return Array for valid properties with the reasons
112
120
  def list_invalid_properties
113
121
  invalid_properties = Array.new
114
- if @flag_id.nil?
115
- invalid_properties.push('invalid value for "flag_id", flag_id cannot be nil.')
116
- end
117
-
118
- if @flag_id < 1
119
- invalid_properties.push('invalid value for "flag_id", must be greater than or equal to 1.')
120
- end
121
-
122
- if @segment_id.nil?
123
- invalid_properties.push('invalid value for "segment_id", segment_id cannot be nil.')
124
- end
125
-
126
- if @segment_id < 1
127
- invalid_properties.push('invalid value for "segment_id", must be greater than or equal to 1.')
128
- end
129
-
130
- if @variant_id.nil?
131
- invalid_properties.push('invalid value for "variant_id", variant_id cannot be nil.')
132
- end
133
-
134
- if @variant_id < 1
135
- invalid_properties.push('invalid value for "variant_id", must be greater than or equal to 1.')
136
- end
137
-
138
- if @variant_key.nil?
139
- invalid_properties.push('invalid value for "variant_key", variant_key cannot be nil.')
140
- end
141
-
142
- if @variant_key.to_s.length < 1
143
- invalid_properties.push('invalid value for "variant_key", the character length must be great than or equal to 1.')
144
- end
145
-
146
- if @variant_attachment.nil?
147
- invalid_properties.push('invalid value for "variant_attachment", variant_attachment cannot be nil.')
148
- end
149
-
150
- if @eval_context.nil?
151
- invalid_properties.push('invalid value for "eval_context", eval_context cannot be nil.')
152
- end
153
-
154
- if @timestamp.nil?
155
- invalid_properties.push('invalid value for "timestamp", timestamp cannot be nil.')
156
- end
157
-
158
- if @timestamp.to_s.length < 1
159
- invalid_properties.push('invalid value for "timestamp", the character length must be great than or equal to 1.')
160
- end
161
-
162
122
  invalid_properties
163
123
  end
164
124
 
165
125
  # Check to see if the all the properties in the model are valid
166
126
  # @return true if the model is valid
167
127
  def valid?
168
- return false if @flag_id.nil?
169
- return false if @flag_id < 1
170
- return false if @segment_id.nil?
171
- return false if @segment_id < 1
172
- return false if @variant_id.nil?
173
- return false if @variant_id < 1
174
- return false if @variant_key.nil?
175
- return false if @variant_key.to_s.length < 1
176
- return false if @variant_attachment.nil?
177
- return false if @eval_context.nil?
178
- return false if @timestamp.nil?
179
- return false if @timestamp.to_s.length < 1
180
128
  true
181
129
  end
182
130
 
183
- # Custom attribute writer method with validation
184
- # @param [Object] flag_id Value to be assigned
185
- def flag_id=(flag_id)
186
- if flag_id.nil?
187
- fail ArgumentError, 'flag_id cannot be nil'
188
- end
189
-
190
- if flag_id < 1
191
- fail ArgumentError, 'invalid value for "flag_id", must be greater than or equal to 1.'
192
- end
193
-
194
- @flag_id = flag_id
195
- end
196
-
197
- # Custom attribute writer method with validation
198
- # @param [Object] segment_id Value to be assigned
199
- def segment_id=(segment_id)
200
- if segment_id.nil?
201
- fail ArgumentError, 'segment_id cannot be nil'
202
- end
203
-
204
- if segment_id < 1
205
- fail ArgumentError, 'invalid value for "segment_id", must be greater than or equal to 1.'
206
- end
207
-
208
- @segment_id = segment_id
209
- end
210
-
211
- # Custom attribute writer method with validation
212
- # @param [Object] variant_id Value to be assigned
213
- def variant_id=(variant_id)
214
- if variant_id.nil?
215
- fail ArgumentError, 'variant_id cannot be nil'
216
- end
217
-
218
- if variant_id < 1
219
- fail ArgumentError, 'invalid value for "variant_id", must be greater than or equal to 1.'
220
- end
221
-
222
- @variant_id = variant_id
223
- end
224
-
225
- # Custom attribute writer method with validation
226
- # @param [Object] variant_key Value to be assigned
227
- def variant_key=(variant_key)
228
- if variant_key.nil?
229
- fail ArgumentError, 'variant_key cannot be nil'
230
- end
231
-
232
- if variant_key.to_s.length < 1
233
- fail ArgumentError, 'invalid value for "variant_key", the character length must be great than or equal to 1.'
234
- end
235
-
236
- @variant_key = variant_key
237
- end
238
-
239
- # Custom attribute writer method with validation
240
- # @param [Object] timestamp Value to be assigned
241
- def timestamp=(timestamp)
242
- if timestamp.nil?
243
- fail ArgumentError, 'timestamp cannot be nil'
244
- end
245
-
246
- if timestamp.to_s.length < 1
247
- fail ArgumentError, 'invalid value for "timestamp", the character length must be great than or equal to 1.'
248
- end
249
-
250
- @timestamp = timestamp
251
- end
252
-
253
131
  # Checks equality by comparing each attribute.
254
132
  # @param [Object] Object to be compared
255
133
  def ==(o)
256
134
  return true if self.equal?(o)
257
135
  self.class == o.class &&
258
136
  flag_id == o.flag_id &&
137
+ flag_key == o.flag_key &&
259
138
  flag_snapshot_id == o.flag_snapshot_id &&
260
139
  segment_id == o.segment_id &&
261
140
  variant_id == o.variant_id &&
@@ -275,7 +154,7 @@ module Flagr
275
154
  # Calculates hash code according to all attributes.
276
155
  # @return [Fixnum] Hash code
277
156
  def hash
278
- [flag_id, flag_snapshot_id, segment_id, variant_id, variant_key, variant_attachment, eval_context, timestamp, eval_debug_log].hash
157
+ [flag_id, flag_key, flag_snapshot_id, segment_id, variant_id, variant_key, variant_attachment, eval_context, timestamp, eval_debug_log].hash
279
158
  end
280
159
 
281
160
  # Builds the object from hash
@@ -285,7 +164,7 @@ module Flagr
285
164
  return nil unless attributes.is_a?(Hash)
286
165
  self.class.swagger_types.each_pair do |key, type|
287
166
  if type =~ /\AArray<(.*)>/i
288
- # check to ensure the input is an array given that the the attribute
167
+ # check to ensure the input is an array given that the attribute
289
168
  # is documented as an array but the input is not
290
169
  if attributes[self.class.attribute_map[key]].is_a?(Array)
291
170
  self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
@@ -381,5 +260,6 @@ module Flagr
381
260
  value
382
261
  end
383
262
  end
263
+
384
264
  end
385
265
  end