Class: LaunchDarklyApi::ApprovalsBetaApi

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ ApprovalsBetaApi

Returns a new instance of ApprovalsBetaApi.



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

def api_client
  @api_client
end

Instance Method Details

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

Delete approval request Delete an approval request.

Parameters:

  • id (String)

    The approval request ID

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

    the optional parameters

Returns:

  • (nil)


27
28
29
30
# File 'lib/launchdarkly_api/api/approvals_beta_api.rb', line 27

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

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

Delete approval request Delete an approval request.

Parameters:

  • id (String)

    The approval request ID

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



37
38
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
# File 'lib/launchdarkly_api/api/approvals_beta_api.rb', line 37

def delete_approval_request_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ApprovalsBetaApi.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 ApprovalsBetaApi.delete_approval_request"
  end
  # resource path
  local_var_path = '/api/v2/approval-requests/{id}'.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 => :"ApprovalsBetaApi.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: ApprovalsBetaApi#delete_approval_request\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_approval_request(id, opts = {}) ⇒ ExpandableApprovalRequestResponse

Get approval request Get an approval request by approval request ID. ### Expanding approval response LaunchDarkly supports the ‘expand` query param to include additional fields in the response, with the following fields: - `flag` includes the flag the approval request belongs to - `project` includes the project the approval request belongs to - `environments` includes the environments the approval request relates to For example, `expand=project,flag` includes the `project` and `flag` fields in the response.

Parameters:

  • id (String)

    The approval request ID

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

    the optional parameters

Options Hash (opts):

  • :expand (String)

    A comma-separated list of fields to expand in the response. Supported fields are explained above.

Returns:



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

def get_approval_request(id, opts = {})
  data, _status_code, _headers = get_approval_request_with_http_info(id, opts)
  data
end

#get_approval_request_with_http_info(id, opts = {}) ⇒ Array<(ExpandableApprovalRequestResponse, Integer, Hash)>

Get approval request Get an approval request by approval request ID. ### Expanding approval response LaunchDarkly supports the &#x60;expand&#x60; query param to include additional fields in the response, with the following fields: - &#x60;flag&#x60; includes the flag the approval request belongs to - &#x60;project&#x60; includes the project the approval request belongs to - &#x60;environments&#x60; includes the environments the approval request relates to For example, &#x60;expand&#x3D;project,flag&#x60; includes the &#x60;project&#x60; and &#x60;flag&#x60; fields in the response.

Parameters:

  • id (String)

    The approval request ID

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

    the optional parameters

Options Hash (opts):

  • :expand (String)

    A comma-separated list of fields to expand in the response. Supported fields are explained above.

Returns:



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
149
# File 'lib/launchdarkly_api/api/approvals_beta_api.rb', line 102

def get_approval_request_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ApprovalsBetaApi.get_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 ApprovalsBetaApi.get_approval_request"
  end
  # resource path
  local_var_path = '/api/v2/approval-requests/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

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

  # 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] || 'ExpandableApprovalRequestResponse'

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

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

#get_approval_requests(opts = {}) ⇒ ExpandableApprovalRequestsResponse

List approval requests Get all approval requests. ### Filtering approvals LaunchDarkly supports the ‘filter` query param for filtering, with the following fields: - `notifyMemberIds` filters for only approvals that are assigned to a member in the specified list. For example: `filter=notifyMemberIds anyOf ["memberId1", "memberId2"]`. - `requestorId` filters for only approvals that correspond to the ID of the member who requested the approval. For example: `filter=requestorId equals 457034721476302714390214`. - `resourceId` filters for only approvals that correspond to the the specified resource identifier. For example: `filter=resourceId equals proj/my-project:env/my-environment:flag/my-flag`. - `reviewStatus` filters for only approvals which correspond to the review status in the specified list. The possible values are `approved`, `declined`, and `pending`. For example: `filter=reviewStatus anyOf ["pending", "approved"]`. - `status` filters for only approvals which correspond to the status in the specified list. The possible values are `pending`, `scheduled`, `failed`, and `completed`. For example: `filter=status anyOf ["pending", "scheduled"]`. You can also apply multiple filters at once. For example, setting `filter=projectKey equals my-project, reviewStatus anyOf ["pending","approved"]` matches approval requests which correspond to the `my-project` project key, and a review status of either `pending` or `approved`. ### Expanding approval response LaunchDarkly supports the `expand` query param to include additional fields in the response, with the following fields: - `flag` includes the flag the approval request belongs to - `project` includes the project the approval request belongs to - `environments` includes the environments the approval request relates to For example, `expand=project,flag` includes the `project` and `flag` fields in the response.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :filter (String)

    A comma-separated list of filters. Each filter is of the form &#x60;field operator value&#x60;. Supported fields are explained above.

  • :expand (String)

    A comma-separated list of fields to expand in the response. Supported fields are explained above.

  • :limit (Integer)

    The number of approvals to return. Defaults to -1, which returns all approvals.

  • :offset (Integer)

    Where to start in the list. Use this with pagination. For example, an offset of 10 skips the first ten items and then returns the next items in the list, up to the query &#x60;limit&#x60;.

