rbflagr 0.1.2 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (56) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +9 -7
  3. data/docs/CreateFlagRequest.md +1 -0
  4. data/docs/Distribution.md +0 -1
  5. data/docs/EvalContext.md +3 -2
  6. data/docs/EvalResult.md +1 -0
  7. data/docs/EvaluationBatchRequest.md +2 -1
  8. data/docs/EvaluationEntity.md +1 -1
  9. data/docs/ExportApi.md +49 -0
  10. data/docs/Flag.md +5 -0
  11. data/docs/FlagApi.md +41 -0
  12. data/docs/HealthApi.md +7 -5
  13. data/docs/PutFlagRequest.md +4 -1
  14. data/docs/PutVariantRequest.md +1 -1
  15. data/lib/rbflagr.rb +3 -2
  16. data/lib/rbflagr/api/constraint_api.rb +2 -2
  17. data/lib/rbflagr/api/distribution_api.rb +2 -2
  18. data/lib/rbflagr/api/evaluation_api.rb +2 -2
  19. data/lib/rbflagr/api/export_api.rb +69 -0
  20. data/lib/rbflagr/api/flag_api.rb +49 -2
  21. data/lib/rbflagr/api/health_api.rb +9 -7
  22. data/lib/rbflagr/api/segment_api.rb +2 -2
  23. data/lib/rbflagr/api/variant_api.rb +2 -2
  24. data/lib/rbflagr/api_client.rb +2 -2
  25. data/lib/rbflagr/api_error.rb +2 -2
  26. data/lib/rbflagr/configuration.rb +2 -2
  27. data/lib/rbflagr/models/constraint.rb +2 -2
  28. data/lib/rbflagr/models/create_constraint_request.rb +2 -2
  29. data/lib/rbflagr/models/create_flag_request.rb +16 -6
  30. data/lib/rbflagr/models/create_segment_request.rb +2 -2
  31. data/lib/rbflagr/models/create_variant_request.rb +2 -2
  32. data/lib/rbflagr/models/distribution.rb +3 -27
  33. data/lib/rbflagr/models/error.rb +2 -2
  34. data/lib/rbflagr/models/eval_context.rb +20 -42
  35. data/lib/rbflagr/models/eval_debug_log.rb +2 -2
  36. data/lib/rbflagr/models/eval_result.rb +17 -3
  37. data/lib/rbflagr/models/evaluation_batch_request.rb +19 -11
  38. data/lib/rbflagr/models/evaluation_batch_response.rb +2 -2
  39. data/lib/rbflagr/models/evaluation_entity.rb +2 -26
  40. data/lib/rbflagr/models/flag.rb +68 -6
  41. data/lib/rbflagr/models/flag_snapshot.rb +2 -2
  42. data/lib/rbflagr/models/put_distributions_request.rb +2 -2
  43. data/lib/rbflagr/models/put_flag_request.rb +37 -18
  44. data/lib/rbflagr/models/put_segment_reorder_request.rb +2 -2
  45. data/lib/rbflagr/models/put_segment_request.rb +2 -2
  46. data/lib/rbflagr/models/put_variant_request.rb +2 -7
  47. data/lib/rbflagr/models/segment.rb +2 -2
  48. data/lib/rbflagr/models/segment_debug_log.rb +2 -2
  49. data/lib/rbflagr/models/set_flag_enabled_request.rb +2 -2
  50. data/lib/rbflagr/models/variant.rb +2 -2
  51. data/lib/rbflagr/version.rb +3 -3
  52. data/rbflagr.gemspec +3 -3
  53. data/spec/api/export_api_spec.rb +45 -0
  54. data/swagger.yaml +115 -35
  55. data/swagger_ruby.json +1 -1
  56. metadata +8 -3
@@ -1,9 +1,9 @@
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.0.13
7
7
 
8
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
9
9
  Swagger Codegen version: 2.4.0-SNAPSHOT
@@ -19,18 +19,20 @@ module Flagr
19
19
  def initialize(api_client = ApiClient.default)
20
20
  @api_client = api_client
