ff-ruby-server-sdk 1.0.0 → 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (47) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +9 -3
  3. data/Gemfile +0 -3
  4. data/example/example.rb +4 -3
  5. data/lib/ff/ruby/server/generated/lib/openapi_client/api/client_api.rb +545 -0
  6. data/lib/ff/ruby/server/generated/lib/openapi_client/api/metrics_api.rb +89 -0
  7. data/lib/ff/ruby/server/generated/lib/openapi_client/api_client.rb +390 -0
  8. data/lib/ff/ruby/server/generated/lib/openapi_client/api_error.rb +57 -0
  9. data/lib/ff/ruby/server/generated/lib/openapi_client/configuration.rb +282 -0
  10. data/lib/ff/ruby/server/generated/lib/openapi_client/models/authentication_request.rb +232 -0
  11. data/lib/ff/ruby/server/generated/lib/openapi_client/models/authentication_request_target.rb +250 -0
  12. data/lib/ff/ruby/server/generated/lib/openapi_client/models/authentication_response.rb +223 -0
  13. data/lib/ff/ruby/server/generated/lib/openapi_client/models/clause.rb +281 -0
  14. data/lib/ff/ruby/server/generated/lib/openapi_client/models/distribution.rb +239 -0
  15. data/lib/ff/ruby/server/generated/lib/openapi_client/models/error.rb +237 -0
  16. data/lib/ff/ruby/server/generated/lib/openapi_client/models/evaluation.rb +260 -0
  17. data/lib/ff/ruby/server/generated/lib/openapi_client/models/feature_config.rb +418 -0
  18. data/lib/ff/ruby/server/generated/lib/openapi_client/models/feature_state.rb +37 -0
  19. data/lib/ff/ruby/server/generated/lib/openapi_client/models/key_value.rb +237 -0
  20. data/lib/ff/ruby/server/generated/lib/openapi_client/models/metrics.rb +231 -0
  21. data/lib/ff/ruby/server/generated/lib/openapi_client/models/metrics_data.rb +303 -0
  22. data/lib/ff/ruby/server/generated/lib/openapi_client/models/pagination.rb +274 -0
  23. data/lib/ff/ruby/server/generated/lib/openapi_client/models/prerequisite.rb +239 -0
  24. data/lib/ff/ruby/server/generated/lib/openapi_client/models/segment.rb +320 -0
  25. data/lib/ff/ruby/server/generated/lib/openapi_client/models/serve.rb +227 -0
  26. data/lib/ff/ruby/server/generated/lib/openapi_client/models/serving_rule.rb +267 -0
  27. data/lib/ff/ruby/server/generated/lib/openapi_client/models/tag.rb +233 -0
  28. data/lib/ff/ruby/server/generated/lib/openapi_client/models/target.rb +331 -0
  29. data/lib/ff/ruby/server/generated/lib/openapi_client/models/target_data.rb +253 -0
  30. data/lib/ff/ruby/server/generated/lib/openapi_client/models/target_map.rb +232 -0
  31. data/lib/ff/ruby/server/generated/lib/openapi_client/models/variation.rb +255 -0
  32. data/lib/ff/ruby/server/generated/lib/openapi_client/models/variation_map.rb +245 -0
  33. data/lib/ff/ruby/server/generated/lib/openapi_client/models/weighted_variation.rb +237 -0
  34. data/lib/ff/ruby/server/generated/lib/openapi_client/version.rb +15 -0
  35. data/lib/ff/ruby/server/generated/lib/openapi_client.rb +65 -0
  36. data/lib/ff/ruby/server/sdk/api/cf_client.rb +1 -1
  37. data/lib/ff/ruby/server/sdk/version.rb +1 -1
  38. data/scripts/install.sh +8 -2
  39. data/scripts/openapi.sh +51 -10
  40. data/scripts/publish.sh +1 -1
  41. data/scripts/sdk_specs.sh +1 -1
  42. metadata +208 -13
  43. data/.run/build.sh.run.xml +0 -17
  44. data/.run/install.sh.run.xml +0 -17
  45. data/.run/openapi.sh.run.xml +0 -17
  46. data/.run/publish.sh.run.xml +0 -17
  47. data/.run/unpublish.sh.run.xml +0 -17
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: aafd2726a023b297ce97c582bc0270092f8795064c7bd16dd6096d2a5690681d
4
- data.tar.gz: 00a0f190db82bdfb225eb7fd8546865ef6d399c2bcc835da436e1b807c90f1ae
3
+ metadata.gz: b1338c83b2248c11382717371743495cb32eefda503c06f107465bee5feeb783
4
+ data.tar.gz: f2b12848cfbd2366db0937ffae69abd2337e74fe6498fda2abf3b202440ed166
5
5
  SHA512:
6
- metadata.gz: e839a0f6b68c3e576730a62d836b74b622e50cabb07927fb6cebb1aaee5d9849788c603bf16a96e361d9e8fb25b8b34a71a28c13bf168a68f11b1fc5313484f4
7
- data.tar.gz: f65a9e15ccc5f80ac924a4801c58f671cd63f1be24e95875e665af3b787af07cd35cb05e173bd66807ffac7331a83e00ffa30d5b83903deca3b4322608c19f16
6
+ metadata.gz: 39fb700e43c01f53804f542916f6db018747f68097731a10a85593068b667c5fe4c0749f84d84adc9136c8490d84a0b0d2b77c73b39107cfdd2fa7a84ec9523f
7
+ data.tar.gz: 34ef0734b8db6ca79bb81abc1af862165a185e665d3d57e63ec62dc952bd7eedb659f2dff8fdfb5d0fee32bd724c81e7ac2c290a533bb7145e4c53a486bd3eb4
data/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
- ## [Unreleased]
1
+ # [1.0.2]
2
2
 
3
- ## [0.0.1, 0.0.2] - 2021-11-16
3
+ - Runtime and development dependencies specified.
4
4
 
5
- - Initial release
5
+ # [1.0.1]
6
+
7
+ - OpenAPI issues fixed
8
+
9
+ # [1.0.0]
10
+
11
+ - The first SDK release
data/Gemfile CHANGED
@@ -8,9 +8,6 @@ gem "rake", "~> 13.0"
8
8
  gem "minitest", "~> 5.0"
9
9
  gem "standard", "~> 1.3"
10
10
 
11
- # OpenAPI:
12
- gem "openapi_client", "~> 1.0.0"
13
-
14
11
  # Caching support:
15
12
  gem "pp"
16
13
  gem "rufus-scheduler"
data/example/example.rb CHANGED
@@ -20,6 +20,7 @@ executor = Concurrent::FixedThreadPool.new(100)
20
20
 
21
21
  keys = {
22
22
 
23
+ # "UAT" => "834b1749-073b-4a97-8424-03893572bab5",
23
24
  "Freemium" => "1f3339b4-e004-457a-91f7-9b5ce173eaaf",
24
25
  "Non-Freemium" => "a30cf6aa-67f2-4545-8ac7-f86709f4f3a0"
25
26
  }
@@ -31,12 +32,12 @@ keys.each do |name, key|
31
32
  config = ConfigBuilder.new
32
33
  .logger(logger)
33
34
  .build
34
-
35
- client = CfClient.new(key, config)
36
-
35
+ # UAT:
37
36
  # .config_url("https://config.feature-flags.uat.harness.io/api/1.0")
38
37
  # .event_url("https://event.feature-flags.uat.harness.io/api/1.0")
39
38
 
39
+ client = CfClient.new(key, config)
40
+
40
41
  client.init
41
42
 
42
43
  config.logger.debug "We will wait for the initialization"
@@ -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