Class: LaunchDarklyApi::UserSegmentsApi

Inherits:
Object
  • Object
show all
Defined in:
lib/launchdarkly_api/api/user_segments_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ UserSegmentsApi



19
20
21
# File 'lib/launchdarkly_api/api/user_segments_api.rb', line 19

def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



17
18
19
# File 'lib/launchdarkly_api/api/user_segments_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#delete_user_segment(project_key, environment_key, user_segment_key, opts = {}) ⇒ nil

Delete a user segment.



28
29
30
31
# File 'lib/launchdarkly_api/api/user_segments_api.rb', line 28

def delete_user_segment(project_key, environment_key, user_segment_key, opts = {})
  delete_user_segment_with_http_info(project_key, environment_key, user_segment_key, opts)
  nil
end

#delete_user_segment_with_http_info(project_key, environment_key, user_segment_key, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Delete a user segment.



39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
# File 'lib/launchdarkly_api/api/user_segments_api.rb', line 39

def delete_user_segment_with_http_info(project_key, environment_key, user_segment_key, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: UserSegmentsApi.delete_user_segment ...'
  end
  # verify the required parameter 'project_key' is set
  if @api_client.config.client_side_validation && project_key.nil?
    fail ArgumentError, "Missing the required parameter 'project_key' when calling UserSegmentsApi.delete_user_segment"
  end
  # verify the required parameter 'environment_key' is set
  if @api_client.config.client_side_validation && environment_key.nil?
    fail ArgumentError, "Missing the required parameter 'environment_key' when calling UserSegmentsApi.delete_user_segment"
  end
  # verify the required parameter 'user_segment_key' is set
  if @api_client.config.client_side_validation && user_segment_key.nil?
    fail ArgumentError, "Missing the required parameter 'user_segment_key' when calling UserSegmentsApi.delete_user_segment"
  end
  # resource path
  local_var_path = '/segments/{projectKey}/{environmentKey}/{userSegmentKey}'.sub('{' + 'projectKey' + '}', project_key.to_s).sub('{' + 'environmentKey' + '}', environment_key.to_s).sub('{' + 'userSegmentKey' + '}', user_segment_key.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['Token']
  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: UserSegmentsApi#delete_user_segment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_expiring_user_targets_on_segment(project_key, environment_key, user_segment_key, opts = {}) ⇒ UserTargetingExpirationForSegment

Get expiring user targets for user segment



91
92
93
94
# File 'lib/launchdarkly_api/api/user_segments_api.rb', line 91

def get_expiring_user_targets_on_segment(project_key, environment_key, user_segment_key, opts = {})
  data, _status_code, _headers = get_expiring_user_targets_on_segment_with_http_info(project_key, environment_key, user_segment_key, opts)
  data
end

#get_expiring_user_targets_on_segment_with_http_info(project_key, environment_key, user_segment_key, opts = {}) ⇒ Array<(UserTargetingExpirationForSegment, Fixnum, Hash)>

Get expiring user targets for user segment



102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
# File 'lib/launchdarkly_api/api/user_segments_api.rb', line 102

def get_expiring_user_targets_on_segment_with_http_info(project_key, environment_key, user_segment_key, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: UserSegmentsApi.get_expiring_user_targets_on_segment ...'
  end
  # verify the required parameter 'project_key' is set
  if @api_client.config.client_side_validation && project_key.nil?
    fail ArgumentError, "Missing the required parameter 'project_key' when calling UserSegmentsApi.get_expiring_user_targets_on_segment"
  end
  # verify the required parameter 'environment_key' is set
  if @api_client.config.client_side_validation && environment_key.nil?
    fail ArgumentError, "Missing the required parameter 'environment_key' when calling UserSegmentsApi.get_expiring_user_targets_on_segment"
  end
  # verify the required parameter 'user_segment_key' is set
  if @api_client.config.client_side_validation && user_segment_key.nil?
    fail ArgumentError, "Missing the required parameter 'user_segment_key' when calling UserSegmentsApi.get_expiring_user_targets_on_segment"
  end
  # resource path
  local_var_path = '/segments/{projectKey}/{userSegmentKey}/expiring-user-targets/{environmentKey}'.sub('{' + 'projectKey' + '}', project_key.to_s).sub('{' + 'environmentKey' + '}', environment_key.to_s).sub('{' + 'userSegmentKey' + '}', user_segment_key.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['Token']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'UserTargetingExpirationForSegment')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: UserSegmentsApi#get_expiring_user_targets_on_segment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_user_segment(project_key, environment_key, user_segment_key, opts = {}) ⇒ UserSegment

Get a single user segment by key.



155
156
157
158
# File 'lib/launchdarkly_api/api/user_segments_api.rb', line 155

def get_user_segment(project_key, environment_key, user_segment_key, opts = {})
  data, _status_code, _headers = get_user_segment_with_http_info(project_key, environment_key, user_segment_key, opts)
  data
end

#get_user_segment_with_http_info(project_key, environment_key, user_segment_key, opts = {}) ⇒ Array<(UserSegment, Fixnum, Hash)>

Get a single user segment by key.



166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
# File 'lib/launchdarkly_api/api/user_segments_api.rb', line 166

def get_user_segment_with_http_info(project_key, environment_key, user_segment_key, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: UserSegmentsApi.get_user_segment ...'
  end
  # verify the required parameter 'project_key' is set
  if @api_client.config.client_side_validation && project_key.nil?
    fail ArgumentError, "Missing the required parameter 'project_key' when calling UserSegmentsApi.get_user_segment"
  end
  # verify the required parameter 'environment_key' is set
  if @api_client.config.client_side_validation && environment_key.nil?
    fail ArgumentError, "Missing the required parameter 'environment_key' when calling UserSegmentsApi.get_user_segment"
  end
  # verify the required parameter 'user_segment_key' is set
  if @api_client.config.client_side_validation && user_segment_key.nil?
    fail ArgumentError, "Missing the required parameter 'user_segment_key' when calling UserSegmentsApi.get_user_segment"
  end
  # resource path
  local_var_path = '/segments/{projectKey}/{environmentKey}/{userSegmentKey}'.sub('{' + 'projectKey' + '}', project_key.to_s).sub('{' + 'environmentKey' + '}', environment_key.to_s).sub('{' + 'userSegmentKey' + '}', user_segment_key.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['Token']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'UserSegment')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: UserSegmentsApi#get_user_segment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_user_segments(project_key, environment_key, opts = {}) ⇒ UserSegments

Get a list of all user segments in the given project.

Options Hash (opts):

  • :tag (String)

    Filter by tag. A tag can be used to group flags across projects.



219
220
221
222
# File 'lib/launchdarkly_api/api/user_segments_api.rb', line 219

def get_user_segments(project_key, environment_key, opts = {})
  data, _status_code, _headers = get_user_segments_with_http_info(project_key, environment_key, opts)
  data
end

#get_user_segments_with_http_info(project_key, environment_key, opts = {}) ⇒ Array<(UserSegments, Fixnum, Hash)>

Get a list of all user segments in the given project.

Options Hash (opts):

  • :tag (String)

    Filter by tag. A tag can be used to group flags across projects.



230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
# File 'lib/launchdarkly_api/api/user_segments_api.rb', line 230

def get_user_segments_with_http_info(project_key, environment_key, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: UserSegmentsApi.get_user_segments ...'
  end
  # verify the required parameter 'project_key' is set
  if @api_client.config.client_side_validation && project_key.nil?
    fail ArgumentError, "Missing the required parameter 'project_key' when calling UserSegmentsApi.get_user_segments"
  end
  # verify the required parameter 'environment_key' is set
  if @api_client.config.client_side_validation && environment_key.nil?
    fail ArgumentError, "Missing the required parameter 'environment_key' when calling UserSegmentsApi.get_user_segments"
  end
  # resource path
  local_var_path = '/segments/{projectKey}/{environmentKey}'.sub('{' + 'projectKey' + '}', project_key.to_s).sub('{' + 'environmentKey' + '}', environment_key.to_s)

  # query parameters
  query_params = {}
  query_params[:'tag'] = opts[:'tag'] if !opts[:'tag'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['Token']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'UserSegments')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: UserSegmentsApi#get_user_segments\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#patch_expiring_user_targets_on_segment(project_key, environment_key, user_segment_key, semantic_patch_with_comment, opts = {}) ⇒ UserTargetingExpirationForSegment

Update, add, or delete expiring user targets on user segment



281
282
283
284
# File 'lib/launchdarkly_api/api/user_segments_api.rb', line 281

def patch_expiring_user_targets_on_segment(project_key, environment_key, user_segment_key, semantic_patch_with_comment, opts = {})
  data, _status_code, _headers = patch_expiring_user_targets_on_segment_with_http_info(project_key, environment_key, user_segment_key, semantic_patch_with_comment, opts)
  data
end

#patch_expiring_user_targets_on_segment_with_http_info(project_key, environment_key, user_segment_key, semantic_patch_with_comment, opts = {}) ⇒ Array<(UserTargetingExpirationForSegment, Fixnum, Hash)>

Update, add, or delete expiring user targets on user segment



293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
# File 'lib/launchdarkly_api/api/user_segments_api.rb', line 293

def patch_expiring_user_targets_on_segment_with_http_info(project_key, environment_key, user_segment_key, semantic_patch_with_comment, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: UserSegmentsApi.patch_expiring_user_targets_on_segment ...'
  end
  # verify the required parameter 'project_key' is set
  if @api_client.config.client_side_validation && project_key.nil?
    fail ArgumentError, "Missing the required parameter 'project_key' when calling UserSegmentsApi.patch_expiring_user_targets_on_segment"
  end
  # verify the required parameter 'environment_key' is set
  if @api_client.config.client_side_validation && environment_key.nil?
    fail ArgumentError, "Missing the required parameter 'environment_key' when calling UserSegmentsApi.patch_expiring_user_targets_on_segment"
  end
  # verify the required parameter 'user_segment_key' is set
  if @api_client.config.client_side_validation && user_segment_key.nil?
    fail ArgumentError, "Missing the required parameter 'user_segment_key' when calling UserSegmentsApi.patch_expiring_user_targets_on_segment"
  end
  # verify the required parameter 'semantic_patch_with_comment' is set
  if @api_client.config.client_side_validation && semantic_patch_with_comment.nil?
    fail ArgumentError, "Missing the required parameter 'semantic_patch_with_comment' when calling UserSegmentsApi.patch_expiring_user_targets_on_segment"
  end
  # resource path
  local_var_path = '/segments/{projectKey}/{userSegmentKey}/expiring-user-targets/{environmentKey}'.sub('{' + 'projectKey' + '}', project_key.to_s).sub('{' + 'environmentKey' + '}', environment_key.to_s).sub('{' + 'userSegmentKey' + '}', user_segment_key.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(semantic_patch_with_comment)
  auth_names = ['Token']
  data, status_code, headers = @api_client.call_api(:PATCH, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'UserTargetingExpirationForSegment')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: UserSegmentsApi#patch_expiring_user_targets_on_segment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#patch_user_segment(project_key, environment_key, user_segment_key, patch_only, opts = {}) ⇒ UserSegment

Perform a partial update to a user segment.



351
352
353
354
# File 'lib/launchdarkly_api/api/user_segments_api.rb', line 351

def patch_user_segment(project_key, environment_key, user_segment_key, patch_only, opts = {})
  data, _status_code, _headers = patch_user_segment_with_http_info(project_key, environment_key, user_segment_key, patch_only, opts)
  data
end

#patch_user_segment_with_http_info(project_key, environment_key, user_segment_key, patch_only, opts = {}) ⇒ Array<(UserSegment, Fixnum, Hash)>

Perform a partial update to a user segment.



363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
# File 'lib/launchdarkly_api/api/user_segments_api.rb', line 363

def patch_user_segment_with_http_info(project_key, environment_key, user_segment_key, patch_only, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: UserSegmentsApi.patch_user_segment ...'
  end
  # verify the required parameter 'project_key' is set
  if @api_client.config.client_side_validation && project_key.nil?
    fail ArgumentError, "Missing the required parameter 'project_key' when calling UserSegmentsApi.patch_user_segment"
  end
  # verify the required parameter 'environment_key' is set
  if @api_client.config.client_side_validation && environment_key.nil?
    fail ArgumentError, "Missing the required parameter 'environment_key' when calling UserSegmentsApi.patch_user_segment"
  end
  # verify the required parameter 'user_segment_key' is set
  if @api_client.config.client_side_validation && user_segment_key.nil?
    fail ArgumentError, "Missing the required parameter 'user_segment_key' when calling UserSegmentsApi.patch_user_segment"
  end
  # verify the required parameter 'patch_only' is set
  if @api_client.config.client_side_validation && patch_only.nil?
    fail ArgumentError, "Missing the required parameter 'patch_only' when calling UserSegmentsApi.patch_user_segment"
  end
  # resource path
  local_var_path = '/segments/{projectKey}/{environmentKey}/{userSegmentKey}'.sub('{' + 'projectKey' + '}', project_key.to_s).sub('{' + 'environmentKey' + '}', environment_key.to_s).sub('{' + 'userSegmentKey' + '}', user_segment_key.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(patch_only)
  auth_names = ['Token']
  data, status_code, headers = @api_client.call_api(:PATCH, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'UserSegment')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: UserSegmentsApi#patch_user_segment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#post_user_segment(project_key, environment_key, user_segment_body, opts = {}) ⇒ UserSegment

Creates a new user segment.



420
421
422
423
# File 'lib/launchdarkly_api/api/user_segments_api.rb', line 420

def post_user_segment(project_key, environment_key, user_segment_body, opts = {})
  data, _status_code, _headers = post_user_segment_with_http_info(project_key, environment_key, user_segment_body, opts)
  data
end

#post_user_segment_with_http_info(project_key, environment_key, user_segment_body, opts = {}) ⇒ Array<(UserSegment, Fixnum, Hash)>

Creates a new user segment.



431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
# File 'lib/launchdarkly_api/api/user_segments_api.rb', line 431

def post_user_segment_with_http_info(project_key, environment_key, user_segment_body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: UserSegmentsApi.post_user_segment ...'
  end
  # verify the required parameter 'project_key' is set
  if @api_client.config.client_side_validation && project_key.nil?
    fail ArgumentError, "Missing the required parameter 'project_key' when calling UserSegmentsApi.post_user_segment"
  end
  # verify the required parameter 'environment_key' is set
  if @api_client.config.client_side_validation && environment_key.nil?
    fail ArgumentError, "Missing the required parameter 'environment_key' when calling UserSegmentsApi.post_user_segment"
  end
  # verify the required parameter 'user_segment_body' is set
  if @api_client.config.client_side_validation && user_segment_body.nil?
    fail ArgumentError, "Missing the required parameter 'user_segment_body' when calling UserSegmentsApi.post_user_segment"
  end
  # resource path
  local_var_path = '/segments/{projectKey}/{environmentKey}'.sub('{' + 'projectKey' + '}', project_key.to_s).sub('{' + 'environmentKey' + '}', environment_key.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(user_segment_body)
  auth_names = ['Token']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'UserSegment')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: UserSegmentsApi#post_user_segment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#updated_unbounded_segment_targets(project_key, environment_key, user_segment_key, unbounded_segment_targets_body, opts = {}) ⇒ nil

Update targets included or excluded in an unbounded segment



485
486
487
488
# File 'lib/launchdarkly_api/api/user_segments_api.rb', line 485

def updated_unbounded_segment_targets(project_key, environment_key, user_segment_key, unbounded_segment_targets_body, opts = {})
  updated_unbounded_segment_targets_with_http_info(project_key, environment_key, user_segment_key, unbounded_segment_targets_body, opts)
  nil
end

#updated_unbounded_segment_targets_with_http_info(project_key, environment_key, user_segment_key, unbounded_segment_targets_body, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Update targets included or excluded in an unbounded segment



497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
# File 'lib/launchdarkly_api/api/user_segments_api.rb', line 497

def updated_unbounded_segment_targets_with_http_info(project_key, environment_key, user_segment_key, unbounded_segment_targets_body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: UserSegmentsApi.updated_unbounded_segment_targets ...'
  end
  # verify the required parameter 'project_key' is set
  if @api_client.config.client_side_validation && project_key.nil?
    fail ArgumentError, "Missing the required parameter 'project_key' when calling UserSegmentsApi.updated_unbounded_segment_targets"
  end
  # verify the required parameter 'environment_key' is set
  if @api_client.config.client_side_validation && environment_key.nil?
    fail ArgumentError, "Missing the required parameter 'environment_key' when calling UserSegmentsApi.updated_unbounded_segment_targets"
  end
  # verify the required parameter 'user_segment_key' is set
  if @api_client.config.client_side_validation && user_segment_key.nil?
    fail ArgumentError, "Missing the required parameter 'user_segment_key' when calling UserSegmentsApi.updated_unbounded_segment_targets"
  end
  # verify the required parameter 'unbounded_segment_targets_body' is set
  if @api_client.config.client_side_validation && unbounded_segment_targets_body.nil?
    fail ArgumentError, "Missing the required parameter 'unbounded_segment_targets_body' when calling UserSegmentsApi.updated_unbounded_segment_targets"
  end
  # resource path
  local_var_path = '/segments/{projectKey}/{environmentKey}/{userSegmentKey}/unbounded-users'.sub('{' + 'projectKey' + '}', project_key.to_s).sub('{' + 'environmentKey' + '}', environment_key.to_s).sub('{' + 'userSegmentKey' + '}', user_segment_key.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(unbounded_segment_targets_body)
  auth_names = ['Token']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: UserSegmentsApi#updated_unbounded_segment_targets\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end