rbflagr 1.1.0 → 1.1.10

Sign up to get free protection for your applications and to get access to all the features.
Files changed (64) hide show
  1. checksums.yaml +5 -5
  2. data/Gemfile +1 -1
  3. data/README.md +14 -6
  4. data/docs/CreateFlagRequest.md +1 -0
  5. data/docs/CreateTagRequest.md +8 -0
  6. data/docs/EvalContext.md +1 -0
  7. data/docs/EvaluationBatchRequest.md +2 -1
  8. data/docs/ExportApi.md +54 -6
  9. data/docs/Flag.md +2 -0
  10. data/docs/FlagApi.md +2 -0
  11. data/docs/Health.md +8 -0
  12. data/docs/HealthApi.md +4 -3
  13. data/docs/PutFlagRequest.md +1 -0
  14. data/docs/Tag.md +9 -0
  15. data/docs/TagApi.md +198 -0
  16. data/lib/rbflagr.rb +6 -2
  17. data/lib/rbflagr/api/constraint_api.rb +2 -2
  18. data/lib/rbflagr/api/distribution_api.rb +2 -2
  19. data/lib/rbflagr/api/evaluation_api.rb +2 -2
  20. data/lib/rbflagr/api/export_api.rb +56 -7
  21. data/lib/rbflagr/api/flag_api.rb +5 -2
  22. data/lib/rbflagr/api/health_api.rb +8 -7
  23. data/lib/rbflagr/api/segment_api.rb +2 -2
  24. data/lib/rbflagr/api/tag_api.rb +253 -0
  25. data/lib/rbflagr/api/variant_api.rb +2 -2
  26. data/lib/rbflagr/api_client.rb +4 -2
  27. data/lib/rbflagr/api_error.rb +2 -2
  28. data/lib/rbflagr/configuration.rb +2 -2
  29. data/lib/rbflagr/models/constraint.rb +4 -3
  30. data/lib/rbflagr/models/create_constraint_request.rb +4 -3
  31. data/lib/rbflagr/models/create_flag_request.rb +18 -7
  32. data/lib/rbflagr/models/create_segment_request.rb +4 -3
  33. data/lib/rbflagr/models/create_tag_request.rb +208 -0
  34. data/lib/rbflagr/models/create_variant_request.rb +4 -3
  35. data/lib/rbflagr/models/distribution.rb +4 -3
  36. data/lib/rbflagr/models/error.rb +4 -3
  37. data/lib/rbflagr/models/eval_context.rb +20 -7
  38. data/lib/rbflagr/models/eval_debug_log.rb +4 -3
  39. data/lib/rbflagr/models/eval_result.rb +4 -3
  40. data/lib/rbflagr/models/evaluation_batch_request.rb +21 -8
  41. data/lib/rbflagr/models/evaluation_batch_response.rb +4 -3
  42. data/lib/rbflagr/models/evaluation_entity.rb +4 -3
  43. data/lib/rbflagr/models/flag.rb +26 -4
  44. data/lib/rbflagr/models/flag_snapshot.rb +4 -3
  45. data/lib/rbflagr/models/health.rb +184 -0
  46. data/lib/rbflagr/models/put_distributions_request.rb +4 -3
  47. data/lib/rbflagr/models/put_flag_request.rb +17 -7
  48. data/lib/rbflagr/models/put_segment_reorder_request.rb +4 -3
  49. data/lib/rbflagr/models/put_segment_request.rb +4 -3
  50. data/lib/rbflagr/models/put_variant_request.rb +4 -3
  51. data/lib/rbflagr/models/segment.rb +4 -3
  52. data/lib/rbflagr/models/segment_debug_log.rb +4 -3
  53. data/lib/rbflagr/models/set_flag_enabled_request.rb +4 -3
  54. data/lib/rbflagr/models/tag.rb +232 -0
  55. data/lib/rbflagr/models/variant.rb +4 -3
  56. data/lib/rbflagr/version.rb +3 -3
  57. data/rbflagr.gemspec +2 -2
  58. data/spec/api/tag_api_spec.rb +79 -0
  59. data/spec/models/create_tag_request_spec.rb +41 -0
  60. data/spec/models/health_spec.rb +41 -0
  61. data/spec/models/tag_spec.rb +47 -0
  62. data/swagger.yaml +201 -5
  63. data/swagger_ruby.json +1 -1
  64. metadata +28 -13
@@ -3,10 +3,10 @@
3
3
 
4
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.1.0
6
+ OpenAPI spec version: 1.1.10
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.14
10
10
 
