Class: GetStream::Generated::CommonClient

Inherits:
Object
  • Object
show all
Defined in:
lib/getstream_ruby/generated/common_client.rb

Overview

Common API client with generated methods

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ CommonClient



12
13
14
# File 'lib/getstream_ruby/generated/common_client.rb', line 12

def initialize(client)
  @client = client
end

Instance Method Details

#block_users(block_users_request) ⇒ Models::BlockUsersResponse

Block users



1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
# File 'lib/getstream_ruby/generated/common_client.rb', line 1037

def block_users(block_users_request)
  path = '/api/v2/users/block'
  # Build request body
  body = block_users_request

  # Make the API request
  @client.make_request(
    :post,
    path,
    body: body
  )
end

#check_external_storage(name) ⇒ Models::CheckExternalStorageResponse



335
336
337
338
339
340
341
342
343
344
345
# File 'lib/getstream_ruby/generated/common_client.rb', line 335

def check_external_storage(name)
  path = '/api/v2/external_storage/{name}/check'
  # Replace path parameters
  path = path.gsub('{name}', name.to_s)

  # Make the API request
  @client.make_request(
    :get,
    path
  )
end

#check_push(check_push_request) ⇒ Models::CheckPushResponse

Sends a test message via push, this is a test endpoint to verify your push settings



146
147
148
149
150
151
152
153
154
155
156
157
# File 'lib/getstream_ruby/generated/common_client.rb', line 146

def check_push(check_push_request)
  path = '/api/v2/check_push'
  # Build request body
  body = check_push_request

  # Make the API request
  @client.make_request(
    :post,
    path,
    body: body
  )
end

#check_sns(check_sns_request) ⇒ Models::CheckSNSResponse

Validates Amazon SNS configuration



163
164
165
166
167
168
169
170
171
172
173
174
# File 'lib/getstream_ruby/generated/common_client.rb', line 163

def check_sns(check_sns_request)
  path = '/api/v2/check_sns'
  # Build request body
  body = check_sns_request

  # Make the API request
  @client.make_request(
    :post,
    path,
    body: body
  )
end

#check_sqs(check_sqs_request) ⇒ Models::CheckSQSResponse

Validates Amazon SQS credentials



180
181
182
183
184
185
186
187
188
189
190
191
# File 'lib/getstream_ruby/generated/common_client.rb', line 180

def check_sqs(check_sqs_request)
  path = '/api/v2/check_sqs'
  # Build request body
  body = check_sqs_request

  # Make the API request
  @client.make_request(
    :post,
    path,
    body: body
  )
end

#create_block_list(create_block_list_request) ⇒ Models::CreateBlockListResponse

Creates a new application blocklist, once created the blocklist can be used by any channel type



67
68
69
70
71
72
73
74
75
76
77
78
# File 'lib/getstream_ruby/generated/common_client.rb', line 67

def create_block_list(create_block_list_request)
  path = '/api/v2/blocklists'
  # Build request body
  body = create_block_list_request

  # Make the API request
  @client.make_request(
    :post,
    path,
    body: body
  )
end

#create_device(create_device_request) ⇒ Models::Response

Adds a new device to a user, if the same device already exists the call will have no effect



235
236
237
238
239
240
241
242
243
244
245
246
# File 'lib/getstream_ruby/generated/common_client.rb', line 235

def create_device(create_device_request)
  path = '/api/v2/devices'
  # Build request body
  body = create_device_request

  # Make the API request
  @client.make_request(
    :post,
    path,
    body: body
  )
end

#create_external_storage(create_external_storage_request) ⇒ Models::CreateExternalStorageResponse

Creates new external storage



282
283
284
285
286
287
288
289
290
291
292
293
# File 'lib/getstream_ruby/generated/common_client.rb', line 282

def create_external_storage(create_external_storage_request)
  path = '/api/v2/external_storage'
  # Build request body
  body = create_external_storage_request

  # Make the API request
  @client.make_request(
    :post,
    path,
    body: body
  )
end

#create_guest(create_guest_request) ⇒ Models::CreateGuestResponse



351
352
353
354
355
356
357
358
359
360
361
362
# File 'lib/getstream_ruby/generated/common_client.rb', line 351