21
21
  end
22
+ # Check if Flagr is healthy
22
23
  # @param [Hash] opts the optional parameters
23
24
  # @return [nil]
24
- def health_get(opts = {})
25
- health_get_with_http_info(opts)
25
+ def get_health(opts = {})
26
+ get_health_with_http_info(opts)
26
27
  nil
27
28
  end
28
29
 
30
+ # Check if Flagr is healthy
29
31
  # @param [Hash] opts the optional parameters
30
32
  # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
31
- def health_get_with_http_info(opts = {})
33
+ def get_health_with_http_info(opts = {})
32
34
  if @api_client.config.debugging
33
- @api_client.config.logger.debug 'Calling API: HealthApi.health_get ...'
35
+ @api_client.config.logger.debug 'Calling API: HealthApi.get_health ...'
34
36
  end
35
37
  # resource path
36
38
  local_var_path = '/health'
@@ -58,7 +60,7 @@ module Flagr
58
60
  :body => post_body,
59
61
  :auth_names => auth_names)
60
62
  if @api_client.config.debugging
61
- @api_client.config.logger.debug "API called: HealthApi#health_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
63
+ @api_client.config.logger.debug "API called: HealthApi#get_health\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
62
64
  end
63
65
  return data, status_code, headers
64
66
  end
@@ -1,9 +1,9 @@
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.0.13
7
7
 
8
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
9
9
  Swagger Codegen version: 2.4.0-SNAPSHOT
@@ -1,9 +1,9 @@
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.0.13
7
7
 
8
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
9
9
  Swagger Codegen version: 2.4.0-SNAPSHOT
@@ -1,9 +1,9 @@
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.0.13
7
7
 
8
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
9
9
  Swagger Codegen version: 2.4.0-SNAPSHOT
@@ -1,9 +1,9 @@
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.0.13
7
7
 
8
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
9
9
  Swagger Codegen version: 2.4.0-SNAPSHOT
@@ -1,9 +1,9 @@
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.0.13
7
7
 
8
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
9
9
  Swagger Codegen version: 2.4.0-SNAPSHOT
@@ -1,9 +1,9 @@
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.0.13
7
7
 
8
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
9
9
  Swagger Codegen version: 2.4.0-SNAPSHOT
@@ -1,9 +1,9 @@
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.0.13
7
7
 
8
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
9
9
  Swagger Codegen version: 2.4.0-SNAPSHOT
@@ -1,9 +1,9 @@
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.0.13
7
7
 
8
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
9
9
  Swagger Codegen version: 2.4.0-SNAPSHOT
@@ -16,17 +16,22 @@ 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
+
19
22
  # Attribute mapping from ruby-style variable name to JSON key.
20
23
  def self.attribute_map
21
24
  {
22
- :'description' => :'description'
25
+ :'description' => :'description',
26
+ :'key' => :'key'
23
27
  }
24
28
  end
25
29
 
26
30
  # Attribute type mapping.
27
31
  def self.swagger_types
28
32
  {
29
- :'description' => :'String'
33
+ :'description' => :'String',
34
+ :'key' => :'String'
30
35
  }
31
36
  end
32
37
 
@@ -41,6 +46,10 @@ module Flagr
41
46
  if attributes.has_key?(:'description')
42
47
  self.description = attributes[:'description']
43
48
  end
49
+
50
+ if attributes.has_key?(:'key')
51
+ self.key = attributes[:'key']
52
+ end
44
53
  end
45
54
 
46
55
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -85,7 +94,8 @@ module Flagr
85
94
  def ==(o)
86
95
  return true if self.equal?(o)
87
96
  self.class == o.class &&
88
- description == o.description
97
+ description == o.description &&
98
+ key == o.key
89
99
  end
90
100
 
91
101
  # @see the `==` method
@@ -97,7 +107,7 @@ module Flagr
97
107
  # Calculates hash code according to all attributes.
98
108
  # @return [Fixnum] Hash code
99
109
  def hash
100
- [description].hash
110
+ [description, key].hash
101
111
  end
