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
 
@@ -173,7 +173,7 @@ module Flagr
173
173
  return nil unless attributes.is_a?(Hash)
174
174
  self.class.swagger_types.each_pair do |key, type|
175
175
  if type =~ /\AArray<(.*)>/i
176
- # check to ensure the input is an array given that the the attribute
176
+ # check to ensure the input is an array given that the attribute
177
177
  # is documented as an array but the input is not
178
178
  if attributes[self.class.attribute_map[key]].is_a?(Array)
179
179
  self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
@@ -269,5 +269,6 @@ module Flagr
269
269
  value
270
270
  end
271
271
  end
272
+
272
273
  end
273
274
  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,17 +16,27 @@ module Flagr
16
16
  class CreateFlagRequest
17
17
  attr_accessor :description
18
18
 
19
+ # unique key representation of the flag
20
+ attr_accessor :key
21
+
22
+ # template for flag creation
23
+ attr_accessor :template
24
+
19
25
  # Attribute mapping from ruby-style variable name to JSON key.
20
26
  def self.attribute_map
21
27
  {
22
- :'description' => :'description'
28
+ :'description' => :'description',
29
+ :'key' => :'key',
30
+ :'template' => :'template'
23
31
  }
24
32
  end
25
33
 
26
34
  # Attribute type mapping.
27
35
  def self.swagger_types
28
36
  {
29
- :'description' => :'String'
37
+ :'description' => :'String',
38
+ :'key' => :'String',
39
+ :'template' => :'String'
30
40
  }
31
41
  end
32
42
 
@@ -41,6 +51,14 @@ module Flagr
41
51
  if attributes.has_key?(:'description')
42
52
  self.description = attributes[:'description']
43
53
  end
54
+
55
+ if attributes.has_key?(:'key')
56
+ self.key = attributes[:'key']
57
+ end
58
+
59
+ if attributes.has_key?(:'template')
60
+ self.template = attributes[:'template']
61
+ end
44
62
  end
45
63
 
46
64
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -85,7 +103,9 @@ module Flagr
85
103
  def ==(o)
86
104
  return true if self.equal?(o)
87
105
  self.class == o.class &&
88
- description == o.description
106
+ description == o.description &&
107
+ key == o.key &&
108
+ template == o.template
89
109
  end
90
110
 
91
111
  # @see the `==` method
@@ -97,7 +117,7 @@ module Flagr
97
117
  # Calculates hash code according to all attributes.
98
118
  # @return [Fixnum] Hash code
99
119
  def hash
100
- [description].hash
120
+ [description, key, template].hash
101
121
  end
102
122
 
103
123
  # Builds the object from hash
@@ -107,7 +127,7 @@ module Flagr
107
127
  return nil unless attributes.is_a?(Hash)
108
128
  self.class.swagger_types.each_pair do |key, type|
109
129
  if type =~ /\AArray<(.*)>/i
110
- # check to ensure the input is an array given that the the attribute
130
+ # check to ensure the input is an array given that the attribute
111
131
  # is documented as an array but the input is not
112
132
  if attributes[self.class.attribute_map[key]].is_a?(Array)
113
133
  self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
@@ -203,5 +223,6 @@ module Flagr
203
223
  value
204
224
  end
205
225
  end
226
+
206
227
  end
207
228
  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
 
@@ -149,7 +149,7 @@ module Flagr
149
149
  return nil unless attributes.is_a?(Hash)
150
150
  self.class.swagger_types.each_pair do |key, type|
151
151
  if type =~ /\AArray<(.*)>/i
152
- # check to ensure the input is an array given that the the attribute
152
+ # check to ensure the input is an array given that the attribute
153
153
  # is documented as an array but the input is not
154
154
  if attributes[self.class.attribute_map[key]].is_a?(Array)
155
155
  self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
@@ -245,5 +245,6 @@ module Flagr
245
245
  value
246
246
  end
247
247
  end
248
+
248
249
  end
249
250
  end