def create_guest(create_guest_request)
  path = '/api/v2/guest'
  # Build request body
  body = create_guest_request

  # Make the API request
  @client.make_request(
    :post,
    path,
    body: body
  )
end

#create_import(create_import_request) ⇒ Models::CreateImportResponse

Creates a new import



398
399
400
401
402
403
404
405
406
407
408
409
# File 'lib/getstream_ruby/generated/common_client.rb', line 398

def create_import(create_import_request)
  path = '/api/v2/imports'
  # Build request body
  body = create_import_request

  # Make the API request
  @client.make_request(
    :post,
    path,
    body: body
  )
end

#create_import_url(create_import_url_request) ⇒ Models::CreateImportURLResponse

Creates a new import URL



368
369
370
371
372
373
374
375
376
377
378
379
# File 'lib/getstream_ruby/generated/common_client.rb', line 368

def create_import_url(create_import_url_request)
  path = '/api/v2/import_urls'
  # Build request body
  body = create_import_url_request

  # Make the API request
  @client.make_request(
    :post,
    path,
    body: body
  )
end

#create_poll(create_poll_request) ⇒ Models::PollResponse

Creates a new poll



478
479
480
481
482
483
484
485
486
487
488
489
# File 'lib/getstream_ruby/generated/common_client.rb', line 478

def create_poll(create_poll_request)
  path = '/api/v2/polls'
  # Build request body
  body = create_poll_request

  # Make the API request
  @client.make_request(
    :post,
    path,
    body: body
  )
end

#create_poll_option(poll_id, create_poll_option_request) ⇒ Models::PollOptionResponse

Creates a poll optionSends events:- feeds.poll.updated- poll.updated



597
598
599
600
601
602
603
604
605
606
607
608
609
610
# File 'lib/getstream_ruby/generated/common_client.rb', line 597

def create_poll_option(poll_id, create_poll_option_request)
  path = '/api/v2/polls/{poll_id}/options'
  # Replace path parameters
  path = path.gsub('{poll_id}', poll_id.to_s)
  # Build request body
  body = create_poll_option_request

  # Make the API request
  @client.make_request(
    :post,
    path,
    body: body
  )
end

#create_role(create_role_request) ⇒ Models::CreateRoleResponse

Creates custom role



848
849
850
851
852
853
854
855
856
857
858
859
# File 'lib/getstream_ruby/generated/common_client.rb', line 848

def create_role(create_role_request)
  path = '/api/v2/roles'
  # Build request body
  body = create_role_request

  # Make the API request
  @client.make_request(
    :post,
    path,
    body: body
  )
end

#deactivate_user(user_id, deactivate_user_request) ⇒ Models::DeactivateUserResponse

Deactivates user with possibility to activate it backSends events:- user.deactivated



1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
# File 'lib/getstream_ruby/generated/common_client.rb', line 1180

def deactivate_user(user_id, deactivate_user_request)
  path = '/api/v2/users/{user_id}/deactivate'
  # Replace path parameters
  path = path.gsub('{user_id}', user_id.to_s)
  # Build request body
  body = deactivate_user_request

  # Make the API request
  @client.make_request(
    :post,
    path,
    body: body
  )
end

#deactivate_users(deactivate_users_request) ⇒ Models::DeactivateUsersResponse

Deactivate users in batchesSends events:- user.deactivated



1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
# File 'lib/getstream_ruby/generated/common_client.rb', line 1054

def deactivate_users(deactivate_users_request)
  path = '/api/v2/users/deactivate'
  # Build request body
  body = deactivate_users_request

  # Make the API request
  @client.make_request(
    :post,
    path,
    body: body
  )
end

#delete_block_list(name, team = nil) ⇒ Models::Response

Deletes previously created application blocklist



85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
# File 'lib/getstream_ruby/generated/common_client.rb', line 85

def delete_block_list(name, team = nil)
  path = '/api/v2/blocklists/{name}'
  # Replace path parameters
  path = path.gsub('{name}', name.to_s)
  # Build query parameters
  query_params = {}
  query_params['team'] = team unless team.nil?

  # Make the API request
  @client.make_request(
    :delete,
    path,
    query_params: query_params
  )
end

#delete_device(_id, user_id = nil) ⇒ Models::Response

Deletes one device



198
199
200
201
202
203
204
205
206
207
208
209
210
211
# File 'lib/getstream_ruby/generated/common_client.rb', line 198

