diff --git a/src/types/poll_answer.rs b/src/types/poll_answer.rs index 2d16cb2b..6ddb0b06 100644 --- a/src/types/poll_answer.rs +++ b/src/types/poll_answer.rs @@ -15,3 +15,34 @@ pub struct PollAnswer { /// May be empty if the user retracted their vote. pub option_ids: Vec, } + +impl PollAnswer { + pub fn new(poll_id: S, user: User, option_ids: O) -> Self + where + S: Into, + O: Into>, + { + Self { poll_id: poll_id.into(), user, option_ids: option_ids.into() } + } + + pub fn poll_id(mut self, val: S) -> Self + where + S: Into, + { + self.poll_id = val.into(); + self + } + + pub fn user(mut self, val: User) -> Self { + self.user = val; + self + } + + pub fn option_ids(mut self, val: S) -> Self + where + S: Into>, + { + self.option_ids = val.into(); + self + } +}