@@ -0,0 +1,208 @@
1
+ =begin
2
+ #Flagr
3
+
4
+ #Flagr is a feature flagging, A/B testing and dynamic configuration microservice. The base path for all the APIs is \"/api/v1\".
5
+
6
+ OpenAPI spec version: 1.1.12
7
+
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.4.21
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module Flagr
16
+ class CreateTagRequest
17
+ attr_accessor :value
18
+
19
+ # Attribute mapping from ruby-style variable name to JSON key.
20
+ def self.attribute_map
21
+ {
22
+ :'value' => :'value'
23
+ }
24
+ end
25
+
26
+ # Attribute type mapping.
27
+ def self.swagger_types
28
+ {
29
+ :'value' => :'String'
30
+ }
31
+ end
32
+
33
+ # Initializes the object
34
+ # @param [Hash] attributes Model attributes in the form of hash
35
+ def initialize(attributes = {})
36
+ return unless attributes.is_a?(Hash)
37
+
38
+ # convert string to symbol for hash key
39
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
40
+
41
+ if attributes.has_key?(:'value')
42
+ self.value = attributes[:'value']
43
+ end
44
+ end
45
+
46
+ # Show invalid properties with the reasons. Usually used together with valid?
47
+ # @return Array for valid properties with the reasons
48
+ def list_invalid_properties
49
+ invalid_properties = Array.new
50
+ if @value.nil?
51
+ invalid_properties.push('invalid value for "value", value cannot be nil.')
52
+ end
53
+
54
+ if @value.to_s.length < 1
55
+ invalid_properties.push('invalid value for "value", the character length must be great than or equal to 1.')
56
+ end
57
+
58
+ invalid_properties
59
+ end
60
+
61
+ # Check to see if the all the properties in the model are valid
62
+ # @return true if the model is valid
63
+ def valid?
64
+ return false if @value.nil?
65
+ return false if @value.to_s.length < 1
66
+ true
67
+ end
68
+
69
+ # Custom attribute writer method with validation
70
+ # @param [Object] value Value to be assigned
71
+ def value=(value)
72
+ if value.nil?
73
+ fail ArgumentError, 'value cannot be nil'
74
+ end
75
+
76
+ if value.to_s.length < 1
77
+ fail ArgumentError, 'invalid value for "value", the character length must be great than or equal to 1.'
78
+ end
79
+
80
+ @value = value
81
+ end
82
+
83
+ # Checks equality by comparing each attribute.
84
+ # @param [Object] Object to be compared
85
+ def ==(o)
86
+ return true if self.equal?(o)
87
+ self.class == o.class &&
88
+ value == o.value
89
+ end
90
+
91
+ # @see the `==` method
92
+ # @param [Object] Object to be compared
93
+ def eql?(o)
94
+ self == o
95
+ end
96
+
97
+ # Calculates hash code according to all attributes.
98
+ # @return [Fixnum] Hash code
99
+ def hash
100
+ [value].hash
101
+ end
102
+
103
+ # Builds the object from hash
104
+ # @param [Hash] attributes Model attributes in the form of hash
105
+ # @return [Object] Returns the model itself
106
+ def build_from_hash(attributes)
107
+ return nil unless attributes.is_a?(Hash)
108
+ self.class.swagger_types.each_pair do |key, type|
109
+ if type =~ /\AArray<(.*)>/i
110
+ # check to ensure the input is an array given that the attribute
111
+ # is documented as an array but the input is not
112
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
113
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
114
+ end
115
+ elsif !attributes[self.class.attribute_map[key]].nil?
116
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
117
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
118
+ end
119
+
120
+ self
121
+ end
122
+
123
+ # Deserializes the data based on type
124
+ # @param string type Data type
125
+ # @param string value Value to be deserialized
126
+ # @return [Object] Deserialized data
127
+ def _deserialize(type, value)
128
+ case type.to_sym
129
+ when :DateTime
130
+ DateTime.parse(value)
131
+ when :Date
132
+ Date.parse(value)
133
+ when :String
134
+ value.to_s
135
+ when :Integer
136
+ value.to_i
137
+ when :Float
138
+ value.to_f
139
+ when :BOOLEAN
140
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
141
+ true
142
+ else
143
+ false
144
+ end
145
+ when :Object
146
+ # generic object (usually a Hash), return directly
147
+ value
148
+ when /\AArray<(?<inner_type>.+)>\z/
149
+ inner_type = Regexp.last_match[:inner_type]
150
+ value.map { |v| _deserialize(inner_type, v) }
151
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
152
+ k_type = Regexp.last_match[:k_type]
153
+ v_type = Regexp.last_match[:v_type]
154
+ {}.tap do |hash|
155
+ value.each do |k, v|
156
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
157
+ end
158
+ end
159
+ else # model
160
+ temp_model = Flagr.const_get(type).new
161
+ temp_model.build_from_hash(value)
162
+ end
163
+ end
164
+
165
+ # Returns the string representation of the object
166
+ # @return [String] String presentation of the object
167
+ def to_s
168
+ to_hash.to_s
169
+ end
170
+
171
+ # to_body is an alias to to_hash (backward compatibility)
172
+ # @return [Hash] Returns the object in the form of hash
173
+ def to_body
174
+ to_hash
175
+ end
176
+
177
+ # Returns the object in the form of hash
178
+ # @return [Hash] Returns the object in the form of hash
179
+ def to_hash
180
+ hash = {}
181
+ self.class.attribute_map.each_pair do |attr, param|
182
+ value = self.send(attr)
183
+ next if value.nil?
184
+ hash[param] = _to_hash(value)
185
+ end
186
+ hash
187
+ end
188
+
189
+ # Outputs non-array value in the form of hash
190
+ # For object, use to_hash. Otherwise, just return the value
191
+ # @param [Object] value Any valid value
192
+ # @return [Hash] Returns the value in the form of hash
193
+ def _to_hash(value)
194
+ if value.is_a?(Array)
195
+ value.compact.map { |v| _to_hash(v) }
196
+ elsif value.is_a?(Hash)
197
+ {}.tap do |hash|
198
+ value.each { |k, v| hash[k] = _to_hash(v) }
199
+ end
200
+ elsif value.respond_to? :to_hash
201
+ value.to_hash
202
+ else
203
+ value
204
+ end
205
+ end
206
+
207
+ end
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
 