def delete_device(_id, user_id = nil)
  path = '/api/v2/devices'
  # Build query parameters
  query_params = {}
  query_params['id'] = _id unless _id.nil?
  query_params['user_id'] = user_id unless user_id.nil?

  # Make the API request
  @client.make_request(
    :delete,
    path,
    query_params: query_params
  )
end

#delete_external_storage(name) ⇒ Models::DeleteExternalStorageResponse

Deletes external storage



299
300
301
302
303
304
305
306
307
308
309
# File 'lib/getstream_ruby/generated/common_client.rb', line 299

def delete_external_storage(name)
  path = '/api/v2/external_storage/{name}'
  # Replace path parameters
  path = path.gsub('{name}', name.to_s)

  # Make the API request
  @client.make_request(
    :delete,
    path
  )
end

#delete_file(url = nil) ⇒ Models::Response

Deletes previously uploaded file



897
898
899
900
901
902
903
904
905
906
907
908
909
# File 'lib/getstream_ruby/generated/common_client.rb', line 897

def delete_file(url = nil)
  path = '/api/v2/uploads/file'
  # Build query parameters
  query_params = {}
  query_params['url'] = url unless url.nil?

  # Make the API request
  @client.make_request(
    :delete,
    path,
    query_params: query_params
  )
end

#delete_image(url = nil) ⇒ Models::Response

Deletes previously uploaded image



932
933
934
935
936
937
938
939
940
941
942
943
944
# File 'lib/getstream_ruby/generated/common_client.rb', line 932

def delete_image(url = nil)
  path = '/api/v2/uploads/image'
  # Build query parameters
  query_params = {}
  query_params['url'] = url unless url.nil?

  # Make the API request
  @client.make_request(
    :delete,
    path,
    query_params: query_params
  )
end

#delete_poll(poll_id, user_id = nil) ⇒ Models::Response

Deletes a pollSends events:- feeds.poll.deleted- poll.deleted



535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
# File 'lib/getstream_ruby/generated/common_client.rb', line 535

def delete_poll(poll_id, user_id = nil)
  path = '/api/v2/polls/{poll_id}'
  # Replace path parameters
  path = path.gsub('{poll_id}', poll_id.to_s)
  # Build query parameters
  query_params = {}
  query_params['user_id'] = user_id unless user_id.nil?

  # Make the API request
  @client.make_request(
    :delete,
    path,
    query_params: query_params
  )
end

#delete_poll_option(poll_id, option_id, user_id = nil) ⇒ Models::Response

Deletes a poll optionSends events:- feeds.poll.updated- poll.updated



638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
# File 'lib/getstream_ruby/generated/common_client.rb', line 638

def delete_poll_option(poll_id, option_id, user_id = nil)
  path = '/api/v2/polls/{poll_id}/options/{option_id}'
  # Replace path parameters
  path = path.gsub('{poll_id}', poll_id.to_s)
  path = path.gsub('{option_id}', option_id.to_s)
  # Build query parameters
  query_params = {}
  query_params['user_id'] = user_id unless user_id.nil?

  # Make the API request
  @client.make_request(
    :delete,
    path,
    query_params: query_params
  )
end

#delete_push_provider(_type, name) ⇒ Models::Response

Delete a push provider from v2 with multi bundle/package support. v1 isn’t supported in this endpoint



755
756
757
758
759
760
761
762
763
764
765
766
# File 'lib/getstream_ruby/generated/common_client.rb', line 755

def delete_push_provider(_type, name)
  path = '/api/v2/push_providers/{type}/{name}'
  # Replace path parameters
  path = path.gsub('{type}', _type.to_s)
  path = path.gsub('{name}', name.to_s)

  # Make the API request
  @client.make_request(
    :delete,
    path
  )
end

#delete_role(name) ⇒ Models::Response

Deletes custom role



865
866
867
868
869
870
871
872
873
874
875
# File 'lib/getstream_ruby/generated/common_client.rb', line 865

def delete_role(name)
  path = '/api/v2/roles/{name}'
  # Replace path parameters
  path = path.gsub('{name}', name.to_s)

  # Make the API request
  @client.make_request(
    :delete,
    path
  )
end

#delete_users(delete_users_request) ⇒ Models::DeleteUsersResponse

