Class: LaunchDarklyApi::ReleasePoliciesBetaApi

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ ReleasePoliciesBetaApi

Returns a new instance of ReleasePoliciesBetaApi.



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

def api_client
  @api_client
end

Instance Method Details

#delete_release_policy(ld_api_version, project_key, policy_key, opts = {}) ⇒ nil

Delete a release policy Delete an existing release policy for the specified project.

Parameters:

  • ld_api_version (String)

    Version of the endpoint.

  • project_key (String)

    The project key

  • policy_key (String)

    The human-readable key of the release policy

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

    the optional parameters

Returns:

  • (nil)


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

def delete_release_policy(ld_api_version, project_key, policy_key, opts = {})
  delete_release_policy_with_http_info(ld_api_version, project_key, policy_key, opts)
  nil
end

#delete_release_policy_with_http_info(ld_api_version, project_key, policy_key, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Delete a release policy Delete an existing release policy for the specified project.

Parameters:

  • ld_api_version (String)

    Version of the endpoint.

  • project_key (String)

    The project key

  • policy_key (String)

    The human-readable key of the release policy

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



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

def delete_release_policy_with_http_info(ld_api_version, project_key, policy_key, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ReleasePoliciesBetaApi.delete_release_policy ...'
  end
  # verify the required parameter 'ld_api_version' is set
  if @api_client.config.client_side_validation && ld_api_version.nil?
    fail ArgumentError, "Missing the required parameter 'ld_api_version' when calling ReleasePoliciesBetaApi.delete_release_policy"
  end
  # verify enum value
  allowable_values = ["beta"]
  if @api_client.config.client_side_validation && !allowable_values.include?(ld_api_version)
    fail ArgumentError, "invalid value for \"ld_api_version\", must be one of #{allowable_values}"
  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 ReleasePoliciesBetaApi.delete_release_policy"
  end
  # verify the required parameter 'policy_key' is set
  if @api_client.config.client_side_validation && policy_key.nil?
    fail ArgumentError, "Missing the required parameter 'policy_key' when calling ReleasePoliciesBetaApi.delete_release_policy"
  end
  # resource path
  local_var_path = '/api/v2/projects/{projectKey}/release-policies/{policyKey}'.sub('{' + 'projectKey' + '}', CGI.escape(project_key.to_s)).sub('{' + 'policyKey' + '}', CGI.escape(policy_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']) unless header_params['Accept']
  header_params[:'LD-API-Version'] = ld_api_version

  # 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 => :"ReleasePoliciesBetaApi.delete_release_policy",
    :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: ReleasePoliciesBetaApi#delete_release_policy\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_release_policies(ld_api_version, project_key, opts = {}) ⇒ ReleasePoliciesResponse

List release policies Get a list of release policies for the specified project with optional filtering.

Parameters:

  • ld_api_version (String)

    Version of the endpoint.

  • project_key (String)

    The project key

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

    the optional parameters

Options Hash (opts):

  • :exclude_default (Boolean)

    When true, exclude the default release policy from the response. When false or omitted, include the default policy if an environment filter is present. (default to false)

Returns:



110
111
112
113
# File 'lib/launchdarkly_api/api/release_policies_beta_api.rb', line 110

def get_release_policies(ld_api_version, project_key, opts = {})
  data, _status_code, _headers = get_release_policies_with_http_info(ld_api_version, project_key, opts)
  data
end

#get_release_policies_with_http_info(ld_api_version, project_key, opts = {}) ⇒ Array<(ReleasePoliciesResponse, Integer, Hash)>

List release policies Get a list of release policies for the specified project with optional filtering.

Parameters:

  • ld_api_version (String)

    Version of the endpoint.

  • project_key (String)

    The project key

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

    the optional parameters

Options Hash (opts):

  • :exclude_default (Boolean)

    When true, exclude the default release policy from the response. When false or omitted, include the default policy if an environment filter is present. (default to false)

Returns:

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

    ReleasePoliciesResponse data, response status code and response headers



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
177
178
179
# File 'lib/launchdarkly_api/api/release_policies_beta_api.rb', line 122

def get_release_policies_with_http_info(ld_api_version, project_key, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ReleasePoliciesBetaApi.get_release_policies ...'
  end
  # verify the required parameter 'ld_api_version' is set
  if @api_client.config.client_side_validation && ld_api_version.nil?
    fail ArgumentError, "Missing the required parameter 'ld_api_version' when calling ReleasePoliciesBetaApi.get_release_policies"
  end
  # verify enum value
  allowable_values = ["beta"]
  if @api_client.config.client_side_validation && !allowable_values.include?(ld_api_version)
    fail ArgumentError, "invalid value for \"ld_api_version\", must be one of #{allowable_values}"
  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 ReleasePoliciesBetaApi.get_release_policies"
  end
  # resource path
  local_var_path = '/api/v2/projects/{projectKey}/release-policies'.sub('{' + 'projectKey' + '}', CGI.escape(project_key.to_s))

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

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

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

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

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

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

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

#get_release_policy(ld_api_version, project_key, policy_key, opts = {}) ⇒ ReleasePolicy

Get a release policy by key Retrieve a single release policy by its key for the specified project.

Parameters:

  • ld_api_version (String)

    Version of the endpoint.

  • project_key (String)

    The project key

  • policy_key (String)

    The release policy key

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

    the optional parameters

Returns:



188
189
190
191
# File 'lib/launchdarkly_api/api/release_policies_beta_api.rb', line 188

def get_release_policy(ld_api_version, project_key, policy_key, opts = {})
  data, _status_code, _headers = get_release_policy_with_http_info(ld_api_version, project_key, policy_key, opts)
  data
end

#get_release_policy_with_http_info(ld_api_version, project_key, policy_key, opts = {}) ⇒ Array<(ReleasePolicy, Integer, Hash)>

Get a release policy by key Retrieve a single release policy by its key for the specified project.

Parameters:

  • ld_api_version (String)

    Version of the endpoint.

  • project_key (String)

    The project key

  • policy_key (String)

    The release policy key

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

    the optional parameters

Returns:

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

    ReleasePolicy data, response status code and response headers



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
252
253
254
255
256
257
258
259
260
# File 'lib/launchdarkly_api/api/release_policies_beta_api.rb', line 200

def get_release_policy_with_http_info(ld_api_version, project_key, policy_key, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ReleasePoliciesBetaApi.get_release_policy ...'
  end
  # verify the required parameter 'ld_api_version' is set
  if @api_client.config.client_side_validation && ld_api_version.nil?
    fail ArgumentError, "Missing the required parameter 'ld_api_version' when calling ReleasePoliciesBetaApi.get_release_policy"
  end
  # verify enum value
  allowable_values = ["beta"]
  if @api_client.config.client_side_validation && !allowable_values.include?(ld_api_version)
    fail ArgumentError, "invalid value for \"ld_api_version\", must be one of #{allowable_values}"
  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 ReleasePoliciesBetaApi.get_release_policy"
  end
  # verify the required parameter 'policy_key' is set
  if @api_client.config.client_side_validation && policy_key.nil?
    fail ArgumentError, "Missing the required parameter 'policy_key' when calling ReleasePoliciesBetaApi.get_release_policy"
  end
  # resource path
  local_var_path = '/api/v2/projects/{projectKey}/release-policies/{policyKey}'.sub('{' + 'projectKey' + '}', CGI.escape(project_key.to_s)).sub('{' + 'policyKey' + '}', CGI.escape(policy_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']) unless header_params['Accept']
  header_params[:'LD-API-Version'] = ld_api_version

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

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

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

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

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

#post_release_policies_order(ld_api_version, project_key, request_body, opts = {}) ⇒ Array<ReleasePolicy>

Update the order of existing release policies Update the order of existing release policies for the specified project.

Parameters:

  • ld_api_version (String)

    Version of the endpoint.

  • project_key (String)

    The project key

  • request_body (Array<String>)

    Array of release policy keys in the desired rank order (scoped policies only). These keys must include all of the scoped release policies for the project.

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

    the optional parameters

Returns:



269
270
271
272
# File 'lib/launchdarkly_api/api/release_policies_beta_api.rb', line 269

def post_release_policies_order(ld_api_version, project_key, request_body, opts = {})
  data, _status_code, _headers = post_release_policies_order_with_http_info(ld_api_version, project_key, request_body, opts)
  data
end

#post_release_policies_order_with_http_info(ld_api_version, project_key, request_body, opts = {}) ⇒ Array<(Array<ReleasePolicy>, Integer, Hash)>

Update the order of existing release policies Update the order of existing release policies for the specified project.

Parameters:

  • ld_api_version (String)

    Version of the endpoint.

  • project_key (String)

    The project key

  • request_body (Array<String>)

    Array of release policy keys in the desired rank order (scoped policies only). These keys must include all of the scoped release policies for the project.

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

    the optional parameters

Returns:

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

    Array data, response status code and response headers



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
344
345
346
# File 'lib/launchdarkly_api/api/release_policies_beta_api.rb', line 281

def post_release_policies_order_with_http_info(ld_api_version, project_key, request_body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ReleasePoliciesBetaApi.post_release_policies_order ...'
  end
  # verify the required parameter 'ld_api_version' is set
  if @api_client.config.client_side_validation && ld_api_version.nil?
    fail ArgumentError, "Missing the required parameter 'ld_api_version' when calling ReleasePoliciesBetaApi.post_release_policies_order"
  end
  # verify enum value
  allowable_values = ["beta"]
  if @api_client.config.client_side_validation && !allowable_values.include?(ld_api_version)
    fail ArgumentError, "invalid value for \"ld_api_version\", must be one of #{allowable_values}"
  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 ReleasePoliciesBetaApi.post_release_policies_order"
  end
  # verify the required parameter 'request_body' is set
  if @api_client.config.client_side_validation && request_body.nil?
    fail ArgumentError, "Missing the required parameter 'request_body' when calling ReleasePoliciesBetaApi.post_release_policies_order"
  end
  # resource path
  local_var_path = '/api/v2/projects/{projectKey}/release-policies/order'.sub('{' + 'projectKey' + '}', CGI.escape(project_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']) unless header_params['Accept']
  # 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
  header_params[:'LD-API-Version'] = ld_api_version

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

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

  # return_type
  return_type = opts[:debug_return_type] || 'Array<ReleasePolicy>'

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

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

#post_release_policy(ld_api_version, project_key, post_release_policy_request, opts = {}) ⇒ ReleasePolicy

Create a release policy Create a new release policy for the specified project.

Parameters:

  • ld_api_version (String)

    Version of the endpoint.

  • project_key (String)

    The project key

  • post_release_policy_request (PostReleasePolicyRequest)

    Release policy to create

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

    the optional parameters

Returns:



355
356
357
358
# File 'lib/launchdarkly_api/api/release_policies_beta_api.rb', line 355

def post_release_policy(ld_api_version, project_key, post_release_policy_request, opts = {})
  data, _status_code, _headers = post_release_policy_with_http_info(ld_api_version, project_key, post_release_policy_request, opts)
  data
end

#post_release_policy_with_http_info(ld_api_version, project_key, post_release_policy_request, opts = {}) ⇒ Array<(ReleasePolicy, Integer, Hash)>

Create a release policy Create a new release policy for the specified project.

Parameters:

  • ld_api_version (String)

    Version of the endpoint.

  • project_key (String)

    The project key

  • post_release_policy_request (PostReleasePolicyRequest)

    Release policy to create

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

    the optional parameters

Returns:

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

    ReleasePolicy data, response status code and response headers



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
430
431
432
# File 'lib/launchdarkly_api/api/release_policies_beta_api.rb', line 367

def post_release_policy_with_http_info(ld_api_version, project_key, post_release_policy_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ReleasePoliciesBetaApi.post_release_policy ...'
  end
  # verify the required parameter 'ld_api_version' is set
  if @api_client.config.client_side_validation && ld_api_version.nil?
    fail ArgumentError, "Missing the required parameter 'ld_api_version' when calling ReleasePoliciesBetaApi.post_release_policy"
  end
  # verify enum value
  allowable_values = ["beta"]
  if @api_client.config.client_side_validation && !allowable_values.include?(ld_api_version)
    fail ArgumentError, "invalid value for \"ld_api_version\", must be one of #{allowable_values}"
  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 ReleasePoliciesBetaApi.post_release_policy"
  end
  # verify the required parameter 'post_release_policy_request' is set
  if @api_client.config.client_side_validation && post_release_policy_request.nil?
    fail ArgumentError, "Missing the required parameter 'post_release_policy_request' when calling ReleasePoliciesBetaApi.post_release_policy"
  end
  # resource path
  local_var_path = '/api/v2/projects/{projectKey}/release-policies'.sub('{' + 'projectKey' + '}', CGI.escape(project_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']) unless header_params['Accept']
  # 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
  header_params[:'LD-API-Version'] = ld_api_version

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

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

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

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

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

#put_release_policy(ld_api_version, project_key, policy_key, put_release_policy_request, opts = {}) ⇒ ReleasePolicy

Update a release policy Update an existing release policy for the specified project.

Parameters:

  • ld_api_version (String)

    Version of the endpoint.

  • project_key (String)

    The project key

  • policy_key (String)

    The human-readable key of the release policy

  • put_release_policy_request (PutReleasePolicyRequest)

    Release policy data to update

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

    the optional parameters

Returns:



442
443
444
445
# File 'lib/launchdarkly_api/api/release_policies_beta_api.rb', line 442

def put_release_policy(ld_api_version, project_key, policy_key, put_release_policy_request, opts = {})
  data, _status_code, _headers = put_release_policy_with_http_info(ld_api_version, project_key, policy_key, put_release_policy_request, opts)
  data
end

#put_release_policy_with_http_info(ld_api_version, project_key, policy_key, put_release_policy_request, opts = {}) ⇒ Array<(ReleasePolicy, Integer, Hash)>

Update a release policy Update an existing release policy for the specified project.

Parameters:

  • ld_api_version (String)

    Version of the endpoint.

  • project_key (String)

    The project key

  • policy_key (String)

    The human-readable key of the release policy

  • put_release_policy_request (PutReleasePolicyRequest)

    Release policy data to update

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

    the optional parameters

Returns:

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

    ReleasePolicy data, response status code and response headers



455
456
457
458
459
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
# File 'lib/launchdarkly_api/api/release_policies_beta_api.rb', line 455

def put_release_policy_with_http_info(ld_api_version, project_key, policy_key, put_release_policy_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ReleasePoliciesBetaApi.put_release_policy ...'
  end
  # verify the required parameter 'ld_api_version' is set
  if @api_client.config.client_side_validation && ld_api_version.nil?
    fail ArgumentError, "Missing the required parameter 'ld_api_version' when calling ReleasePoliciesBetaApi.put_release_policy"
  end
  # verify enum value
  allowable_values = ["beta"]
  if @api_client.config.client_side_validation && !allowable_values.include?(ld_api_version)
    fail ArgumentError, "invalid value for \"ld_api_version\", must be one of #{allowable_values}"
  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 ReleasePoliciesBetaApi.put_release_policy"
  end
  # verify the required parameter 'policy_key' is set
  if @api_client.config.client_side_validation && policy_key.nil?
    fail ArgumentError, "Missing the required parameter 'policy_key' when calling ReleasePoliciesBetaApi.put_release_policy"
  end
  # verify the required parameter 'put_release_policy_request' is set
  if @api_client.config.client_side_validation && put_release_policy_request.nil?
    fail ArgumentError, "Missing the required parameter 'put_release_policy_request' when calling ReleasePoliciesBetaApi.put_release_policy"
  end
  # resource path
  local_var_path = '/api/v2/projects/{projectKey}/release-policies/{policyKey}'.sub('{' + 'projectKey' + '}', CGI.escape(project_key.to_s)).sub('{' + 'policyKey' + '}', CGI.escape(policy_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']) unless header_params['Accept']
  # 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
  header_params[:'LD-API-Version'] = ld_api_version

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

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

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

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

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