/
realm_bindings.dart
13387 lines (12195 loc) · 489 KB
/
realm_bindings.dart
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
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
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
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
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
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
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
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
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
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
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
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
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
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
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
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
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// ignore_for_file: always_specify_types
// ignore_for_file: camel_case_types
// ignore_for_file: non_constant_identifier_names
// AUTO GENERATED FILE, DO NOT EDIT.
//
// Generated by `package:ffigen`.
// ignore_for_file: type=lint
import 'dart:ffi' as ffi;
/// Realm native lib bindings.
class RealmLibrary {
/// Holds the symbol lookup function.
final ffi.Pointer<T> Function<T extends ffi.NativeType>(String symbolName)
_lookup;
/// The symbols are looked up in [dynamicLibrary].
RealmLibrary(ffi.DynamicLibrary dynamicLibrary)
: _lookup = dynamicLibrary.lookup;
/// The symbols are looked up with [lookup].
RealmLibrary.fromLookup(
ffi.Pointer<T> Function<T extends ffi.NativeType>(String symbolName)
lookup)
: _lookup = lookup;
/// Add a callback that will be invoked every time the view of this file is updated.
///
/// This callback is guaranteed to be invoked before any object or collection change
/// notifications for this realm are delivered.
///
/// @return a registration token used to remove the callback.
ffi.Pointer<realm_callback_token_t> realm_add_realm_changed_callback(
ffi.Pointer<realm_t> arg0,
realm_on_realm_change_func_t arg1,
ffi.Pointer<ffi.Void> userdata,
realm_free_userdata_func_t userdata_free,
) {
return _realm_add_realm_changed_callback(
arg0,
arg1,
userdata,
userdata_free,
);
}
late final _realm_add_realm_changed_callbackPtr = _lookup<
ffi.NativeFunction<
ffi.Pointer<realm_callback_token_t> Function(
ffi.Pointer<realm_t>,
realm_on_realm_change_func_t,
ffi.Pointer<ffi.Void>,
realm_free_userdata_func_t)>>('realm_add_realm_changed_callback');
late final _realm_add_realm_changed_callback =
_realm_add_realm_changed_callbackPtr.asFunction<
ffi.Pointer<realm_callback_token_t> Function(
ffi.Pointer<realm_t>,
realm_on_realm_change_func_t,
ffi.Pointer<ffi.Void>,
realm_free_userdata_func_t)>();
/// Add a callback that will be invoked the first time that the given realm is refreshed to the version which is the
/// latest version at the time when this is called.
/// @return a refresh token to remove the callback
ffi.Pointer<realm_refresh_callback_token_t> realm_add_realm_refresh_callback(
ffi.Pointer<realm_t> arg0,
realm_on_realm_refresh_func_t arg1,
ffi.Pointer<ffi.Void> userdata,
realm_free_userdata_func_t userdata_free,
) {
return _realm_add_realm_refresh_callback(
arg0,
arg1,
userdata,
userdata_free,
);
}
late final _realm_add_realm_refresh_callbackPtr = _lookup<
ffi.NativeFunction<
ffi.Pointer<realm_refresh_callback_token_t> Function(
ffi.Pointer<realm_t>,
realm_on_realm_refresh_func_t,
ffi.Pointer<ffi.Void>,
realm_free_userdata_func_t)>>('realm_add_realm_refresh_callback');
late final _realm_add_realm_refresh_callback =
_realm_add_realm_refresh_callbackPtr.asFunction<
ffi.Pointer<realm_refresh_callback_token_t> Function(
ffi.Pointer<realm_t>,
realm_on_realm_refresh_func_t,
ffi.Pointer<ffi.Void>,
realm_free_userdata_func_t)>();
/// Add a callback that will be invoked every time the schema of this realm is changed.
///
/// @return a registration token used to remove the callback.
ffi.Pointer<realm_callback_token_t> realm_add_schema_changed_callback(
ffi.Pointer<realm_t> arg0,
realm_on_schema_change_func_t arg1,
ffi.Pointer<ffi.Void> userdata,
realm_free_userdata_func_t userdata_free,
) {
return _realm_add_schema_changed_callback(
arg0,
arg1,
userdata,
userdata_free,
);
}
late final _realm_add_schema_changed_callbackPtr = _lookup<
ffi.NativeFunction<
ffi.Pointer<realm_callback_token_t> Function(
ffi.Pointer<realm_t>,
realm_on_schema_change_func_t,
ffi.Pointer<ffi.Void>,
realm_free_userdata_func_t)>>(
'realm_add_schema_changed_callback');
late final _realm_add_schema_changed_callback =
_realm_add_schema_changed_callbackPtr.asFunction<
ffi.Pointer<realm_callback_token_t> Function(
ffi.Pointer<realm_t>,
realm_on_schema_change_func_t,
ffi.Pointer<ffi.Void>,
realm_free_userdata_func_t)>();
/// Run a named MongoDB Realm function.
///
/// @param serialized_ejson_args The arguments array to invoke the function with,
/// serialized as an Extended JSON string.
/// @param service_name The name of the remote service whose system function to call. Can be null,
/// in which case the called function is expected to be a user function.
/// @return true, if no error occurred.
bool realm_app_call_function(
ffi.Pointer<realm_app_t> arg0,
ffi.Pointer<realm_user_t> arg1,
ffi.Pointer<ffi.Char> function_name,
ffi.Pointer<ffi.Char> serialized_ejson_args,
ffi.Pointer<ffi.Char> service_name,
realm_return_string_func_t callback,
ffi.Pointer<ffi.Void> userdata,
realm_free_userdata_func_t userdata_free,
) {
return _realm_app_call_function(
arg0,
arg1,
function_name,
serialized_ejson_args,
service_name,
callback,
userdata,
userdata_free,
);
}
late final _realm_app_call_functionPtr = _lookup<
ffi.NativeFunction<
ffi.Bool Function(
ffi.Pointer<realm_app_t>,
ffi.Pointer<realm_user_t>,
ffi.Pointer<ffi.Char>,
ffi.Pointer<ffi.Char>,
ffi.Pointer<ffi.Char>,
realm_return_string_func_t,
ffi.Pointer<ffi.Void>,
realm_free_userdata_func_t)>>('realm_app_call_function');
late final _realm_app_call_function = _realm_app_call_functionPtr.asFunction<
bool Function(
ffi.Pointer<realm_app_t>,
ffi.Pointer<realm_user_t>,
ffi.Pointer<ffi.Char>,
ffi.Pointer<ffi.Char>,
ffi.Pointer<ffi.Char>,
realm_return_string_func_t,
ffi.Pointer<ffi.Void>,
realm_free_userdata_func_t)>();
/// Create a new app configuration.
///
/// @param app_id The MongoDB Realm app id.
/// @param http_transport The HTTP transport used to make network calls.
ffi.Pointer<realm_app_config_t> realm_app_config_new(
ffi.Pointer<ffi.Char> app_id,
ffi.Pointer<realm_http_transport_t> http_transport,
) {
return _realm_app_config_new(
app_id,
http_transport,
);
}
late final _realm_app_config_newPtr = _lookup<
ffi.NativeFunction<
ffi.Pointer<realm_app_config_t> Function(ffi.Pointer<ffi.Char>,
ffi.Pointer<realm_http_transport_t>)>>('realm_app_config_new');
late final _realm_app_config_new = _realm_app_config_newPtr.asFunction<
ffi.Pointer<realm_app_config_t> Function(
ffi.Pointer<ffi.Char>, ffi.Pointer<realm_http_transport_t>)>();
void realm_app_config_set_base_url(
ffi.Pointer<realm_app_config_t> arg0,
ffi.Pointer<ffi.Char> arg1,
) {
return _realm_app_config_set_base_url(
arg0,
arg1,
);
}
late final _realm_app_config_set_base_urlPtr = _lookup<
ffi.NativeFunction<
ffi.Void Function(ffi.Pointer<realm_app_config_t>,
ffi.Pointer<ffi.Char>)>>('realm_app_config_set_base_url');
late final _realm_app_config_set_base_url =
_realm_app_config_set_base_urlPtr.asFunction<
void Function(
ffi.Pointer<realm_app_config_t>, ffi.Pointer<ffi.Char>)>();
void realm_app_config_set_bundle_id(
ffi.Pointer<realm_app_config_t> config,
ffi.Pointer<ffi.Char> bundle_id,
) {
return _realm_app_config_set_bundle_id(
config,
bundle_id,
);
}
late final _realm_app_config_set_bundle_idPtr = _lookup<
ffi.NativeFunction<
ffi.Void Function(ffi.Pointer<realm_app_config_t>,
ffi.Pointer<ffi.Char>)>>('realm_app_config_set_bundle_id');
late final _realm_app_config_set_bundle_id =
_realm_app_config_set_bundle_idPtr.asFunction<
void Function(
ffi.Pointer<realm_app_config_t>, ffi.Pointer<ffi.Char>)>();
void realm_app_config_set_default_request_timeout(
ffi.Pointer<realm_app_config_t> arg0,
int ms,
) {
return _realm_app_config_set_default_request_timeout(
arg0,
ms,
);
}
late final _realm_app_config_set_default_request_timeoutPtr = _lookup<
ffi.NativeFunction<
ffi.Void Function(ffi.Pointer<realm_app_config_t>,
ffi.Uint64)>>('realm_app_config_set_default_request_timeout');
late final _realm_app_config_set_default_request_timeout =
_realm_app_config_set_default_request_timeoutPtr
.asFunction<void Function(ffi.Pointer<realm_app_config_t>, int)>();
void realm_app_config_set_device_name(
ffi.Pointer<realm_app_config_t> config,
ffi.Pointer<ffi.Char> device_name,
) {
return _realm_app_config_set_device_name(
config,
device_name,
);
}
late final _realm_app_config_set_device_namePtr = _lookup<
ffi.NativeFunction<
ffi.Void Function(ffi.Pointer<realm_app_config_t>,
ffi.Pointer<ffi.Char>)>>('realm_app_config_set_device_name');
late final _realm_app_config_set_device_name =
_realm_app_config_set_device_namePtr.asFunction<
void Function(
ffi.Pointer<realm_app_config_t>, ffi.Pointer<ffi.Char>)>();
void realm_app_config_set_device_version(
ffi.Pointer<realm_app_config_t> config,
ffi.Pointer<ffi.Char> device_version,
) {
return _realm_app_config_set_device_version(
config,
device_version,
);
}
late final _realm_app_config_set_device_versionPtr = _lookup<
ffi.NativeFunction<
ffi.Void Function(ffi.Pointer<realm_app_config_t>,
ffi.Pointer<ffi.Char>)>>('realm_app_config_set_device_version');
late final _realm_app_config_set_device_version =
_realm_app_config_set_device_versionPtr.asFunction<
void Function(
ffi.Pointer<realm_app_config_t>, ffi.Pointer<ffi.Char>)>();
void realm_app_config_set_framework_name(
ffi.Pointer<realm_app_config_t> config,
ffi.Pointer<ffi.Char> framework_name,
) {
return _realm_app_config_set_framework_name(
config,
framework_name,
);
}
late final _realm_app_config_set_framework_namePtr = _lookup<
ffi.NativeFunction<
ffi.Void Function(ffi.Pointer<realm_app_config_t>,
ffi.Pointer<ffi.Char>)>>('realm_app_config_set_framework_name');
late final _realm_app_config_set_framework_name =
_realm_app_config_set_framework_namePtr.asFunction<
void Function(
ffi.Pointer<realm_app_config_t>, ffi.Pointer<ffi.Char>)>();
void realm_app_config_set_framework_version(
ffi.Pointer<realm_app_config_t> config,
ffi.Pointer<ffi.Char> framework_version,
) {
return _realm_app_config_set_framework_version(
config,
framework_version,
);
}
late final _realm_app_config_set_framework_versionPtr = _lookup<
ffi.NativeFunction<
ffi.Void Function(
ffi.Pointer<realm_app_config_t>, ffi.Pointer<ffi.Char>)>>(
'realm_app_config_set_framework_version');
late final _realm_app_config_set_framework_version =
_realm_app_config_set_framework_versionPtr.asFunction<
void Function(
ffi.Pointer<realm_app_config_t>, ffi.Pointer<ffi.Char>)>();
void realm_app_config_set_platform_version(
ffi.Pointer<realm_app_config_t> arg0,
ffi.Pointer<ffi.Char> arg1,
) {
return _realm_app_config_set_platform_version(
arg0,
arg1,
);
}
late final _realm_app_config_set_platform_versionPtr = _lookup<
ffi.NativeFunction<
ffi.Void Function(ffi.Pointer<realm_app_config_t>,
ffi.Pointer<ffi.Char>)>>('realm_app_config_set_platform_version');
late final _realm_app_config_set_platform_version =
_realm_app_config_set_platform_versionPtr.asFunction<
void Function(
ffi.Pointer<realm_app_config_t>, ffi.Pointer<ffi.Char>)>();
void realm_app_config_set_sdk(
ffi.Pointer<realm_app_config_t> config,
ffi.Pointer<ffi.Char> sdk,
) {
return _realm_app_config_set_sdk(
config,
sdk,
);
}
late final _realm_app_config_set_sdkPtr = _lookup<
ffi.NativeFunction<
ffi.Void Function(ffi.Pointer<realm_app_config_t>,
ffi.Pointer<ffi.Char>)>>('realm_app_config_set_sdk');
late final _realm_app_config_set_sdk =
_realm_app_config_set_sdkPtr.asFunction<
void Function(
ffi.Pointer<realm_app_config_t>, ffi.Pointer<ffi.Char>)>();
void realm_app_config_set_sdk_version(
ffi.Pointer<realm_app_config_t> arg0,
ffi.Pointer<ffi.Char> arg1,
) {
return _realm_app_config_set_sdk_version(
arg0,
arg1,
);
}
late final _realm_app_config_set_sdk_versionPtr = _lookup<
ffi.NativeFunction<
ffi.Void Function(ffi.Pointer<realm_app_config_t>,
ffi.Pointer<ffi.Char>)>>('realm_app_config_set_sdk_version');
late final _realm_app_config_set_sdk_version =
_realm_app_config_set_sdk_versionPtr.asFunction<
void Function(
ffi.Pointer<realm_app_config_t>, ffi.Pointer<ffi.Char>)>();
/// Create realm_app_t* instance given a valid realm configuration and sync client configuration.
///
/// @return A non-null pointer if no error occurred.
ffi.Pointer<realm_app_t> realm_app_create(
ffi.Pointer<realm_app_config_t> arg0,
ffi.Pointer<realm_sync_client_config_t> arg1,
) {
return _realm_app_create(
arg0,
arg1,
);
}
late final _realm_app_createPtr = _lookup<
ffi.NativeFunction<
ffi.Pointer<realm_app_t> Function(ffi.Pointer<realm_app_config_t>,
ffi.Pointer<realm_sync_client_config_t>)>>('realm_app_create');
late final _realm_app_create = _realm_app_createPtr.asFunction<
ffi.Pointer<realm_app_t> Function(ffi.Pointer<realm_app_config_t>,
ffi.Pointer<realm_sync_client_config_t>)>();
/// Create cached realm_app_t* instance given a valid realm configuration and sync client configuration.
///
/// @return A non-null pointer if no error occurred.
ffi.Pointer<realm_app_t> realm_app_create_cached(
ffi.Pointer<realm_app_config_t> arg0,
ffi.Pointer<realm_sync_client_config_t> arg1,
) {
return _realm_app_create_cached(
arg0,
arg1,
);
}
late final _realm_app_create_cachedPtr = _lookup<
ffi.NativeFunction<
ffi.Pointer<realm_app_t> Function(ffi.Pointer<realm_app_config_t>,
ffi.Pointer<realm_sync_client_config_t>)>>(
'realm_app_create_cached');
late final _realm_app_create_cached = _realm_app_create_cachedPtr.asFunction<
ffi.Pointer<realm_app_t> Function(ffi.Pointer<realm_app_config_t>,
ffi.Pointer<realm_sync_client_config_t>)>();
ffi.Pointer<realm_app_credentials_t> realm_app_credentials_new_anonymous(
bool reuse_credentials,
) {
return _realm_app_credentials_new_anonymous(
reuse_credentials,
);
}
late final _realm_app_credentials_new_anonymousPtr = _lookup<
ffi.NativeFunction<
ffi.Pointer<realm_app_credentials_t> Function(
ffi.Bool)>>('realm_app_credentials_new_anonymous');
late final _realm_app_credentials_new_anonymous =
_realm_app_credentials_new_anonymousPtr
.asFunction<ffi.Pointer<realm_app_credentials_t> Function(bool)>();
ffi.Pointer<realm_app_credentials_t> realm_app_credentials_new_api_key(
ffi.Pointer<ffi.Char> api_key,
) {
return _realm_app_credentials_new_api_key(
api_key,
);
}
late final _realm_app_credentials_new_api_keyPtr = _lookup<
ffi.NativeFunction<
ffi.Pointer<realm_app_credentials_t> Function(
ffi.Pointer<ffi.Char>)>>('realm_app_credentials_new_api_key');
late final _realm_app_credentials_new_api_key =
_realm_app_credentials_new_api_keyPtr.asFunction<
ffi.Pointer<realm_app_credentials_t> Function(
ffi.Pointer<ffi.Char>)>();
ffi.Pointer<realm_app_credentials_t> realm_app_credentials_new_apple(
ffi.Pointer<ffi.Char> id_token,
) {
return _realm_app_credentials_new_apple(
id_token,
);
}
late final _realm_app_credentials_new_applePtr = _lookup<
ffi.NativeFunction<
ffi.Pointer<realm_app_credentials_t> Function(
ffi.Pointer<ffi.Char>)>>('realm_app_credentials_new_apple');
late final _realm_app_credentials_new_apple =
_realm_app_credentials_new_applePtr.asFunction<
ffi.Pointer<realm_app_credentials_t> Function(
ffi.Pointer<ffi.Char>)>();
ffi.Pointer<realm_app_credentials_t> realm_app_credentials_new_email_password(
ffi.Pointer<ffi.Char> email,
realm_string_t password,
) {
return _realm_app_credentials_new_email_password(
email,
password,
);
}
late final _realm_app_credentials_new_email_passwordPtr = _lookup<
ffi.NativeFunction<
ffi.Pointer<realm_app_credentials_t> Function(ffi.Pointer<ffi.Char>,
realm_string_t)>>('realm_app_credentials_new_email_password');
late final _realm_app_credentials_new_email_password =
_realm_app_credentials_new_email_passwordPtr.asFunction<
ffi.Pointer<realm_app_credentials_t> Function(
ffi.Pointer<ffi.Char>, realm_string_t)>();
ffi.Pointer<realm_app_credentials_t> realm_app_credentials_new_facebook(
ffi.Pointer<ffi.Char> access_token,
) {
return _realm_app_credentials_new_facebook(
access_token,
);
}
late final _realm_app_credentials_new_facebookPtr = _lookup<
ffi.NativeFunction<
ffi.Pointer<realm_app_credentials_t> Function(
ffi.Pointer<ffi.Char>)>>('realm_app_credentials_new_facebook');
late final _realm_app_credentials_new_facebook =
_realm_app_credentials_new_facebookPtr.asFunction<
ffi.Pointer<realm_app_credentials_t> Function(
ffi.Pointer<ffi.Char>)>();
/// Create Custom Function authentication app credentials.
///
/// @param serialized_ejson_payload The arguments array to invoke the function with,
/// serialized as an Extended JSON string.
/// @return null, if an error occurred.
ffi.Pointer<realm_app_credentials_t> realm_app_credentials_new_function(
ffi.Pointer<ffi.Char> serialized_ejson_payload,
) {
return _realm_app_credentials_new_function(
serialized_ejson_payload,
);
}
late final _realm_app_credentials_new_functionPtr = _lookup<
ffi.NativeFunction<
ffi.Pointer<realm_app_credentials_t> Function(
ffi.Pointer<ffi.Char>)>>('realm_app_credentials_new_function');
late final _realm_app_credentials_new_function =
_realm_app_credentials_new_functionPtr.asFunction<
ffi.Pointer<realm_app_credentials_t> Function(
ffi.Pointer<ffi.Char>)>();
ffi.Pointer<realm_app_credentials_t>
realm_app_credentials_new_google_auth_code(
ffi.Pointer<ffi.Char> auth_code,
) {
return _realm_app_credentials_new_google_auth_code(
auth_code,
);
}
late final _realm_app_credentials_new_google_auth_codePtr = _lookup<
ffi.NativeFunction<
ffi.Pointer<realm_app_credentials_t> Function(
ffi.Pointer<ffi.Char>)>>(
'realm_app_credentials_new_google_auth_code');
late final _realm_app_credentials_new_google_auth_code =
_realm_app_credentials_new_google_auth_codePtr.asFunction<
ffi.Pointer<realm_app_credentials_t> Function(
ffi.Pointer<ffi.Char>)>();
ffi.Pointer<realm_app_credentials_t>
realm_app_credentials_new_google_id_token(
ffi.Pointer<ffi.Char> id_token,
) {
return _realm_app_credentials_new_google_id_token(
id_token,
);
}
late final _realm_app_credentials_new_google_id_tokenPtr = _lookup<
ffi.NativeFunction<
ffi.Pointer<realm_app_credentials_t> Function(
ffi.Pointer<ffi.Char>)>>(
'realm_app_credentials_new_google_id_token');
late final _realm_app_credentials_new_google_id_token =
_realm_app_credentials_new_google_id_tokenPtr.asFunction<
ffi.Pointer<realm_app_credentials_t> Function(
ffi.Pointer<ffi.Char>)>();
ffi.Pointer<realm_app_credentials_t> realm_app_credentials_new_jwt(
ffi.Pointer<ffi.Char> jwt_token,
) {
return _realm_app_credentials_new_jwt(
jwt_token,
);
}
late final _realm_app_credentials_new_jwtPtr = _lookup<
ffi.NativeFunction<
ffi.Pointer<realm_app_credentials_t> Function(
ffi.Pointer<ffi.Char>)>>('realm_app_credentials_new_jwt');
late final _realm_app_credentials_new_jwt =
_realm_app_credentials_new_jwtPtr.asFunction<
ffi.Pointer<realm_app_credentials_t> Function(
ffi.Pointer<ffi.Char>)>();
/// Get an existing @a realm_app_credentials_t and return it's json representation
/// Note: the caller must delete the pointer to the string via realm_release
///
/// @return: a non-null ptr to the string representing the json configuration.
ffi.Pointer<ffi.Char> realm_app_credentials_serialize_as_json(
ffi.Pointer<realm_app_credentials_t> arg0,
) {
return _realm_app_credentials_serialize_as_json(
arg0,
);
}
late final _realm_app_credentials_serialize_as_jsonPtr = _lookup<
ffi.NativeFunction<
ffi.Pointer<ffi.Char> Function(
ffi.Pointer<realm_app_credentials_t>)>>(
'realm_app_credentials_serialize_as_json');
late final _realm_app_credentials_serialize_as_json =
_realm_app_credentials_serialize_as_jsonPtr.asFunction<
ffi.Pointer<ffi.Char> Function(
ffi.Pointer<realm_app_credentials_t>)>();
/// Deletes a user and all its data from the server.
/// @param app ptr to realm_app
/// @param user ptr to the user to delete
/// @param callback invoked once operation has completed
/// @return True if no error has been recorded, False otherwise
bool realm_app_delete_user(
ffi.Pointer<realm_app_t> app,
ffi.Pointer<realm_user_t> user,
realm_app_void_completion_func_t callback,
ffi.Pointer<ffi.Void> userdata,
realm_free_userdata_func_t userdata_free,
) {
return _realm_app_delete_user(
app,
user,
callback,
userdata,
userdata_free,
);
}
late final _realm_app_delete_userPtr = _lookup<
ffi.NativeFunction<
ffi.Bool Function(
ffi.Pointer<realm_app_t>,
ffi.Pointer<realm_user_t>,
realm_app_void_completion_func_t,
ffi.Pointer<ffi.Void>,
realm_free_userdata_func_t)>>('realm_app_delete_user');
late final _realm_app_delete_user = _realm_app_delete_userPtr.asFunction<
bool Function(
ffi.Pointer<realm_app_t>,
ffi.Pointer<realm_user_t>,
realm_app_void_completion_func_t,
ffi.Pointer<ffi.Void>,
realm_free_userdata_func_t)>();
/// Run the Email/Password Authentication provider's password reset function.
///
/// @param serialized_ejson_payload The arguments array to invoke the function with,
/// serialized as an Extended JSON string.
/// @return true, if no error occurred.
bool realm_app_email_password_provider_client_call_reset_password_function(
ffi.Pointer<realm_app_t> arg0,
ffi.Pointer<ffi.Char> email,
realm_string_t password,
ffi.Pointer<ffi.Char> serialized_ejson_payload,
realm_app_void_completion_func_t callback,
ffi.Pointer<ffi.Void> userdata,
realm_free_userdata_func_t userdata_free,
) {
return _realm_app_email_password_provider_client_call_reset_password_function(
arg0,
email,
password,
serialized_ejson_payload,
callback,
userdata,
userdata_free,
);
}
late final _realm_app_email_password_provider_client_call_reset_password_functionPtr =
_lookup<
ffi.NativeFunction<
ffi.Bool Function(
ffi.Pointer<realm_app_t>,
ffi.Pointer<ffi.Char>,
realm_string_t,
ffi.Pointer<ffi.Char>,
realm_app_void_completion_func_t,
ffi.Pointer<ffi.Void>,
realm_free_userdata_func_t)>>(
'realm_app_email_password_provider_client_call_reset_password_function');
late final _realm_app_email_password_provider_client_call_reset_password_function =
_realm_app_email_password_provider_client_call_reset_password_functionPtr
.asFunction<
bool Function(
ffi.Pointer<realm_app_t>,
ffi.Pointer<ffi.Char>,
realm_string_t,
ffi.Pointer<ffi.Char>,
realm_app_void_completion_func_t,
ffi.Pointer<ffi.Void>,
realm_free_userdata_func_t)>();
/// Confirms an email identity with the username/password provider.
/// @param app ptr to realm_app
/// @param token string emailed
/// @param token_id string emailed
/// @param callback invoked once operation has completed
/// @return True if no error has been recorded, False otherwise
bool realm_app_email_password_provider_client_confirm_user(
ffi.Pointer<realm_app_t> app,
ffi.Pointer<ffi.Char> token,
ffi.Pointer<ffi.Char> token_id,
realm_app_void_completion_func_t callback,
ffi.Pointer<ffi.Void> userdata,
realm_free_userdata_func_t userdata_free,
) {
return _realm_app_email_password_provider_client_confirm_user(
app,
token,
token_id,
callback,
userdata,
userdata_free,
);
}
late final _realm_app_email_password_provider_client_confirm_userPtr =
_lookup<
ffi.NativeFunction<
ffi.Bool Function(
ffi.Pointer<realm_app_t>,
ffi.Pointer<ffi.Char>,
ffi.Pointer<ffi.Char>,
realm_app_void_completion_func_t,
ffi.Pointer<ffi.Void>,
realm_free_userdata_func_t)>>(
'realm_app_email_password_provider_client_confirm_user');
late final _realm_app_email_password_provider_client_confirm_user =
_realm_app_email_password_provider_client_confirm_userPtr.asFunction<
bool Function(
ffi.Pointer<realm_app_t>,
ffi.Pointer<ffi.Char>,
ffi.Pointer<ffi.Char>,
realm_app_void_completion_func_t,
ffi.Pointer<ffi.Void>,
realm_free_userdata_func_t)>();
/// Registers a new email identity with the username/password provider and send confirmation email.
/// @param app ptr to realm_app
/// @param email identity email
/// @param password associated to the identity
/// @param callback invoked once operation has completed
/// @return True if no error has been recorded, False otherwise
bool realm_app_email_password_provider_client_register_email(
ffi.Pointer<realm_app_t> app,
ffi.Pointer<ffi.Char> email,
realm_string_t password,
realm_app_void_completion_func_t callback,
ffi.Pointer<ffi.Void> userdata,
realm_free_userdata_func_t userdata_free,
) {
return _realm_app_email_password_provider_client_register_email(
app,
email,
password,
callback,
userdata,
userdata_free,
);
}
late final _realm_app_email_password_provider_client_register_emailPtr =
_lookup<
ffi.NativeFunction<
ffi.Bool Function(
ffi.Pointer<realm_app_t>,
ffi.Pointer<ffi.Char>,
realm_string_t,
realm_app_void_completion_func_t,
ffi.Pointer<ffi.Void>,
realm_free_userdata_func_t)>>(
'realm_app_email_password_provider_client_register_email');
late final _realm_app_email_password_provider_client_register_email =
_realm_app_email_password_provider_client_register_emailPtr.asFunction<
bool Function(
ffi.Pointer<realm_app_t>,
ffi.Pointer<ffi.Char>,
realm_string_t,
realm_app_void_completion_func_t,
ffi.Pointer<ffi.Void>,
realm_free_userdata_func_t)>();
/// Re-sends a confirmation email to a user that has registered but not yet confirmed their email address.
/// @param app ptr to realm_app
/// @param email to use
/// @param callback invoked once operation has completed
/// @return True if no error has been recorded, False otherwise
bool realm_app_email_password_provider_client_resend_confirmation_email(
ffi.Pointer<realm_app_t> app,
ffi.Pointer<ffi.Char> email,
realm_app_void_completion_func_t callback,
ffi.Pointer<ffi.Void> userdata,
realm_free_userdata_func_t userdata_free,
) {
return _realm_app_email_password_provider_client_resend_confirmation_email(
app,
email,
callback,
userdata,
userdata_free,
);
}
late final _realm_app_email_password_provider_client_resend_confirmation_emailPtr =
_lookup<
ffi.NativeFunction<
ffi.Bool Function(
ffi.Pointer<realm_app_t>,
ffi.Pointer<ffi.Char>,
realm_app_void_completion_func_t,
ffi.Pointer<ffi.Void>,
realm_free_userdata_func_t)>>(
'realm_app_email_password_provider_client_resend_confirmation_email');
late final _realm_app_email_password_provider_client_resend_confirmation_email =
_realm_app_email_password_provider_client_resend_confirmation_emailPtr
.asFunction<
bool Function(
ffi.Pointer<realm_app_t>,
ffi.Pointer<ffi.Char>,
realm_app_void_completion_func_t,
ffi.Pointer<ffi.Void>,
realm_free_userdata_func_t)>();
/// Resets the password of an email identity using the password reset token emailed to a user.
/// @param app ptr to realm_app
/// @param password new password to set
/// @param token ptr to token string emailed to the user
/// @param token_id ptr to token_id emailed to the user
/// @return True if no error has been recorded, False otherwise
bool realm_app_email_password_provider_client_reset_password(
ffi.Pointer<realm_app_t> app,
realm_string_t password,
ffi.Pointer<ffi.Char> token,
ffi.Pointer<ffi.Char> token_id,
realm_app_void_completion_func_t callback,
ffi.Pointer<ffi.Void> userdata,
realm_free_userdata_func_t userdata_free,
) {
return _realm_app_email_password_provider_client_reset_password(
app,
password,
token,
token_id,
callback,
userdata,
userdata_free,
);
}
late final _realm_app_email_password_provider_client_reset_passwordPtr =
_lookup<
ffi.NativeFunction<
ffi.Bool Function(
ffi.Pointer<realm_app_t>,
realm_string_t,
ffi.Pointer<ffi.Char>,
ffi.Pointer<ffi.Char>,
realm_app_void_completion_func_t,
ffi.Pointer<ffi.Void>,
realm_free_userdata_func_t)>>(
'realm_app_email_password_provider_client_reset_password');
late final _realm_app_email_password_provider_client_reset_password =
_realm_app_email_password_provider_client_reset_passwordPtr.asFunction<
bool Function(
ffi.Pointer<realm_app_t>,
realm_string_t,
ffi.Pointer<ffi.Char>,
ffi.Pointer<ffi.Char>,
realm_app_void_completion_func_t,
ffi.Pointer<ffi.Void>,
realm_free_userdata_func_t)>();
/// Retries the custom confirmation function on a user for a given email.
/// @param app ptr to realm_app
/// @param email email for the user
/// @param callback invoked once operation has completed
/// @return True if no error has been recorded, False otherwise
bool realm_app_email_password_provider_client_retry_custom_confirmation(
ffi.Pointer<realm_app_t> app,
ffi.Pointer<ffi.Char> email,
realm_app_void_completion_func_t callback,
ffi.Pointer<ffi.Void> userdata,
realm_free_userdata_func_t userdata_free,
) {
return _realm_app_email_password_provider_client_retry_custom_confirmation(
app,
email,
callback,
userdata,
userdata_free,
);
}
late final _realm_app_email_password_provider_client_retry_custom_confirmationPtr =
_lookup<
ffi.NativeFunction<
ffi.Bool Function(
ffi.Pointer<realm_app_t>,
ffi.Pointer<ffi.Char>,
realm_app_void_completion_func_t,
ffi.Pointer<ffi.Void>,
realm_free_userdata_func_t)>>(
'realm_app_email_password_provider_client_retry_custom_confirmation');
late final _realm_app_email_password_provider_client_retry_custom_confirmation =
_realm_app_email_password_provider_client_retry_custom_confirmationPtr
.asFunction<
bool Function(
ffi.Pointer<realm_app_t>,
ffi.Pointer<ffi.Char>,
realm_app_void_completion_func_t,
ffi.Pointer<ffi.Void>,
realm_free_userdata_func_t)>();
/// Send reset password to the email specified in the parameter passed to the function.
/// @param app ptr to realm_app
/// @param email where to send the reset instructions
/// @param callback invoked once operation has completed
/// @return True if no error has been recorded, False otherwise
bool realm_app_email_password_provider_client_send_reset_password_email(
ffi.Pointer<realm_app_t> app,
ffi.Pointer<ffi.Char> email,
realm_app_void_completion_func_t callback,
ffi.Pointer<ffi.Void> userdata,
realm_free_userdata_func_t userdata_free,
) {
return _realm_app_email_password_provider_client_send_reset_password_email(
app,
email,
callback,
userdata,
userdata_free,
);
}
late final _realm_app_email_password_provider_client_send_reset_password_emailPtr =
_lookup<
ffi.NativeFunction<
ffi.Bool Function(
ffi.Pointer<realm_app_t>,
ffi.Pointer<ffi.Char>,
realm_app_void_completion_func_t,
ffi.Pointer<ffi.Void>,
realm_free_userdata_func_t)>>(
'realm_app_email_password_provider_client_send_reset_password_email');
late final _realm_app_email_password_provider_client_send_reset_password_email =
_realm_app_email_password_provider_client_send_reset_password_emailPtr
.asFunction<
bool Function(
ffi.Pointer<realm_app_t>,
ffi.Pointer<ffi.Char>,
realm_app_void_completion_func_t,
ffi.Pointer<ffi.Void>,
realm_free_userdata_func_t)>();
/// Get the list of active users in this @a app.
/// In case of errors this function will return false (errors to be fetched via `realm_get_last_error()`).
/// If data is not copied the function will return true and set `out_n` with the capacity needed.
/// Data is only copied if the input array has enough capacity, otherwise the needed array capacity will be set.
///
/// @param out_users A pointer to an array of `realm_user_t*`, which
/// will be populated with the list of active users in the app.
/// Array may be NULL, in this case no data will be copied and `out_n` set if not NULL.
/// @param capacity The maximum number of elements `out_users` can hold.
/// @param out_n The actual number of entries written to `out_users`.
/// May be NULL.
/// @return True if no exception occurred.
bool realm_app_get_all_users(
ffi.Pointer<realm_app_t> app,
ffi.Pointer<ffi.Pointer<realm_user_t>> out_users,
int capacity,
ffi.Pointer<ffi.Size> out_n,
) {
return _realm_app_get_all_users(
app,
out_users,
capacity,
out_n,
);
}
late final _realm_app_get_all_usersPtr = _lookup<
ffi.NativeFunction<
ffi.Bool Function(
ffi.Pointer<realm_app_t>,
ffi.Pointer<ffi.Pointer<realm_user_t>>,
ffi.Size,
ffi.Pointer<ffi.Size>)>>('realm_app_get_all_users');
late final _realm_app_get_all_users = _realm_app_get_all_usersPtr.asFunction<
bool Function(