ff-ruby-server-sdk 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +7 -1
- data/Gemfile +0 -3
- data/lib/ff/ruby/server/generated/lib/openapi_client/api/client_api.rb +545 -0
- data/lib/ff/ruby/server/generated/lib/openapi_client/api/metrics_api.rb +89 -0
- data/lib/ff/ruby/server/generated/lib/openapi_client/api_client.rb +390 -0
- data/lib/ff/ruby/server/generated/lib/openapi_client/api_error.rb +57 -0
- data/lib/ff/ruby/server/generated/lib/openapi_client/configuration.rb +282 -0
- data/lib/ff/ruby/server/generated/lib/openapi_client/models/authentication_request.rb +232 -0
- data/lib/ff/ruby/server/generated/lib/openapi_client/models/authentication_request_target.rb +250 -0
- data/lib/ff/ruby/server/generated/lib/openapi_client/models/authentication_response.rb +223 -0
- data/lib/ff/ruby/server/generated/lib/openapi_client/models/clause.rb +281 -0
- data/lib/ff/ruby/server/generated/lib/openapi_client/models/distribution.rb +239 -0
- data/lib/ff/ruby/server/generated/lib/openapi_client/models/error.rb +237 -0
- data/lib/ff/ruby/server/generated/lib/openapi_client/models/evaluation.rb +260 -0
- data/lib/ff/ruby/server/generated/lib/openapi_client/models/feature_config.rb +418 -0
- data/lib/ff/ruby/server/generated/lib/openapi_client/models/feature_state.rb +37 -0
- data/lib/ff/ruby/server/generated/lib/openapi_client/models/key_value.rb +237 -0
- data/lib/ff/ruby/server/generated/lib/openapi_client/models/metrics.rb +231 -0
- data/lib/ff/ruby/server/generated/lib/openapi_client/models/metrics_data.rb +303 -0
- data/lib/ff/ruby/server/generated/lib/openapi_client/models/pagination.rb +274 -0
- data/lib/ff/ruby/server/generated/lib/openapi_client/models/prerequisite.rb +239 -0
- data/lib/ff/ruby/server/generated/lib/openapi_client/models/segment.rb +320 -0
- data/lib/ff/ruby/server/generated/lib/openapi_client/models/serve.rb +227 -0
- data/lib/ff/ruby/server/generated/lib/openapi_client/models/serving_rule.rb +267 -0
- data/lib/ff/ruby/server/generated/lib/openapi_client/models/tag.rb +233 -0
- data/lib/ff/ruby/server/generated/lib/openapi_client/models/target.rb +331 -0
- data/lib/ff/ruby/server/generated/lib/openapi_client/models/target_data.rb +253 -0
- data/lib/ff/ruby/server/generated/lib/openapi_client/models/target_map.rb +232 -0
- data/lib/ff/ruby/server/generated/lib/openapi_client/models/variation.rb +255 -0
- data/lib/ff/ruby/server/generated/lib/openapi_client/models/variation_map.rb +245 -0
- data/lib/ff/ruby/server/generated/lib/openapi_client/models/weighted_variation.rb +237 -0
- data/lib/ff/ruby/server/generated/lib/openapi_client/version.rb +15 -0
- data/lib/ff/ruby/server/generated/lib/openapi_client.rb +65 -0
- data/lib/ff/ruby/server/sdk/api/cf_client.rb +1 -1
- data/lib/ff/ruby/server/sdk/version.rb +1 -1
- data/scripts/install.sh +8 -2
- data/scripts/openapi.sh +51 -10
- data/scripts/publish.sh +1 -1
- data/scripts/sdk_specs.sh +1 -1
- metadata +38 -11
- data/.run/build.sh.run.xml +0 -17
- data/.run/install.sh.run.xml +0 -17
- data/.run/openapi.sh.run.xml +0 -17
- data/.run/publish.sh.run.xml +0 -17
- data/.run/unpublish.sh.run.xml +0 -17
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 284bd5f82437a6dafea97d6dbff3f977b7497dcc4cd9345baefe805cdfb9029b
|
4
|
+
data.tar.gz: 03b6cbed509fbbaa75d068ead3badc880388ea25b03251a566f4ca4c0ec7d22c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 99945b143df108ed2d330448aeb84b6c385c173d84dab5c433664100064261a42c19d893cdc83e84cae0071b45405b55f1faa9b308b29dc9f4f9a2ea024bfb63
|
7
|
+
data.tar.gz: d3ce289e348781c08028f828ec9e0acc9ad7470806fe5e393d8fbb0e658f201deff0093fb1e359a5a86f216abc8e203008a2c7251fc659384a9cf0213a70743a
|
data/CHANGELOG.md
CHANGED
data/Gemfile
CHANGED
@@ -0,0 +1,545 @@
|
|
1
|
+
=begin
|
2
|
+
#Harness feature flag service client apis
|
3
|
+
|
4
|
+
#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 1.0.0
|
7
|
+
Contact: cf@harness.io
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 5.2.1
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'cgi'
|
14
|
+
|
15
|
+
module OpenapiClient
|
16
|
+
class ClientApi
|
17
|
+
attr_accessor :api_client
|
18
|
+
|
19
|
+
def initialize(api_client = ApiClient.default)
|
20
|
+
@api_client = api_client
|
21
|
+
end
|
22
|
+
# Authenticate with the admin server.
|
23
|
+
# Used to retrieve all target segments for certain account id.
|
24
|
+
# @param [Hash] opts the optional parameters
|
25
|
+
# @option opts [AuthenticationRequest] :authentication_request
|
26
|
+
# @return [AuthenticationResponse]
|
27
|
+
def authenticate(opts = {})
|
28
|
+
data, _status_code, _headers = authenticate_with_http_info(opts)
|
29
|
+
data
|
30
|
+
end
|
31
|
+
|
32
|
+
# Authenticate with the admin server.
|
33
|
+
# Used to retrieve all target segments for certain account id.
|
34
|
+
# @param [Hash] opts the optional parameters
|
35
|
+
# @option opts [AuthenticationRequest] :authentication_request
|
36
|
+
# @return [Array<(AuthenticationResponse, Integer, Hash)>] AuthenticationResponse data, response status code and response headers
|
37
|
+
def authenticate_with_http_info(opts = {})
|
38
|
+
if @api_client.config.debugging
|
39
|
+
@api_client.config.logger.debug 'Calling API: ClientApi.authenticate ...'
|
40
|
+
end
|
41
|
+
# resource path
|
42
|
+
local_var_path = '/client/auth'
|
43
|
+
|
44
|
+
# query parameters
|
45
|
+
query_params = opts[:query_params] || {}
|
46
|
+
|
47
|
+
# header parameters
|
48
|
+
header_params = opts[: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 = opts[:form_params] || {}
|
56
|
+
|
57
|
+
# http body (model)
|
58
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'authentication_request'])
|
59
|
+
|
60
|
+
# return_type
|
61
|
+
return_type = opts[:debug_return_type] || 'AuthenticationResponse'
|
62
|
+
|
63
|
+
# auth_names
|
64
|
+
auth_names = opts[:debug_auth_names] || []
|
65
|
+
|
66
|
+
new_options = opts.merge(
|
67
|
+
:operation => :"ClientApi.authenticate",
|
68
|
+
:header_params => header_params,
|
69
|
+
:query_params => query_params,
|
70
|
+
:form_params => form_params,
|
71
|
+
:body => post_body,
|
72
|
+
:auth_names => auth_names,
|
73
|
+
:return_type => return_type
|
74
|
+
)
|
75
|
+
|
76
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
77
|
+
if @api_client.config.debugging
|
78
|
+
@api_client.config.logger.debug "API called: ClientApi#authenticate\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
79
|
+
end
|
80
|
+
return data, status_code, headers
|
81
|
+
end
|
82
|
+
|
83
|
+
# Retrieve all segments.
|
84
|
+
# Used to retrieve all segments for certain account id.
|
85
|
+
# @param environment_uuid [String] Unique identifier for the environment object in the API.
|
86
|
+
# @param [Hash] opts the optional parameters
|
87
|
+
# @return [Array<Segment>]
|
88
|
+
def get_all_segments(environment_uuid, opts = {})
|
89
|
+
data, _status_code, _headers = get_all_segments_with_http_info(environment_uuid, opts)
|
90
|
+
data
|
91
|
+
end
|
92
|
+
|
93
|
+
# Retrieve all segments.
|
94
|
+
# Used to retrieve all segments for certain account id.
|
95
|
+
# @param environment_uuid [String] Unique identifier for the environment object in the API.
|
96
|
+
# @param [Hash] opts the optional parameters
|
97
|
+
# @return [Array<(Array<Segment>, Integer, Hash)>] Array<Segment> data, response status code and response headers
|
98
|
+
def get_all_segments_with_http_info(environment_uuid, opts = {})
|
99
|
+
if @api_client.config.debugging
|
100
|
+
@api_client.config.logger.debug 'Calling API: ClientApi.get_all_segments ...'
|
101
|
+
end
|
102
|
+
# verify the required parameter 'environment_uuid' is set
|
103
|
+
if @api_client.config.client_side_validation && environment_uuid.nil?
|
104
|
+
fail ArgumentError, "Missing the required parameter 'environment_uuid' when calling ClientApi.get_all_segments"
|
105
|
+
end
|
106
|
+
# resource path
|
107
|
+
local_var_path = '/client/env/{environmentUUID}/target-segments'.sub('{' + 'environmentUUID' + '}', CGI.escape(environment_uuid.to_s))
|
108
|
+
|
109
|
+
# query parameters
|
110
|
+
query_params = opts[:query_params] || {}
|
111
|
+
|
112
|
+
# header parameters
|
113
|
+
header_params = opts[:header_params] || {}
|
114
|
+
# HTTP header 'Accept' (if needed)
|
115
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
116
|
+
|
117
|
+
# form parameters
|
118
|
+
form_params = opts[:form_params] || {}
|
119
|
+
|
120
|
+
# http body (model)
|
121
|
+
post_body = opts[:debug_body]
|
122
|
+
|
123
|
+
# return_type
|
124
|
+
return_type = opts[:debug_return_type] || 'Array<Segment>'
|
125
|
+
|
126
|
+
# auth_names
|
127
|
+
auth_names = opts[:debug_auth_names] || ['BearerAuth']
|
128
|
+
|
129
|
+
new_options = opts.merge(
|
130
|
+
:operation => :"ClientApi.get_all_segments",
|
131
|
+
:header_params => header_params,
|
132
|
+
:query_params => query_params,
|
133
|
+
:form_params => form_params,
|
134
|
+
:body => post_body,
|
135
|
+
:auth_names => auth_names,
|
136
|
+
:return_type => return_type
|
137
|
+
)
|
138
|
+
|
139
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
140
|
+
if @api_client.config.debugging
|
141
|
+
@api_client.config.logger.debug "API called: ClientApi#get_all_segments\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
142
|
+
end
|
143
|
+
return data, status_code, headers
|
144
|
+
end
|
145
|
+
|
146
|
+
# Get feature evaluations for target
|
147
|
+
# @param environment_uuid [String] Unique identifier for the environment object in the API.
|
148
|
+
# @param feature [String] Unique identifier for the flag object in the API.
|
149
|
+
# @param target [String] Unique identifier for the target object in the API.
|
150
|
+
# @param [Hash] opts the optional parameters
|
151
|
+
# @return [Evaluation]
|
152
|
+
def get_evaluation_by_identifier(environment_uuid, feature, target, opts = {})
|
153
|
+
data, _status_code, _headers = get_evaluation_by_identifier_with_http_info(environment_uuid, feature, target, opts)
|
154
|
+
data
|
155
|
+
end
|
156
|
+
|
157
|
+
# Get feature evaluations for target
|
158
|
+
# @param environment_uuid [String] Unique identifier for the environment object in the API.
|
159
|
+
# @param feature [String] Unique identifier for the flag object in the API.
|
160
|
+
# @param target [String] Unique identifier for the target object in the API.
|
161
|
+
# @param [Hash] opts the optional parameters
|
162
|
+
# @return [Array<(Evaluation, Integer, Hash)>] Evaluation data, response status code and response headers
|
163
|
+
def get_evaluation_by_identifier_with_http_info(environment_uuid, feature, target, opts = {})
|
164
|
+
if @api_client.config.debugging
|
165
|
+
@api_client.config.logger.debug 'Calling API: ClientApi.get_evaluation_by_identifier ...'
|
166
|
+
end
|
167
|
+
# verify the required parameter 'environment_uuid' is set
|
168
|
+
if @api_client.config.client_side_validation && environment_uuid.nil?
|
169
|
+
fail ArgumentError, "Missing the required parameter 'environment_uuid' when calling ClientApi.get_evaluation_by_identifier"
|
170
|
+
end
|
171
|
+
# verify the required parameter 'feature' is set
|
172
|
+
if @api_client.config.client_side_validation && feature.nil?
|
173
|
+
fail ArgumentError, "Missing the required parameter 'feature' when calling ClientApi.get_evaluation_by_identifier"
|
174
|
+
end
|
175
|
+
# verify the required parameter 'target' is set
|
176
|
+
if @api_client.config.client_side_validation && target.nil?
|
177
|
+
fail ArgumentError, "Missing the required parameter 'target' when calling ClientApi.get_evaluation_by_identifier"
|
178
|
+
end
|
179
|
+
# resource path
|
180
|
+
local_var_path = '/client/env/{environmentUUID}/target/{target}/evaluations/{feature}'.sub('{' + 'environmentUUID' + '}', CGI.escape(environment_uuid.to_s)).sub('{' + 'feature' + '}', CGI.escape(feature.to_s)).sub('{' + 'target' + '}', CGI.escape(target.to_s))
|
181
|
+
|
182
|
+
# query parameters
|
183
|
+
query_params = opts[:query_params] || {}
|
184
|
+
|
185
|
+
# header parameters
|
186
|
+
header_params = opts[:header_params] || {}
|
187
|
+
# HTTP header 'Accept' (if needed)
|
188
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
189
|
+
|
190
|
+
# form parameters
|
191
|
+
form_params = opts[:form_params] || {}
|
192
|
+
|
193
|
+
# http body (model)
|
194
|
+
post_body = opts[:debug_body]
|
195
|
+
|
196
|
+
# return_type
|
197
|
+
return_type = opts[:debug_return_type] || 'Evaluation'
|
198
|
+
|
199
|
+
# auth_names
|
200
|
+
auth_names = opts[:debug_auth_names] || ['BearerAuth']
|
201
|
+
|
202
|
+
new_options = opts.merge(
|
203
|
+
:operation => :"ClientApi.get_evaluation_by_identifier",
|
204
|
+
:header_params => header_params,
|
205
|
+
:query_params => query_params,
|
206
|
+
:form_params => form_params,
|
207
|
+
:body => post_body,
|
208
|
+
:auth_names => auth_names,
|
209
|
+
:return_type => return_type
|
210
|
+
)
|
211
|
+
|
212
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
213
|
+
if @api_client.config.debugging
|
214
|
+
@api_client.config.logger.debug "API called: ClientApi#get_evaluation_by_identifier\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
215
|
+
end
|
216
|
+
return data, status_code, headers
|
217
|
+
end
|
218
|
+
|
219
|
+
# Get feature evaluations for target
|
220
|
+
# @param environment_uuid [String] Unique identifier for the environment object in the API.
|
221
|
+
# @param target [String] Unique identifier for the target object in the API.
|
222
|
+
# @param [Hash] opts the optional parameters
|
223
|
+
# @return [Pagination]
|
224
|
+
def get_evaluations(environment_uuid, target, opts = {})
|
225
|
+
data, _status_code, _headers = get_evaluations_with_http_info(environment_uuid, target, opts)
|
226
|
+
data
|
227
|
+
end
|
228
|
+
|
229
|
+
# Get feature evaluations for target
|
230
|
+
# @param environment_uuid [String] Unique identifier for the environment object in the API.
|
231
|
+
# @param target [String] Unique identifier for the target object in the API.
|
232
|
+
# @param [Hash] opts the optional parameters
|
233
|
+
# @return [Array<(Pagination, Integer, Hash)>] Pagination data, response status code and response headers
|
234
|
+
def get_evaluations_with_http_info(environment_uuid, target, opts = {})
|
235
|
+
if @api_client.config.debugging
|
236
|
+
@api_client.config.logger.debug 'Calling API: ClientApi.get_evaluations ...'
|
237
|
+
end
|
238
|
+
# verify the required parameter 'environment_uuid' is set
|
239
|
+
if @api_client.config.client_side_validation && environment_uuid.nil?
|
240
|
+
fail ArgumentError, "Missing the required parameter 'environment_uuid' when calling ClientApi.get_evaluations"
|
241
|
+
end
|
242
|
+
# verify the required parameter 'target' is set
|
243
|
+
if @api_client.config.client_side_validation && target.nil?
|
244
|
+
fail ArgumentError, "Missing the required parameter 'target' when calling ClientApi.get_evaluations"
|
245
|
+
end
|
246
|
+
# resource path
|
247
|
+
local_var_path = '/client/env/{environmentUUID}/target/{target}/evaluations'.sub('{' + 'environmentUUID' + '}', CGI.escape(environment_uuid.to_s)).sub('{' + 'target' + '}', CGI.escape(target.to_s))
|
248
|
+
|
249
|
+
# query parameters
|
250
|
+
query_params = opts[:query_params] || {}
|
251
|
+
|
252
|
+
# header parameters
|
253
|
+
header_params = opts[:header_params] || {}
|
254
|
+
# HTTP header 'Accept' (if needed)
|
255
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
256
|
+
|
257
|
+
# form parameters
|
258
|
+
form_params = opts[:form_params] || {}
|
259
|
+
|
260
|
+
# http body (model)
|
261
|
+
post_body = opts[:debug_body]
|
262
|
+
|
263
|
+
# return_type
|
264
|
+
return_type = opts[:debug_return_type] || 'Pagination'
|
265
|
+
|
266
|
+
# auth_names
|
267
|
+
auth_names = opts[:debug_auth_names] || ['BearerAuth']
|
268
|
+
|
269
|
+
new_options = opts.merge(
|
270
|
+
:operation => :"ClientApi.get_evaluations",
|
271
|
+
:header_params => header_params,
|
272
|
+
:query_params => query_params,
|
273
|
+
:form_params => form_params,
|
274
|
+
:body => post_body,
|
275
|
+
:auth_names => auth_names,
|
276
|
+
:return_type => return_type
|
277
|
+
)
|
278
|
+
|
279
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
280
|
+
if @api_client.config.debugging
|
281
|
+
@api_client.config.logger.debug "API called: ClientApi#get_evaluations\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
282
|
+
end
|
283
|
+
return data, status_code, headers
|
284
|
+
end
|
285
|
+
|
286
|
+
# Get all feature flags activations
|
287
|
+
# All feature flags with activations in project environment
|
288
|
+
# @param environment_uuid [String] Unique identifier for the environment object in the API.
|
289
|
+
# @param [Hash] opts the optional parameters
|
290
|
+
# @return [Array<FeatureConfig>]
|
291
|
+
def get_feature_config(environment_uuid, opts = {})
|
292
|
+
data, _status_code, _headers = get_feature_config_with_http_info(environment_uuid, opts)
|
293
|
+
data
|
294
|
+
end
|
295
|
+
|
296
|
+
# Get all feature flags activations
|
297
|
+
# All feature flags with activations in project environment
|
298
|
+
# @param environment_uuid [String] Unique identifier for the environment object in the API.
|
299
|
+
# @param [Hash] opts the optional parameters
|
300
|
+
# @return [Array<(Array<FeatureConfig>, Integer, Hash)>] Array<FeatureConfig> data, response status code and response headers
|
301
|
+
def get_feature_config_with_http_info(environment_uuid, opts = {})
|
302
|
+
if @api_client.config.debugging
|
303
|
+
@api_client.config.logger.debug 'Calling API: ClientApi.get_feature_config ...'
|
304
|
+
end
|
305
|
+
# verify the required parameter 'environment_uuid' is set
|
306
|
+
if @api_client.config.client_side_validation && environment_uuid.nil?
|
307
|
+
fail ArgumentError, "Missing the required parameter 'environment_uuid' when calling ClientApi.get_feature_config"
|
308
|
+
end
|
309
|
+
# resource path
|
310
|
+
local_var_path = '/client/env/{environmentUUID}/feature-configs'.sub('{' + 'environmentUUID' + '}', CGI.escape(environment_uuid.to_s))
|
311
|
+
|
312
|
+
# query parameters
|
313
|
+
query_params = opts[:query_params] || {}
|
314
|
+
|
315
|
+
# header parameters
|
316
|
+
header_params = opts[:header_params] || {}
|
317
|
+
# HTTP header 'Accept' (if needed)
|
318
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
319
|
+
|
320
|
+
# form parameters
|
321
|
+
form_params = opts[:form_params] || {}
|
322
|
+
|
323
|
+
# http body (model)
|
324
|
+
post_body = opts[:debug_body]
|
325
|
+
|
326
|
+
# return_type
|
327
|
+
return_type = opts[:debug_return_type] || 'Array<FeatureConfig>'
|
328
|
+
|
329
|
+
# auth_names
|
330
|
+
auth_names = opts[:debug_auth_names] || ['BearerAuth']
|
331
|
+
|
332
|
+
new_options = opts.merge(
|
333
|
+
:operation => :"ClientApi.get_feature_config",
|
334
|
+
:header_params => header_params,
|
335
|
+
:query_params => query_params,
|
336
|
+
:form_params => form_params,
|
337
|
+
:body => post_body,
|
338
|
+
:auth_names => auth_names,
|
339
|
+
:return_type => return_type
|
340
|
+
)
|
341
|
+
|
342
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
343
|
+
if @api_client.config.debugging
|
344
|
+
@api_client.config.logger.debug "API called: ClientApi#get_feature_config\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
345
|
+
end
|
346
|
+
return data, status_code, headers
|
347
|
+
end
|
348
|
+
|
349
|
+
# Get feature config
|
350
|
+
# @param identifier [String] Unique identifier for the flag object in the API.
|
351
|
+
# @param environment_uuid [String] Unique identifier for the environment object in the API.
|
352
|
+
# @param [Hash] opts the optional parameters
|
353
|
+
# @return [FeatureConfig]
|
354
|
+
def get_feature_config_by_identifier(identifier, environment_uuid, opts = {})
|
355
|
+
data, _status_code, _headers = get_feature_config_by_identifier_with_http_info(identifier, environment_uuid, opts)
|
356
|
+
data
|
357
|
+
end
|
358
|
+
|
359
|
+
# Get feature config
|
360
|
+
# @param identifier [String] Unique identifier for the flag object in the API.
|
361
|
+
# @param environment_uuid [String] Unique identifier for the environment object in the API.
|
362
|
+
# @param [Hash] opts the optional parameters
|
363
|
+
# @return [Array<(FeatureConfig, Integer, Hash)>] FeatureConfig data, response status code and response headers
|
364
|
+
def get_feature_config_by_identifier_with_http_info(identifier, environment_uuid, opts = {})
|
365
|
+
if @api_client.config.debugging
|
366
|
+
@api_client.config.logger.debug 'Calling API: ClientApi.get_feature_config_by_identifier ...'
|
367
|
+
end
|
368
|
+
# verify the required parameter 'identifier' is set
|
369
|
+
if @api_client.config.client_side_validation && identifier.nil?
|
370
|
+
fail ArgumentError, "Missing the required parameter 'identifier' when calling ClientApi.get_feature_config_by_identifier"
|
371
|
+
end
|
372
|
+
# verify the required parameter 'environment_uuid' is set
|
373
|
+
if @api_client.config.client_side_validation && environment_uuid.nil?
|
374
|
+
fail ArgumentError, "Missing the required parameter 'environment_uuid' when calling ClientApi.get_feature_config_by_identifier"
|
375
|
+
end
|
376
|
+
# resource path
|
377
|
+
local_var_path = '/client/env/{environmentUUID}/feature-configs/{identifier}'.sub('{' + 'identifier' + '}', CGI.escape(identifier.to_s)).sub('{' + 'environmentUUID' + '}', CGI.escape(environment_uuid.to_s))
|
378
|
+
|
379
|
+
# query parameters
|
380
|
+
query_params = opts[:query_params] || {}
|
381
|
+
|
382
|
+
# header parameters
|
383
|
+
header_params = opts[:header_params] || {}
|
384
|
+
# HTTP header 'Accept' (if needed)
|
385
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
386
|
+
|
387
|
+
# form parameters
|
388
|
+
form_params = opts[:form_params] || {}
|
389
|
+
|
390
|
+
# http body (model)
|
391
|
+
post_body = opts[:debug_body]
|
392
|
+
|
393
|
+
# return_type
|
394
|
+
return_type = opts[:debug_return_type] || 'FeatureConfig'
|
395
|
+
|
396
|
+
# auth_names
|
397
|
+
auth_names = opts[:debug_auth_names] || ['BearerAuth']
|
398
|
+
|
399
|
+
new_options = opts.merge(
|
400
|
+
:operation => :"ClientApi.get_feature_config_by_identifier",
|
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 => return_type
|
407
|
+
)
|
408
|
+
|
409
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
410
|
+
if @api_client.config.debugging
|
411
|
+
@api_client.config.logger.debug "API called: ClientApi#get_feature_config_by_identifier\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
412
|
+
end
|
413
|
+
return data, status_code, headers
|
414
|
+
end
|
415
|
+
|
416
|
+
# Retrieve a segment by identifier
|
417
|
+
# Used to retrieve a segment for a certain account id by identifier
|
418
|
+
# @param identifier [String] Unique identifier for the segment object in the API
|
419
|
+
# @param environment_uuid [String] Unique identifier for the environment object in the API
|
420
|
+
# @param [Hash] opts the optional parameters
|
421
|
+
# @return [Segment]
|
422
|
+
def get_segment_by_identifier(identifier, environment_uuid, opts = {})
|
423
|
+
data, _status_code, _headers = get_segment_by_identifier_with_http_info(identifier, environment_uuid, opts)
|
424
|
+
data
|
425
|
+
end
|
426
|
+
|
427
|
+
# Retrieve a segment by identifier
|
428
|
+
# Used to retrieve a segment for a certain account id by identifier
|
429
|
+
# @param identifier [String] Unique identifier for the segment object in the API
|
430
|
+
# @param environment_uuid [String] Unique identifier for the environment object in the API
|
431
|
+
# @param [Hash] opts the optional parameters
|
432
|
+
# @return [Array<(Segment, Integer, Hash)>] Segment data, response status code and response headers
|
433
|
+
def get_segment_by_identifier_with_http_info(identifier, environment_uuid, opts = {})
|
434
|
+
if @api_client.config.debugging
|
435
|
+
@api_client.config.logger.debug 'Calling API: ClientApi.get_segment_by_identifier ...'
|
436
|
+
end
|
437
|
+
# verify the required parameter 'identifier' is set
|
438
|
+
if @api_client.config.client_side_validation && identifier.nil?
|
439
|
+
fail ArgumentError, "Missing the required parameter 'identifier' when calling ClientApi.get_segment_by_identifier"
|
440
|
+
end
|
441
|
+
# verify the required parameter 'environment_uuid' is set
|
442
|
+
if @api_client.config.client_side_validation && environment_uuid.nil?
|
443
|
+
fail ArgumentError, "Missing the required parameter 'environment_uuid' when calling ClientApi.get_segment_by_identifier"
|
444
|
+
end
|
445
|
+
# resource path
|
446
|
+
local_var_path = '/client/env/{environmentUUID}/target-segments/{identifier}'.sub('{' + 'identifier' + '}', CGI.escape(identifier.to_s)).sub('{' + 'environmentUUID' + '}', CGI.escape(environment_uuid.to_s))
|
447
|
+
|
448
|
+
# query parameters
|
449
|
+
query_params = opts[:query_params] || {}
|
450
|
+
|
451
|
+
# header parameters
|
452
|
+
header_params = opts[:header_params] || {}
|
453
|
+
# HTTP header 'Accept' (if needed)
|
454
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
455
|
+
|
456
|
+
# form parameters
|
457
|
+
form_params = opts[:form_params] || {}
|
458
|
+
|
459
|
+
# http body (model)
|
460
|
+
post_body = opts[:debug_body]
|
461
|
+
|
462
|
+
# return_type
|
463
|
+
return_type = opts[:debug_return_type] || 'Segment'
|
464
|
+
|
465
|
+
# auth_names
|
466
|
+
auth_names = opts[:debug_auth_names] || ['BearerAuth']
|
467
|
+
|
468
|
+
new_options = opts.merge(
|
469
|
+
:operation => :"ClientApi.get_segment_by_identifier",
|
470
|
+
:header_params => header_params,
|
471
|
+
:query_params => query_params,
|
472
|
+
:form_params => form_params,
|
473
|
+
:body => post_body,
|
474
|
+
:auth_names => auth_names,
|
475
|
+
:return_type => return_type
|
476
|
+
)
|
477
|
+
|
478
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
479
|
+
if @api_client.config.debugging
|
480
|
+
@api_client.config.logger.debug "API called: ClientApi#get_segment_by_identifier\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
481
|
+
end
|
482
|
+
return data, status_code, headers
|
483
|
+
end
|
484
|
+
|
485
|
+
# Stream endpoint.
|
486
|
+
# @param api_key [String]
|
487
|
+
# @param [Hash] opts the optional parameters
|
488
|
+
# @return [nil]
|
489
|
+
def stream(api_key, opts = {})
|
490
|
+
stream_with_http_info(api_key, opts)
|
491
|
+
nil
|
492
|
+
end
|
493
|
+
|
494
|
+
# Stream endpoint.
|
495
|
+
# @param api_key [String]
|
496
|
+
# @param [Hash] opts the optional parameters
|
497
|
+
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
498
|
+
def stream_with_http_info(api_key, opts = {})
|
499
|
+
if @api_client.config.debugging
|
500
|
+
@api_client.config.logger.debug 'Calling API: ClientApi.stream ...'
|
501
|
+
end
|
502
|
+
# verify the required parameter 'api_key' is set
|
503
|
+
if @api_client.config.client_side_validation && api_key.nil?
|
504
|
+
fail ArgumentError, "Missing the required parameter 'api_key' when calling ClientApi.stream"
|
505
|
+
end
|
506
|
+
# resource path
|
507
|
+
local_var_path = '/stream'
|
508
|
+
|
509
|
+
# query parameters
|
510
|
+
query_params = opts[:query_params] || {}
|
511
|
+
|
512
|
+
# header parameters
|
513
|
+
header_params = opts[:header_params] || {}
|
514
|
+
header_params[:'API-Key'] = api_key
|
515
|
+
|
516
|
+
# form parameters
|
517
|
+
form_params = opts[:form_params] || {}
|
518
|
+
|
519
|
+
# http body (model)
|
520
|
+
post_body = opts[:debug_body]
|
521
|
+
|
522
|
+
# return_type
|
523
|
+
return_type = opts[:debug_return_type]
|
524
|
+
|
525
|
+
# auth_names
|
526
|
+
auth_names = opts[:debug_auth_names] || ['BearerAuth']
|
527
|
+
|
528
|
+
new_options = opts.merge(
|
529
|
+
:operation => :"ClientApi.stream",
|
530
|
+
:header_params => header_params,
|
531
|
+
:query_params => query_params,
|
532
|
+
:form_params => form_params,
|
533
|
+
:body => post_body,
|
534
|
+
:auth_names => auth_names,
|
535
|
+
:return_type => return_type
|
536
|
+
)
|
537
|
+
|
538
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
539
|
+
if @api_client.config.debugging
|
540
|
+
@api_client.config.logger.debug "API called: ClientApi#stream\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
541
|
+
end
|
542
|
+
return data, status_code, headers
|
543
|
+
end
|
544
|
+
end
|
545
|
+
end
|
@@ -0,0 +1,89 @@
|
|
1
|
+
=begin
|
2
|
+
#Harness feature flag service client apis
|
3
|
+
|
4
|
+
#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 1.0.0
|
7
|
+
Contact: cf@harness.io
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 5.2.1
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'cgi'
|
14
|
+
|
15
|
+
module OpenapiClient
|
16
|
+
class MetricsApi
|
17
|
+
attr_accessor :api_client
|
18
|
+
|
19
|
+
def initialize(api_client = ApiClient.default)
|
20
|
+
@api_client = api_client
|
21
|
+
end
|
22
|
+
# Send metrics to the Analytics server.
|
23
|
+
# Send metrics to Analytics server
|
24
|
+
# @param environment [String] environment parameter in query.
|
25
|
+
# @param [Hash] opts the optional parameters
|
26
|
+
# @option opts [Metrics] :metrics
|
27
|
+
# @return [nil]
|
28
|
+
def post_metrics(environment, opts = {})
|
29
|
+
post_metrics_with_http_info(environment, opts)
|
30
|
+
nil
|
31
|
+
end
|
32
|
+
|
33
|
+
# Send metrics to the Analytics server.
|
34
|
+
# Send metrics to Analytics server
|
35
|
+
# @param environment [String] environment parameter in query.
|
36
|
+
# @param [Hash] opts the optional parameters
|
37
|
+
# @option opts [Metrics] :metrics
|
38
|
+
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
39
|
+
def post_metrics_with_http_info(environment, opts = {})
|
40
|
+
if @api_client.config.debugging
|
41
|
+
@api_client.config.logger.debug 'Calling API: MetricsApi.post_metrics ...'
|
42
|
+
end
|
43
|
+
# verify the required parameter 'environment' is set
|
44
|
+
if @api_client.config.client_side_validation && environment.nil?
|
45
|
+
fail ArgumentError, "Missing the required parameter 'environment' when calling MetricsApi.post_metrics"
|
46
|
+
end
|
47
|
+
# resource path
|
48
|
+
local_var_path = '/metrics/{environment}'.sub('{' + 'environment' + '}', CGI.escape(environment.to_s))
|
49
|
+
|
50
|
+
# query parameters
|
51
|
+
query_params = opts[:query_params] || {}
|
52
|
+
|
53
|
+
# header parameters
|
54
|
+
header_params = opts[:header_params] || {}
|
55
|
+
# HTTP header 'Accept' (if needed)
|
56
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
57
|
+
# HTTP header 'Content-Type'
|
58
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
59
|
+
|
60
|
+
# form parameters
|
61
|
+
form_params = opts[:form_params] || {}
|
62
|
+
|
63
|
+
# http body (model)
|
64
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'metrics'])
|
65
|
+
|
66
|
+
# return_type
|
67
|
+
return_type = opts[:debug_return_type]
|
68
|
+
|
69
|
+
# auth_names
|
70
|
+
auth_names = opts[:debug_auth_names] || ['BearerAuth']
|
71
|
+
|
72
|
+
new_options = opts.merge(
|
73
|
+
:operation => :"MetricsApi.post_metrics",
|
74
|
+
:header_params => header_params,
|
75
|
+
:query_params => query_params,
|
76
|
+
:form_params => form_params,
|
77
|
+
:body => post_body,
|
78
|
+
:auth_names => auth_names,
|
79
|
+
:return_type => return_type
|
80
|
+
)
|
81
|
+
|
82
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
83
|
+
if @api_client.config.debugging
|
84
|
+
@api_client.config.logger.debug "API called: MetricsApi#post_metrics\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
85
|
+
end
|
86
|
+
return data, status_code, headers
|
87
|
+
end
|
88
|
+
end
|
89
|
+
end
|