Returns:



159
160
161
162
# File 'lib/launchdarkly_api/api/approvals_beta_api.rb', line 159

def get_approval_requests(opts = {})
  data, _status_code, _headers = get_approval_requests_with_http_info(opts)
  data
end

#get_approval_requests_with_http_info(opts = {}) ⇒ Array<(ExpandableApprovalRequestsResponse, Integer, Hash)>

List approval requests Get all approval requests. ### Filtering approvals LaunchDarkly supports the &#x60;filter&#x60; query param for filtering, with the following fields: - &#x60;notifyMemberIds&#x60; filters for only approvals that are assigned to a member in the specified list. For example: &#x60;filter&#x3D;notifyMemberIds anyOf [&quot;memberId1&quot;, &quot;memberId2&quot;]&#x60;. - &#x60;requestorId&#x60; filters for only approvals that correspond to the ID of the member who requested the approval. For example: &#x60;filter&#x3D;requestorId equals 457034721476302714390214&#x60;. - &#x60;resourceId&#x60; filters for only approvals that correspond to the the specified resource identifier. For example: &#x60;filter&#x3D;resourceId equals proj/my-project:env/my-environment:flag/my-flag&#x60;. - &#x60;reviewStatus&#x60; filters for only approvals which correspond to the review status in the specified list. The possible values are &#x60;approved&#x60;, &#x60;declined&#x60;, and &#x60;pending&#x60;. For example: &#x60;filter&#x3D;reviewStatus anyOf [&quot;pending&quot;, &quot;approved&quot;]&#x60;. - &#x60;status&#x60; filters for only approvals which correspond to the status in the specified list. The possible values are &#x60;pending&#x60;, &#x60;scheduled&#x60;, &#x60;failed&#x60;, and &#x60;completed&#x60;. For example: &#x60;filter&#x3D;status anyOf [&quot;pending&quot;, &quot;scheduled&quot;]&#x60;. You can also apply multiple filters at once. For example, setting &#x60;filter&#x3D;projectKey equals my-project, reviewStatus anyOf [&quot;pending&quot;,&quot;approved&quot;]&#x60; matches approval requests which correspond to the &#x60;my-project&#x60; project key, and a review status of either &#x60;pending&#x60; or &#x60;approved&#x60;. ### Expanding approval response LaunchDarkly supports the &#x60;expand&#x60; query param to include additional fields in the response, with the following fields: - &#x60;flag&#x60; includes the flag the approval request belongs to - &#x60;project&#x60; includes the project the approval request belongs to - &#x60;environments&#x60; includes the environments the approval request relates to For example, &#x60;expand&#x3D;project,flag&#x60; includes the &#x60;project&#x60; and &#x60;flag&#x60; fields in the response.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :filter (String)

    A comma-separated list of filters. Each filter is of the form &#x60;field operator value&#x60;. Supported fields are explained above.

  • :expand (String)

    A comma-separated list of fields to expand in the response. Supported fields are explained above.

  • :limit (Integer)

    The number of approvals to return. Defaults to -1, which returns all approvals.

  • :offset (Integer)

    Where to start in the list. Use this with pagination. For example, an offset of 10 skips the first ten items and then returns the next items in the list, up to the query &#x60;limit&#x60;.

Returns:



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
213
214
215
216
217
218
# File 'lib/launchdarkly_api/api/approvals_beta_api.rb', line 172

def get_approval_requests_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ApprovalsBetaApi.get_approval_requests ...'
  end
  # resource path
  local_var_path = '/api/v2/approval-requests'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil?
  query_params[:'expand'] = opts[:'expand'] if !opts[:'expand'].nil?
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?

  # 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] || 'ExpandableApprovalRequestsResponse'

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

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

#post_approval_request(create_approval_request_request, opts = {}) ⇒ ApprovalRequestResponse

