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
use derive_new::new;
use derive_setters::Setters;
use serde::Serialize;
#[derive(Clone, Debug, Serialize, new, Setters)]
#[setters(prefix = "with_")]
#[setters(into, strip_option)]
pub struct ReferRequest {
/// The endpoint resource or technology specific URI to send the message to. Valid resources are pjsip, and xmpp.
#[setters(skip)]
#[new(into)]
pub(crate) to: String,
/// The endpoint resource or technology specific identity to send this message from. Valid resources are pjsip, and xmpp.
#[setters(skip)]
#[new(into)]
pub(crate) from: String,
/// The endpoint resource or technology specific URI to refer to.
#[setters(skip)]
#[new(into)]
pub(crate) refer_to: String,
/// If true and "refer_to" refers to an Asterisk endpoint, the "refer_to" value is set to point to this Asterisk endpoint - so the referee is referred to Asterisk. Otherwise, use the contact URI associated with the endpoint.
#[serde(rename = "to_self", skip_serializing_if = "Option::is_none")]
#[new(default)]
pub(crate) to_self: Option<bool>,
/// The "variables" key in the body object holds technology specific key/value pairs to append to the message.
///
/// These can be interpreted and used by the various resource types;
/// for example, the pjsip resource type will add the key/value pairs as SIP headers.
/// The "display_name" key is used by the PJSIP technology.
/// Its value will be prepended as a display name to the Refer-To URI.
#[serde(skip_serializing)]
#[new(default)]
pub(crate) variables: Option<serde_json::Value>,
}
#[derive(Clone, Debug, Serialize, new, Setters)]
#[setters(prefix = "with_")]
#[setters(into, strip_option)]
pub struct SendMessageRequest {
/// The endpoint resource or technology specific URI to send the message to. Valid resources are pjsip, and xmpp.
#[setters(skip)]
#[new(into)]
pub(crate) to: String,
/// The endpoint resource or technology specific identity to send this message from. Valid resources are pjsip, and xmpp.
#[setters(skip)]
#[new(into)]
pub(crate) from: String,
/// The body of the message.
#[serde(rename = "body", skip_serializing_if = "Option::is_none")]
#[new(default)]
pub(crate) body: Option<String>,
/// The "variables" key in the body object holds technology specific key/value pairs to append to the message.
///
/// These can be interpreted and used by the various resource types;
/// for example, the pjsip resource type will add the key/value pairs as SIP headers.
/// The "display_name" key is used by the PJSIP technology.
/// Its value will be prepended as a display name to the Refer-To URI.
#[serde(skip)]
#[new(default)]
pub(crate) variables: Option<serde_json::Value>,
}
#[derive(Clone, Debug, Serialize, new, Setters)]
#[setters(prefix = "with_")]
#[setters(into, strip_option)]
pub struct SendMessageToEndpointRequest {
/// Technology of the endpoint
#[serde(skip_serializing)]
#[setters(skip)]
#[new(into)]
pub(crate) tech: String,
/// ID of the endpoint
#[serde(skip_serializing)]
#[setters(skip)]
#[new(into)]
pub(crate) resource: String,
/// The endpoint resource or technology specific identity to send this message from. Valid resources are pjsip, and xmpp.
#[setters(skip)]
#[new(into)]
pub(crate) from: String,
/// The body of the message.
#[serde(rename = "body", skip_serializing_if = "Option::is_none")]
#[new(default)]
pub(crate) body: Option<String>,
/// The "variables" key in the body object holds technology specific key/value pairs to append to the message.
///
/// These can be interpreted and used by the various resource types;
/// for example, the pjsip resource type will add the key/value pairs as SIP headers.
/// The "display_name" key is used by the PJSIP technology.
/// Its value will be prepended as a display name to the Refer-To URI.
#[serde(skip)]
#[new(default)]
pub(crate) variables: Option<serde_json::Value>,
}
#[derive(Clone, Debug, Serialize, new, Setters)]
#[setters(prefix = "with_")]
#[setters(into, strip_option)]
pub struct ReferToEndpointRequest {
/// Technology of the endpoint
#[serde(skip_serializing)]
#[setters(skip)]
#[new(into)]
pub(crate) tech: String,
/// ID of the endpoint
#[serde(skip_serializing)]
#[setters(skip)]
#[new(into)]
pub(crate) resource: String,
/// The endpoint resource or technology specific identity to send this message from.
///
/// Valid resources are pjsip, and xmpp.
#[setters(skip)]
#[new(into)]
from: String,
/// The endpoint resource or technology specific URI to refer to.
#[setters(skip)]
#[new(into)]
refer_to: String,
/// If true and "refer_to" refers to an Asterisk endpoint,
/// the "refer_to" value is set to point to this Asterisk endpoint - so the referee is referred to Asterisk.
/// Otherwise, use the contact URI associated with the endpoint.
#[serde(skip_serializing_if = "Option::is_none")]
#[new(default)]
to_self: Option<bool>,
/// The "variables" key in the body object holds technology specific key/value pairs to append to the message.
///
/// These can be interpreted and used by the various resource types;
/// for example, the pjsip resource type will add the key/value pairs as SIP headers.
/// The "display_name" key is used by the PJSIP technology.
/// Its value will be prepended as a display name to the Refer-To URI.
#[serde(skip_serializing)]
#[new(default)]
pub(crate) variables: Option<serde_json::Value>,
}