102
112
 
103
113
  # Builds the object from hash
@@ -1,9 +1,9 @@
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.0.13
7
7
 
8
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
9
9
  Swagger Codegen version: 2.4.0-SNAPSHOT
@@ -1,9 +1,9 @@
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.0.13
7
7
 
8
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
9
9
  Swagger Codegen version: 2.4.0-SNAPSHOT
@@ -1,9 +1,9 @@
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.0.13
7
7
 
8
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
9
9
  Swagger Codegen version: 2.4.0-SNAPSHOT
@@ -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
@@ -1,9 +1,9 @@
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.0.13
7
7
 
8
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
9
9
  Swagger Codegen version: 2.4.0-SNAPSHOT
@@ -1,9 +1,9 @@
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.0.13
7
7
 
8
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
9
9
  Swagger Codegen version: 2.4.0-SNAPSHOT
@@ -23,8 +23,12 @@ 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
+
28
32
  # Attribute mapping from ruby-style variable name to JSON key.
29
33
  def self.attribute_map
30
34
  {
@@ -32,7 +36,8 @@ module Flagr
32
36
  :'entity_type' => :'entityType',
33
37
  :'entity_context' => :'entityContext',
34
38
  :'enable_debug' => :'enableDebug',
35
- :'flag_id' => :'flagID'
39
+ :'flag_id' => :'flagID',
40
+ :'flag_key' => :'flagKey'
36
41
  }
37
42
  end
38
43
 
@@ -43,7 +48,8 @@ module Flagr
43
48
  :'entity_type' => :'String',
44
49
  :'entity_context' => :'Object',
45
50
  :'enable_debug' => :'BOOLEAN',
46
- :'flag_id' => :'Integer'
51
+ :'flag_id' => :'Integer',
52
+ :'flag_key' => :'String'
47
53
  }
48
54
  end
49
55
 
@@ -74,25 +80,17 @@ module Flagr
74
80
  if attributes.has_key?(:'flagID')
75
81
  self.flag_id = attributes[:'flagID']
76
82
  end
83
+
84
+ if attributes.has_key?(:'flagKey')
85
+ self.flag_key = attributes[:'flagKey']
86
+ end
77
87
  end
78
88
 
79
89
  # Show invalid properties with the reasons. Usually used together with valid?
80
90
  # @return Array for valid properties with the reasons
81
91
  def list_invalid_properties
82
92
  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
93
+ if !@flag_id.nil? && @flag_id < 1
96
94
  invalid_properties.push('invalid value for "flag_id", must be greater than or equal to 1.')
97
95
  end
98
96
 
@@ -102,35 +100,14 @@ module Flagr
102
100
  # Check to see if the all the properties in the model are valid
103
101
  # @return true if the model is valid
104
102
  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
103
+ return false if !@flag_id.nil? && @flag_id < 1
109
104
  true
110
105
  end
111
106
 
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
107
  # Custom attribute writer method with validation
127
108
  # @param [Object] flag_id Value to be assigned
128
109
  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
110
+ if !flag_id.nil? && flag_id < 1
134
111
  fail ArgumentError, 'invalid value for "flag_id", must be greater than or equal to 1.'
135
112
  end
136
113
 
@@ -146,7 +123,8 @@ module Flagr
146
123
  entity_type == o.entity_type &&
147
124
  entity_context == o.entity_context &&
148
125
  enable_debug == o.enable_debug &&
149
- flag_id == o.flag_id
126
+ flag_id == o.flag_id &&
127
+ flag_key == o.flag_key
150
128
  end
151
129
 
152
130
  # @see the `==` method
@@ -158,7 +136,7 @@ module Flagr
158
136
  # Calculates hash code according to all attributes.
159
137
  # @return [Fixnum] Hash code
160
138
  def hash
161
- [entity_id, entity_type, entity_context, enable_debug, flag_id].hash
139
+ [entity_id, entity_type, entity_context, enable_debug, flag_id, flag_key].hash
162
140
  end
163
141
 
164
142
  # Builds the object from hash