openiap_proto/
workitem.rs

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
#![warn(missing_docs)]
use super::protos::{
    Envelope, PushWorkitemRequest, PushWorkitemsRequest, PopWorkitemRequest, UpdateWorkitemRequest, DeleteWorkitemRequest,
    AddWorkItemQueueRequest, UpdateWorkItemQueueRequest, DeleteWorkItemQueueRequest
};

impl PushWorkitemRequest {
    /// Creates a new `PushWorkitemRequest` with the given `workitem`.
    pub fn to_envelope(&self) -> Envelope {
        let any_message = prost_types::Any {
            type_url: "type.googleapis.com/openiap.PushWorkitemRequest".to_string(),
            value: {
                let mut buf = Vec::new();
                prost::Message::encode(self, &mut buf).unwrap_or(());
                buf
            },
        };
        Envelope {
            command: "pushworkitem".into(),
            data: Some(any_message.clone()),
            ..Default::default() 
        }
    }
}
impl PushWorkitemsRequest {
    /// Creates a new `PushWorkitemsRequest` with the given `workitem`.
    pub fn to_envelope(&self) -> Envelope {
        let any_message = prost_types::Any {
            type_url: "type.googleapis.com/openiap.PushWorkitemsRequest".to_string(),
            value: {
                let mut buf = Vec::new();
                prost::Message::encode(self, &mut buf).unwrap_or(());
                buf
            },
        };
        Envelope {
            command: "pushworkitems".into(),
            data: Some(any_message.clone()),
            ..Default::default() 
        }
    }
}
impl PopWorkitemRequest {
    /// Creates a new `PopWorkitemRequest` with the given `wiq`.
    pub fn bywiq(wiq: &str) -> Self {
        Self {
            wiq: wiq.to_string(),
            compressed: false,
            includefiles: false,
            wiqid: "".to_string(),
        }
    }
    /// Creates a new `PopWorkitemRequest` with the given `wiqid`.
    pub fn bywiqid(wiqid: &str) -> Self {
        Self {
            wiqid: wiqid.to_string(),
            compressed: false,
            includefiles: false,
            wiq: "".to_string(),
        }
    }
    /// Creates a new `PopWorkitemRequest` with the given `workitem`.
    pub fn to_envelope(&self) -> Envelope {
        let any_message = prost_types::Any {
            type_url: "type.googleapis.com/openiap.PopWorkitemRequest".to_string(),
            value: {
                let mut buf = Vec::new();
                prost::Message::encode(self, &mut buf).unwrap_or(());
                buf
            },
        };
        Envelope {
            command: "popworkitem".into(),
            data: Some(any_message.clone()),
            ..Default::default() 
        }
    }
}
impl UpdateWorkitemRequest {
    /// Creates a new `UpdateWorkitemRequest` with the given `workitem`.
    pub fn to_envelope(&self) -> Envelope {
        let any_message = prost_types::Any {
            type_url: "type.googleapis.com/openiap.UpdateWorkitemRequest".to_string(),
            value: {
                let mut buf = Vec::new();
                prost::Message::encode(self, &mut buf).unwrap_or(());
                buf
            },
        };
        Envelope {
            command: "updateworkitem".into(),
            data: Some(any_message.clone()),
            ..Default::default() 
        }
    }    
}
impl DeleteWorkitemRequest {
    /// Creates a new `DeleteWorkitemRequest` with the given `workitem`.
    pub fn to_envelope(&self) -> Envelope {
        let any_message = prost_types::Any {
            type_url: "type.googleapis.com/openiap.DeleteWorkitemRequest".to_string(),
            value: {
                let mut buf = Vec::new();
                prost::Message::encode(self, &mut buf).unwrap_or(());
                buf
            },
        };
        Envelope {
            command: "deleteworkitem".into(),
            data: Some(any_message.clone()),
            ..Default::default() 
        }
    }
}
impl AddWorkItemQueueRequest {
    /// Creates a new `AddWorkItemQueueRequest` with the given `workitem`.
    pub fn to_envelope(&self) -> Envelope {
        let any_message = prost_types::Any {
            type_url: "type.googleapis.com/openiap.AddWorkItemQueueRequest".to_string(),
            value: {
                let mut buf = Vec::new();
                prost::Message::encode(self, &mut buf).unwrap_or(());
                buf
            },
        };
        Envelope {
            command: "addworkitemqueue".into(),
            data: Some(any_message.clone()),
            ..Default::default() 
        }
    }
}
impl UpdateWorkItemQueueRequest {
    /// Creates a new `UpdateWorkItemQueueRequest` with the given `workitem`.
    pub fn to_envelope(&self) -> Envelope {
        let any_message = prost_types::Any {
            type_url: "type.googleapis.com/openiap.UpdateWorkItemQueueRequest".to_string(),
            value: {
                let mut buf = Vec::new();
                prost::Message::encode(self, &mut buf).unwrap_or(());
                buf
            },
        };
        Envelope {
            command: "updateworkitemqueue".into(),
            data: Some(any_message.clone()),
            ..Default::default() 
        }
    }
}
impl DeleteWorkItemQueueRequest {
    /// Creates a new `DeleteWorkItemQueueRequest` with the given `workitem`.
    pub fn to_envelope(&self) -> Envelope {
        let any_message = prost_types::Any {
            type_url: "type.googleapis.com/openiap.DeleteWorkItemQueueRequest".to_string(),
            value: {
                let mut buf = Vec::new();
                prost::Message::encode(self, &mut buf).unwrap_or(());
                buf
            },
        };
        Envelope {
            command: "deleteworkitemqueue".into(),
            data: Some(any_message.clone()),
            ..Default::default() 
        }
    }
}