Class: LinodeOpenapiClient::ProfileApi

Inherits:
Object
  • Object
show all
Defined in:
lib/linode_openapi_client/api/profile_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ ProfileApi

Returns a new instance of ProfileApi.



19
20
21
# File 'lib/linode_openapi_client/api/profile_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/linode_openapi_client/api/profile_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#delete_personal_access_token(api_version, token_id, opts = {}) ⇒ Object

Revoke a personal access token Revokes a Personal Access Token. The token will be invalidated immediately, and requests using that token will fail with a 401. It is possible to revoke access to the token making the request to revoke a token, but keep in mind that doing so could lose you access to the api and require you to create a new token through some other means. <<LB>> — - __CLI__. “‘ linode-cli profile token-delete 123 “` [Learn more…](www.linode.com/docs/products/tools/cli/get-started/) - __OAuth scopes__. “` account:read_write “` [Learn more…](techdocs.akamai.com/linode-api/reference/get-started#oauth)

Parameters:

  • api_version (String)

    __Enum__ Call either the &#x60;v4&#x60; URL, or &#x60;v4beta&#x60; for operations still in Beta.

  • token_id (Integer)

    The ID of the token to access.

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

    the optional parameters

Returns:

  • (Object)


28
29
30
31
# File 'lib/linode_openapi_client/api/profile_api.rb', line 28

def delete_personal_access_token(api_version, token_id, opts = {})
  data, _status_code, _headers = delete_personal_access_token_with_http_info(api_version, token_id, opts)
  data
end

#delete_personal_access_token_with_http_info(api_version, token_id, opts = {}) ⇒ Array<(Object, Integer, Hash)>

Revoke a personal access token Revokes a Personal Access Token. The token will be invalidated immediately, and requests using that token will fail with a 401. It is possible to revoke access to the token making the request to revoke a token, but keep in mind that doing so could lose you access to the api and require you to create a new token through some other means. &lt;&lt;LB&gt;&gt; — - __CLI__. &#x60;&#x60;&#x60; linode-cli profile token-delete 123 &#x60;&#x60;&#x60; [Learn more…](www.linode.com/docs/products/tools/cli/get-started/) - __OAuth scopes__. &#x60;&#x60;&#x60; account:read_write &#x60;&#x60;&#x60; [Learn more…](techdocs.akamai.com/linode-api/reference/get-started#oauth)

Parameters:

  • api_version (String)

    __Enum__ Call either the &#x60;v4&#x60; URL, or &#x60;v4beta&#x60; for operations still in Beta.

  • token_id (Integer)

    The ID of the token to access.

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

    the optional parameters

Returns:

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

    Object data, response status code and response headers



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
84
85
86
87
88
89
90
91
92
93
94
# File 'lib/linode_openapi_client/api/profile_api.rb', line 39

def delete_personal_access_token_with_http_info(api_version, token_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProfileApi.delete_personal_access_token ...'
  end
  # verify the required parameter 'api_version' is set
  if @api_client.config.client_side_validation && api_version.nil?
    fail ArgumentError, "Missing the required parameter 'api_version' when calling ProfileApi.delete_personal_access_token"
  end
  # verify enum value
  allowable_values = ["v4", "v4beta"]
  if @api_client.config.client_side_validation && !allowable_values.include?(api_version)
    fail ArgumentError, "invalid value for \"api_version\", must be one of #{allowable_values}"
  end
  # verify the required parameter 'token_id' is set
  if @api_client.config.client_side_validation && token_id.nil?
    fail ArgumentError, "Missing the required parameter 'token_id' when calling ProfileApi.delete_personal_access_token"
  end
  # resource path
  local_var_path = '/{apiVersion}/profile/tokens/{tokenId}'.sub('{' + 'apiVersion' + '}', CGI.escape(api_version.to_s)).sub('{' + 'tokenId' + '}', CGI.escape(token_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']) unless header_params['Accept']

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

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

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

  # auth_names
  auth_names = opts[:debug_auth_names] || ['personalAccessToken', 'oauth']

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

#delete_profile_app(api_version, app_id, opts = {}) ⇒ Object

Revoke app access Expires this app token. This token may no longer be used to access your Account. <<LB>> — - __CLI__. “‘ linode-cli profile app-delete 123 “` [Learn more…](www.linode.com/docs/products/tools/cli/get-started/) - __OAuth scopes__. “` account:read_write “` [Learn more…](techdocs.akamai.com/linode-api/reference/get-started#oauth)

Parameters:

  • api_version (String)

    __Enum__ Call either the &#x60;v4&#x60; URL, or &#x60;v4beta&#x60; for operations still in Beta.

  • app_id (Integer)

    The authorized app ID to manage.

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

    the optional parameters

Returns:

  • (Object)


102
103
104
105
# File 'lib/linode_openapi_client/api/profile_api.rb', line 102

def delete_profile_app(api_version, app_id, opts = {})
  data, _status_code, _headers = delete_profile_app_with_http_info(api_version, app_id, opts)
  data
end

#delete_profile_app_with_http_info(api_version, app_id, opts = {}) ⇒ Array<(Object, Integer, Hash)>

Revoke app access Expires this app token. This token may no longer be used to access your Account. &lt;&lt;LB&gt;&gt; — - __CLI__. &#x60;&#x60;&#x60; linode-cli profile app-delete 123 &#x60;&#x60;&#x60; [Learn more…](www.linode.com/docs/products/tools/cli/get-started/) - __OAuth scopes__. &#x60;&#x60;&#x60; account:read_write &#x60;&#x60;&#x60; [Learn more…](techdocs.akamai.com/linode-api/reference/get-started#oauth)

Parameters:

  • api_version (String)

    __Enum__ Call either the &#x60;v4&#x60; URL, or &#x60;v4beta&#x60; for operations still in Beta.

  • app_id (Integer)

    The authorized app ID to manage.

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

    the optional parameters

Returns:

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

    Object data, response status code and response headers



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
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
# File 'lib/linode_openapi_client/api/profile_api.rb', line 113

def delete_profile_app_with_http_info(api_version, app_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProfileApi.delete_profile_app ...'
  end
  # verify the required parameter 'api_version' is set
  if @api_client.config.client_side_validation && api_version.nil?
    fail ArgumentError, "Missing the required parameter 'api_version' when calling ProfileApi.delete_profile_app"
  end
  # verify enum value
  allowable_values = ["v4", "v4beta"]
  if @api_client.config.client_side_validation && !allowable_values.include?(api_version)
    fail ArgumentError, "invalid value for \"api_version\", must be one of #{allowable_values}"
  end
  # verify the required parameter 'app_id' is set
  if @api_client.config.client_side_validation && app_id.nil?
    fail ArgumentError, "Missing the required parameter 'app_id' when calling ProfileApi.delete_profile_app"
  end
  # resource path
  local_var_path = '/{apiVersion}/profile/apps/{appId}'.sub('{' + 'apiVersion' + '}', CGI.escape(api_version.to_s)).sub('{' + 'appId' + '}', CGI.escape(app_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']) unless header_params['Accept']

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

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

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

  # auth_names
  auth_names = opts[:debug_auth_names] || ['personalAccessToken', 'oauth']

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

#delete_profile_phone_number(api_version, opts = {}) ⇒ Object

Delete a phone number Delete the verified phone number for the User making this request. Use this operation to opt out of SMS messages for the requesting User after a phone number has been verified with the [Verify a phone number](techdocs.akamai.com/linode-api/reference/post-profile-phone-number-verify) operation. <<LB>> — - __CLI__. “‘ linode-cli phone delete “` [Learn more…](www.linode.com/docs/products/tools/cli/get-started/) - __OAuth scopes__. “` account:read_write “` [Learn more…](techdocs.akamai.com/linode-api/reference/get-started#oauth)

Parameters:

  • api_version (String)

    __Enum__ Call either the &#x60;v4&#x60; URL, or &#x60;v4beta&#x60; for operations still in Beta.

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

    the optional parameters

Returns:

  • (Object)


175
176
177
178
# File 'lib/linode_openapi_client/api/profile_api.rb', line 175

def delete_profile_phone_number(api_version, opts = {})
  data, _status_code, _headers = delete_profile_phone_number_with_http_info(api_version, opts)
  data
end

#delete_profile_phone_number_with_http_info(api_version, opts = {}) ⇒ Array<(Object, Integer, Hash)>

Delete a phone number Delete the verified phone number for the User making this request. Use this operation to opt out of SMS messages for the requesting User after a phone number has been verified with the [Verify a phone number](techdocs.akamai.com/linode-api/reference/post-profile-phone-number-verify) operation. &lt;&lt;LB&gt;&gt; — - __CLI__. &#x60;&#x60;&#x60; linode-cli phone delete &#x60;&#x60;&#x60; [Learn more…](www.linode.com/docs/products/tools/cli/get-started/) - __OAuth scopes__. &#x60;&#x60;&#x60; account:read_write &#x60;&#x60;&#x60; [Learn more…](techdocs.akamai.com/linode-api/reference/get-started#oauth)

Parameters:

  • api_version (String)

    __Enum__ Call either the &#x60;v4&#x60; URL, or &#x60;v4beta&#x60; for operations still in Beta.

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

    the optional parameters

Returns:

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

    Object data, response status code and response headers



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
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
# File 'lib/linode_openapi_client/api/profile_api.rb', line 185

def delete_profile_phone_number_with_http_info(api_version, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProfileApi.delete_profile_phone_number ...'
  end
  # verify the required parameter 'api_version' is set
  if @api_client.config.client_side_validation && api_version.nil?
    fail ArgumentError, "Missing the required parameter 'api_version' when calling ProfileApi.delete_profile_phone_number"
  end
  # verify enum value
  allowable_values = ["v4", "v4beta"]
  if @api_client.config.client_side_validation && !allowable_values.include?(api_version)
    fail ArgumentError, "invalid value for \"api_version\", must be one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/{apiVersion}/profile/phone-number'.sub('{' + 'apiVersion' + '}', CGI.escape(api_version.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']

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

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

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

  # auth_names
  auth_names = opts[:debug_auth_names] || ['personalAccessToken', 'oauth']

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

#delete_ssh_key(api_version, ssh_key_id, opts = {}) ⇒ Object

Delete an SSH key Deletes an SSH Key you have access to. __Note__. deleting an SSH Key will not remove it from any Linode or Disk that was deployed with ‘authorized_keys`. In those cases, the keys must be manually deleted on the Linode or Disk. This operation will only delete the key’s association from your Profile. <<LB>> — - __CLI__. “‘ linode-cli sshkeys delete 42 “` [Learn more…](www.linode.com/docs/products/tools/cli/get-started/) - __OAuth scopes__. “` account:read_write “` [Learn more…](techdocs.akamai.com/linode-api/reference/get-started#oauth)

Parameters:

  • api_version (String)

    __Enum__ Call either the &#x60;v4&#x60; URL, or &#x60;v4beta&#x60; for operations still in Beta.

  • ssh_key_id (Integer)

    The ID of the SSHKey.

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

    the optional parameters

Returns:

  • (Object)


244
245
246
247
# File 'lib/linode_openapi_client/api/profile_api.rb', line 244

def delete_ssh_key(api_version, ssh_key_id, opts = {})
  data, _status_code, _headers = delete_ssh_key_with_http_info(api_version, ssh_key_id, opts)
  data
end

#delete_ssh_key_with_http_info(api_version, ssh_key_id, opts = {}) ⇒ Array<(Object, Integer, Hash)>

Delete an SSH key Deletes an SSH Key you have access to. __Note__. deleting an SSH Key will not remove it from any Linode or Disk that was deployed with &#x60;authorized_keys&#x60;. In those cases, the keys must be manually deleted on the Linode or Disk. This operation will only delete the key&#39;s association from your Profile. &lt;&lt;LB&gt;&gt; — - __CLI__. &#x60;&#x60;&#x60; linode-cli sshkeys delete 42 &#x60;&#x60;&#x60; [Learn more…](www.linode.com/docs/products/tools/cli/get-started/) - __OAuth scopes__. &#x60;&#x60;&#x60; account:read_write &#x60;&#x60;&#x60; [Learn more…](techdocs.akamai.com/linode-api/reference/get-started#oauth)

Parameters:

  • api_version (String)

    __Enum__ Call either the &#x60;v4&#x60; URL, or &#x60;v4beta&#x60; for operations still in Beta.

  • ssh_key_id (Integer)

    The ID of the SSHKey.

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

    the optional parameters

Returns:

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

    Object data, response status code and response headers



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
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
# File 'lib/linode_openapi_client/api/profile_api.rb', line 255

def delete_ssh_key_with_http_info(api_version, ssh_key_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProfileApi.delete_ssh_key ...'
  end
  # verify the required parameter 'api_version' is set
  if @api_client.config.client_side_validation && api_version.nil?
    fail ArgumentError, "Missing the required parameter 'api_version' when calling ProfileApi.delete_ssh_key"
  end
  # verify enum value
  allowable_values = ["v4", "v4beta"]
  if @api_client.config.client_side_validation && !allowable_values.include?(api_version)
    fail ArgumentError, "invalid value for \"api_version\", must be one of #{allowable_values}"
  end
  # verify the required parameter 'ssh_key_id' is set
  if @api_client.config.client_side_validation && ssh_key_id.nil?
    fail ArgumentError, "Missing the required parameter 'ssh_key_id' when calling ProfileApi.delete_ssh_key"
  end
  # resource path
  local_var_path = '/{apiVersion}/profile/sshkeys/{sshKeyId}'.sub('{' + 'apiVersion' + '}', CGI.escape(api_version.to_s)).sub('{' + 'sshKeyId' + '}', CGI.escape(ssh_key_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']) unless header_params['Accept']

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

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

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

  # auth_names
  auth_names = opts[:debug_auth_names] || ['personalAccessToken', 'oauth']

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

#delete_trusted_device(api_version, device_id, opts = {}) ⇒ Object

Revoke a trusted device Revoke an active TrustedDevice for your User. Once a TrustedDevice is revoked, this device will have to log in again before accessing your Linode account. <<LB>> — - __CLI__. “‘ linode-cli profile device-revoke 123 “` [Learn more…](www.linode.com/docs/products/tools/cli/get-started/) - __OAuth scopes__. “` account:read_write “` [Learn more…](techdocs.akamai.com/linode-api/reference/get-started#oauth)

Parameters:

  • api_version (String)

    __Enum__ Call either the &#x60;v4&#x60; URL, or &#x60;v4beta&#x60; for operations still in Beta.

  • device_id (Integer)

    The ID of the TrustedDevice.

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

    the optional parameters

Returns:

  • (Object)


318
319
320
321
# File 'lib/linode_openapi_client/api/profile_api.rb', line 318

def delete_trusted_device(api_version, device_id, opts = {})
  data, _status_code, _headers = delete_trusted_device_with_http_info(api_version, device_id, opts)
  data
end

#delete_trusted_device_with_http_info(api_version, device_id, opts = {}) ⇒ Array<(Object, Integer, Hash)>

Revoke a trusted device Revoke an active TrustedDevice for your User. Once a TrustedDevice is revoked, this device will have to log in again before accessing your Linode account. &lt;&lt;LB&gt;&gt; — - __CLI__. &#x60;&#x60;&#x60; linode-cli profile device-revoke 123 &#x60;&#x60;&#x60; [Learn more…](www.linode.com/docs/products/tools/cli/get-started/) - __OAuth scopes__. &#x60;&#x60;&#x60; account:read_write &#x60;&#x60;&#x60; [Learn more…](techdocs.akamai.com/linode-api/reference/get-started#oauth)

Parameters:

  • api_version (String)

    __Enum__ Call either the &#x60;v4&#x60; URL, or &#x60;v4beta&#x60; for operations still in Beta.

  • device_id (Integer)

    The ID of the TrustedDevice.

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

    the optional parameters

Returns:

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

    Object data, response status code and response headers



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
# File 'lib/linode_openapi_client/api/profile_api.rb', line 329

def delete_trusted_device_with_http_info(api_version, device_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProfileApi.delete_trusted_device ...'
  end
  # verify the required parameter 'api_version' is set
  if @api_client.config.client_side_validation && api_version.nil?
    fail ArgumentError, "Missing the required parameter 'api_version' when calling ProfileApi.delete_trusted_device"
  end
  # verify enum value
  allowable_values = ["v4", "v4beta"]
  if @api_client.config.client_side_validation && !allowable_values.include?(api_version)
    fail ArgumentError, "invalid value for \"api_version\", must be one of #{allowable_values}"
  end
  # verify the required parameter 'device_id' is set
  if @api_client.config.client_side_validation && device_id.nil?
    fail ArgumentError, "Missing the required parameter 'device_id' when calling ProfileApi.delete_trusted_device"
  end
  # resource path
  local_var_path = '/{apiVersion}/profile/devices/{deviceId}'.sub('{' + 'apiVersion' + '}', CGI.escape(api_version.to_s)).sub('{' + 'deviceId' + '}', CGI.escape(device_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']) unless header_params['Accept']

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

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

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

  # auth_names
  auth_names = opts[:debug_auth_names] || ['personalAccessToken', 'oauth']

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

#get_devices(api_version, opts = {}) ⇒ GetDevices200Response

List trusted devices Returns a paginated list of active TrustedDevices for your User. Browsers with an active Remember Me Session are logged into your account until the session expires or is revoked. <<LB>> — - __CLI__. “‘ linode-cli profile devices-list “` [Learn more…](www.linode.com/docs/products/tools/cli/get-started/) - __OAuth scopes__. “` account:read_only “` [Learn more…](techdocs.akamai.com/linode-api/reference/get-started#oauth)

Parameters:

  • api_version (String)

    __Enum__ Call either the &#x60;v4&#x60; URL, or &#x60;v4beta&#x60; for operations still in Beta.

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

    the optional parameters

Returns:



391
392
393
394
# File 'lib/linode_openapi_client/api/profile_api.rb', line 391

def get_devices(api_version, opts = {})
  data, _status_code, _headers = get_devices_with_http_info(api_version, opts)
  data
end

#get_devices_with_http_info(api_version, opts = {}) ⇒ Array<(GetDevices200Response, Integer, Hash)>

List trusted devices Returns a paginated list of active TrustedDevices for your User. Browsers with an active Remember Me Session are logged into your account until the session expires or is revoked. &lt;&lt;LB&gt;&gt; — - __CLI__. &#x60;&#x60;&#x60; linode-cli profile devices-list &#x60;&#x60;&#x60; [Learn more…](www.linode.com/docs/products/tools/cli/get-started/) - __OAuth scopes__. &#x60;&#x60;&#x60; account:read_only &#x60;&#x60;&#x60; [Learn more…](techdocs.akamai.com/linode-api/reference/get-started#oauth)

Parameters:

  • api_version (String)

    __Enum__ Call either the &#x60;v4&#x60; URL, or &#x60;v4beta&#x60; for operations still in Beta.

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

    the optional parameters

Returns:

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

    GetDevices200Response data, response status code and response headers



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
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
# File 'lib/linode_openapi_client/api/profile_api.rb', line 401

def get_devices_with_http_info(api_version, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProfileApi.get_devices ...'
  end
  # verify the required parameter 'api_version' is set
  if @api_client.config.client_side_validation && api_version.nil?
    fail ArgumentError, "Missing the required parameter 'api_version' when calling ProfileApi.get_devices"
  end
  # verify enum value
  allowable_values = ["v4", "v4beta"]
  if @api_client.config.client_side_validation && !allowable_values.include?(api_version)
    fail ArgumentError, "invalid value for \"api_version\", must be one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/{apiVersion}/profile/devices'.sub('{' + 'apiVersion' + '}', CGI.escape(api_version.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']

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

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

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

  # auth_names
  auth_names = opts[:debug_auth_names] || ['personalAccessToken', 'oauth']

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

#get_personal_access_token(api_version, token_id, opts = {}) ⇒ GetPersonalAccessToken200Response

Get a personal access token Returns a single Personal Access Token. <<LB>> — - __CLI__. “‘ linode-cli profile token-view 123 “` [Learn more…](www.linode.com/docs/products/tools/cli/get-started/) - __OAuth scopes__. “` account:read_only “` [Learn more…](techdocs.akamai.com/linode-api/reference/get-started#oauth)

Parameters:

  • api_version (String)

    __Enum__ Call either the &#x60;v4&#x60; URL, or &#x60;v4beta&#x60; for operations still in Beta.

  • token_id (Integer)

    The ID of the token to access.

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

    the optional parameters

Returns:



460
461
462
463
# File 'lib/linode_openapi_client/api/profile_api.rb', line 460

def get_personal_access_token(api_version, token_id, opts = {})
  data, _status_code, _headers = get_personal_access_token_with_http_info(api_version, token_id, opts)
  data
end

#get_personal_access_token_with_http_info(api_version, token_id, opts = {}) ⇒ Array<(GetPersonalAccessToken200Response, Integer, Hash)>

Get a personal access token Returns a single Personal Access Token. &lt;&lt;LB&gt;&gt; — - __CLI__. &#x60;&#x60;&#x60; linode-cli profile token-view 123 &#x60;&#x60;&#x60; [Learn more…](www.linode.com/docs/products/tools/cli/get-started/) - __OAuth scopes__. &#x60;&#x60;&#x60; account:read_only &#x60;&#x60;&#x60; [Learn more…](techdocs.akamai.com/linode-api/reference/get-started#oauth)

Parameters:

  • api_version (String)

    __Enum__ Call either the &#x60;v4&#x60; URL, or &#x60;v4beta&#x60; for operations still in Beta.

  • token_id (Integer)

    The ID of the token to access.

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

    the optional parameters

Returns:



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
# File 'lib/linode_openapi_client/api/profile_api.rb', line 471

def get_personal_access_token_with_http_info(api_version, token_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProfileApi.get_personal_access_token ...'
  end
  # verify the required parameter 'api_version' is set
  if @api_client.config.client_side_validation && api_version.nil?
    fail ArgumentError, "Missing the required parameter 'api_version' when calling ProfileApi.get_personal_access_token"
  end
  # verify enum value
  allowable_values = ["v4", "v4beta"]
  if @api_client.config.client_side_validation && !allowable_values.include?(api_version)
    fail ArgumentError, "invalid value for \"api_version\", must be one of #{allowable_values}"
  end
  # verify the required parameter 'token_id' is set
  if @api_client.config.client_side_validation && token_id.nil?
    fail ArgumentError, "Missing the required parameter 'token_id' when calling ProfileApi.get_personal_access_token"
  end
  # resource path
  local_var_path = '/{apiVersion}/profile/tokens/{tokenId}'.sub('{' + 'apiVersion' + '}', CGI.escape(api_version.to_s)).sub('{' + 'tokenId' + '}', CGI.escape(token_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']) unless header_params['Accept']

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

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

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

  # auth_names
  auth_names = opts[:debug_auth_names] || ['personalAccessToken', 'oauth']

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

#get_personal_access_tokens(api_version, opts = {}) ⇒ GetPersonalAccessTokens200Response

List personal access tokens Returns a paginated list of Personal Access Tokens currently active for your User. <<LB>> — - __CLI__. “‘ linode-cli profile tokens-list “` [Learn more…](www.linode.com/docs/products/tools/cli/get-started/) - __OAuth scopes__. “` account:read_only “` [Learn more…](techdocs.akamai.com/linode-api/reference/get-started#oauth)

Parameters:

  • api_version (String)

    __Enum__ Call either the &#x60;v4&#x60; URL, or &#x60;v4beta&#x60; for operations still in Beta.

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

    the optional parameters

Returns:



533
534
535
536
# File 'lib/linode_openapi_client/api/profile_api.rb', line 533

def get_personal_access_tokens(api_version, opts = {})
  data, _status_code, _headers = get_personal_access_tokens_with_http_info(api_version, opts)
  data
end

#get_personal_access_tokens_with_http_info(api_version, opts = {}) ⇒ Array<(GetPersonalAccessTokens200Response, Integer, Hash)>

List personal access tokens Returns a paginated list of Personal Access Tokens currently active for your User. &lt;&lt;LB&gt;&gt; — - __CLI__. &#x60;&#x60;&#x60; linode-cli profile tokens-list &#x60;&#x60;&#x60; [Learn more…](www.linode.com/docs/products/tools/cli/get-started/) - __OAuth scopes__. &#x60;&#x60;&#x60; account:read_only &#x60;&#x60;&#x60; [Learn more…](techdocs.akamai.com/linode-api/reference/get-started#oauth)

Parameters:

  • api_version (String)

    __Enum__ Call either the &#x60;v4&#x60; URL, or &#x60;v4beta&#x60; for operations still in Beta.

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

    the optional parameters

Returns:



543
544
545
546
547
548
549
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
# File 'lib/linode_openapi_client/api/profile_api.rb', line 543

def get_personal_access_tokens_with_http_info(api_version, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProfileApi.get_personal_access_tokens ...'
  end
  # verify the required parameter 'api_version' is set
  if @api_client.config.client_side_validation && api_version.nil?
    fail ArgumentError, "Missing the required parameter 'api_version' when calling ProfileApi.get_personal_access_tokens"
  end
  # verify enum value
  allowable_values = ["v4", "v4beta"]
  if @api_client.config.client_side_validation && !allowable_values.include?(api_version)
    fail ArgumentError, "invalid value for \"api_version\", must be one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/{apiVersion}/profile/tokens'.sub('{' + 'apiVersion' + '}', CGI.escape(api_version.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']

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

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

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

  # auth_names
  auth_names = opts[:debug_auth_names] || ['personalAccessToken', 'oauth']

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

#get_profile(api_version, opts = {}) ⇒ GetProfile200Response

Get a profile Returns information about the current User. This can be used to see who is acting in applications where more than one token is managed. For example, in third-party OAuth applications. This operation is always accessible, no matter what OAuth scopes the acting token has. <<LB>> — - __CLI__. “‘ linode-cli profile view “` [Learn more…](www.linode.com/docs/products/tools/cli/get-started/)

Parameters:

  • api_version (String)

    __Enum__ Call either the &#x60;v4&#x60; URL, or &#x60;v4beta&#x60; for operations still in Beta.

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

    the optional parameters

Returns:



601
602
603
604
# File 'lib/linode_openapi_client/api/profile_api.rb', line 601

def get_profile(api_version, opts = {})
  data, _status_code, _headers = get_profile_with_http_info(api_version, opts)
  data
end

#get_profile_app(api_version, app_id, opts = {}) ⇒ GetProfileApp200Response

Get an authorized app Returns information about a single app you’ve authorized to access your Account. <<LB>> — - __CLI__. “‘ linode-cli profile app-view 1234 “` [Learn more…](www.linode.com/docs/products/tools/cli/get-started/) - __OAuth scopes__. “` account:read_only “` [Learn more…](techdocs.akamai.com/linode-api/reference/get-started#oauth)

Parameters:

  • api_version (String)

    __Enum__ Call either the &#x60;v4&#x60; URL, or &#x60;v4beta&#x60; for operations still in Beta.

  • app_id (Integer)

    The authorized app ID to manage.

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

    the optional parameters

Returns:



670
671
672
673
# File 'lib/linode_openapi_client/api/profile_api.rb', line 670

def get_profile_app(api_version, app_id, opts = {})
  data, _status_code, _headers = get_profile_app_with_http_info(api_version, app_id, opts)
  data
end

#get_profile_app_with_http_info(api_version, app_id, opts = {}) ⇒ Array<(GetProfileApp200Response, Integer, Hash)>

Get an authorized app Returns information about a single app you&#39;ve authorized to access your Account. &lt;&lt;LB&gt;&gt; — - __CLI__. &#x60;&#x60;&#x60; linode-cli profile app-view 1234 &#x60;&#x60;&#x60; [Learn more…](www.linode.com/docs/products/tools/cli/get-started/) - __OAuth scopes__. &#x60;&#x60;&#x60; account:read_only &#x60;&#x60;&#x60; [Learn more…](techdocs.akamai.com/linode-api/reference/get-started#oauth)

Parameters:

  • api_version (String)

    __Enum__ Call either the &#x60;v4&#x60; URL, or &#x60;v4beta&#x60; for operations still in Beta.

  • app_id (Integer)

    The authorized app ID to manage.

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

    the optional parameters

Returns:

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

    GetProfileApp200Response data, response status code and response headers



681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
# File 'lib/linode_openapi_client/api/profile_api.rb', line 681

def get_profile_app_with_http_info(api_version, app_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProfileApi.get_profile_app ...'
  end
  # verify the required parameter 'api_version' is set
  if @api_client.config.client_side_validation && api_version.nil?
    fail ArgumentError, "Missing the required parameter 'api_version' when calling ProfileApi.get_profile_app"
  end
  # verify enum value
  allowable_values = ["v4", "v4beta"]
  if @api_client.config.client_side_validation && !allowable_values.include?(api_version)
    fail ArgumentError, "invalid value for \"api_version\", must be one of #{allowable_values}"
  end
  # verify the required parameter 'app_id' is set
  if @api_client.config.client_side_validation && app_id.nil?
    fail ArgumentError, "Missing the required parameter 'app_id' when calling ProfileApi.get_profile_app"
  end
  # resource path
  local_var_path = '/{apiVersion}/profile/apps/{appId}'.sub('{' + 'apiVersion' + '}', CGI.escape(api_version.to_s)).sub('{' + 'appId' + '}', CGI.escape(app_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']) unless header_params['Accept']

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

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

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

  # auth_names
  auth_names = opts[:debug_auth_names] || ['personalAccessToken', 'oauth']

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

#get_profile_apps(api_version, opts = {}) ⇒ GetProfileApps200Response

List authorized apps This is a collection of OAuth apps that you’ve given access to your Account, and includes the level of access granted. <<LB>> — - __CLI__. “‘ linode-cli profile apps-list “` [Learn more…](www.linode.com/docs/products/tools/cli/get-started/) - __OAuth scopes__. “` account:read_only “` [Learn more…](techdocs.akamai.com/linode-api/reference/get-started#oauth)

Parameters:

  • api_version (String)

    __Enum__ Call either the &#x60;v4&#x60; URL, or &#x60;v4beta&#x60; for operations still in Beta.

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

    the optional parameters

Options Hash (opts):

  • :page (Integer)

    The page of a collection to return. (default to 1)

  • :page_size (Integer)

    The number of items to return per page. (default to 100)

Returns:



745
746
747
748
# File 'lib/linode_openapi_client/api/profile_api.rb', line 745

def get_profile_apps(api_version, opts = {})
  data, _status_code, _headers = get_profile_apps_with_http_info(api_version, opts)
  data
end

#get_profile_apps_with_http_info(api_version, opts = {}) ⇒ Array<(GetProfileApps200Response, Integer, Hash)>

List authorized apps This is a collection of OAuth apps that you&#39;ve given access to your Account, and includes the level of access granted. &lt;&lt;LB&gt;&gt; — - __CLI__. &#x60;&#x60;&#x60; linode-cli profile apps-list &#x60;&#x60;&#x60; [Learn more…](www.linode.com/docs/products/tools/cli/get-started/) - __OAuth scopes__. &#x60;&#x60;&#x60; account:read_only &#x60;&#x60;&#x60; [Learn more…](techdocs.akamai.com/linode-api/reference/get-started#oauth)

Parameters:

  • api_version (String)

    __Enum__ Call either the &#x60;v4&#x60; URL, or &#x60;v4beta&#x60; for operations still in Beta.

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

    the optional parameters

Options Hash (opts):

  • :page (Integer)

    The page of a collection to return. (default to 1)

  • :page_size (Integer)

    The number of items to return per page. (default to 100)

Returns:

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

    GetProfileApps200Response data, response status code and response headers



757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
# File 'lib/linode_openapi_client/api/profile_api.rb', line 757

def get_profile_apps_with_http_info(api_version, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProfileApi.get_profile_apps ...'
  end
  # verify the required parameter 'api_version' is set
  if @api_client.config.client_side_validation && api_version.nil?
    fail ArgumentError, "Missing the required parameter 'api_version' when calling ProfileApi.get_profile_apps"
  end
  # verify enum value
  allowable_values = ["v4", "v4beta"]
  if @api_client.config.client_side_validation && !allowable_values.include?(api_version)
    fail ArgumentError, "invalid value for \"api_version\", must be one of #{allowable_values}"
  end
  if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] < 1
    fail ArgumentError, 'invalid value for "opts[:"page"]" when calling ProfileApi.get_profile_apps, must be greater than or equal to 1.'
  end

  if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 500
    fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling ProfileApi.get_profile_apps, must be smaller than or equal to 500.'
  end

  if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 25
    fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling ProfileApi.get_profile_apps, must be greater than or equal to 25.'
  end

  # resource path
  local_var_path = '/{apiVersion}/profile/apps'.sub('{' + 'apiVersion' + '}', CGI.escape(api_version.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
  query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].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']

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

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

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

  # auth_names
  auth_names = opts[:debug_auth_names] || ['personalAccessToken', 'oauth']

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

#get_profile_grants(api_version, opts = {}) ⇒ GetProfileGrants200Response

List grants This returns a GrantsResponse describing what the acting User has been granted access to. For unrestricted users, this will return a 204 and no body because unrestricted users have access to everything without grants. This will not return information about entities you do not have access to. This operation is useful when writing third-party OAuth applications to see what options you should present to the acting User. For example, if they do not have ‘global.add_linodes`, you might not display a button to deploy a new Linode. Any client may run this operation; no OAuth scopes are required.

Parameters:

  • api_version (String)

    __Enum__ Call either the &#x60;v4&#x60; URL, or &#x60;v4beta&#x60; for operations still in Beta.

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

    the optional parameters

Returns:



829
830
831
832
# File 'lib/linode_openapi_client/api/profile_api.rb', line 829

def get_profile_grants(api_version, opts = {})
  data, _status_code, _headers = get_profile_grants_with_http_info(api_version, opts)
  data
end

#get_profile_grants_with_http_info(api_version, opts = {}) ⇒ Array<(GetProfileGrants200Response, Integer, Hash)>

List grants This returns a GrantsResponse describing what the acting User has been granted access to. For unrestricted users, this will return a 204 and no body because unrestricted users have access to everything without grants. This will not return information about entities you do not have access to. This operation is useful when writing third-party OAuth applications to see what options you should present to the acting User. For example, if they do not have &#x60;global.add_linodes&#x60;, you might not display a button to deploy a new Linode. Any client may run this operation; no OAuth scopes are required.

Parameters:

  • api_version (String)

    __Enum__ Call either the &#x60;v4&#x60; URL, or &#x60;v4beta&#x60; for operations still in Beta.

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

    the optional parameters

Returns:

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

    GetProfileGrants200Response data, response status code and response headers



839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
# File 'lib/linode_openapi_client/api/profile_api.rb', line 839

def get_profile_grants_with_http_info(api_version, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProfileApi.get_profile_grants ...'
  end
  # verify the required parameter 'api_version' is set
  if @api_client.config.client_side_validation && api_version.nil?
    fail ArgumentError, "Missing the required parameter 'api_version' when calling ProfileApi.get_profile_grants"
  end
  # verify enum value
  allowable_values = ["v4", "v4beta"]
  if @api_client.config.client_side_validation && !allowable_values.include?(api_version)
    fail ArgumentError, "invalid value for \"api_version\", must be one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/{apiVersion}/profile/grants'.sub('{' + 'apiVersion' + '}', CGI.escape(api_version.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']

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

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

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

  # auth_names
  auth_names = opts[:debug_auth_names] || ['personalAccessToken', 'oauth']

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

#get_profile_login(api_version, login_id, opts = {}) ⇒ GetProfileLogin200Response

Get a profile’s login Returns a login object displaying information about a successful account login from this user. <<LB>> — - __CLI__. “‘ linode-cli profile login-view 1234 “` [Learn more…](www.linode.com/docs/products/tools/cli/get-started/) - __OAuth scopes__. “` account:read_only “` [Learn more…](techdocs.akamai.com/linode-api/reference/get-started#oauth)

Parameters:

  • api_version (String)

    __Enum__ Call either the &#x60;v4&#x60; URL, or &#x60;v4beta&#x60; for operations still in Beta.

  • login_id (Integer)

    The ID of the login object to access.

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

    the optional parameters

Returns:



898
899
900
901
# File 'lib/linode_openapi_client/api/profile_api.rb', line 898

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

#get_profile_login_with_http_info(api_version, login_id, opts = {}) ⇒ Array<(GetProfileLogin200Response, Integer, Hash)>

Get a profile&#39;s login Returns a login object displaying information about a successful account login from this user. &lt;&lt;LB&gt;&gt; — - __CLI__. &#x60;&#x60;&#x60; linode-cli profile login-view 1234 &#x60;&#x60;&#x60; [Learn more…](www.linode.com/docs/products/tools/cli/get-started/) - __OAuth scopes__. &#x60;&#x60;&#x60; account:read_only &#x60;&#x60;&#x60; [Learn more…](techdocs.akamai.com/linode-api/reference/get-started#oauth)

Parameters:

  • api_version (String)

    __Enum__ Call either the &#x60;v4&#x60; URL, or &#x60;v4beta&#x60; for operations still in Beta.

  • login_id (Integer)

    The ID of the login object to access.

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

    the optional parameters

Returns:

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

    GetProfileLogin200Response data, response status code and response headers



909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
# File 'lib/linode_openapi_client/api/profile_api.rb', line 909

def (api_version, , opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProfileApi.get_profile_login ...'
  end
  # verify the required parameter 'api_version' is set
  if @api_client.config.client_side_validation && api_version.nil?
    fail ArgumentError, "Missing the required parameter 'api_version' when calling ProfileApi.get_profile_login"
  end
  # verify enum value
  allowable_values = ["v4", "v4beta"]
  if @api_client.config.client_side_validation && !allowable_values.include?(api_version)
    fail ArgumentError, "invalid value for \"api_version\", must be one of #{allowable_values}"
  end
  # verify the required parameter 'login_id' is set
  if @api_client.config.client_side_validation && .nil?
    fail ArgumentError, "Missing the required parameter 'login_id' when calling ProfileApi.get_profile_login"
  end
  # resource path
  local_var_path = '/{apiVersion}/profile/logins/{loginId}'.sub('{' + 'apiVersion' + '}', CGI.escape(api_version.to_s)).sub('{' + 'loginId' + '}', CGI.escape(.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']

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

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

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

  # auth_names
  auth_names = opts[:debug_auth_names] || ['personalAccessToken', 'oauth']

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

#get_profile_logins(api_version, opts = {}) ⇒ GetProfileLogins200Response

List logins Returns a collection of successful account logins from this user during the last 90 days. <<LB>> — - __CLI__. “‘ linode-cli profile logins-list “` [Learn more…](www.linode.com/docs/products/tools/cli/get-started/) - __OAuth scopes__. “` account:read_only “` [Learn more…](techdocs.akamai.com/linode-api/reference/get-started#oauth)

Parameters:

  • api_version (String)

    __Enum__ Call either the &#x60;v4&#x60; URL, or &#x60;v4beta&#x60; for operations still in Beta.

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

    the optional parameters

Returns:



971
972
973
974
# File 'lib/linode_openapi_client/api/profile_api.rb', line 971

def get_profile_logins(api_version, opts = {})
  data, _status_code, _headers = get_profile_logins_with_http_info(api_version, opts)
  data
end

#get_profile_logins_with_http_info(api_version, opts = {}) ⇒ Array<(GetProfileLogins200Response, Integer, Hash)>

List logins Returns a collection of successful account logins from this user during the last 90 days. &lt;&lt;LB&gt;&gt; — - __CLI__. &#x60;&#x60;&#x60; linode-cli profile logins-list &#x60;&#x60;&#x60; [Learn more…](www.linode.com/docs/products/tools/cli/get-started/) - __OAuth scopes__. &#x60;&#x60;&#x60; account:read_only &#x60;&#x60;&#x60; [Learn more…](techdocs.akamai.com/linode-api/reference/get-started#oauth)

Parameters:

  • api_version (String)

    __Enum__ Call either the &#x60;v4&#x60; URL, or &#x60;v4beta&#x60; for operations still in Beta.

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

    the optional parameters

Returns:

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

    GetProfileLogins200Response data, response status code and response headers



981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
# File 'lib/linode_openapi_client/api/profile_api.rb', line 981

def get_profile_logins_with_http_info(api_version, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProfileApi.get_profile_logins ...'
  end
  # verify the required parameter 'api_version' is set
  if @api_client.config.client_side_validation && api_version.nil?
    fail ArgumentError, "Missing the required parameter 'api_version' when calling ProfileApi.get_profile_logins"
  end
  # verify enum value
  allowable_values = ["v4", "v4beta"]
  if @api_client.config.client_side_validation && !allowable_values.include?(api_version)
    fail ArgumentError, "invalid value for \"api_version\", must be one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/{apiVersion}/profile/logins'.sub('{' + 'apiVersion' + '}', CGI.escape(api_version.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']

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

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

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

  # auth_names
  auth_names = opts[:debug_auth_names] || ['personalAccessToken', 'oauth']

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

#get_profile_with_http_info(api_version, opts = {}) ⇒ Array<(GetProfile200Response, Integer, Hash)>

Get a profile Returns information about the current User. This can be used to see who is acting in applications where more than one token is managed. For example, in third-party OAuth applications. This operation is always accessible, no matter what OAuth scopes the acting token has. &lt;&lt;LB&gt;&gt; — - __CLI__. &#x60;&#x60;&#x60; linode-cli profile view &#x60;&#x60;&#x60; [Learn more…](www.linode.com/docs/products/tools/cli/get-started/)

Parameters:

  • api_version (String)

    __Enum__ Call either the &#x60;v4&#x60; URL, or &#x60;v4beta&#x60; for operations still in Beta.

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

    the optional parameters

Returns:

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

    GetProfile200Response data, response status code and response headers



611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
# File 'lib/linode_openapi_client/api/profile_api.rb', line 611

def get_profile_with_http_info(api_version, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProfileApi.get_profile ...'
  end
  # verify the required parameter 'api_version' is set
  if @api_client.config.client_side_validation && api_version.nil?
    fail ArgumentError, "Missing the required parameter 'api_version' when calling ProfileApi.get_profile"
  end
  # verify enum value
  allowable_values = ["v4", "v4beta"]
  if @api_client.config.client_side_validation && !allowable_values.include?(api_version)
    fail ArgumentError, "invalid value for \"api_version\", must be one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/{apiVersion}/profile'.sub('{' + 'apiVersion' + '}', CGI.escape(api_version.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']

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

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

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

  # auth_names
  auth_names = opts[:debug_auth_names] || ['personalAccessToken', 'oauth']

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

#get_security_questions(api_version, opts = {}) ⇒ GetSecurityQuestions200Response

List security questions Returns a collection of security questions and their responses, if any, for your User Profile. <<LB>> — - __CLI__. “‘ linode-cli security-questions list “` [Learn more…](www.linode.com/docs/products/tools/cli/get-started/) - __OAuth scopes__. “` account:read_only “` [Learn more…](techdocs.akamai.com/linode-api/reference/get-started#oauth)

Parameters:

  • api_version (String)

    __Enum__ Call either the &#x60;v4&#x60; URL, or &#x60;v4beta&#x60; for operations still in Beta.

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

    the optional parameters

Returns:



1039
1040
1041
1042
# File 'lib/linode_openapi_client/api/profile_api.rb', line 1039

def get_security_questions(api_version, opts = {})
  data, _status_code, _headers = get_security_questions_with_http_info(api_version, opts)
  data
end

#get_security_questions_with_http_info(api_version, opts = {}) ⇒ Array<(GetSecurityQuestions200Response, Integer, Hash)>

List security questions Returns a collection of security questions and their responses, if any, for your User Profile. &lt;&lt;LB&gt;&gt; — - __CLI__. &#x60;&#x60;&#x60; linode-cli security-questions list &#x60;&#x60;&#x60; [Learn more…](www.linode.com/docs/products/tools/cli/get-started/) - __OAuth scopes__. &#x60;&#x60;&#x60; account:read_only &#x60;&#x60;&#x60; [Learn more…](techdocs.akamai.com/linode-api/reference/get-started#oauth)

Parameters:

  • api_version (String)

    __Enum__ Call either the &#x60;v4&#x60; URL, or &#x60;v4beta&#x60; for operations still in Beta.

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

    the optional parameters

Returns:



1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
# File 'lib/linode_openapi_client/api/profile_api.rb', line 1049

def get_security_questions_with_http_info(api_version, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProfileApi.get_security_questions ...'
  end
  # verify the required parameter 'api_version' is set
  if @api_client.config.client_side_validation && api_version.nil?
    fail ArgumentError, "Missing the required parameter 'api_version' when calling ProfileApi.get_security_questions"
  end
  # verify enum value
  allowable_values = ["v4", "v4beta"]
  if @api_client.config.client_side_validation && !allowable_values.include?(api_version)
    fail ArgumentError, "invalid value for \"api_version\", must be one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/{apiVersion}/profile/security-questions'.sub('{' + 'apiVersion' + '}', CGI.escape(api_version.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']

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

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

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

  # auth_names
  auth_names = opts[:debug_auth_names] || ['personalAccessToken', 'oauth']

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

#get_ssh_key(api_version, ssh_key_id, opts = {}) ⇒ GetSshKey200Response

Get an SSH key Returns a single SSH Key object identified by ‘id` that you have access to view. <<LB>> — - __CLI__. “` linode-cli sshkeys view 42 “` [Learn more…](www.linode.com/docs/products/tools/cli/get-started/) - __OAuth scopes__. “` account:read_only “` [Learn more…](techdocs.akamai.com/linode-api/reference/get-started#oauth)

Parameters:

  • api_version (String)

    __Enum__ Call either the &#x60;v4&#x60; URL, or &#x60;v4beta&#x60; for operations still in Beta.

  • ssh_key_id (Integer)

    The ID of the SSHKey.

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

    the optional parameters

Returns:



1108
1109
1110
1111
# File 'lib/linode_openapi_client/api/profile_api.rb', line 1108

def get_ssh_key(api_version, ssh_key_id, opts = {})
  data, _status_code, _headers = get_ssh_key_with_http_info(api_version, ssh_key_id, opts)
  data
end

#get_ssh_key_with_http_info(api_version, ssh_key_id, opts = {}) ⇒ Array<(GetSshKey200Response, Integer, Hash)>

Get an SSH key Returns a single SSH Key object identified by &#x60;id&#x60; that you have access to view. &lt;&lt;LB&gt;&gt; — - __CLI__. &#x60;&#x60;&#x60; linode-cli sshkeys view 42 &#x60;&#x60;&#x60; [Learn more…](www.linode.com/docs/products/tools/cli/get-started/) - __OAuth scopes__. &#x60;&#x60;&#x60; account:read_only &#x60;&#x60;&#x60; [Learn more…](techdocs.akamai.com/linode-api/reference/get-started#oauth)

Parameters:

  • api_version (String)

    __Enum__ Call either the &#x60;v4&#x60; URL, or &#x60;v4beta&#x60; for operations still in Beta.

  • ssh_key_id (Integer)

    The ID of the SSHKey.

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

    the optional parameters

Returns:

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

    GetSshKey200Response data, response status code and response headers



1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
# File 'lib/linode_openapi_client/api/profile_api.rb', line 1119

def get_ssh_key_with_http_info(api_version, ssh_key_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProfileApi.get_ssh_key ...'
  end
  # verify the required parameter 'api_version' is set
  if @api_client.config.client_side_validation && api_version.nil?
    fail ArgumentError, "Missing the required parameter 'api_version' when calling ProfileApi.get_ssh_key"
  end
  # verify enum value
  allowable_values = ["v4", "v4beta"]
  if @api_client.config.client_side_validation && !allowable_values.include?(api_version)
    fail ArgumentError, "invalid value for \"api_version\", must be one of #{allowable_values}"
  end
  # verify the required parameter 'ssh_key_id' is set
  if @api_client.config.client_side_validation && ssh_key_id.nil?
    fail ArgumentError, "Missing the required parameter 'ssh_key_id' when calling ProfileApi.get_ssh_key"
  end
  # resource path
  local_var_path = '/{apiVersion}/profile/sshkeys/{sshKeyId}'.sub('{' + 'apiVersion' + '}', CGI.escape(api_version.to_s)).sub('{' + 'sshKeyId' + '}', CGI.escape(ssh_key_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']) unless header_params['Accept']

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

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

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

  # auth_names
  auth_names = opts[:debug_auth_names] || ['personalAccessToken', 'oauth']

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

#get_ssh_keys(api_version, opts = {}) ⇒ GetSshKeys200Response

List SSH keys Returns a collection of SSH Keys you’ve added to your Profile. <<LB>> — - __CLI__. “‘ linode-cli sshkeys list “` [Learn more…](www.linode.com/docs/products/tools/cli/get-started/) - __OAuth scopes__. “` account:read_only “` [Learn more…](techdocs.akamai.com/linode-api/reference/get-started#oauth)

Parameters:

  • api_version (String)

    __Enum__ Call either the &#x60;v4&#x60; URL, or &#x60;v4beta&#x60; for operations still in Beta.

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

    the optional parameters

Options Hash (opts):

  • :page (Integer)

    The page of a collection to return. (default to 1)

  • :page_size (Integer)

    The number of items to return per page. (default to 100)

Returns:



1183
1184
1185
1186
# File 'lib/linode_openapi_client/api/profile_api.rb', line 1183

def get_ssh_keys(api_version, opts = {})
  data, _status_code, _headers = get_ssh_keys_with_http_info(api_version, opts)
  data
end

#get_ssh_keys_with_http_info(api_version, opts = {}) ⇒ Array<(GetSshKeys200Response, Integer, Hash)>

List SSH keys Returns a collection of SSH Keys you&#39;ve added to your Profile. &lt;&lt;LB&gt;&gt; — - __CLI__. &#x60;&#x60;&#x60; linode-cli sshkeys list &#x60;&#x60;&#x60; [Learn more…](www.linode.com/docs/products/tools/cli/get-started/) - __OAuth scopes__. &#x60;&#x60;&#x60; account:read_only &#x60;&#x60;&#x60; [Learn more…](techdocs.akamai.com/linode-api/reference/get-started#oauth)

Parameters:

  • api_version (String)

    __Enum__ Call either the &#x60;v4&#x60; URL, or &#x60;v4beta&#x60; for operations still in Beta.

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

    the optional parameters

Options Hash (opts):

  • :page (Integer)

    The page of a collection to return. (default to 1)

  • :page_size (Integer)

    The number of items to return per page. (default to 100)

Returns:

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

    GetSshKeys200Response data, response status code and response headers



1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
# File 'lib/linode_openapi_client/api/profile_api.rb', line 1195

def get_ssh_keys_with_http_info(api_version, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProfileApi.get_ssh_keys ...'
  end
  # verify the required parameter 'api_version' is set
  if @api_client.config.client_side_validation && api_version.nil?
    fail ArgumentError, "Missing the required parameter 'api_version' when calling ProfileApi.get_ssh_keys"
  end
  # verify enum value
  allowable_values = ["v4", "v4beta"]
  if @api_client.config.client_side_validation && !allowable_values.include?(api_version)
    fail ArgumentError, "invalid value for \"api_version\", must be one of #{allowable_values}"
  end
  if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] < 1
    fail ArgumentError, 'invalid value for "opts[:"page"]" when calling ProfileApi.get_ssh_keys, must be greater than or equal to 1.'
  end

  if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 500
    fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling ProfileApi.get_ssh_keys, must be smaller than or equal to 500.'
  end

  if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 25
    fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling ProfileApi.get_ssh_keys, must be greater than or equal to 25.'
  end

  # resource path
  local_var_path = '/{apiVersion}/profile/sshkeys'.sub('{' + 'apiVersion' + '}', CGI.escape(api_version.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
  query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].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']

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

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

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

  # auth_names
  auth_names = opts[:debug_auth_names] || ['personalAccessToken', 'oauth']

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

#get_trusted_device(api_version, device_id, opts = {}) ⇒ GetTrustedDevice200Response

Get a trusted device Returns a single active TrustedDevice for your User. <<LB>> — - __CLI__. “‘ linode-cli profile device-view 123 “` [Learn more…](www.linode.com/docs/products/tools/cli/get-started/) - __OAuth scopes__. “` account:read_only “` [Learn more…](techdocs.akamai.com/linode-api/reference/get-started#oauth)

Parameters:

  • api_version (String)

    __Enum__ Call either the &#x60;v4&#x60; URL, or &#x60;v4beta&#x60; for operations still in Beta.

  • device_id (Integer)

    The ID of the TrustedDevice.

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

    the optional parameters

Returns:



1268
1269
1270
1271
# File 'lib/linode_openapi_client/api/profile_api.rb', line 1268

def get_trusted_device(api_version, device_id, opts = {})
  data, _status_code, _headers = get_trusted_device_with_http_info(api_version, device_id, opts)
  data
end

#get_trusted_device_with_http_info(api_version, device_id, opts = {}) ⇒ Array<(GetTrustedDevice200Response, Integer, Hash)>

Get a trusted device Returns a single active TrustedDevice for your User. &lt;&lt;LB&gt;&gt; — - __CLI__. &#x60;&#x60;&#x60; linode-cli profile device-view 123 &#x60;&#x60;&#x60; [Learn more…](www.linode.com/docs/products/tools/cli/get-started/) - __OAuth scopes__. &#x60;&#x60;&#x60; account:read_only &#x60;&#x60;&#x60; [Learn more…](techdocs.akamai.com/linode-api/reference/get-started#oauth)

Parameters:

  • api_version (String)

    __Enum__ Call either the &#x60;v4&#x60; URL, or &#x60;v4beta&#x60; for operations still in Beta.

  • device_id (Integer)

    The ID of the TrustedDevice.

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

    the optional parameters

Returns:

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

    GetTrustedDevice200Response data, response status code and response headers



1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
# File 'lib/linode_openapi_client/api/profile_api.rb', line 1279

def get_trusted_device_with_http_info(api_version, device_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProfileApi.get_trusted_device ...'
  end
  # verify the required parameter 'api_version' is set
  if @api_client.config.client_side_validation && api_version.nil?
    fail ArgumentError, "Missing the required parameter 'api_version' when calling ProfileApi.get_trusted_device"
  end
  # verify enum value
  allowable_values = ["v4", "v4beta"]
  if @api_client.config.client_side_validation && !allowable_values.include?(api_version)
    fail ArgumentError, "invalid value for \"api_version\", must be one of #{allowable_values}"
  end
  # verify the required parameter 'device_id' is set
  if @api_client.config.client_side_validation && device_id.nil?
    fail ArgumentError, "Missing the required parameter 'device_id' when calling ProfileApi.get_trusted_device"
  end
  # resource path
  local_var_path = '/{apiVersion}/profile/devices/{deviceId}'.sub('{' + 'apiVersion' + '}', CGI.escape(api_version.to_s)).sub('{' + 'deviceId' + '}', CGI.escape(device_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']) unless header_params['Accept']

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

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

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

  # auth_names
  auth_names = opts[:debug_auth_names] || ['personalAccessToken', 'oauth']

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

#get_user_preferences(api_version, opts = {}) ⇒ Object

Get user preferences View a list of user preferences tied to the OAuth client that generated the token making the request. The user preferences endpoints allow consumers of the API to store arbitrary JSON data, such as a user’s font size preference or preferred display name. User preferences are available for each OAuth client registered to your account, and as such an account can have multiple user preferences. <<LB>> — - __OAuth scopes__. “‘ account:read_only “` [Learn more…](techdocs.akamai.com/linode-api/reference/get-started#oauth)

Parameters:

  • api_version (String)

    __Enum__ Call either the &#x60;v4&#x60; URL, or &#x60;v4beta&#x60; for operations still in Beta.

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

    the optional parameters

Returns:

  • (Object)


1341
1342
1343
1344
# File 'lib/linode_openapi_client/api/profile_api.rb', line 1341

def get_user_preferences(api_version, opts = {})
  data, _status_code, _headers = get_user_preferences_with_http_info(api_version, opts)
  data
end

#get_user_preferences_with_http_info(api_version, opts = {}) ⇒ Array<(Object, Integer, Hash)>

Get user preferences View a list of user preferences tied to the OAuth client that generated the token making the request. The user preferences endpoints allow consumers of the API to store arbitrary JSON data, such as a user&#39;s font size preference or preferred display name. User preferences are available for each OAuth client registered to your account, and as such an account can have multiple user preferences. &lt;&lt;LB&gt;&gt; — - __OAuth scopes__. &#x60;&#x60;&#x60; account:read_only &#x60;&#x60;&#x60; [Learn more…](techdocs.akamai.com/linode-api/reference/get-started#oauth)

Parameters:

  • api_version (String)

    __Enum__ Call either the &#x60;v4&#x60; URL, or &#x60;v4beta&#x60; for operations still in Beta.

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

    the optional parameters

Returns:

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

    Object data, response status code and response headers



1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
# File 'lib/linode_openapi_client/api/profile_api.rb', line 1351

def get_user_preferences_with_http_info(api_version, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProfileApi.get_user_preferences ...'
  end
  # verify the required parameter 'api_version' is set
  if @api_client.config.client_side_validation && api_version.nil?
    fail ArgumentError, "Missing the required parameter 'api_version' when calling ProfileApi.get_user_preferences"
  end
  # verify enum value
  allowable_values = ["v4", "v4beta"]
  if @api_client.config.client_side_validation && !allowable_values.include?(api_version)
    fail ArgumentError, "invalid value for \"api_version\", must be one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/{apiVersion}/profile/preferences'.sub('{' + 'apiVersion' + '}', CGI.escape(api_version.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']

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

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

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

  # auth_names
  auth_names = opts[:debug_auth_names] || ['personalAccessToken', 'oauth']

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

#post_add_ssh_key(api_version, opts = {}) ⇒ PostAddSshKey200Response

Add an SSH key Adds an SSH Key to your Account profile. <<LB>> — - __CLI__. “‘ linode-cli sshkeys create \ –label "My SSH Key" \ –ssh_key "ssh-rsa AAAA_valid_public_ssh_key_123456785== user@their-computer" “` [Learn more…](www.linode.com/docs/products/tools/cli/get-started/) - __OAuth scopes__. “` account:read_write “` [Learn more…](techdocs.akamai.com/linode-api/reference/get-started#oauth)

Parameters:

  • api_version (String)

    __Enum__ Call either the &#x60;v4&#x60; URL, or &#x60;v4beta&#x60; for operations still in Beta.

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

    the optional parameters

Options Hash (opts):

Returns:



1410
1411
1412
1413
# File 'lib/linode_openapi_client/api/profile_api.rb', line 1410

def post_add_ssh_key(api_version, opts = {})
  data, _status_code, _headers = post_add_ssh_key_with_http_info(api_version, opts)
  data
end

#post_add_ssh_key_with_http_info(api_version, opts = {}) ⇒ Array<(PostAddSshKey200Response, Integer, Hash)>

Add an SSH key Adds an SSH Key to your Account profile. &lt;&lt;LB&gt;&gt; — - __CLI__. &#x60;&#x60;&#x60; linode-cli sshkeys create \ –label &quot;My SSH Key&quot; \ –ssh_key &quot;ssh-rsa AAAA_valid_public_ssh_key_123456785&#x3D;&#x3D; user@their-computer&quot; &#x60;&#x60;&#x60; [Learn more…](www.linode.com/docs/products/tools/cli/get-started/) - __OAuth scopes__. &#x60;&#x60;&#x60; account:read_write &#x60;&#x60;&#x60; [Learn more…](techdocs.akamai.com/linode-api/reference/get-started#oauth)

Parameters:

  • api_version (String)

    __Enum__ Call either the &#x60;v4&#x60; URL, or &#x60;v4beta&#x60; for operations still in Beta.

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

    the optional parameters

Options Hash (opts):

Returns:

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

    PostAddSshKey200Response data, response status code and response headers



1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
# File 'lib/linode_openapi_client/api/profile_api.rb', line 1421

def post_add_ssh_key_with_http_info(api_version, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProfileApi.post_add_ssh_key ...'
  end
  # verify the required parameter 'api_version' is set
  if @api_client.config.client_side_validation && api_version.nil?
    fail ArgumentError, "Missing the required parameter 'api_version' when calling ProfileApi.post_add_ssh_key"
  end
  # verify enum value
  allowable_values = ["v4", "v4beta"]
  if @api_client.config.client_side_validation && !allowable_values.include?(api_version)
    fail ArgumentError, "invalid value for \"api_version\", must be one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/{apiVersion}/profile/sshkeys'.sub('{' + 'apiVersion' + '}', CGI.escape(api_version.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

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

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

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

  # auth_names
  auth_names = opts[:debug_auth_names] || ['personalAccessToken', 'oauth']

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

#post_personal_access_token(api_version, post_personal_access_token_request, opts = {}) ⇒ PostPersonalAccessToken200Response

Create a personal access token Creates a Personal Access Token for your User. The raw token will be returned in the response, but will never be returned again afterward so be sure to take note of it. You may create a token with _at most_ the scopes of your current token. The created token will be able to access your Account until the given expiry, or until it is revoked. __Parent and child accounts__ In a [parent and child account](www.linode.com/docs/guides/parent-child-accounts/) environment, the following apply: - If you’re using a child account parent user (proxy user), you can’t create this form of token. The only token available to a proxy user is one that lets you run operations in a child account. These are created with the [Create a proxy user token](techdocs.akamai.com/linode-api/reference/post-child-account-token) operation. <<LB>> — - __CLI__. “‘ linode-cli profile token-create \ –scopes ’*‘ \ –expiry ’2018-01-01T13:46:32’ \ –label linode-cli “‘ [Learn more…](www.linode.com/docs/products/tools/cli/get-started/) - __OAuth scopes__. “` account:read_write “` [Learn more…](techdocs.akamai.com/linode-api/reference/get-started#oauth)

Parameters:

  • api_version (String)

    __Enum__ Call either the &#x60;v4&#x60; URL, or &#x60;v4beta&#x60; for operations still in Beta.

  • post_personal_access_token_request (PostPersonalAccessTokenRequest)

    Information about the requested token.

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

    the optional parameters

Returns:



1485
1486
1487
1488
# File 'lib/linode_openapi_client/api/profile_api.rb', line 1485

def post_personal_access_token(api_version, post_personal_access_token_request, opts = {})
  data, _status_code, _headers = post_personal_access_token_with_http_info(api_version, post_personal_access_token_request, opts)
  data
end

#post_personal_access_token_with_http_info(api_version, post_personal_access_token_request, opts = {}) ⇒ Array<(PostPersonalAccessToken200Response, Integer, Hash)>

Create a personal access token Creates a Personal Access Token for your User. The raw token will be returned in the response, but will never be returned again afterward so be sure to take note of it. You may create a token with _at most_ the scopes of your current token. The created token will be able to access your Account until the given expiry, or until it is revoked. __Parent and child accounts__ In a [parent and child account](www.linode.com/docs/guides/parent-child-accounts/) environment, the following apply: - If you&#39;re using a child account parent user (proxy user), you can&#39;t create this form of token. The only token available to a proxy user is one that lets you run operations in a child account. These are created with the [Create a proxy user token](techdocs.akamai.com/linode-api/reference/post-child-account-token) operation. &lt;&lt;LB&gt;&gt; — - __CLI__. &#x60;&#x60;&#x60; linode-cli profile token-create \ –scopes &#39;*&#39; \ –expiry &#39;2018-01-01T13:46:32&#39; \ –label linode-cli &#x60;&#x60;&#x60; [Learn more…](www.linode.com/docs/products/tools/cli/get-started/) - __OAuth scopes__. &#x60;&#x60;&#x60; account:read_write &#x60;&#x60;&#x60; [Learn more…](techdocs.akamai.com/linode-api/reference/get-started#oauth)

Parameters:

  • api_version (String)

    __Enum__ Call either the &#x60;v4&#x60; URL, or &#x60;v4beta&#x60; for operations still in Beta.

  • post_personal_access_token_request (PostPersonalAccessTokenRequest)

    Information about the requested token.

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

    the optional parameters

Returns:



1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
# File 'lib/linode_openapi_client/api/profile_api.rb', line 1496

def post_personal_access_token_with_http_info(api_version, post_personal_access_token_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProfileApi.post_personal_access_token ...'
  end
  # verify the required parameter 'api_version' is set
  if @api_client.config.client_side_validation && api_version.nil?
    fail ArgumentError, "Missing the required parameter 'api_version' when calling ProfileApi.post_personal_access_token"
  end
  # verify enum value
  allowable_values = ["v4", "v4beta"]
  if @api_client.config.client_side_validation && !allowable_values.include?(api_version)
    fail ArgumentError, "invalid value for \"api_version\", must be one of #{allowable_values}"
  end
  # verify the required parameter 'post_personal_access_token_request' is set
  if @api_client.config.client_side_validation && post_personal_access_token_request.nil?
    fail ArgumentError, "Missing the required parameter 'post_personal_access_token_request' when calling ProfileApi.post_personal_access_token"
  end
  # resource path
  local_var_path = '/{apiVersion}/profile/tokens'.sub('{' + 'apiVersion' + '}', CGI.escape(api_version.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

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

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

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

  # auth_names
  auth_names = opts[:debug_auth_names] || ['personalAccessToken', 'oauth']

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

#post_profile_phone_number(api_version, opts = {}) ⇒ Object

Send a phone number verification code Send a one-time verification code via SMS message to the submitted phone number. Providing your phone number helps ensure you can securely access your Account in case other ways to connect are lost. Your phone number is only used to verify your identity by sending an SMS message. Standard carrier messaging fees may apply. - By accessing this operation you are opting in to receive SMS messages. You can opt out of SMS messages by running the [Delete a phone number](techdocs.akamai.com/linode-api/reference/delete-profile-phone-number) operation after your phone number is verified. - Verification codes are valid for 10 minutes after they are sent. - Subsequent requests made prior to code expiration result in sending the same code. Once a verification code is received, verify your phone number with the [Verify a phone number](techdocs.akamai.com/linode-api/reference/post-profile-phone-number-verify) operation. <<LB>> — - __CLI__. “‘ linode-cli phone sms-code-send \ –iso-code US \ –phone-number 555-555-5555 “` [Learn more…](www.linode.com/docs/products/tools/cli/get-started/) - __OAuth scopes__. “` account:read_write “` [Learn more…](techdocs.akamai.com/linode-api/reference/get-started#oauth)

Parameters:

  • api_version (String)

    __Enum__ Call either the &#x60;v4&#x60; URL, or &#x60;v4beta&#x60; for operations still in Beta.

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

    the optional parameters

Options Hash (opts):

Returns:

  • (Object)


1564
1565
1566
1567
# File 'lib/linode_openapi_client/api/profile_api.rb', line 1564

def post_profile_phone_number(api_version, opts = {})
  data, _status_code, _headers = post_profile_phone_number_with_http_info(api_version, opts)
  data
end

#post_profile_phone_number_verify(api_version, opts = {}) ⇒ Object

Verify a phone number Verify a phone number by confirming the one-time code received via SMS message after running the [Send a phone number verification code](techdocs.akamai.com/linode-api/reference/post-profile-phone-number) operation. - Verification codes are valid for 10 minutes after they are sent. - Only the same User that made the verification code request can use that code with this operation. Once completed, the verified phone number is assigned to the User making the request. To change the verified phone number for a User, first run the [Delete a phone number](techdocs.akamai.com/linode-api/reference/delete-profile-phone-number) operation, then begin the verification process again with the [Send a phone number verification code](techdocs.akamai.com/linode-api/reference/post-profile-phone-number) operation. <<LB>> — - __CLI__. “‘ linode-cli phone verify \ –otp_code 123456 “` [Learn more…](www.linode.com/docs/products/tools/cli/get-started/) - __OAuth scopes__. “` account:read_write “` [Learn more…](techdocs.akamai.com/linode-api/reference/get-started#oauth)

Parameters:

  • api_version (String)

    __Enum__ Call either the &#x60;v4&#x60; URL, or &#x60;v4beta&#x60; for operations still in Beta.

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

    the optional parameters

Options Hash (opts):

Returns:

  • (Object)


1639
1640
1641
1642
# File 'lib/linode_openapi_client/api/profile_api.rb', line 1639

def post_profile_phone_number_verify(api_version, opts = {})
  data, _status_code, _headers = post_profile_phone_number_verify_with_http_info(api_version, opts)
  data
end

#post_profile_phone_number_verify_with_http_info(api_version, opts = {}) ⇒ Array<(Object, Integer, Hash)>

Verify a phone number Verify a phone number by confirming the one-time code received via SMS message after running the [Send a phone number verification code](techdocs.akamai.com/linode-api/reference/post-profile-phone-number) operation. - Verification codes are valid for 10 minutes after they are sent. - Only the same User that made the verification code request can use that code with this operation. Once completed, the verified phone number is assigned to the User making the request. To change the verified phone number for a User, first run the [Delete a phone number](techdocs.akamai.com/linode-api/reference/delete-profile-phone-number) operation, then begin the verification process again with the [Send a phone number verification code](techdocs.akamai.com/linode-api/reference/post-profile-phone-number) operation. &lt;&lt;LB&gt;&gt; — - __CLI__. &#x60;&#x60;&#x60; linode-cli phone verify \ –otp_code 123456 &#x60;&#x60;&#x60; [Learn more…](www.linode.com/docs/products/tools/cli/get-started/) - __OAuth scopes__. &#x60;&#x60;&#x60; account:read_write &#x60;&#x60;&#x60; [Learn more…](techdocs.akamai.com/linode-api/reference/get-started#oauth)

Parameters:

  • api_version (String)

    __Enum__ Call either the &#x60;v4&#x60; URL, or &#x60;v4beta&#x60; for operations still in Beta.

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

    the optional parameters

Options Hash (opts):

Returns:

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

    Object data, response status code and response headers



1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
# File 'lib/linode_openapi_client/api/profile_api.rb', line 1650

def post_profile_phone_number_verify_with_http_info(api_version, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProfileApi.post_profile_phone_number_verify ...'
  end
  # verify the required parameter 'api_version' is set
  if @api_client.config.client_side_validation && api_version.nil?
    fail ArgumentError, "Missing the required parameter 'api_version' when calling ProfileApi.post_profile_phone_number_verify"
  end
  # verify enum value
  allowable_values = ["v4", "v4beta"]
  if @api_client.config.client_side_validation && !allowable_values.include?(api_version)
    fail ArgumentError, "invalid value for \"api_version\", must be one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/{apiVersion}/profile/phone-number/verify'.sub('{' + 'apiVersion' + '}', CGI.escape(api_version.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

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

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

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

  # auth_names
  auth_names = opts[:debug_auth_names] || ['personalAccessToken', 'oauth']

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

#post_profile_phone_number_with_http_info(api_version, opts = {}) ⇒ Array<(Object, Integer, Hash)>

Send a phone number verification code Send a one-time verification code via SMS message to the submitted phone number. Providing your phone number helps ensure you can securely access your Account in case other ways to connect are lost. Your phone number is only used to verify your identity by sending an SMS message. Standard carrier messaging fees may apply. - By accessing this operation you are opting in to receive SMS messages. You can opt out of SMS messages by running the [Delete a phone number](techdocs.akamai.com/linode-api/reference/delete-profile-phone-number) operation after your phone number is verified. - Verification codes are valid for 10 minutes after they are sent. - Subsequent requests made prior to code expiration result in sending the same code. Once a verification code is received, verify your phone number with the [Verify a phone number](techdocs.akamai.com/linode-api/reference/post-profile-phone-number-verify) operation. &lt;&lt;LB&gt;&gt; — - __CLI__. &#x60;&#x60;&#x60; linode-cli phone sms-code-send \ –iso-code US \ –phone-number 555-555-5555 &#x60;&#x60;&#x60; [Learn more…](www.linode.com/docs/products/tools/cli/get-started/) - __OAuth scopes__. &#x60;&#x60;&#x60; account:read_write &#x60;&#x60;&#x60; [Learn more…](techdocs.akamai.com/linode-api/reference/get-started#oauth)

Parameters:

  • api_version (String)

    __Enum__ Call either the &#x60;v4&#x60; URL, or &#x60;v4beta&#x60; for operations still in Beta.

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

    the optional parameters

Options Hash (opts):

Returns:

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

    Object data, response status code and response headers



1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
# File 'lib/linode_openapi_client/api/profile_api.rb', line 1575

def post_profile_phone_number_with_http_info(api_version, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProfileApi.post_profile_phone_number ...'
  end
  # verify the required parameter 'api_version' is set
  if @api_client.config.client_side_validation && api_version.nil?
    fail ArgumentError, "Missing the required parameter 'api_version' when calling ProfileApi.post_profile_phone_number"
  end
  # verify enum value
  allowable_values = ["v4", "v4beta"]
  if @api_client.config.client_side_validation && !allowable_values.include?(api_version)
    fail ArgumentError, "invalid value for \"api_version\", must be one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/{apiVersion}/profile/phone-number'.sub('{' + 'apiVersion' + '}', CGI.escape(api_version.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

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

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

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

  # auth_names
  auth_names = opts[:debug_auth_names] || ['personalAccessToken', 'oauth']

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

#post_security_questions(api_version, opts = {}) ⇒ PostSecurityQuestions200Response

Answer security questions Adds security question responses for your User. Requires exactly three unique questions. Previous responses are overwritten if answered or reset to ‘null` if unanswered. __Note__. Security questions must be answered for your User prior to accessing the [Create a two factor secret](techdocs.akamai.com/linode-api/reference/post-tfa-enable) operation. <<LB>> — - __OAuth scopes__. “` account:read_write “` [Learn more…](techdocs.akamai.com/linode-api/reference/get-started#oauth)

Parameters:

  • api_version (String)

    __Enum__ Call either the &#x60;v4&#x60; URL, or &#x60;v4beta&#x60; for operations still in Beta.

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

    the optional parameters

Options Hash (opts):

Returns:



1714
1715
1716
1717
# File 'lib/linode_openapi_client/api/profile_api.rb', line 1714

def post_security_questions(api_version, opts = {})
  data, _status_code, _headers = post_security_questions_with_http_info(api_version, opts)
  data
end

#post_security_questions_with_http_info(api_version, opts = {}) ⇒ Array<(PostSecurityQuestions200Response, Integer, Hash)>

Answer security questions Adds security question responses for your User. Requires exactly three unique questions. Previous responses are overwritten if answered or reset to &#x60;null&#x60; if unanswered. __Note__. Security questions must be answered for your User prior to accessing the [Create a two factor secret](techdocs.akamai.com/linode-api/reference/post-tfa-enable) operation. &lt;&lt;LB&gt;&gt; — - __OAuth scopes__. &#x60;&#x60;&#x60; account:read_write &#x60;&#x60;&#x60; [Learn more…](techdocs.akamai.com/linode-api/reference/get-started#oauth)

Parameters:

  • api_version (String)

    __Enum__ Call either the &#x60;v4&#x60; URL, or &#x60;v4beta&#x60; for operations still in Beta.

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

    the optional parameters

Options Hash (opts):

Returns:



1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
# File 'lib/linode_openapi_client/api/profile_api.rb', line 1725

def post_security_questions_with_http_info(api_version, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProfileApi.post_security_questions ...'
  end
  # verify the required parameter 'api_version' is set
  if @api_client.config.client_side_validation && api_version.nil?
    fail ArgumentError, "Missing the required parameter 'api_version' when calling ProfileApi.post_security_questions"
  end
  # verify enum value
  allowable_values = ["v4", "v4beta"]
  if @api_client.config.client_side_validation && !allowable_values.include?(api_version)
    fail ArgumentError, "invalid value for \"api_version\", must be one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/{apiVersion}/profile/security-questions'.sub('{' + 'apiVersion' + '}', CGI.escape(api_version.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

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

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

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

  # auth_names
  auth_names = opts[:debug_auth_names] || ['personalAccessToken', 'oauth']

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

#post_tfa_confirm(api_version, post_tfa_confirm_request, opts = {}) ⇒ PostTfaConfirm200Response

Enable two factor authentication Confirms that you can successfully generate Two Factor codes and enables TFA on your Account. Once this is complete, login attempts from untrusted computers will be required to provide a Two Factor code before they are successful. <<LB>> — - __CLI__. “‘ linode-cli profile tfa-confirm \ –tfa_code 213456 “` [Learn more…](www.linode.com/docs/products/tools/cli/get-started/) - __OAuth scopes__. “` account:read_write “` [Learn more…](techdocs.akamai.com/linode-api/reference/get-started#oauth)

Parameters:

  • api_version (String)

    __Enum__ Call either the &#x60;v4&#x60; URL, or &#x60;v4beta&#x60; for operations still in Beta.

  • post_tfa_confirm_request (PostTfaConfirmRequest)

    The Two Factor code you generated with your Two Factor secret.

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

    the optional parameters

Returns:



1789
1790
1791
1792
# File 'lib/linode_openapi_client/api/profile_api.rb', line 1789

def post_tfa_confirm(api_version, post_tfa_confirm_request, opts = {})
  data, _status_code, _headers = post_tfa_confirm_with_http_info(api_version, post_tfa_confirm_request, opts)
  data
end

#post_tfa_confirm_with_http_info(api_version, post_tfa_confirm_request, opts = {}) ⇒ Array<(PostTfaConfirm200Response, Integer, Hash)>

Enable two factor authentication Confirms that you can successfully generate Two Factor codes and enables TFA on your Account. Once this is complete, login attempts from untrusted computers will be required to provide a Two Factor code before they are successful. &lt;&lt;LB&gt;&gt; — - __CLI__. &#x60;&#x60;&#x60; linode-cli profile tfa-confirm \ –tfa_code 213456 &#x60;&#x60;&#x60; [Learn more…](www.linode.com/docs/products/tools/cli/get-started/) - __OAuth scopes__. &#x60;&#x60;&#x60; account:read_write &#x60;&#x60;&#x60; [Learn more…](techdocs.akamai.com/linode-api/reference/get-started#oauth)

Parameters:

  • api_version (String)

    __Enum__ Call either the &#x60;v4&#x60; URL, or &#x60;v4beta&#x60; for operations still in Beta.

  • post_tfa_confirm_request (PostTfaConfirmRequest)

    The Two Factor code you generated with your Two Factor secret.

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

    the optional parameters

Returns:

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

    PostTfaConfirm200Response data, response status code and response headers



1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
# File 'lib/linode_openapi_client/api/profile_api.rb', line 1800

def post_tfa_confirm_with_http_info(api_version, post_tfa_confirm_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProfileApi.post_tfa_confirm ...'
  end
  # verify the required parameter 'api_version' is set
  if @api_client.config.client_side_validation && api_version.nil?
    fail ArgumentError, "Missing the required parameter 'api_version' when calling ProfileApi.post_tfa_confirm"
  end
  # verify enum value
  allowable_values = ["v4", "v4beta"]
  if @api_client.config.client_side_validation && !allowable_values.include?(api_version)
    fail ArgumentError, "invalid value for \"api_version\", must be one of #{allowable_values}"
  end
  # verify the required parameter 'post_tfa_confirm_request' is set
  if @api_client.config.client_side_validation && post_tfa_confirm_request.nil?
    fail ArgumentError, "Missing the required parameter 'post_tfa_confirm_request' when calling ProfileApi.post_tfa_confirm"
  end
  # resource path
  local_var_path = '/{apiVersion}/profile/tfa-enable-confirm'.sub('{' + 'apiVersion' + '}', CGI.escape(api_version.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

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

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

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

  # auth_names
  auth_names = opts[:debug_auth_names] || ['personalAccessToken', 'oauth']

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

#post_tfa_disable(api_version, opts = {}) ⇒ Object

Disable two factor authentication Disables Two Factor Authentication for your User. Once successful, login attempts from untrusted computers will only require a password before being successful. This is less secure, and is discouraged. <<LB>> — - __CLI__. “‘ linode-cli profile tfa-disable “` [Learn more…](www.linode.com/docs/products/tools/cli/get-started/) - __OAuth scopes__. “` account:read_write “` [Learn more…](techdocs.akamai.com/linode-api/reference/get-started#oauth)

Parameters:

  • api_version (String)

    __Enum__ Call either the &#x60;v4&#x60; URL, or &#x60;v4beta&#x60; for operations still in Beta.

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

    the optional parameters

Returns:

  • (Object)


1867
1868
1869
1870
# File 'lib/linode_openapi_client/api/profile_api.rb', line 1867

def post_tfa_disable(api_version, opts = {})
  data, _status_code, _headers = post_tfa_disable_with_http_info(api_version, opts)
  data
end

#post_tfa_disable_with_http_info(api_version, opts = {}) ⇒ Array<(Object, Integer, Hash)>

Disable two factor authentication Disables Two Factor Authentication for your User. Once successful, login attempts from untrusted computers will only require a password before being successful. This is less secure, and is discouraged. &lt;&lt;LB&gt;&gt; — - __CLI__. &#x60;&#x60;&#x60; linode-cli profile tfa-disable &#x60;&#x60;&#x60; [Learn more…](www.linode.com/docs/products/tools/cli/get-started/) - __OAuth scopes__. &#x60;&#x60;&#x60; account:read_write &#x60;&#x60;&#x60; [Learn more…](techdocs.akamai.com/linode-api/reference/get-started#oauth)

Parameters:

  • api_version (String)

    __Enum__ Call either the &#x60;v4&#x60; URL, or &#x60;v4beta&#x60; for operations still in Beta.

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

    the optional parameters

Returns:

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

    Object data, response status code and response headers



1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
# File 'lib/linode_openapi_client/api/profile_api.rb', line 1877

def post_tfa_disable_with_http_info(api_version, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProfileApi.post_tfa_disable ...'
  end
  # verify the required parameter 'api_version' is set
  if @api_client.config.client_side_validation && api_version.nil?
    fail ArgumentError, "Missing the required parameter 'api_version' when calling ProfileApi.post_tfa_disable"
  end
  # verify enum value
  allowable_values = ["v4", "v4beta"]
  if @api_client.config.client_side_validation && !allowable_values.include?(api_version)
    fail ArgumentError, "invalid value for \"api_version\", must be one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/{apiVersion}/profile/tfa-disable'.sub('{' + 'apiVersion' + '}', CGI.escape(api_version.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']

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

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

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

  # auth_names
  auth_names = opts[:debug_auth_names] || ['personalAccessToken', 'oauth']

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

#post_tfa_enable(api_version, opts = {}) ⇒ PostTfaEnable200Response

Create a two factor secret Generates a Two Factor secret for your User. To enable TFA for your User, enter the secret obtained from this operation with the [Enable two factor authentication](techdocs.akamai.com/linode-api/reference/post-tfa-confirm) operation. Once enabled, logins from untrusted computers are required to provide a TFA code before they are successful. Run the [Answer security questions](techdocs.akamai.com/linode-api/reference/post-security-questions) operation. <<LB>> — - __CLI__. “‘ linode-cli profile tfa-enable “` [Learn more…](www.linode.com/docs/products/tools/cli/get-started/) - __OAuth scopes__. “` account:read_write “` [Learn more…](techdocs.akamai.com/linode-api/reference/get-started#oauth)

Parameters:

  • api_version (String)

    __Enum__ Call either the &#x60;v4&#x60; URL, or &#x60;v4beta&#x60; for operations still in Beta.

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

    the optional parameters

Returns:



1935
1936
1937
1938
# File 'lib/linode_openapi_client/api/profile_api.rb', line 1935

def post_tfa_enable(api_version, opts = {})
  data, _status_code, _headers = post_tfa_enable_with_http_info(api_version, opts)
  data
end

#post_tfa_enable_with_http_info(api_version, opts = {}) ⇒ Array<(PostTfaEnable200Response, Integer, Hash)>

Create a two factor secret Generates a Two Factor secret for your User. To enable TFA for your User, enter the secret obtained from this operation with the [Enable two factor authentication](techdocs.akamai.com/linode-api/reference/post-tfa-confirm) operation. Once enabled, logins from untrusted computers are required to provide a TFA code before they are successful. Run the [Answer security questions](techdocs.akamai.com/linode-api/reference/post-security-questions) operation. &lt;&lt;LB&gt;&gt; — - __CLI__. &#x60;&#x60;&#x60; linode-cli profile tfa-enable &#x60;&#x60;&#x60; [Learn more…](www.linode.com/docs/products/tools/cli/get-started/) - __OAuth scopes__. &#x60;&#x60;&#x60; account:read_write &#x60;&#x60;&#x60; [Learn more…](techdocs.akamai.com/linode-api/reference/get-started#oauth)

Parameters:

  • api_version (String)

    __Enum__ Call either the &#x60;v4&#x60; URL, or &#x60;v4beta&#x60; for operations still in Beta.

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

    the optional parameters

Returns:

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

    PostTfaEnable200Response data, response status code and response headers



1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
# File 'lib/linode_openapi_client/api/profile_api.rb', line 1945

def post_tfa_enable_with_http_info(api_version, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProfileApi.post_tfa_enable ...'
  end
  # verify the required parameter 'api_version' is set
  if @api_client.config.client_side_validation && api_version.nil?
    fail ArgumentError, "Missing the required parameter 'api_version' when calling ProfileApi.post_tfa_enable"
  end
  # verify enum value
  allowable_values = ["v4", "v4beta"]
  if @api_client.config.client_side_validation && !allowable_values.include?(api_version)
    fail ArgumentError, "invalid value for \"api_version\", must be one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/{apiVersion}/profile/tfa-enable'.sub('{' + 'apiVersion' + '}', CGI.escape(api_version.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']

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

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

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

  # auth_names
  auth_names = opts[:debug_auth_names] || ['personalAccessToken', 'oauth']

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

#put_personal_access_token(api_version, token_id, put_personal_access_token_request, opts = {}) ⇒ PutPersonalAccessToken200Response

Update a personal access token Updates a Personal Access Token. <<LB>> — - __CLI__. “‘ linode-cli profile token-update 123 \ –label linode-cli “` [Learn more…](www.linode.com/docs/products/tools/cli/get-started/) - __OAuth scopes__. “` account:read_write “` [Learn more…](techdocs.akamai.com/linode-api/reference/get-started#oauth)

Parameters:

  • api_version (String)

    __Enum__ Call either the &#x60;v4&#x60; URL, or &#x60;v4beta&#x60; for operations still in Beta.

  • token_id (Integer)

    The ID of the token to access.

  • put_personal_access_token_request (PutPersonalAccessTokenRequest)

    The fields to update.

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

    the optional parameters

Returns:



2005
2006
2007
2008
# File 'lib/linode_openapi_client/api/profile_api.rb', line 2005

def put_personal_access_token(api_version, token_id, put_personal_access_token_request, opts = {})
  data, _status_code, _headers = put_personal_access_token_with_http_info(api_version, token_id, put_personal_access_token_request, opts)
  data
end

#put_personal_access_token_with_http_info(api_version, token_id, put_personal_access_token_request, opts = {}) ⇒ Array<(PutPersonalAccessToken200Response, Integer, Hash)>

Update a personal access token Updates a Personal Access Token. &lt;&lt;LB&gt;&gt; — - __CLI__. &#x60;&#x60;&#x60; linode-cli profile token-update 123 \ –label linode-cli &#x60;&#x60;&#x60; [Learn more…](www.linode.com/docs/products/tools/cli/get-started/) - __OAuth scopes__. &#x60;&#x60;&#x60; account:read_write &#x60;&#x60;&#x60; [Learn more…](techdocs.akamai.com/linode-api/reference/get-started#oauth)

Parameters:

  • api_version (String)

    __Enum__ Call either the &#x60;v4&#x60; URL, or &#x60;v4beta&#x60; for operations still in Beta.

  • token_id (Integer)

    The ID of the token to access.

  • put_personal_access_token_request (PutPersonalAccessTokenRequest)

    The fields to update.

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

    the optional parameters

Returns:



2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
# File 'lib/linode_openapi_client/api/profile_api.rb', line 2017

def put_personal_access_token_with_http_info(api_version, token_id, put_personal_access_token_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProfileApi.put_personal_access_token ...'
  end
  # verify the required parameter 'api_version' is set
  if @api_client.config.client_side_validation && api_version.nil?
    fail ArgumentError, "Missing the required parameter 'api_version' when calling ProfileApi.put_personal_access_token"
  end
  # verify enum value
  allowable_values = ["v4", "v4beta"]
  if @api_client.config.client_side_validation && !allowable_values.include?(api_version)
    fail ArgumentError, "invalid value for \"api_version\", must be one of #{allowable_values}"
  end
  # verify the required parameter 'token_id' is set
  if @api_client.config.client_side_validation && token_id.nil?
    fail ArgumentError, "Missing the required parameter 'token_id' when calling ProfileApi.put_personal_access_token"
  end
  # verify the required parameter 'put_personal_access_token_request' is set
  if @api_client.config.client_side_validation && put_personal_access_token_request.nil?
    fail ArgumentError, "Missing the required parameter 'put_personal_access_token_request' when calling ProfileApi.put_personal_access_token"
  end
  # resource path
  local_var_path = '/{apiVersion}/profile/tokens/{tokenId}'.sub('{' + 'apiVersion' + '}', CGI.escape(api_version.to_s)).sub('{' + 'tokenId' + '}', CGI.escape(token_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']) 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

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

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

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

  # auth_names
  auth_names = opts[:debug_auth_names] || ['personalAccessToken', 'oauth']

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

#put_profile(api_version, put_profile_request, opts = {}) ⇒ PutProfile200Response

Update a profile Update information in your Profile. This operation requires the ‘account:read_write` OAuth Scope. __Parent and child accounts__ In a [parent and child account](www.linode.com/docs/guides/parent-child-accounts/) environment, the following apply: - You can’t edit the ‘email` for a child account parent user (proxy user). This value is fixed and set when you provision this environment. <<LB>> — - __CLI__. “` linode-cli profile update \ –email [email protected] \ –timezone US/Eastern \ –email_notifications true \ –list_auth_method keys_only \ –two_factor_auth true \ –restricted false “` [Learn more…](www.linode.com/docs/products/tools/cli/get-started/) - __OAuth scopes__. “` account:read_write “` [Learn more…](techdocs.akamai.com/linode-api/reference/get-started#oauth)

Parameters:

  • api_version (String)

    __Enum__ Call either the &#x60;v4&#x60; URL, or &#x60;v4beta&#x60; for operations still in Beta.

  • put_profile_request (PutProfileRequest)

    The fields to update.

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

    the optional parameters

Returns:



2089
2090
2091
2092
# File 'lib/linode_openapi_client/api/profile_api.rb', line 2089

def put_profile(api_version, put_profile_request, opts = {})
  data, _status_code, _headers = put_profile_with_http_info(api_version, put_profile_request, opts)
  data
end

#put_profile_with_http_info(api_version, put_profile_request, opts = {}) ⇒ Array<(PutProfile200Response, Integer, Hash)>

Update a profile Update information in your Profile. This operation requires the &#x60;account:read_write&#x60; OAuth Scope. __Parent and child accounts__ In a [parent and child account](www.linode.com/docs/guides/parent-child-accounts/) environment, the following apply: - You can&#39;t edit the &#x60;email&#x60; for a child account parent user (proxy user). This value is fixed and set when you provision this environment. &lt;&lt;LB&gt;&gt; — - __CLI__. &#x60;&#x60;&#x60; linode-cli profile update \ –email [email protected] \ –timezone US/Eastern \ –email_notifications true \ –list_auth_method keys_only \ –two_factor_auth true \ –restricted false &#x60;&#x60;&#x60; [Learn more…](www.linode.com/docs/products/tools/cli/get-started/) - __OAuth scopes__. &#x60;&#x60;&#x60; account:read_write &#x60;&#x60;&#x60; [Learn more…](techdocs.akamai.com/linode-api/reference/get-started#oauth)

Parameters:

  • api_version (String)

    __Enum__ Call either the &#x60;v4&#x60; URL, or &#x60;v4beta&#x60; for operations still in Beta.

  • put_profile_request (PutProfileRequest)

    The fields to update.

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

    the optional parameters

Returns:

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

    PutProfile200Response data, response status code and response headers



2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
# File 'lib/linode_openapi_client/api/profile_api.rb', line 2100

def put_profile_with_http_info(api_version, put_profile_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProfileApi.put_profile ...'
  end
  # verify the required parameter 'api_version' is set
  if @api_client.config.client_side_validation && api_version.nil?
    fail ArgumentError, "Missing the required parameter 'api_version' when calling ProfileApi.put_profile"
  end
  # verify enum value
  allowable_values = ["v4", "v4beta"]
  if @api_client.config.client_side_validation && !allowable_values.include?(api_version)
    fail ArgumentError, "invalid value for \"api_version\", must be one of #{allowable_values}"
  end
  # verify the required parameter 'put_profile_request' is set
  if @api_client.config.client_side_validation && put_profile_request.nil?
    fail ArgumentError, "Missing the required parameter 'put_profile_request' when calling ProfileApi.put_profile"
  end
  # resource path
  local_var_path = '/{apiVersion}/profile'.sub('{' + 'apiVersion' + '}', CGI.escape(api_version.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

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

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

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

  # auth_names
  auth_names = opts[:debug_auth_names] || ['personalAccessToken', 'oauth']

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

#put_ssh_key(api_version, ssh_key_id, put_ssh_key_request, opts = {}) ⇒ GetSshKey200Response

Update an SSH key Updates an SSH Key that you have permission to ‘read_write`. Only SSH key labels can be updated. <<LB>> — - __CLI__. “` linode-cli sshkeys update 42 \ –label "my laptop" “` [Learn more…](www.linode.com/docs/products/tools/cli/get-started/) - __OAuth scopes__. “` account:read_write “` [Learn more…](techdocs.akamai.com/linode-api/reference/get-started#oauth)

Parameters:

  • api_version (String)

    __Enum__ Call either the &#x60;v4&#x60; URL, or &#x60;v4beta&#x60; for operations still in Beta.

  • ssh_key_id (Integer)

    The ID of the SSHKey.

  • put_ssh_key_request (PutSshKeyRequest)

    The fields to update.

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

    the optional parameters

Returns:



2169
2170
2171
2172
# File 'lib/linode_openapi_client/api/profile_api.rb', line 2169

def put_ssh_key(api_version, ssh_key_id, put_ssh_key_request, opts = {})
  data, _status_code, _headers = put_ssh_key_with_http_info(api_version, ssh_key_id, put_ssh_key_request, opts)
  data
end

#put_ssh_key_with_http_info(api_version, ssh_key_id, put_ssh_key_request, opts = {}) ⇒ Array<(GetSshKey200Response, Integer, Hash)>

Update an SSH key Updates an SSH Key that you have permission to &#x60;read_write&#x60;. Only SSH key labels can be updated. &lt;&lt;LB&gt;&gt; — - __CLI__. &#x60;&#x60;&#x60; linode-cli sshkeys update 42 \ –label &quot;my laptop&quot; &#x60;&#x60;&#x60; [Learn more…](www.linode.com/docs/products/tools/cli/get-started/) - __OAuth scopes__. &#x60;&#x60;&#x60; account:read_write &#x60;&#x60;&#x60; [Learn more…](techdocs.akamai.com/linode-api/reference/get-started#oauth)

Parameters:

  • api_version (String)

    __Enum__ Call either the &#x60;v4&#x60; URL, or &#x60;v4beta&#x60; for operations still in Beta.

  • ssh_key_id (Integer)

    The ID of the SSHKey.

  • put_ssh_key_request (PutSshKeyRequest)

    The fields to update.

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

    the optional parameters

Returns:

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

    GetSshKey200Response data, response status code and response headers



2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
# File 'lib/linode_openapi_client/api/profile_api.rb', line 2181

def put_ssh_key_with_http_info(api_version, ssh_key_id, put_ssh_key_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProfileApi.put_ssh_key ...'
  end
  # verify the required parameter 'api_version' is set
  if @api_client.config.client_side_validation && api_version.nil?
    fail ArgumentError, "Missing the required parameter 'api_version' when calling ProfileApi.put_ssh_key"
  end
  # verify enum value
  allowable_values = ["v4", "v4beta"]
  if @api_client.config.client_side_validation && !allowable_values.include?(api_version)
    fail ArgumentError, "invalid value for \"api_version\", must be one of #{allowable_values}"
  end
  # verify the required parameter 'ssh_key_id' is set
  if @api_client.config.client_side_validation && ssh_key_id.nil?
    fail ArgumentError, "Missing the required parameter 'ssh_key_id' when calling ProfileApi.put_ssh_key"
  end
  # verify the required parameter 'put_ssh_key_request' is set
  if @api_client.config.client_side_validation && put_ssh_key_request.nil?
    fail ArgumentError, "Missing the required parameter 'put_ssh_key_request' when calling ProfileApi.put_ssh_key"
  end
  # resource path
  local_var_path = '/{apiVersion}/profile/sshkeys/{sshKeyId}'.sub('{' + 'apiVersion' + '}', CGI.escape(api_version.to_s)).sub('{' + 'sshKeyId' + '}', CGI.escape(ssh_key_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']) 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

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

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

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

  # auth_names
  auth_names = opts[:debug_auth_names] || ['personalAccessToken', 'oauth']

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

#put_user_preferences(api_version, body, opts = {}) ⇒ Object

Update a user’s preferences Updates a user’s preferences. These preferences are tied to the OAuth client that generated the token making the request. The user preferences endpoints allow consumers of the API to store arbitrary JSON data, such as a user’s font size preference or preferred display name. An account may have multiple preferences. Preferences, and the pertaining request body, may contain any arbitrary JSON data that the user would like to store. <<LB>> — - __OAuth scopes__. “‘ account:read_write “` [Learn more…](techdocs.akamai.com/linode-api/reference/get-started#oauth)

Parameters:

  • api_version (String)

    __Enum__ Call either the &#x60;v4&#x60; URL, or &#x60;v4beta&#x60; for operations still in Beta.

  • body (Object)

    The user preferences to update or store.

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

    the optional parameters

Returns:

  • (Object)


2253
2254
2255
2256
# File 'lib/linode_openapi_client/api/profile_api.rb', line 2253

def put_user_preferences(api_version, body, opts = {})
  data, _status_code, _headers = put_user_preferences_with_http_info(api_version, body, opts)
  data
end

#put_user_preferences_with_http_info(api_version, body, opts = {}) ⇒ Array<(Object, Integer, Hash)>

Update a user&#39;s preferences Updates a user&#39;s preferences. These preferences are tied to the OAuth client that generated the token making the request. The user preferences endpoints allow consumers of the API to store arbitrary JSON data, such as a user&#39;s font size preference or preferred display name. An account may have multiple preferences. Preferences, and the pertaining request body, may contain any arbitrary JSON data that the user would like to store. &lt;&lt;LB&gt;&gt; — - __OAuth scopes__. &#x60;&#x60;&#x60; account:read_write &#x60;&#x60;&#x60; [Learn more…](techdocs.akamai.com/linode-api/reference/get-started#oauth)

Parameters:

  • api_version (String)

    __Enum__ Call either the &#x60;v4&#x60; URL, or &#x60;v4beta&#x60; for operations still in Beta.

  • body (Object)

    The user preferences to update or store.

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

    the optional parameters

Returns:

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

    Object data, response status code and response headers



2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
# File 'lib/linode_openapi_client/api/profile_api.rb', line 2264

def put_user_preferences_with_http_info(api_version, body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProfileApi.put_user_preferences ...'
  end
  # verify the required parameter 'api_version' is set
  if @api_client.config.client_side_validation && api_version.nil?
    fail ArgumentError, "Missing the required parameter 'api_version' when calling ProfileApi.put_user_preferences"
  end
  # verify enum value
  allowable_values = ["v4", "v4beta"]
  if @api_client.config.client_side_validation && !allowable_values.include?(api_version)
    fail ArgumentError, "invalid value for \"api_version\", must be one of #{allowable_values}"
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling ProfileApi.put_user_preferences"
  end
  # resource path
  local_var_path = '/{apiVersion}/profile/preferences'.sub('{' + 'apiVersion' + '}', CGI.escape(api_version.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

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

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

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

  # auth_names
  auth_names = opts[:debug_auth_names] || ['personalAccessToken', 'oauth']

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