Deletes users and optionally all their belongings asynchronously.Sends events:- channel.deleted- user.deleted



1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
# File 'lib/getstream_ruby/generated/common_client.rb', line 1071

def delete_users(delete_users_request)
  path = '/api/v2/users/delete'
  # Build request body
  body = delete_users_request

  # Make the API request
  @client.make_request(
    :post,
    path,
    body: body
  )
end

#export_user(user_id) ⇒ Models::ExportUserResponse

Exports the user’s profile, reactions and messages. Raises an error if a user has more than 10k messages or reactions



1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
# File 'lib/getstream_ruby/generated/common_client.rb', line 1199

def export_user(user_id)
  path = '/api/v2/users/{user_id}/export'
  # Replace path parameters
  path = path.gsub('{user_id}', user_id.to_s)

  # Make the API request
  @client.make_request(
    :get,
    path
  )
end

#export_users(export_users_request) ⇒ Models::ExportUsersResponse

Exports user profile, reactions and messages for list of given users



252
253
254
255
256
257
258
259
260
261
262
263
# File 'lib/getstream_ruby/generated/common_client.rb', line 252

def export_users(export_users_request)
  path = '/api/v2/export/users'
  # Build request body
  body = export_users_request

  # Make the API request
  @client.make_request(
    :post,
    path,
    body: body
  )
end

#get_appModels::GetApplicationResponse

This Method returns the application settings



18
19
20
21
22
23
24
25
26
# File 'lib/getstream_ruby/generated/common_client.rb', line 18

def get_app()
  path = '/api/v2/app'

  # Make the API request
  @client.make_request(
    :get,
    path
  )
end

#get_block_list(name, team = nil) ⇒ Models::GetBlockListResponse

Returns block list by given name



106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
# File 'lib/getstream_ruby/generated/common_client.rb', line 106

def get_block_list(name, team = nil)
  path = '/api/v2/blocklists/{name}'
  # Replace path parameters
  path = path.gsub('{name}', name.to_s)
  # Build query parameters
  query_params = {}
  query_params['team'] = team unless team.nil?

  # Make the API request
  @client.make_request(
    :get,
    path,
    query_params: query_params
  )
end

#get_blocked_users(user_id = nil) ⇒ Models::GetBlockedUsersResponse

Get list of blocked Users



1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
# File 'lib/getstream_ruby/generated/common_client.rb', line 1019

def get_blocked_users(user_id = nil)
  path = '/api/v2/users/block'
  # Build query parameters
  query_params = {}
  query_params['user_id'] = user_id unless user_id.nil?

  # Make the API request
  @client.make_request(
    :get,
    path,
    query_params: query_params
  )
end

#get_import(_id) ⇒ Models::GetImportResponse

Gets an import



415
416
417
418
419
420
421
422
423
424
425
# File 'lib/getstream_ruby/generated/common_client.rb', line 415

def get_import(_id)
  path = '/api/v2/imports/{id}'
  # Replace path parameters
  path = path.gsub('{id}', _id.to_s)

  # Make the API request
  @client.make_request(
    :get,
    path
  )
end

#get_og(url) ⇒ Models::GetOGResponse

Get an OpenGraph attachment for a link



431
432
433
434
435
436
437
438
439
440
441
442
443
# File 'lib/getstream_ruby/generated/common_client.rb', line 431

def get_og(url)
  path = '/api/v2/og'
  # Build query parameters
  query_params = {}
  query_params['url'] = url unless url.nil?

  # Make the API request
  @client.make_request(
    :get,
    path,
    query_params: query_params
  )
end

#get_permission(_id) ⇒ Models::GetCustomPermissionResponse

Gets custom permission



462
463
464
465
466
467
468
469
470
471
472
# File 'lib/getstream_ruby/generated/common_client.rb', line 462

def get_permission(_id)
  path = '/api/v2/permissions/{id}'
  # Replace path parameters
  path = path.gsub('{id}', _id.to_s)

  # Make the API request
  @client.make_request(
    :get,
    path
  )
end

#get_poll(poll_id, user_id = nil) ⇒ Models::PollResponse

Retrieves a poll



556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
# File 'lib/getstream_ruby/generated/common_client.rb', line 556

