Class: LaunchDarklyApi::ApprovalsApi

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ ApprovalsApi

Returns a new instance of ApprovalsApi.



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

def api_client
  @api_client
end

Instance Method Details

#delete_approval_request(project_key, feature_flag_key, environment_key, id, opts = {}) ⇒ nil

Delete approval request Delete an approval request for a feature flag.

Parameters:

  • project_key (String)

    The project key

  • feature_flag_key (String)

    The feature flag key

  • environment_key (String)

    The environment key

  • id (String)

    The feature flag approval request ID

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

    the optional parameters

Returns:

  • (nil)


30
31
32
33
# File 'lib/launchdarkly_api/api/approvals_api.rb', line 30

def delete_approval_request(project_key, feature_flag_key, environment_key, id, opts = {})
  delete_approval_request_with_http_info(project_key, feature_flag_key, environment_key, id, opts)
  nil
end

#delete_approval_request_with_http_info(project_key, feature_flag_key, environment_key, id, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Delete approval request Delete an approval request for a feature flag.

Parameters:

  • project_key (String)

    The project key

  • feature_flag_key (String)

    The feature flag key

  • environment_key (String)

    The environment key

  • id (String)

    The feature flag approval request ID

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



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
96
97
98
99
100
101
# File 'lib/launchdarkly_api/api/approvals_api.rb', line 43

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

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

  new_options = opts.merge(
    :operation => :"ApprovalsApi.delete_approval_request",
    :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(:DELETE, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ApprovalsApi#delete_approval_request\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_approval(project_key, feature_flag_key, environment_key, id, opts = {}) ⇒ FlagConfigApprovalRequestResponse

Get approval request Get a single approval request for a feature flag.

Parameters:

  • project_key (String)

    The project key

  • feature_flag_key (String)

    The feature flag key

  • environment_key (String)

    The environment key

  • id (String)

    The feature flag approval request ID

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

    the optional parameters

Returns:



111
112
113
114
# File 'lib/launchdarkly_api/api/approvals_api.rb', line 111

def get_approval(project_key, feature_flag_key, environment_key, id, opts = {})
  data, _status_code, _headers = get_approval_with_http_info(project_key, feature_flag_key, environment_key, id, opts)
  data
end

#get_approval_with_http_info(project_key, feature_flag_key, environment_key, id, opts = {}) ⇒ Array<(FlagConfigApprovalRequestResponse, Integer, Hash)>

Get approval request Get a single approval request for a feature flag.

Parameters:

  • project_key (String)

    The project key

  • feature_flag_key (String)

    The feature flag key

  • environment_key (String)

    The environment key

  • id (String)

    The feature flag approval request ID

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

    the optional parameters

Returns:



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
177
178
179
180
181
182
# File 'lib/launchdarkly_api/api/approvals_api.rb', line 124

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

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

  new_options = opts.merge(
    :operation => :"ApprovalsApi.get_approval",
    :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: ApprovalsApi#get_approval\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_approvals(project_key, feature_flag_key, environment_key, opts = {}) ⇒ FlagConfigApprovalRequestsResponse

List all approval requests Get all approval requests for a feature flag.

Parameters:

  • project_key (String)

    The project key

  • feature_flag_key (String)

    The feature flag key

  • environment_key (String)

    The environment key

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

    the optional parameters

Returns:



191
192
193
194
# File 'lib/launchdarkly_api/api/approvals_api.rb', line 191

def get_approvals(project_key, feature_flag_key, environment_key, opts = {})
  data, _status_code, _headers = get_approvals_with_http_info(project_key, feature_flag_key, environment_key, opts)
  data
end

#get_approvals_with_http_info(project_key, feature_flag_key, environment_key, opts = {}) ⇒ Array<(FlagConfigApprovalRequestsResponse, Integer, Hash)>

List all approval requests Get all approval requests for a feature flag.

Parameters:

  • project_key (String)

    The project key

  • feature_flag_key (String)

    The feature flag key

  • environment_key (String)

    The environment key

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

    the optional parameters

Returns:



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
252
253
254
255
256
257
# File 'lib/launchdarkly_api/api/approvals_api.rb', line 203

def get_approvals_with_http_info(project_key, feature_flag_key, environment_key, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ApprovalsApi.get_approvals ...'
  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 ApprovalsApi.get_approvals"
  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 ApprovalsApi.get_approvals"
  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 ApprovalsApi.get_approvals"
  end
  # resource path
  local_var_path = '/api/v2/projects/{projectKey}/flags/{featureFlagKey}/environments/{environmentKey}/approval-requests'.sub('{' + 'projectKey' + '}', CGI.escape(project_key.to_s)).sub('{' + 'featureFlagKey' + '}', CGI.escape(feature_flag_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] || 'FlagConfigApprovalRequestsResponse'

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

  new_options = opts.merge(
    :operation => :"ApprovalsApi.get_approvals",
    :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: ApprovalsApi#get_approvals\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#post_approval_request(project_key, feature_flag_key, environment_key, create_flag_config_approval_request_request, opts = {}) ⇒ FlagConfigApprovalRequestResponse

Create approval request Create an approval request for a feature flag.

Parameters:

  • project_key (String)

    The project key

  • feature_flag_key (String)

    The feature flag key

  • environment_key (String)

    The environment key

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

    the optional parameters

Returns:



267
268
269
270
# File 'lib/launchdarkly_api/api/approvals_api.rb', line 267

def post_approval_request(project_key, feature_flag_key, environment_key, create_flag_config_approval_request_request, opts = {})
  data, _status_code, _headers = post_approval_request_with_http_info(project_key, feature_flag_key, environment_key, create_flag_config_approval_request_request, opts)
  data
end

#post_approval_request_apply_request(project_key, feature_flag_key, environment_key, id, post_approval_request_apply_request, opts = {}) ⇒ FlagConfigApprovalRequestResponse

Apply approval request Apply an approval request that has been approved.

Parameters:

  • project_key (String)

    The project key

  • feature_flag_key (String)

    The feature flag key

  • environment_key (String)

    The environment key

  • id (String)

    The feature flag approval request ID

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

    the optional parameters

Returns:



354
355
356
357
# File 'lib/launchdarkly_api/api/approvals_api.rb', line 354

def post_approval_request_apply_request(project_key, feature_flag_key, environment_key, id, post_approval_request_apply_request, opts = {})
  data, _status_code, _headers = post_approval_request_apply_request_with_http_info(project_key, feature_flag_key, environment_key, id, post_approval_request_apply_request, opts)
  data
end

#post_approval_request_apply_request_with_http_info(project_key, feature_flag_key, environment_key, id, post_approval_request_apply_request, opts = {}) ⇒ Array<(FlagConfigApprovalRequestResponse, Integer, Hash)>

Apply approval request Apply an approval request that has been approved.

Parameters:

  • project_key (String)

    The project key

  • feature_flag_key (String)

    The feature flag key

  • environment_key (String)

    The environment key

  • id (String)

    The feature flag approval request ID

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

    the optional parameters

Returns:



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
430
431
432
433
434
435
# File 'lib/launchdarkly_api/api/approvals_api.rb', line 368

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

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

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

  new_options = opts.merge(
    :operation => :"ApprovalsApi.post_approval_request_apply_request",
    :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(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ApprovalsApi#post_approval_request_apply_request\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#post_approval_request_review(project_key, feature_flag_key, environment_key, id, post_approval_request_review_request, opts = {}) ⇒ FlagConfigApprovalRequestResponse

Review approval request Review an approval request by approving or denying changes.

Parameters:

  • project_key (String)

    The project key

  • feature_flag_key (String)

    The feature flag key

  • environment_key (String)

    The environment key

  • id (String)

    The feature flag approval request ID

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

    the optional parameters

Returns:



446
447
448
449
# File 'lib/launchdarkly_api/api/approvals_api.rb', line 446

def post_approval_request_review(project_key, feature_flag_key, environment_key, id, post_approval_request_review_request, opts = {})
  data, _status_code, _headers = post_approval_request_review_with_http_info(project_key, feature_flag_key, environment_key, id, post_approval_request_review_request, opts)
  data
end

#post_approval_request_review_with_http_info(project_key, feature_flag_key, environment_key, id, post_approval_request_review_request, opts = {}) ⇒ Array<(FlagConfigApprovalRequestResponse, Integer, Hash)>

Review approval request Review an approval request by approving or denying changes.

Parameters:

  • project_key (String)

    The project key

  • feature_flag_key (String)

    The feature flag key

  • environment_key (String)

    The environment key

  • id (String)

    The feature flag approval request ID

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

    the optional parameters

Returns:



460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
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
# File 'lib/launchdarkly_api/api/approvals_api.rb', line 460

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

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

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

  new_options = opts.merge(
    :operation => :"ApprovalsApi.post_approval_request_review",
    :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(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ApprovalsApi#post_approval_request_review\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#post_approval_request_with_http_info(project_key, feature_flag_key, environment_key, create_flag_config_approval_request_request, opts = {}) ⇒ Array<(FlagConfigApprovalRequestResponse, Integer, Hash)>

Create approval request Create an approval request for a feature flag.

Parameters:

  • project_key (String)

    The project key

  • feature_flag_key (String)

    The feature flag key

  • environment_key (String)

    The environment key

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

    the optional parameters

Returns:



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
338
339
340
341
342
343
# File 'lib/launchdarkly_api/api/approvals_api.rb', line 280

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

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

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

  new_options = opts.merge(
    :operation => :"ApprovalsApi.post_approval_request",
    :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(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ApprovalsApi#post_approval_request\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#post_flag_copy_config_approval_request(project_key, feature_flag_key, environment_key, create_copy_flag_config_approval_request_request, opts = {}) ⇒ FlagConfigApprovalRequestResponse

Create approval request to copy flag configurations across environments Create an approval request to copy a feature flag's configuration across environments.

Parameters:

  • project_key (String)

    The project key

  • feature_flag_key (String)

    The feature flag key

  • environment_key (String)

    The environment key for the target environment

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

    the optional parameters

Returns:



537
538
539
540
# File 'lib/launchdarkly_api/api/approvals_api.rb', line 537

def post_flag_copy_config_approval_request(project_key, feature_flag_key, environment_key, create_copy_flag_config_approval_request_request, opts = {})
  data, _status_code, _headers = post_flag_copy_config_approval_request_with_http_info(project_key, feature_flag_key, environment_key, create_copy_flag_config_approval_request_request, opts)
  data
end

#post_flag_copy_config_approval_request_with_http_info(project_key, feature_flag_key, environment_key, create_copy_flag_config_approval_request_request, opts = {}) ⇒ Array<(FlagConfigApprovalRequestResponse, Integer, Hash)>

Create approval request to copy flag configurations across environments Create an approval request to copy a feature flag&#39;s configuration across environments.

Parameters:

  • project_key (String)

    The project key

  • feature_flag_key (String)

    The feature flag key

  • environment_key (String)

    The environment key for the target environment

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

    the optional parameters

Returns:



550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
# File 'lib/launchdarkly_api/api/approvals_api.rb', line 550

def post_flag_copy_config_approval_request_with_http_info(project_key, feature_flag_key, environment_key, create_copy_flag_config_approval_request_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ApprovalsApi.post_flag_copy_config_approval_request ...'
  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 ApprovalsApi.post_flag_copy_config_approval_request"
  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 ApprovalsApi.post_flag_copy_config_approval_request"
  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 ApprovalsApi.post_flag_copy_config_approval_request"
  end
  # verify the required parameter 'create_copy_flag_config_approval_request_request' is set
  if @api_client.config.client_side_validation && create_copy_flag_config_approval_request_request.nil?
    fail ArgumentError, "Missing the required parameter 'create_copy_flag_config_approval_request_request' when calling ApprovalsApi.post_flag_copy_config_approval_request"
  end
  # resource path
  local_var_path = '/api/v2/projects/{projectKey}/flags/{featureFlagKey}/environments/{environmentKey}/approval-requests-flag-copy'.sub('{' + 'projectKey' + '}', CGI.escape(project_key.to_s)).sub('{' + 'featureFlagKey' + '}', CGI.escape(feature_flag_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(create_copy_flag_config_approval_request_request)

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

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

  new_options = opts.merge(
    :operation => :"ApprovalsApi.post_flag_copy_config_approval_request",
    :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(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ApprovalsApi#post_flag_copy_config_approval_request\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end