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
@@ -0,0 +1,184 @@
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 Health
17
+ attr_accessor :status
18
+
19
+ # Attribute mapping from ruby-style variable name to JSON key.
20
+ def self.attribute_map
21
+ {
22
+ :'status' => :'status'
23
+ }
24
+ end
25
+
26
+ # Attribute type mapping.
27
+ def self.swagger_types
28
+ {
29
+ :'status' => :'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?(:'status')
42
+ self.status = attributes[:'status']
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
+ invalid_properties
51
+ end
52
+
53
+ # Check to see if the all the properties in the model are valid
54
+ # @return true if the model is valid
55
+ def valid?
56
+ true
57
+ end
58
+
59
+ # Checks equality by comparing each attribute.
60
+ # @param [Object] Object to be compared
61
+ def ==(o)
62
+ return true if self.equal?(o)
63
+ self.class == o.class &&
64
+ status == o.status
65
+ end
66
+
67
+ # @see the `==` method
68
+ # @param [Object] Object to be compared
69
+ def eql?(o)
70
+ self == o
71
+ end
72
+
73
+ # Calculates hash code according to all attributes.
74
+ # @return [Fixnum] Hash code
75
+ def hash
76
+ [status].hash
77
+ end
78
+
79
+ # Builds the object from hash
80
+ # @param [Hash] attributes Model attributes in the form of hash
81
+ # @return [Object] Returns the model itself
82
+ def build_from_hash(attributes)
83
+ return nil unless attributes.is_a?(Hash)
84
+ self.class.swagger_types.each_pair do |key, type|
85
+ if type =~ /\AArray<(.*)>/i
86
+ # check to ensure the input is an array given that the attribute
87
+ # is documented as an array but the input is not
88
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
89
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
90
+ end
91
+ elsif !attributes[self.class.attribute_map[key]].nil?
92
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
93
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
94
+ end
95
+
96
+ self
97
+ end
98
+
99
+ # Deserializes the data based on type
100
+ # @param string type Data type
101
+ # @param string value Value to be deserialized
102
+ # @return [Object] Deserialized data
103
+ def _deserialize(type, value)
104
+ case type.to_sym
105
+ when :DateTime
106
+ DateTime.parse(value)
107
+ when :Date
108
+ Date.parse(value)
109
+ when :String
110
+ value.to_s
111
+ when :Integer
112
+ value.to_i
113
+ when :Float
114
+ value.to_f
115
+ when :BOOLEAN
116
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
117
+ true
118
+ else
119
+ false
120
+ end
121
+ when :Object
122
+ # generic object (usually a Hash), return directly
123
+ value
124
+ when /\AArray<(?<inner_type>.+)>\z/
125
+ inner_type = Regexp.last_match[:inner_type]
126
+ value.map { |v| _deserialize(inner_type, v) }
127
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
128
+ k_type = Regexp.last_match[:k_type]
129
+ v_type = Regexp.last_match[:v_type]
130
+ {}.tap do |hash|
131
+ value.each do |k, v|
132
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
133
+ end
134
+ end
135
+ else # model
136
+ temp_model = Flagr.const_get(type).new
137
+ temp_model.build_from_hash(value)
138
+ end
139
+ end
140
+
141
+ # Returns the string representation of the object
142
+ # @return [String] String presentation of the object
143
+ def to_s
144
+ to_hash.to_s
145
+ end
146
+
147
+ # to_body is an alias to to_hash (backward compatibility)
148
+ # @return [Hash] Returns the object in the form of hash
149
+ def to_body
150
+ to_hash
151
+ end
152
+
153
+ # Returns the object in the form of hash
154
+ # @return [Hash] Returns the object in the form of hash
155
+ def to_hash
156
+ hash = {}
157
+ self.class.attribute_map.each_pair do |attr, param|
158
+ value = self.send(attr)
159
+ next if value.nil?
160
+ hash[param] = _to_hash(value)
161
+ end
162
+ hash
163
+ end
164
+
165
+ # Outputs non-array value in the form of hash
166
+ # For object, use to_hash. Otherwise, just return the value
167
+ # @param [Object] value Any valid value
168
+ # @return [Hash] Returns the value in the form of hash
169
+ def _to_hash(value)
170
+ if value.is_a?(Array)
171
+ value.compact.map { |v| _to_hash(v) }
172
+ elsif value.is_a?(Hash)
173
+ {}.tap do |hash|
174
+ value.each { |k, v| hash[k] = _to_hash(v) }
175
+ end
176
+ elsif value.respond_to? :to_hash
177
+ value.to_hash
178
+ else
179
+ value
180
+ end
181
+ end
182
+
183
+ end
184
+ 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
 
@@ -19,11 +19,24 @@ module Flagr
19
19
  # enabled data records will get data logging in the metrics pipeline, for example, kafka.
20
20
  attr_accessor :data_records_enabled
21
21
 
22
+ # it will overwrite entityType into evaluation logs if it's not empty
23
+ attr_accessor :entity_type
24
+
25
+ attr_accessor :enabled
26
+
27
+ attr_accessor :key
28
+
29
+ attr_accessor :notes
30
+
22
31
  # Attribute mapping from ruby-style variable name to JSON key.
23
32
  def self.attribute_map
24
33
  {
25
34
  :'description' => :'description',
26
- :'data_records_enabled' => :'dataRecordsEnabled'
35
+ :'data_records_enabled' => :'dataRecordsEnabled',
36
+ :'entity_type' => :'entityType',
37
+ :'enabled' => :'enabled',
38
+ :'key' => :'key',
39
+ :'notes' => :'notes'
27
40
  }
28
41
  end
29
42
 
@@ -31,7 +44,11 @@ module Flagr
31
44
  def self.swagger_types
32
45
  {
33
46
  :'description' => :'String',
34
- :'data_records_enabled' => :'BOOLEAN'
47
+ :'data_records_enabled' => :'BOOLEAN',
48
+ :'entity_type' => :'String',
49
+ :'enabled' => :'BOOLEAN',
50
+ :'key' => :'String',
51
+ :'notes' => :'String'
35
52
  }
36
53
  end
37
54
 
@@ -50,17 +67,29 @@ module Flagr
50
67
  if attributes.has_key?(:'dataRecordsEnabled')
51
68
  self.data_records_enabled = attributes[:'dataRecordsEnabled']
52
69
  end
70
+
71
+ if attributes.has_key?(:'entityType')
72
+ self.entity_type = attributes[:'entityType']
73
+ end
74
+
75
+ if attributes.has_key?(:'enabled')
76
+ self.enabled = attributes[:'enabled']
77
+ end
78
+
79
+ if attributes.has_key?(:'key')
80
+ self.key = attributes[:'key']
81
+ end
82
+
83
+ if attributes.has_key?(:'notes')
84
+ self.notes = attributes[:'notes']
85
+ end
53
86
  end
54
87
 
55
88
  # Show invalid properties with the reasons. Usually used together with valid?
56
89
  # @return Array for valid properties with the reasons
57
90
  def list_invalid_properties
58
91
  invalid_properties = Array.new
59
- if @description.nil?
60
- invalid_properties.push('invalid value for "description", description cannot be nil.')
61
- end
62
-
63
- if @description.to_s.length < 1
92
+ if !@description.nil? && @description.to_s.length < 1
64
93
  invalid_properties.push('invalid value for "description", the character length must be great than or equal to 1.')
65
94
  end
66
95
 
@@ -70,19 +99,14 @@ module Flagr
70
99
  # Check to see if the all the properties in the model are valid
71
100
  # @return true if the model is valid
72
101
  def valid?
73
- return false if @description.nil?
74
- return false if @description.to_s.length < 1
102
+ return false if !@description.nil? && @description.to_s.length < 1
75
103
  true
76
104
  end
77
105
 
78
106
  # Custom attribute writer method with validation
79
107
  # @param [Object] description Value to be assigned
80
108
  def description=(description)
81
- if description.nil?
82
- fail ArgumentError, 'description cannot be nil'
83
- end
84
-
85
- if description.to_s.length < 1
109
+ if !description.nil? && description.to_s.length < 1
86
110
  fail ArgumentError, 'invalid value for "description", the character length must be great than or equal to 1.'
87
111
  end
88
112
 
@@ -95,7 +119,11 @@ module Flagr
95
119
  return true if self.equal?(o)
96
120
  self.class == o.class &&
97
121
  description == o.description &&
98
- data_records_enabled == o.data_records_enabled
122
+ data_records_enabled == o.data_records_enabled &&
123
+ entity_type == o.entity_type &&
124
+ enabled == o.enabled &&
125
+ key == o.key &&
126
+ notes == o.notes
99
127
  end
100
128
 
101
129
  # @see the `==` method
@@ -107,7 +135,7 @@ module Flagr
107
135
  # Calculates hash code according to all attributes.
108
136
  # @return [Fixnum] Hash code
109
137
  def hash
110
- [description, data_records_enabled].hash
138
+ [description, data_records_enabled, entity_type, enabled, key, notes].hash
111
139
  end
112
140
 
113
141
  # Builds the object from hash
@@ -117,7 +145,7 @@ module Flagr
117
145
  return nil unless attributes.is_a?(Hash)
118
146
  self.class.swagger_types.each_pair do |key, type|
119
147
  if type =~ /\AArray<(.*)>/i
120
- # check to ensure the input is an array given that the the attribute
148
+ # check to ensure the input is an array given that the attribute
121
149
  # is documented as an array but the input is not
122
150
  if attributes[self.class.attribute_map[key]].is_a?(Array)
123
151
  self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
@@ -213,5 +241,6 @@ module Flagr
213
241
  value
214
242
  end
215
243
  end
244
+
216
245
  end
217
246
  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
 
@@ -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
@@ -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,10 +63,6 @@ module Flagr
63
63
  invalid_properties.push('invalid value for "key", the character length must be great than or equal to 1.')
64
64
  end
65
65
 
66
- if @attachment.nil?
67
- invalid_properties.push('invalid value for "attachment", attachment cannot be nil.')
68
- end
69
-
70
66
  invalid_properties
71
67
  end
72
68
 
@@ -75,7 +71,6 @@ module Flagr
75
71
  def valid?
76
72
  return false if @key.nil?
77
73
  return false if @key.to_s.length < 1
78
- return false if @attachment.nil?
79
74
  true
80
75
  end
81
76
 
@@ -121,7 +116,7 @@ module Flagr
121
116
  return nil unless attributes.is_a?(Hash)
122
117
  self.class.swagger_types.each_pair do |key, type|
123
118
  if type =~ /\AArray<(.*)>/i
124
- # 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
125
120
  # is documented as an array but the input is not
126
121
  if attributes[self.class.attribute_map[key]].is_a?(Array)
127
122
  self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
@@ -217,5 +212,6 @@ module Flagr
217
212
  value
218
213
  end
219
214
  end
215
+
220
216
  end
221
217
  end