def get_poll(poll_id, user_id = nil)
  path = '/api/v2/polls/{poll_id}'
  # Replace path parameters
  path = path.gsub('{poll_id}', poll_id.to_s)
  # Build query parameters
  query_params = {}
  query_params['user_id'] = user_id unless user_id.nil?

  # Make the API request
  @client.make_request(
    :get,
    path,
    query_params: query_params
  )
end

#get_poll_option(poll_id, option_id, user_id = nil) ⇒ Models::PollOptionResponse

Retrieves a poll option



661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
# File 'lib/getstream_ruby/generated/common_client.rb', line 661

def get_poll_option(poll_id, option_id, user_id = nil)
  path = '/api/v2/polls/{poll_id}/options/{option_id}'
  # Replace path parameters
  path = path.gsub('{poll_id}', poll_id.to_s)
  path = path.gsub('{option_id}', option_id.to_s)
  # Build query parameters
  query_params = {}
  query_params['user_id'] = user_id unless user_id.nil?

  # Make the API request
  @client.make_request(
    :get,
    path,
    query_params: query_params
  )
end

#get_push_templates(push_provider_type, push_provider_name = nil) ⇒ Models::GetPushTemplatesResponse

Retrieve push notification templates for Chat.



773
774
775
776
777
778
779
780
781
782
783
784
785
786
# File 'lib/getstream_ruby/generated/common_client.rb', line 773

def get_push_templates(push_provider_type, push_provider_name = nil)
  path = '/api/v2/push_templates'
  # Build query parameters
  query_params = {}
  query_params['push_provider_type'] = push_provider_type unless push_provider_type.nil?
  query_params['push_provider_name'] = push_provider_name unless push_provider_name.nil?

  # Make the API request
  @client.make_request(
    :get,
    path,
    query_params: query_params
  )
end

#get_rate_limits(server_side = nil, android = nil, ios = nil, web = nil, endpoints = nil) ⇒ Models::GetRateLimitsResponse

Get rate limits usage and quotas



813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
# File 'lib/getstream_ruby/generated/common_client.rb', line 813

def get_rate_limits(server_side = nil, android = nil, ios = nil, web = nil, endpoints = nil)
  path = '/api/v2/rate_limits'
  # Build query parameters
  query_params = {}
  query_params['server_side'] = server_side unless server_side.nil?
  query_params['android'] = android unless android.nil?
  query_params['ios'] = ios unless ios.nil?
  query_params['web'] = web unless web.nil?
  query_params['endpoints'] = endpoints unless endpoints.nil?

  # Make the API request
  @client.make_request(
    :get,
    path,
    query_params: query_params
  )
end

#get_task(_id) ⇒ Models::GetTaskResponse

Gets status of a task



881
882
883
884
885
886
887
888
889
890
891
# File 'lib/getstream_ruby/generated/common_client.rb', line 881

def get_task(_id)
  path = '/api/v2/tasks/{id}'
  # Replace path parameters
  path = path.gsub('{id}', _id.to_s)

  # Make the API request
  @client.make_request(
    :get,
    path
  )
end

#get_user_live_locations(user_id = nil) ⇒ Models::SharedLocationsResponse

Retrieves all active live locations for a user



1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
# File 'lib/getstream_ruby/generated/common_client.rb', line 1088

def get_user_live_locations(user_id = nil)
  path = '/api/v2/users/live_locations'
  # Build query parameters
  query_params = {}
  query_params['user_id'] = user_id unless user_id.nil?

  # Make the API request
  @client.make_request(
    :get,
    path,
    query_params: query_params
  )
end

#list_block_lists(team = nil) ⇒ Models::ListBlockListResponse

Returns all available block lists



49
50
51
52
53
54
55
56
57
58
59
60
61
# File 'lib/getstream_ruby/generated/common_client.rb', line 49

def list_block_lists(team = nil)
  path = '/api/v2/blocklists'
  # Build query parameters
  query_params = {}
  query_params['team'] = team unless team.nil?

  # Make the API request
  @client.make_request(
    :get,
    path,
    query_params: query_params
  )
end

#list_devices(user_id = nil) ⇒ Models::ListDevicesResponse

Returns all available devices



217
218
219
220
221
222
223
224
225
226
227
228
229
# File 'lib/getstream_ruby/generated/common_client.rb', line 217

