rbflagr 0.1.2 → 1.1.12

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 (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
 
@@ -18,14 +18,23 @@ module Flagr
18
18
 
19
19
  attr_accessor :enable_debug
20
20
 
21
+ # flagIDs
21
22
  attr_accessor :flag_i_ds
22
23
 
24
+ # flagKeys. Either flagIDs, flagKeys or flagTags works. If pass in multiples, Flagr may return duplicate results.
25
+ attr_accessor :flag_keys
26
+
27
+ # flagTags. Either flagIDs, flagKeys or flagTags works. If pass in multiples, Flagr may return duplicate results.
28
+ attr_accessor :flag_tags
29
+
23
30
  # Attribute mapping from ruby-style variable name to JSON key.
24
31
  def self.attribute_map
25
32
  {
26
33
  :'entities' => :'entities',
27
34
  :'enable_debug' => :'enableDebug',
28
- :'flag_i_ds' => :'flagIDs'
35
+ :'flag_i_ds' => :'flagIDs',
36
+ :'flag_keys' => :'flagKeys',
37
+ :'flag_tags' => :'flagTags'
29
38
  }
30
39
  end
31
40
 
@@ -34,7 +43,9 @@ module Flagr
34
43
  {
35
44
  :'entities' => :'Array<EvaluationEntity>',
36
45
  :'enable_debug' => :'BOOLEAN',
37
- :'flag_i_ds' => :'Array<Integer>'
46
+ :'flag_i_ds' => :'Array<Integer>',
47
+ :'flag_keys' => :'Array<String>',
48
+ :'flag_tags' => :'Array<String>'
38
49
  }
39
50
  end
40
51
 
@@ -61,6 +72,18 @@ module Flagr
61
72
  self.flag_i_ds = value
62
73
  end
63
74
  end
75
+
76
+ if attributes.has_key?(:'flagKeys')
77
+ if (value = attributes[:'flagKeys']).is_a?(Array)
78
+ self.flag_keys = value
79
+ end
80
+ end
81
+
82
+ if attributes.has_key?(:'flagTags')
83
+ if (value = attributes[:'flagTags']).is_a?(Array)
84
+ self.flag_tags = value
85
+ end
86
+ end
64
87
  end
65
88
 
66
89
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -71,10 +94,6 @@ module Flagr
71
94
  invalid_properties.push('invalid value for "entities", entities cannot be nil.')
72
95
  end
73
96
 
74
- if @flag_i_ds.nil?
75
- invalid_properties.push('invalid value for "flag_i_ds", flag_i_ds cannot be nil.')
76
- end
77
-
78
97
  invalid_properties
79
98
  end
80
99
 
@@ -82,7 +101,6 @@ module Flagr
82
101
  # @return true if the model is valid
83
102
  def valid?
84
103
  return false if @entities.nil?
85
- return false if @flag_i_ds.nil?
86
104
  true
87
105
  end
88
106
 
@@ -93,7 +111,9 @@ module Flagr
93
111
  self.class == o.class &&
94
112
  entities == o.entities &&
95
113
  enable_debug == o.enable_debug &&
96
- flag_i_ds == o.flag_i_ds
114
+ flag_i_ds == o.flag_i_ds &&
115
+ flag_keys == o.flag_keys &&
116
+ flag_tags == o.flag_tags
97
117
  end
98
118
 
99
119
  # @see the `==` method
@@ -105,7 +125,7 @@ module Flagr
105
125
  # Calculates hash code according to all attributes.
106
126
  # @return [Fixnum] Hash code
107
127
  def hash
108
- [entities, enable_debug, flag_i_ds].hash
128
+ [entities, enable_debug, flag_i_ds, flag_keys, flag_tags].hash
109
129
  end
110
130
 
111
131
  # Builds the object from hash
@@ -115,7 +135,7 @@ module Flagr
115
135
  return nil unless attributes.is_a?(Hash)
116
136
  self.class.swagger_types.each_pair do |key, type|
117
137
  if type =~ /\AArray<(.*)>/i
118
- # check to ensure the input is an array given that the the attribute
138
+ # check to ensure the input is an array given that the attribute
119
139
  # is documented as an array but the input is not
120
140
  if attributes[self.class.attribute_map[key]].is_a?(Array)
121
141
  self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
@@ -211,5 +231,6 @@ module Flagr
211
231
  value
212
232
  end
213
233
  end
234
+
214
235
  end
215
236
  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
 
@@ -90,7 +90,7 @@ module Flagr
90
90
  return nil unless attributes.is_a?(Hash)
91
91
  self.class.swagger_types.each_pair do |key, type|
92
92
  if type =~ /\AArray<(.*)>/i
93
- # check to ensure the input is an array given that the the attribute
93
+ # check to ensure the input is an array given that the attribute
94
94
  # is documented as an array but the input is not
95
95
  if attributes[self.class.attribute_map[key]].is_a?(Array)
96
96
  self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
@@ -186,5 +186,6 @@ module Flagr
186
186
  value
187
187
  end
188
188
  end
189
+
189
190
  end
190
191
  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
 
@@ -63,39 +63,15 @@ module Flagr
63
63
  # @return Array for valid properties with the reasons
64
64
  def list_invalid_properties
65
65
  invalid_properties = Array.new
66
- if @entity_type.nil?
67
- invalid_properties.push('invalid value for "entity_type", entity_type cannot be nil.')
68
- end
69
-
70
- if @entity_type.to_s.length < 1
71
- invalid_properties.push('invalid value for "entity_type", the character length must be great than or equal to 1.')
72
- end
73
-
74
66
  invalid_properties
75
67
  end
76
68
 
77
69
  # Check to see if the all the properties in the model are valid
78
70
  # @return true if the model is valid
79
71
  def valid?
80
- return false if @entity_type.nil?
81
- return false if @entity_type.to_s.length < 1
82
72
  true
83
73
  end
84
74
 
85
- # Custom attribute writer method with validation
86
- # @param [Object] entity_type Value to be assigned
87
- def entity_type=(entity_type)
88
- if entity_type.nil?
89
- fail ArgumentError, 'entity_type cannot be nil'
90
- end
91
-
92
- if entity_type.to_s.length < 1
93
- fail ArgumentError, 'invalid value for "entity_type", the character length must be great than or equal to 1.'
94
- end
95
-
96
- @entity_type = entity_type
97
- end
98
-
99
75
  # Checks equality by comparing each attribute.
100
76
  # @param [Object] Object to be compared
101
77
  def ==(o)
@@ -125,7 +101,7 @@ module Flagr
125
101
  return nil unless attributes.is_a?(Hash)
126
102
  self.class.swagger_types.each_pair do |key, type|
127
103
  if type =~ /\AArray<(.*)>/i
128
- # check to ensure the input is an array given that the the attribute
104
+ # check to ensure the input is an array given that the attribute
129
105
  # is documented as an array but the input is not
130
106
  if attributes[self.class.attribute_map[key]].is_a?(Array)
131
107
  self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
@@ -221,5 +197,6 @@ module Flagr
221
197
  value
222
198
  end
223
199
  end
200
+
224
201
  end
225
202
  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,10 +16,15 @@ module Flagr
16
16
  class Flag
17
17
  attr_accessor :id
18
18
 
19
+ # unique key representation of the flag
20
+ attr_accessor :key
21
+
19
22
  attr_accessor :description
20
23
 
21
24
  attr_accessor :enabled
22
25
 
26
+ attr_accessor :tags
27
+
23
28
  attr_accessor :segments
24
29
 
25
30
  attr_accessor :variants
@@ -27,15 +32,34 @@ module Flagr
27
32
  # enabled data records will get data logging in the metrics pipeline, for example, kafka.
28
33
  attr_accessor :data_records_enabled
29
34
 
35
+ # it will override the entityType in the evaluation logs if it's not empty
36
+ attr_accessor :entity_type
37
+
38
+ # flag usage details in markdown format
39
+ attr_accessor :notes
40
+
41
+ attr_accessor :created_by
42
+
43
+ attr_accessor :updated_by
44
+
45
+ attr_accessor :updated_at
46
+
30
47
  # Attribute mapping from ruby-style variable name to JSON key.
31
48
  def self.attribute_map
32
49
  {
33
50
  :'id' => :'id',
51
+ :'key' => :'key',
34
52
  :'description' => :'description',
35
53
  :'enabled' => :'enabled',
54
+ :'tags' => :'tags',
36
55
  :'segments' => :'segments',
37
56
  :'variants' => :'variants',
38
- :'data_records_enabled' => :'dataRecordsEnabled'
57
+ :'data_records_enabled' => :'dataRecordsEnabled',
58
+ :'entity_type' => :'entityType',
59
+ :'notes' => :'notes',
60
+ :'created_by' => :'createdBy',
61
+ :'updated_by' => :'updatedBy',
62
+ :'updated_at' => :'updatedAt'
39
63
  }
40
64
  end
41
65
 
@@ -43,11 +67,18 @@ module Flagr
43
67
  def self.swagger_types
44
68
  {
45
69
  :'id' => :'Integer',
70
+ :'key' => :'String',
46
71
  :'description' => :'String',
47
72
  :'enabled' => :'BOOLEAN',
73
+ :'tags' => :'Array<Tag>',
48
74
  :'segments' => :'Array<Segment>',
49
75
  :'variants' => :'Array<Variant>',
50
- :'data_records_enabled' => :'BOOLEAN'
76
+ :'data_records_enabled' => :'BOOLEAN',
77
+ :'entity_type' => :'String',
78
+ :'notes' => :'String',
79
+ :'created_by' => :'String',
80
+ :'updated_by' => :'String',
81
+ :'updated_at' => :'DateTime'
51
82
  }
52
83
  end
53
84
 
@@ -63,6 +94,10 @@ module Flagr
63
94
  self.id = attributes[:'id']
64
95
  end
65
96
 
97
+ if attributes.has_key?(:'key')
98
+ self.key = attributes[:'key']
99
+ end
100
+
66
101
  if attributes.has_key?(:'description')
67
102
  self.description = attributes[:'description']
68
103
  end
@@ -71,6 +106,12 @@ module Flagr
71
106
  self.enabled = attributes[:'enabled']
72
107
  end
73
108
 
109
+ if attributes.has_key?(:'tags')
110
+ if (value = attributes[:'tags']).is_a?(Array)
111
+ self.tags = value
112
+ end
113
+ end
114
+
74
115
  if attributes.has_key?(:'segments')
75
116
  if (value = attributes[:'segments']).is_a?(Array)
76
117
  self.segments = value
@@ -86,6 +127,26 @@ module Flagr
86
127
  if attributes.has_key?(:'dataRecordsEnabled')
87
128
  self.data_records_enabled = attributes[:'dataRecordsEnabled']
88
129
  end
130
+
131
+ if attributes.has_key?(:'entityType')
132
+ self.entity_type = attributes[:'entityType']
133
+ end
134
+
135
+ if attributes.has_key?(:'notes')
136
+ self.notes = attributes[:'notes']
137
+ end
138
+
139
+ if attributes.has_key?(:'createdBy')
140
+ self.created_by = attributes[:'createdBy']
141
+ end
142
+
143
+ if attributes.has_key?(:'updatedBy')
144
+ self.updated_by = attributes[:'updatedBy']
145
+ end
146
+
147
+ if attributes.has_key?(:'updatedAt')
148
+ self.updated_at = attributes[:'updatedAt']
149
+ end
89
150
  end
90
151
 
91
152
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -96,6 +157,10 @@ module Flagr
96
157
  invalid_properties.push('invalid value for "id", must be greater than or equal to 1.')
97
158
  end
98
159
 
160
+ if !@key.nil? && @key.to_s.length < 1
161
+ invalid_properties.push('invalid value for "key", the character length must be great than or equal to 1.')
162
+ end
163
+
99
164
  if @description.nil?
100
165
  invalid_properties.push('invalid value for "description", description cannot be nil.')
101
166
  end
@@ -119,6 +184,7 @@ module Flagr
119
184
  # @return true if the model is valid
120
185
  def valid?
121
186
  return false if !@id.nil? && @id < 1
187
+ return false if !@key.nil? && @key.to_s.length < 1
122
188
  return false if @description.nil?
123
189
  return false if @description.to_s.length < 1
124
190
  return false if @enabled.nil?
@@ -136,6 +202,16 @@ module Flagr
136
202
  @id = id
137
203
  end
138
204
 
205
+ # Custom attribute writer method with validation
206
+ # @param [Object] key Value to be assigned
207
+ def key=(key)
208
+ if !key.nil? && key.to_s.length < 1
209
+ fail ArgumentError, 'invalid value for "key", the character length must be great than or equal to 1.'
210
+ end
211
+
212
+ @key = key
213
+ end
214
+
139
215
  # Custom attribute writer method with validation
140
216
  # @param [Object] description Value to be assigned
141
217
  def description=(description)
@@ -156,11 +232,18 @@ module Flagr
156
232
  return true if self.equal?(o)
157
233
  self.class == o.class &&
158
234
  id == o.id &&
235
+ key == o.key &&
159
236
  description == o.description &&
160
237
  enabled == o.enabled &&
238
+ tags == o.tags &&
161
239
  segments == o.segments &&
162
240
  variants == o.variants &&
163
- data_records_enabled == o.data_records_enabled
241
+ data_records_enabled == o.data_records_enabled &&
242
+ entity_type == o.entity_type &&
243
+ notes == o.notes &&
244
+ created_by == o.created_by &&
245
+ updated_by == o.updated_by &&
246
+ updated_at == o.updated_at
164
247
  end
165
248
 
166
249
  # @see the `==` method
@@ -172,7 +255,7 @@ module Flagr
172
255
  # Calculates hash code according to all attributes.
173
256
  # @return [Fixnum] Hash code
174
257
  def hash
175
- [id, description, enabled, segments, variants, data_records_enabled].hash
258
+ [id, key, description, enabled, tags, segments, variants, data_records_enabled, entity_type, notes, created_by, updated_by, updated_at].hash
176
259
  end
177
260
 
178
261
  # Builds the object from hash
@@ -182,7 +265,7 @@ module Flagr
182
265
  return nil unless attributes.is_a?(Hash)
183
266
  self.class.swagger_types.each_pair do |key, type|
184
267
  if type =~ /\AArray<(.*)>/i
185
- # check to ensure the input is an array given that the the attribute
268
+ # check to ensure the input is an array given that the attribute
186
269
  # is documented as an array but the input is not
187
270
  if attributes[self.class.attribute_map[key]].is_a?(Array)
188
271
  self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
@@ -278,5 +361,6 @@ module Flagr
278
361
  value
279
362
  end
280
363
  end
364
+
281
365
  end
282
366
  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
 
@@ -163,7 +163,7 @@ module Flagr
163
163
  return nil unless attributes.is_a?(Hash)
164
164
  self.class.swagger_types.each_pair do |key, type|
165
165
  if type =~ /\AArray<(.*)>/i
166
- # check to ensure the input is an array given that the the attribute
166
+ # check to ensure the input is an array given that the attribute
167
167
  # is documented as an array but the input is not
168
168
  if attributes[self.class.attribute_map[key]].is_a?(Array)
169
169
  self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
@@ -259,5 +259,6 @@ module Flagr
259
259
  value
260
260
  end
261
261
  end
262
+
262
263
  end
263
264
  end