11
11
  =end
12
12
 
@@ -88,7 +88,7 @@ module Flagr
88
88
  return nil unless attributes.is_a?(Hash)
89
89
  self.class.swagger_types.each_pair do |key, type|
90
90
  if type =~ /\AArray<(.*)>/i
91
- # check to ensure the input is an array given that the the attribute
91
+ # check to ensure the input is an array given that the attribute
92
92
  # is documented as an array but the input is not
93
93
  if attributes[self.class.attribute_map[key]].is_a?(Array)
94
94
  self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
@@ -184,5 +184,6 @@ module Flagr
184
184
  value
185
185
  end
186
186
  end
187
+
187
188
  end
188
189
  end
@@ -0,0 +1,232 @@
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.10
7
+
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.4.14
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module Flagr
16
+ class Tag
17
+ attr_accessor :id
18
+
19
+ attr_accessor :value
20
+
21
+ # Attribute mapping from ruby-style variable name to JSON key.
22
+ def self.attribute_map
23
+ {
24
+ :'id' => :'id',
25
+ :'value' => :'value'
26
+ }
27
+ end
28
+
29
+ # Attribute type mapping.
30
+ def self.swagger_types
31
+ {
32
+ :'id' => :'Integer',
33
+ :'value' => :'String'
34
+ }
35
+ end
36
+
37
+ # Initializes the object
38
+ # @param [Hash] attributes Model attributes in the form of hash
39
+ def initialize(attributes = {})
40
+ return unless attributes.is_a?(Hash)
41
+
42
+ # convert string to symbol for hash key
43
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
44
+
45
+ if attributes.has_key?(:'id')
46
+ self.id = attributes[:'id']
47
+ end
48
+
49
+ if attributes.has_key?(:'value')
50
+ self.value = attributes[:'value']
51
+ end
52
+ end
53
+
54
+ # Show invalid properties with the reasons. Usually used together with valid?
55
+ # @return Array for valid properties with the reasons
56
+ def list_invalid_properties
57
+ invalid_properties = Array.new
58
+ if !@id.nil? && @id < 1
59
+ invalid_properties.push('invalid value for "id", must be greater than or equal to 1.')
60
+ end
61
+
62
+ if @value.nil?
63
+ invalid_properties.push('invalid value for "value", value cannot be nil.')
64
+ end
65
+
66
+ if @value.to_s.length < 1
67
+ invalid_properties.push('invalid value for "value", the character length must be great than or equal to 1.')
68
+ end
69
+
70
+ invalid_properties
71
+ end
72
+
73
+ # Check to see if the all the properties in the model are valid
74
+ # @return true if the model is valid
75
+ def valid?
76
+ return false if !@id.nil? && @id < 1
77
+ return false if @value.nil?
78
+ return false if @value.to_s.length < 1
79
+ true
80
+ end
81
+
82
+ # Custom attribute writer method with validation
83
+ # @param [Object] id Value to be assigned
84
+ def id=(id)
85
+ if !id.nil? && id < 1
86
+ fail ArgumentError, 'invalid value for "id", must be greater than or equal to 1.'
87
+ end
88
+
89
+ @id = id
90
+ end
91
+
92
+ # Custom attribute writer method with validation
93
+ # @param [Object] value Value to be assigned
94
+ def value=(value)
95
+ if value.nil?
96
+ fail ArgumentError, 'value cannot be nil'
97
+ end
98
+
99
+ if value.to_s.length < 1
100
+ fail ArgumentError, 'invalid value for "value", the character length must be great than or equal to 1.'
101
+ end
102
+
103
+ @value = value
104
+ end
105
+
106
+ # Checks equality by comparing each attribute.
107
+ # @param [Object] Object to be compared
108
+ def ==(o)
109
+ return true if self.equal?(o)
110
+ self.class == o.class &&
111
+ id == o.id &&
112
+ value == o.value
113
+ end
114
+
115
+ # @see the `==` method
116
+ # @param [Object] Object to be compared
117
+ def eql?(o)
118
+ self == o
119
+ end
120
+
121
+ # Calculates hash code according to all attributes.
122
+ # @return [Fixnum] Hash code
123
+ def hash
124
+ [id, value].hash
125
+ end
126
+
127
+ # Builds the object from hash
128
+ # @param [Hash] attributes Model attributes in the form of hash
129
+ # @return [Object] Returns the model itself
130
+ def build_from_hash(attributes)
131
+ return nil unless attributes.is_a?(Hash)
132
+ self.class.swagger_types.each_pair do |key, type|
133
+ if type =~ /\AArray<(.*)>/i
134
+ # check to ensure the input is an array given that the attribute
135
+ # is documented as an array but the input is not
136
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
137
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
138
+ end
139
+ elsif !attributes[self.class.attribute_map[key]].nil?
140
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
141
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
142
+ end
143
+
144
+ self
145
+ end
146
+
147
+ # Deserializes the data based on type
148
+ # @param string type Data type
149
+ # @param string value Value to be deserialized
150
+ # @return [Object] Deserialized data
151
+ def _deserialize(type, value)
152
+ case type.to_sym
153
+ when :DateTime
154
+ DateTime.parse(value)
155
+ when :Date
156
+ Date.parse(value)
157
+ when :String
158
+ value.to_s
159
+ when :Integer
160
+ value.to_i
161
+ when :Float
162
+ value.to_f
163
+ when :BOOLEAN
164
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
165
+ true
166
+ else
167
+ false
168
+ end
169
+ when :Object
170
+ # generic object (usually a Hash), return directly
171
+ value
172
+ when /\AArray<(?<inner_type>.+)>\z/
173
+ inner_type = Regexp.last_match[:inner_type]
174
+ value.map { |v| _deserialize(inner_type, v) }
175
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
176
+ k_type = Regexp.last_match[:k_type]
177
+ v_type = Regexp.last_match[:v_type]
178
+ {}.tap do |hash|
179
+ value.each do |k, v|
180
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
181
+ end
182
+ end
183
+ else # model
184
+ temp_model = Flagr.const_get(type).new
185
+ temp_model.build_from_hash(value)
186
+ end
187
+ end
188
+
189
+ # Returns the string representation of the object
190
+ # @return [String] String presentation of the object
191
+ def to_s
192
+ to_hash.to_s
193
+ end
194
+
195
+ # to_body is an alias to to_hash (backward compatibility)
196
+ # @return [Hash] Returns the object in the form of hash
197
+ def to_body
198
+ to_hash
199
+ end
200
+
201
+ # Returns the object in the form of hash
202
+ # @return [Hash] Returns the object in the form of hash
203
+ def to_hash
204
+ hash = {}
205
+ self.class.attribute_map.each_pair do |attr, param|
206
+ value = self.send(attr)
207
+ next if value.nil?
208
+ hash[param] = _to_hash(value)
209
+ end
210
+ hash
211
+ end
212
+
213
+ # Outputs non-array value in the form of hash
214
+ # For object, use to_hash. Otherwise, just return the value
215
+ # @param [Object] value Any valid value
216
+ # @return [Hash] Returns the value in the form of hash
217
+ def _to_hash(value)
218
+ if value.is_a?(Array)
219
+ value.compact.map { |v| _to_hash(v) }
220
+ elsif value.is_a?(Hash)
221
+ {}.tap do |hash|
222
+ value.each { |k, v| hash[k] = _to_hash(v) }
223
+ end
224
+ elsif value.respond_to? :to_hash
225
+ value.to_hash
226
+ else
227
+ value
228
+ end
229
+ end
230
+
231
+ end
232
+ end
@@ -3,10 +3,10 @@
3
3
 
