Class: LaunchDarklyApi::SDKKeysBetaApi

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ SDKKeysBetaApi

Returns a new instance of SDKKeysBetaApi.



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

def api_client
  @api_client
end

Instance Method Details

#delete_sdk_key_by_key(ld_api_version, project_key, environment_key, sdk_key_key, opts = {}) ⇒ nil

Delete SDK key Delete a specific SDK key by its key.

Parameters:

  • ld_api_version (String)

    Version of the endpoint.

  • project_key (String)
  • environment_key (String)
  • sdk_key_key (String)

    The user-defined identifying key of the SDK key. This is used solely to identify an SDK key and is distinct from the value field, which is the actual SDK key value.

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

    the optional parameters

Returns:

  • (nil)


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

def delete_sdk_key_by_key(ld_api_version, project_key, environment_key, sdk_key_key, opts = {})
  delete_sdk_key_by_key_with_http_info(ld_api_version, project_key, environment_key, sdk_key_key, opts)
  nil
end

#delete_sdk_key_by_key_with_http_info(ld_api_version, project_key, environment_key, sdk_key_key, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Delete SDK key Delete a specific SDK key by its key.

Parameters:

  • ld_api_version (String)

    Version of the endpoint.

  • project_key (String)
  • environment_key (String)
  • sdk_key_key (String)

    The user-defined identifying key of the SDK key. This is used solely to identify an SDK key and is distinct from the value field, which is the actual SDK key value.

  • 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
102
103
104
105
106
107
# File 'lib/launchdarkly_api/api/sdk_keys_beta_api.rb', line 43

