#[derive(Clone, Debug)]
pub struct TwitterClient<A: Authenticator, H: HttpHandler> {
auth: A,
handler: H,
}
impl<A: Authenticator, H: HttpHandler> TwitterClient<A, H> {
pub fn new(authenticator: A, http_handler: H) -> TwitterClient<A, H> {
TwitterClient {
auth: authenticator,
handler: http_handler,
}
}
pub fn trends(&self) -> TrendsClient<A, H> {
TrendsClient { client: self }
}
pub fn favorites(&self) -> FavoritesClient<A, H> {
FavoritesClient { client: self }
}
pub fn search(&self) -> SearchClient<A, H> {
SearchClient { client: self }
}
pub fn application(&self) -> ApplicationClient<A, H> {
ApplicationClient { client: self }
}
pub fn account(&self) -> AccountClient<A, H> {
AccountClient { client: self }
}
pub fn followers(&self) -> FollowersClient<A, H> {
FollowersClient { client: self }
}
pub fn geo(&self) -> GeoClient<A, H> {
GeoClient { client: self }
}
pub fn friendships(&self) -> FriendshipsClient<A, H> {
FriendshipsClient { client: self }
}
pub fn lists(&self) -> ListsClient<A, H> {
ListsClient { client: self }
}
pub fn blocks(&self) -> BlocksClient<A, H> {
BlocksClient { client: self }
}
pub fn friends(&self) -> FriendsClient<A, H> {
FriendsClient { client: self }
}
pub fn mutes_users(&self) -> MutesUsersClient<A, H> {
MutesUsersClient { client: self }
}
pub fn media(&self) -> MediaClient<A, H> {
MediaClient { client: self }
}
pub fn direct_messages(&self) -> DirectMessagesClient<A, H> {
DirectMessagesClient { client: self }
}
pub fn lists_subscribers(&self) -> ListsSubscribersClient<A, H> {
ListsSubscribersClient { client: self }
}
pub fn statuses(&self) -> StatusesClient<A, H> {
StatusesClient { client: self }
}
pub fn help(&self) -> HelpClient<A, H> {
HelpClient { client: self }
}
pub fn users(&self) -> UsersClient<A, H> {
UsersClient { client: self }
}
pub fn saved_searches(&self) -> SavedSearchesClient<A, H> {
SavedSearchesClient { client: self }
}
pub fn lists_members(&self) -> ListsMembersClient<A, H> {
ListsMembersClient { client: self }
}
}
#[derive(Clone, Debug)]
pub struct TrendsClient<'a, A: 'a + Authenticator, H: 'a + HttpHandler> {
client: &'a TwitterClient<A, H>
}
impl<'a, A: Authenticator, H: HttpHandler> TrendsClient<'a, A, H> {
pub fn available(&self) -> TrendsAvailableRequestBuilder<'a, A, H> {
TrendsAvailableRequestBuilder {
_client: self.client,
}
}
pub fn closest(&self, lat: f64, long: f64) -> TrendsClosestRequestBuilder<'a, A, H> {
TrendsClosestRequestBuilder {
_client: self.client,
lat: lat,
long: long,
}
}
pub fn place(&self, id: i64) -> TrendsPlaceRequestBuilder<'a, A, H> {
TrendsPlaceRequestBuilder {
_client: self.client,
id: id,
exclude: None,
}
}
}
pub struct TrendsAvailableRequestBuilder<'a, A: 'a + Authenticator, H: 'a + HttpHandler> {
_client: &'a TwitterClient<A, H>,
}
impl<'a, A: Authenticator, H: HttpHandler> TrendsAvailableRequestBuilder<'a, A, H> {
pub fn execute(&'a mut self) -> TwitterResult<Vec<TrendPlace>> {
let params = Vec::<(Cow<str>, ParameterValue)>::new();
let url = "https://api.twitter.com/1.1/trends/available.json";
execute_core(self._client, Get, url, params)
}
}
pub struct TrendsClosestRequestBuilder<'a, A: 'a + Authenticator, H: 'a + HttpHandler> {
_client: &'a TwitterClient<A, H>,
lat: f64,
long: f64,
}
impl<'a, A: Authenticator, H: HttpHandler> TrendsClosestRequestBuilder<'a, A, H> {
pub fn execute(&'a mut self) -> TwitterResult<Vec<TrendPlace>> {
let mut params = Vec::with_capacity(2);
params.push((Cow::Borrowed("lat"), self.lat.to_parameter_value()));
params.push((Cow::Borrowed("long"), self.long.to_parameter_value()));
let url = "https://api.twitter.com/1.1/trends/closest.json";
execute_core(self._client, Get, url, params)
}
}
pub struct TrendsPlaceRequestBuilder<'a, A: 'a + Authenticator, H: 'a + HttpHandler> {
_client: &'a TwitterClient<A, H>,
id: i64,
exclude: Option<Cow<'a, str>>,
}
impl<'a, A: Authenticator, H: HttpHandler> TrendsPlaceRequestBuilder<'a, A, H> {
pub fn exclude<T1: Into<Cow<'a, str>>>(&'a mut self, val: T1) -> &'a mut Self {
self.exclude = Some(val.into());
self
}
pub fn execute(&'a mut self) -> TwitterResult<Vec<TrendsResult>> {
let mut params = Vec::with_capacity(2);
params.push((Cow::Borrowed("id"), self.id.to_parameter_value()));
if let Some(ref mut x) = self.exclude { params.push((Cow::Borrowed("exclude"), x.to_parameter_value())) }
let url = "https://api.twitter.com/1.1/trends/place.json";
execute_core(self._client, Get, url, params)
}
}
#[derive(Clone, Debug)]
pub struct FavoritesClient<'a, A: 'a + Authenticator, H: 'a + HttpHandler> {
client: &'a TwitterClient<A, H>
}
impl<'a, A: Authenticator, H: HttpHandler> FavoritesClient<'a, A, H> {
pub fn list(&self) -> FavoritesListRequestBuilder<'a, A, H> {
FavoritesListRequestBuilder {
_client: self.client,
id: None,
screen_name: None,
count: None,
since_id: None,
max_id: None,
include_entities: None,
include_ext_alt_text: None,
tweet_mode: None,
}
}
pub fn create(&self, id: i64) -> FavoritesCreateRequestBuilder<'a, A, H> {
FavoritesCreateRequestBuilder {
_client: self.client,
id: id,
include_entities: None,
include_ext_alt_text: None,
tweet_mode: None,
}
}
pub fn destroy(&self, id: i64) -> FavoritesDestroyRequestBuilder<'a, A, H> {
FavoritesDestroyRequestBuilder {
_client: self.client,
id: id,
include_entities: None,
include_ext_alt_text: None,
tweet_mode: None,
}
}
}
pub struct FavoritesListRequestBuilder<'a, A: 'a + Authenticator, H: 'a + HttpHandler> {
_client: &'a TwitterClient<A, H>,
id: Option<i64>,
screen_name: Option<Cow<'a, str>>,
count: Option<i32>,
since_id: Option<i64>,
max_id: Option<i64>,
include_entities: Option<bool>,
include_ext_alt_text: Option<bool>,
tweet_mode: Option<TweetMode>,
}
impl<'a, A: Authenticator, H: HttpHandler> FavoritesListRequestBuilder<'a, A, H> {
pub fn id(&'a mut self, val: i64) -> &'a mut Self {
self.id = Some(val);
self
}
pub fn screen_name<T1: Into<Cow<'a, str>>>(&'a mut self, val: T1) -> &'a mut Self {
self.screen_name = Some(val.into());
self
}
pub fn count(&'a mut self, val: i32) -> &'a mut Self {
self.count = Some(val);
self
}
pub fn since_id(&'a mut self, val: i64) -> &'a mut Self {
self.since_id = Some(val);
self
}
pub fn max_id(&'a mut self, val: i64) -> &'a mut Self {
self.max_id = Some(val);
self
}
pub fn include_entities(&'a mut self, val: bool) -> &'a mut Self {
self.include_entities = Some(val);
self
}
pub fn include_ext_alt_text(&'a mut self, val: bool) -> &'a mut Self {
self.include_ext_alt_text = Some(val);
self
}
pub fn tweet_mode(&'a mut self, val: TweetMode) -> &'a mut Self {
self.tweet_mode = Some(val);
self
}
pub fn execute(&'a mut self) -> TwitterResult<Vec<Tweet>> {
let mut params = Vec::with_capacity(8);
if let Some(ref mut x) = self.id { params.push((Cow::Borrowed("id"), x.to_parameter_value())) }
if let Some(ref mut x) = self.screen_name { params.push((Cow::Borrowed("screen_name"), x.to_parameter_value())) }
if let Some(ref mut x) = self.count { params.push((Cow::Borrowed("count"), x.to_parameter_value())) }
if let Some(ref mut x) = self.since_id { params.push((Cow::Borrowed("since_id"), x.to_parameter_value())) }
if let Some(ref mut x) = self.max_id { params.push((Cow::Borrowed("max_id"), x.to_parameter_value())) }
if let Some(ref mut x) = self.include_entities { params.push((Cow::Borrowed("include_entities"), x.to_parameter_value())) }
if let Some(ref mut x) = self.include_ext_alt_text { params.push((Cow::Borrowed("include_ext_alt_text"), x.to_parameter_value())) }
if let Some(ref mut x) = self.tweet_mode { params.push((Cow::Borrowed("tweet_mode"), x.to_parameter_value())) }
let url = "https://api.twitter.com/1.1/favorites/list.json";
execute_core(self._client, Get, url, params)
}
}
pub struct FavoritesCreateRequestBuilder<'a, A: 'a + Authenticator, H: 'a + HttpHandler> {
_client: &'a TwitterClient<A, H>,
id: i64,
include_entities: Option<bool>,
include_ext_alt_text: Option<bool>,
tweet_mode: Option<TweetMode>,
}
impl<'a, A: Authenticator, H: HttpHandler> FavoritesCreateRequestBuilder<'a, A, H> {
pub fn include_entities(&'a mut self, val: bool) -> &'a mut Self {
self.include_entities = Some(val);
self
}
pub fn include_ext_alt_text(&'a mut self, val: bool) -> &'a mut Self {
self.include_ext_alt_text = Some(val);
self
}
pub fn tweet_mode(&'a mut self, val: TweetMode) -> &'a mut Self {
self.tweet_mode = Some(val);
self
}
pub fn execute(&'a mut self) -> TwitterResult<Tweet> {
let mut params = Vec::with_capacity(4);
params.push((Cow::Borrowed("id"), self.id.to_parameter_value()));
if let Some(ref mut x) = self.include_entities { params.push((Cow::Borrowed("include_entities"), x.to_parameter_value())) }
if let Some(ref mut x) = self.include_ext_alt_text { params.push((Cow::Borrowed("include_ext_alt_text"), x.to_parameter_value())) }
if let Some(ref mut x) = self.tweet_mode { params.push((Cow::Borrowed("tweet_mode"), x.to_parameter_value())) }
let url = "https://api.twitter.com/1.1/favorites/create.json";
execute_core(self._client, Post, url, params)
}
}
pub struct FavoritesDestroyRequestBuilder<'a, A: 'a + Authenticator, H: 'a + HttpHandler> {
_client: &'a TwitterClient<A, H>,
id: i64,
include_entities: Option<bool>,
include_ext_alt_text: Option<bool>,
tweet_mode: Option<TweetMode>,
}
impl<'a, A: Authenticator, H: HttpHandler> FavoritesDestroyRequestBuilder<'a, A, H> {
pub fn include_entities(&'a mut self, val: bool) -> &'a mut Self {
self.include_entities = Some(val);
self
}
pub fn include_ext_alt_text(&'a mut self, val: bool) -> &'a mut Self {
self.include_ext_alt_text = Some(val);
self
}
pub fn tweet_mode(&'a mut self, val: TweetMode) -> &'a mut Self {
self.tweet_mode = Some(val);
self
}
pub fn execute(&'a mut self) -> TwitterResult<Tweet> {
let mut params = Vec::with_capacity(4);
params.push((Cow::Borrowed("id"), self.id.to_parameter_value()));
if let Some(ref mut x) = self.include_entities { params.push((Cow::Borrowed("include_entities"), x.to_parameter_value())) }
if let Some(ref mut x) = self.include_ext_alt_text { params.push((Cow::Borrowed("include_ext_alt_text"), x.to_parameter_value())) }
if let Some(ref mut x) = self.tweet_mode { params.push((Cow::Borrowed("tweet_mode"), x.to_parameter_value())) }
let url = "https://api.twitter.com/1.1/favorites/destroy.json";
execute_core(self._client, Post, url, params)
}
}
#[derive(Clone, Debug)]
pub struct SearchClient<'a, A: 'a + Authenticator, H: 'a + HttpHandler> {
client: &'a TwitterClient<A, H>
}
impl<'a, A: Authenticator, H: HttpHandler> SearchClient<'a, A, H> {
pub fn tweets<T1: Into<Cow<'a, str>>>(&self, q: T1) -> SearchTweetsRequestBuilder<'a, A, H> {
SearchTweetsRequestBuilder {
_client: self.client,
q: q.into(),
geocode: None,
lang: None,
locale: None,
result_type: None,
count: None,
until: None,
since_id: None,
max_id: None,
include_entities: None,
include_ext_alt_text: None,
tweet_mode: None,
}
}
}
pub struct SearchTweetsRequestBuilder<'a, A: 'a + Authenticator, H: 'a + HttpHandler> {
_client: &'a TwitterClient<A, H>,
q: Cow<'a, str>,
geocode: Option<Cow<'a, str>>,
lang: Option<Cow<'a, str>>,
locale: Option<Cow<'a, str>>,
result_type: Option<Cow<'a, str>>,
count: Option<i32>,
until: Option<Cow<'a, str>>,
since_id: Option<i64>,
max_id: Option<i64>,
include_entities: Option<bool>,
include_ext_alt_text: Option<bool>,
tweet_mode: Option<TweetMode>,
}
impl<'a, A: Authenticator, H: HttpHandler> SearchTweetsRequestBuilder<'a, A, H> {
pub fn geocode<T1: Into<Cow<'a, str>>>(&'a mut self, val: T1) -> &'a mut Self {
self.geocode = Some(val.into());
self
}
pub fn lang<T1: Into<Cow<'a, str>>>(&'a mut self, val: T1) -> &'a mut Self {
self.lang = Some(val.into());
self
}
pub fn locale<T1: Into<Cow<'a, str>>>(&'a mut self, val: T1) -> &'a mut Self {
self.locale = Some(val.into());
self
}
pub fn result_type<T1: Into<Cow<'a, str>>>(&'a mut self, val: T1) -> &'a mut Self {
self.result_type = Some(val.into());
self
}
pub fn count(&'a mut self, val: i32) -> &'a mut Self {
self.count = Some(val);
self
}
pub fn until<T1: Into<Cow<'a, str>>>(&'a mut self, val: T1) -> &'a mut Self {
self.until = Some(val.into());
self
}
pub fn since_id(&'a mut self, val: i64) -> &'a mut Self {
self.since_id = Some(val);
self
}
pub fn max_id(&'a mut self, val: i64) -> &'a mut Self {
self.max_id = Some(val);
self
}
pub fn include_entities(&'a mut self, val: bool) -> &'a mut Self {
self.include_entities = Some(val);
self
}
pub fn include_ext_alt_text(&'a mut self, val: bool) -> &'a mut Self {
self.include_ext_alt_text = Some(val);
self
}
pub fn tweet_mode(&'a mut self, val: TweetMode) -> &'a mut Self {
self.tweet_mode = Some(val);
self
}
pub fn execute(&'a mut self) -> TwitterResult<SearchResponse> {
let mut params = Vec::with_capacity(12);
params.push((Cow::Borrowed("q"), self.q.to_parameter_value()));
if let Some(ref mut x) = self.geocode { params.push((Cow::Borrowed("geocode"), x.to_parameter_value())) }
if let Some(ref mut x) = self.lang { params.push((Cow::Borrowed("lang"), x.to_parameter_value())) }
if let Some(ref mut x) = self.locale { params.push((Cow::Borrowed("locale"), x.to_parameter_value())) }
if let Some(ref mut x) = self.result_type { params.push((Cow::Borrowed("result_type"), x.to_parameter_value())) }
if let Some(ref mut x) = self.count { params.push((Cow::Borrowed("count"), x.to_parameter_value())) }
if let Some(ref mut x) = self.until { params.push((Cow::Borrowed("until"), x.to_parameter_value())) }
if let Some(ref mut x) = self.since_id { params.push((Cow::Borrowed("since_id"), x.to_parameter_value())) }
if let Some(ref mut x) = self.max_id { params.push((Cow::Borrowed("max_id"), x.to_parameter_value())) }
if let Some(ref mut x) = self.include_entities { params.push((Cow::Borrowed("include_entities"), x.to_parameter_value())) }
if let Some(ref mut x) = self.include_ext_alt_text { params.push((Cow::Borrowed("include_ext_alt_text"), x.to_parameter_value())) }
if let Some(ref mut x) = self.tweet_mode { params.push((Cow::Borrowed("tweet_mode"), x.to_parameter_value())) }
let url = "https://api.twitter.com/1.1/search/tweets.json";
execute_core(self._client, Get, url, params)
}
}
#[derive(Clone, Debug)]
pub struct ApplicationClient<'a, A: 'a + Authenticator, H: 'a + HttpHandler> {
client: &'a TwitterClient<A, H>
}
impl<'a, A: Authenticator, H: HttpHandler> ApplicationClient<'a, A, H> {
pub fn rate_limit_status(&self) -> ApplicationRateLimitStatusRequestBuilder<'a, A, H> {
ApplicationRateLimitStatusRequestBuilder {
_client: self.client,
resources: None,
}
}
}
pub struct ApplicationRateLimitStatusRequestBuilder<'a, A: 'a + Authenticator, H: 'a + HttpHandler> {
_client: &'a TwitterClient<A, H>,
resources: Option<String>,
}
impl<'a, A: Authenticator, H: HttpHandler> ApplicationRateLimitStatusRequestBuilder<'a, A, H> {
pub fn resources<T1: AsRef<str>, T2: IntoIterator<Item = T1>>(&'a mut self, val: T2) -> &'a mut Self {
self.resources = Some(str_collection_parameter(val));
self
}
pub fn execute(&'a mut self) -> TwitterResult<RateLimitStatusResponse> {
let mut params = Vec::with_capacity(1);
if let Some(ref mut x) = self.resources { params.push((Cow::Borrowed("resources"), x.to_parameter_value())) }
let url = "https://api.twitter.com/1.1/application/rate_limit_status.json";
execute_core(self._client, Get, url, params)
}
}
#[derive(Clone, Debug)]
pub struct AccountClient<'a, A: 'a + Authenticator, H: 'a + HttpHandler> {
client: &'a TwitterClient<A, H>
}
impl<'a, A: Authenticator, H: HttpHandler> AccountClient<'a, A, H> {
pub fn verify_credentials(&self) -> AccountVerifyCredentialsRequestBuilder<'a, A, H> {
AccountVerifyCredentialsRequestBuilder {
_client: self.client,
include_entities: None,
skip_status: None,
include_email: None,
include_ext_alt_text: None,
tweet_mode: None,
}
}
pub fn settings(&self) -> AccountSettingsRequestBuilder<'a, A, H> {
AccountSettingsRequestBuilder {
_client: self.client,
trend_location_woeid: None,
sleep_time_enabled: None,
start_sleep_time: None,
end_sleep_time: None,
time_zone: None,
lang: None,
allow_contributor_request: None,
current_password: None,
allow_dms_from: None,
}
}
pub fn update_profile(&self) -> AccountUpdateProfileRequestBuilder<'a, A, H> {
AccountUpdateProfileRequestBuilder {
_client: self.client,
name: None,
url: None,
location: None,
description: None,
profile_link_color: None,
include_entities: None,
skip_status: None,
include_ext_alt_text: None,
tweet_mode: None,
}
}
pub fn update_profile_background_image(&self) -> AccountUpdateProfileBackgroundImageRequestBuilder<'a, A, H> {
AccountUpdateProfileBackgroundImageRequestBuilder {
_client: self.client,
image: None,
media_id: None,
tile: None,
include_entities: None,
skip_status: None,
include_ext_alt_text: None,
tweet_mode: None,
}
}
pub fn update_profile_banner(&self) -> AccountUpdateProfileBannerRequestBuilder<'a, A, H> {
AccountUpdateProfileBannerRequestBuilder {
_client: self.client,
image: None,
banner: None,
width: None,
height: None,
offset_left: None,
offset_top: None,
}
}
pub fn remove_profile_banner(&self) -> AccountRemoveProfileBannerRequestBuilder<'a, A, H> {
AccountRemoveProfileBannerRequestBuilder {
_client: self.client,
}
}
pub fn update_profile_image(&self, image: &'a mut Read) -> AccountUpdateProfileImageRequestBuilder<'a, A, H> {
AccountUpdateProfileImageRequestBuilder {
_client: self.client,
image: image,
include_entities: None,
skip_status: None,
include_ext_alt_text: None,
tweet_mode: None,
}
}
}
pub struct AccountVerifyCredentialsRequestBuilder<'a, A: 'a + Authenticator, H: 'a + HttpHandler> {
_client: &'a TwitterClient<A, H>,
include_entities: Option<bool>,
skip_status: Option<bool>,
include_email: Option<bool>,
include_ext_alt_text: Option<bool>,
tweet_mode: Option<TweetMode>,
}
impl<'a, A: Authenticator, H: HttpHandler> AccountVerifyCredentialsRequestBuilder<'a, A, H> {
pub fn include_entities(&'a mut self, val: bool) -> &'a mut Self {
self.include_entities = Some(val);
self
}
pub fn skip_status(&'a mut self, val: bool) -> &'a mut Self {
self.skip_status = Some(val);
self
}
pub fn include_email(&'a mut self, val: bool) -> &'a mut Self {
self.include_email = Some(val);
self
}
pub fn include_ext_alt_text(&'a mut self, val: bool) -> &'a mut Self {
self.include_ext_alt_text = Some(val);
self
}
pub fn tweet_mode(&'a mut self, val: TweetMode) -> &'a mut Self {
self.tweet_mode = Some(val);
self
}
pub fn execute(&'a mut self) -> TwitterResult<User> {
let mut params = Vec::with_capacity(5);
if let Some(ref mut x) = self.include_entities { params.push((Cow::Borrowed("include_entities"), x.to_parameter_value())) }
if let Some(ref mut x) = self.skip_status { params.push((Cow::Borrowed("skip_status"), x.to_parameter_value())) }
if let Some(ref mut x) = self.include_email { params.push((Cow::Borrowed("include_email"), x.to_parameter_value())) }
if let Some(ref mut x) = self.include_ext_alt_text { params.push((Cow::Borrowed("include_ext_alt_text"), x.to_parameter_value())) }
if let Some(ref mut x) = self.tweet_mode { params.push((Cow::Borrowed("tweet_mode"), x.to_parameter_value())) }
let url = "https://api.twitter.com/1.1/account/verify_credentials.json";
execute_core(self._client, Get, url, params)
}
}
pub struct AccountSettingsRequestBuilder<'a, A: 'a + Authenticator, H: 'a + HttpHandler> {
_client: &'a TwitterClient<A, H>,
trend_location_woeid: Option<i32>,
sleep_time_enabled: Option<bool>,
start_sleep_time: Option<i32>,
end_sleep_time: Option<i32>,
time_zone: Option<Cow<'a, str>>,
lang: Option<Cow<'a, str>>,
allow_contributor_request: Option<Cow<'a, str>>,
current_password: Option<Cow<'a, str>>,
allow_dms_from: Option<Cow<'a, str>>,
}
impl<'a, A: Authenticator, H: HttpHandler> AccountSettingsRequestBuilder<'a, A, H> {
pub fn trend_location_woeid(&'a mut self, val: i32) -> &'a mut Self {
self.trend_location_woeid = Some(val);
self
}
pub fn sleep_time_enabled(&'a mut self, val: bool) -> &'a mut Self {
self.sleep_time_enabled = Some(val);
self
}
pub fn start_sleep_time(&'a mut self, val: i32) -> &'a mut Self {
self.start_sleep_time = Some(val);
self
}
pub fn end_sleep_time(&'a mut self, val: i32) -> &'a mut Self {
self.end_sleep_time = Some(val);
self
}
pub fn time_zone<T1: Into<Cow<'a, str>>>(&'a mut self, val: T1) -> &'a mut Self {
self.time_zone = Some(val.into());
self
}
pub fn lang<T1: Into<Cow<'a, str>>>(&'a mut self, val: T1) -> &'a mut Self {
self.lang = Some(val.into());
self
}
pub fn allow_contributor_request<T1: Into<Cow<'a, str>>>(&'a mut self, val: T1) -> &'a mut Self {
self.allow_contributor_request = Some(val.into());
self
}
pub fn current_password<T1: Into<Cow<'a, str>>>(&'a mut self, val: T1) -> &'a mut Self {
self.current_password = Some(val.into());
self
}
pub fn allow_dms_from<T1: Into<Cow<'a, str>>>(&'a mut self, val: T1) -> &'a mut Self {
self.allow_dms_from = Some(val.into());
self
}
pub fn execute(&'a mut self) -> TwitterResult<AccountSettings> {
let mut params = Vec::with_capacity(9);
if let Some(ref mut x) = self.trend_location_woeid { params.push((Cow::Borrowed("trend_location_woeid"), x.to_parameter_value())) }
if let Some(ref mut x) = self.sleep_time_enabled { params.push((Cow::Borrowed("sleep_time_enabled"), x.to_parameter_value())) }
if let Some(ref mut x) = self.start_sleep_time { params.push((Cow::Borrowed("start_sleep_time"), x.to_parameter_value())) }
if let Some(ref mut x) = self.end_sleep_time { params.push((Cow::Borrowed("end_sleep_time"), x.to_parameter_value())) }
if let Some(ref mut x) = self.time_zone { params.push((Cow::Borrowed("time_zone"), x.to_parameter_value())) }
if let Some(ref mut x) = self.lang { params.push((Cow::Borrowed("lang"), x.to_parameter_value())) }
if let Some(ref mut x) = self.allow_contributor_request { params.push((Cow::Borrowed("allow_contributor_request"), x.to_parameter_value())) }
if let Some(ref mut x) = self.current_password { params.push((Cow::Borrowed("current_password"), x.to_parameter_value())) }
if let Some(ref mut x) = self.allow_dms_from { params.push((Cow::Borrowed("allow_dms_from"), x.to_parameter_value())) }
impls::account_settings(self._client, params)
}
}
pub struct AccountUpdateProfileRequestBuilder<'a, A: 'a + Authenticator, H: 'a + HttpHandler> {
_client: &'a TwitterClient<A, H>,
name: Option<Cow<'a, str>>,
url: Option<Cow<'a, str>>,
location: Option<Cow<'a, str>>,
description: Option<Cow<'a, str>>,
profile_link_color: Option<Cow<'a, str>>,
include_entities: Option<bool>,
skip_status: Option<bool>,
include_ext_alt_text: Option<bool>,
tweet_mode: Option<TweetMode>,
}
impl<'a, A: Authenticator, H: HttpHandler> AccountUpdateProfileRequestBuilder<'a, A, H> {
pub fn name<T1: Into<Cow<'a, str>>>(&'a mut self, val: T1) -> &'a mut Self {
self.name = Some(val.into());
self
}
pub fn url<T1: Into<Cow<'a, str>>>(&'a mut self, val: T1) -> &'a mut Self {
self.url = Some(val.into());
self
}
pub fn location<T1: Into<Cow<'a, str>>>(&'a mut self, val: T1) -> &'a mut Self {
self.location = Some(val.into());
self
}
pub fn description<T1: Into<Cow<'a, str>>>(&'a mut self, val: T1) -> &'a mut Self {
self.description = Some(val.into());
self
}
pub fn profile_link_color<T1: Into<Cow<'a, str>>>(&'a mut self, val: T1) -> &'a mut Self {
self.profile_link_color = Some(val.into());
self
}
pub fn include_entities(&'a mut self, val: bool) -> &'a mut Self {
self.include_entities = Some(val);
self
}
pub fn skip_status(&'a mut self, val: bool) -> &'a mut Self {
self.skip_status = Some(val);
self
}
pub fn include_ext_alt_text(&'a mut self, val: bool) -> &'a mut Self {
self.include_ext_alt_text = Some(val);
self
}
pub fn tweet_mode(&'a mut self, val: TweetMode) -> &'a mut Self {
self.tweet_mode = Some(val);
self
}
pub fn execute(&'a mut self) -> TwitterResult<User> {
let mut params = Vec::with_capacity(9);
if let Some(ref mut x) = self.name { params.push((Cow::Borrowed("name"), x.to_parameter_value())) }
if let Some(ref mut x) = self.url { params.push((Cow::Borrowed("url"), x.to_parameter_value())) }
if let Some(ref mut x) = self.location { params.push((Cow::Borrowed("location"), x.to_parameter_value())) }
if let Some(ref mut x) = self.description { params.push((Cow::Borrowed("description"), x.to_parameter_value())) }
if let Some(ref mut x) = self.profile_link_color { params.push((Cow::Borrowed("profile_link_color"), x.to_parameter_value())) }
if let Some(ref mut x) = self.include_entities { params.push((Cow::Borrowed("include_entities"), x.to_parameter_value())) }
if let Some(ref mut x) = self.skip_status { params.push((Cow::Borrowed("skip_status"), x.to_parameter_value())) }
if let Some(ref mut x) = self.include_ext_alt_text { params.push((Cow::Borrowed("include_ext_alt_text"), x.to_parameter_value())) }
if let Some(ref mut x) = self.tweet_mode { params.push((Cow::Borrowed("tweet_mode"), x.to_parameter_value())) }
let url = "https://api.twitter.com/1.1/account/update_profile.json";
execute_core(self._client, Post, url, params)
}
}
pub struct AccountUpdateProfileBackgroundImageRequestBuilder<'a, A: 'a + Authenticator, H: 'a + HttpHandler> {
_client: &'a TwitterClient<A, H>,
image: Option<&'a mut Read>,
media_id: Option<i64>,
tile: Option<bool>,
include_entities: Option<bool>,
skip_status: Option<bool>,
include_ext_alt_text: Option<bool>,
tweet_mode: Option<TweetMode>,
}
impl<'a, A: Authenticator, H: HttpHandler> AccountUpdateProfileBackgroundImageRequestBuilder<'a, A, H> {
pub fn image(&'a mut self, val: &'a mut Read) -> &'a mut Self {
self.image = Some(val);
self
}
pub fn media_id(&'a mut self, val: i64) -> &'a mut Self {
self.media_id = Some(val);
self
}
pub fn tile(&'a mut self, val: bool) -> &'a mut Self {
self.tile = Some(val);
self
}
pub fn include_entities(&'a mut self, val: bool) -> &'a mut Self {
self.include_entities = Some(val);
self
}
pub fn skip_status(&'a mut self, val: bool) -> &'a mut Self {
self.skip_status = Some(val);
self
}
pub fn include_ext_alt_text(&'a mut self, val: bool) -> &'a mut Self {
self.include_ext_alt_text = Some(val);
self
}
pub fn tweet_mode(&'a mut self, val: TweetMode) -> &'a mut Self {
self.tweet_mode = Some(val);
self
}
pub fn execute(&'a mut self) -> TwitterResult<User> {
let mut params = Vec::with_capacity(7);
if let Some(ref mut x) = self.image { params.push((Cow::Borrowed("image"), x.to_parameter_value())) }
if let Some(ref mut x) = self.media_id { params.push((Cow::Borrowed("media_id"), x.to_parameter_value())) }
if let Some(ref mut x) = self.tile { params.push((Cow::Borrowed("tile"), x.to_parameter_value())) }
if let Some(ref mut x) = self.include_entities { params.push((Cow::Borrowed("include_entities"), x.to_parameter_value())) }
if let Some(ref mut x) = self.skip_status { params.push((Cow::Borrowed("skip_status"), x.to_parameter_value())) }
if let Some(ref mut x) = self.include_ext_alt_text { params.push((Cow::Borrowed("include_ext_alt_text"), x.to_parameter_value())) }
if let Some(ref mut x) = self.tweet_mode { params.push((Cow::Borrowed("tweet_mode"), x.to_parameter_value())) }
let url = "https://api.twitter.com/1.1/account/update_profile_background_image.json";
execute_core(self._client, Post, url, params)
}
}
pub struct AccountUpdateProfileBannerRequestBuilder<'a, A: 'a + Authenticator, H: 'a + HttpHandler> {
_client: &'a TwitterClient<A, H>,
image: Option<&'a mut Read>,
banner: Option<Cow<'a, str>>,
width: Option<Cow<'a, str>>,
height: Option<Cow<'a, str>>,
offset_left: Option<Cow<'a, str>>,
offset_top: Option<Cow<'a, str>>,
}
impl<'a, A: Authenticator, H: HttpHandler> AccountUpdateProfileBannerRequestBuilder<'a, A, H> {
pub fn image(&'a mut self, val: &'a mut Read) -> &'a mut Self {
self.image = Some(val);
self
}
pub fn banner<T1: Into<Cow<'a, str>>>(&'a mut self, val: T1) -> &'a mut Self {
self.banner = Some(val.into());
self
}
pub fn width<T1: Into<Cow<'a, str>>>(&'a mut self, val: T1) -> &'a mut Self {
self.width = Some(val.into());
self
}
pub fn height<T1: Into<Cow<'a, str>>>(&'a mut self, val: T1) -> &'a mut Self {
self.height = Some(val.into());
self
}
pub fn offset_left<T1: Into<Cow<'a, str>>>(&'a mut self, val: T1) -> &'a mut Self {
self.offset_left = Some(val.into());
self
}
pub fn offset_top<T1: Into<Cow<'a, str>>>(&'a mut self, val: T1) -> &'a mut Self {
self.offset_top = Some(val.into());
self
}
pub fn execute(&'a mut self) -> TwitterResult<()> {
let mut params = Vec::with_capacity(6);
if let Some(ref mut x) = self.image { params.push((Cow::Borrowed("image"), x.to_parameter_value())) }
if let Some(ref mut x) = self.banner { params.push((Cow::Borrowed("banner"), x.to_parameter_value())) }
if let Some(ref mut x) = self.width { params.push((Cow::Borrowed("width"), x.to_parameter_value())) }
if let Some(ref mut x) = self.height { params.push((Cow::Borrowed("height"), x.to_parameter_value())) }
if let Some(ref mut x) = self.offset_left { params.push((Cow::Borrowed("offset_left"), x.to_parameter_value())) }
if let Some(ref mut x) = self.offset_top { params.push((Cow::Borrowed("offset_top"), x.to_parameter_value())) }
let url = "https://api.twitter.com/1.1/account/update_profile_banner.json";
execute_core_unit(self._client, Post, url, params)
}
}
pub struct AccountRemoveProfileBannerRequestBuilder<'a, A: 'a + Authenticator, H: 'a + HttpHandler> {
_client: &'a TwitterClient<A, H>,
}
impl<'a, A: Authenticator, H: HttpHandler> AccountRemoveProfileBannerRequestBuilder<'a, A, H> {
pub fn execute(&'a mut self) -> TwitterResult<()> {
let params = Vec::<(Cow<str>, ParameterValue)>::new();
let url = "https://api.twitter.com/1.1/account/remove_profile_banner.json";
execute_core_unit(self._client, Post, url, params)
}
}
pub struct AccountUpdateProfileImageRequestBuilder<'a, A: 'a + Authenticator, H: 'a + HttpHandler> {
_client: &'a TwitterClient<A, H>,
image: &'a mut Read,
include_entities: Option<bool>,
skip_status: Option<bool>,
include_ext_alt_text: Option<bool>,
tweet_mode: Option<TweetMode>,
}
impl<'a, A: Authenticator, H: HttpHandler> AccountUpdateProfileImageRequestBuilder<'a, A, H> {
pub fn include_entities(&'a mut self, val: bool) -> &'a mut Self {
self.include_entities = Some(val);
self
}
pub fn skip_status(&'a mut self, val: bool) -> &'a mut Self {
self.skip_status = Some(val);
self
}
pub fn include_ext_alt_text(&'a mut self, val: bool) -> &'a mut Self {
self.include_ext_alt_text = Some(val);
self
}
pub fn tweet_mode(&'a mut self, val: TweetMode) -> &'a mut Self {
self.tweet_mode = Some(val);
self
}
pub fn execute(&'a mut self) -> TwitterResult<User> {
let mut params = Vec::with_capacity(5);
params.push((Cow::Borrowed("image"), self.image.to_parameter_value()));
if let Some(ref mut x) = self.include_entities { params.push((Cow::Borrowed("include_entities"), x.to_parameter_value())) }
if let Some(ref mut x) = self.skip_status { params.push((Cow::Borrowed("skip_status"), x.to_parameter_value())) }
if let Some(ref mut x) = self.include_ext_alt_text { params.push((Cow::Borrowed("include_ext_alt_text"), x.to_parameter_value())) }
if let Some(ref mut x) = self.tweet_mode { params.push((Cow::Borrowed("tweet_mode"), x.to_parameter_value())) }
let url = "https://api.twitter.com/1.1/account/update_profile_image.json";
execute_core(self._client, Post, url, params)
}
}
#[derive(Clone, Debug)]
pub struct FollowersClient<'a, A: 'a + Authenticator, H: 'a + HttpHandler> {
client: &'a TwitterClient<A, H>
}
impl<'a, A: Authenticator, H: HttpHandler> FollowersClient<'a, A, H> {
pub fn ids(&self) -> FollowersIdsRequestBuilder<'a, A, H> {
FollowersIdsRequestBuilder {
_client: self.client,
user_id: None,
screen_name: None,
cursor: None,
count: None,
}
}
pub fn list(&self) -> FollowersListRequestBuilder<'a, A, H> {
FollowersListRequestBuilder {
_client: self.client,
user_id: None,
screen_name: None,
cursor: None,
count: None,
skip_status: None,
include_user_entities: None,
include_ext_alt_text: None,
tweet_mode: None,
}
}
}
pub struct FollowersIdsRequestBuilder<'a, A: 'a + Authenticator, H: 'a + HttpHandler> {
_client: &'a TwitterClient<A, H>,
user_id: Option<i64>,
screen_name: Option<Cow<'a, str>>,
cursor: Option<i64>,
count: Option<i32>,
}
impl<'a, A: Authenticator, H: HttpHandler> FollowersIdsRequestBuilder<'a, A, H> {
pub fn user_id(&'a mut self, val: i64) -> &'a mut Self {
self.user_id = Some(val);
self
}
pub fn screen_name<T1: Into<Cow<'a, str>>>(&'a mut self, val: T1) -> &'a mut Self {
self.screen_name = Some(val.into());
self
}
pub fn cursor(&'a mut self, val: i64) -> &'a mut Self {
self.cursor = Some(val);
self
}
pub fn count(&'a mut self, val: i32) -> &'a mut Self {
self.count = Some(val);
self
}
pub fn execute(&'a mut self) -> TwitterResult<CursorIds> {
let mut params = Vec::with_capacity(4);
if let Some(ref mut x) = self.user_id { params.push((Cow::Borrowed("user_id"), x.to_parameter_value())) }
if let Some(ref mut x) = self.screen_name { params.push((Cow::Borrowed("screen_name"), x.to_parameter_value())) }
if let Some(ref mut x) = self.cursor { params.push((Cow::Borrowed("cursor"), x.to_parameter_value())) }
if let Some(ref mut x) = self.count { params.push((Cow::Borrowed("count"), x.to_parameter_value())) }
let url = "https://api.twitter.com/1.1/followers/ids.json";
execute_core(self._client, Get, url, params)
}
}
pub struct FollowersListRequestBuilder<'a, A: 'a + Authenticator, H: 'a + HttpHandler> {
_client: &'a TwitterClient<A, H>,
user_id: Option<i64>,
screen_name: Option<Cow<'a, str>>,
cursor: Option<i64>,
count: Option<i32>,
skip_status: Option<bool>,
include_user_entities: Option<bool>,
include_ext_alt_text: Option<bool>,
tweet_mode: Option<TweetMode>,
}
impl<'a, A: Authenticator, H: HttpHandler> FollowersListRequestBuilder<'a, A, H> {
pub fn user_id(&'a mut self, val: i64) -> &'a mut Self {
self.user_id = Some(val);
self
}
pub fn screen_name<T1: Into<Cow<'a, str>>>(&'a mut self, val: T1) -> &'a mut Self {
self.screen_name = Some(val.into());
self
}
pub fn cursor(&'a mut self, val: i64) -> &'a mut Self {
self.cursor = Some(val);
self
}
pub fn count(&'a mut self, val: i32) -> &'a mut Self {
self.count = Some(val);
self
}
pub fn skip_status(&'a mut self, val: bool) -> &'a mut Self {
self.skip_status = Some(val);
self
}
pub fn include_user_entities(&'a mut self, val: bool) -> &'a mut Self {
self.include_user_entities = Some(val);
self
}
pub fn include_ext_alt_text(&'a mut self, val: bool) -> &'a mut Self {
self.include_ext_alt_text = Some(val);
self
}
pub fn tweet_mode(&'a mut self, val: TweetMode) -> &'a mut Self {
self.tweet_mode = Some(val);
self
}
pub fn execute(&'a mut self) -> TwitterResult<CursorUsers> {
let mut params = Vec::with_capacity(8);
if let Some(ref mut x) = self.user_id { params.push((Cow::Borrowed("user_id"), x.to_parameter_value())) }
if let Some(ref mut x) = self.screen_name { params.push((Cow::Borrowed("screen_name"), x.to_parameter_value())) }
if let Some(ref mut x) = self.cursor { params.push((Cow::Borrowed("cursor"), x.to_parameter_value())) }
if let Some(ref mut x) = self.count { params.push((Cow::Borrowed("count"), x.to_parameter_value())) }
if let Some(ref mut x) = self.skip_status { params.push((Cow::Borrowed("skip_status"), x.to_parameter_value())) }
if let Some(ref mut x) = self.include_user_entities { params.push((Cow::Borrowed("include_user_entities"), x.to_parameter_value())) }
if let Some(ref mut x) = self.include_ext_alt_text { params.push((Cow::Borrowed("include_ext_alt_text"), x.to_parameter_value())) }
if let Some(ref mut x) = self.tweet_mode { params.push((Cow::Borrowed("tweet_mode"), x.to_parameter_value())) }
let url = "https://api.twitter.com/1.1/followers/list.json";
execute_core(self._client, Get, url, params)
}
}
#[derive(Clone, Debug)]
pub struct GeoClient<'a, A: 'a + Authenticator, H: 'a + HttpHandler> {
client: &'a TwitterClient<A, H>
}
impl<'a, A: Authenticator, H: HttpHandler> GeoClient<'a, A, H> {
pub fn id<T1: Into<Cow<'a, str>>>(&self, place_id: T1) -> GeoIdRequestBuilder<'a, A, H> {
GeoIdRequestBuilder {
_client: self.client,
place_id: place_id.into(),
}
}
pub fn similar_places<T1: Into<Cow<'a, str>>>(&self, lat: f64, long: f64, name: T1) -> GeoSimilarPlacesRequestBuilder<'a, A, H> {
GeoSimilarPlacesRequestBuilder {
_client: self.client,
lat: lat,
long: long,
name: name.into(),
contained_within: None,
street_address: None,
}
}
pub fn search(&self) -> GeoSearchRequestBuilder<'a, A, H> {
GeoSearchRequestBuilder {
_client: self.client,
lat: None,
long: None,
query: None,
ip: None,
granularity: None,
accuracy: None,
max_results: None,
contained_within: None,
}
}
pub fn reverse_geocode(&self, lat: f64, long: f64) -> GeoReverseGeocodeRequestBuilder<'a, A, H> {
GeoReverseGeocodeRequestBuilder {
_client: self.client,
lat: lat,
long: long,
accuracy: None,
granularity: None,
max_results: None,
}
}
}
pub struct GeoIdRequestBuilder<'a, A: 'a + Authenticator, H: 'a + HttpHandler> {
_client: &'a TwitterClient<A, H>,
place_id: Cow<'a, str>,
}
impl<'a, A: Authenticator, H: HttpHandler> GeoIdRequestBuilder<'a, A, H> {
pub fn execute(&'a mut self) -> TwitterResult<Place> {
let params = Vec::<(Cow<str>, ParameterValue)>::new();
let url = format!("https://api.twitter.com/1.1/geo/id/{place_id}.json", place_id = self.place_id);
execute_core(self._client, Get, url, params)
}
}
pub struct GeoSimilarPlacesRequestBuilder<'a, A: 'a + Authenticator, H: 'a + HttpHandler> {
_client: &'a TwitterClient<A, H>,
lat: f64,
long: f64,
name: Cow<'a, str>,
contained_within: Option<Cow<'a, str>>,
street_address: Option<Cow<'a, str>>,
}
impl<'a, A: Authenticator, H: HttpHandler> GeoSimilarPlacesRequestBuilder<'a, A, H> {
pub fn contained_within<T1: Into<Cow<'a, str>>>(&'a mut self, val: T1) -> &'a mut Self {
self.contained_within = Some(val.into());
self
}
pub fn street_address<T1: Into<Cow<'a, str>>>(&'a mut self, val: T1) -> &'a mut Self {
self.street_address = Some(val.into());
self
}
pub fn execute(&'a mut self) -> TwitterResult<GeoResponse> {
let mut params = Vec::with_capacity(5);
params.push((Cow::Borrowed("lat"), self.lat.to_parameter_value()));
params.push((Cow::Borrowed("long"), self.long.to_parameter_value()));
params.push((Cow::Borrowed("name"), self.name.to_parameter_value()));
if let Some(ref mut x) = self.contained_within { params.push((Cow::Borrowed("contained_within"), x.to_parameter_value())) }
if let Some(ref mut x) = self.street_address { params.push((Cow::Borrowed("street_address"), x.to_parameter_value())) }
let url = "https://api.twitter.com/1.1/geo/similar_places.json";
execute_core(self._client, Get, url, params)
}
}
pub struct GeoSearchRequestBuilder<'a, A: 'a + Authenticator, H: 'a + HttpHandler> {
_client: &'a TwitterClient<A, H>,
lat: Option<f64>,
long: Option<f64>,
query: Option<Cow<'a, str>>,
ip: Option<Cow<'a, str>>,
granularity: Option<Cow<'a, str>>,
accuracy: Option<Cow<'a, str>>,
max_results: Option<i32>,
contained_within: Option<Cow<'a, str>>,
}
impl<'a, A: Authenticator, H: HttpHandler> GeoSearchRequestBuilder<'a, A, H> {
pub fn lat(&'a mut self, val: f64) -> &'a mut Self {
self.lat = Some(val);
self
}
pub fn long(&'a mut self, val: f64) -> &'a mut Self {
self.long = Some(val);
self
}
pub fn query<T1: Into<Cow<'a, str>>>(&'a mut self, val: T1) -> &'a mut Self {
self.query = Some(val.into());
self
}
pub fn ip<T1: Into<Cow<'a, str>>>(&'a mut self, val: T1) -> &'a mut Self {
self.ip = Some(val.into());
self
}
pub fn granularity<T1: Into<Cow<'a, str>>>(&'a mut self, val: T1) -> &'a mut Self {
self.granularity = Some(val.into());
self
}
pub fn accuracy<T1: Into<Cow<'a, str>>>(&'a mut self, val: T1) -> &'a mut Self {
self.accuracy = Some(val.into());
self
}
pub fn max_results(&'a mut self, val: i32) -> &'a mut Self {
self.max_results = Some(val);
self
}
pub fn contained_within<T1: Into<Cow<'a, str>>>(&'a mut self, val: T1) -> &'a mut Self {
self.contained_within = Some(val.into());
self
}
pub fn execute(&'a mut self) -> TwitterResult<GeoResponse> {
let mut params = Vec::with_capacity(8);
if let Some(ref mut x) = self.lat { params.push((Cow::Borrowed("lat"), x.to_parameter_value())) }
if let Some(ref mut x) = self.long { params.push((Cow::Borrowed("long"), x.to_parameter_value())) }
if let Some(ref mut x) = self.query { params.push((Cow::Borrowed("query"), x.to_parameter_value())) }
if let Some(ref mut x) = self.ip { params.push((Cow::Borrowed("ip"), x.to_parameter_value())) }
if let Some(ref mut x) = self.granularity { params.push((Cow::Borrowed("granularity"), x.to_parameter_value())) }
if let Some(ref mut x) = self.accuracy { params.push((Cow::Borrowed("accuracy"), x.to_parameter_value())) }
if let Some(ref mut x) = self.max_results { params.push((Cow::Borrowed("max_results"), x.to_parameter_value())) }
if let Some(ref mut x) = self.contained_within { params.push((Cow::Borrowed("contained_within"), x.to_parameter_value())) }
let url = "https://api.twitter.com/1.1/geo/search.json";
execute_core(self._client, Get, url, params)
}
}
pub struct GeoReverseGeocodeRequestBuilder<'a, A: 'a + Authenticator, H: 'a + HttpHandler> {
_client: &'a TwitterClient<A, H>,
lat: f64,
long: f64,
accuracy: Option<Cow<'a, str>>,
granularity: Option<Cow<'a, str>>,
max_results: Option<i32>,
}
impl<'a, A: Authenticator, H: HttpHandler> GeoReverseGeocodeRequestBuilder<'a, A, H> {
pub fn accuracy<T1: Into<Cow<'a, str>>>(&'a mut self, val: T1) -> &'a mut Self {
self.accuracy = Some(val.into());
self
}
pub fn granularity<T1: Into<Cow<'a, str>>>(&'a mut self, val: T1) -> &'a mut Self {
self.granularity = Some(val.into());
self
}
pub fn max_results(&'a mut self, val: i32) -> &'a mut Self {
self.max_results = Some(val);
self
}
pub fn execute(&'a mut self) -> TwitterResult<GeoResponse> {
let mut params = Vec::with_capacity(5);
params.push((Cow::Borrowed("lat"), self.lat.to_parameter_value()));
params.push((Cow::Borrowed("long"), self.long.to_parameter_value()));
if let Some(ref mut x) = self.accuracy { params.push((Cow::Borrowed("accuracy"), x.to_parameter_value())) }
if let Some(ref mut x) = self.granularity { params.push((Cow::Borrowed("granularity"), x.to_parameter_value())) }
if let Some(ref mut x) = self.max_results { params.push((Cow::Borrowed("max_results"), x.to_parameter_value())) }
let url = "https://api.twitter.com/1.1/geo/reverse_geocode.json";
execute_core(self._client, Get, url, params)
}
}
#[derive(Clone, Debug)]
pub struct FriendshipsClient<'a, A: 'a + Authenticator, H: 'a + HttpHandler> {
client: &'a TwitterClient<A, H>
}
impl<'a, A: Authenticator, H: HttpHandler> FriendshipsClient<'a, A, H> {
pub fn no_retweets_ids(&self) -> FriendshipsNoRetweetsIdsRequestBuilder<'a, A, H> {
FriendshipsNoRetweetsIdsRequestBuilder {
_client: self.client,
}
}
pub fn incoming(&self) -> FriendshipsIncomingRequestBuilder<'a, A, H> {
FriendshipsIncomingRequestBuilder {
_client: self.client,
cursor: None,
}
}
pub fn outgoing(&self) -> FriendshipsOutgoingRequestBuilder<'a, A, H> {
FriendshipsOutgoingRequestBuilder {
_client: self.client,
cursor: None,
}
}
pub fn lookup(&self) -> FriendshipsLookupRequestBuilder<'a, A, H> {
FriendshipsLookupRequestBuilder {
_client: self.client,
screen_name: None,
user_id: None,
}
}
pub fn show(&self) -> FriendshipsShowRequestBuilder<'a, A, H> {
FriendshipsShowRequestBuilder {
_client: self.client,
source_id: None,
source_screen_name: None,
target_id: None,
target_screen_name: None,
}
}
pub fn create(&self) -> FriendshipsCreateRequestBuilder<'a, A, H> {
FriendshipsCreateRequestBuilder {
_client: self.client,
user_id: None,
screen_name: None,
follow: None,
include_ext_alt_text: None,
tweet_mode: None,
}
}
pub fn destroy(&self) -> FriendshipsDestroyRequestBuilder<'a, A, H> {
FriendshipsDestroyRequestBuilder {
_client: self.client,
user_id: None,
screen_name: None,
include_ext_alt_text: None,
tweet_mode: None,
}
}
pub fn update(&self) -> FriendshipsUpdateRequestBuilder<'a, A, H> {
FriendshipsUpdateRequestBuilder {
_client: self.client,
user_id: None,
screen_name: None,
device: None,
retweets: None,
}
}
}
pub struct FriendshipsNoRetweetsIdsRequestBuilder<'a, A: 'a + Authenticator, H: 'a + HttpHandler> {
_client: &'a TwitterClient<A, H>,
}
impl<'a, A: Authenticator, H: HttpHandler> FriendshipsNoRetweetsIdsRequestBuilder<'a, A, H> {
pub fn execute(&'a mut self) -> TwitterResult<Vec<i64>> {
let params = Vec::<(Cow<str>, ParameterValue)>::new();
let url = "https://api.twitter.com/1.1/friendships/no_retweets/ids.json";
execute_core(self._client, Get, url, params)
}
}
pub struct FriendshipsIncomingRequestBuilder<'a, A: 'a + Authenticator, H: 'a + HttpHandler> {
_client: &'a TwitterClient<A, H>,
cursor: Option<i64>,
}
impl<'a, A: Authenticator, H: HttpHandler> FriendshipsIncomingRequestBuilder<'a, A, H> {
pub fn cursor(&'a mut self, val: i64) -> &'a mut Self {
self.cursor = Some(val);
self
}
pub fn execute(&'a mut self) -> TwitterResult<CursorIds> {
let mut params = Vec::with_capacity(1);
if let Some(ref mut x) = self.cursor { params.push((Cow::Borrowed("cursor"), x.to_parameter_value())) }
let url = "https://api.twitter.com/1.1/friendships/incoming.json";
execute_core(self._client, Get, url, params)
}
}
pub struct FriendshipsOutgoingRequestBuilder<'a, A: 'a + Authenticator, H: 'a + HttpHandler> {
_client: &'a TwitterClient<A, H>,
cursor: Option<i64>,
}
impl<'a, A: Authenticator, H: HttpHandler> FriendshipsOutgoingRequestBuilder<'a, A, H> {
pub fn cursor(&'a mut self, val: i64) -> &'a mut Self {
self.cursor = Some(val);
self
}
pub fn execute(&'a mut self) -> TwitterResult<CursorIds> {
let mut params = Vec::with_capacity(1);
if let Some(ref mut x) = self.cursor { params.push((Cow::Borrowed("cursor"), x.to_parameter_value())) }
let url = "https://api.twitter.com/1.1/friendships/outgoing.json";
execute_core(self._client, Get, url, params)
}
}
pub struct FriendshipsLookupRequestBuilder<'a, A: 'a + Authenticator, H: 'a + HttpHandler> {
_client: &'a TwitterClient<A, H>,
screen_name: Option<String>,
user_id: Option<String>,
}
impl<'a, A: Authenticator, H: HttpHandler> FriendshipsLookupRequestBuilder<'a, A, H> {
pub fn screen_name<T1: AsRef<str>, T2: IntoIterator<Item = T1>>(&'a mut self, val: T2) -> &'a mut Self {
self.screen_name = Some(str_collection_parameter(val));
self
}
pub fn user_id<T1: IntoIterator<Item = i64>>(&'a mut self, val: T1) -> &'a mut Self {
self.user_id = Some(collection_paramter(val));
self
}
pub fn execute(&'a mut self) -> TwitterResult<Vec<Friendship>> {
let mut params = Vec::with_capacity(2);
if let Some(ref mut x) = self.screen_name { params.push((Cow::Borrowed("screen_name"), x.to_parameter_value())) }
if let Some(ref mut x) = self.user_id { params.push((Cow::Borrowed("user_id"), x.to_parameter_value())) }
let url = "https://api.twitter.com/1.1/friendships/lookup.json";
execute_core(self._client, Get, url, params)
}
}
pub struct FriendshipsShowRequestBuilder<'a, A: 'a + Authenticator, H: 'a + HttpHandler> {
_client: &'a TwitterClient<A, H>,
source_id: Option<i64>,
source_screen_name: Option<Cow<'a, str>>,
target_id: Option<i64>,
target_screen_name: Option<Cow<'a, str>>,
}
impl<'a, A: Authenticator, H: HttpHandler> FriendshipsShowRequestBuilder<'a, A, H> {
pub fn source_id(&'a mut self, val: i64) -> &'a mut Self {
self.source_id = Some(val);
self
}
pub fn source_screen_name<T1: Into<Cow<'a, str>>>(&'a mut self, val: T1) -> &'a mut Self {
self.source_screen_name = Some(val.into());
self
}
pub fn target_id(&'a mut self, val: i64) -> &'a mut Self {
self.target_id = Some(val);
self
}
pub fn target_screen_name<T1: Into<Cow<'a, str>>>(&'a mut self, val: T1) -> &'a mut Self {
self.target_screen_name = Some(val.into());
self
}
pub fn execute(&'a mut self) -> TwitterResult<FriendshipResponse> {
let mut params = Vec::with_capacity(4);
if let Some(ref mut x) = self.source_id { params.push((Cow::Borrowed("source_id"), x.to_parameter_value())) }
if let Some(ref mut x) = self.source_screen_name { params.push((Cow::Borrowed("source_screen_name"), x.to_parameter_value())) }
if let Some(ref mut x) = self.target_id { params.push((Cow::Borrowed("target_id"), x.to_parameter_value())) }
if let Some(ref mut x) = self.target_screen_name { params.push((Cow::Borrowed("target_screen_name"), x.to_parameter_value())) }
let url = "https://api.twitter.com/1.1/friendships/show.json";
execute_core(self._client, Get, url, params)
}
}
pub struct FriendshipsCreateRequestBuilder<'a, A: 'a + Authenticator, H: 'a + HttpHandler> {
_client: &'a TwitterClient<A, H>,
user_id: Option<i64>,
screen_name: Option<Cow<'a, str>>,
follow: Option<bool>,
include_ext_alt_text: Option<bool>,
tweet_mode: Option<TweetMode>,
}
impl<'a, A: Authenticator, H: HttpHandler> FriendshipsCreateRequestBuilder<'a, A, H> {
pub fn user_id(&'a mut self, val: i64) -> &'a mut Self {
self.user_id = Some(val);
self
}
pub fn screen_name<T1: Into<Cow<'a, str>>>(&'a mut self, val: T1) -> &'a mut Self {
self.screen_name = Some(val.into());
self
}
pub fn follow(&'a mut self, val: bool) -> &'a mut Self {
self.follow = Some(val);
self
}
pub fn include_ext_alt_text(&'a mut self, val: bool) -> &'a mut Self {
self.include_ext_alt_text = Some(val);
self
}
pub fn tweet_mode(&'a mut self, val: TweetMode) -> &'a mut Self {
self.tweet_mode = Some(val);
self
}
pub fn execute(&'a mut self) -> TwitterResult<User> {
let mut params = Vec::with_capacity(5);
if let Some(ref mut x) = self.user_id { params.push((Cow::Borrowed("user_id"), x.to_parameter_value())) }
if let Some(ref mut x) = self.screen_name { params.push((Cow::Borrowed("screen_name"), x.to_parameter_value())) }
if let Some(ref mut x) = self.follow { params.push((Cow::Borrowed("follow"), x.to_parameter_value())) }
if let Some(ref mut x) = self.include_ext_alt_text { params.push((Cow::Borrowed("include_ext_alt_text"), x.to_parameter_value())) }
if let Some(ref mut x) = self.tweet_mode { params.push((Cow::Borrowed("tweet_mode"), x.to_parameter_value())) }
let url = "https://api.twitter.com/1.1/friendships/create.json";
execute_core(self._client, Post, url, params)
}
}
pub struct FriendshipsDestroyRequestBuilder<'a, A: 'a + Authenticator, H: 'a + HttpHandler> {
_client: &'a TwitterClient<A, H>,
user_id: Option<i64>,
screen_name: Option<Cow<'a, str>>,
include_ext_alt_text: Option<bool>,
tweet_mode: Option<TweetMode>,
}
impl<'a, A: Authenticator, H: HttpHandler> FriendshipsDestroyRequestBuilder<'a, A, H> {
pub fn user_id(&'a mut self, val: i64) -> &'a mut Self {
self.user_id = Some(val);
self
}
pub fn screen_name<T1: Into<Cow<'a, str>>>(&'a mut self, val: T1) -> &'a mut Self {
self.screen_name = Some(val.into());
self
}
pub fn include_ext_alt_text(&'a mut self, val: bool) -> &'a mut Self {
self.include_ext_alt_text = Some(val);
self
}
pub fn tweet_mode(&'a mut self, val: TweetMode) -> &'a mut Self {
self.tweet_mode = Some(val);
self
}
pub fn execute(&'a mut self) -> TwitterResult<User> {
let mut params = Vec::with_capacity(4);
if let Some(ref mut x) = self.user_id { params.push((Cow::Borrowed("user_id"), x.to_parameter_value())) }
if let Some(ref mut x) = self.screen_name { params.push((Cow::Borrowed("screen_name"), x.to_parameter_value())) }
if let Some(ref mut x) = self.include_ext_alt_text { params.push((Cow::Borrowed("include_ext_alt_text"), x.to_parameter_value())) }
if let Some(ref mut x) = self.tweet_mode { params.push((Cow::Borrowed("tweet_mode"), x.to_parameter_value())) }
let url = "https://api.twitter.com/1.1/friendships/destroy.json";
execute_core(self._client, Post, url, params)
}
}
pub struct FriendshipsUpdateRequestBuilder<'a, A: 'a + Authenticator, H: 'a + HttpHandler> {
_client: &'a TwitterClient<A, H>,
user_id: Option<i64>,
screen_name: Option<Cow<'a, str>>,
device: Option<bool>,
retweets: Option<bool>,
}
impl<'a, A: Authenticator, H: HttpHandler> FriendshipsUpdateRequestBuilder<'a, A, H> {
pub fn user_id(&'a mut self, val: i64) -> &'a mut Self {
self.user_id = Some(val);
self
}
pub fn screen_name<T1: Into<Cow<'a, str>>>(&'a mut self, val: T1) -> &'a mut Self {
self.screen_name = Some(val.into());
self
}
pub fn device(&'a mut self, val: bool) -> &'a mut Self {
self.device = Some(val);
self
}
pub fn retweets(&'a mut self, val: bool) -> &'a mut Self {
self.retweets = Some(val);
self
}
pub fn execute(&'a mut self) -> TwitterResult<FriendshipResponse> {
let mut params = Vec::with_capacity(4);
if let Some(ref mut x) = self.user_id { params.push((Cow::Borrowed("user_id"), x.to_parameter_value())) }
if let Some(ref mut x) = self.screen_name { params.push((Cow::Borrowed("screen_name"), x.to_parameter_value())) }
if let Some(ref mut x) = self.device { params.push((Cow::Borrowed("device"), x.to_parameter_value())) }
if let Some(ref mut x) = self.retweets { params.push((Cow::Borrowed("retweets"), x.to_parameter_value())) }
let url = "https://api.twitter.com/1.1/friendships/update.json";
execute_core(self._client, Post, url, params)
}
}
#[derive(Clone, Debug)]
pub struct ListsClient<'a, A: 'a + Authenticator, H: 'a + HttpHandler> {
client: &'a TwitterClient<A, H>
}
impl<'a, A: Authenticator, H: HttpHandler> ListsClient<'a, A, H> {
pub fn list(&self) -> ListsListRequestBuilder<'a, A, H> {
ListsListRequestBuilder {
_client: self.client,
user_id: None,
screen_name: None,
reverse: None,
}
}
pub fn memberships(&self) -> ListsMembershipsRequestBuilder<'a, A, H> {
ListsMembershipsRequestBuilder {
_client: self.client,
user_id: None,
screen_name: None,
count: None,
cursor: None,
filter_to_owned_lists: None,
}
}
pub fn ownerships(&self) -> ListsOwnershipsRequestBuilder<'a, A, H> {
ListsOwnershipsRequestBuilder {
_client: self.client,
user_id: None,
screen_name: None,
count: None,
cursor: None,
}
}
pub fn show(&self) -> ListsShowRequestBuilder<'a, A, H> {
ListsShowRequestBuilder {
_client: self.client,
list_id: None,
slug: None,
owner_screen_name: None,
owner_id: None,
}
}
pub fn subscriptions(&self) -> ListsSubscriptionsRequestBuilder<'a, A, H> {
ListsSubscriptionsRequestBuilder {
_client: self.client,
user_id: None,
screen_name: None,
count: None,
cursor: None,
}
}
pub fn statuses(&self) -> ListsStatusesRequestBuilder<'a, A, H> {
ListsStatusesRequestBuilder {
_client: self.client,
list_id: None,
slug: None,
owner_screen_name: None,
owner_id: None,
since_id: None,
max_id: None,
count: None,
include_entities: None,
include_rts: None,
include_ext_alt_text: None,
tweet_mode: None,
}
}
pub fn create<T1: Into<Cow<'a, str>>>(&self, name: T1) -> ListsCreateRequestBuilder<'a, A, H> {
ListsCreateRequestBuilder {
_client: self.client,
name: name.into(),
mode: None,
description: None,
}
}
pub fn destroy(&self) -> ListsDestroyRequestBuilder<'a, A, H> {
ListsDestroyRequestBuilder {
_client: self.client,
list_id: None,
slug: None,
owner_screen_name: None,
owner_id: None,
}
}
pub fn update(&self) -> ListsUpdateRequestBuilder<'a, A, H> {
ListsUpdateRequestBuilder {
_client: self.client,
list_id: None,
slug: None,
owner_screen_name: None,
owner_id: None,
name: None,
mode: None,
description: None,
}
}
}
pub struct ListsListRequestBuilder<'a, A: 'a + Authenticator, H: 'a + HttpHandler> {
_client: &'a TwitterClient<A, H>,
user_id: Option<i64>,
screen_name: Option<Cow<'a, str>>,
reverse: Option<bool>,
}
impl<'a, A: Authenticator, H: HttpHandler> ListsListRequestBuilder<'a, A, H> {
pub fn user_id(&'a mut self, val: i64) -> &'a mut Self {
self.user_id = Some(val);
self
}
pub fn screen_name<T1: Into<Cow<'a, str>>>(&'a mut self, val: T1) -> &'a mut Self {
self.screen_name = Some(val.into());
self
}
pub fn reverse(&'a mut self, val: bool) -> &'a mut Self {
self.reverse = Some(val);
self
}
pub fn execute(&'a mut self) -> TwitterResult<Vec<List>> {
let mut params = Vec::with_capacity(3);
if let Some(ref mut x) = self.user_id { params.push((Cow::Borrowed("user_id"), x.to_parameter_value())) }
if let Some(ref mut x) = self.screen_name { params.push((Cow::Borrowed("screen_name"), x.to_parameter_value())) }
if let Some(ref mut x) = self.reverse { params.push((Cow::Borrowed("reverse"), x.to_parameter_value())) }
let url = "https://api.twitter.com/1.1/lists/list.json";
execute_core(self._client, Get, url, params)
}
}
pub struct ListsMembershipsRequestBuilder<'a, A: 'a + Authenticator, H: 'a + HttpHandler> {
_client: &'a TwitterClient<A, H>,
user_id: Option<i64>,
screen_name: Option<Cow<'a, str>>,
count: Option<i32>,
cursor: Option<i64>,
filter_to_owned_lists: Option<bool>,
}
impl<'a, A: Authenticator, H: HttpHandler> ListsMembershipsRequestBuilder<'a, A, H> {
pub fn user_id(&'a mut self, val: i64) -> &'a mut Self {
self.user_id = Some(val);
self
}
pub fn screen_name<T1: Into<Cow<'a, str>>>(&'a mut self, val: T1) -> &'a mut Self {
self.screen_name = Some(val.into());
self
}
pub fn count(&'a mut self, val: i32) -> &'a mut Self {
self.count = Some(val);
self
}
pub fn cursor(&'a mut self, val: i64) -> &'a mut Self {
self.cursor = Some(val);
self
}
pub fn filter_to_owned_lists(&'a mut self, val: bool) -> &'a mut Self {
self.filter_to_owned_lists = Some(val);
self
}
pub fn execute(&'a mut self) -> TwitterResult<CursorLists> {
let mut params = Vec::with_capacity(5);
if let Some(ref mut x) = self.user_id { params.push((Cow::Borrowed("user_id"), x.to_parameter_value())) }
if let Some(ref mut x) = self.screen_name { params.push((Cow::Borrowed("screen_name"), x.to_parameter_value())) }
if let Some(ref mut x) = self.count { params.push((Cow::Borrowed("count"), x.to_parameter_value())) }
if let Some(ref mut x) = self.cursor { params.push((Cow::Borrowed("cursor"), x.to_parameter_value())) }
if let Some(ref mut x) = self.filter_to_owned_lists { params.push((Cow::Borrowed("filter_to_owned_lists"), x.to_parameter_value())) }
let url = "https://api.twitter.com/1.1/lists/memberships.json";
execute_core(self._client, Get, url, params)
}
}
pub struct ListsOwnershipsRequestBuilder<'a, A: 'a + Authenticator, H: 'a + HttpHandler> {
_client: &'a TwitterClient<A, H>,
user_id: Option<i64>,
screen_name: Option<Cow<'a, str>>,
count: Option<i32>,
cursor: Option<i64>,
}
impl<'a, A: Authenticator, H: HttpHandler> ListsOwnershipsRequestBuilder<'a, A, H> {
pub fn user_id(&'a mut self, val: i64) -> &'a mut Self {
self.user_id = Some(val);
self
}
pub fn screen_name<T1: Into<Cow<'a, str>>>(&'a mut self, val: T1) -> &'a mut Self {
self.screen_name = Some(val.into());
self
}
pub fn count(&'a mut self, val: i32) -> &'a mut Self {
self.count = Some(val);
self
}
pub fn cursor(&'a mut self, val: i64) -> &'a mut Self {
self.cursor = Some(val);
self
}
pub fn execute(&'a mut self) -> TwitterResult<CursorLists> {
let mut params = Vec::with_capacity(4);
if let Some(ref mut x) = self.user_id { params.push((Cow::Borrowed("user_id"), x.to_parameter_value())) }
if let Some(ref mut x) = self.screen_name { params.push((Cow::Borrowed("screen_name"), x.to_parameter_value())) }
if let Some(ref mut x) = self.count { params.push((Cow::Borrowed("count"), x.to_parameter_value())) }
if let Some(ref mut x) = self.cursor { params.push((Cow::Borrowed("cursor"), x.to_parameter_value())) }
let url = "https://api.twitter.com/1.1/lists/ownerships.json";
execute_core(self._client, Get, url, params)
}
}
pub struct ListsShowRequestBuilder<'a, A: 'a + Authenticator, H: 'a + HttpHandler> {
_client: &'a TwitterClient<A, H>,
list_id: Option<i64>,
slug: Option<Cow<'a, str>>,
owner_screen_name: Option<Cow<'a, str>>,
owner_id: Option<i64>,
}
impl<'a, A: Authenticator, H: HttpHandler> ListsShowRequestBuilder<'a, A, H> {
pub fn list_id(&'a mut self, val: i64) -> &'a mut Self {
self.list_id = Some(val);
self
}
pub fn slug<T1: Into<Cow<'a, str>>>(&'a mut self, val: T1) -> &'a mut Self {
self.slug = Some(val.into());
self
}
pub fn owner_screen_name<T1: Into<Cow<'a, str>>>(&'a mut self, val: T1) -> &'a mut Self {
self.owner_screen_name = Some(val.into());
self
}
pub fn owner_id(&'a mut self, val: i64) -> &'a mut Self {
self.owner_id = Some(val);
self
}
pub fn execute(&'a mut self) -> TwitterResult<List> {
let mut params = Vec::with_capacity(4);
if let Some(ref mut x) = self.list_id { params.push((Cow::Borrowed("list_id"), x.to_parameter_value())) }
if let Some(ref mut x) = self.slug { params.push((Cow::Borrowed("slug"), x.to_parameter_value())) }
if let Some(ref mut x) = self.owner_screen_name { params.push((Cow::Borrowed("owner_screen_name"), x.to_parameter_value())) }
if let Some(ref mut x) = self.owner_id { params.push((Cow::Borrowed("owner_id"), x.to_parameter_value())) }
let url = "https://api.twitter.com/1.1/lists/show.json";
execute_core(self._client, Get, url, params)
}
}
pub struct ListsSubscriptionsRequestBuilder<'a, A: 'a + Authenticator, H: 'a + HttpHandler> {
_client: &'a TwitterClient<A, H>,
user_id: Option<i64>,
screen_name: Option<Cow<'a, str>>,
count: Option<i32>,
cursor: Option<i64>,
}
impl<'a, A: Authenticator, H: HttpHandler> ListsSubscriptionsRequestBuilder<'a, A, H> {
pub fn user_id(&'a mut self, val: i64) -> &'a mut Self {
self.user_id = Some(val);
self
}
pub fn screen_name<T1: Into<Cow<'a, str>>>(&'a mut self, val: T1) -> &'a mut Self {
self.screen_name = Some(val.into());
self
}
pub fn count(&'a mut self, val: i32) -> &'a mut Self {
self.count = Some(val);
self
}
pub fn cursor(&'a mut self, val: i64) -> &'a mut Self {
self.cursor = Some(val);
self
}
pub fn execute(&'a mut self) -> TwitterResult<CursorLists> {
let mut params = Vec::with_capacity(4);
if let Some(ref mut x) = self.user_id { params.push((Cow::Borrowed("user_id"), x.to_parameter_value())) }
if let Some(ref mut x) = self.screen_name { params.push((Cow::Borrowed("screen_name"), x.to_parameter_value())) }
if let Some(ref mut x) = self.count { params.push((Cow::Borrowed("count"), x.to_parameter_value())) }
if let Some(ref mut x) = self.cursor { params.push((Cow::Borrowed("cursor"), x.to_parameter_value())) }
let url = "https://api.twitter.com/1.1/lists/subscriptions.json";
execute_core(self._client, Get, url, params)
}
}
pub struct ListsStatusesRequestBuilder<'a, A: 'a + Authenticator, H: 'a + HttpHandler> {
_client: &'a TwitterClient<A, H>,
list_id: Option<i64>,
slug: Option<Cow<'a, str>>,
owner_screen_name: Option<Cow<'a, str>>,
owner_id: Option<i64>,
since_id: Option<i64>,
max_id: Option<i64>,
count: Option<i32>,
include_entities: Option<bool>,
include_rts: Option<bool>,
include_ext_alt_text: Option<bool>,
tweet_mode: Option<TweetMode>,
}
impl<'a, A: Authenticator, H: HttpHandler> ListsStatusesRequestBuilder<'a, A, H> {
pub fn list_id(&'a mut self, val: i64) -> &'a mut Self {
self.list_id = Some(val);
self
}
pub fn slug<T1: Into<Cow<'a, str>>>(&'a mut self, val: T1) -> &'a mut Self {
self.slug = Some(val.into());
self
}
pub fn owner_screen_name<T1: Into<Cow<'a, str>>>(&'a mut self, val: T1) -> &'a mut Self {
self.owner_screen_name = Some(val.into());
self
}
pub fn owner_id(&'a mut self, val: i64) -> &'a mut Self {
self.owner_id = Some(val);
self
}
pub fn since_id(&'a mut self, val: i64) -> &'a mut Self {
self.since_id = Some(val);
self
}
pub fn max_id(&'a mut self, val: i64) -> &'a mut Self {
self.max_id = Some(val);
self
}
pub fn count(&'a mut self, val: i32) -> &'a mut Self {
self.count = Some(val);
self
}
pub fn include_entities(&'a mut self, val: bool) -> &'a mut Self {
self.include_entities = Some(val);
self
}
pub fn include_rts(&'a mut self, val: bool) -> &'a mut Self {
self.include_rts = Some(val);
self
}
pub fn include_ext_alt_text(&'a mut self, val: bool) -> &'a mut Self {
self.include_ext_alt_text = Some(val);
self
}
pub fn tweet_mode(&'a mut self, val: TweetMode) -> &'a mut Self {
self.tweet_mode = Some(val);
self
}
pub fn execute(&'a mut self) -> TwitterResult<Vec<Tweet>> {
let mut params = Vec::with_capacity(11);
if let Some(ref mut x) = self.list_id { params.push((Cow::Borrowed("list_id"), x.to_parameter_value())) }
if let Some(ref mut x) = self.slug { params.push((Cow::Borrowed("slug"), x.to_parameter_value())) }
if let Some(ref mut x) = self.owner_screen_name { params.push((Cow::Borrowed("owner_screen_name"), x.to_parameter_value())) }
if let Some(ref mut x) = self.owner_id { params.push((Cow::Borrowed("owner_id"), x.to_parameter_value())) }
if let Some(ref mut x) = self.since_id { params.push((Cow::Borrowed("since_id"), x.to_parameter_value())) }
if let Some(ref mut x) = self.max_id { params.push((Cow::Borrowed("max_id"), x.to_parameter_value())) }
if let Some(ref mut x) = self.count { params.push((Cow::Borrowed("count"), x.to_parameter_value())) }
if let Some(ref mut x) = self.include_entities { params.push((Cow::Borrowed("include_entities"), x.to_parameter_value())) }
if let Some(ref mut x) = self.include_rts { params.push((Cow::Borrowed("include_rts"), x.to_parameter_value())) }
if let Some(ref mut x) = self.include_ext_alt_text { params.push((Cow::Borrowed("include_ext_alt_text"), x.to_parameter_value())) }
if let Some(ref mut x) = self.tweet_mode { params.push((Cow::Borrowed("tweet_mode"), x.to_parameter_value())) }
let url = "https://api.twitter.com/1.1/lists/statuses.json";
execute_core(self._client, Get, url, params)
}
}
pub struct ListsCreateRequestBuilder<'a, A: 'a + Authenticator, H: 'a + HttpHandler> {
_client: &'a TwitterClient<A, H>,
name: Cow<'a, str>,
mode: Option<Cow<'a, str>>,
description: Option<Cow<'a, str>>,
}
impl<'a, A: Authenticator, H: HttpHandler> ListsCreateRequestBuilder<'a, A, H> {
pub fn mode<T1: Into<Cow<'a, str>>>(&'a mut self, val: T1) -> &'a mut Self {
self.mode = Some(val.into());
self
}
pub fn description<T1: Into<Cow<'a, str>>>(&'a mut self, val: T1) -> &'a mut Self {
self.description = Some(val.into());
self
}
pub fn execute(&'a mut self) -> TwitterResult<List> {
let mut params = Vec::with_capacity(3);
params.push((Cow::Borrowed("name"), self.name.to_parameter_value()));
if let Some(ref mut x) = self.mode { params.push((Cow::Borrowed("mode"), x.to_parameter_value())) }
if let Some(ref mut x) = self.description { params.push((Cow::Borrowed("description"), x.to_parameter_value())) }
let url = "https://api.twitter.com/1.1/lists/create.json";
execute_core(self._client, Post, url, params)
}
}
pub struct ListsDestroyRequestBuilder<'a, A: 'a + Authenticator, H: 'a + HttpHandler> {
_client: &'a TwitterClient<A, H>,
list_id: Option<i64>,
slug: Option<Cow<'a, str>>,
owner_screen_name: Option<Cow<'a, str>>,
owner_id: Option<i64>,
}
impl<'a, A: Authenticator, H: HttpHandler> ListsDestroyRequestBuilder<'a, A, H> {
pub fn list_id(&'a mut self, val: i64) -> &'a mut Self {
self.list_id = Some(val);
self
}
pub fn slug<T1: Into<Cow<'a, str>>>(&'a mut self, val: T1) -> &'a mut Self {
self.slug = Some(val.into());
self
}
pub fn owner_screen_name<T1: Into<Cow<'a, str>>>(&'a mut self, val: T1) -> &'a mut Self {
self.owner_screen_name = Some(val.into());
self
}
pub fn owner_id(&'a mut self, val: i64) -> &'a mut Self {
self.owner_id = Some(val);
self
}
pub fn execute(&'a mut self) -> TwitterResult<List> {
let mut params = Vec::with_capacity(4);
if let Some(ref mut x) = self.list_id { params.push((Cow::Borrowed("list_id"), x.to_parameter_value())) }
if let Some(ref mut x) = self.slug { params.push((Cow::Borrowed("slug"), x.to_parameter_value())) }
if let Some(ref mut x) = self.owner_screen_name { params.push((Cow::Borrowed("owner_screen_name"), x.to_parameter_value())) }
if let Some(ref mut x) = self.owner_id { params.push((Cow::Borrowed("owner_id"), x.to_parameter_value())) }
let url = "https://api.twitter.com/1.1/lists/destroy.json";
execute_core(self._client, Post, url, params)
}
}
pub struct ListsUpdateRequestBuilder<'a, A: 'a + Authenticator, H: 'a + HttpHandler> {
_client: &'a TwitterClient<A, H>,
list_id: Option<i64>,
slug: Option<Cow<'a, str>>,
owner_screen_name: Option<Cow<'a, str>>,
owner_id: Option<i64>,
name: Option<Cow<'a, str>>,
mode: Option<Cow<'a, str>>,
description: Option<Cow<'a, str>>,
}
impl<'a, A: Authenticator, H: HttpHandler> ListsUpdateRequestBuilder<'a, A, H> {
pub fn list_id(&'a mut self, val: i64) -> &'a mut Self {
self.list_id = Some(val);
self
}
pub fn slug<T1: Into<Cow<'a, str>>>(&'a mut self, val: T1) -> &'a mut Self {
self.slug = Some(val.into());
self
}
pub fn owner_screen_name<T1: Into<Cow<'a, str>>>(&'a mut self, val: T1) -> &'a mut Self {
self.owner_screen_name = Some(val.into());
self
}
pub fn owner_id(&'a mut self, val: i64) -> &'a mut Self {
self.owner_id = Some(val);
self
}
pub fn name<T1: Into<Cow<'a, str>>>(&'a mut self, val: T1) -> &'a mut Self {
self.name = Some(val.into());
self
}
pub fn mode<T1: Into<Cow<'a, str>>>(&'a mut self, val: T1) -> &'a mut Self {
self.mode = Some(val.into());
self
}
pub fn description<T1: Into<Cow<'a, str>>>(&'a mut self, val: T1) -> &'a mut Self {
self.description = Some(val.into());
self
}
pub fn execute(&'a mut self) -> TwitterResult<List> {
let mut params = Vec::with_capacity(7);
if let Some(ref mut x) = self.list_id { params.push((Cow::Borrowed("list_id"), x.to_parameter_value())) }
if let Some(ref mut x) = self.slug { params.push((Cow::Borrowed("slug"), x.to_parameter_value())) }
if let Some(ref mut x) = self.owner_screen_name { params.push((Cow::Borrowed("owner_screen_name"), x.to_parameter_value())) }
if let Some(ref mut x) = self.owner_id { params.push((Cow::Borrowed("owner_id"), x.to_parameter_value())) }
if let Some(ref mut x) = self.name { params.push((Cow::Borrowed("name"), x.to_parameter_value())) }
if let Some(ref mut x) = self.mode { params.push((Cow::Borrowed("mode"), x.to_parameter_value())) }
if let Some(ref mut x) = self.description { params.push((Cow::Borrowed("description"), x.to_parameter_value())) }
let url = "https://api.twitter.com/1.1/lists/update.json";
execute_core(self._client, Post, url, params)
}
}
#[derive(Clone, Debug)]
pub struct BlocksClient<'a, A: 'a + Authenticator, H: 'a + HttpHandler> {
client: &'a TwitterClient<A, H>
}
impl<'a, A: Authenticator, H: HttpHandler> BlocksClient<'a, A, H> {
pub fn ids(&self) -> BlocksIdsRequestBuilder<'a, A, H> {
BlocksIdsRequestBuilder {
_client: self.client,
cursor: None,
}
}
pub fn list(&self) -> BlocksListRequestBuilder<'a, A, H> {
BlocksListRequestBuilder {
_client: self.client,
cursor: None,
include_entities: None,
skip_status: None,
include_ext_alt_text: None,
tweet_mode: None,
}
}
pub fn create(&self) -> BlocksCreateRequestBuilder<'a, A, H> {
BlocksCreateRequestBuilder {
_client: self.client,
screen_name: None,
user_id: None,
include_entities: None,
skip_status: None,
include_ext_alt_text: None,
tweet_mode: None,
}
}
pub fn destroy(&self) -> BlocksDestroyRequestBuilder<'a, A, H> {
BlocksDestroyRequestBuilder {
_client: self.client,
screen_name: None,
user_id: None,
include_entities: None,
skip_status: None,
include_ext_alt_text: None,
tweet_mode: None,
}
}
}
pub struct BlocksIdsRequestBuilder<'a, A: 'a + Authenticator, H: 'a + HttpHandler> {
_client: &'a TwitterClient<A, H>,
cursor: Option<i64>,
}
impl<'a, A: Authenticator, H: HttpHandler> BlocksIdsRequestBuilder<'a, A, H> {
pub fn cursor(&'a mut self, val: i64) -> &'a mut Self {
self.cursor = Some(val);
self
}
pub fn execute(&'a mut self) -> TwitterResult<CursorIds> {
let mut params = Vec::with_capacity(1);
if let Some(ref mut x) = self.cursor { params.push((Cow::Borrowed("cursor"), x.to_parameter_value())) }
let url = "https://api.twitter.com/1.1/blocks/ids.json";
execute_core(self._client, Get, url, params)
}
}
pub struct BlocksListRequestBuilder<'a, A: 'a + Authenticator, H: 'a + HttpHandler> {
_client: &'a TwitterClient<A, H>,
cursor: Option<i64>,
include_entities: Option<bool>,
skip_status: Option<bool>,
include_ext_alt_text: Option<bool>,
tweet_mode: Option<TweetMode>,
}
impl<'a, A: Authenticator, H: HttpHandler> BlocksListRequestBuilder<'a, A, H> {
pub fn cursor(&'a mut self, val: i64) -> &'a mut Self {
self.cursor = Some(val);
self
}
pub fn include_entities(&'a mut self, val: bool) -> &'a mut Self {
self.include_entities = Some(val);
self
}
pub fn skip_status(&'a mut self, val: bool) -> &'a mut Self {
self.skip_status = Some(val);
self
}
pub fn include_ext_alt_text(&'a mut self, val: bool) -> &'a mut Self {
self.include_ext_alt_text = Some(val);
self
}
pub fn tweet_mode(&'a mut self, val: TweetMode) -> &'a mut Self {
self.tweet_mode = Some(val);
self
}
pub fn execute(&'a mut self) -> TwitterResult<CursorUsers> {
let mut params = Vec::with_capacity(5);
if let Some(ref mut x) = self.cursor { params.push((Cow::Borrowed("cursor"), x.to_parameter_value())) }
if let Some(ref mut x) = self.include_entities { params.push((Cow::Borrowed("include_entities"), x.to_parameter_value())) }
if let Some(ref mut x) = self.skip_status { params.push((Cow::Borrowed("skip_status"), x.to_parameter_value())) }
if let Some(ref mut x) = self.include_ext_alt_text { params.push((Cow::Borrowed("include_ext_alt_text"), x.to_parameter_value())) }
if let Some(ref mut x) = self.tweet_mode { params.push((Cow::Borrowed("tweet_mode"), x.to_parameter_value())) }
let url = "https://api.twitter.com/1.1/blocks/list.json";
execute_core(self._client, Get, url, params)
}
}
pub struct BlocksCreateRequestBuilder<'a, A: 'a + Authenticator, H: 'a + HttpHandler> {
_client: &'a TwitterClient<A, H>,
screen_name: Option<Cow<'a, str>>,
user_id: Option<i64>,
include_entities: Option<bool>,
skip_status: Option<bool>,
include_ext_alt_text: Option<bool>,
tweet_mode: Option<TweetMode>,
}
impl<'a, A: Authenticator, H: HttpHandler> BlocksCreateRequestBuilder<'a, A, H> {
pub fn screen_name<T1: Into<Cow<'a, str>>>(&'a mut self, val: T1) -> &'a mut Self {
self.screen_name = Some(val.into());
self
}
pub fn user_id(&'a mut self, val: i64) -> &'a mut Self {
self.user_id = Some(val);
self
}
pub fn include_entities(&'a mut self, val: bool) -> &'a mut Self {
self.include_entities = Some(val);
self
}
pub fn skip_status(&'a mut self, val: bool) -> &'a mut Self {
self.skip_status = Some(val);
self
}
pub fn include_ext_alt_text(&'a mut self, val: bool) -> &'a mut Self {
self.include_ext_alt_text = Some(val);
self
}
pub fn tweet_mode(&'a mut self, val: TweetMode) -> &'a mut Self {
self.tweet_mode = Some(val);
self
}
pub fn execute(&'a mut self) -> TwitterResult<User> {
let mut params = Vec::with_capacity(6);
if let Some(ref mut x) = self.screen_name { params.push((Cow::Borrowed("screen_name"), x.to_parameter_value())) }
if let Some(ref mut x) = self.user_id { params.push((Cow::Borrowed("user_id"), x.to_parameter_value())) }
if let Some(ref mut x) = self.include_entities { params.push((Cow::Borrowed("include_entities"), x.to_parameter_value())) }
if let Some(ref mut x) = self.skip_status { params.push((Cow::Borrowed("skip_status"), x.to_parameter_value())) }
if let Some(ref mut x) = self.include_ext_alt_text { params.push((Cow::Borrowed("include_ext_alt_text"), x.to_parameter_value())) }
if let Some(ref mut x) = self.tweet_mode { params.push((Cow::Borrowed("tweet_mode"), x.to_parameter_value())) }
let url = "https://api.twitter.com/1.1/blocks/create.json";
execute_core(self._client, Post, url, params)
}
}
pub struct BlocksDestroyRequestBuilder<'a, A: 'a + Authenticator, H: 'a + HttpHandler> {
_client: &'a TwitterClient<A, H>,
screen_name: Option<Cow<'a, str>>,
user_id: Option<i64>,
include_entities: Option<bool>,
skip_status: Option<bool>,
include_ext_alt_text: Option<bool>,
tweet_mode: Option<TweetMode>,
}
impl<'a, A: Authenticator, H: HttpHandler> BlocksDestroyRequestBuilder<'a, A, H> {
pub fn screen_name<T1: Into<Cow<'a, str>>>(&'a mut self, val: T1) -> &'a mut Self {
self.screen_name = Some(val.into());
self
}
pub fn user_id(&'a mut self, val: i64) -> &'a mut Self {
self.user_id = Some(val);
self
}
pub fn include_entities(&'a mut self, val: bool) -> &'a mut Self {
self.include_entities = Some(val);
self
}
pub fn skip_status(&'a mut self, val: bool) -> &'a mut Self {
self.skip_status = Some(val);
self
}
pub fn include_ext_alt_text(&'a mut self, val: bool) -> &'a mut Self {
self.include_ext_alt_text = Some(val);
self
}
pub fn tweet_mode(&'a mut self, val: TweetMode) -> &'a mut Self {
self.tweet_mode = Some(val);
self
}
pub fn execute(&'a mut self) -> TwitterResult<User> {
let mut params = Vec::with_capacity(6);
if let Some(ref mut x) = self.screen_name { params.push((Cow::Borrowed("screen_name"), x.to_parameter_value())) }
if let Some(ref mut x) = self.user_id { params.push((Cow::Borrowed("user_id"), x.to_parameter_value())) }
if let Some(ref mut x) = self.include_entities { params.push((Cow::Borrowed("include_entities"), x.to_parameter_value())) }
if let Some(ref mut x) = self.skip_status { params.push((Cow::Borrowed("skip_status"), x.to_parameter_value())) }
if let Some(ref mut x) = self.include_ext_alt_text { params.push((Cow::Borrowed("include_ext_alt_text"), x.to_parameter_value())) }
if let Some(ref mut x) = self.tweet_mode { params.push((Cow::Borrowed("tweet_mode"), x.to_parameter_value())) }
let url = "https://api.twitter.com/1.1/blocks/destroy.json";
execute_core(self._client, Post, url, params)
}
}
#[derive(Clone, Debug)]
pub struct FriendsClient<'a, A: 'a + Authenticator, H: 'a + HttpHandler> {
client: &'a TwitterClient<A, H>
}
impl<'a, A: Authenticator, H: HttpHandler> FriendsClient<'a, A, H> {
pub fn ids(&self) -> FriendsIdsRequestBuilder<'a, A, H> {
FriendsIdsRequestBuilder {
_client: self.client,
user_id: None,
screen_name: None,
cursor: None,
count: None,
}
}
pub fn list(&self) -> FriendsListRequestBuilder<'a, A, H> {
FriendsListRequestBuilder {
_client: self.client,
user_id: None,
screen_name: None,
cursor: None,
count: None,
skip_status: None,
include_user_entities: None,
include_ext_alt_text: None,
tweet_mode: None,
}
}
}
pub struct FriendsIdsRequestBuilder<'a, A: 'a + Authenticator, H: 'a + HttpHandler> {
_client: &'a TwitterClient<A, H>,
user_id: Option<i64>,
screen_name: Option<Cow<'a, str>>,
cursor: Option<i64>,
count: Option<i32>,
}
impl<'a, A: Authenticator, H: HttpHandler> FriendsIdsRequestBuilder<'a, A, H> {
pub fn user_id(&'a mut self, val: i64) -> &'a mut Self {
self.user_id = Some(val);
self
}
pub fn screen_name<T1: Into<Cow<'a, str>>>(&'a mut self, val: T1) -> &'a mut Self {
self.screen_name = Some(val.into());
self
}
pub fn cursor(&'a mut self, val: i64) -> &'a mut Self {
self.cursor = Some(val);
self
}
pub fn count(&'a mut self, val: i32) -> &'a mut Self {
self.count = Some(val);
self
}
pub fn execute(&'a mut self) -> TwitterResult<CursorIds> {
let mut params = Vec::with_capacity(4);
if let Some(ref mut x) = self.user_id { params.push((Cow::Borrowed("user_id"), x.to_parameter_value())) }
if let Some(ref mut x) = self.screen_name { params.push((Cow::Borrowed("screen_name"), x.to_parameter_value())) }
if let Some(ref mut x) = self.cursor { params.push((Cow::Borrowed("cursor"), x.to_parameter_value())) }
if let Some(ref mut x) = self.count { params.push((Cow::Borrowed("count"), x.to_parameter_value())) }
let url = "https://api.twitter.com/1.1/friends/ids.json";
execute_core(self._client, Get, url, params)
}
}
pub struct FriendsListRequestBuilder<'a, A: 'a + Authenticator, H: 'a + HttpHandler> {
_client: &'a TwitterClient<A, H>,
user_id: Option<i64>,
screen_name: Option<Cow<'a, str>>,
cursor: Option<i64>,
count: Option<i32>,
skip_status: Option<bool>,
include_user_entities: Option<bool>,
include_ext_alt_text: Option<bool>,
tweet_mode: Option<TweetMode>,
}
impl<'a, A: Authenticator, H: HttpHandler> FriendsListRequestBuilder<'a, A, H> {
pub fn user_id(&'a mut self, val: i64) -> &'a mut Self {
self.user_id = Some(val);
self
}
pub fn screen_name<T1: Into<Cow<'a, str>>>(&'a mut self, val: T1) -> &'a mut Self {
self.screen_name = Some(val.into());
self
}
pub fn cursor(&'a mut self, val: i64) -> &'a mut Self {
self.cursor = Some(val);
self
}
pub fn count(&'a mut self, val: i32) -> &'a mut Self {
self.count = Some(val);
self
}
pub fn skip_status(&'a mut self, val: bool) -> &'a mut Self {
self.skip_status = Some(val);
self
}
pub fn include_user_entities(&'a mut self, val: bool) -> &'a mut Self {
self.include_user_entities = Some(val);
self
}
pub fn include_ext_alt_text(&'a mut self, val: bool) -> &'a mut Self {
self.include_ext_alt_text = Some(val);
self
}
pub fn tweet_mode(&'a mut self, val: TweetMode) -> &'a mut Self {
self.tweet_mode = Some(val);
self
}
pub fn execute(&'a mut self) -> TwitterResult<CursorUsers> {
let mut params = Vec::with_capacity(8);
if let Some(ref mut x) = self.user_id { params.push((Cow::Borrowed("user_id"), x.to_parameter_value())) }
if let Some(ref mut x) = self.screen_name { params.push((Cow::Borrowed("screen_name"), x.to_parameter_value())) }
if let Some(ref mut x) = self.cursor { params.push((Cow::Borrowed("cursor"), x.to_parameter_value())) }
if let Some(ref mut x) = self.count { params.push((Cow::Borrowed("count"), x.to_parameter_value())) }
if let Some(ref mut x) = self.skip_status { params.push((Cow::Borrowed("skip_status"), x.to_parameter_value())) }
if let Some(ref mut x) = self.include_user_entities { params.push((Cow::Borrowed("include_user_entities"), x.to_parameter_value())) }
if let Some(ref mut x) = self.include_ext_alt_text { params.push((Cow::Borrowed("include_ext_alt_text"), x.to_parameter_value())) }
if let Some(ref mut x) = self.tweet_mode { params.push((Cow::Borrowed("tweet_mode"), x.to_parameter_value())) }
let url = "https://api.twitter.com/1.1/friends/list.json";
execute_core(self._client, Get, url, params)
}
}
#[derive(Clone, Debug)]
pub struct MutesUsersClient<'a, A: 'a + Authenticator, H: 'a + HttpHandler> {
client: &'a TwitterClient<A, H>
}
impl<'a, A: Authenticator, H: HttpHandler> MutesUsersClient<'a, A, H> {
pub fn ids(&self) -> MutesUsersIdsRequestBuilder<'a, A, H> {
MutesUsersIdsRequestBuilder {
_client: self.client,
cursor: None,
}
}
pub fn list(&self) -> MutesUsersListRequestBuilder<'a, A, H> {
MutesUsersListRequestBuilder {
_client: self.client,
cursor: None,
include_entities: None,
skip_status: None,
include_ext_alt_text: None,
tweet_mode: None,
}
}
pub fn create(&self) -> MutesUsersCreateRequestBuilder<'a, A, H> {
MutesUsersCreateRequestBuilder {
_client: self.client,
screen_name: None,
user_id: None,
include_ext_alt_text: None,
tweet_mode: None,
}
}
pub fn destroy(&self) -> MutesUsersDestroyRequestBuilder<'a, A, H> {
MutesUsersDestroyRequestBuilder {
_client: self.client,
screen_name: None,
user_id: None,
include_ext_alt_text: None,
tweet_mode: None,
}
}
}
pub struct MutesUsersIdsRequestBuilder<'a, A: 'a + Authenticator, H: 'a + HttpHandler> {
_client: &'a TwitterClient<A, H>,
cursor: Option<i64>,
}
impl<'a, A: Authenticator, H: HttpHandler> MutesUsersIdsRequestBuilder<'a, A, H> {
pub fn cursor(&'a mut self, val: i64) -> &'a mut Self {
self.cursor = Some(val);
self
}
pub fn execute(&'a mut self) -> TwitterResult<CursorIds> {
let mut params = Vec::with_capacity(1);
if let Some(ref mut x) = self.cursor { params.push((Cow::Borrowed("cursor"), x.to_parameter_value())) }
let url = "https://api.twitter.com/1.1/mutes/users/ids.json";
execute_core(self._client, Get, url, params)
}
}
pub struct MutesUsersListRequestBuilder<'a, A: 'a + Authenticator, H: 'a + HttpHandler> {
_client: &'a TwitterClient<A, H>,
cursor: Option<i64>,
include_entities: Option<bool>,
skip_status: Option<bool>,
include_ext_alt_text: Option<bool>,
tweet_mode: Option<TweetMode>,
}
impl<'a, A: Authenticator, H: HttpHandler> MutesUsersListRequestBuilder<'a, A, H> {
pub fn cursor(&'a mut self, val: i64) -> &'a mut Self {
self.cursor = Some(val);
self
}
pub fn include_entities(&'a mut self, val: bool) -> &'a mut Self {
self.include_entities = Some(val);
self
}
pub fn skip_status(&'a mut self, val: bool) -> &'a mut Self {
self.skip_status = Some(val);
self
}
pub fn include_ext_alt_text(&'a mut self, val: bool) -> &'a mut Self {
self.include_ext_alt_text = Some(val);
self
}
pub fn tweet_mode(&'a mut self, val: TweetMode) -> &'a mut Self {
self.tweet_mode = Some(val);
self
}
pub fn execute(&'a mut self) -> TwitterResult<CursorUsers> {
let mut params = Vec::with_capacity(5);
if let Some(ref mut x) = self.cursor { params.push((Cow::Borrowed("cursor"), x.to_parameter_value())) }
if let Some(ref mut x) = self.include_entities { params.push((Cow::Borrowed("include_entities"), x.to_parameter_value())) }
if let Some(ref mut x) = self.skip_status { params.push((Cow::Borrowed("skip_status"), x.to_parameter_value())) }
if let Some(ref mut x) = self.include_ext_alt_text { params.push((Cow::Borrowed("include_ext_alt_text"), x.to_parameter_value())) }
if let Some(ref mut x) = self.tweet_mode { params.push((Cow::Borrowed("tweet_mode"), x.to_parameter_value())) }
let url = "https://api.twitter.com/1.1/mutes/users/list.json";
execute_core(self._client, Get, url, params)
}
}
pub struct MutesUsersCreateRequestBuilder<'a, A: 'a + Authenticator, H: 'a + HttpHandler> {
_client: &'a TwitterClient<A, H>,
screen_name: Option<Cow<'a, str>>,
user_id: Option<i64>,
include_ext_alt_text: Option<bool>,
tweet_mode: Option<TweetMode>,
}
impl<'a, A: Authenticator, H: HttpHandler> MutesUsersCreateRequestBuilder<'a, A, H> {
pub fn screen_name<T1: Into<Cow<'a, str>>>(&'a mut self, val: T1) -> &'a mut Self {
self.screen_name = Some(val.into());
self
}
pub fn user_id(&'a mut self, val: i64) -> &'a mut Self {
self.user_id = Some(val);
self
}
pub fn include_ext_alt_text(&'a mut self, val: bool) -> &'a mut Self {
self.include_ext_alt_text = Some(val);
self
}
pub fn tweet_mode(&'a mut self, val: TweetMode) -> &'a mut Self {
self.tweet_mode = Some(val);
self
}
pub fn execute(&'a mut self) -> TwitterResult<User> {
let mut params = Vec::with_capacity(4);
if let Some(ref mut x) = self.screen_name { params.push((Cow::Borrowed("screen_name"), x.to_parameter_value())) }
if let Some(ref mut x) = self.user_id { params.push((Cow::Borrowed("user_id"), x.to_parameter_value())) }
if let Some(ref mut x) = self.include_ext_alt_text { params.push((Cow::Borrowed("include_ext_alt_text"), x.to_parameter_value())) }
if let Some(ref mut x) = self.tweet_mode { params.push((Cow::Borrowed("tweet_mode"), x.to_parameter_value())) }
let url = "https://api.twitter.com/1.1/mutes/users/create.json";
execute_core(self._client, Post, url, params)
}
}
pub struct MutesUsersDestroyRequestBuilder<'a, A: 'a + Authenticator, H: 'a + HttpHandler> {
_client: &'a TwitterClient<A, H>,
screen_name: Option<Cow<'a, str>>,
user_id: Option<i64>,
include_ext_alt_text: Option<bool>,
tweet_mode: Option<TweetMode>,
}
impl<'a, A: Authenticator, H: HttpHandler> MutesUsersDestroyRequestBuilder<'a, A, H> {
pub fn screen_name<T1: Into<Cow<'a, str>>>(&'a mut self, val: T1) -> &'a mut Self {
self.screen_name = Some(val.into());
self
}
pub fn user_id(&'a mut self, val: i64) -> &'a mut Self {
self.user_id = Some(val);
self
}
pub fn include_ext_alt_text(&'a mut self, val: bool) -> &'a mut Self {
self.include_ext_alt_text = Some(val);
self
}
pub fn tweet_mode(&'a mut self, val: TweetMode) -> &'a mut Self {
self.tweet_mode = Some(val);
self
}
pub fn execute(&'a mut self) -> TwitterResult<User> {
let mut params = Vec::with_capacity(4);
if let Some(ref mut x) = self.screen_name { params.push((Cow::Borrowed("screen_name"), x.to_parameter_value())) }
if let Some(ref mut x) = self.user_id { params.push((Cow::Borrowed("user_id"), x.to_parameter_value())) }
if let Some(ref mut x) = self.include_ext_alt_text { params.push((Cow::Borrowed("include_ext_alt_text"), x.to_parameter_value())) }
if let Some(ref mut x) = self.tweet_mode { params.push((Cow::Borrowed("tweet_mode"), x.to_parameter_value())) }
let url = "https://api.twitter.com/1.1/mutes/users/destroy.json";
execute_core(self._client, Post, url, params)
}
}
#[derive(Clone, Debug)]
pub struct MediaClient<'a, A: 'a + Authenticator, H: 'a + HttpHandler> {
client: &'a TwitterClient<A, H>
}
impl<'a, A: Authenticator, H: HttpHandler> MediaClient<'a, A, H> {
pub fn upload(&self) -> MediaUploadRequestBuilder<'a, A, H> {
MediaUploadRequestBuilder {
_client: self.client,
media: None,
media_data: None,
additional_owners: None,
}
}
pub fn upload_init_command<T1: Into<Cow<'a, str>>>(&self, total_bytes: u64, media_type: T1) -> MediaUploadInitCommandRequestBuilder<'a, A, H> {
MediaUploadInitCommandRequestBuilder {
_client: self.client,
total_bytes: total_bytes,
media_type: media_type.into(),
additional_owners: None,
media_category: None,
}
}
pub fn upload_append_command(&self, media_id: i64, segment_index: i32) -> MediaUploadAppendCommandRequestBuilder<'a, A, H> {
MediaUploadAppendCommandRequestBuilder {
_client: self.client,
media_id: media_id,
segment_index: segment_index,
media: None,
media_data: None,
}
}
pub fn upload_finalize_command(&self, media_id: i64) -> MediaUploadFinalizeCommandRequestBuilder<'a, A, H> {
MediaUploadFinalizeCommandRequestBuilder {
_client: self.client,
media_id: media_id,
}
}
pub fn upload_status_command(&self, media_id: i64) -> MediaUploadStatusCommandRequestBuilder<'a, A, H> {
MediaUploadStatusCommandRequestBuilder {
_client: self.client,
media_id: media_id,
}
}
}
pub struct MediaUploadRequestBuilder<'a, A: 'a + Authenticator, H: 'a + HttpHandler> {
_client: &'a TwitterClient<A, H>,
media: Option<&'a mut Read>,
media_data: Option<Cow<'a, str>>,
additional_owners: Option<String>,
}
impl<'a, A: Authenticator, H: HttpHandler> MediaUploadRequestBuilder<'a, A, H> {
pub fn media(&'a mut self, val: &'a mut Read) -> &'a mut Self {
self.media = Some(val);
self
}
pub fn media_data<T1: Into<Cow<'a, str>>>(&'a mut self, val: T1) -> &'a mut Self {
self.media_data = Some(val.into());
self
}
pub fn additional_owners<T1: IntoIterator<Item = i64>>(&'a mut self, val: T1) -> &'a mut Self {
self.additional_owners = Some(collection_paramter(val));
self
}
pub fn execute(&'a mut self) -> TwitterResult<MediaUploadResponse> {
let mut params = Vec::with_capacity(3);
if let Some(ref mut x) = self.media { params.push((Cow::Borrowed("media"), x.to_parameter_value())) }
if let Some(ref mut x) = self.media_data { params.push((Cow::Borrowed("media_data"), x.to_parameter_value())) }
if let Some(ref mut x) = self.additional_owners { params.push((Cow::Borrowed("additional_owners"), x.to_parameter_value())) }
impls::media_upload(self._client, params)
}
}
pub struct MediaUploadInitCommandRequestBuilder<'a, A: 'a + Authenticator, H: 'a + HttpHandler> {
_client: &'a TwitterClient<A, H>,
total_bytes: u64,
media_type: Cow<'a, str>,
additional_owners: Option<String>,
media_category: Option<Cow<'a, str>>,
}
impl<'a, A: Authenticator, H: HttpHandler> MediaUploadInitCommandRequestBuilder<'a, A, H> {
pub fn additional_owners<T1: IntoIterator<Item = i64>>(&'a mut self, val: T1) -> &'a mut Self {
self.additional_owners = Some(collection_paramter(val));
self
}
pub fn media_category<T1: Into<Cow<'a, str>>>(&'a mut self, val: T1) -> &'a mut Self {
self.media_category = Some(val.into());
self
}
pub fn execute(&'a mut self) -> TwitterResult<UploadInitCommandResponse> {
let mut params = Vec::with_capacity(4);
params.push((Cow::Borrowed("total_bytes"), self.total_bytes.to_parameter_value()));
params.push((Cow::Borrowed("media_type"), self.media_type.to_parameter_value()));
if let Some(ref mut x) = self.additional_owners { params.push((Cow::Borrowed("additional_owners"), x.to_parameter_value())) }
if let Some(ref mut x) = self.media_category { params.push((Cow::Borrowed("media_category"), x.to_parameter_value())) }
impls::media_upload_init_command(self._client, params)
}
}
pub struct MediaUploadAppendCommandRequestBuilder<'a, A: 'a + Authenticator, H: 'a + HttpHandler> {
_client: &'a TwitterClient<A, H>,
media_id: i64,
segment_index: i32,
media: Option<&'a mut Read>,
media_data: Option<Cow<'a, str>>,
}
impl<'a, A: Authenticator, H: HttpHandler> MediaUploadAppendCommandRequestBuilder<'a, A, H> {
pub fn media(&'a mut self, val: &'a mut Read) -> &'a mut Self {
self.media = Some(val);
self
}
pub fn media_data<T1: Into<Cow<'a, str>>>(&'a mut self, val: T1) -> &'a mut Self {
self.media_data = Some(val.into());
self
}
pub fn execute(&'a mut self) -> TwitterResult<()> {
let mut params = Vec::with_capacity(4);
params.push((Cow::Borrowed("media_id"), self.media_id.to_parameter_value()));
params.push((Cow::Borrowed("segment_index"), self.segment_index.to_parameter_value()));
if let Some(ref mut x) = self.media { params.push((Cow::Borrowed("media"), x.to_parameter_value())) }
if let Some(ref mut x) = self.media_data { params.push((Cow::Borrowed("media_data"), x.to_parameter_value())) }
impls::media_upload_append_command(self._client, params)
}
}
pub struct MediaUploadFinalizeCommandRequestBuilder<'a, A: 'a + Authenticator, H: 'a + HttpHandler> {
_client: &'a TwitterClient<A, H>,
media_id: i64,
}
impl<'a, A: Authenticator, H: HttpHandler> MediaUploadFinalizeCommandRequestBuilder<'a, A, H> {
pub fn execute(&'a mut self) -> TwitterResult<UploadFinalizeCommandResponse> {
let mut params = Vec::with_capacity(1);
params.push((Cow::Borrowed("media_id"), self.media_id.to_parameter_value()));
impls::media_upload_finalize_command(self._client, params)
}
}
pub struct MediaUploadStatusCommandRequestBuilder<'a, A: 'a + Authenticator, H: 'a + HttpHandler> {
_client: &'a TwitterClient<A, H>,
media_id: i64,
}
impl<'a, A: Authenticator, H: HttpHandler> MediaUploadStatusCommandRequestBuilder<'a, A, H> {
pub fn execute(&'a mut self) -> TwitterResult<UploadStatusCommandResponse> {
let mut params = Vec::with_capacity(1);
params.push((Cow::Borrowed("media_id"), self.media_id.to_parameter_value()));
impls::media_upload_status_command(self._client, params)
}
}
#[derive(Clone, Debug)]
pub struct DirectMessagesClient<'a, A: 'a + Authenticator, H: 'a + HttpHandler> {
client: &'a TwitterClient<A, H>
}
impl<'a, A: Authenticator, H: HttpHandler> DirectMessagesClient<'a, A, H> {
pub fn received(&self) -> DirectMessagesReceivedRequestBuilder<'a, A, H> {
DirectMessagesReceivedRequestBuilder {
_client: self.client,
since_id: None,
max_id: None,
count: None,
page: None,
full_text: None,
include_entities: None,
}
}
pub fn sent(&self) -> DirectMessagesSentRequestBuilder<'a, A, H> {
DirectMessagesSentRequestBuilder {
_client: self.client,
since_id: None,
max_id: None,
count: None,
page: None,
full_text: None,
include_entities: None,
}
}
pub fn show(&self, id: i64) -> DirectMessagesShowRequestBuilder<'a, A, H> {
DirectMessagesShowRequestBuilder {
_client: self.client,
id: id,
full_text: None,
}
}
pub fn new<T1: Into<Cow<'a, str>>>(&self, text: T1) -> DirectMessagesNewRequestBuilder<'a, A, H> {
DirectMessagesNewRequestBuilder {
_client: self.client,
text: text.into(),
user_id: None,
screen_name: None,
}
}
pub fn destroy(&self, id: i64) -> DirectMessagesDestroyRequestBuilder<'a, A, H> {
DirectMessagesDestroyRequestBuilder {
_client: self.client,
id: id,
include_entities: None,
}
}
}
pub struct DirectMessagesReceivedRequestBuilder<'a, A: 'a + Authenticator, H: 'a + HttpHandler> {
_client: &'a TwitterClient<A, H>,
since_id: Option<i64>,
max_id: Option<i64>,
count: Option<i32>,
page: Option<i32>,
full_text: Option<bool>,
include_entities: Option<bool>,
}
impl<'a, A: Authenticator, H: HttpHandler> DirectMessagesReceivedRequestBuilder<'a, A, H> {
pub fn since_id(&'a mut self, val: i64) -> &'a mut Self {
self.since_id = Some(val);
self
}
pub fn max_id(&'a mut self, val: i64) -> &'a mut Self {
self.max_id = Some(val);
self
}
pub fn count(&'a mut self, val: i32) -> &'a mut Self {
self.count = Some(val);
self
}
pub fn page(&'a mut self, val: i32) -> &'a mut Self {
self.page = Some(val);
self
}
pub fn full_text(&'a mut self, val: bool) -> &'a mut Self {
self.full_text = Some(val);
self
}
pub fn include_entities(&'a mut self, val: bool) -> &'a mut Self {
self.include_entities = Some(val);
self
}
pub fn execute(&'a mut self) -> TwitterResult<Vec<DirectMessage>> {
let mut params = Vec::with_capacity(6);
if let Some(ref mut x) = self.since_id { params.push((Cow::Borrowed("since_id"), x.to_parameter_value())) }
if let Some(ref mut x) = self.max_id { params.push((Cow::Borrowed("max_id"), x.to_parameter_value())) }
if let Some(ref mut x) = self.count { params.push((Cow::Borrowed("count"), x.to_parameter_value())) }
if let Some(ref mut x) = self.page { params.push((Cow::Borrowed("page"), x.to_parameter_value())) }
if let Some(ref mut x) = self.full_text { params.push((Cow::Borrowed("full_text"), x.to_parameter_value())) }
if let Some(ref mut x) = self.include_entities { params.push((Cow::Borrowed("include_entities"), x.to_parameter_value())) }
let url = "https://api.twitter.com/1.1/direct_messages.json";
execute_core(self._client, Get, url, params)
}
}
pub struct DirectMessagesSentRequestBuilder<'a, A: 'a + Authenticator, H: 'a + HttpHandler> {
_client: &'a TwitterClient<A, H>,
since_id: Option<i64>,
max_id: Option<i64>,
count: Option<i32>,
page: Option<i32>,
full_text: Option<bool>,
include_entities: Option<bool>,
}
impl<'a, A: Authenticator, H: HttpHandler> DirectMessagesSentRequestBuilder<'a, A, H> {
pub fn since_id(&'a mut self, val: i64) -> &'a mut Self {
self.since_id = Some(val);
self
}
pub fn max_id(&'a mut self, val: i64) -> &'a mut Self {
self.max_id = Some(val);
self
}
pub fn count(&'a mut self, val: i32) -> &'a mut Self {
self.count = Some(val);
self
}
pub fn page(&'a mut self, val: i32) -> &'a mut Self {
self.page = Some(val);
self
}
pub fn full_text(&'a mut self, val: bool) -> &'a mut Self {
self.full_text = Some(val);
self
}
pub fn include_entities(&'a mut self, val: bool) -> &'a mut Self {
self.include_entities = Some(val);
self
}
pub fn execute(&'a mut self) -> TwitterResult<Vec<DirectMessage>> {
let mut params = Vec::with_capacity(6);
if let Some(ref mut x) = self.since_id { params.push((Cow::Borrowed("since_id"), x.to_parameter_value())) }
if let Some(ref mut x) = self.max_id { params.push((Cow::Borrowed("max_id"), x.to_parameter_value())) }
if let Some(ref mut x) = self.count { params.push((Cow::Borrowed("count"), x.to_parameter_value())) }
if let Some(ref mut x) = self.page { params.push((Cow::Borrowed("page"), x.to_parameter_value())) }
if let Some(ref mut x) = self.full_text { params.push((Cow::Borrowed("full_text"), x.to_parameter_value())) }
if let Some(ref mut x) = self.include_entities { params.push((Cow::Borrowed("include_entities"), x.to_parameter_value())) }
let url = "https://api.twitter.com/1.1/direct_messages/sent.json";
execute_core(self._client, Get, url, params)
}
}
pub struct DirectMessagesShowRequestBuilder<'a, A: 'a + Authenticator, H: 'a + HttpHandler> {
_client: &'a TwitterClient<A, H>,
id: i64,
full_text: Option<bool>,
}
impl<'a, A: Authenticator, H: HttpHandler> DirectMessagesShowRequestBuilder<'a, A, H> {
pub fn full_text(&'a mut self, val: bool) -> &'a mut Self {
self.full_text = Some(val);
self
}
pub fn execute(&'a mut self) -> TwitterResult<DirectMessage> {
let mut params = Vec::with_capacity(2);
params.push((Cow::Borrowed("id"), self.id.to_parameter_value()));
if let Some(ref mut x) = self.full_text { params.push((Cow::Borrowed("full_text"), x.to_parameter_value())) }
let url = "https://api.twitter.com/1.1/direct_messages/show.json";
execute_core(self._client, Get, url, params)
}
}
pub struct DirectMessagesNewRequestBuilder<'a, A: 'a + Authenticator, H: 'a + HttpHandler> {
_client: &'a TwitterClient<A, H>,
text: Cow<'a, str>,
user_id: Option<i64>,
screen_name: Option<Cow<'a, str>>,
}
impl<'a, A: Authenticator, H: HttpHandler> DirectMessagesNewRequestBuilder<'a, A, H> {
pub fn user_id(&'a mut self, val: i64) -> &'a mut Self {
self.user_id = Some(val);
self
}
pub fn screen_name<T1: Into<Cow<'a, str>>>(&'a mut self, val: T1) -> &'a mut Self {
self.screen_name = Some(val.into());
self
}
pub fn execute(&'a mut self) -> TwitterResult<DirectMessage> {
let mut params = Vec::with_capacity(3);
params.push((Cow::Borrowed("text"), self.text.to_parameter_value()));
if let Some(ref mut x) = self.user_id { params.push((Cow::Borrowed("user_id"), x.to_parameter_value())) }
if let Some(ref mut x) = self.screen_name { params.push((Cow::Borrowed("screen_name"), x.to_parameter_value())) }
let url = "https://api.twitter.com/1.1/direct_messages/new.json";
execute_core(self._client, Post, url, params)
}
}
pub struct DirectMessagesDestroyRequestBuilder<'a, A: 'a + Authenticator, H: 'a + HttpHandler> {
_client: &'a TwitterClient<A, H>,
id: i64,
include_entities: Option<bool>,
}
impl<'a, A: Authenticator, H: HttpHandler> DirectMessagesDestroyRequestBuilder<'a, A, H> {
pub fn include_entities(&'a mut self, val: bool) -> &'a mut Self {
self.include_entities = Some(val);
self
}
pub fn execute(&'a mut self) -> TwitterResult<DirectMessage> {
let mut params = Vec::with_capacity(2);
params.push((Cow::Borrowed("id"), self.id.to_parameter_value()));
if let Some(ref mut x) = self.include_entities { params.push((Cow::Borrowed("include_entities"), x.to_parameter_value())) }
let url = "https://api.twitter.com/1.1/direct_messages/destroy.json";
execute_core(self._client, Post, url, params)
}
}
#[derive(Clone, Debug)]
pub struct ListsSubscribersClient<'a, A: 'a + Authenticator, H: 'a + HttpHandler> {
client: &'a TwitterClient<A, H>
}
impl<'a, A: Authenticator, H: HttpHandler> ListsSubscribersClient<'a, A, H> {
pub fn list(&self) -> ListsSubscribersListRequestBuilder<'a, A, H> {
ListsSubscribersListRequestBuilder {
_client: self.client,
list_id: None,
slug: None,
owner_screen_name: None,
owner_id: None,
count: None,
cursor: None,
include_entities: None,
skip_status: None,
include_ext_alt_text: None,
tweet_mode: None,
}
}
pub fn show(&self) -> ListsSubscribersShowRequestBuilder<'a, A, H> {
ListsSubscribersShowRequestBuilder {
_client: self.client,
list_id: None,
slug: None,
owner_screen_name: None,
owner_id: None,
user_id: None,
screen_name: None,
include_entities: None,
skip_status: None,
include_ext_alt_text: None,
tweet_mode: None,
}
}
pub fn create(&self) -> ListsSubscribersCreateRequestBuilder<'a, A, H> {
ListsSubscribersCreateRequestBuilder {
_client: self.client,
list_id: None,
slug: None,
owner_screen_name: None,
owner_id: None,
}
}
pub fn destroy(&self) -> ListsSubscribersDestroyRequestBuilder<'a, A, H> {
ListsSubscribersDestroyRequestBuilder {
_client: self.client,
list_id: None,
slug: None,
owner_screen_name: None,
owner_id: None,
}
}
}
pub struct ListsSubscribersListRequestBuilder<'a, A: 'a + Authenticator, H: 'a + HttpHandler> {
_client: &'a TwitterClient<A, H>,
list_id: Option<i64>,
slug: Option<Cow<'a, str>>,
owner_screen_name: Option<Cow<'a, str>>,
owner_id: Option<i64>,
count: Option<i32>,
cursor: Option<i64>,
include_entities: Option<bool>,
skip_status: Option<bool>,
include_ext_alt_text: Option<bool>,
tweet_mode: Option<TweetMode>,
}
impl<'a, A: Authenticator, H: HttpHandler> ListsSubscribersListRequestBuilder<'a, A, H> {
pub fn list_id(&'a mut self, val: i64) -> &'a mut Self {
self.list_id = Some(val);
self
}
pub fn slug<T1: Into<Cow<'a, str>>>(&'a mut self, val: T1) -> &'a mut Self {
self.slug = Some(val.into());
self
}
pub fn owner_screen_name<T1: Into<Cow<'a, str>>>(&'a mut self, val: T1) -> &'a mut Self {
self.owner_screen_name = Some(val.into());
self
}
pub fn owner_id(&'a mut self, val: i64) -> &'a mut Self {
self.owner_id = Some(val);
self
}
pub fn count(&'a mut self, val: i32) -> &'a mut Self {
self.count = Some(val);
self
}
pub fn cursor(&'a mut self, val: i64) -> &'a mut Self {
self.cursor = Some(val);
self
}
pub fn include_entities(&'a mut self, val: bool) -> &'a mut Self {
self.include_entities = Some(val);
self
}
pub fn skip_status(&'a mut self, val: bool) -> &'a mut Self {
self.skip_status = Some(val);
self
}
pub fn include_ext_alt_text(&'a mut self, val: bool) -> &'a mut Self {
self.include_ext_alt_text = Some(val);
self
}
pub fn tweet_mode(&'a mut self, val: TweetMode) -> &'a mut Self {
self.tweet_mode = Some(val);
self
}
pub fn execute(&'a mut self) -> TwitterResult<CursorUsers> {
let mut params = Vec::with_capacity(10);
if let Some(ref mut x) = self.list_id { params.push((Cow::Borrowed("list_id"), x.to_parameter_value())) }
if let Some(ref mut x) = self.slug { params.push((Cow::Borrowed("slug"), x.to_parameter_value())) }
if let Some(ref mut x) = self.owner_screen_name { params.push((Cow::Borrowed("owner_screen_name"), x.to_parameter_value())) }
if let Some(ref mut x) = self.owner_id { params.push((Cow::Borrowed("owner_id"), x.to_parameter_value())) }
if let Some(ref mut x) = self.count { params.push((Cow::Borrowed("count"), x.to_parameter_value())) }
if let Some(ref mut x) = self.cursor { params.push((Cow::Borrowed("cursor"), x.to_parameter_value())) }
if let Some(ref mut x) = self.include_entities { params.push((Cow::Borrowed("include_entities"), x.to_parameter_value())) }
if let Some(ref mut x) = self.skip_status { params.push((Cow::Borrowed("skip_status"), x.to_parameter_value())) }
if let Some(ref mut x) = self.include_ext_alt_text { params.push((Cow::Borrowed("include_ext_alt_text"), x.to_parameter_value())) }
if let Some(ref mut x) = self.tweet_mode { params.push((Cow::Borrowed("tweet_mode"), x.to_parameter_value())) }
let url = "https://api.twitter.com/1.1/lists/subscribers.json";
execute_core(self._client, Get, url, params)
}
}
pub struct ListsSubscribersShowRequestBuilder<'a, A: 'a + Authenticator, H: 'a + HttpHandler> {
_client: &'a TwitterClient<A, H>,
list_id: Option<i64>,
slug: Option<Cow<'a, str>>,
owner_screen_name: Option<Cow<'a, str>>,
owner_id: Option<i64>,
user_id: Option<i64>,
screen_name: Option<Cow<'a, str>>,
include_entities: Option<bool>,
skip_status: Option<bool>,
include_ext_alt_text: Option<bool>,
tweet_mode: Option<TweetMode>,
}
impl<'a, A: Authenticator, H: HttpHandler> ListsSubscribersShowRequestBuilder<'a, A, H> {
pub fn list_id(&'a mut self, val: i64) -> &'a mut Self {
self.list_id = Some(val);
self
}
pub fn slug<T1: Into<Cow<'a, str>>>(&'a mut self, val: T1) -> &'a mut Self {
self.slug = Some(val.into());
self
}
pub fn owner_screen_name<T1: Into<Cow<'a, str>>>(&'a mut self, val: T1) -> &'a mut Self {
self.owner_screen_name = Some(val.into());
self
}
pub fn owner_id(&'a mut self, val: i64) -> &'a mut Self {
self.owner_id = Some(val);
self
}
pub fn user_id(&'a mut self, val: i64) -> &'a mut Self {
self.user_id = Some(val);
self
}
pub fn screen_name<T1: Into<Cow<'a, str>>>(&'a mut self, val: T1) -> &'a mut Self {
self.screen_name = Some(val.into());
self
}
pub fn include_entities(&'a mut self, val: bool) -> &'a mut Self {
self.include_entities = Some(val);
self
}
pub fn skip_status(&'a mut self, val: bool) -> &'a mut Self {
self.skip_status = Some(val);
self
}
pub fn include_ext_alt_text(&'a mut self, val: bool) -> &'a mut Self {
self.include_ext_alt_text = Some(val);
self
}
pub fn tweet_mode(&'a mut self, val: TweetMode) -> &'a mut Self {
self.tweet_mode = Some(val);
self
}
pub fn execute(&'a mut self) -> TwitterResult<User> {
let mut params = Vec::with_capacity(10);
if let Some(ref mut x) = self.list_id { params.push((Cow::Borrowed("list_id"), x.to_parameter_value())) }
if let Some(ref mut x) = self.slug { params.push((Cow::Borrowed("slug"), x.to_parameter_value())) }
if let Some(ref mut x) = self.owner_screen_name { params.push((Cow::Borrowed("owner_screen_name"), x.to_parameter_value())) }
if let Some(ref mut x) = self.owner_id { params.push((Cow::Borrowed("owner_id"), x.to_parameter_value())) }
if let Some(ref mut x) = self.user_id { params.push((Cow::Borrowed("user_id"), x.to_parameter_value())) }
if let Some(ref mut x) = self.screen_name { params.push((Cow::Borrowed("screen_name"), x.to_parameter_value())) }
if let Some(ref mut x) = self.include_entities { params.push((Cow::Borrowed("include_entities"), x.to_parameter_value())) }
if let Some(ref mut x) = self.skip_status { params.push((Cow::Borrowed("skip_status"), x.to_parameter_value())) }
if let Some(ref mut x) = self.include_ext_alt_text { params.push((Cow::Borrowed("include_ext_alt_text"), x.to_parameter_value())) }
if let Some(ref mut x) = self.tweet_mode { params.push((Cow::Borrowed("tweet_mode"), x.to_parameter_value())) }
let url = "https://api.twitter.com/1.1/lists/subscribers/show.json";
execute_core(self._client, Get, url, params)
}
}
pub struct ListsSubscribersCreateRequestBuilder<'a, A: 'a + Authenticator, H: 'a + HttpHandler> {
_client: &'a TwitterClient<A, H>,
list_id: Option<i64>,
slug: Option<Cow<'a, str>>,
owner_screen_name: Option<Cow<'a, str>>,
owner_id: Option<i64>,
}
impl<'a, A: Authenticator, H: HttpHandler> ListsSubscribersCreateRequestBuilder<'a, A, H> {
pub fn list_id(&'a mut self, val: i64) -> &'a mut Self {
self.list_id = Some(val);
self
}
pub fn slug<T1: Into<Cow<'a, str>>>(&'a mut self, val: T1) -> &'a mut Self {
self.slug = Some(val.into());
self
}
pub fn owner_screen_name<T1: Into<Cow<'a, str>>>(&'a mut self, val: T1) -> &'a mut Self {
self.owner_screen_name = Some(val.into());
self
}
pub fn owner_id(&'a mut self, val: i64) -> &'a mut Self {
self.owner_id = Some(val);
self
}
pub fn execute(&'a mut self) -> TwitterResult<List> {
let mut params = Vec::with_capacity(4);
if let Some(ref mut x) = self.list_id { params.push((Cow::Borrowed("list_id"), x.to_parameter_value())) }
if let Some(ref mut x) = self.slug { params.push((Cow::Borrowed("slug"), x.to_parameter_value())) }
if let Some(ref mut x) = self.owner_screen_name { params.push((Cow::Borrowed("owner_screen_name"), x.to_parameter_value())) }
if let Some(ref mut x) = self.owner_id { params.push((Cow::Borrowed("owner_id"), x.to_parameter_value())) }
let url = "https://api.twitter.com/1.1/lists/subscribers/create.json";
execute_core(self._client, Post, url, params)
}
}
pub struct ListsSubscribersDestroyRequestBuilder<'a, A: 'a + Authenticator, H: 'a + HttpHandler> {
_client: &'a TwitterClient<A, H>,
list_id: Option<i64>,
slug: Option<Cow<'a, str>>,
owner_screen_name: Option<Cow<'a, str>>,
owner_id: Option<i64>,
}
impl<'a, A: Authenticator, H: HttpHandler> ListsSubscribersDestroyRequestBuilder<'a, A, H> {
pub fn list_id(&'a mut self, val: i64) -> &'a mut Self {
self.list_id = Some(val);
self
}
pub fn slug<T1: Into<Cow<'a, str>>>(&'a mut self, val: T1) -> &'a mut Self {
self.slug = Some(val.into());
self
}
pub fn owner_screen_name<T1: Into<Cow<'a, str>>>(&'a mut self, val: T1) -> &'a mut Self {
self.owner_screen_name = Some(val.into());
self
}
pub fn owner_id(&'a mut self, val: i64) -> &'a mut Self {
self.owner_id = Some(val);
self
}
pub fn execute(&'a mut self) -> TwitterResult<List> {
let mut params = Vec::with_capacity(4);
if let Some(ref mut x) = self.list_id { params.push((Cow::Borrowed("list_id"), x.to_parameter_value())) }
if let Some(ref mut x) = self.slug { params.push((Cow::Borrowed("slug"), x.to_parameter_value())) }
if let Some(ref mut x) = self.owner_screen_name { params.push((Cow::Borrowed("owner_screen_name"), x.to_parameter_value())) }
if let Some(ref mut x) = self.owner_id { params.push((Cow::Borrowed("owner_id"), x.to_parameter_value())) }
let url = "https://api.twitter.com/1.1/lists/subscribers/destroy.json";
execute_core(self._client, Post, url, params)
}
}
#[derive(Clone, Debug)]
pub struct StatusesClient<'a, A: 'a + Authenticator, H: 'a + HttpHandler> {
client: &'a TwitterClient<A, H>
}
impl<'a, A: Authenticator, H: HttpHandler> StatusesClient<'a, A, H> {
pub fn mentions_timeline(&self) -> StatusesMentionsTimelineRequestBuilder<'a, A, H> {
StatusesMentionsTimelineRequestBuilder {
_client: self.client,
count: None,
since_id: None,
max_id: None,
trim_user: None,
contributor_details: None,
include_entities: None,
include_ext_alt_text: None,
tweet_mode: None,
}
}
pub fn user_timeline(&self) -> StatusesUserTimelineRequestBuilder<'a, A, H> {
StatusesUserTimelineRequestBuilder {
_client: self.client,
user_id: None,
screen_name: None,
count: None,
since_id: None,
max_id: None,
trim_user: None,
exclude_replies: None,
contributor_details: None,
include_rts: None,
include_ext_alt_text: None,
tweet_mode: None,
}
}
pub fn home_timeline(&self) -> StatusesHomeTimelineRequestBuilder<'a, A, H> {
StatusesHomeTimelineRequestBuilder {
_client: self.client,
count: None,
since_id: None,
max_id: None,
trim_user: None,
exclude_replies: None,
contributor_details: None,
include_entities: None,
include_ext_alt_text: None,
tweet_mode: None,
}
}
pub fn retweets_of_me(&self) -> StatusesRetweetsOfMeRequestBuilder<'a, A, H> {
StatusesRetweetsOfMeRequestBuilder {
_client: self.client,
count: None,
since_id: None,
max_id: None,
trim_user: None,
include_entities: None,
include_user_entities: None,
include_ext_alt_text: None,
tweet_mode: None,
}
}
pub fn oembed(&self) -> StatusesOembedRequestBuilder<'a, A, H> {
StatusesOembedRequestBuilder {
_client: self.client,
id: None,
url: None,
maxwidth: None,
hide_media: None,
hide_thread: None,
omit_script: None,
align: None,
related: None,
lang: None,
widget_type: None,
hide_tweet: None,
}
}
pub fn show(&self, id: i64) -> StatusesShowRequestBuilder<'a, A, H> {
StatusesShowRequestBuilder {
_client: self.client,
id: id,
trim_user: None,
include_my_retweet: None,
include_entities: None,
include_ext_alt_text: None,
tweet_mode: None,
}
}
pub fn retweets(&self, id: i64) -> StatusesRetweetsRequestBuilder<'a, A, H> {
StatusesRetweetsRequestBuilder {
_client: self.client,
id: id,
count: None,
trim_user: None,
include_ext_alt_text: None,
tweet_mode: None,
}
}
pub fn lookup<T1: IntoIterator<Item = i64>>(&self, id: T1) -> StatusesLookupRequestBuilder<'a, A, H> {
StatusesLookupRequestBuilder {
_client: self.client,
id: collection_paramter(id),
trim_user: None,
include_entities: None,
include_ext_alt_text: None,
tweet_mode: None,
}
}
pub fn retweeters_ids(&self, id: i64) -> StatusesRetweetersIdsRequestBuilder<'a, A, H> {
StatusesRetweetersIdsRequestBuilder {
_client: self.client,
id: id,
cursor: None,
}
}
pub fn update<T1: Into<Cow<'a, str>>>(&self, status: T1) -> StatusesUpdateRequestBuilder<'a, A, H> {
StatusesUpdateRequestBuilder {
_client: self.client,
status: status.into(),
in_reply_to_status_id: None,
possibly_sensitive: None,
lat: None,
long: None,
place_id: None,
display_coordinates: None,
trim_user: None,
media_ids: None,
attachment_url: None,
auto_populate_reply_metadata: None,
exclude_reply_user_ids: None,
include_ext_alt_text: None,
tweet_mode: None,
}
}
pub fn destroy(&self, id: i64) -> StatusesDestroyRequestBuilder<'a, A, H> {
StatusesDestroyRequestBuilder {
_client: self.client,
id: id,
trim_user: None,
include_ext_alt_text: None,
tweet_mode: None,
}
}
pub fn retweet(&self, id: i64) -> StatusesRetweetRequestBuilder<'a, A, H> {
StatusesRetweetRequestBuilder {
_client: self.client,
id: id,
trim_user: None,
include_ext_alt_text: None,
tweet_mode: None,
}
}
pub fn unretweet(&self, id: i64) -> StatusesUnretweetRequestBuilder<'a, A, H> {
StatusesUnretweetRequestBuilder {
_client: self.client,
id: id,
trim_user: None,
include_ext_alt_text: None,
tweet_mode: None,
}
}
}
pub struct StatusesMentionsTimelineRequestBuilder<'a, A: 'a + Authenticator, H: 'a + HttpHandler> {
_client: &'a TwitterClient<A, H>,
count: Option<i32>,
since_id: Option<i64>,
max_id: Option<i64>,
trim_user: Option<bool>,
contributor_details: Option<bool>,
include_entities: Option<bool>,
include_ext_alt_text: Option<bool>,
tweet_mode: Option<TweetMode>,
}
impl<'a, A: Authenticator, H: HttpHandler> StatusesMentionsTimelineRequestBuilder<'a, A, H> {
pub fn count(&'a mut self, val: i32) -> &'a mut Self {
self.count = Some(val);
self
}
pub fn since_id(&'a mut self, val: i64) -> &'a mut Self {
self.since_id = Some(val);
self
}
pub fn max_id(&'a mut self, val: i64) -> &'a mut Self {
self.max_id = Some(val);
self
}
pub fn trim_user(&'a mut self, val: bool) -> &'a mut Self {
self.trim_user = Some(val);
self
}
pub fn contributor_details(&'a mut self, val: bool) -> &'a mut Self {
self.contributor_details = Some(val);
self
}
pub fn include_entities(&'a mut self, val: bool) -> &'a mut Self {
self.include_entities = Some(val);
self
}
pub fn include_ext_alt_text(&'a mut self, val: bool) -> &'a mut Self {
self.include_ext_alt_text = Some(val);
self
}
pub fn tweet_mode(&'a mut self, val: TweetMode) -> &'a mut Self {
self.tweet_mode = Some(val);
self
}
pub fn execute(&'a mut self) -> TwitterResult<Vec<Tweet>> {
let mut params = Vec::with_capacity(8);
if let Some(ref mut x) = self.count { params.push((Cow::Borrowed("count"), x.to_parameter_value())) }
if let Some(ref mut x) = self.since_id { params.push((Cow::Borrowed("since_id"), x.to_parameter_value())) }
if let Some(ref mut x) = self.max_id { params.push((Cow::Borrowed("max_id"), x.to_parameter_value())) }
if let Some(ref mut x) = self.trim_user { params.push((Cow::Borrowed("trim_user"), x.to_parameter_value())) }
if let Some(ref mut x) = self.contributor_details { params.push((Cow::Borrowed("contributor_details"), x.to_parameter_value())) }
if let Some(ref mut x) = self.include_entities { params.push((Cow::Borrowed("include_entities"), x.to_parameter_value())) }
if let Some(ref mut x) = self.include_ext_alt_text { params.push((Cow::Borrowed("include_ext_alt_text"), x.to_parameter_value())) }
if let Some(ref mut x) = self.tweet_mode { params.push((Cow::Borrowed("tweet_mode"), x.to_parameter_value())) }
let url = "https://api.twitter.com/1.1/statuses/mentions_timeline.json";
execute_core(self._client, Get, url, params)
}
}
pub struct StatusesUserTimelineRequestBuilder<'a, A: 'a + Authenticator, H: 'a + HttpHandler> {
_client: &'a TwitterClient<A, H>,
user_id: Option<i64>,
screen_name: Option<Cow<'a, str>>,
count: Option<i32>,
since_id: Option<i64>,
max_id: Option<i64>,
trim_user: Option<bool>,
exclude_replies: Option<bool>,
contributor_details: Option<bool>,
include_rts: Option<bool>,
include_ext_alt_text: Option<bool>,
tweet_mode: Option<TweetMode>,
}
impl<'a, A: Authenticator, H: HttpHandler> StatusesUserTimelineRequestBuilder<'a, A, H> {
pub fn user_id(&'a mut self, val: i64) -> &'a mut Self {
self.user_id = Some(val);
self
}
pub fn screen_name<T1: Into<Cow<'a, str>>>(&'a mut self, val: T1) -> &'a mut Self {
self.screen_name = Some(val.into());
self
}
pub fn count(&'a mut self, val: i32) -> &'a mut Self {
self.count = Some(val);
self
}
pub fn since_id(&'a mut self, val: i64) -> &'a mut Self {
self.since_id = Some(val);
self
}
pub fn max_id(&'a mut self, val: i64) -> &'a mut Self {
self.max_id = Some(val);
self
}
pub fn trim_user(&'a mut self, val: bool) -> &'a mut Self {
self.trim_user = Some(val);
self
}
pub fn exclude_replies(&'a mut self, val: bool) -> &'a mut Self {
self.exclude_replies = Some(val);
self
}
pub fn contributor_details(&'a mut self, val: bool) -> &'a mut Self {
self.contributor_details = Some(val);
self
}
pub fn include_rts(&'a mut self, val: bool) -> &'a mut Self {
self.include_rts = Some(val);
self
}
pub fn include_ext_alt_text(&'a mut self, val: bool) -> &'a mut Self {
self.include_ext_alt_text = Some(val);
self
}
pub fn tweet_mode(&'a mut self, val: TweetMode) -> &'a mut Self {
self.tweet_mode = Some(val);
self
}
pub fn execute(&'a mut self) -> TwitterResult<Vec<Tweet>> {
let mut params = Vec::with_capacity(11);
if let Some(ref mut x) = self.user_id { params.push((Cow::Borrowed("user_id"), x.to_parameter_value())) }
if let Some(ref mut x) = self.screen_name { params.push((Cow::Borrowed("screen_name"), x.to_parameter_value())) }
if let Some(ref mut x) = self.count { params.push((Cow::Borrowed("count"), x.to_parameter_value())) }
if let Some(ref mut x) = self.since_id { params.push((Cow::Borrowed("since_id"), x.to_parameter_value())) }
if let Some(ref mut x) = self.max_id { params.push((Cow::Borrowed("max_id"), x.to_parameter_value())) }
if let Some(ref mut x) = self.trim_user { params.push((Cow::Borrowed("trim_user"), x.to_parameter_value())) }
if let Some(ref mut x) = self.exclude_replies { params.push((Cow::Borrowed("exclude_replies"), x.to_parameter_value())) }
if let Some(ref mut x) = self.contributor_details { params.push((Cow::Borrowed("contributor_details"), x.to_parameter_value())) }
if let Some(ref mut x) = self.include_rts { params.push((Cow::Borrowed("include_rts"), x.to_parameter_value())) }
if let Some(ref mut x) = self.include_ext_alt_text { params.push((Cow::Borrowed("include_ext_alt_text"), x.to_parameter_value())) }
if let Some(ref mut x) = self.tweet_mode { params.push((Cow::Borrowed("tweet_mode"), x.to_parameter_value())) }
let url = "https://api.twitter.com/1.1/statuses/user_timeline.json";
execute_core(self._client, Get, url, params)
}
}
pub struct StatusesHomeTimelineRequestBuilder<'a, A: 'a + Authenticator, H: 'a + HttpHandler> {
_client: &'a TwitterClient<A, H>,
count: Option<i32>,
since_id: Option<i64>,
max_id: Option<i64>,
trim_user: Option<bool>,
exclude_replies: Option<bool>,
contributor_details: Option<bool>,
include_entities: Option<bool>,
include_ext_alt_text: Option<bool>,
tweet_mode: Option<TweetMode>,
}
impl<'a, A: Authenticator, H: HttpHandler> StatusesHomeTimelineRequestBuilder<'a, A, H> {
pub fn count(&'a mut self, val: i32) -> &'a mut Self {
self.count = Some(val);
self
}
pub fn since_id(&'a mut self, val: i64) -> &'a mut Self {
self.since_id = Some(val);
self
}
pub fn max_id(&'a mut self, val: i64) -> &'a mut Self {
self.max_id = Some(val);
self
}
pub fn trim_user(&'a mut self, val: bool) -> &'a mut Self {
self.trim_user = Some(val);
self
}
pub fn exclude_replies(&'a mut self, val: bool) -> &'a mut Self {
self.exclude_replies = Some(val);
self
}
pub fn contributor_details(&'a mut self, val: bool) -> &'a mut Self {
self.contributor_details = Some(val);
self
}
pub fn include_entities(&'a mut self, val: bool) -> &'a mut Self {
self.include_entities = Some(val);
self
}
pub fn include_ext_alt_text(&'a mut self, val: bool) -> &'a mut Self {
self.include_ext_alt_text = Some(val);
self
}
pub fn tweet_mode(&'a mut self, val: TweetMode) -> &'a mut Self {
self.tweet_mode = Some(val);
self
}
pub fn execute(&'a mut self) -> TwitterResult<Vec<Tweet>> {
let mut params = Vec::with_capacity(9);
if let Some(ref mut x) = self.count { params.push((Cow::Borrowed("count"), x.to_parameter_value())) }
if let Some(ref mut x) = self.since_id { params.push((Cow::Borrowed("since_id"), x.to_parameter_value())) }
if let Some(ref mut x) = self.max_id { params.push((Cow::Borrowed("max_id"), x.to_parameter_value())) }
if let Some(ref mut x) = self.trim_user { params.push((Cow::Borrowed("trim_user"), x.to_parameter_value())) }
if let Some(ref mut x) = self.exclude_replies { params.push((Cow::Borrowed("exclude_replies"), x.to_parameter_value())) }
if let Some(ref mut x) = self.contributor_details { params.push((Cow::Borrowed("contributor_details"), x.to_parameter_value())) }
if let Some(ref mut x) = self.include_entities { params.push((Cow::Borrowed("include_entities"), x.to_parameter_value())) }
if let Some(ref mut x) = self.include_ext_alt_text { params.push((Cow::Borrowed("include_ext_alt_text"), x.to_parameter_value())) }
if let Some(ref mut x) = self.tweet_mode { params.push((Cow::Borrowed("tweet_mode"), x.to_parameter_value())) }
let url = "https://api.twitter.com/1.1/statuses/home_timeline.json";
execute_core(self._client, Get, url, params)
}
}
pub struct StatusesRetweetsOfMeRequestBuilder<'a, A: 'a + Authenticator, H: 'a + HttpHandler> {
_client: &'a TwitterClient<A, H>,
count: Option<i32>,
since_id: Option<i64>,
max_id: Option<i64>,
trim_user: Option<bool>,
include_entities: Option<bool>,
include_user_entities: Option<bool>,
include_ext_alt_text: Option<bool>,
tweet_mode: Option<TweetMode>,
}
impl<'a, A: Authenticator, H: HttpHandler> StatusesRetweetsOfMeRequestBuilder<'a, A, H> {
pub fn count(&'a mut self, val: i32) -> &'a mut Self {
self.count = Some(val);
self
}
pub fn since_id(&'a mut self, val: i64) -> &'a mut Self {
self.since_id = Some(val);
self
}
pub fn max_id(&'a mut self, val: i64) -> &'a mut Self {
self.max_id = Some(val);
self
}
pub fn trim_user(&'a mut self, val: bool) -> &'a mut Self {
self.trim_user = Some(val);
self
}
pub fn include_entities(&'a mut self, val: bool) -> &'a mut Self {
self.include_entities = Some(val);
self
}
pub fn include_user_entities(&'a mut self, val: bool) -> &'a mut Self {
self.include_user_entities = Some(val);
self
}
pub fn include_ext_alt_text(&'a mut self, val: bool) -> &'a mut Self {
self.include_ext_alt_text = Some(val);
self
}
pub fn tweet_mode(&'a mut self, val: TweetMode) -> &'a mut Self {
self.tweet_mode = Some(val);
self
}
pub fn execute(&'a mut self) -> TwitterResult<Vec<Tweet>> {
let mut params = Vec::with_capacity(8);
if let Some(ref mut x) = self.count { params.push((Cow::Borrowed("count"), x.to_parameter_value())) }
if let Some(ref mut x) = self.since_id { params.push((Cow::Borrowed("since_id"), x.to_parameter_value())) }
if let Some(ref mut x) = self.max_id { params.push((Cow::Borrowed("max_id"), x.to_parameter_value())) }
if let Some(ref mut x) = self.trim_user { params.push((Cow::Borrowed("trim_user"), x.to_parameter_value())) }
if let Some(ref mut x) = self.include_entities { params.push((Cow::Borrowed("include_entities"), x.to_parameter_value())) }
if let Some(ref mut x) = self.include_user_entities { params.push((Cow::Borrowed("include_user_entities"), x.to_parameter_value())) }
if let Some(ref mut x) = self.include_ext_alt_text { params.push((Cow::Borrowed("include_ext_alt_text"), x.to_parameter_value())) }
if let Some(ref mut x) = self.tweet_mode { params.push((Cow::Borrowed("tweet_mode"), x.to_parameter_value())) }
let url = "https://api.twitter.com/1.1/statuses/retweets_of_me.json";
execute_core(self._client, Get, url, params)
}
}
pub struct StatusesOembedRequestBuilder<'a, A: 'a + Authenticator, H: 'a + HttpHandler> {
_client: &'a TwitterClient<A, H>,
id: Option<i64>,
url: Option<Cow<'a, str>>,
maxwidth: Option<i32>,
hide_media: Option<bool>,
hide_thread: Option<bool>,
omit_script: Option<bool>,
align: Option<Cow<'a, str>>,
related: Option<Cow<'a, str>>,
lang: Option<Cow<'a, str>>,
widget_type: Option<Cow<'a, str>>,
hide_tweet: Option<bool>,
}
impl<'a, A: Authenticator, H: HttpHandler> StatusesOembedRequestBuilder<'a, A, H> {
pub fn id(&'a mut self, val: i64) -> &'a mut Self {
self.id = Some(val);
self
}
pub fn url<T1: Into<Cow<'a, str>>>(&'a mut self, val: T1) -> &'a mut Self {
self.url = Some(val.into());
self
}
pub fn maxwidth(&'a mut self, val: i32) -> &'a mut Self {
self.maxwidth = Some(val);
self
}
pub fn hide_media(&'a mut self, val: bool) -> &'a mut Self {
self.hide_media = Some(val);
self
}
pub fn hide_thread(&'a mut self, val: bool) -> &'a mut Self {
self.hide_thread = Some(val);
self
}
pub fn omit_script(&'a mut self, val: bool) -> &'a mut Self {
self.omit_script = Some(val);
self
}
pub fn align<T1: Into<Cow<'a, str>>>(&'a mut self, val: T1) -> &'a mut Self {
self.align = Some(val.into());
self
}
pub fn related<T1: Into<Cow<'a, str>>>(&'a mut self, val: T1) -> &'a mut Self {
self.related = Some(val.into());
self
}
pub fn lang<T1: Into<Cow<'a, str>>>(&'a mut self, val: T1) -> &'a mut Self {
self.lang = Some(val.into());
self
}
pub fn widget_type<T1: Into<Cow<'a, str>>>(&'a mut self, val: T1) -> &'a mut Self {
self.widget_type = Some(val.into());
self
}
pub fn hide_tweet(&'a mut self, val: bool) -> &'a mut Self {
self.hide_tweet = Some(val);
self
}
pub fn execute(&'a mut self) -> TwitterResult<OEmbed> {
let mut params = Vec::with_capacity(11);
if let Some(ref mut x) = self.id { params.push((Cow::Borrowed("id"), x.to_parameter_value())) }
if let Some(ref mut x) = self.url { params.push((Cow::Borrowed("url"), x.to_parameter_value())) }
if let Some(ref mut x) = self.maxwidth { params.push((Cow::Borrowed("maxwidth"), x.to_parameter_value())) }
if let Some(ref mut x) = self.hide_media { params.push((Cow::Borrowed("hide_media"), x.to_parameter_value())) }
if let Some(ref mut x) = self.hide_thread { params.push((Cow::Borrowed("hide_thread"), x.to_parameter_value())) }
if let Some(ref mut x) = self.omit_script { params.push((Cow::Borrowed("omit_script"), x.to_parameter_value())) }
if let Some(ref mut x) = self.align { params.push((Cow::Borrowed("align"), x.to_parameter_value())) }
if let Some(ref mut x) = self.related { params.push((Cow::Borrowed("related"), x.to_parameter_value())) }
if let Some(ref mut x) = self.lang { params.push((Cow::Borrowed("lang"), x.to_parameter_value())) }
if let Some(ref mut x) = self.widget_type { params.push((Cow::Borrowed("widget_type"), x.to_parameter_value())) }
if let Some(ref mut x) = self.hide_tweet { params.push((Cow::Borrowed("hide_tweet"), x.to_parameter_value())) }
let url = "https://api.twitter.com/1.1/statuses/oembed.json";
execute_core(self._client, Get, url, params)
}
}
pub struct StatusesShowRequestBuilder<'a, A: 'a + Authenticator, H: 'a + HttpHandler> {
_client: &'a TwitterClient<A, H>,
id: i64,
trim_user: Option<bool>,
include_my_retweet: Option<bool>,
include_entities: Option<bool>,
include_ext_alt_text: Option<bool>,
tweet_mode: Option<TweetMode>,
}
impl<'a, A: Authenticator, H: HttpHandler> StatusesShowRequestBuilder<'a, A, H> {
pub fn trim_user(&'a mut self, val: bool) -> &'a mut Self {
self.trim_user = Some(val);
self
}
pub fn include_my_retweet(&'a mut self, val: bool) -> &'a mut Self {
self.include_my_retweet = Some(val);
self
}
pub fn include_entities(&'a mut self, val: bool) -> &'a mut Self {
self.include_entities = Some(val);
self
}
pub fn include_ext_alt_text(&'a mut self, val: bool) -> &'a mut Self {
self.include_ext_alt_text = Some(val);
self
}
pub fn tweet_mode(&'a mut self, val: TweetMode) -> &'a mut Self {
self.tweet_mode = Some(val);
self
}
pub fn execute(&'a mut self) -> TwitterResult<Tweet> {
let mut params = Vec::with_capacity(5);
if let Some(ref mut x) = self.trim_user { params.push((Cow::Borrowed("trim_user"), x.to_parameter_value())) }
if let Some(ref mut x) = self.include_my_retweet { params.push((Cow::Borrowed("include_my_retweet"), x.to_parameter_value())) }
if let Some(ref mut x) = self.include_entities { params.push((Cow::Borrowed("include_entities"), x.to_parameter_value())) }
if let Some(ref mut x) = self.include_ext_alt_text { params.push((Cow::Borrowed("include_ext_alt_text"), x.to_parameter_value())) }
if let Some(ref mut x) = self.tweet_mode { params.push((Cow::Borrowed("tweet_mode"), x.to_parameter_value())) }
let url = format!("https://api.twitter.com/1.1/statuses/show/{id}.json", id = self.id);
execute_core(self._client, Get, url, params)
}
}
pub struct StatusesRetweetsRequestBuilder<'a, A: 'a + Authenticator, H: 'a + HttpHandler> {
_client: &'a TwitterClient<A, H>,
id: i64,
count: Option<i32>,
trim_user: Option<bool>,
include_ext_alt_text: Option<bool>,
tweet_mode: Option<TweetMode>,
}
impl<'a, A: Authenticator, H: HttpHandler> StatusesRetweetsRequestBuilder<'a, A, H> {
pub fn count(&'a mut self, val: i32) -> &'a mut Self {
self.count = Some(val);
self
}
pub fn trim_user(&'a mut self, val: bool) -> &'a mut Self {
self.trim_user = Some(val);
self
}
pub fn include_ext_alt_text(&'a mut self, val: bool) -> &'a mut Self {
self.include_ext_alt_text = Some(val);
self
}
pub fn tweet_mode(&'a mut self, val: TweetMode) -> &'a mut Self {
self.tweet_mode = Some(val);
self
}
pub fn execute(&'a mut self) -> TwitterResult<Vec<Tweet>> {
let mut params = Vec::with_capacity(4);
if let Some(ref mut x) = self.count { params.push((Cow::Borrowed("count"), x.to_parameter_value())) }
if let Some(ref mut x) = self.trim_user { params.push((Cow::Borrowed("trim_user"), x.to_parameter_value())) }
if let Some(ref mut x) = self.include_ext_alt_text { params.push((Cow::Borrowed("include_ext_alt_text"), x.to_parameter_value())) }
if let Some(ref mut x) = self.tweet_mode { params.push((Cow::Borrowed("tweet_mode"), x.to_parameter_value())) }
let url = format!("https://api.twitter.com/1.1/statuses/retweets/{id}.json", id = self.id);
execute_core(self._client, Get, url, params)
}
}
pub struct StatusesLookupRequestBuilder<'a, A: 'a + Authenticator, H: 'a + HttpHandler> {
_client: &'a TwitterClient<A, H>,
id: String,
trim_user: Option<bool>,
include_entities: Option<bool>,
include_ext_alt_text: Option<bool>,
tweet_mode: Option<TweetMode>,
}
impl<'a, A: Authenticator, H: HttpHandler> StatusesLookupRequestBuilder<'a, A, H> {
pub fn trim_user(&'a mut self, val: bool) -> &'a mut Self {
self.trim_user = Some(val);
self
}
pub fn include_entities(&'a mut self, val: bool) -> &'a mut Self {
self.include_entities = Some(val);
self
}
pub fn include_ext_alt_text(&'a mut self, val: bool) -> &'a mut Self {
self.include_ext_alt_text = Some(val);
self
}
pub fn tweet_mode(&'a mut self, val: TweetMode) -> &'a mut Self {
self.tweet_mode = Some(val);
self
}
pub fn execute(&'a mut self) -> TwitterResult<Vec<Tweet>> {
let mut params = Vec::with_capacity(5);
params.push((Cow::Borrowed("id"), self.id.to_parameter_value()));
if let Some(ref mut x) = self.trim_user { params.push((Cow::Borrowed("trim_user"), x.to_parameter_value())) }
if let Some(ref mut x) = self.include_entities { params.push((Cow::Borrowed("include_entities"), x.to_parameter_value())) }
if let Some(ref mut x) = self.include_ext_alt_text { params.push((Cow::Borrowed("include_ext_alt_text"), x.to_parameter_value())) }
if let Some(ref mut x) = self.tweet_mode { params.push((Cow::Borrowed("tweet_mode"), x.to_parameter_value())) }
let url = "https://api.twitter.com/1.1/statuses/lookup.json";
execute_core(self._client, Get, url, params)
}
}
pub struct StatusesRetweetersIdsRequestBuilder<'a, A: 'a + Authenticator, H: 'a + HttpHandler> {
_client: &'a TwitterClient<A, H>,
id: i64,
cursor: Option<i64>,
}
impl<'a, A: Authenticator, H: HttpHandler> StatusesRetweetersIdsRequestBuilder<'a, A, H> {
pub fn cursor(&'a mut self, val: i64) -> &'a mut Self {
self.cursor = Some(val);
self
}
pub fn execute(&'a mut self) -> TwitterResult<CursorIds> {
let mut params = Vec::with_capacity(2);
params.push((Cow::Borrowed("id"), self.id.to_parameter_value()));
if let Some(ref mut x) = self.cursor { params.push((Cow::Borrowed("cursor"), x.to_parameter_value())) }
let url = "https://api.twitter.com/1.1/statuses/retweeters/ids.json";
execute_core(self._client, Get, url, params)
}
}
pub struct StatusesUpdateRequestBuilder<'a, A: 'a + Authenticator, H: 'a + HttpHandler> {
_client: &'a TwitterClient<A, H>,
status: Cow<'a, str>,
in_reply_to_status_id: Option<i64>,
possibly_sensitive: Option<bool>,
lat: Option<f64>,
long: Option<f64>,
place_id: Option<Cow<'a, str>>,
display_coordinates: Option<bool>,
trim_user: Option<bool>,
media_ids: Option<String>,
attachment_url: Option<Cow<'a, str>>,
auto_populate_reply_metadata: Option<bool>,
exclude_reply_user_ids: Option<String>,
include_ext_alt_text: Option<bool>,
tweet_mode: Option<TweetMode>,
}
impl<'a, A: Authenticator, H: HttpHandler> StatusesUpdateRequestBuilder<'a, A, H> {
pub fn in_reply_to_status_id(&'a mut self, val: i64) -> &'a mut Self {
self.in_reply_to_status_id = Some(val);
self
}
pub fn possibly_sensitive(&'a mut self, val: bool) -> &'a mut Self {
self.possibly_sensitive = Some(val);
self
}
pub fn lat(&'a mut self, val: f64) -> &'a mut Self {
self.lat = Some(val);
self
}
pub fn long(&'a mut self, val: f64) -> &'a mut Self {
self.long = Some(val);
self
}
pub fn place_id<T1: Into<Cow<'a, str>>>(&'a mut self, val: T1) -> &'a mut Self {
self.place_id = Some(val.into());
self
}
pub fn display_coordinates(&'a mut self, val: bool) -> &'a mut Self {
self.display_coordinates = Some(val);
self
}
pub fn trim_user(&'a mut self, val: bool) -> &'a mut Self {
self.trim_user = Some(val);
self
}
pub fn media_ids<T1: IntoIterator<Item = i64>>(&'a mut self, val: T1) -> &'a mut Self {
self.media_ids = Some(collection_paramter(val));
self
}
pub fn attachment_url<T1: Into<Cow<'a, str>>>(&'a mut self, val: T1) -> &'a mut Self {
self.attachment_url = Some(val.into());
self
}
pub fn auto_populate_reply_metadata(&'a mut self, val: bool) -> &'a mut Self {
self.auto_populate_reply_metadata = Some(val);
self
}
pub fn exclude_reply_user_ids<T1: IntoIterator<Item = i64>>(&'a mut self, val: T1) -> &'a mut Self {
self.exclude_reply_user_ids = Some(collection_paramter(val));
self
}
pub fn include_ext_alt_text(&'a mut self, val: bool) -> &'a mut Self {
self.include_ext_alt_text = Some(val);
self
}
pub fn tweet_mode(&'a mut self, val: TweetMode) -> &'a mut Self {
self.tweet_mode = Some(val);
self
}
pub fn execute(&'a mut self) -> TwitterResult<Tweet> {
let mut params = Vec::with_capacity(14);
params.push((Cow::Borrowed("status"), self.status.to_parameter_value()));
if let Some(ref mut x) = self.in_reply_to_status_id { params.push((Cow::Borrowed("in_reply_to_status_id"), x.to_parameter_value())) }
if let Some(ref mut x) = self.possibly_sensitive { params.push((Cow::Borrowed("possibly_sensitive"), x.to_parameter_value())) }
if let Some(ref mut x) = self.lat { params.push((Cow::Borrowed("lat"), x.to_parameter_value())) }
if let Some(ref mut x) = self.long { params.push((Cow::Borrowed("long"), x.to_parameter_value())) }
if let Some(ref mut x) = self.place_id { params.push((Cow::Borrowed("place_id"), x.to_parameter_value())) }
if let Some(ref mut x) = self.display_coordinates { params.push((Cow::Borrowed("display_coordinates"), x.to_parameter_value())) }
if let Some(ref mut x) = self.trim_user { params.push((Cow::Borrowed("trim_user"), x.to_parameter_value())) }
if let Some(ref mut x) = self.media_ids { params.push((Cow::Borrowed("media_ids"), x.to_parameter_value())) }
if let Some(ref mut x) = self.attachment_url { params.push((Cow::Borrowed("attachment_url"), x.to_parameter_value())) }
if let Some(ref mut x) = self.auto_populate_reply_metadata { params.push((Cow::Borrowed("auto_populate_reply_metadata"), x.to_parameter_value())) }
if let Some(ref mut x) = self.exclude_reply_user_ids { params.push((Cow::Borrowed("exclude_reply_user_ids"), x.to_parameter_value())) }
if let Some(ref mut x) = self.include_ext_alt_text { params.push((Cow::Borrowed("include_ext_alt_text"), x.to_parameter_value())) }
if let Some(ref mut x) = self.tweet_mode { params.push((Cow::Borrowed("tweet_mode"), x.to_parameter_value())) }
let url = "https://api.twitter.com/1.1/statuses/update.json";
execute_core(self._client, Post, url, params)
}
}
pub struct StatusesDestroyRequestBuilder<'a, A: 'a + Authenticator, H: 'a + HttpHandler> {
_client: &'a TwitterClient<A, H>,
id: i64,
trim_user: Option<bool>,
include_ext_alt_text: Option<bool>,
tweet_mode: Option<TweetMode>,
}
impl<'a, A: Authenticator, H: HttpHandler> StatusesDestroyRequestBuilder<'a, A, H> {
pub fn trim_user(&'a mut self, val: bool) -> &'a mut Self {
self.trim_user = Some(val);
self
}
pub fn include_ext_alt_text(&'a mut self, val: bool) -> &'a mut Self {
self.include_ext_alt_text = Some(val);
self
}
pub fn tweet_mode(&'a mut self, val: TweetMode) -> &'a mut Self {
self.tweet_mode = Some(val);
self
}
pub fn execute(&'a mut self) -> TwitterResult<Tweet> {
let mut params = Vec::with_capacity(3);
if let Some(ref mut x) = self.trim_user { params.push((Cow::Borrowed("trim_user"), x.to_parameter_value())) }
if let Some(ref mut x) = self.include_ext_alt_text { params.push((Cow::Borrowed("include_ext_alt_text"), x.to_parameter_value())) }
if let Some(ref mut x) = self.tweet_mode { params.push((Cow::Borrowed("tweet_mode"), x.to_parameter_value())) }
let url = format!("https://api.twitter.com/1.1/statuses/destroy/{id}.json", id = self.id);
execute_core(self._client, Post, url, params)
}
}
pub struct StatusesRetweetRequestBuilder<'a, A: 'a + Authenticator, H: 'a + HttpHandler> {
_client: &'a TwitterClient<A, H>,
id: i64,
trim_user: Option<bool>,
include_ext_alt_text: Option<bool>,
tweet_mode: Option<TweetMode>,
}
impl<'a, A: Authenticator, H: HttpHandler> StatusesRetweetRequestBuilder<'a, A, H> {
pub fn trim_user(&'a mut self, val: bool) -> &'a mut Self {
self.trim_user = Some(val);
self
}
pub fn include_ext_alt_text(&'a mut self, val: bool) -> &'a mut Self {
self.include_ext_alt_text = Some(val);
self
}
pub fn tweet_mode(&'a mut self, val: TweetMode) -> &'a mut Self {
self.tweet_mode = Some(val);
self
}
pub fn execute(&'a mut self) -> TwitterResult<Tweet> {
let mut params = Vec::with_capacity(3);
if let Some(ref mut x) = self.trim_user { params.push((Cow::Borrowed("trim_user"), x.to_parameter_value())) }
if let Some(ref mut x) = self.include_ext_alt_text { params.push((Cow::Borrowed("include_ext_alt_text"), x.to_parameter_value())) }
if let Some(ref mut x) = self.tweet_mode { params.push((Cow::Borrowed("tweet_mode"), x.to_parameter_value())) }
let url = format!("https://api.twitter.com/1.1/statuses/retweet/{id}.json", id = self.id);
execute_core(self._client, Post, url, params)
}
}
pub struct StatusesUnretweetRequestBuilder<'a, A: 'a + Authenticator, H: 'a + HttpHandler> {
_client: &'a TwitterClient<A, H>,
id: i64,
trim_user: Option<bool>,
include_ext_alt_text: Option<bool>,
tweet_mode: Option<TweetMode>,
}
impl<'a, A: Authenticator, H: HttpHandler> StatusesUnretweetRequestBuilder<'a, A, H> {
pub fn trim_user(&'a mut self, val: bool) -> &'a mut Self {
self.trim_user = Some(val);
self
}
pub fn include_ext_alt_text(&'a mut self, val: bool) -> &'a mut Self {
self.include_ext_alt_text = Some(val);
self
}
pub fn tweet_mode(&'a mut self, val: TweetMode) -> &'a mut Self {
self.tweet_mode = Some(val);
self
}
pub fn execute(&'a mut self) -> TwitterResult<Tweet> {
let mut params = Vec::with_capacity(3);
if let Some(ref mut x) = self.trim_user { params.push((Cow::Borrowed("trim_user"), x.to_parameter_value())) }
if let Some(ref mut x) = self.include_ext_alt_text { params.push((Cow::Borrowed("include_ext_alt_text"), x.to_parameter_value())) }
if let Some(ref mut x) = self.tweet_mode { params.push((Cow::Borrowed("tweet_mode"), x.to_parameter_value())) }
let url = format!("https://api.twitter.com/1.1/statuses/unretweet/{id}.json", id = self.id);
execute_core(self._client, Post, url, params)
}
}
#[derive(Clone, Debug)]
pub struct HelpClient<'a, A: 'a + Authenticator, H: 'a + HttpHandler> {
client: &'a TwitterClient<A, H>
}
impl<'a, A: Authenticator, H: HttpHandler> HelpClient<'a, A, H> {
pub fn configuration(&self) -> HelpConfigurationRequestBuilder<'a, A, H> {
HelpConfigurationRequestBuilder {
_client: self.client,
}
}
pub fn languages(&self) -> HelpLanguagesRequestBuilder<'a, A, H> {
HelpLanguagesRequestBuilder {
_client: self.client,
}
}
pub fn privacy(&self) -> HelpPrivacyRequestBuilder<'a, A, H> {
HelpPrivacyRequestBuilder {
_client: self.client,
}
}
pub fn tos(&self) -> HelpTosRequestBuilder<'a, A, H> {
HelpTosRequestBuilder {
_client: self.client,
}
}
}
pub struct HelpConfigurationRequestBuilder<'a, A: 'a + Authenticator, H: 'a + HttpHandler> {
_client: &'a TwitterClient<A, H>,
}
impl<'a, A: Authenticator, H: HttpHandler> HelpConfigurationRequestBuilder<'a, A, H> {
pub fn execute(&'a mut self) -> TwitterResult<Configuration> {
let params = Vec::<(Cow<str>, ParameterValue)>::new();
let url = "https://api.twitter.com/1.1/help/configuration.json";
execute_core(self._client, Get, url, params)
}
}
pub struct HelpLanguagesRequestBuilder<'a, A: 'a + Authenticator, H: 'a + HttpHandler> {
_client: &'a TwitterClient<A, H>,
}
impl<'a, A: Authenticator, H: HttpHandler> HelpLanguagesRequestBuilder<'a, A, H> {
pub fn execute(&'a mut self) -> TwitterResult<Vec<Language>> {
let params = Vec::<(Cow<str>, ParameterValue)>::new();
let url = "https://api.twitter.com/1.1/help/languages.json";
execute_core(self._client, Get, url, params)
}
}
pub struct HelpPrivacyRequestBuilder<'a, A: 'a + Authenticator, H: 'a + HttpHandler> {
_client: &'a TwitterClient<A, H>,
}
impl<'a, A: Authenticator, H: HttpHandler> HelpPrivacyRequestBuilder<'a, A, H> {
pub fn execute(&'a mut self) -> TwitterResult<PrivacyResponse> {
let params = Vec::<(Cow<str>, ParameterValue)>::new();
let url = "https://api.twitter.com/1.1/help/privacy.json";
execute_core(self._client, Get, url, params)
}
}
pub struct HelpTosRequestBuilder<'a, A: 'a + Authenticator, H: 'a + HttpHandler> {
_client: &'a TwitterClient<A, H>,
}
impl<'a, A: Authenticator, H: HttpHandler> HelpTosRequestBuilder<'a, A, H> {
pub fn execute(&'a mut self) -> TwitterResult<TosResponse> {
let params = Vec::<(Cow<str>, ParameterValue)>::new();
let url = "https://api.twitter.com/1.1/help/tos.json";
execute_core(self._client, Get, url, params)
}
}
#[derive(Clone, Debug)]
pub struct UsersClient<'a, A: 'a + Authenticator, H: 'a + HttpHandler> {
client: &'a TwitterClient<A, H>
}
impl<'a, A: Authenticator, H: HttpHandler> UsersClient<'a, A, H> {
pub fn contributees(&self) -> UsersContributeesRequestBuilder<'a, A, H> {
UsersContributeesRequestBuilder {
_client: self.client,
user_id: None,
screen_name: None,
include_entities: None,
skip_status: None,
include_ext_alt_text: None,
tweet_mode: None,
}
}
pub fn contributors(&self) -> UsersContributorsRequestBuilder<'a, A, H> {
UsersContributorsRequestBuilder {
_client: self.client,
user_id: None,
screen_name: None,
include_entities: None,
skip_status: None,
include_ext_alt_text: None,
tweet_mode: None,
}
}
pub fn lookup(&self) -> UsersLookupRequestBuilder<'a, A, H> {
UsersLookupRequestBuilder {
_client: self.client,
user_id: None,
screen_name: None,
include_entities: None,
include_ext_alt_text: None,
tweet_mode: None,
}
}
pub fn profile_banner(&self) -> UsersProfileBannerRequestBuilder<'a, A, H> {
UsersProfileBannerRequestBuilder {
_client: self.client,
user_id: None,
screen_name: None,
}
}
pub fn search<T1: Into<Cow<'a, str>>>(&self, q: T1) -> UsersSearchRequestBuilder<'a, A, H> {
UsersSearchRequestBuilder {
_client: self.client,
q: q.into(),
page: None,
count: None,
include_entities: None,
include_ext_alt_text: None,
tweet_mode: None,
}
}
pub fn show(&self) -> UsersShowRequestBuilder<'a, A, H> {
UsersShowRequestBuilder {
_client: self.client,
user_id: None,
screen_name: None,
include_entities: None,
include_ext_alt_text: None,
tweet_mode: None,
}
}
pub fn suggestions(&self) -> UsersSuggestionsRequestBuilder<'a, A, H> {
UsersSuggestionsRequestBuilder {
_client: self.client,
lang: None,
}
}
pub fn suggestion<T1: Into<Cow<'a, str>>>(&self, slug: T1) -> UsersSuggestionRequestBuilder<'a, A, H> {
UsersSuggestionRequestBuilder {
_client: self.client,
slug: slug.into(),
lang: None,
}
}
pub fn suggested_members<T1: Into<Cow<'a, str>>>(&self, slug: T1) -> UsersSuggestedMembersRequestBuilder<'a, A, H> {
UsersSuggestedMembersRequestBuilder {
_client: self.client,
slug: slug.into(),
}
}
pub fn report_spam(&self) -> UsersReportSpamRequestBuilder<'a, A, H> {
UsersReportSpamRequestBuilder {
_client: self.client,
screen_name: None,
user_id: None,
include_ext_alt_text: None,
tweet_mode: None,
}
}
}
pub struct UsersContributeesRequestBuilder<'a, A: 'a + Authenticator, H: 'a + HttpHandler> {
_client: &'a TwitterClient<A, H>,
user_id: Option<i64>,
screen_name: Option<Cow<'a, str>>,
include_entities: Option<bool>,
skip_status: Option<bool>,
include_ext_alt_text: Option<bool>,
tweet_mode: Option<TweetMode>,
}
impl<'a, A: Authenticator, H: HttpHandler> UsersContributeesRequestBuilder<'a, A, H> {
pub fn user_id(&'a mut self, val: i64) -> &'a mut Self {
self.user_id = Some(val);
self
}
pub fn screen_name<T1: Into<Cow<'a, str>>>(&'a mut self, val: T1) -> &'a mut Self {
self.screen_name = Some(val.into());
self
}
pub fn include_entities(&'a mut self, val: bool) -> &'a mut Self {
self.include_entities = Some(val);
self
}
pub fn skip_status(&'a mut self, val: bool) -> &'a mut Self {
self.skip_status = Some(val);
self
}
pub fn include_ext_alt_text(&'a mut self, val: bool) -> &'a mut Self {
self.include_ext_alt_text = Some(val);
self
}
pub fn tweet_mode(&'a mut self, val: TweetMode) -> &'a mut Self {
self.tweet_mode = Some(val);
self
}
pub fn execute(&'a mut self) -> TwitterResult<Vec<User>> {
let mut params = Vec::with_capacity(6);
if let Some(ref mut x) = self.user_id { params.push((Cow::Borrowed("user_id"), x.to_parameter_value())) }
if let Some(ref mut x) = self.screen_name { params.push((Cow::Borrowed("screen_name"), x.to_parameter_value())) }
if let Some(ref mut x) = self.include_entities { params.push((Cow::Borrowed("include_entities"), x.to_parameter_value())) }
if let Some(ref mut x) = self.skip_status { params.push((Cow::Borrowed("skip_status"), x.to_parameter_value())) }
if let Some(ref mut x) = self.include_ext_alt_text { params.push((Cow::Borrowed("include_ext_alt_text"), x.to_parameter_value())) }
if let Some(ref mut x) = self.tweet_mode { params.push((Cow::Borrowed("tweet_mode"), x.to_parameter_value())) }
let url = "https://api.twitter.com/1.1/users/contributees.json";
execute_core(self._client, Get, url, params)
}
}
pub struct UsersContributorsRequestBuilder<'a, A: 'a + Authenticator, H: 'a + HttpHandler> {
_client: &'a TwitterClient<A, H>,
user_id: Option<i64>,
screen_name: Option<Cow<'a, str>>,
include_entities: Option<bool>,
skip_status: Option<bool>,
include_ext_alt_text: Option<bool>,
tweet_mode: Option<TweetMode>,
}
impl<'a, A: Authenticator, H: HttpHandler> UsersContributorsRequestBuilder<'a, A, H> {
pub fn user_id(&'a mut self, val: i64) -> &'a mut Self {
self.user_id = Some(val);
self
}
pub fn screen_name<T1: Into<Cow<'a, str>>>(&'a mut self, val: T1) -> &'a mut Self {
self.screen_name = Some(val.into());
self
}
pub fn include_entities(&'a mut self, val: bool) -> &'a mut Self {
self.include_entities = Some(val);
self
}
pub fn skip_status(&'a mut self, val: bool) -> &'a mut Self {
self.skip_status = Some(val);
self
}
pub fn include_ext_alt_text(&'a mut self, val: bool) -> &'a mut Self {
self.include_ext_alt_text = Some(val);
self
}
pub fn tweet_mode(&'a mut self, val: TweetMode) -> &'a mut Self {
self.tweet_mode = Some(val);
self
}
pub fn execute(&'a mut self) -> TwitterResult<Vec<User>> {
let mut params = Vec::with_capacity(6);
if let Some(ref mut x) = self.user_id { params.push((Cow::Borrowed("user_id"), x.to_parameter_value())) }
if let Some(ref mut x) = self.screen_name { params.push((Cow::Borrowed("screen_name"), x.to_parameter_value())) }
if let Some(ref mut x) = self.include_entities { params.push((Cow::Borrowed("include_entities"), x.to_parameter_value())) }
if let Some(ref mut x) = self.skip_status { params.push((Cow::Borrowed("skip_status"), x.to_parameter_value())) }
if let Some(ref mut x) = self.include_ext_alt_text { params.push((Cow::Borrowed("include_ext_alt_text"), x.to_parameter_value())) }
if let Some(ref mut x) = self.tweet_mode { params.push((Cow::Borrowed("tweet_mode"), x.to_parameter_value())) }
let url = "https://api.twitter.com/1.1/users/contributors.json";
execute_core(self._client, Get, url, params)
}
}
pub struct UsersLookupRequestBuilder<'a, A: 'a + Authenticator, H: 'a + HttpHandler> {
_client: &'a TwitterClient<A, H>,
user_id: Option<String>,
screen_name: Option<String>,
include_entities: Option<bool>,
include_ext_alt_text: Option<bool>,
tweet_mode: Option<TweetMode>,
}
impl<'a, A: Authenticator, H: HttpHandler> UsersLookupRequestBuilder<'a, A, H> {
pub fn user_id<T1: IntoIterator<Item = i64>>(&'a mut self, val: T1) -> &'a mut Self {
self.user_id = Some(collection_paramter(val));
self
}
pub fn screen_name<T1: AsRef<str>, T2: IntoIterator<Item = T1>>(&'a mut self, val: T2) -> &'a mut Self {
self.screen_name = Some(str_collection_parameter(val));
self
}
pub fn include_entities(&'a mut self, val: bool) -> &'a mut Self {
self.include_entities = Some(val);
self
}
pub fn include_ext_alt_text(&'a mut self, val: bool) -> &'a mut Self {
self.include_ext_alt_text = Some(val);
self
}
pub fn tweet_mode(&'a mut self, val: TweetMode) -> &'a mut Self {
self.tweet_mode = Some(val);
self
}
pub fn execute(&'a mut self) -> TwitterResult<Vec<User>> {
let mut params = Vec::with_capacity(5);
if let Some(ref mut x) = self.user_id { params.push((Cow::Borrowed("user_id"), x.to_parameter_value())) }
if let Some(ref mut x) = self.screen_name { params.push((Cow::Borrowed("screen_name"), x.to_parameter_value())) }
if let Some(ref mut x) = self.include_entities { params.push((Cow::Borrowed("include_entities"), x.to_parameter_value())) }
if let Some(ref mut x) = self.include_ext_alt_text { params.push((Cow::Borrowed("include_ext_alt_text"), x.to_parameter_value())) }
if let Some(ref mut x) = self.tweet_mode { params.push((Cow::Borrowed("tweet_mode"), x.to_parameter_value())) }
let url = "https://api.twitter.com/1.1/users/lookup.json";
execute_core(self._client, Get, url, params)
}
}
pub struct UsersProfileBannerRequestBuilder<'a, A: 'a + Authenticator, H: 'a + HttpHandler> {
_client: &'a TwitterClient<A, H>,
user_id: Option<i64>,
screen_name: Option<Cow<'a, str>>,
}
impl<'a, A: Authenticator, H: HttpHandler> UsersProfileBannerRequestBuilder<'a, A, H> {
pub fn user_id(&'a mut self, val: i64) -> &'a mut Self {
self.user_id = Some(val);
self
}
pub fn screen_name<T1: Into<Cow<'a, str>>>(&'a mut self, val: T1) -> &'a mut Self {
self.screen_name = Some(val.into());
self
}
pub fn execute(&'a mut self) -> TwitterResult<ProfileBannerSizes> {
let mut params = Vec::with_capacity(2);
if let Some(ref mut x) = self.user_id { params.push((Cow::Borrowed("user_id"), x.to_parameter_value())) }
if let Some(ref mut x) = self.screen_name { params.push((Cow::Borrowed("screen_name"), x.to_parameter_value())) }
let url = "https://api.twitter.com/1.1/users/profile_banner.json";
execute_core(self._client, Get, url, params)
}
}
pub struct UsersSearchRequestBuilder<'a, A: 'a + Authenticator, H: 'a + HttpHandler> {
_client: &'a TwitterClient<A, H>,
q: Cow<'a, str>,
page: Option<i32>,
count: Option<i32>,
include_entities: Option<bool>,
include_ext_alt_text: Option<bool>,
tweet_mode: Option<TweetMode>,
}
impl<'a, A: Authenticator, H: HttpHandler> UsersSearchRequestBuilder<'a, A, H> {
pub fn page(&'a mut self, val: i32) -> &'a mut Self {
self.page = Some(val);
self
}
pub fn count(&'a mut self, val: i32) -> &'a mut Self {
self.count = Some(val);
self
}
pub fn include_entities(&'a mut self, val: bool) -> &'a mut Self {
self.include_entities = Some(val);
self
}
pub fn include_ext_alt_text(&'a mut self, val: bool) -> &'a mut Self {
self.include_ext_alt_text = Some(val);
self
}
pub fn tweet_mode(&'a mut self, val: TweetMode) -> &'a mut Self {
self.tweet_mode = Some(val);
self
}
pub fn execute(&'a mut self) -> TwitterResult<Vec<User>> {
let mut params = Vec::with_capacity(6);
params.push((Cow::Borrowed("q"), self.q.to_parameter_value()));
if let Some(ref mut x) = self.page { params.push((Cow::Borrowed("page"), x.to_parameter_value())) }
if let Some(ref mut x) = self.count { params.push((Cow::Borrowed("count"), x.to_parameter_value())) }
if let Some(ref mut x) = self.include_entities { params.push((Cow::Borrowed("include_entities"), x.to_parameter_value())) }
if let Some(ref mut x) = self.include_ext_alt_text { params.push((Cow::Borrowed("include_ext_alt_text"), x.to_parameter_value())) }
if let Some(ref mut x) = self.tweet_mode { params.push((Cow::Borrowed("tweet_mode"), x.to_parameter_value())) }
let url = "https://api.twitter.com/1.1/users/search.json";
execute_core(self._client, Get, url, params)
}
}
pub struct UsersShowRequestBuilder<'a, A: 'a + Authenticator, H: 'a + HttpHandler> {
_client: &'a TwitterClient<A, H>,
user_id: Option<i64>,
screen_name: Option<Cow<'a, str>>,
include_entities: Option<bool>,
include_ext_alt_text: Option<bool>,
tweet_mode: Option<TweetMode>,
}
impl<'a, A: Authenticator, H: HttpHandler> UsersShowRequestBuilder<'a, A, H> {
pub fn user_id(&'a mut self, val: i64) -> &'a mut Self {
self.user_id = Some(val);
self
}
pub fn screen_name<T1: Into<Cow<'a, str>>>(&'a mut self, val: T1) -> &'a mut Self {
self.screen_name = Some(val.into());
self
}
pub fn include_entities(&'a mut self, val: bool) -> &'a mut Self {
self.include_entities = Some(val);
self
}
pub fn include_ext_alt_text(&'a mut self, val: bool) -> &'a mut Self {
self.include_ext_alt_text = Some(val);
self
}
pub fn tweet_mode(&'a mut self, val: TweetMode) -> &'a mut Self {
self.tweet_mode = Some(val);
self
}
pub fn execute(&'a mut self) -> TwitterResult<User> {
let mut params = Vec::with_capacity(5);
if let Some(ref mut x) = self.user_id { params.push((Cow::Borrowed("user_id"), x.to_parameter_value())) }
if let Some(ref mut x) = self.screen_name { params.push((Cow::Borrowed("screen_name"), x.to_parameter_value())) }
if let Some(ref mut x) = self.include_entities { params.push((Cow::Borrowed("include_entities"), x.to_parameter_value())) }
if let Some(ref mut x) = self.include_ext_alt_text { params.push((Cow::Borrowed("include_ext_alt_text"), x.to_parameter_value())) }
if let Some(ref mut x) = self.tweet_mode { params.push((Cow::Borrowed("tweet_mode"), x.to_parameter_value())) }
let url = "https://api.twitter.com/1.1/users/show.json";
execute_core(self._client, Get, url, params)
}
}
pub struct UsersSuggestionsRequestBuilder<'a, A: 'a + Authenticator, H: 'a + HttpHandler> {
_client: &'a TwitterClient<A, H>,
lang: Option<Cow<'a, str>>,
}
impl<'a, A: Authenticator, H: HttpHandler> UsersSuggestionsRequestBuilder<'a, A, H> {
pub fn lang<T1: Into<Cow<'a, str>>>(&'a mut self, val: T1) -> &'a mut Self {
self.lang = Some(val.into());
self
}
pub fn execute(&'a mut self) -> TwitterResult<Vec<UserCategory>> {
let mut params = Vec::with_capacity(1);
if let Some(ref mut x) = self.lang { params.push((Cow::Borrowed("lang"), x.to_parameter_value())) }
let url = "https://api.twitter.com/1.1/users/suggestions.json";
execute_core(self._client, Get, url, params)
}
}
pub struct UsersSuggestionRequestBuilder<'a, A: 'a + Authenticator, H: 'a + HttpHandler> {
_client: &'a TwitterClient<A, H>,
slug: Cow<'a, str>,
lang: Option<Cow<'a, str>>,
}
impl<'a, A: Authenticator, H: HttpHandler> UsersSuggestionRequestBuilder<'a, A, H> {
pub fn lang<T1: Into<Cow<'a, str>>>(&'a mut self, val: T1) -> &'a mut Self {
self.lang = Some(val.into());
self
}
pub fn execute(&'a mut self) -> TwitterResult<SuggestedUsers> {
let mut params = Vec::with_capacity(1);
if let Some(ref mut x) = self.lang { params.push((Cow::Borrowed("lang"), x.to_parameter_value())) }
let url = format!("https://api.twitter.com/1.1/users/suggestions/{slug}.json", slug = self.slug);
execute_core(self._client, Get, url, params)
}
}
pub struct UsersSuggestedMembersRequestBuilder<'a, A: 'a + Authenticator, H: 'a + HttpHandler> {
_client: &'a TwitterClient<A, H>,
slug: Cow<'a, str>,
}
impl<'a, A: Authenticator, H: HttpHandler> UsersSuggestedMembersRequestBuilder<'a, A, H> {
pub fn execute(&'a mut self) -> TwitterResult<Vec<User>> {
let params = Vec::<(Cow<str>, ParameterValue)>::new();
let url = format!("https://api.twitter.com/1.1/users/suggestions/{slug}/members.json", slug = self.slug);
execute_core(self._client, Get, url, params)
}
}
pub struct UsersReportSpamRequestBuilder<'a, A: 'a + Authenticator, H: 'a + HttpHandler> {
_client: &'a TwitterClient<A, H>,
screen_name: Option<Cow<'a, str>>,
user_id: Option<i64>,
include_ext_alt_text: Option<bool>,
tweet_mode: Option<TweetMode>,
}
impl<'a, A: Authenticator, H: HttpHandler> UsersReportSpamRequestBuilder<'a, A, H> {
pub fn screen_name<T1: Into<Cow<'a, str>>>(&'a mut self, val: T1) -> &'a mut Self {
self.screen_name = Some(val.into());
self
}
pub fn user_id(&'a mut self, val: i64) -> &'a mut Self {
self.user_id = Some(val);
self
}
pub fn include_ext_alt_text(&'a mut self, val: bool) -> &'a mut Self {
self.include_ext_alt_text = Some(val);
self
}
pub fn tweet_mode(&'a mut self, val: TweetMode) -> &'a mut Self {
self.tweet_mode = Some(val);
self
}
pub fn execute(&'a mut self) -> TwitterResult<User> {
let mut params = Vec::with_capacity(4);
if let Some(ref mut x) = self.screen_name { params.push((Cow::Borrowed("screen_name"), x.to_parameter_value())) }
if let Some(ref mut x) = self.user_id { params.push((Cow::Borrowed("user_id"), x.to_parameter_value())) }
if let Some(ref mut x) = self.include_ext_alt_text { params.push((Cow::Borrowed("include_ext_alt_text"), x.to_parameter_value())) }
if let Some(ref mut x) = self.tweet_mode { params.push((Cow::Borrowed("tweet_mode"), x.to_parameter_value())) }
let url = "https://api.twitter.com/1.1/users/report_spam.json";
execute_core(self._client, Post, url, params)
}
}
#[derive(Clone, Debug)]
pub struct SavedSearchesClient<'a, A: 'a + Authenticator, H: 'a + HttpHandler> {
client: &'a TwitterClient<A, H>
}
impl<'a, A: Authenticator, H: HttpHandler> SavedSearchesClient<'a, A, H> {
pub fn list(&self) -> SavedSearchesListRequestBuilder<'a, A, H> {
SavedSearchesListRequestBuilder {
_client: self.client,
}
}
pub fn show(&self, id: i64) -> SavedSearchesShowRequestBuilder<'a, A, H> {
SavedSearchesShowRequestBuilder {
_client: self.client,
id: id,
}
}
pub fn create<T1: Into<Cow<'a, str>>>(&self, query: T1) -> SavedSearchesCreateRequestBuilder<'a, A, H> {
SavedSearchesCreateRequestBuilder {
_client: self.client,
query: query.into(),
}
}
pub fn destroy(&self, id: i64) -> SavedSearchesDestroyRequestBuilder<'a, A, H> {
SavedSearchesDestroyRequestBuilder {
_client: self.client,
id: id,
}
}
}
pub struct SavedSearchesListRequestBuilder<'a, A: 'a + Authenticator, H: 'a + HttpHandler> {
_client: &'a TwitterClient<A, H>,
}
impl<'a, A: Authenticator, H: HttpHandler> SavedSearchesListRequestBuilder<'a, A, H> {
pub fn execute(&'a mut self) -> TwitterResult<Vec<SavedSearch>> {
let params = Vec::<(Cow<str>, ParameterValue)>::new();
let url = "https://api.twitter.com/1.1/saved_searches/list.json";
execute_core(self._client, Get, url, params)
}
}
pub struct SavedSearchesShowRequestBuilder<'a, A: 'a + Authenticator, H: 'a + HttpHandler> {
_client: &'a TwitterClient<A, H>,
id: i64,
}
impl<'a, A: Authenticator, H: HttpHandler> SavedSearchesShowRequestBuilder<'a, A, H> {
pub fn execute(&'a mut self) -> TwitterResult<SavedSearch> {
let params = Vec::<(Cow<str>, ParameterValue)>::new();
let url = format!("https://api.twitter.com/1.1/saved_searches/show/{id}.json", id = self.id);
execute_core(self._client, Get, url, params)
}
}
pub struct SavedSearchesCreateRequestBuilder<'a, A: 'a + Authenticator, H: 'a + HttpHandler> {
_client: &'a TwitterClient<A, H>,
query: Cow<'a, str>,
}
impl<'a, A: Authenticator, H: HttpHandler> SavedSearchesCreateRequestBuilder<'a, A, H> {
pub fn execute(&'a mut self) -> TwitterResult<SavedSearch> {
let mut params = Vec::with_capacity(1);
params.push((Cow::Borrowed("query"), self.query.to_parameter_value()));
let url = "https://api.twitter.com/1.1/saved_searches/create.json";
execute_core(self._client, Post, url, params)
}
}
pub struct SavedSearchesDestroyRequestBuilder<'a, A: 'a + Authenticator, H: 'a + HttpHandler> {
_client: &'a TwitterClient<A, H>,
id: i64,
}
impl<'a, A: Authenticator, H: HttpHandler> SavedSearchesDestroyRequestBuilder<'a, A, H> {
pub fn execute(&'a mut self) -> TwitterResult<SavedSearch> {
let params = Vec::<(Cow<str>, ParameterValue)>::new();
let url = format!("https://api.twitter.com/1.1/saved_searches/destroy/{id}.json", id = self.id);
execute_core(self._client, Post, url, params)
}
}
#[derive(Clone, Debug)]
pub struct ListsMembersClient<'a, A: 'a + Authenticator, H: 'a + HttpHandler> {
client: &'a TwitterClient<A, H>
}
impl<'a, A: Authenticator, H: HttpHandler> ListsMembersClient<'a, A, H> {
pub fn list(&self) -> ListsMembersListRequestBuilder<'a, A, H> {
ListsMembersListRequestBuilder {
_client: self.client,
list_id: None,
slug: None,
owner_screen_name: None,
owner_id: None,
count: None,
cursor: None,
include_entities: None,
skip_status: None,
include_ext_alt_text: None,
tweet_mode: None,
}
}
pub fn show(&self) -> ListsMembersShowRequestBuilder<'a, A, H> {
ListsMembersShowRequestBuilder {
_client: self.client,
list_id: None,
slug: None,
owner_screen_name: None,
owner_id: None,
user_id: None,
screen_name: None,
include_entities: None,
skip_status: None,
include_ext_alt_text: None,
tweet_mode: None,
}
}
pub fn create(&self) -> ListsMembersCreateRequestBuilder<'a, A, H> {
ListsMembersCreateRequestBuilder {
_client: self.client,
list_id: None,
slug: None,
owner_screen_name: None,
owner_id: None,
user_id: None,
screen_name: None,
}
}
pub fn create_all(&self) -> ListsMembersCreateAllRequestBuilder<'a, A, H> {
ListsMembersCreateAllRequestBuilder {
_client: self.client,
list_id: None,
slug: None,
owner_screen_name: None,
owner_id: None,
user_id: None,
screen_name: None,
}
}
pub fn destroy(&self) -> ListsMembersDestroyRequestBuilder<'a, A, H> {
ListsMembersDestroyRequestBuilder {
_client: self.client,
list_id: None,
slug: None,
owner_screen_name: None,
owner_id: None,
user_id: None,
screen_name: None,
}
}
pub fn destroy_all(&self) -> ListsMembersDestroyAllRequestBuilder<'a, A, H> {
ListsMembersDestroyAllRequestBuilder {
_client: self.client,
list_id: None,
slug: None,
owner_screen_name: None,
owner_id: None,
user_id: None,
screen_name: None,
}
}
}
pub struct ListsMembersListRequestBuilder<'a, A: 'a + Authenticator, H: 'a + HttpHandler> {
_client: &'a TwitterClient<A, H>,
list_id: Option<i64>,
slug: Option<Cow<'a, str>>,
owner_screen_name: Option<Cow<'a, str>>,
owner_id: Option<i64>,
count: Option<i32>,
cursor: Option<i64>,
include_entities: Option<bool>,
skip_status: Option<bool>,
include_ext_alt_text: Option<bool>,
tweet_mode: Option<TweetMode>,
}
impl<'a, A: Authenticator, H: HttpHandler> ListsMembersListRequestBuilder<'a, A, H> {
pub fn list_id(&'a mut self, val: i64) -> &'a mut Self {
self.list_id = Some(val);
self
}
pub fn slug<T1: Into<Cow<'a, str>>>(&'a mut self, val: T1) -> &'a mut Self {
self.slug = Some(val.into());
self
}
pub fn owner_screen_name<T1: Into<Cow<'a, str>>>(&'a mut self, val: T1) -> &'a mut Self {
self.owner_screen_name = Some(val.into());
self
}
pub fn owner_id(&'a mut self, val: i64) -> &'a mut Self {
self.owner_id = Some(val);
self
}
pub fn count(&'a mut self, val: i32) -> &'a mut Self {
self.count = Some(val);
self
}
pub fn cursor(&'a mut self, val: i64) -> &'a mut Self {
self.cursor = Some(val);
self
}
pub fn include_entities(&'a mut self, val: bool) -> &'a mut Self {
self.include_entities = Some(val);
self
}
pub fn skip_status(&'a mut self, val: bool) -> &'a mut Self {
self.skip_status = Some(val);
self
}
pub fn include_ext_alt_text(&'a mut self, val: bool) -> &'a mut Self {
self.include_ext_alt_text = Some(val);
self
}
pub fn tweet_mode(&'a mut self, val: TweetMode) -> &'a mut Self {
self.tweet_mode = Some(val);
self
}
pub fn execute(&'a mut self) -> TwitterResult<CursorUsers> {
let mut params = Vec::with_capacity(10);
if let Some(ref mut x) = self.list_id { params.push((Cow::Borrowed("list_id"), x.to_parameter_value())) }
if let Some(ref mut x) = self.slug { params.push((Cow::Borrowed("slug"), x.to_parameter_value())) }
if let Some(ref mut x) = self.owner_screen_name { params.push((Cow::Borrowed("owner_screen_name"), x.to_parameter_value())) }
if let Some(ref mut x) = self.owner_id { params.push((Cow::Borrowed("owner_id"), x.to_parameter_value())) }
if let Some(ref mut x) = self.count { params.push((Cow::Borrowed("count"), x.to_parameter_value())) }
if let Some(ref mut x) = self.cursor { params.push((Cow::Borrowed("cursor"), x.to_parameter_value())) }
if let Some(ref mut x) = self.include_entities { params.push((Cow::Borrowed("include_entities"), x.to_parameter_value())) }
if let Some(ref mut x) = self.skip_status { params.push((Cow::Borrowed("skip_status"), x.to_parameter_value())) }
if let Some(ref mut x) = self.include_ext_alt_text { params.push((Cow::Borrowed("include_ext_alt_text"), x.to_parameter_value())) }
if let Some(ref mut x) = self.tweet_mode { params.push((Cow::Borrowed("tweet_mode"), x.to_parameter_value())) }
let url = "https://api.twitter.com/1.1/lists/members.json";
execute_core(self._client, Get, url, params)
}
}
pub struct ListsMembersShowRequestBuilder<'a, A: 'a + Authenticator, H: 'a + HttpHandler> {
_client: &'a TwitterClient<A, H>,
list_id: Option<i64>,
slug: Option<Cow<'a, str>>,
owner_screen_name: Option<Cow<'a, str>>,
owner_id: Option<i64>,
user_id: Option<i64>,
screen_name: Option<Cow<'a, str>>,
include_entities: Option<bool>,
skip_status: Option<bool>,
include_ext_alt_text: Option<bool>,
tweet_mode: Option<TweetMode>,
}
impl<'a, A: Authenticator, H: HttpHandler> ListsMembersShowRequestBuilder<'a, A, H> {
pub fn list_id(&'a mut self, val: i64) -> &'a mut Self {
self.list_id = Some(val);
self
}
pub fn slug<T1: Into<Cow<'a, str>>>(&'a mut self, val: T1) -> &'a mut Self {
self.slug = Some(val.into());
self
}
pub fn owner_screen_name<T1: Into<Cow<'a, str>>>(&'a mut self, val: T1) -> &'a mut Self {
self.owner_screen_name = Some(val.into());
self
}
pub fn owner_id(&'a mut self, val: i64) -> &'a mut Self {
self.owner_id = Some(val);
self
}
pub fn user_id(&'a mut self, val: i64) -> &'a mut Self {
self.user_id = Some(val);
self
}
pub fn screen_name<T1: Into<Cow<'a, str>>>(&'a mut self, val: T1) -> &'a mut Self {
self.screen_name = Some(val.into());
self
}
pub fn include_entities(&'a mut self, val: bool) -> &'a mut Self {
self.include_entities = Some(val);
self
}
pub fn skip_status(&'a mut self, val: bool) -> &'a mut Self {
self.skip_status = Some(val);
self
}
pub fn include_ext_alt_text(&'a mut self, val: bool) -> &'a mut Self {
self.include_ext_alt_text = Some(val);
self
}
pub fn tweet_mode(&'a mut self, val: TweetMode) -> &'a mut Self {
self.tweet_mode = Some(val);
self
}
pub fn execute(&'a mut self) -> TwitterResult<User> {
let mut params = Vec::with_capacity(10);
if let Some(ref mut x) = self.list_id { params.push((Cow::Borrowed("list_id"), x.to_parameter_value())) }
if let Some(ref mut x) = self.slug { params.push((Cow::Borrowed("slug"), x.to_parameter_value())) }
if let Some(ref mut x) = self.owner_screen_name { params.push((Cow::Borrowed("owner_screen_name"), x.to_parameter_value())) }
if let Some(ref mut x) = self.owner_id { params.push((Cow::Borrowed("owner_id"), x.to_parameter_value())) }
if let Some(ref mut x) = self.user_id { params.push((Cow::Borrowed("user_id"), x.to_parameter_value())) }
if let Some(ref mut x) = self.screen_name { params.push((Cow::Borrowed("screen_name"), x.to_parameter_value())) }
if let Some(ref mut x) = self.include_entities { params.push((Cow::Borrowed("include_entities"), x.to_parameter_value())) }
if let Some(ref mut x) = self.skip_status { params.push((Cow::Borrowed("skip_status"), x.to_parameter_value())) }
if let Some(ref mut x) = self.include_ext_alt_text { params.push((Cow::Borrowed("include_ext_alt_text"), x.to_parameter_value())) }
if let Some(ref mut x) = self.tweet_mode { params.push((Cow::Borrowed("tweet_mode"), x.to_parameter_value())) }
let url = "https://api.twitter.com/1.1/lists/members/show.json";
execute_core(self._client, Get, url, params)
}
}
pub struct ListsMembersCreateRequestBuilder<'a, A: 'a + Authenticator, H: 'a + HttpHandler> {
_client: &'a TwitterClient<A, H>,
list_id: Option<i64>,
slug: Option<Cow<'a, str>>,
owner_screen_name: Option<Cow<'a, str>>,
owner_id: Option<i64>,
user_id: Option<i64>,
screen_name: Option<Cow<'a, str>>,
}
impl<'a, A: Authenticator, H: HttpHandler> ListsMembersCreateRequestBuilder<'a, A, H> {
pub fn list_id(&'a mut self, val: i64) -> &'a mut Self {
self.list_id = Some(val);
self
}
pub fn slug<T1: Into<Cow<'a, str>>>(&'a mut self, val: T1) -> &'a mut Self {
self.slug = Some(val.into());
self
}
pub fn owner_screen_name<T1: Into<Cow<'a, str>>>(&'a mut self, val: T1) -> &'a mut Self {
self.owner_screen_name = Some(val.into());
self
}
pub fn owner_id(&'a mut self, val: i64) -> &'a mut Self {
self.owner_id = Some(val);
self
}
pub fn user_id(&'a mut self, val: i64) -> &'a mut Self {
self.user_id = Some(val);
self
}
pub fn screen_name<T1: Into<Cow<'a, str>>>(&'a mut self, val: T1) -> &'a mut Self {
self.screen_name = Some(val.into());
self
}
pub fn execute(&'a mut self) -> TwitterResult<List> {
let mut params = Vec::with_capacity(6);
if let Some(ref mut x) = self.list_id { params.push((Cow::Borrowed("list_id"), x.to_parameter_value())) }
if let Some(ref mut x) = self.slug { params.push((Cow::Borrowed("slug"), x.to_parameter_value())) }
if let Some(ref mut x) = self.owner_screen_name { params.push((Cow::Borrowed("owner_screen_name"), x.to_parameter_value())) }
if let Some(ref mut x) = self.owner_id { params.push((Cow::Borrowed("owner_id"), x.to_parameter_value())) }
if let Some(ref mut x) = self.user_id { params.push((Cow::Borrowed("user_id"), x.to_parameter_value())) }
if let Some(ref mut x) = self.screen_name { params.push((Cow::Borrowed("screen_name"), x.to_parameter_value())) }
let url = "https://api.twitter.com/1.1/lists/members/create.json";
execute_core(self._client, Post, url, params)
}
}
pub struct ListsMembersCreateAllRequestBuilder<'a, A: 'a + Authenticator, H: 'a + HttpHandler> {
_client: &'a TwitterClient<A, H>,
list_id: Option<i64>,
slug: Option<Cow<'a, str>>,
owner_screen_name: Option<Cow<'a, str>>,
owner_id: Option<i64>,
user_id: Option<String>,
screen_name: Option<String>,
}
impl<'a, A: Authenticator, H: HttpHandler> ListsMembersCreateAllRequestBuilder<'a, A, H> {
pub fn list_id(&'a mut self, val: i64) -> &'a mut Self {
self.list_id = Some(val);
self
}
pub fn slug<T1: Into<Cow<'a, str>>>(&'a mut self, val: T1) -> &'a mut Self {
self.slug = Some(val.into());
self
}
pub fn owner_screen_name<T1: Into<Cow<'a, str>>>(&'a mut self, val: T1) -> &'a mut Self {
self.owner_screen_name = Some(val.into());
self
}
pub fn owner_id(&'a mut self, val: i64) -> &'a mut Self {
self.owner_id = Some(val);
self
}
pub fn user_id<T1: IntoIterator<Item = i64>>(&'a mut self, val: T1) -> &'a mut Self {
self.user_id = Some(collection_paramter(val));
self
}
pub fn screen_name<T1: AsRef<str>, T2: IntoIterator<Item = T1>>(&'a mut self, val: T2) -> &'a mut Self {
self.screen_name = Some(str_collection_parameter(val));
self
}
pub fn execute(&'a mut self) -> TwitterResult<List> {
let mut params = Vec::with_capacity(6);
if let Some(ref mut x) = self.list_id { params.push((Cow::Borrowed("list_id"), x.to_parameter_value())) }
if let Some(ref mut x) = self.slug { params.push((Cow::Borrowed("slug"), x.to_parameter_value())) }
if let Some(ref mut x) = self.owner_screen_name { params.push((Cow::Borrowed("owner_screen_name"), x.to_parameter_value())) }
if let Some(ref mut x) = self.owner_id { params.push((Cow::Borrowed("owner_id"), x.to_parameter_value())) }
if let Some(ref mut x) = self.user_id { params.push((Cow::Borrowed("user_id"), x.to_parameter_value())) }
if let Some(ref mut x) = self.screen_name { params.push((Cow::Borrowed("screen_name"), x.to_parameter_value())) }
let url = "https://api.twitter.com/1.1/lists/members/create_all.json";
execute_core(self._client, Post, url, params)
}
}
pub struct ListsMembersDestroyRequestBuilder<'a, A: 'a + Authenticator, H: 'a + HttpHandler> {
_client: &'a TwitterClient<A, H>,
list_id: Option<i64>,
slug: Option<Cow<'a, str>>,
owner_screen_name: Option<Cow<'a, str>>,
owner_id: Option<i64>,
user_id: Option<i64>,
screen_name: Option<Cow<'a, str>>,
}
impl<'a, A: Authenticator, H: HttpHandler> ListsMembersDestroyRequestBuilder<'a, A, H> {
pub fn list_id(&'a mut self, val: i64) -> &'a mut Self {
self.list_id = Some(val);
self
}
pub fn slug<T1: Into<Cow<'a, str>>>(&'a mut self, val: T1) -> &'a mut Self {
self.slug = Some(val.into());
self
}
pub fn owner_screen_name<T1: Into<Cow<'a, str>>>(&'a mut self, val: T1) -> &'a mut Self {
self.owner_screen_name = Some(val.into());
self
}
pub fn owner_id(&'a mut self, val: i64) -> &'a mut Self {
self.owner_id = Some(val);
self
}
pub fn user_id(&'a mut self, val: i64) -> &'a mut Self {
self.user_id = Some(val);
self
}
pub fn screen_name<T1: Into<Cow<'a, str>>>(&'a mut self, val: T1) -> &'a mut Self {
self.screen_name = Some(val.into());
self
}
pub fn execute(&'a mut self) -> TwitterResult<List> {
let mut params = Vec::with_capacity(6);
if let Some(ref mut x) = self.list_id { params.push((Cow::Borrowed("list_id"), x.to_parameter_value())) }
if let Some(ref mut x) = self.slug { params.push((Cow::Borrowed("slug"), x.to_parameter_value())) }
if let Some(ref mut x) = self.owner_screen_name { params.push((Cow::Borrowed("owner_screen_name"), x.to_parameter_value())) }
if let Some(ref mut x) = self.owner_id { params.push((Cow::Borrowed("owner_id"), x.to_parameter_value())) }
if let Some(ref mut x) = self.user_id { params.push((Cow::Borrowed("user_id"), x.to_parameter_value())) }
if let Some(ref mut x) = self.screen_name { params.push((Cow::Borrowed("screen_name"), x.to_parameter_value())) }
let url = "https://api.twitter.com/1.1/lists/members/destroy.json";
execute_core(self._client, Post, url, params)
}
}
pub struct ListsMembersDestroyAllRequestBuilder<'a, A: 'a + Authenticator, H: 'a + HttpHandler> {
_client: &'a TwitterClient<A, H>,
list_id: Option<i64>,
slug: Option<Cow<'a, str>>,
owner_screen_name: Option<Cow<'a, str>>,
owner_id: Option<i64>,
user_id: Option<String>,
screen_name: Option<String>,
}
impl<'a, A: Authenticator, H: HttpHandler> ListsMembersDestroyAllRequestBuilder<'a, A, H> {
pub fn list_id(&'a mut self, val: i64) -> &'a mut Self {
self.list_id = Some(val);
self
}
pub fn slug<T1: Into<Cow<'a, str>>>(&'a mut self, val: T1) -> &'a mut Self {
self.slug = Some(val.into());
self
}
pub fn owner_screen_name<T1: Into<Cow<'a, str>>>(&'a mut self, val: T1) -> &'a mut Self {
self.owner_screen_name = Some(val.into());
self
}
pub fn owner_id(&'a mut self, val: i64) -> &'a mut Self {
self.owner_id = Some(val);
self
}
pub fn user_id<T1: IntoIterator<Item = i64>>(&'a mut self, val: T1) -> &'a mut Self {
self.user_id = Some(collection_paramter(val));
self
}
pub fn screen_name<T1: AsRef<str>, T2: IntoIterator<Item = T1>>(&'a mut self, val: T2) -> &'a mut Self {
self.screen_name = Some(str_collection_parameter(val));
self
}
pub fn execute(&'a mut self) -> TwitterResult<List> {
let mut params = Vec::with_capacity(6);
if let Some(ref mut x) = self.list_id { params.push((Cow::Borrowed("list_id"), x.to_parameter_value())) }
if let Some(ref mut x) = self.slug { params.push((Cow::Borrowed("slug"), x.to_parameter_value())) }
if let Some(ref mut x) = self.owner_screen_name { params.push((Cow::Borrowed("owner_screen_name"), x.to_parameter_value())) }
if let Some(ref mut x) = self.owner_id { params.push((Cow::Borrowed("owner_id"), x.to_parameter_value())) }
if let Some(ref mut x) = self.user_id { params.push((Cow::Borrowed("user_id"), x.to_parameter_value())) }
if let Some(ref mut x) = self.screen_name { params.push((Cow::Borrowed("screen_name"), x.to_parameter_value())) }
let url = "https://api.twitter.com/1.1/lists/members/destroy_all.json";
execute_core(self._client, Post, url, params)
}
}