Class: LaunchDarklyApi::UserSettingsApi

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ UserSettingsApi

Returns a new instance of UserSettingsApi.



19
20
21
# File 'lib/launchdarkly_api/api/user_settings_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_settings_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#get_expiring_flags_for_user(project_key, user_key, environment_key, opts = {}) ⇒ ExpiringUserTargetGetResponse

Get expiring dates on flags for user Get a list of flags for which the given user is scheduled for removal.

Parameters:

  • project_key (String)

    The project key

  • user_key (String)

    The user key

  • environment_key (String)

    The environment key

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



29
30
31
32
# File 'lib/launchdarkly_api/api/user_settings_api.rb', line 29

def get_expiring_flags_for_user(project_key, user_key, environment_key, opts = {})
  data, _status_code, _headers = get_expiring_flags_for_user_with_http_info(project_key, user_key, environment_key, opts)
  data
end

#get_expiring_flags_for_user_with_http_info(project_key, user_key, environment_key, opts = {}) ⇒ Array<(ExpiringUserTargetGetResponse, Integer, Hash)>

Get expiring dates on flags for user Get a list of flags for which the given user is scheduled for removal.

Parameters:

  • project_key (String)

    The project key

  • user_key (String)

    The user key

  • environment_key (String)

    The environment key

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



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
85
86
87
88
89
90
91
92
93
94
95
# File 'lib/launchdarkly_api/api/user_settings_api.rb', line 41