4
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.1.0
6
+ OpenAPI spec version: 1.1.10
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.14
10
10
 
11
11
  =end
12
12
 
@@ -140,7 +140,7 @@ module Flagr
140
140
  return nil unless attributes.is_a?(Hash)
141
141
  self.class.swagger_types.each_pair do |key, type|
142
142
  if type =~ /\AArray<(.*)>/i
143
- # check to ensure the input is an array given that the the attribute
143
+ # check to ensure the input is an array given that the attribute
144
144
  # is documented as an array but the input is not
145
145
  if attributes[self.class.attribute_map[key]].is_a?(Array)
146
146
  self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
@@ -236,5 +236,6 @@ module Flagr
236
236
  value
237
237
  end
238
238
  end
239
+
239
240
  end
240
241
  end
@@ -3,13 +3,13 @@
3
3
 
4
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.1.0
6
+ OpenAPI spec version: 1.1.10
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.14
10
10
 
11
11
  =end
12
12
 
13
13
  module Flagr
14
- VERSION = '1.1.0'
14
+ VERSION = '1.1.10'
15
15
  end
@@ -5,10 +5,10 @@
5
5
 
6
6
  #Flagr is a feature flagging, A/B testing and dynamic configuration microservice. The base path for all the APIs is \"/api/v1\".