def delete_sdk_key_by_key_with_http_info(ld_api_version, project_key, environment_key, sdk_key_key, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SDKKeysBetaApi.delete_sdk_key_by_key ...'
  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 SDKKeysBetaApi.delete_sdk_key_by_key"
  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 SDKKeysBetaApi.delete_sdk_key_by_key"
  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 SDKKeysBetaApi.delete_sdk_key_by_key"
  end
  # verify the required parameter 'sdk_key_key' is set
  if @api_client.config.client_side_validation && sdk_key_key.nil?
    fail ArgumentError, "Missing the required parameter 'sdk_key_key' when calling SDKKeysBetaApi.delete_sdk_key_by_key"
  end
  # resource path
  local_var_path = '/api/v2/projects/{projectKey}/environments/{environmentKey}/sdk-keys/{sdkKeyKey}'.sub('{' + 'projectKey' + '}', CGI.escape(project_key.to_s)).sub('{' + 'environmentKey' + '}', CGI.escape(environment_key.to_s)).sub('{' + 'sdkKeyKey' + '}', CGI.escape(sdk_key_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 => :"SDKKeysBetaApi.delete_sdk_key_by_key",
    :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: SDKKeysBetaApi#delete_sdk_key_by_key\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_sdk_key_by_key(ld_api_version, project_key, environment_key, sdk_key_key, opts = {}) ⇒ SdkKey

Get SDK key Get a specific SDK key by its key.

Parameters:

  • ld_api_version (String)

    Version of the endpoint.

  • project_key (String)
  • environment_key (String)
  • sdk_key_key (String)

    The user-defined identifying key of the SDK key. This is used solely to identify an SDK key and is distinct from the value field, which is the actual SDK key value.

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

    the optional parameters

Returns:



117
118
119
120
# File 'lib/launchdarkly_api/api/sdk_keys_beta_api.rb', line 117

def get_sdk_key_by_key(ld_api_version, project_key, environment_key, sdk_key_key, opts = {})
  data, _status_code, _headers = get_sdk_key_by_key_with_http_info(ld_api_version, project_key, environment_key, sdk_key_key, opts)
  data
end

#get_sdk_key_by_key_with_http_info(ld_api_version, project_key, environment_key, sdk_key_key, opts = {}) ⇒ Array<(SdkKey, Integer, Hash)>

Get SDK key Get a specific SDK key by its key.

Parameters:

  • ld_api_version (String)

    Version of the endpoint.

  • project_key (String)
  • environment_key (String)
  • sdk_key_key (String)

    The user-defined identifying key of the SDK key. This is used solely to identify an SDK key and is distinct from the value field, which is the actual SDK key value.

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

    the optional parameters

Returns:

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

    SdkKey data, response status code and response headers



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
183
184
185
186
187
188
189
190
191
192
193
194
# File 'lib/launchdarkly_api/api/sdk_keys_beta_api.rb', line 130

def get_sdk_key_by_key_with_http_info(ld_api_version, project_key, environment_key, sdk_key_key, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SDKKeysBetaApi.get_sdk_key_by_key ...'
  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 SDKKeysBetaApi.get_sdk_key_by_key"
  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 SDKKeysBetaApi.get_sdk_key_by_key"
  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 SDKKeysBetaApi.get_sdk_key_by_key"
  end
  # verify the required parameter 'sdk_key_key' is set
  if @api_client.config.client_side_validation && sdk_key_key.nil?
    fail ArgumentError, "Missing the required parameter 'sdk_key_key' when calling SDKKeysBetaApi.get_sdk_key_by_key"
  end
  # resource path
  local_var_path = '/api/v2/projects/{projectKey}/environments/{environmentKey}/sdk-keys/{sdkKeyKey}'.sub('{' + 'projectKey' + '}', CGI.escape(project_key.to_s)).sub('{' + 'environmentKey' + '}', CGI.escape(environment_key.to_s)).sub('{' + 'sdkKeyKey' + '}', CGI.escape(sdk_key_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] || 'SdkKey'

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

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

#patch_sdk_key_by_key(ld_api_version, project_key, environment_key, sdk_key_key, sdk_key_patch, opts = {}) ⇒ SdkKey

Update SDK key Update a an existing SDK key by its identifying key.

Parameters:

  • ld_api_version (String)

    Version of the endpoint.

  • project_key (String)
  • environment_key (String)
  • sdk_key_key (String)

    The user-defined identifying key of the SDK key. This is used solely to identify an SDK key and is distinct from the value field, which is the actual SDK key value.

  • sdk_key_patch (SdkKeyPatch)

    An array of patches for updating an existing SDK key. The following fields are supported: `name`, `description`, `expiry`.

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

    the optional parameters

Options Hash (opts):

  • :version (Integer)

    The version of the SDK key for optimistic locking. If provided, the update will only succeed if the current version matches.

Returns:



206
207
208
209
# File 'lib/launchdarkly_api/api/sdk_keys_beta_api.rb', line 206

def patch_sdk_key_by_key(ld_api_version, project_key, environment_key, sdk_key_key, sdk_key_patch, opts = {})
  data, _status_code, _headers = patch_sdk_key_by_key_with_http_info(ld_api_version, project_key, environment_key, sdk_key_key, sdk_key_patch, opts)
  data
end

#patch_sdk_key_by_key_with_http_info(ld_api_version, project_key, environment_key, sdk_key_key, sdk_key_patch, opts = {}) ⇒ Array<(SdkKey, Integer, Hash)>

Update SDK key Update a an existing SDK key by its identifying key.

Parameters:

  • ld_api_version (String)

    Version of the endpoint.

  • project_key (String)
  • environment_key (String)
  • sdk_key_key (String)

    The user-defined identifying key of the SDK key. This is used solely to identify an SDK key and is distinct from the value field, which is the actual SDK key value.

  • sdk_key_patch (SdkKeyPatch)

    An array of patches for updating an existing SDK key. The following fields are supported: `name`, `description`, `expiry`.

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

    the optional parameters

Options Hash (opts):

  • :version (Integer)

    The version of the SDK key for optimistic locking. If provided, the update will only succeed if the current version matches.

Returns:

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

    SdkKey data, response status code and response headers



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
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
287
288
289
290
291
292
293
294
295
# File 'lib/launchdarkly_api/api/sdk_keys_beta_api.rb', line 221

def patch_sdk_key_by_key_with_http_info(ld_api_version, project_key, environment_key, sdk_key_key, sdk_key_patch, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SDKKeysBetaApi.patch_sdk_key_by_key ...'
  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 SDKKeysBetaApi.patch_sdk_key_by_key"
  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 SDKKeysBetaApi.patch_sdk_key_by_key"
  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 SDKKeysBetaApi.patch_sdk_key_by_key"
  end
  # verify the required parameter 'sdk_key_key' is set
  if @api_client.config.client_side_validation && sdk_key_key.nil?
    fail ArgumentError, "Missing the required parameter 'sdk_key_key' when calling SDKKeysBetaApi.patch_sdk_key_by_key"
  end
  # verify the required parameter 'sdk_key_patch' is set
  if @api_client.config.client_side_validation && sdk_key_patch.nil?
    fail ArgumentError, "Missing the required parameter 'sdk_key_patch' when calling SDKKeysBetaApi.patch_sdk_key_by_key"
  end
  # resource path
  local_var_path = '/api/v2/projects/{projectKey}/environments/{environmentKey}/sdk-keys/{sdkKeyKey}'.sub('{' + 'projectKey' + '}', CGI.escape(project_key.to_s)).sub('{' + 'environmentKey' + '}', CGI.escape(environment_key.to_s)).sub('{' + 'sdkKeyKey' + '}', CGI.escape(sdk_key_key.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'version'] = opts[:'version'] if !opts[:'version'].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']
  # 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(sdk_key_patch)

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

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

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

#post_sdk_key(ld_api_version, project_key, environment_key, sdk_key_post, opts = {}) ⇒ SdkKey

Create SDK key Create a new server-side or mobile SDK key.

Parameters:

  • ld_api_version (String)

    Version of the endpoint.

  • project_key (String)
  • environment_key (String)
  • sdk_key_post (SdkKeyPost)

    Parameters for creating a new SDK key

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

    the optional parameters

Returns:



305
306
307
308
# File 'lib/launchdarkly_api/api/sdk_keys_beta_api.rb', line 305

def post_sdk_key(ld_api_version, project_key, environment_key, sdk_key_post, opts = {})
  data, _status_code, _headers = post_sdk_key_with_http_info(ld_api_version, project_key, environment_key, sdk_key_post, opts)
  data
end

#post_sdk_key_with_http_info(ld_api_version, project_key, environment_key, sdk_key_post, opts = {}) ⇒ Array<(SdkKey, Integer, Hash)>

Create SDK key Create a new server-side or mobile SDK key.

Parameters:

  • ld_api_version (String)

    Version of the endpoint.

  • project_key (String)
  • environment_key (String)
  • sdk_key_post (SdkKeyPost)

    Parameters for creating a new SDK key

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

    the optional parameters

Returns:

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

    SdkKey data, response status code and response headers



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
361
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
# File 'lib/launchdarkly_api/api/sdk_keys_beta_api.rb', line 318

def post_sdk_key_with_http_info(ld_api_version, project_key, environment_key, sdk_key_post, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SDKKeysBetaApi.post_sdk_key ...'
  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 SDKKeysBetaApi.post_sdk_key"
  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 SDKKeysBetaApi.post_sdk_key"
  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 SDKKeysBetaApi.post_sdk_key"
  end
  # verify the required parameter 'sdk_key_post' is set
  if @api_client.config.client_side_validation && sdk_key_post.nil?
    fail ArgumentError, "Missing the required parameter 'sdk_key_post' when calling SDKKeysBetaApi.post_sdk_key"
  end
  # resource path
  local_var_path = '/api/v2/projects/{projectKey}/environments/{environmentKey}/sdk-keys'.sub('{' + 'projectKey' + '}', CGI.escape(project_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']) 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(sdk_key_post)

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

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

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