rbflagr 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- 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,123 @@
|
|
1
|
+
=begin
|
2
|
+
#Flagr
|
3
|
+
|
4
|
+
#Flagr is a feature flagging, A/B testing and dynamic configuration microservice
|
5
|
+
|
6
|
+
OpenAPI spec version: 1.0.8
|
7
|
+
|
8
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
+
Swagger Codegen version: 2.4.0-SNAPSHOT
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'uri'
|
14
|
+
|
15
|
+
module Flagr
|
16
|
+
class EvaluationApi
|
17
|
+
attr_accessor :api_client
|
18
|
+
|
19
|
+
def initialize(api_client = ApiClient.default)
|
20
|
+
@api_client = api_client
|
21
|
+
end
|
22
|
+
# @param body evalution context
|
23
|
+
# @param [Hash] opts the optional parameters
|
24
|
+
# @return [EvalResult]
|
25
|
+
def post_evaluation(body, opts = {})
|
26
|
+
data, _status_code, _headers = post_evaluation_with_http_info(body, opts)
|
27
|
+
data
|
28
|
+
end
|
29
|
+
|
30
|
+
# @param body evalution context
|
31
|
+
# @param [Hash] opts the optional parameters
|
32
|
+
# @return [Array<(EvalResult, Fixnum, Hash)>] EvalResult data, response status code and response headers
|
33
|
+
def post_evaluation_with_http_info(body, opts = {})
|
34
|
+
if @api_client.config.debugging
|
35
|
+
@api_client.config.logger.debug 'Calling API: EvaluationApi.post_evaluation ...'
|
36
|
+
end
|
37
|
+
# verify the required parameter 'body' is set
|
38
|
+
if @api_client.config.client_side_validation && body.nil?
|
39
|
+
fail ArgumentError, "Missing the required parameter 'body' when calling EvaluationApi.post_evaluation"
|
40
|
+
end
|
41
|
+
# resource path
|
42
|
+
local_var_path = '/evaluation'
|
43
|
+
|
44
|
+
# query parameters
|
45
|
+
query_params = {}
|
46
|
+
|
47
|
+
# header parameters
|
48
|
+
header_params = {}
|
49
|
+
# HTTP header 'Accept' (if needed)
|
50
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
51
|
+
# HTTP header 'Content-Type'
|
52
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
53
|
+
|
54
|
+
# form parameters
|
55
|
+
form_params = {}
|
56
|
+
|
57
|
+
# http body (model)
|
58
|
+
post_body = @api_client.object_to_http_body(body)
|
59
|
+
auth_names = []
|
60
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
61
|
+
:header_params => header_params,
|
62
|
+
:query_params => query_params,
|
63
|
+
:form_params => form_params,
|
64
|
+
:body => post_body,
|
65
|
+
:auth_names => auth_names,
|
66
|
+
:return_type => 'EvalResult')
|
67
|
+
if @api_client.config.debugging
|
68
|
+
@api_client.config.logger.debug "API called: EvaluationApi#post_evaluation\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
69
|
+
end
|
70
|
+
return data, status_code, headers
|
71
|
+
end
|
72
|
+
# @param body evalution batch request
|
73
|
+
# @param [Hash] opts the optional parameters
|
74
|
+
# @return [EvaluationBatchResponse]
|
75
|
+
def post_evaluation_batch(body, opts = {})
|
76
|
+
data, _status_code, _headers = post_evaluation_batch_with_http_info(body, opts)
|
77
|
+
data
|
78
|
+
end
|
79
|
+
|
80
|
+
# @param body evalution batch request
|
81
|
+
# @param [Hash] opts the optional parameters
|
82
|
+
# @return [Array<(EvaluationBatchResponse, Fixnum, Hash)>] EvaluationBatchResponse data, response status code and response headers
|
83
|
+
def post_evaluation_batch_with_http_info(body, opts = {})
|
84
|
+
if @api_client.config.debugging
|
85
|
+
@api_client.config.logger.debug 'Calling API: EvaluationApi.post_evaluation_batch ...'
|
86
|
+
end
|
87
|
+
# verify the required parameter 'body' is set
|
88
|
+
if @api_client.config.client_side_validation && body.nil?
|
89
|
+
fail ArgumentError, "Missing the required parameter 'body' when calling EvaluationApi.post_evaluation_batch"
|
90
|
+
end
|
91
|
+
# resource path
|
92
|
+
local_var_path = '/evaluation/batch'
|
93
|
+
|
94
|
+
# query parameters
|
95
|
+
query_params = {}
|
96
|
+
|
97
|
+
# header parameters
|
98
|
+
header_params = {}
|
99
|
+
# HTTP header 'Accept' (if needed)
|
100
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
101
|
+
# HTTP header 'Content-Type'
|
102
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
103
|
+
|
104
|
+
# form parameters
|
105
|
+
form_params = {}
|
106
|
+
|
107
|
+
# http body (model)
|
108
|
+
post_body = @api_client.object_to_http_body(body)
|
109
|
+
auth_names = []
|
110
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
111
|
+
:header_params => header_params,
|
112
|
+
:query_params => query_params,
|
113
|
+
:form_params => form_params,
|
114
|
+
:body => post_body,
|
115
|
+
:auth_names => auth_names,
|
116
|
+
:return_type => 'EvaluationBatchResponse')
|
117
|
+
if @api_client.config.debugging
|
118
|
+
@api_client.config.logger.debug "API called: EvaluationApi#post_evaluation_batch\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
119
|
+
end
|
120
|
+
return data, status_code, headers
|
121
|
+
end
|
122
|
+
end
|
123
|
+
end
|
@@ -0,0 +1,413 @@
|
|
1
|
+
=begin
|
2
|
+
#Flagr
|
3
|
+
|
4
|
+
#Flagr is a feature flagging, A/B testing and dynamic configuration microservice
|
5
|
+
|
6
|
+
OpenAPI spec version: 1.0.8
|
7
|
+
|
8
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
+
Swagger Codegen version: 2.4.0-SNAPSHOT
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'uri'
|
14
|
+
|
15
|
+
module Flagr
|
16
|
+
class FlagApi
|
17
|
+
attr_accessor :api_client
|
18
|
+
|
19
|
+
def initialize(api_client = ApiClient.default)
|
20
|
+
@api_client = api_client
|
21
|
+
end
|
22
|
+
# @param body create a flag
|
23
|
+
# @param [Hash] opts the optional parameters
|
24
|
+
# @return [Flag]
|
25
|
+
def create_flag(body, opts = {})
|
26
|
+
data, _status_code, _headers = create_flag_with_http_info(body, opts)
|
27
|
+
data
|
28
|
+
end
|
29
|
+
|
30
|
+
# @param body create a flag
|
31
|
+
# @param [Hash] opts the optional parameters
|
32
|
+
# @return [Array<(Flag, Fixnum, Hash)>] Flag data, response status code and response headers
|
33
|
+
def create_flag_with_http_info(body, opts = {})
|
34
|
+
if @api_client.config.debugging
|
35
|
+
@api_client.config.logger.debug 'Calling API: FlagApi.create_flag ...'
|
36
|
+
end
|
37
|
+
# verify the required parameter 'body' is set
|
38
|
+
if @api_client.config.client_side_validation && body.nil?
|
39
|
+
fail ArgumentError, "Missing the required parameter 'body' when calling FlagApi.create_flag"
|
40
|
+
end
|
41
|
+
# resource path
|
42
|
+
local_var_path = '/flags'
|
43
|
+
|
44
|
+
# query parameters
|
45
|
+
query_params = {}
|
46
|
+
|
47
|
+
# header parameters
|
48
|
+
header_params = {}
|
49
|
+
# HTTP header 'Accept' (if needed)
|
50
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
51
|
+
# HTTP header 'Content-Type'
|
52
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
53
|
+
|
54
|
+
# form parameters
|
55
|
+
form_params = {}
|
56
|
+
|
57
|
+
# http body (model)
|
58
|
+
post_body = @api_client.object_to_http_body(body)
|
59
|
+
auth_names = []
|
60
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
61
|
+
:header_params => header_params,
|
62
|
+
:query_params => query_params,
|
63
|
+
:form_params => form_params,
|
64
|
+
:body => post_body,
|
65
|
+
:auth_names => auth_names,
|
66
|
+
:return_type => 'Flag')
|
67
|
+
if @api_client.config.debugging
|
68
|
+
@api_client.config.logger.debug "API called: FlagApi#create_flag\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
69
|
+
end
|
70
|
+
return data, status_code, headers
|
71
|
+
end
|
72
|
+
# @param flag_id numeric ID of the flag
|
73
|
+
# @param [Hash] opts the optional parameters
|
74
|
+
# @return [nil]
|
75
|
+
def delete_flag(flag_id, opts = {})
|
76
|
+
delete_flag_with_http_info(flag_id, opts)
|
77
|
+
nil
|
78
|
+
end
|
79
|
+
|
80
|
+
# @param flag_id numeric ID of the flag
|
81
|
+
# @param [Hash] opts the optional parameters
|
82
|
+
# @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
|
83
|
+
def delete_flag_with_http_info(flag_id, opts = {})
|
84
|
+
if @api_client.config.debugging
|
85
|
+
@api_client.config.logger.debug 'Calling API: FlagApi.delete_flag ...'
|
86
|
+
end
|
87
|
+
# verify the required parameter 'flag_id' is set
|
88
|
+
if @api_client.config.client_side_validation && flag_id.nil?
|
89
|
+
fail ArgumentError, "Missing the required parameter 'flag_id' when calling FlagApi.delete_flag"
|
90
|
+
end
|
91
|
+
if @api_client.config.client_side_validation && flag_id < 1
|
92
|
+
fail ArgumentError, 'invalid value for "flag_id" when calling FlagApi.delete_flag, must be greater than or equal to 1.'
|
93
|
+
end
|
94
|
+
|
95
|
+
# resource path
|
96
|
+
local_var_path = '/flags/{flagID}'.sub('{' + 'flagID' + '}', flag_id.to_s)
|
97
|
+
|
98
|
+
# query parameters
|
99
|
+
query_params = {}
|
100
|
+
|
101
|
+
# header parameters
|
102
|
+
header_params = {}
|
103
|
+
# HTTP header 'Accept' (if needed)
|
104
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
105
|
+
# HTTP header 'Content-Type'
|
106
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
107
|
+
|
108
|
+
# form parameters
|
109
|
+
form_params = {}
|
110
|
+
|
111
|
+
# http body (model)
|
112
|
+
post_body = nil
|
113
|
+
auth_names = []
|
114
|
+
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
|
115
|
+
:header_params => header_params,
|
116
|
+
:query_params => query_params,
|
117
|
+
:form_params => form_params,
|
118
|
+
:body => post_body,
|
119
|
+
:auth_names => auth_names)
|
120
|
+
if @api_client.config.debugging
|
121
|
+
@api_client.config.logger.debug "API called: FlagApi#delete_flag\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
122
|
+
end
|
123
|
+
return data, status_code, headers
|
124
|
+
end
|
125
|
+
# @param [Hash] opts the optional parameters
|
126
|
+
# @option opts [Integer] :limit the numbers of flags to return
|
127
|
+
# @option opts [BOOLEAN] :enabled return flags having given enabled status
|
128
|
+
# @option opts [String] :description return flags exactly matching given description
|
129
|
+
# @option opts [String] :description_like return flags partially matching given description
|
130
|
+
# @option opts [Integer] :offset return flags given the offset, it should usually set together with limit
|
131
|
+
# @return [Array<Flag>]
|
132
|
+
def find_flags(opts = {})
|
133
|
+
data, _status_code, _headers = find_flags_with_http_info(opts)
|
134
|
+
data
|
135
|
+
end
|
136
|
+
|
137
|
+
# @param [Hash] opts the optional parameters
|
138
|
+
# @option opts [Integer] :limit the numbers of flags to return
|
139
|
+
# @option opts [BOOLEAN] :enabled return flags having given enabled status
|
140
|
+
# @option opts [String] :description return flags exactly matching given description
|
141
|
+
# @option opts [String] :description_like return flags partially matching given description
|
142
|
+
# @option opts [Integer] :offset return flags given the offset, it should usually set together with limit
|
143
|
+
# @return [Array<(Array<Flag>, Fixnum, Hash)>] Array<Flag> data, response status code and response headers
|
144
|
+
def find_flags_with_http_info(opts = {})
|
145
|
+
if @api_client.config.debugging
|
146
|
+
@api_client.config.logger.debug 'Calling API: FlagApi.find_flags ...'
|
147
|
+
end
|
148
|
+
# resource path
|
149
|
+
local_var_path = '/flags'
|
150
|
+
|
151
|
+
# query parameters
|
152
|
+
query_params = {}
|
153
|
+
query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
|
154
|
+
query_params[:'enabled'] = opts[:'enabled'] if !opts[:'enabled'].nil?
|
155
|
+
query_params[:'description'] = opts[:'description'] if !opts[:'description'].nil?
|
156
|
+
query_params[:'description_like'] = opts[:'description_like'] if !opts[:'description_like'].nil?
|
157
|
+
query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
|
158
|
+
|
159
|
+
# header parameters
|
160
|
+
header_params = {}
|
161
|
+
# HTTP header 'Accept' (if needed)
|
162
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
163
|
+
# HTTP header 'Content-Type'
|
164
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
165
|
+
|
166
|
+
# form parameters
|
167
|
+
form_params = {}
|
168
|
+
|
169
|
+
# http body (model)
|
170
|
+
post_body = nil
|
171
|
+
auth_names = []
|
172
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
173
|
+
:header_params => header_params,
|
174
|
+
:query_params => query_params,
|
175
|
+
:form_params => form_params,
|
176
|
+
:body => post_body,
|
177
|
+
:auth_names => auth_names,
|
178
|
+
:return_type => 'Array<Flag>')
|
179
|
+
if @api_client.config.debugging
|
180
|
+
@api_client.config.logger.debug "API called: FlagApi#find_flags\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
181
|
+
end
|
182
|
+
return data, status_code, headers
|
183
|
+
end
|
184
|
+
# @param flag_id numeric ID of the flag to get
|
185
|
+
# @param [Hash] opts the optional parameters
|
186
|
+
# @return [Flag]
|
187
|
+
def get_flag(flag_id, opts = {})
|
188
|
+
data, _status_code, _headers = get_flag_with_http_info(flag_id, opts)
|
189
|
+
data
|
190
|
+
end
|
191
|
+
|
192
|
+
# @param flag_id numeric ID of the flag to get
|
193
|
+
# @param [Hash] opts the optional parameters
|
194
|
+
# @return [Array<(Flag, Fixnum, Hash)>] Flag data, response status code and response headers
|
195
|
+
def get_flag_with_http_info(flag_id, opts = {})
|
196
|
+
if @api_client.config.debugging
|
197
|
+
@api_client.config.logger.debug 'Calling API: FlagApi.get_flag ...'
|
198
|
+
end
|
199
|
+
# verify the required parameter 'flag_id' is set
|
200
|
+
if @api_client.config.client_side_validation && flag_id.nil?
|
201
|
+
fail ArgumentError, "Missing the required parameter 'flag_id' when calling FlagApi.get_flag"
|
202
|
+
end
|
203
|
+
if @api_client.config.client_side_validation && flag_id < 1
|
204
|
+
fail ArgumentError, 'invalid value for "flag_id" when calling FlagApi.get_flag, must be greater than or equal to 1.'
|
205
|
+
end
|
206
|
+
|
207
|
+
# resource path
|
208
|
+
local_var_path = '/flags/{flagID}'.sub('{' + 'flagID' + '}', flag_id.to_s)
|
209
|
+
|
210
|
+
# query parameters
|
211
|
+
query_params = {}
|
212
|
+
|
213
|
+
# header parameters
|
214
|
+
header_params = {}
|
215
|
+
# HTTP header 'Accept' (if needed)
|
216
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
217
|
+
# HTTP header 'Content-Type'
|
218
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
219
|
+
|
220
|
+
# form parameters
|
221
|
+
form_params = {}
|
222
|
+
|
223
|
+
# http body (model)
|
224
|
+
post_body = nil
|
225
|
+
auth_names = []
|
226
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
227
|
+
:header_params => header_params,
|
228
|
+
:query_params => query_params,
|
229
|
+
:form_params => form_params,
|
230
|
+
:body => post_body,
|
231
|
+
:auth_names => auth_names,
|
232
|
+
:return_type => 'Flag')
|
233
|
+
if @api_client.config.debugging
|
234
|
+
@api_client.config.logger.debug "API called: FlagApi#get_flag\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
235
|
+
end
|
236
|
+
return data, status_code, headers
|
237
|
+
end
|
238
|
+
# @param flag_id numeric ID of the flag to get
|
239
|
+
# @param [Hash] opts the optional parameters
|
240
|
+
# @return [Array<FlagSnapshot>]
|
241
|
+
def get_flag_snapshots(flag_id, opts = {})
|
242
|
+
data, _status_code, _headers = get_flag_snapshots_with_http_info(flag_id, opts)
|
243
|
+
data
|
244
|
+
end
|
245
|
+
|
246
|
+
# @param flag_id numeric ID of the flag to get
|
247
|
+
# @param [Hash] opts the optional parameters
|
248
|
+
# @return [Array<(Array<FlagSnapshot>, Fixnum, Hash)>] Array<FlagSnapshot> data, response status code and response headers
|
249
|
+
def get_flag_snapshots_with_http_info(flag_id, opts = {})
|
250
|
+
if @api_client.config.debugging
|
251
|
+
@api_client.config.logger.debug 'Calling API: FlagApi.get_flag_snapshots ...'
|
252
|
+
end
|
253
|
+
# verify the required parameter 'flag_id' is set
|
254
|
+
if @api_client.config.client_side_validation && flag_id.nil?
|
255
|
+
fail ArgumentError, "Missing the required parameter 'flag_id' when calling FlagApi.get_flag_snapshots"
|
256
|
+
end
|
257
|
+
if @api_client.config.client_side_validation && flag_id < 1
|
258
|
+
fail ArgumentError, 'invalid value for "flag_id" when calling FlagApi.get_flag_snapshots, must be greater than or equal to 1.'
|
259
|
+
end
|
260
|
+
|
261
|
+
# resource path
|
262
|
+
local_var_path = '/flags/{flagID}/snapshots'.sub('{' + 'flagID' + '}', flag_id.to_s)
|
263
|
+
|
264
|
+
# query parameters
|
265
|
+
query_params = {}
|
266
|
+
|
267
|
+
# header parameters
|
268
|
+
header_params = {}
|
269
|
+
# HTTP header 'Accept' (if needed)
|
270
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
271
|
+
# HTTP header 'Content-Type'
|
272
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
273
|
+
|
274
|
+
# form parameters
|
275
|
+
form_params = {}
|
276
|
+
|
277
|
+
# http body (model)
|
278
|
+
post_body = nil
|
279
|
+
auth_names = []
|
280
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
281
|
+
:header_params => header_params,
|
282
|
+
:query_params => query_params,
|
283
|
+
:form_params => form_params,
|
284
|
+
:body => post_body,
|
285
|
+
:auth_names => auth_names,
|
286
|
+
:return_type => 'Array<FlagSnapshot>')
|
287
|
+
if @api_client.config.debugging
|
288
|
+
@api_client.config.logger.debug "API called: FlagApi#get_flag_snapshots\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
289
|
+
end
|
290
|
+
return data, status_code, headers
|
291
|
+
end
|
292
|
+
# @param flag_id numeric ID of the flag to get
|
293
|
+
# @param body update a flag
|
294
|
+
# @param [Hash] opts the optional parameters
|
295
|
+
# @return [Flag]
|
296
|
+
def put_flag(flag_id, body, opts = {})
|
297
|
+
data, _status_code, _headers = put_flag_with_http_info(flag_id, body, opts)
|
298
|
+
data
|
299
|
+
end
|
300
|
+
|
301
|
+
# @param flag_id numeric ID of the flag to get
|
302
|
+
# @param body update a flag
|
303
|
+
# @param [Hash] opts the optional parameters
|
304
|
+
# @return [Array<(Flag, Fixnum, Hash)>] Flag data, response status code and response headers
|
305
|
+
def put_flag_with_http_info(flag_id, body, opts = {})
|
306
|
+
if @api_client.config.debugging
|
307
|
+
@api_client.config.logger.debug 'Calling API: FlagApi.put_flag ...'
|
308
|
+
end
|
309
|
+
# verify the required parameter 'flag_id' is set
|
310
|
+
if @api_client.config.client_side_validation && flag_id.nil?
|
311
|
+
fail ArgumentError, "Missing the required parameter 'flag_id' when calling FlagApi.put_flag"
|
312
|
+
end
|
313
|
+
if @api_client.config.client_side_validation && flag_id < 1
|
314
|
+
fail ArgumentError, 'invalid value for "flag_id" when calling FlagApi.put_flag, must be greater than or equal to 1.'
|
315
|
+
end
|
316
|
+
|
317
|
+
# verify the required parameter 'body' is set
|
318
|
+
if @api_client.config.client_side_validation && body.nil?
|
319
|
+
fail ArgumentError, "Missing the required parameter 'body' when calling FlagApi.put_flag"
|
320
|
+
end
|
321
|
+
# resource path
|
322
|
+
local_var_path = '/flags/{flagID}'.sub('{' + 'flagID' + '}', flag_id.to_s)
|
323
|
+
|
324
|
+
# query parameters
|
325
|
+
query_params = {}
|
326
|
+
|
327
|
+
# header parameters
|
328
|
+
header_params = {}
|
329
|
+
# HTTP header 'Accept' (if needed)
|
330
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
331
|
+
# HTTP header 'Content-Type'
|
332
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
333
|
+
|
334
|
+
# form parameters
|
335
|
+
form_params = {}
|
336
|
+
|
337
|
+
# http body (model)
|
338
|
+
post_body = @api_client.object_to_http_body(body)
|
339
|
+
auth_names = []
|
340
|
+
data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
|
341
|
+
:header_params => header_params,
|
342
|
+
:query_params => query_params,
|
343
|
+
:form_params => form_params,
|
344
|
+
:body => post_body,
|
345
|
+
:auth_names => auth_names,
|
346
|
+
:return_type => 'Flag')
|
347
|
+
if @api_client.config.debugging
|
348
|
+
@api_client.config.logger.debug "API called: FlagApi#put_flag\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
349
|
+
end
|
350
|
+
return data, status_code, headers
|
351
|
+
end
|
352
|
+
# @param flag_id numeric ID of the flag to get
|
353
|
+
# @param body set flag enabled state
|
354
|
+
# @param [Hash] opts the optional parameters
|
355
|
+
# @return [Flag]
|
356
|
+
def set_flag_enabled(flag_id, body, opts = {})
|
357
|
+
data, _status_code, _headers = set_flag_enabled_with_http_info(flag_id, body, opts)
|
358
|
+
data
|
359
|
+
end
|
360
|
+
|
361
|
+
# @param flag_id numeric ID of the flag to get
|
362
|
+
# @param body set flag enabled state
|
363
|
+
# @param [Hash] opts the optional parameters
|
364
|
+
# @return [Array<(Flag, Fixnum, Hash)>] Flag data, response status code and response headers
|
365
|
+
def set_flag_enabled_with_http_info(flag_id, body, opts = {})
|
366
|
+
if @api_client.config.debugging
|
367
|
+
@api_client.config.logger.debug 'Calling API: FlagApi.set_flag_enabled ...'
|
368
|
+
end
|
369
|
+
# verify the required parameter 'flag_id' is set
|
370
|
+
if @api_client.config.client_side_validation && flag_id.nil?
|
371
|
+
fail ArgumentError, "Missing the required parameter 'flag_id' when calling FlagApi.set_flag_enabled"
|
372
|
+
end
|
373
|
+
if @api_client.config.client_side_validation && flag_id < 1
|
374
|
+
fail ArgumentError, 'invalid value for "flag_id" when calling FlagApi.set_flag_enabled, must be greater than or equal to 1.'
|
375
|
+
end
|
376
|
+
|
377
|
+
# verify the required parameter 'body' is set
|
378
|
+
if @api_client.config.client_side_validation && body.nil?
|
379
|
+
fail ArgumentError, "Missing the required parameter 'body' when calling FlagApi.set_flag_enabled"
|
380
|
+
end
|
381
|
+
# resource path
|
382
|
+
local_var_path = '/flags/{flagID}/enabled'.sub('{' + 'flagID' + '}', flag_id.to_s)
|
383
|
+
|
384
|
+
# query parameters
|
385
|
+
query_params = {}
|
386
|
+
|
387
|
+
# header parameters
|
388
|
+
header_params = {}
|
389
|
+
# HTTP header 'Accept' (if needed)
|
390
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
391
|
+
# HTTP header 'Content-Type'
|
392
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
393
|
+
|
394
|
+
# form parameters
|
395
|
+
form_params = {}
|
396
|
+
|
397
|
+
# http body (model)
|
398
|
+
post_body = @api_client.object_to_http_body(body)
|
399
|
+
auth_names = []
|
400
|
+
data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
|
401
|
+
:header_params => header_params,
|
402
|
+
:query_params => query_params,
|
403
|
+
:form_params => form_params,
|
404
|
+
:body => post_body,
|
405
|
+
:auth_names => auth_names,
|
406
|
+
:return_type => 'Flag')
|
407
|
+
if @api_client.config.debugging
|
408
|
+
@api_client.config.logger.debug "API called: FlagApi#set_flag_enabled\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
409
|
+
end
|
410
|
+
return data, status_code, headers
|
411
|
+
end
|
412
|
+
end
|
413
|
+
end
|