@@ -116,7 +116,7 @@ module Flagr
116
116
  return nil unless attributes.is_a?(Hash)
117
117
  self.class.swagger_types.each_pair do |key, type|
118
118
  if type =~ /\AArray<(.*)>/i
119
- # check to ensure the input is an array given that the the attribute
119
+ # check to ensure the input is an array given that the attribute
120
120
  # is documented as an array but the input is not
121
121
  if attributes[self.class.attribute_map[key]].is_a?(Array)
122
122
  self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
@@ -212,5 +212,6 @@ module Flagr
212
212
  value
213
213
  end
214
214
  end
215
+
215
216
  end
216
217
  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
 
@@ -18,8 +18,6 @@ module Flagr
18
18
 
19
19
  attr_accessor :percent
20
20
 
21
- attr_accessor :bitmap
22
-
23
21
  attr_accessor :variant_key
24
22
 
25
23
  attr_accessor :variant_id
@@ -29,7 +27,6 @@ module Flagr
29
27
  {
30
28
  :'id' => :'id',
31
29
  :'percent' => :'percent',
32
- :'bitmap' => :'bitmap',
33
30
  :'variant_key' => :'variantKey',
34
31
  :'variant_id' => :'variantID'
35
32
  }
@@ -40,7 +37,6 @@ module Flagr
40
37
  {
41
38
  :'id' => :'Integer',
42
39
  :'percent' => :'Integer',
43
- :'bitmap' => :'String',
44
40
  :'variant_key' => :'String',
45
41
  :'variant_id' => :'Integer'
46
42
  }
@@ -62,10 +58,6 @@ module Flagr
62
58
  self.percent = attributes[:'percent']
63
59
  end
64
60
 
65
- if attributes.has_key?(:'bitmap')
66
- self.bitmap = attributes[:'bitmap']
67
- end
68
-
69
61
  if attributes.has_key?(:'variantKey')
70
62
  self.variant_key = attributes[:'variantKey']
71
63
  end
@@ -95,10 +87,6 @@ module Flagr
95
87
  invalid_properties.push('invalid value for "percent", must be greater than or equal to 0.')
96
88
  end
97
89
 
98
- if !@bitmap.nil? && @bitmap.to_s.length < 1
99
- invalid_properties.push('invalid value for "bitmap", the character length must be great than or equal to 1.')
100
- end
101
-
102
90
  if @variant_key.nil?
103
91
  invalid_properties.push('invalid value for "variant_key", variant_key cannot be nil.')
104
92
  end
@@ -125,7 +113,6 @@ module Flagr
125
113
  return false if @percent.nil?
126
114
  return false if @percent > 100
127
115
  return false if @percent < 0
128
- return false if !@bitmap.nil? && @bitmap.to_s.length < 1
129
116
  return false if @variant_key.nil?
130
117
  return false if @variant_key.to_s.length < 1
131
118
  return false if @variant_id.nil?
@@ -161,16 +148,6 @@ module Flagr
161
148
  @percent = percent
162
149
  end
163
150
 
164
- # Custom attribute writer method with validation
165
- # @param [Object] bitmap Value to be assigned
166
- def bitmap=(bitmap)
167
- if !bitmap.nil? && bitmap.to_s.length < 1
168
- fail ArgumentError, 'invalid value for "bitmap", the character length must be great than or equal to 1.'
169
- end
170
-
171
- @bitmap = bitmap
172
- end
173
-
174
151
  # Custom attribute writer method with validation
175
152
  # @param [Object] variant_key Value to be assigned
176
153
  def variant_key=(variant_key)
@@ -206,7 +183,6 @@ module Flagr
206
183
  self.class == o.class &&
207
184
  id == o.id &&
208
185
  percent == o.percent &&
209
- bitmap == o.bitmap &&
210
186
  variant_key == o.variant_key &&
211
187
  variant_id == o.variant_id
212
188
  end
@@ -220,7 +196,7 @@ module Flagr
220
196
  # Calculates hash code according to all attributes.
221
197
  # @return [Fixnum] Hash code
222
198
  def hash
223
- [id, percent, bitmap, variant_key, variant_id].hash
199
+ [id, percent, variant_key, variant_id].hash
224
200
  end
225
201
 
226
202
  # Builds the object from hash
@@ -230,7 +206,7 @@ module Flagr
230
206
  return nil unless attributes.is_a?(Hash)
231
207
  self.class.swagger_types.each_pair do |key, type|
232
208
  if type =~ /\AArray<(.*)>/i
233
- # check to ensure the input is an array given that the the attribute
209
+ # check to ensure the input is an array given that the attribute
234
210
  # is documented as an array but the input is not
235
211
  if attributes[self.class.attribute_map[key]].is_a?(Array)
236
212
  self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
@@ -326,5 +302,6 @@ module Flagr
326
302
  value
327
303
  end
328
304
  end
305
+
329
306
  end
330
307
  end