1 module libwasm.bindings.RTCConfiguration;
2 
3 import libwasm.types;
4 
5 import memutils.ct: tuple;
6 import libwasm.bindings.RTCCertificate;
7 
8 @safe:
9 nothrow:
10 
11 enum RTCBundlePolicy {
12   balanced,
13   max_compat,
14   max_bundle
15 }
16 struct RTCConfiguration {
17   nothrow:
18   JsHandle handle;
19   alias handle this;
20   this(Handle h) {
21     this.handle = JsHandle(h);
22   }
23   static auto create() {
24     return RTCConfiguration(libwasm_add__object());
25   }
26   void iceServers()(scope ref Sequence!(RTCIceServer) iceServers) {
27     Object_Call_Handle__void(this.handle, "iceServers", iceServers.handle);
28   }
29   auto iceServers()() {
30     return Sequence!(RTCIceServer)(Object_Getter__Handle(this.handle, "iceServers"));
31   }
32   void iceTransportPolicy()(RTCIceTransportPolicy iceTransportPolicy) {
33     Object_Call_int__void(this.handle, "iceTransportPolicy", iceTransportPolicy);
34   }
35   RTCIceTransportPolicy iceTransportPolicy()() {
36     return Object_Getter__int(this.handle, "iceTransportPolicy");
37   }
38   void bundlePolicy()(RTCBundlePolicy bundlePolicy) {
39     Object_Call_int__void(this.handle, "bundlePolicy", bundlePolicy);
40   }
41   RTCBundlePolicy bundlePolicy()() {
42     return Object_Getter__int(this.handle, "bundlePolicy");
43   }
44   void peerIdentity(T0)(scope auto ref Optional!(T0) peerIdentity) if (isTOrPointer!(T0, string)) {
45     Serialize_Object_VarArgCall!void(this.handle, "peerIdentity", "Optional!(string)", tuple(!peerIdentity.empty, peerIdentity.front));
46   }
47   Optional!(string) peerIdentity()() {
48     return Object_Getter__OptionalString(this.handle, "peerIdentity");
49   }
50   void certificates()(scope ref Sequence!(RTCCertificate) certificates) {
51     Object_Call_Handle__void(this.handle, "certificates", certificates.handle);
52   }
53   auto certificates()() {
54     return Sequence!(RTCCertificate)(Object_Getter__Handle(this.handle, "certificates"));
55   }
56 }
57 enum RTCIceCredentialType {
58   password,
59   token
60 }
61 struct RTCIceServer {
62   nothrow:
63   JsHandle handle;
64   alias handle this;
65   this(Handle h) {
66     this.handle = JsHandle(h);
67   }
68   static auto create() {
69     return RTCIceServer(libwasm_add__object());
70   }
71   void urls()(scope ref SumType!(string, Sequence!(string)) urls) {
72     Serialize_Object_VarArgCall!void(this.handle, "urls", "SumType!(string,Handle)", tuple(libwasm.sumtype.match!(((string v) => 0),((ref urls.Types[1] v) => 1))(urls),tuple(libwasm.sumtype.match!(((string v) => v),((ref urls.Types[1] v) => string.init))(urls),libwasm.sumtype.match!(((string v) => Handle.init),((ref urls.Types[1] v) => cast(Handle)v.handle))(urls))));
73   }
74   auto urls()() {
75     return Object_Getter__Handle(this.handle, "urls");
76   }
77   void url()(string url) {
78     Object_Call_string__void(this.handle, "url", url);
79   }
80   string url()() {
81     return Object_Getter__string(this.handle, "url");
82   }
83   void username()(string username) {
84     Object_Call_string__void(this.handle, "username", username);
85   }
86   string username()() {
87     return Object_Getter__string(this.handle, "username");
88   }
89   void credential()(string credential) {
90     Object_Call_string__void(this.handle, "credential", credential);
91   }
92   string credential()() {
93     return Object_Getter__string(this.handle, "credential");
94   }
95   void credentialType()(RTCIceCredentialType credentialType) {
96     Object_Call_int__void(this.handle, "credentialType", credentialType);
97   }
98   RTCIceCredentialType credentialType()() {
99     return Object_Getter__int(this.handle, "credentialType");
100   }
101 }
102 enum RTCIceTransportPolicy {
103   relay,
104   all
105 }
106 
107