rbflagr 0.1.2
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.
- checksums.yaml +7 -0
- data/Gemfile +7 -0
- data/Makefile +9 -0
- data/README.md +143 -0
- data/Rakefile +8 -0
- data/docs/Constraint.md +11 -0
- data/docs/ConstraintApi.md +211 -0
- data/docs/CreateConstraintRequest.md +10 -0
- data/docs/CreateFlagRequest.md +8 -0
- data/docs/CreateSegmentRequest.md +9 -0
- data/docs/CreateVariantRequest.md +9 -0
- data/docs/Distribution.md +12 -0
- data/docs/DistributionApi.md +109 -0
- data/docs/Error.md +8 -0
- data/docs/EvalContext.md +12 -0
- data/docs/EvalDebugLog.md +9 -0
- data/docs/EvalResult.md +16 -0
- data/docs/EvaluationApi.md +98 -0
- data/docs/EvaluationBatchRequest.md +10 -0
- data/docs/EvaluationBatchResponse.md +8 -0
- data/docs/EvaluationEntity.md +10 -0
- data/docs/Flag.md +13 -0
- data/docs/FlagApi.md +337 -0
- data/docs/FlagSnapshot.md +11 -0
- data/docs/HealthApi.md +46 -0
- data/docs/PutDistributionsRequest.md +8 -0
- data/docs/PutFlagRequest.md +9 -0
- data/docs/PutSegmentReorderRequest.md +8 -0
- data/docs/PutSegmentRequest.md +9 -0
- data/docs/PutVariantRequest.md +9 -0
- data/docs/Segment.md +13 -0
- data/docs/SegmentApi.md +246 -0
- data/docs/SegmentDebugLog.md +9 -0
- data/docs/SetFlagEnabledRequest.md +8 -0
- data/docs/Variant.md +10 -0
- data/docs/VariantApi.md +199 -0
- data/git_push.sh +55 -0
- data/lib/rbflagr.rb +70 -0
- data/lib/rbflagr/api/constraint_api.rb +310 -0
- data/lib/rbflagr/api/distribution_api.rb +159 -0
- data/lib/rbflagr/api/evaluation_api.rb +123 -0
- data/lib/rbflagr/api/flag_api.rb +413 -0
- data/lib/rbflagr/api/health_api.rb +66 -0
- data/lib/rbflagr/api/segment_api.rb +329 -0
- data/lib/rbflagr/api/variant_api.rb +270 -0
- data/lib/rbflagr/api_client.rb +388 -0
- data/lib/rbflagr/api_error.rb +38 -0
- data/lib/rbflagr/configuration.rb +202 -0
- data/lib/rbflagr/models/constraint.rb +317 -0
- data/lib/rbflagr/models/create_constraint_request.rb +273 -0
- data/lib/rbflagr/models/create_flag_request.rb +207 -0
- data/lib/rbflagr/models/create_segment_request.rb +249 -0
- data/lib/rbflagr/models/create_variant_request.rb +216 -0
- data/lib/rbflagr/models/distribution.rb +330 -0
- data/lib/rbflagr/models/error.rb +207 -0
- data/lib/rbflagr/models/eval_context.rb +268 -0
- data/lib/rbflagr/models/eval_debug_log.rb +194 -0
- data/lib/rbflagr/models/eval_result.rb +385 -0
- data/lib/rbflagr/models/evaluation_batch_request.rb +215 -0
- data/lib/rbflagr/models/evaluation_batch_response.rb +190 -0
- data/lib/rbflagr/models/evaluation_entity.rb +225 -0
- data/lib/rbflagr/models/flag.rb +282 -0
- data/lib/rbflagr/models/flag_snapshot.rb +263 -0
- data/lib/rbflagr/models/put_distributions_request.rb +190 -0
- data/lib/rbflagr/models/put_flag_request.rb +217 -0
- data/lib/rbflagr/models/put_segment_reorder_request.rb +190 -0
- data/lib/rbflagr/models/put_segment_request.rb +249 -0
- data/lib/rbflagr/models/put_variant_request.rb +221 -0
- data/lib/rbflagr/models/segment.rb +328 -0
- data/lib/rbflagr/models/segment_debug_log.rb +207 -0
- data/lib/rbflagr/models/set_flag_enabled_request.rb +188 -0
- data/lib/rbflagr/models/variant.rb +240 -0
- data/lib/rbflagr/version.rb +15 -0
- data/rbflagr.gemspec +45 -0
- data/spec/api/constraint_api_spec.rb +91 -0
- data/spec/api/distribution_api_spec.rb +62 -0
- data/spec/api/evaluation_api_spec.rb +47 -0
- data/spec/api/flag_api_spec.rb +108 -0
- data/spec/api/health_api_spec.rb +44 -0
- data/spec/api/segment_api_spec.rb +87 -0
- data/spec/api/variant_api_spec.rb +87 -0
- data/spec/api_client_spec.rb +226 -0
- data/spec/configuration_spec.rb +42 -0
- data/spec/models/constraint_spec.rb +64 -0
- data/spec/models/create_constraint_request_spec.rb +54 -0
- data/spec/models/create_flag_request_spec.rb +42 -0
- data/spec/models/create_segment_request_spec.rb +48 -0
- data/spec/models/create_variant_request_spec.rb +48 -0
- data/spec/models/distribution_spec.rb +66 -0
- data/spec/models/error_spec.rb +42 -0
- data/spec/models/eval_context_spec.rb +66 -0
- data/spec/models/eval_debug_log_spec.rb +48 -0
- data/spec/models/eval_result_spec.rb +78 -0
- data/spec/models/evaluation_batch_request_spec.rb +54 -0
- data/spec/models/evaluation_batch_response_spec.rb +42 -0
- data/spec/models/evaluation_entity_spec.rb +54 -0
- data/spec/models/flag_snapshot_spec.rb +60 -0
- data/spec/models/flag_spec.rb +66 -0
- data/spec/models/put_distributions_request_spec.rb +42 -0
- data/spec/models/put_flag_request_spec.rb +42 -0
- data/spec/models/put_segment_reorder_request_spec.rb +42 -0
- data/spec/models/put_segment_request_spec.rb +48 -0
- data/spec/models/put_variant_request_spec.rb +48 -0
- data/spec/models/segment_debug_log_spec.rb +48 -0
- data/spec/models/segment_spec.rb +72 -0
- data/spec/models/set_flag_enabled_request_spec.rb +42 -0
- data/spec/models/variant_spec.rb +54 -0
- data/spec/spec_helper.rb +111 -0
- data/swagger.yaml +1135 -0
- data/swagger_ruby.json +6 -0
- data/tags +618 -0
- metadata +362 -0
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# Flagr::FlagSnapshot
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
Name | Type | Description | Notes
|
|
5
|
+
------------ | ------------- | ------------- | -------------
|
|
6
|
+
**id** | **Integer** | |
|
|
7
|
+
**updated_by** | **String** | | [optional]
|
|
8
|
+
**flag** | [**Flag**](Flag.md) | |
|
|
9
|
+
**updated_at** | **String** | |
|
|
10
|
+
|
|
11
|
+
|
data/docs/HealthApi.md
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# Flagr::HealthApi
|
|
2
|
+
|
|
3
|
+
All URIs are relative to *http://localhost/api/v1*
|
|
4
|
+
|
|
5
|
+
Method | HTTP request | Description
|
|
6
|
+
------------- | ------------- | -------------
|
|
7
|
+
[**health_get**](HealthApi.md#health_get) | **GET** /health |
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
# **health_get**
|
|
11
|
+
> health_get
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Example
|
|
16
|
+
```ruby
|
|
17
|
+
# load the gem
|
|
18
|
+
require 'rbflagr'
|
|
19
|
+
|
|
20
|
+
api_instance = Flagr::HealthApi.new
|
|
21
|
+
|
|
22
|
+
begin
|
|
23
|
+
api_instance.health_get
|
|
24
|
+
rescue Flagr::ApiError => e
|
|
25
|
+
puts "Exception when calling HealthApi->health_get: #{e}"
|
|
26
|
+
end
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
### Parameters
|
|
30
|
+
This endpoint does not need any parameter.
|
|
31
|
+
|
|
32
|
+
### Return type
|
|
33
|
+
|
|
34
|
+
nil (empty response body)
|
|
35
|
+
|
|
36
|
+
### Authorization
|
|
37
|
+
|
|
38
|
+
No authorization required
|
|
39
|
+
|
|
40
|
+
### HTTP request headers
|
|
41
|
+
|
|
42
|
+
- **Content-Type**: application/json
|
|
43
|
+
- **Accept**: application/json
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# Flagr::PutFlagRequest
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
Name | Type | Description | Notes
|
|
5
|
+
------------ | ------------- | ------------- | -------------
|
|
6
|
+
**description** | **String** | |
|
|
7
|
+
**data_records_enabled** | **BOOLEAN** | enabled data records will get data logging in the metrics pipeline, for example, kafka. | [optional]
|
|
8
|
+
|
|
9
|
+
|
data/docs/Segment.md
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# Flagr::Segment
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
Name | Type | Description | Notes
|
|
5
|
+
------------ | ------------- | ------------- | -------------
|
|
6
|
+
**id** | **Integer** | | [optional]
|
|
7
|
+
**description** | **String** | |
|
|
8
|
+
**constraints** | [**Array<Constraint>**](Constraint.md) | | [optional]
|
|
9
|
+
**distributions** | [**Array<Distribution>**](Distribution.md) | | [optional]
|
|
10
|
+
**rank** | **Integer** | |
|
|
11
|
+
**rollout_percent** | **Integer** | |
|
|
12
|
+
|
|
13
|
+
|
data/docs/SegmentApi.md
ADDED
|
@@ -0,0 +1,246 @@
|
|
|
1
|
+
# Flagr::SegmentApi
|
|
2
|
+
|
|
3
|
+
All URIs are relative to *http://localhost/api/v1*
|
|
4
|
+
|
|
5
|
+
Method | HTTP request | Description
|
|
6
|
+
------------- | ------------- | -------------
|
|
7
|
+
[**create_segment**](SegmentApi.md#create_segment) | **POST** /flags/{flagID}/segments |
|
|
8
|
+
[**delete_segment**](SegmentApi.md#delete_segment) | **DELETE** /flags/{flagID}/segments/{segmentID} |
|
|
9
|
+
[**find_segments**](SegmentApi.md#find_segments) | **GET** /flags/{flagID}/segments |
|
|
10
|
+
[**put_segment**](SegmentApi.md#put_segment) | **PUT** /flags/{flagID}/segments/{segmentID} |
|
|
11
|
+
[**put_segments_reorder**](SegmentApi.md#put_segments_reorder) | **PUT** /flags/{flagID}/segments/reorder |
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
# **create_segment**
|
|
15
|
+
> Segment create_segment(flag_id, body)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
### Example
|
|
20
|
+
```ruby
|
|
21
|
+
# load the gem
|
|
22
|
+
require 'rbflagr'
|
|
23
|
+
|
|
24
|
+
api_instance = Flagr::SegmentApi.new
|
|
25
|
+
|
|
26
|
+
flag_id = 789 # Integer | numeric ID of the flag to get
|
|
27
|
+
|
|
28
|
+
body = Flagr::CreateSegmentRequest.new # CreateSegmentRequest | create a segment under a flag
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
begin
|
|
32
|
+
result = api_instance.create_segment(flag_id, body)
|
|
33
|
+
p result
|
|
34
|
+
rescue Flagr::ApiError => e
|
|
35
|
+
puts "Exception when calling SegmentApi->create_segment: #{e}"
|
|
36
|
+
end
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
### Parameters
|
|
40
|
+
|
|
41
|
+
Name | Type | Description | Notes
|
|
42
|
+
------------- | ------------- | ------------- | -------------
|
|
43
|
+
**flag_id** | **Integer**| numeric ID of the flag to get |
|
|
44
|
+
**body** | [**CreateSegmentRequest**](CreateSegmentRequest.md)| create a segment under a flag |
|
|
45
|
+
|
|
46
|
+
### Return type
|
|
47
|
+
|
|
48
|
+
[**Segment**](Segment.md)
|
|
49
|
+
|
|
50
|
+
### Authorization
|
|
51
|
+
|
|
52
|
+
No authorization required
|
|
53
|
+
|
|
54
|
+
### HTTP request headers
|
|
55
|
+
|
|
56
|
+
- **Content-Type**: application/json
|
|
57
|
+
- **Accept**: application/json
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
# **delete_segment**
|
|
62
|
+
> delete_segment(flag_id, segment_id)
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
### Example
|
|
67
|
+
```ruby
|
|
68
|
+
# load the gem
|
|
69
|
+
require 'rbflagr'
|
|
70
|
+
|
|
71
|
+
api_instance = Flagr::SegmentApi.new
|
|
72
|
+
|
|
73
|
+
flag_id = 789 # Integer | numeric ID of the flag
|
|
74
|
+
|
|
75
|
+
segment_id = 789 # Integer | numeric ID of the segment
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
begin
|
|
79
|
+
api_instance.delete_segment(flag_id, segment_id)
|
|
80
|
+
rescue Flagr::ApiError => e
|
|
81
|
+
puts "Exception when calling SegmentApi->delete_segment: #{e}"
|
|
82
|
+
end
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
### Parameters
|
|
86
|
+
|
|
87
|
+
Name | Type | Description | Notes
|
|
88
|
+
------------- | ------------- | ------------- | -------------
|
|
89
|
+
**flag_id** | **Integer**| numeric ID of the flag |
|
|
90
|
+
**segment_id** | **Integer**| numeric ID of the segment |
|
|
91
|
+
|
|
92
|
+
### Return type
|
|
93
|
+
|
|
94
|
+
nil (empty response body)
|
|
95
|
+
|
|
96
|
+
### Authorization
|
|
97
|
+
|
|
98
|
+
No authorization required
|
|
99
|
+
|
|
100
|
+
### HTTP request headers
|
|
101
|
+
|
|
102
|
+
- **Content-Type**: application/json
|
|
103
|
+
- **Accept**: application/json
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
# **find_segments**
|
|
108
|
+
> Array<Segment> find_segments(flag_id)
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
### Example
|
|
113
|
+
```ruby
|
|
114
|
+
# load the gem
|
|
115
|
+
require 'rbflagr'
|
|
116
|
+
|
|
117
|
+
api_instance = Flagr::SegmentApi.new
|
|
118
|
+
|
|
119
|
+
flag_id = 789 # Integer | numeric ID of the flag to get
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
begin
|
|
123
|
+
result = api_instance.find_segments(flag_id)
|
|
124
|
+
p result
|
|
125
|
+
rescue Flagr::ApiError => e
|
|
126
|
+
puts "Exception when calling SegmentApi->find_segments: #{e}"
|
|
127
|
+
end
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
### Parameters
|
|
131
|
+
|
|
132
|
+
Name | Type | Description | Notes
|
|
133
|
+
------------- | ------------- | ------------- | -------------
|
|
134
|
+
**flag_id** | **Integer**| numeric ID of the flag to get |
|
|
135
|
+
|
|
136
|
+
### Return type
|
|
137
|
+
|
|
138
|
+
[**Array<Segment>**](Segment.md)
|
|
139
|
+
|
|
140
|
+
### Authorization
|
|
141
|
+
|
|
142
|
+
No authorization required
|
|
143
|
+
|
|
144
|
+
### HTTP request headers
|
|
145
|
+
|
|
146
|
+
- **Content-Type**: application/json
|
|
147
|
+
- **Accept**: application/json
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
# **put_segment**
|
|
152
|
+
> Segment put_segment(flag_id, segment_id, body)
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
|
|
156
|
+
### Example
|
|
157
|
+
```ruby
|
|
158
|
+
# load the gem
|
|
159
|
+
require 'rbflagr'
|
|
160
|
+
|
|
161
|
+
api_instance = Flagr::SegmentApi.new
|
|
162
|
+
|
|
163
|
+
flag_id = 789 # Integer | numeric ID of the flag
|
|
164
|
+
|
|
165
|
+
segment_id = 789 # Integer | numeric ID of the segment
|
|
166
|
+
|
|
167
|
+
body = Flagr::PutSegmentRequest.new # PutSegmentRequest | update a segment
|
|
168
|
+
|
|
169
|
+
|
|
170
|
+
begin
|
|
171
|
+
result = api_instance.put_segment(flag_id, segment_id, body)
|
|
172
|
+
p result
|
|
173
|
+
rescue Flagr::ApiError => e
|
|
174
|
+
puts "Exception when calling SegmentApi->put_segment: #{e}"
|
|
175
|
+
end
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
### Parameters
|
|
179
|
+
|
|
180
|
+
Name | Type | Description | Notes
|
|
181
|
+
------------- | ------------- | ------------- | -------------
|
|
182
|
+
**flag_id** | **Integer**| numeric ID of the flag |
|
|
183
|
+
**segment_id** | **Integer**| numeric ID of the segment |
|
|
184
|
+
**body** | [**PutSegmentRequest**](PutSegmentRequest.md)| update a segment |
|
|
185
|
+
|
|
186
|
+
### Return type
|
|
187
|
+
|
|
188
|
+
[**Segment**](Segment.md)
|
|
189
|
+
|
|
190
|
+
### Authorization
|
|
191
|
+
|
|
192
|
+
No authorization required
|
|
193
|
+
|
|
194
|
+
### HTTP request headers
|
|
195
|
+
|
|
196
|
+
- **Content-Type**: application/json
|
|
197
|
+
- **Accept**: application/json
|
|
198
|
+
|
|
199
|
+
|
|
200
|
+
|
|
201
|
+
# **put_segments_reorder**
|
|
202
|
+
> put_segments_reorder(flag_id, body)
|
|
203
|
+
|
|
204
|
+
|
|
205
|
+
|
|
206
|
+
### Example
|
|
207
|
+
```ruby
|
|
208
|
+
# load the gem
|
|
209
|
+
require 'rbflagr'
|
|
210
|
+
|
|
211
|
+
api_instance = Flagr::SegmentApi.new
|
|
212
|
+
|
|
213
|
+
flag_id = 789 # Integer | numeric ID of the flag
|
|
214
|
+
|
|
215
|
+
body = Flagr::PutSegmentReorderRequest.new # PutSegmentReorderRequest | reorder segments
|
|
216
|
+
|
|
217
|
+
|
|
218
|
+
begin
|
|
219
|
+
api_instance.put_segments_reorder(flag_id, body)
|
|
220
|
+
rescue Flagr::ApiError => e
|
|
221
|
+
puts "Exception when calling SegmentApi->put_segments_reorder: #{e}"
|
|
222
|
+
end
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
### Parameters
|
|
226
|
+
|
|
227
|
+
Name | Type | Description | Notes
|
|
228
|
+
------------- | ------------- | ------------- | -------------
|
|
229
|
+
**flag_id** | **Integer**| numeric ID of the flag |
|
|
230
|
+
**body** | [**PutSegmentReorderRequest**](PutSegmentReorderRequest.md)| reorder segments |
|
|
231
|
+
|
|
232
|
+
### Return type
|
|
233
|
+
|
|
234
|
+
nil (empty response body)
|
|
235
|
+
|
|
236
|
+
### Authorization
|
|
237
|
+
|
|
238
|
+
No authorization required
|
|
239
|
+
|
|
240
|
+
### HTTP request headers
|
|
241
|
+
|
|
242
|
+
- **Content-Type**: application/json
|
|
243
|
+
- **Accept**: application/json
|
|
244
|
+
|
|
245
|
+
|
|
246
|
+
|
data/docs/Variant.md
ADDED
data/docs/VariantApi.md
ADDED
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
# Flagr::VariantApi
|
|
2
|
+
|
|
3
|
+
All URIs are relative to *http://localhost/api/v1*
|
|
4
|
+
|
|
5
|
+
Method | HTTP request | Description
|
|
6
|
+
------------- | ------------- | -------------
|
|
7
|
+
[**create_variant**](VariantApi.md#create_variant) | **POST** /flags/{flagID}/variants |
|
|
8
|
+
[**delete_variant**](VariantApi.md#delete_variant) | **DELETE** /flags/{flagID}/variants/{variantID} |
|
|
9
|
+
[**find_variants**](VariantApi.md#find_variants) | **GET** /flags/{flagID}/variants |
|
|
10
|
+
[**put_variant**](VariantApi.md#put_variant) | **PUT** /flags/{flagID}/variants/{variantID} |
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
# **create_variant**
|
|
14
|
+
> Variant create_variant(flag_id, body)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
### Example
|
|
19
|
+
```ruby
|
|
20
|
+
# load the gem
|
|
21
|
+
require 'rbflagr'
|
|
22
|
+
|
|
23
|
+
api_instance = Flagr::VariantApi.new
|
|
24
|
+
|
|
25
|
+
flag_id = 789 # Integer | numeric ID of the flag
|
|
26
|
+
|
|
27
|
+
body = Flagr::CreateVariantRequest.new # CreateVariantRequest | create a variant
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
begin
|
|
31
|
+
result = api_instance.create_variant(flag_id, body)
|
|
32
|
+
p result
|
|
33
|
+
rescue Flagr::ApiError => e
|
|
34
|
+
puts "Exception when calling VariantApi->create_variant: #{e}"
|
|
35
|
+
end
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
### Parameters
|
|
39
|
+
|
|
40
|
+
Name | Type | Description | Notes
|
|
41
|
+
------------- | ------------- | ------------- | -------------
|
|
42
|
+
**flag_id** | **Integer**| numeric ID of the flag |
|
|
43
|
+
**body** | [**CreateVariantRequest**](CreateVariantRequest.md)| create a variant |
|
|
44
|
+
|
|
45
|
+
### Return type
|
|
46
|
+
|
|
47
|
+
[**Variant**](Variant.md)
|
|
48
|
+
|
|
49
|
+
### Authorization
|
|
50
|
+
|
|
51
|
+
No authorization required
|
|
52
|
+
|
|
53
|
+
### HTTP request headers
|
|
54
|
+
|
|
55
|
+
- **Content-Type**: application/json
|
|
56
|
+
- **Accept**: application/json
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
# **delete_variant**
|
|
61
|
+
> delete_variant(flag_id, variant_id)
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
### Example
|
|
66
|
+
```ruby
|
|
67
|
+
# load the gem
|
|
68
|
+
require 'rbflagr'
|
|
69
|
+
|
|
70
|
+
api_instance = Flagr::VariantApi.new
|
|
71
|
+
|
|
72
|
+
flag_id = 789 # Integer | numeric ID of the flag
|
|
73
|
+
|
|
74
|
+
variant_id = 789 # Integer | numeric ID of the variant
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
begin
|
|
78
|
+
api_instance.delete_variant(flag_id, variant_id)
|
|
79
|
+
rescue Flagr::ApiError => e
|
|
80
|
+
puts "Exception when calling VariantApi->delete_variant: #{e}"
|
|
81
|
+
end
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
### Parameters
|
|
85
|
+
|
|
86
|
+
Name | Type | Description | Notes
|
|
87
|
+
------------- | ------------- | ------------- | -------------
|
|
88
|
+
**flag_id** | **Integer**| numeric ID of the flag |
|
|
89
|
+
**variant_id** | **Integer**| numeric ID of the variant |
|
|
90
|
+
|
|
91
|
+
### Return type
|
|
92
|
+
|
|
93
|
+
nil (empty response body)
|
|
94
|
+
|
|
95
|
+
### Authorization
|
|
96
|
+
|
|
97
|
+
No authorization required
|
|
98
|
+
|
|
99
|
+
### HTTP request headers
|
|
100
|
+
|
|
101
|
+
- **Content-Type**: application/json
|
|
102
|
+
- **Accept**: application/json
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
# **find_variants**
|
|
107
|
+
> Array<Variant> find_variants(flag_id)
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
### Example
|
|
112
|
+
```ruby
|
|
113
|
+
# load the gem
|
|
114
|
+
require 'rbflagr'
|
|
115
|
+
|
|
116
|
+
api_instance = Flagr::VariantApi.new
|
|
117
|
+
|
|
118
|
+
flag_id = 789 # Integer | numeric ID of the flag
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
begin
|
|
122
|
+
result = api_instance.find_variants(flag_id)
|
|
123
|
+
p result
|
|
124
|
+
rescue Flagr::ApiError => e
|
|
125
|
+
puts "Exception when calling VariantApi->find_variants: #{e}"
|
|
126
|
+
end
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
### Parameters
|
|
130
|
+
|
|
131
|
+
Name | Type | Description | Notes
|
|
132
|
+
------------- | ------------- | ------------- | -------------
|
|
133
|
+
**flag_id** | **Integer**| numeric ID of the flag |
|
|
134
|
+
|
|
135
|
+
### Return type
|
|
136
|
+
|
|
137
|
+
[**Array<Variant>**](Variant.md)
|
|
138
|
+
|
|
139
|
+
### Authorization
|
|
140
|
+
|
|
141
|
+
No authorization required
|
|
142
|
+
|
|
143
|
+
### HTTP request headers
|
|
144
|
+
|
|
145
|
+
- **Content-Type**: application/json
|
|
146
|
+
- **Accept**: application/json
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
# **put_variant**
|
|
151
|
+
> Variant put_variant(flag_id, variant_id, body)
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
### Example
|
|
156
|
+
```ruby
|
|
157
|
+
# load the gem
|
|
158
|
+
require 'rbflagr'
|
|
159
|
+
|
|
160
|
+
api_instance = Flagr::VariantApi.new
|
|
161
|
+
|
|
162
|
+
flag_id = 789 # Integer | numeric ID of the flag
|
|
163
|
+
|
|
164
|
+
variant_id = 789 # Integer | numeric ID of the variant
|
|
165
|
+
|
|
166
|
+
body = Flagr::PutVariantRequest.new # PutVariantRequest | update a variant
|
|
167
|
+
|
|
168
|
+
|
|
169
|
+
begin
|
|
170
|
+
result = api_instance.put_variant(flag_id, variant_id, body)
|
|
171
|
+
p result
|
|
172
|
+
rescue Flagr::ApiError => e
|
|
173
|
+
puts "Exception when calling VariantApi->put_variant: #{e}"
|
|
174
|
+
end
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
### Parameters
|
|
178
|
+
|
|
179
|
+
Name | Type | Description | Notes
|
|
180
|
+
------------- | ------------- | ------------- | -------------
|
|
181
|
+
**flag_id** | **Integer**| numeric ID of the flag |
|
|
182
|
+
**variant_id** | **Integer**| numeric ID of the variant |
|
|
183
|
+
**body** | [**PutVariantRequest**](PutVariantRequest.md)| update a variant |
|
|
184
|
+
|
|
185
|
+
### Return type
|
|
186
|
+
|
|
187
|
+
[**Variant**](Variant.md)
|
|
188
|
+
|
|
189
|
+
### Authorization
|
|
190
|
+
|
|
191
|
+
No authorization required
|
|
192
|
+
|
|
193
|
+
### HTTP request headers
|
|
194
|
+
|
|
195
|
+
- **Content-Type**: application/json
|
|
196
|
+
- **Accept**: application/json
|
|
197
|
+
|
|
198
|
+
|
|
199
|
+
|