def list_devices(user_id = nil)
  path = '/api/v2/devices'
  # Build query parameters
  query_params = {}
  query_params['user_id'] = user_id unless user_id.nil?

  # Make the API request
  @client.make_request(
    :get,
    path,
    query_params: query_params
  )
end

#list_external_storageModels::ListExternalStorageResponse

Lists external storage



268
269
270
271
272
273
274
275
276
# File 'lib/getstream_ruby/generated/common_client.rb', line 268

def list_external_storage()
  path = '/api/v2/external_storage'

  # Make the API request
  @client.make_request(
    :get,
    path
  )
end

#list_importsModels::ListImportsResponse

Gets an import



384
385
386
387
388
389
390
391
392
# File 'lib/getstream_ruby/generated/common_client.rb', line 384

def list_imports()
  path = '/api/v2/imports'

  # Make the API request
  @client.make_request(
    :get,
    path
  )
end

#list_permissionsModels::ListPermissionsResponse

Lists all available permissions



448
449
450
451
452
453
454
455
456
# File 'lib/getstream_ruby/generated/common_client.rb', line 448

def list_permissions()
  path = '/api/v2/permissions'

  # Make the API request
  @client.make_request(
    :get,
    path
  )
end

#list_push_providersModels::ListPushProvidersResponse

List details of all push providers.



723
724
725
726
727
728
729
730
731
# File 'lib/getstream_ruby/generated/common_client.rb', line 723

def list_push_providers()
  path = '/api/v2/push_providers'

  # Make the API request
  @client.make_request(
    :get,
    path
  )
end

#list_rolesModels::ListRolesResponse

Lists all available roles



834
835
836
837
838
839
840
841
842
# File 'lib/getstream_ruby/generated/common_client.rb', line 834

def list_roles()
  path = '/api/v2/roles'

  # Make the API request
  @client.make_request(
    :get,
    path
  )
end

#query_poll_votes(poll_id, query_poll_votes_request, user_id = nil) ⇒ Models::PollVotesResponse

Queries votes



684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
# File 'lib/getstream_ruby/generated/common_client.rb', line 684

def query_poll_votes(poll_id, query_poll_votes_request, user_id = nil)
  path = '/api/v2/polls/{poll_id}/votes'
  # Replace path parameters
  path = path.gsub('{poll_id}', poll_id.to_s)
  # Build query parameters
  query_params = {}
  query_params['user_id'] = user_id unless user_id.nil?
  # Build request body
  body = query_poll_votes_request

  # Make the API request
  @client.make_request(
    :post,
    path,
    query_params: query_params,
    body: body
  )
end

#query_polls(query_polls_request, user_id = nil) ⇒ Models::QueryPollsResponse

Queries polls



513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
# File 'lib/getstream_ruby/generated/common_client.rb', line 513

def query_polls(query_polls_request, user_id = nil)
  path = '/api/v2/polls/query'
  # Build query parameters
  query_params = {}
  query_params['user_id'] = user_id unless user_id.nil?
  # Build request body
  body = query_polls_request

  # Make the API request
  @client.make_request(
    :post,
    path,
    query_params: query_params,
    body: body
  )
end

#query_users(payload = nil) ⇒ Models::QueryUsersResponse

Find and filter users



967
968
969
970
971
972
973
974
975
976
977
978
979
# File 'lib/getstream_ruby/generated/common_client.rb', line 967

def query_users(payload = nil)
  path = '/api/v2/users'
  # Build query parameters
  query_params = {}
  query_params['payload'] = payload unless payload.nil?

  # Make the API request
  @client.make_request(
    :get,
    path,
    query_params: query_params
  )
end

#reactivate_user(user_id, reactivate_user_request) ⇒ Models::ReactivateUserResponse

Activates user who’s been deactivated previouslySends events:- user.reactivated



1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
# File 'lib/getstream_ruby/generated/common_client.rb', line 1216

def reactivate_user(user_id, reactivate_user_request)
  path = '/api/v2/users/{user_id}/reactivate'
  # Replace path parameters
  path = path.gsub('{user_id}', user_id.to_s)
  # Build request body
  body = reactivate_user_request

  # Make the API request
  @client.make_request(
    :post,
    path,
    body: body
  )
end

#reactivate_users(reactivate_users_request) ⇒ Models::ReactivateUsersResponse

Reactivate users in batchesSends events:- user.reactivated- user.reactivated