7
7
 
8
- OpenAPI spec version: 1.1.0
8
+ OpenAPI spec version: 1.1.10
9
9
 
10
10
  Generated by: https://github.com/swagger-api/swagger-codegen.git
11
- Swagger Codegen version: 2.4.0-SNAPSHOT
11
+ Swagger Codegen version: 2.4.14
12
12
 
13
13
  =end
14
14
 
@@ -0,0 +1,79 @@
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.10
7
+
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.4.14
10
+
11
+ =end
12
+
13
+ require 'spec_helper'
14
+ require 'json'
15
+
16
+ # Unit tests for Flagr::TagApi
17
+ # Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen)
18
+ # Please update as you see appropriate
19
+ describe 'TagApi' do
20
+ before do
21
+ # run before each test
22
+ @instance = Flagr::TagApi.new
23
+ end
24
+
25
+ after do
26
+ # run after each test
27
+ end
28
+
29
+ describe 'test an instance of TagApi' do
30
+ it 'should create an instance of TagApi' do
31
+ expect(@instance).to be_instance_of(Flagr::TagApi)
32
+ end
33
+ end
34
+
35
+ # unit tests for create_tag
36
+ # @param flag_id numeric ID of the flag
37
+ # @param body create a tag
38
+ # @param [Hash] opts the optional parameters
39
+ # @return [Tag]
40
+ describe 'create_tag test' do
41
+ it 'should work' do
42
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
43
+ end
44
+ end
45
+
46
+ # unit tests for delete_tag
47
+ # @param flag_id numeric ID of the flag
48
+ # @param tag_id numeric ID of the tag
49
+ # @param [Hash] opts the optional parameters
50
+ # @return [nil]
51
+ describe 'delete_tag test' do
52
+ it 'should work' do
53
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
54
+ end
55
+ end
56
+
57
+ # unit tests for find_all_tags
58
+ # @param [Hash] opts the optional parameters
59
+ # @option opts [Integer] :limit the numbers of tags to return
60
+ # @option opts [Integer] :offset return tags given the offset, it should usually set together with limit
61
+ # @option opts [String] :value_like return tags partially matching given value
62
+ # @return [Array<Tag>]
63
+ describe 'find_all_tags test' do
64
+ it 'should work' do
65
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
66
+ end
67
+ end
68
+
69
+ # unit tests for find_tags
70
+ # @param flag_id numeric ID of the flag
71
+ # @param [Hash] opts the optional parameters
72
+ # @return [Array<Tag>]
73
+ describe 'find_tags test' do
74
+ it 'should work' do
75
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
76
+ end
77
+ end
78
+
79
+ end
@@ -0,0 +1,41 @@
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.10
7
+
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.4.14
10
+
11
+ =end
12
+
13
+ require 'spec_helper'
14
+ require 'json'
15
+ require 'date'
16
+
17
+ # Unit tests for Flagr::CreateTagRequest
18
+ # Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen)
19
+ # Please update as you see appropriate
20
+ describe 'CreateTagRequest' do
21
+ before do
22
+ # run before each test
23
+ @instance = Flagr::CreateTagRequest.new
24
+ end
25
+
26
+ after do
27
+ # run after each test
28
+ end
29
+
30
+ describe 'test an instance of CreateTagRequest' do
31
+ it 'should create an instance of CreateTagRequest' do
32
+ expect(@instance).to be_instance_of(Flagr::CreateTagRequest)
33
+ end
34
+ end
35
+ describe 'test attribute "value"' do
36
+ it 'should work' do
37
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
38
+ end
39
+ end
40
+
41
+ end
@@ -0,0 +1,41 @@
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.10
7
+
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.4.14
10
+
11
+ =end
12
+
13
+ require 'spec_helper'
14
+ require 'json'
15
+ require 'date'
16
+
17
+ # Unit tests for Flagr::Health
18
+ # Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen)
19
+ # Please update as you see appropriate
20
+ describe 'Health' do
21
+ before do
22
+ # run before each test
23
+ @instance = Flagr::Health.new
24
+ end
25
+
26
+ after do
27
+ # run after each test
28
+ end
29
+
30
+ describe 'test an instance of Health' do
31
+ it 'should create an instance of Health' do
32
+ expect(@instance).to be_instance_of(Flagr::Health)
33
+ end
34
+ end
35
+ describe 'test attribute "status"' do
36
+ it 'should work' do
37
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
38
+ end
39
+ end
40
+
41
+ end