Class: PlatformRest::Me

Inherits:
Object
  • Object
show all
Defined in:
lib/platform_rest/me.rb

Overview

Class containing all the actions for the Me Resource

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ Me

Returns a new instance of Me.



30
31
32
# File 'lib/platform_rest/me.rb', line 30

def initialize(client)
  @client = client
end

Instance Method Details

#add_recent_item(params = {}) ⇒ Object

Adds an item to a recent item list

Authentication: The client must be configured with a valid api access token to call this action. The token must include at least one of the following scopes: all.User, me.*, or me.addRecentItem.

Parameters:

  • hash data - Object containing recent item info (api.losant.com/#/definitions/recentItem)

  • string losantdomain - Domain scope of request (rarely needed)

  • boolean _actions - Return resource actions in response

  • boolean _links - Return resource link in response

  • boolean _embedded - Return embedded resources in response

Responses:

Errors:

Raises:

  • (ArgumentError)


54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# File 'lib/platform_rest/me.rb', line 54

def add_recent_item(params = {})
  params = Utils.symbolize_hash_keys(params)
  query_params = { _actions: false, _links: true, _embedded: true }
  headers = {}
  body = nil

  raise ArgumentError.new("data is required") unless params.has_key?(:data)

  body = params[:data] if params.has_key?(:data)
  headers[:losantdomain] = params[:losantdomain] if params.has_key?(:losantdomain)
  query_params[:_actions] = params[:_actions] if params.has_key?(:_actions)
  query_params[:_links] = params[:_links] if params.has_key?(:_links)
  query_params[:_embedded] = params[:_embedded] if params.has_key?(:_embedded)

  path = "/me/recentItems"

  @client.request(
    method: :post,
    path: path,
    query: query_params,
    headers: headers,
    body: body)
end

#change_password(params = {}) ⇒ Object

Changes the current user’s password and optionally logs out all other sessions

Authentication: The client must be configured with a valid api access token to call this action. The token must include at least one of the following scopes: all.User, me.*, or me.changePassword.

Parameters:

  • hash data - Object containing the password change info (api.losant.com/#/definitions/changePassword)

  • string losantdomain - Domain scope of request (rarely needed)

  • boolean _actions - Return resource actions in response

  • boolean _links - Return resource link in response

  • boolean _embedded - Return embedded resources in response

Responses:

Errors:

Raises:

  • (ArgumentError)


98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
# File 'lib/platform_rest/me.rb', line 98

def change_password(params = {})
  params = Utils.symbolize_hash_keys(params)
  query_params = { _actions: false, _links: true, _embedded: true }
  headers = {}
  body = nil

  raise ArgumentError.new("data is required") unless params.has_key?(:data)

  body = params[:data] if params.has_key?(:data)
  headers[:losantdomain] = params[:losantdomain] if params.has_key?(:losantdomain)
  query_params[:_actions] = params[:_actions] if params.has_key?(:_actions)
  query_params[:_links] = params[:_links] if params.has_key?(:_links)
  query_params[:_embedded] = params[:_embedded] if params.has_key?(:_embedded)

  path = "/me/changePassword"

  @client.request(
    method: :patch,
    path: path,
    query: query_params,
    headers: headers,
    body: body)
end

#delete(params = {}) ⇒ Object

Deletes the current user

Authentication: The client must be configured with a valid api access token to call this action. The token must include at least one of the following scopes: all.User, me.*, or me.delete.

Parameters:

  • hash credentials - User authentication credentials (api.losant.com/#/definitions/userCredentials)

  • string losantdomain - Domain scope of request (rarely needed)

  • boolean _actions - Return resource actions in response

  • boolean _links - Return resource link in response

  • boolean _embedded - Return embedded resources in response

Responses:

Errors:

Raises:

  • (ArgumentError)


142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
# File 'lib/platform_rest/me.rb', line 142

def delete(params = {})
  params = Utils.symbolize_hash_keys(params)
  query_params = { _actions: false, _links: true, _embedded: true }
  headers = {}
  body = nil

  raise ArgumentError.new("credentials is required") unless params.has_key?(:credentials)

  body = params[:credentials] if params.has_key?(:credentials)
  headers[:losantdomain] = params[:losantdomain] if params.has_key?(:losantdomain)
  query_params[:_actions] = params[:_actions] if params.has_key?(:_actions)
  query_params[:_links] = params[:_links] if params.has_key?(:_links)
  query_params[:_embedded] = params[:_embedded] if params.has_key?(:_embedded)

  path = "/me/delete"

  @client.request(
    method: :post,
    path: path,
    query: query_params,
    headers: headers,
    body: body)
end

#device_counts(params = {}) ⇒ Object

Returns device counts by day for the time range specified for all applications the current user owns

Authentication: The client must be configured with a valid api access token to call this action. The token must include at least one of the following scopes: all.User, all.User.read, me.*, or me.deviceCounts.

Parameters:

  • string start - Start of range for device count query (ms since epoch)

  • string end - End of range for device count query (ms since epoch)

  • string losantdomain - Domain scope of request (rarely needed)

  • boolean _actions - Return resource actions in response

  • boolean _links - Return resource link in response

  • boolean _embedded - Return embedded resources in response

Responses:

Errors:



187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
# File 'lib/platform_rest/me.rb', line 187

def device_counts(params = {})
  params = Utils.symbolize_hash_keys(params)
  query_params = { _actions: false, _links: true, _embedded: true }
  headers = {}
  body = nil


  query_params[:start] = params[:start] if params.has_key?(:start)
  query_params[:end] = params[:end] if params.has_key?(:end)
  headers[:losantdomain] = params[:losantdomain] if params.has_key?(:losantdomain)
  query_params[:_actions] = params[:_actions] if params.has_key?(:_actions)
  query_params[:_links] = params[:_links] if params.has_key?(:_links)
  query_params[:_embedded] = params[:_embedded] if params.has_key?(:_embedded)

  path = "/me/deviceCounts"

  @client.request(
    method: :get,
    path: path,
    query: query_params,
    headers: headers,
    body: body)
end

#disable_two_factor_auth(params = {}) ⇒ Object

Disables multi-factor authentication for the current user

Authentication: The client must be configured with a valid api access token to call this action. The token must include at least one of the following scopes: all.User, me.*, or me.disableTwoFactorAuth.

Parameters:

  • hash data - Object containing multi-factor authentication properties (api.losant.com/#/definitions/multiFactorAuthDisable)

  • string losantdomain - Domain scope of request (rarely needed)

  • boolean _actions - Return resource actions in response

  • boolean _links - Return resource link in response

  • boolean _embedded - Return embedded resources in response

Responses:

Errors:

Raises:

  • (ArgumentError)


231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
# File 'lib/platform_rest/me.rb', line 231

def disable_two_factor_auth(params = {})
  params = Utils.symbolize_hash_keys(params)
  query_params = { _actions: false, _links: true, _embedded: true }
  headers = {}
  body = nil

  raise ArgumentError.new("data is required") unless params.has_key?(:data)

  body = params[:data] if params.has_key?(:data)
  headers[:losantdomain] = params[:losantdomain] if params.has_key?(:losantdomain)
  query_params[:_actions] = params[:_actions] if params.has_key?(:_actions)
  query_params[:_links] = params[:_links] if params.has_key?(:_links)
  query_params[:_embedded] = params[:_embedded] if params.has_key?(:_embedded)

  path = "/me/disableTwoFactorAuth"

  @client.request(
    method: :patch,
    path: path,
    query: query_params,
    headers: headers,
    body: body)
end

#disconnect_github(params = {}) ⇒ Object

Disconnects the user from Github

Authentication: The client must be configured with a valid api access token to call this action. The token must include at least one of the following scopes: all.User, me.*, or me.disconnectGithub.

Parameters:

  • string losantdomain - Domain scope of request (rarely needed)

  • boolean _actions - Return resource actions in response

  • boolean _links - Return resource link in response

  • boolean _embedded - Return embedded resources in response

Responses:

Errors:



274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
# File 'lib/platform_rest/me.rb', line 274

def disconnect_github(params = {})
  params = Utils.symbolize_hash_keys(params)
  query_params = { _actions: false, _links: true, _embedded: true }
  headers = {}
  body = nil


  headers[:losantdomain] = params[:losantdomain] if params.has_key?(:losantdomain)
  query_params[:_actions] = params[:_actions] if params.has_key?(:_actions)
  query_params[:_links] = params[:_links] if params.has_key?(:_links)
  query_params[:_embedded] = params[:_embedded] if params.has_key?(:_embedded)

  path = "/me/disconnectGithub"

  @client.request(
    method: :patch,
    path: path,
    query: query_params,
    headers: headers,
    body: body)
end

#enable_two_factor_auth(params = {}) ⇒ Object

Enables multi-factor authentication for the current user

Authentication: The client must be configured with a valid api access token to call this action. The token must include at least one of the following scopes: all.User, me.*, or me.enableTwoFactorAuth.

Parameters:

  • hash data - Object containing multi-factor authentication properties (api.losant.com/#/definitions/multiFactorAuthEnable)

  • string losantdomain - Domain scope of request (rarely needed)

  • boolean _actions - Return resource actions in response

  • boolean _links - Return resource link in response

  • boolean _embedded - Return embedded resources in response

Responses:

Errors:

Raises:

  • (ArgumentError)


316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
# File 'lib/platform_rest/me.rb', line 316

def enable_two_factor_auth(params = {})
  params = Utils.symbolize_hash_keys(params)
  query_params = { _actions: false, _links: true, _embedded: true }
  headers = {}
  body = nil

  raise ArgumentError.new("data is required") unless params.has_key?(:data)

  body = params[:data] if params.has_key?(:data)
  headers[:losantdomain] = params[:losantdomain] if params.has_key?(:losantdomain)
  query_params[:_actions] = params[:_actions] if params.has_key?(:_actions)
  query_params[:_links] = params[:_links] if params.has_key?(:_links)
  query_params[:_embedded] = params[:_embedded] if params.has_key?(:_embedded)

  path = "/me/enableTwoFactorAuth"

  @client.request(
    method: :patch,
    path: path,
    query: query_params,
    headers: headers,
    body: body)
end

#fetch_recent_items(params = {}) ⇒ Object

Gets a recent item list

Authentication: The client must be configured with a valid api access token to call this action. The token must include at least one of the following scopes: all.User, all.User.read, me.*, or me.fetchRecentItems.

Parameters:

  • string parentId - Parent id of the recent list

  • undefined itemType - Item type to get the recent list of. Accepted values are: application, device, flow, dashboard, organization

  • string losantdomain - Domain scope of request (rarely needed)

  • boolean _actions - Return resource actions in response

  • boolean _links - Return resource link in response

  • boolean _embedded - Return embedded resources in response

Responses:

Errors:

Raises:

  • (ArgumentError)


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/platform_rest/me.rb', line 361

def fetch_recent_items(params = {})
  params = Utils.symbolize_hash_keys(params)
  query_params = { _actions: false, _links: true, _embedded: true }
  headers = {}
  body = nil

  raise ArgumentError.new("itemType is required") unless params.has_key?(:itemType)

  query_params[:parentId] = params[:parentId] if params.has_key?(:parentId)
  query_params[:itemType] = params[:itemType] if params.has_key?(:itemType)
  headers[:losantdomain] = params[:losantdomain] if params.has_key?(:losantdomain)
  query_params[:_actions] = params[:_actions] if params.has_key?(:_actions)
  query_params[:_links] = params[:_links] if params.has_key?(:_links)
  query_params[:_embedded] = params[:_embedded] if params.has_key?(:_embedded)

  path = "/me/recentItems"

  @client.request(
    method: :get,
    path: path,
    query: query_params,
    headers: headers,
    body: body)
end

#generate_two_factor_auth(params = {}) ⇒ Object

Returns the multi-factor authentication key for the current user

Authentication: The client must be configured with a valid api access token to call this action. The token must include at least one of the following scopes: all.User, me.*, or me.generateTwoFactorAuth.

Parameters:

  • string losantdomain - Domain scope of request (rarely needed)

  • boolean _actions - Return resource actions in response

  • boolean _links - Return resource link in response

  • boolean _embedded - Return embedded resources in response

Responses:

Errors:



405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
# File 'lib/platform_rest/me.rb', line 405

def generate_two_factor_auth(params = {})
  params = Utils.symbolize_hash_keys(params)
  query_params = { _actions: false, _links: true, _embedded: true }
  headers = {}
  body = nil


  headers[:losantdomain] = params[:losantdomain] if params.has_key?(:losantdomain)
  query_params[:_actions] = params[:_actions] if params.has_key?(:_actions)
  query_params[:_links] = params[:_links] if params.has_key?(:_links)
  query_params[:_embedded] = params[:_embedded] if params.has_key?(:_embedded)

  path = "/me/generateTwoFactorAuth"

  @client.request(
    method: :patch,
    path: path,
    query: query_params,
    headers: headers,
    body: body)
end

#get(params = {}) ⇒ Object

Retrieves information on the current user

Authentication: The client must be configured with a valid api access token to call this action. The token must include at least one of the following scopes: all.User, all.User.read, me.*, or me.get.

Parameters:

  • undefined includeRecent - Should the user include recent app/dashboard info

  • string summaryExclude - Comma-separated list of summary fields to exclude from user summary

  • string summaryInclude - Comma-separated list of summary fields to include in user summary

  • string losantdomain - Domain scope of request (rarely needed)

  • boolean _actions - Return resource actions in response

  • boolean _links - Return resource link in response

  • boolean _embedded - Return embedded resources in response

Responses:

Errors:



448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
# File 'lib/platform_rest/me.rb', line 448

def get(params = {})
  params = Utils.symbolize_hash_keys(params)
  query_params = { _actions: false, _links: true, _embedded: true }
  headers = {}
  body = nil


  query_params[:includeRecent] = params[:includeRecent] if params.has_key?(:includeRecent)
  query_params[:summaryExclude] = params[:summaryExclude] if params.has_key?(:summaryExclude)
  query_params[:summaryInclude] = params[:summaryInclude] if params.has_key?(:summaryInclude)
  headers[:losantdomain] = params[:losantdomain] if params.has_key?(:losantdomain)
  query_params[:_actions] = params[:_actions] if params.has_key?(:_actions)
  query_params[:_links] = params[:_links] if params.has_key?(:_links)
  query_params[:_embedded] = params[:_embedded] if params.has_key?(:_embedded)

  path = "/me"

  @client.request(
    method: :get,
    path: path,
    query: query_params,
    headers: headers,
    body: body)
end

#invite(params = {}) ⇒ Object

Retrieves information for an invitation to an organization

Authentication: The client must be configured with a valid api access token to call this action. The token must include at least one of the following scopes: all.User, me.*, or me.invite.

Parameters:

  • string inviteId - ID associated with the invitation

  • string losantdomain - Domain scope of request (rarely needed)

  • boolean _actions - Return resource actions in response

  • boolean _links - Return resource link in response

  • boolean _embedded - Return embedded resources in response

Responses:

Errors:

Raises:

  • (ArgumentError)


494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
# File 'lib/platform_rest/me.rb', line 494

def invite(params = {})
  params = Utils.symbolize_hash_keys(params)
  query_params = { _actions: false, _links: true, _embedded: true }
  headers = {}
  body = nil

  raise ArgumentError.new("inviteId is required") unless params.has_key?(:inviteId)

  headers[:losantdomain] = params[:losantdomain] if params.has_key?(:losantdomain)
  query_params[:_actions] = params[:_actions] if params.has_key?(:_actions)
  query_params[:_links] = params[:_links] if params.has_key?(:_links)
  query_params[:_embedded] = params[:_embedded] if params.has_key?(:_embedded)

  path = "/me/invites/#{params[:inviteId]}"

  @client.request(
    method: :get,
    path: path,
    query: query_params,
    headers: headers,
    body: body)
end

#invites(params = {}) ⇒ Object

Retrieves pending organization invitations for a user

Authentication: The client must be configured with a valid api access token to call this action. The token must include at least one of the following scopes: all.User, me.*, or me.invites.

Parameters:

  • string losantdomain - Domain scope of request (rarely needed)

  • boolean _actions - Return resource actions in response

  • boolean _links - Return resource link in response

  • boolean _embedded - Return embedded resources in response

Responses:

Errors:



536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
# File 'lib/platform_rest/me.rb', line 536

def invites(params = {})
  params = Utils.symbolize_hash_keys(params)
  query_params = { _actions: false, _links: true, _embedded: true }
  headers = {}
  body = nil


  headers[:losantdomain] = params[:losantdomain] if params.has_key?(:losantdomain)
  query_params[:_actions] = params[:_actions] if params.has_key?(:_actions)
  query_params[:_links] = params[:_links] if params.has_key?(:_links)
  query_params[:_embedded] = params[:_embedded] if params.has_key?(:_embedded)

  path = "/me/invites"

  @client.request(
    method: :get,
    path: path,
    query: query_params,
    headers: headers,
    body: body)
end

#notebook_minute_counts(params = {}) ⇒ Object

Returns notebook execution usage by day for the time range specified for all applications the current user owns

Authentication: The client must be configured with a valid api access token to call this action. The token must include at least one of the following scopes: all.User, all.User.read, me.*, or me.notebookMinuteCounts.

Parameters:

  • string start - Start of range for notebook execution query (ms since epoch)

  • string end - End of range for notebook execution query (ms since epoch)

  • string losantdomain - Domain scope of request (rarely needed)

  • boolean _actions - Return resource actions in response

  • boolean _links - Return resource link in response

  • boolean _embedded - Return embedded resources in response

Responses:

Errors:



579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
# File 'lib/platform_rest/me.rb', line 579

def notebook_minute_counts(params = {})
  params = Utils.symbolize_hash_keys(params)
  query_params = { _actions: false, _links: true, _embedded: true }
  headers = {}
  body = nil


  query_params[:start] = params[:start] if params.has_key?(:start)
  query_params[:end] = params[:end] if params.has_key?(:end)
  headers[:losantdomain] = params[:losantdomain] if params.has_key?(:losantdomain)
  query_params[:_actions] = params[:_actions] if params.has_key?(:_actions)
  query_params[:_links] = params[:_links] if params.has_key?(:_links)
  query_params[:_embedded] = params[:_embedded] if params.has_key?(:_embedded)

  path = "/me/notebookMinuteCounts"

  @client.request(
    method: :get,
    path: path,
    query: query_params,
    headers: headers,
    body: body)
end

#patch(params = {}) ⇒ Object

Updates information about the current user

Authentication: The client must be configured with a valid api access token to call this action. The token must include at least one of the following scopes: all.User, me.*, or me.patch.

Parameters:

  • hash user - Object containing new user properties (api.losant.com/#/definitions/mePatch)

  • string summaryExclude - Comma-separated list of summary fields to exclude from user summary

  • string summaryInclude - Comma-separated list of summary fields to include in user summary

  • string losantdomain - Domain scope of request (rarely needed)

  • boolean _actions - Return resource actions in response

  • boolean _links - Return resource link in response

  • boolean _embedded - Return embedded resources in response

Responses:

Errors:

Raises:

  • (ArgumentError)


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
# File 'lib/platform_rest/me.rb', line 625

def patch(params = {})
  params = Utils.symbolize_hash_keys(params)
  query_params = { _actions: false, _links: true, _embedded: true }
  headers = {}
  body = nil

  raise ArgumentError.new("user is required") unless params.has_key?(:user)

  body = params[:user] if params.has_key?(:user)
  query_params[:summaryExclude] = params[:summaryExclude] if params.has_key?(:summaryExclude)
  query_params[:summaryInclude] = params[:summaryInclude] if params.has_key?(:summaryInclude)
  headers[:losantdomain] = params[:losantdomain] if params.has_key?(:losantdomain)
  query_params[:_actions] = params[:_actions] if params.has_key?(:_actions)
  query_params[:_links] = params[:_links] if params.has_key?(:_links)
  query_params[:_embedded] = params[:_embedded] if params.has_key?(:_embedded)

  path = "/me"

  @client.request(
    method: :patch,
    path: path,
    query: query_params,
    headers: headers,
    body: body)
end

#payload_counts(params = {}) ⇒ Object

Returns payload counts for the time range specified for all applications the current user owns

Authentication: The client must be configured with a valid api access token to call this action. The token must include at least one of the following scopes: all.User, all.User.read, me.*, or me.payloadCounts.

Parameters:

  • string start - Start of range for payload count query (ms since epoch)

  • string end - End of range for payload count query (ms since epoch)

  • string losantdomain - Domain scope of request (rarely needed)

  • boolean _actions - Return resource actions in response

  • boolean _links - Return resource link in response

  • boolean _embedded - Return embedded resources in response

Responses:

Errors:



672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
# File 'lib/platform_rest/me.rb', line 672

def payload_counts(params = {})
  params = Utils.symbolize_hash_keys(params)
  query_params = { _actions: false, _links: true, _embedded: true }
  headers = {}
  body = nil


  query_params[:start] = params[:start] if params.has_key?(:start)
  query_params[:end] = params[:end] if params.has_key?(:end)
  headers[:losantdomain] = params[:losantdomain] if params.has_key?(:losantdomain)
  query_params[:_actions] = params[:_actions] if params.has_key?(:_actions)
  query_params[:_links] = params[:_links] if params.has_key?(:_links)
  query_params[:_embedded] = params[:_embedded] if params.has_key?(:_embedded)

  path = "/me/payloadCounts"

  @client.request(
    method: :get,
    path: path,
    query: query_params,
    headers: headers,
    body: body)
end

#payload_counts_breakdown(params = {}) ⇒ Object

Returns payload counts per resolution in the time range specified for all applications the current user owns

Authentication: The client must be configured with a valid api access token to call this action. The token must include at least one of the following scopes: all.User, all.User.read, me.*, or me.payloadCountsBreakdown.

Parameters:

  • string start - Start of range for payload count query (ms since epoch)

  • string end - End of range for payload count query (ms since epoch)

  • string resolution - Resolution in milliseconds. Accepted values are: 86400000, 3600000

  • string asBytes - If the resulting stats should be returned as bytes

  • string includeNonBillable - If non-billable payloads should be included in the result

  • string losantdomain - Domain scope of request (rarely needed)

  • boolean _actions - Return resource actions in response

  • boolean _links - Return resource link in response

  • boolean _embedded - Return embedded resources in response

Responses:

Errors:



720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
# File 'lib/platform_rest/me.rb', line 720

def payload_counts_breakdown(params = {})
  params = Utils.symbolize_hash_keys(params)
  query_params = { _actions: false, _links: true, _embedded: true }
  headers = {}
  body = nil


  query_params[:start] = params[:start] if params.has_key?(:start)
  query_params[:end] = params[:end] if params.has_key?(:end)
  query_params[:resolution] = params[:resolution] if params.has_key?(:resolution)
  query_params[:asBytes] = params[:asBytes] if params.has_key?(:asBytes)
  query_params[:includeNonBillable] = params[:includeNonBillable] if params.has_key?(:includeNonBillable)
  headers[:losantdomain] = params[:losantdomain] if params.has_key?(:losantdomain)
  query_params[:_actions] = params[:_actions] if params.has_key?(:_actions)
  query_params[:_links] = params[:_links] if params.has_key?(:_links)
  query_params[:_embedded] = params[:_embedded] if params.has_key?(:_embedded)

  path = "/me/payloadCountsBreakdown"

  @client.request(
    method: :get,
    path: path,
    query: query_params,
    headers: headers,
    body: body)
end

#refresh_token(params = {}) ⇒ Object

Returns a new auth token based on the current auth token

Authentication: The client must be configured with a valid api access token to call this action. The token must include at least one of the following scopes: all.User, or me.*.

Parameters:

  • string losantdomain - Domain scope of request (rarely needed)

  • boolean _actions - Return resource actions in response

  • boolean _links - Return resource link in response

  • boolean _embedded - Return embedded resources in response

Responses:

Errors:



767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
# File 'lib/platform_rest/me.rb', line 767

def refresh_token(params = {})
  params = Utils.symbolize_hash_keys(params)
  query_params = { _actions: false, _links: true, _embedded: true }
  headers = {}
  body = nil


  headers[:losantdomain] = params[:losantdomain] if params.has_key?(:losantdomain)
  query_params[:_actions] = params[:_actions] if params.has_key?(:_actions)
  query_params[:_links] = params[:_links] if params.has_key?(:_links)
  query_params[:_embedded] = params[:_embedded] if params.has_key?(:_embedded)

  path = "/me/refreshToken"

  @client.request(
    method: :get,
    path: path,
    query: query_params,
    headers: headers,
    body: body)
end

#respond_to_invite(params = {}) ⇒ Object

Accepts or rejects an invitation to an organization

Authentication: The client must be configured with a valid api access token to call this action. The token must include at least one of the following scopes: all.User, me.*, or me.respondToInvite.

Parameters:

  • string inviteId - ID associated with the invitation

  • hash response - Response to invitation (api.losant.com/#/definitions/orgInviteActionUser)

  • string losantdomain - Domain scope of request (rarely needed)

  • boolean _actions - Return resource actions in response

  • boolean _links - Return resource link in response

  • boolean _embedded - Return embedded resources in response

Responses:

Errors:

Raises:

  • (ArgumentError)


812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
# File 'lib/platform_rest/me.rb', line 812

def respond_to_invite(params = {})
  params = Utils.symbolize_hash_keys(params)
  query_params = { _actions: false, _links: true, _embedded: true }
  headers = {}
  body = nil

  raise ArgumentError.new("inviteId is required") unless params.has_key?(:inviteId)
  raise ArgumentError.new("response is required") unless params.has_key?(:response)

  body = params[:response] if params.has_key?(:response)
  headers[:losantdomain] = params[:losantdomain] if params.has_key?(:losantdomain)
  query_params[:_actions] = params[:_actions] if params.has_key?(:_actions)
  query_params[:_links] = params[:_links] if params.has_key?(:_links)
  query_params[:_embedded] = params[:_embedded] if params.has_key?(:_embedded)

  path = "/me/invites/#{params[:inviteId]}"

  @client.request(
    method: :post,
    path: path,
    query: query_params,
    headers: headers,
    body: body)
end

#transfer_resources(params = {}) ⇒ Object

Moves resources to a new owner

Authentication: The client must be configured with a valid api access token to call this action. The token must include at least one of the following scopes: all.User, me.*, or me.transferResources.

Parameters:

  • hash transfer - Object containing properties of the transfer (api.losant.com/#/definitions/resourceTransfer)

  • string losantdomain - Domain scope of request (rarely needed)

  • boolean _actions - Return resource actions in response

  • boolean _links - Return resource link in response

  • boolean _embedded - Return embedded resources in response

Responses:

Errors:

Raises:

  • (ArgumentError)


857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
# File 'lib/platform_rest/me.rb', line 857

def transfer_resources(params = {})
  params = Utils.symbolize_hash_keys(params)
  query_params = { _actions: false, _links: true, _embedded: true }
  headers = {}
  body = nil

  raise ArgumentError.new("transfer is required") unless params.has_key?(:transfer)

  body = params[:transfer] if params.has_key?(:transfer)
  headers[:losantdomain] = params[:losantdomain] if params.has_key?(:losantdomain)
  query_params[:_actions] = params[:_actions] if params.has_key?(:_actions)
  query_params[:_links] = params[:_links] if params.has_key?(:_links)
  query_params[:_embedded] = params[:_embedded] if params.has_key?(:_embedded)

  path = "/me/transferResources"

  @client.request(
    method: :patch,
    path: path,
    query: query_params,
    headers: headers,
    body: body)
end

#verify_email(params = {}) ⇒ Object

Sends an email verification to the user

Authentication: The client must be configured with a valid api access token to call this action. The token must include at least one of the following scopes: all.User, me.*, or me.verifyEmail.

Parameters:

  • string losantdomain - Domain scope of request (rarely needed)

  • boolean _actions - Return resource actions in response

  • boolean _links - Return resource link in response

  • boolean _embedded - Return embedded resources in response

Responses:

Errors:



900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
# File 'lib/platform_rest/me.rb', line 900

def verify_email(params = {})
  params = Utils.symbolize_hash_keys(params)
  query_params = { _actions: false, _links: true, _embedded: true }
  headers = {}
  body = nil


  headers[:losantdomain] = params[:losantdomain] if params.has_key?(:losantdomain)
  query_params[:_actions] = params[:_actions] if params.has_key?(:_actions)
  query_params[:_links] = params[:_links] if params.has_key?(:_links)
  query_params[:_embedded] = params[:_embedded] if params.has_key?(:_embedded)

  path = "/me/verify-email"

  @client.request(
    method: :post,
    path: path,
    query: query_params,
    headers: headers,
    body: body)
end