def get_expiring_flags_for_user_with_http_info(project_key, user_key, environment_key, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: UserSettingsApi.get_expiring_flags_for_user ...'
  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 UserSettingsApi.get_expiring_flags_for_user"
  end
  # verify the required parameter 'user_key' is set
  if @api_client.config.client_side_validation && user_key.nil?
    fail ArgumentError, "Missing the required parameter 'user_key' when calling UserSettingsApi.get_expiring_flags_for_user"
  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 UserSettingsApi.get_expiring_flags_for_user"
  end
  # resource path
  local_var_path = '/api/v2/users/{projectKey}/{userKey}/expiring-user-targets/{environmentKey}'.sub('{' + 'projectKey' + '}', CGI.escape(project_key.to_s)).sub('{' + 'userKey' + '}', CGI.escape(user_key.to_s)).sub('{' + 'environmentKey' + '}', CGI.escape(environment_key.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'ExpiringUserTargetGetResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['ApiKey']

  new_options = opts.merge(
    :operation => :"UserSettingsApi.get_expiring_flags_for_user",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: UserSettingsApi#get_expiring_flags_for_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_user_flag_setting(project_key, environment_key, user_key, feature_flag_key, opts = {}) ⇒ UserFlagSetting

Get flag setting for user Get a single flag setting for a user by flag key. <br /><br />The ‘_value` is the flag variation that the user receives. The `setting` indicates whether you’ve explicitly targeted a user to receive a particular variation. For example, if you have turned off a feature flag for a user, this setting will be ‘false`. The example response indicates that the user `Abbie_Braun` has the `sort.order` flag enabled.

Parameters:

  • project_key (String)

    The project key

  • environment_key (String)

    The environment key

  • user_key (String)

    The user key

  • feature_flag_key (String)

    The feature flag key

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



105
106
107
108
# File 'lib/launchdarkly_api/api/user_settings_api.rb', line 105

def get_user_flag_setting(project_key, environment_key, user_key, feature_flag_key, opts = {})
  data, _status_code, _headers = get_user_flag_setting_with_http_info(project_key, environment_key, user_key, feature_flag_key, opts)
  data
end

#get_user_flag_setting_with_http_info(project_key, environment_key, user_key, feature_flag_key, opts = {}) ⇒ Array<(UserFlagSetting, Integer, Hash)>

Get flag setting for user Get a single flag setting for a user by flag key. &lt;br /&gt;&lt;br /&gt;The &#x60;_value&#x60; is the flag variation that the user receives. The &#x60;setting&#x60; indicates whether you&#39;ve explicitly targeted a user to receive a particular variation. For example, if you have turned off a feature flag for a user, this setting will be &#x60;false&#x60;. The example response indicates that the user &#x60;Abbie_Braun&#x60; has the &#x60;sort.order&#x60; flag enabled.

Parameters:

  • project_key (String)

    The project key

  • environment_key (String)

    The environment key

  • user_key (String)

    The user key

  • feature_flag_key (String)

    The feature flag key

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(UserFlagSetting, Integer, Hash)>)

    UserFlagSetting data, response status code and response headers



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
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
# File 'lib/launchdarkly_api/api/user_settings_api.rb', line 118

def get_user_flag_setting_with_http_info(project_key, environment_key, user_key, feature_flag_key, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: UserSettingsApi.get_user_flag_setting ...'
  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 UserSettingsApi.get_user_flag_setting"
  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 UserSettingsApi.get_user_flag_setting"
  end
  # verify the required parameter 'user_key' is set
  if @api_client.config.client_side_validation && user_key.nil?
    fail ArgumentError, "Missing the required parameter 'user_key' when calling UserSettingsApi.get_user_flag_setting"
  end
  # verify the required parameter 'feature_flag_key' is set
  if @api_client.config.client_side_validation && feature_flag_key.nil?
    fail ArgumentError, "Missing the required parameter 'feature_flag_key' when calling UserSettingsApi.get_user_flag_setting"
  end
  # resource path
  local_var_path = '/api/v2/users/{projectKey}/{environmentKey}/{userKey}/flags/{featureFlagKey}'.sub('{' + 'projectKey' + '}', CGI.escape(project_key.to_s)).sub('{' + 'environmentKey' + '}', CGI.escape(environment_key.to_s)).sub('{' + 'userKey' + '}', CGI.escape(user_key.to_s)).sub('{' + 'featureFlagKey' + '}', CGI.escape(feature_flag_key.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'UserFlagSetting'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['ApiKey']

  new_options = opts.merge(
    :operation => :"UserSettingsApi.get_user_flag_setting",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: UserSettingsApi#get_user_flag_setting\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_user_flag_settings(project_key, environment_key, user_key, opts = {}) ⇒ UserFlagSettings

List flag settings for user Get the current flag settings for a given user. <br /><br />The ‘_value` is the flag variation that the user receives. The `setting` indicates whether you’ve explicitly targeted a user to receive a particular variation. For example, if you have turned off a feature flag for a user, this setting will be ‘false`. The example response indicates that the user `Abbie_Braun` has the `sort.order` flag enabled and the `alternate.page` flag disabled, and that the user has not been explicitly targeted to receive a particular variation.

Parameters:

  • project_key (String)

    The project key

  • environment_key (String)

    The environment key

  • user_key (String)

    The user key

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



185
186
187
188
# File 'lib/launchdarkly_api/api/user_settings_api.rb', line 185

def get_user_flag_settings(project_key, environment_key, user_key, opts = {})
  data, _status_code, _headers = get_user_flag_settings_with_http_info(project_key, environment_key, user_key, opts)
  data
end

#get_user_flag_settings_with_http_info(project_key, environment_key, user_key, opts = {}) ⇒ Array<(UserFlagSettings, Integer, Hash)>

List flag settings for user Get the current flag settings for a given user. &lt;br /&gt;&lt;br /&gt;The &#x60;_value&#x60; is the flag variation that the user receives. The &#x60;setting&#x60; indicates whether you&#39;ve explicitly targeted a user to receive a particular variation. For example, if you have turned off a feature flag for a user, this setting will be &#x60;false&#x60;. The example response indicates that the user &#x60;Abbie_Braun&#x60; has the &#x60;sort.order&#x60; flag enabled and the &#x60;alternate.page&#x60; flag disabled, and that the user has not been explicitly targeted to receive a particular variation.

Parameters:

  • project_key (String)

    The project key

  • environment_key (String)

    The environment key

  • user_key (String)

    The user key

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(UserFlagSettings, Integer, Hash)>)

    UserFlagSettings data, response status code and response headers



197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
# File 'lib/launchdarkly_api/api/user_settings_api.rb', line 197

def get_user_flag_settings_with_http_info(project_key, environment_key, user_key, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: UserSettingsApi.get_user_flag_settings ...'
  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 UserSettingsApi.get_user_flag_settings"
  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 UserSettingsApi.get_user_flag_settings"
  end
  # verify the required parameter 'user_key' is set
  if @api_client.config.client_side_validation && user_key.nil?
    fail ArgumentError, "Missing the required parameter 'user_key' when calling UserSettingsApi.get_user_flag_settings"
  end
  # resource path
  local_var_path = '/api/v2/users/{projectKey}/{environmentKey}/{userKey}/flags'.sub('{' + 'projectKey' + '}', CGI.escape(project_key.to_s)).sub('{' + 'environmentKey' + '}', CGI.escape(environment_key.to_s)).sub('{' + 'userKey' + '}', CGI.escape(user_key.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'UserFlagSettings'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['ApiKey']

  new_options = opts.merge(
    :operation => :"UserSettingsApi.get_user_flag_settings",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: UserSettingsApi#get_user_flag_settings\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#patch_expiring_flags_for_user(project_key, user_key, environment_key, patch_users_request, opts = {}) ⇒ ExpiringUserTargetPatchResponse

Update expiring user target for flags Schedule the specified user for removal from individual targeting on one or more flags. The user must already be individually targeted for each flag. You can add, update, or remove a scheduled removal date. You can only schedule a user for removal on a single variation per flag. This request only supports semantic patches. To make a semantic patch request, you must append ‘domain-model=launchdarkly.semanticpatch` to your `Content-Type` header. To learn more, read [Updates using semantic patch](/reference#updates-using-semantic-patch). ### Instructions #### addExpireUserTargetDate Adds a date and time that LaunchDarkly will remove the user from the flag’s individual targeting. ##### Parameters * ‘value`: The time, in Unix milliseconds, when LaunchDarkly should remove the user from individual targeting for this flag. #### updateExpireUserTargetDate Updates the date and time that LaunchDarkly will remove the user from the flag’s individual targeting. ##### Parameters * ‘value`: The time, in Unix milliseconds, when LaunchDarkly should remove the user from individual targeting for this flag. * `version`: The version of the flag variation to update. You can retrieve this by making a GET request for the flag. #### removeExpireUserTargetDate Removes the scheduled removal of the user from the flag’s individual targeting. The user will remain part of the flag’s individual targeting until explicitly removed, or until another removal is scheduled.

Parameters:

  • project_key (String)

    The project key

  • user_key (String)

    The user key

  • environment_key (String)

    The environment key

  • patch_users_request (PatchUsersRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



261
262
263
264
# File 'lib/launchdarkly_api/api/user_settings_api.rb', line 261

def patch_expiring_flags_for_user(project_key, user_key, environment_key, patch_users_request, opts = {})
  data, _status_code, _headers = patch_expiring_flags_for_user_with_http_info(project_key, user_key, environment_key, patch_users_request, opts)
  data
end

#patch_expiring_flags_for_user_with_http_info(project_key, user_key, environment_key, patch_users_request, opts = {}) ⇒ Array<(ExpiringUserTargetPatchResponse, Integer, Hash)>

Update expiring user target for flags Schedule the specified user for removal from individual targeting on one or more flags. The user must already be individually targeted for each flag. You can add, update, or remove a scheduled removal date. You can only schedule a user for removal on a single variation per flag. This request only supports semantic patches. To make a semantic patch request, you must append &#x60;domain-model&#x3D;launchdarkly.semanticpatch&#x60; to your &#x60;Content-Type&#x60; header. To learn more, read [Updates using semantic patch](/reference#updates-using-semantic-patch). ### Instructions #### addExpireUserTargetDate Adds a date and time that LaunchDarkly will remove the user from the flag&#39;s individual targeting. ##### Parameters * &#x60;value&#x60;: The time, in Unix milliseconds, when LaunchDarkly should remove the user from individual targeting for this flag. #### updateExpireUserTargetDate Updates the date and time that LaunchDarkly will remove the user from the flag&#39;s individual targeting. ##### Parameters * &#x60;value&#x60;: The time, in Unix milliseconds, when LaunchDarkly should remove the user from individual targeting for this flag. * &#x60;version&#x60;: The version of the flag variation to update. You can retrieve this by making a GET request for the flag. #### removeExpireUserTargetDate Removes the scheduled removal of the user from the flag&#39;s individual targeting. The user will remain part of the flag&#39;s individual targeting until explicitly removed, or until another removal is scheduled.

Parameters:

  • project_key (String)

    The project key

  • user_key (String)

    The user key

  • environment_key (String)

    The environment key

  • patch_users_request (PatchUsersRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
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
# File 'lib/launchdarkly_api/api/user_settings_api.rb', line 274

def patch_expiring_flags_for_user_with_http_info(project_key, user_key, environment_key, patch_users_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: UserSettingsApi.patch_expiring_flags_for_user ...'
  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 UserSettingsApi.patch_expiring_flags_for_user"
  end
  # verify the required parameter 'user_key' is set
  if @api_client.config.client_side_validation && user_key.nil?
    fail ArgumentError, "Missing the required parameter 'user_key' when calling UserSettingsApi.patch_expiring_flags_for_user"
  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 UserSettingsApi.patch_expiring_flags_for_user"
  end
  # verify the required parameter 'patch_users_request' is set
  if @api_client.config.client_side_validation && patch_users_request.nil?
    fail ArgumentError, "Missing the required parameter 'patch_users_request' when calling UserSettingsApi.patch_expiring_flags_for_user"
  end
  # resource path
  local_var_path = '/api/v2/users/{projectKey}/{userKey}/expiring-user-targets/{environmentKey}'.sub('{' + 'projectKey' + '}', CGI.escape(project_key.to_s)).sub('{' + 'userKey' + '}', CGI.escape(user_key.to_s)).sub('{' + 'environmentKey' + '}', CGI.escape(environment_key.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(patch_users_request)

  # return_type
  return_type = opts[:debug_return_type] || 'ExpiringUserTargetPatchResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['ApiKey']

  new_options = opts.merge(
    :operation => :"UserSettingsApi.patch_expiring_flags_for_user",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: UserSettingsApi#patch_expiring_flags_for_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#put_flag_setting(project_key, environment_key, user_key, feature_flag_key, value_put, opts = {}) ⇒ nil

Update flag settings for user Enable or disable a feature flag for a user based on their key. Omitting the ‘setting` attribute from the request body, or including a `setting` of `null`, erases the current setting for a user. If you previously patched the flag, and the patch included the user’s data, LaunchDarkly continues to use that data. If LaunchDarkly has never encountered the user’s key before, it calculates the flag values based on the user key alone.

Parameters:

  • project_key (String)

    The project key

  • environment_key (String)

    The environment key

  • user_key (String)

    The user key

  • feature_flag_key (String)

    The feature flag key

  • value_put (ValuePut)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (nil)


348
349
350
351
# File 'lib/launchdarkly_api/api/user_settings_api.rb', line 348

def put_flag_setting(project_key, environment_key, user_key, feature_flag_key, value_put, opts = {})
  put_flag_setting_with_http_info(project_key, environment_key, user_key, feature_flag_key, value_put, opts)
  nil
end

#put_flag_setting_with_http_info(project_key, environment_key, user_key, feature_flag_key, value_put, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Update flag settings for user Enable or disable a feature flag for a user based on their key. Omitting the &#x60;setting&#x60; attribute from the request body, or including a &#x60;setting&#x60; of &#x60;null&#x60;, erases the current setting for a user. If you previously patched the flag, and the patch included the user&#39;s data, LaunchDarkly continues to use that data. If LaunchDarkly has never encountered the user&#39;s key before, it calculates the flag values based on the user key alone.

Parameters:

  • project_key (String)

    The project key

  • environment_key (String)

    The environment key

  • user_key (String)

    The user key

  • feature_flag_key (String)

    The feature flag key

  • value_put (ValuePut)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(nil, Integer, Hash)>)

    nil, response status code and response headers



362
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
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
# File 'lib/launchdarkly_api/api/user_settings_api.rb', line 362

def put_flag_setting_with_http_info(project_key, environment_key, user_key, feature_flag_key, value_put, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: UserSettingsApi.put_flag_setting ...'
  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 UserSettingsApi.put_flag_setting"
  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 UserSettingsApi.put_flag_setting"
  end
  # verify the required parameter 'user_key' is set
  if @api_client.config.client_side_validation && user_key.nil?
    fail ArgumentError, "Missing the required parameter 'user_key' when calling UserSettingsApi.put_flag_setting"
  end
  # verify the required parameter 'feature_flag_key' is set
  if @api_client.config.client_side_validation && feature_flag_key.nil?
    fail ArgumentError, "Missing the required parameter 'feature_flag_key' when calling UserSettingsApi.put_flag_setting"
  end
  # verify the required parameter 'value_put' is set
  if @api_client.config.client_side_validation && value_put.nil?
    fail ArgumentError, "Missing the required parameter 'value_put' when calling UserSettingsApi.put_flag_setting"
  end
  # resource path
  local_var_path = '/api/v2/users/{projectKey}/{environmentKey}/{userKey}/flags/{featureFlagKey}'.sub('{' + 'projectKey' + '}', CGI.escape(project_key.to_s)).sub('{' + 'environmentKey' + '}', CGI.escape(environment_key.to_s)).sub('{' + 'userKey' + '}', CGI.escape(user_key.to_s)).sub('{' + 'featureFlagKey' + '}', CGI.escape(feature_flag_key.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(value_put)

  # return_type
  return_type = opts[:debug_return_type]

  # auth_names
  auth_names = opts[:debug_auth_names] || ['ApiKey']

  new_options = opts.merge(
    :operation => :"UserSettingsApi.put_flag_setting",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: UserSettingsApi#put_flag_setting\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end