Create approval request Create an approval request. This endpoint currently supports creating an approval request for a flag across all environments with the following instructions: - ‘addVariation` - `removeVariation` - `updateVariation` - `updateDefaultVariation` For details on using these instructions, read [Update feature flag](/tag/Feature-flags#operation/patchFeatureFlag). To create an approval for a flag specific to an environment, use [Create approval request for a flag](/tag/Approvals#operation/postApprovalRequestForFlag).

Parameters:

Returns:



225
226
227
228
# File 'lib/launchdarkly_api/api/approvals_beta_api.rb', line 225

def post_approval_request(create_approval_request_request, opts = {})
  data, _status_code, _headers = post_approval_request_with_http_info(create_approval_request_request, opts)
  data
end

#post_approval_request_apply(id, post_approval_request_apply_request, opts = {}) ⇒ ApprovalRequestResponse

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

Parameters:

  • id (String)

    The feature flag approval request ID

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

    the optional parameters

Returns:



294
295
296
297
# File 'lib/launchdarkly_api/api/approvals_beta_api.rb', line 294

def post_approval_request_apply(id, post_approval_request_apply_request, opts = {})
  data, _status_code, _headers = post_approval_request_apply_with_http_info(id, post_approval_request_apply_request, opts)
  data
end

#post_approval_request_apply_with_http_info(id, post_approval_request_apply_request, opts = {}) ⇒ Array<(ApprovalRequestResponse, Integer, Hash)>

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

Parameters:

  • id (String)

    The feature flag approval request ID

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

    the optional parameters

Returns:

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

    ApprovalRequestResponse data, response status code and response headers



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
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
# File 'lib/launchdarkly_api/api/approvals_beta_api.rb', line 305

def post_approval_request_apply_with_http_info(id, post_approval_request_apply_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ApprovalsBetaApi.post_approval_request_apply ...'
  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 ApprovalsBetaApi.post_approval_request_apply"
  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 ApprovalsBetaApi.post_approval_request_apply"
  end
  # resource path
  local_var_path = '/api/v2/approval-requests/{id}/apply'.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] || 'ApprovalRequestResponse'

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

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

#post_approval_request_review(id, post_approval_request_review_request, opts = {}) ⇒ ApprovalRequestResponse

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

Parameters:

  • id (String)

    The approval request ID

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

    the optional parameters

Returns:



368
369
370
371
# File 'lib/launchdarkly_api/api/approvals_beta_api.rb', line 368

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

#post_approval_request_review_with_http_info(id, post_approval_request_review_request, opts = {}) ⇒ Array<(ApprovalRequestResponse, Integer, Hash)>

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

Parameters:

  • id (String)

    The approval request ID

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

    the optional parameters

Returns:

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

    ApprovalRequestResponse data, response status code and response headers



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
# File 'lib/launchdarkly_api/api/approvals_beta_api.rb', line 379

def post_approval_request_review_with_http_info(id, post_approval_request_review_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ApprovalsBetaApi.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 ApprovalsBetaApi.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 ApprovalsBetaApi.post_approval_request_review"
  end
  # resource path
  local_var_path = '/api/v2/approval-requests/{id}/reviews'.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] || 'ApprovalRequestResponse'

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

  new_options = opts.merge(
    :operation => :"ApprovalsBetaApi.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: ApprovalsBetaApi#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(create_approval_request_request, opts = {}) ⇒ Array<(ApprovalRequestResponse, Integer, Hash)>

Create approval request Create an approval request. This endpoint currently supports creating an approval request for a flag across all environments with the following instructions: - &#x60;addVariation&#x60; - &#x60;removeVariation&#x60; - &#x60;updateVariation&#x60; - &#x60;updateDefaultVariation&#x60; For details on using these instructions, read [Update feature flag](/tag/Feature-flags#operation/patchFeatureFlag). To create an approval for a flag specific to an environment, use [Create approval request for a flag](/tag/Approvals#operation/postApprovalRequestForFlag).

Parameters:

Returns:

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

    ApprovalRequestResponse data, response status code and response headers



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
274
275
276
277
278
279
280
281
282
283
284
285
286
# File 'lib/launchdarkly_api/api/approvals_beta_api.rb', line 235

def post_approval_request_with_http_info(create_approval_request_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ApprovalsBetaApi.post_approval_request ...'
  end
  # verify the required parameter 'create_approval_request_request' is set
  if @api_client.config.client_side_validation && create_approval_request_request.nil?
    fail ArgumentError, "Missing the required parameter 'create_approval_request_request' when calling ApprovalsBetaApi.post_approval_request"
  end
  # resource path
  local_var_path = '/api/v2/approval-requests'

  # 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_approval_request_request)

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

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

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