1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
# File 'lib/getstream_ruby/generated/common_client.rb', line 1128

def reactivate_users(reactivate_users_request)
  path = '/api/v2/users/reactivate'
  # Build request body
  body = reactivate_users_request

  # Make the API request
  @client.make_request(
    :post,
    path,
    body: body
  )
end

#restore_users(restore_users_request) ⇒ Models::Response

Restore soft deleted users



1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
# File 'lib/getstream_ruby/generated/common_client.rb', line 1145

def restore_users(restore_users_request)
  path = '/api/v2/users/restore'
  # Build request body
  body = restore_users_request

  # Make the API request
  @client.make_request(
    :post,
    path,
    body: body
  )
end

#unblock_users(unblock_users_request) ⇒ Models::UnblockUsersResponse

Unblock users



1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
# File 'lib/getstream_ruby/generated/common_client.rb', line 1162

def unblock_users(unblock_users_request)
  path = '/api/v2/users/unblock'
  # Build request body
  body = unblock_users_request

  # Make the API request
  @client.make_request(
    :post,
    path,
    body: body
  )
end

#update_app(update_app_request) ⇒ Models::Response

This Method updates one or more application settings



32
33
34
35
36
37
38
39
40
41
42
43
# File 'lib/getstream_ruby/generated/common_client.rb', line 32

def update_app(update_app_request)
  path = '/api/v2/app'
  # Build request body
  body = update_app_request

  # Make the API request
  @client.make_request(
    :patch,
    path,
    body: body
  )
end

#update_block_list(name, update_block_list_request) ⇒ Models::UpdateBlockListResponse

Updates contents of the block list



127
128
129
130
131
132
133
134
135
136
137
138
139
140
# File 'lib/getstream_ruby/generated/common_client.rb', line 127

def update_block_list(name, update_block_list_request)
  path = '/api/v2/blocklists/{name}'
  # Replace path parameters
  path = path.gsub('{name}', name.to_s)
  # Build request body
  body = update_block_list_request

  # Make the API request
  @client.make_request(
    :put,
    path,
    body: body
  )
end

#update_external_storage(name, update_external_storage_request) ⇒ Models::UpdateExternalStorageResponse



316
317
318
319
320
321
322
323
324
325
326
327
328
329
# File 'lib/getstream_ruby/generated/common_client.rb', line 316

def update_external_storage(name, update_external_storage_request)
  path = '/api/v2/external_storage/{name}'
  # Replace path parameters
  path = path.gsub('{name}', name.to_s)
  # Build request body
  body = update_external_storage_request

  # Make the API request
  @client.make_request(
    :put,
    path,
    body: body
  )
end

#update_live_location(update_live_location_request, user_id = nil) ⇒ Models::SharedLocationResponse

Updates an existing live location with new coordinates or expiration time



1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
# File 'lib/getstream_ruby/generated/common_client.rb', line 1107

def update_live_location(update_live_location_request, user_id = nil)
  path = '/api/v2/users/live_locations'
  # Build query parameters
  query_params = {}
  query_params['user_id'] = user_id unless user_id.nil?
  # Build request body
  body = update_live_location_request

  # Make the API request
  @client.make_request(
    :put,
    path,
    query_params: query_params,
    body: body
  )
end

#update_poll(update_poll_request) ⇒ Models::PollResponse

Updates a pollSends events:- feeds.poll.closed- feeds.poll.updated- poll.closed- poll.updated



495
496
497
498
499
500
501
502
503
504
505
506
# File 'lib/getstream_ruby/generated/common_client.rb', line 495

def update_poll(update_poll_request)
  path = '/api/v2/polls'
  # Build request body
  body = update_poll_request

  # Make the API request
  @client.make_request(
    :put,
    path,
    body: body
  )
end

#update_poll_option(poll_id, update_poll_option_request) ⇒ Models::PollOptionResponse

Updates a poll optionSends events:- feeds.poll.updated- poll.updated



617
618
619
620
621
622
623
624
625
626
627
628
629
630
# File 'lib/getstream_ruby/generated/common_client.rb', line 617

def update_poll_option(poll_id, update_poll_option_request)
  path = '/api/v2/polls/{poll_id}/options'
  # Replace path parameters
  path = path.gsub('{poll_id}', poll_id.to_s)
  # Build request body
  body = update_poll_option_request

  # Make the API request
  @client.make_request(
    :put,
    path,
    body: body
  )
end

#update_poll_partial(poll_id, update_poll_partial_request) ⇒ Models::PollResponse

Updates a poll partiallySends events:- feeds.poll.closed- feeds.poll.updated- poll.closed- poll.updated



577
578
579
580
581
582
583
584
585
586
587
588
589
590
# File 'lib/getstream_ruby/generated/common_client.rb', line 577

def update_poll_partial(poll_id, update_poll_partial_request)
  path = '/api/v2/polls/{poll_id}'
  # Replace path parameters
  path = path.gsub('{poll_id}', poll_id.to_s)
  # Build request body
  body = update_poll_partial_request

  # Make the API request
  @client.make_request(
    :patch,
    path,
    body: body
  )
end

#update_push_notification_preferences(upsert_push_preferences_request) ⇒ Models::UpsertPushPreferencesResponse

Upserts the push preferences for a user and or channel member. Set to all, mentions or none



707
708
709
710
711
712
713
714
715
716
717
718
# File 'lib/getstream_ruby/generated/common_client.rb', line 707

def update_push_notification_preferences(upsert_push_preferences_request)
  path = '/api/v2/push_preferences'
  # Build request body
  body = upsert_push_preferences_request

  # Make the API request
  @client.make_request(
    :post,
    path,
    body: body
  )
end

#update_users(update_users_request) ⇒ Models::UpdateUsersResponse

Update or create users in bulkSends events:- user.updated



1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
# File 'lib/getstream_ruby/generated/common_client.rb', line 1002

def update_users(update_users_request)
  path = '/api/v2/users'
  # Build request body
  body = update_users_request

  # Make the API request
  @client.make_request(
    :post,
    path,
    body: body
  )
end

#update_users_partial(update_users_partial_request) ⇒ Models::UpdateUsersResponse

Updates certain fields of the userSends events:- user.presence.changed- user.updated- user.presence.changed



985
986
987
988
989
990
991
992
993
994
995
996
# File 'lib/getstream_ruby/generated/common_client.rb', line 985

def update_users_partial(update_users_partial_request)
  path = '/api/v2/users'
  # Build request body
  body = update_users_partial_request

  # Make the API request
  @client.make_request(
    :patch,
    path,
    body: body
  )
end

#upload_file(file_upload_request) ⇒ Models::FileUploadResponse

Uploads file



915
916
917
918
919
920
921
922
923
924
925
926
# File 'lib/getstream_ruby/generated/common_client.rb', line 915

def upload_file(file_upload_request)
  path = '/api/v2/uploads/file'
  # Build request body
  body = file_upload_request

  # Make the API request
  @client.make_request(
    :post,
    path,
    body: body
  )
end

#upload_image(image_upload_request) ⇒ Models::ImageUploadResponse

Uploads image



950
951
952
953
954
955
956
957
958
959
960
961
# File 'lib/getstream_ruby/generated/common_client.rb', line 950

def upload_image(image_upload_request)
  path = '/api/v2/uploads/image'
  # Build request body
  body = image_upload_request

  # Make the API request
  @client.make_request(
    :post,
    path,
    body: body
  )
end

#upsert_push_provider(upsert_push_provider_request) ⇒ Models::UpsertPushProviderResponse

Upsert a push provider for v2 with multi bundle/package support



737
738
739
740
741
742
743
744
745
746
747
748
# File 'lib/getstream_ruby/generated/common_client.rb', line 737

def upsert_push_provider(upsert_push_provider_request)
  path = '/api/v2/push_providers'
  # Build request body
  body = upsert_push_provider_request

  # Make the API request
  @client.make_request(
    :post,
    path,
    body: body
  )
end

#upsert_push_template(upsert_push_template_request) ⇒ Models::UpsertPushTemplateResponse

Create or update a push notification template for a specific event type and push provider



792
793
794
795
796
797
798
799
800
801
802
803
# File 'lib/getstream_ruby/generated/common_client.rb', line 792

def upsert_push_template(upsert_push_template_request)
  path = '/api/v2/push_templates'
  # Build request body
  body = upsert_push_template_request

  # Make the API request
  @client.make_request(
    :post,
    path,
    body: body
  )
end