use std::time::Duration;
use reqwest::Method;
use super::models::*;
use crate::client::Client;
use crate::errors::Error;
use crate::options::{FetchOptions, Query, RequestOptions};
use crate::references::{ProfileReference, Reference, ResourceReference};
use crate::response::{Items, Page, Response};
use crate::transport::Scope;
impl Client {
pub fn instagram(&self) -> InstagramResource {
InstagramResource {
scope: Scope::new(self.clone()),
}
}
pub fn reddit(&self) -> RedditResource {
RedditResource {
scope: Scope::new(self.clone()),
}
}
pub fn test_data(&self) -> TestDataResource {
TestDataResource {
scope: Scope::new(self.clone()),
}
}
pub fn tiktok(&self) -> TikTokResource {
TikTokResource {
scope: Scope::new(self.clone()),
}
}
pub fn twitter(&self) -> TwitterResource {
TwitterResource {
scope: Scope::new(self.clone()),
}
}
pub fn youtube(&self) -> YouTubeResource {
YouTubeResource {
scope: Scope::new(self.clone()),
}
}
pub async fn fetch(
&self,
url: &str,
options: impl Into<Option<FetchOptions>>,
) -> Result<FetchResponse, Error> {
let options = options.into().unwrap_or_default();
Scope::new(self.clone())
.fetch(url, options.freshness, options.request_options)?
.send_fetch()
.await
}
}
#[derive(Clone, Debug)]
pub struct InstagramResource {
scope: Scope,
}
impl InstagramResource {
pub fn comment(&self, reference: impl Into<ResourceReference>) -> InstagramCommentResource {
InstagramCommentResource {
scope: self.scope.select(
"identifier",
"instagram",
"comment",
Reference::from(reference.into()),
),
}
}
pub fn hashtag(&self, reference: impl Into<ResourceReference>) -> InstagramHashtagResource {
InstagramHashtagResource {
scope: self.scope.select(
"identifier",
"instagram",
"hashtag",
Reference::from(reference.into()),
),
}
}
pub fn highlight(&self, reference: impl Into<ResourceReference>) -> InstagramHighlightResource {
InstagramHighlightResource {
scope: self.scope.select(
"identifier",
"instagram",
"highlight",
Reference::from(reference.into()),
),
}
}
pub fn location(&self, reference: impl Into<ResourceReference>) -> InstagramLocationResource {
InstagramLocationResource {
scope: self.scope.select(
"identifier",
"instagram",
"location",
Reference::from(reference.into()),
),
}
}
pub fn music(&self, reference: impl Into<ResourceReference>) -> InstagramMusicResource {
InstagramMusicResource {
scope: self.scope.select(
"identifier",
"instagram",
"music",
Reference::from(reference.into()),
),
}
}
pub fn post(&self, reference: impl Into<ResourceReference>) -> InstagramPostResource {
InstagramPostResource {
scope: self.scope.select(
"identifier",
"instagram",
"post",
Reference::from(reference.into()),
),
}
}
pub fn profile(&self, reference: impl Into<ProfileReference>) -> InstagramProfileResource {
InstagramProfileResource {
scope: self.scope.select(
"identifier",
"instagram",
"profile",
Reference::from(reference.into()),
),
}
}
pub fn search(&self) -> InstagramSearchResource {
InstagramSearchResource {
scope: self.scope.clone(),
}
}
pub fn story(&self, reference: impl Into<ResourceReference>) -> InstagramStoryResource {
InstagramStoryResource {
scope: self.scope.select(
"identifier",
"instagram",
"story",
Reference::from(reference.into()),
),
}
}
}
#[derive(Clone, Debug)]
pub struct InstagramCommentResource {
scope: Scope,
}
impl InstagramCommentResource {
pub fn likers(&self) -> InstagramCommentLikersResource {
InstagramCommentLikersResource {
scope: self.scope.clone(),
}
}
}
#[derive(Clone, Debug)]
pub struct InstagramCommentLikersResource {
scope: Scope,
}
impl InstagramCommentLikersResource {
pub async fn list(
&self,
options: InstagramCommentLikersOptions,
) -> Result<InstagramCommentLikersPage, Error> {
self.scope
.operation(
Method::GET,
"/v1/instagram/comments/{identifier}/likers",
options.query(),
options.request_options,
)?
.send_page()
.await
}
pub fn items(&self, options: InstagramCommentLikersOptions) -> Items<InstagramProfileSummary> {
Items::new(self.scope.operation(
Method::GET,
"/v1/instagram/comments/{identifier}/likers",
options.query(),
options.request_options,
))
}
}
#[derive(Clone, Debug)]
pub struct InstagramHashtagResource {
scope: Scope,
}
impl InstagramHashtagResource {
pub fn posts(&self) -> InstagramHashtagPostsResource {
InstagramHashtagPostsResource {
scope: self.scope.clone(),
}
}
pub fn reels(&self) -> InstagramHashtagReelsResource {
InstagramHashtagReelsResource {
scope: self.scope.clone(),
}
}
pub async fn get(
&self,
options: impl Into<Option<InstagramHashtagOptions>>,
) -> Result<InstagramHashtagResponse, Error> {
let options = options.into().unwrap_or_default();
self.scope
.operation(
Method::GET,
"/v1/instagram/hashtags/{identifier}",
options.query(),
options.request_options,
)?
.send()
.await
}
}
#[derive(Clone, Debug)]
pub struct InstagramHashtagPostsResource {
scope: Scope,
}
impl InstagramHashtagPostsResource {
pub async fn list(
&self,
options: impl Into<Option<InstagramHashtagPostsOptions>>,
) -> Result<InstagramHashtagPostsPage, Error> {
let options = options.into().unwrap_or_default();
self.scope
.operation(
Method::GET,
"/v1/instagram/hashtags/{identifier}/posts",
options.query(),
options.request_options,
)?
.send_page()
.await
}
pub fn items(
&self,
options: impl Into<Option<InstagramHashtagPostsOptions>>,
) -> Items<InstagramPost> {
let options = options.into().unwrap_or_default();
Items::new(self.scope.operation(
Method::GET,
"/v1/instagram/hashtags/{identifier}/posts",
options.query(),
options.request_options,
))
}
}
#[derive(Clone, Debug)]
pub struct InstagramHashtagReelsResource {
scope: Scope,
}
impl InstagramHashtagReelsResource {
pub async fn list(
&self,
options: impl Into<Option<InstagramHashtagReelsOptions>>,
) -> Result<InstagramHashtagReelsPage, Error> {
let options = options.into().unwrap_or_default();
self.scope
.operation(
Method::GET,
"/v1/instagram/hashtags/{identifier}/reels",
options.query(),
options.request_options,
)?
.send_page()
.await
}
pub fn items(
&self,
options: impl Into<Option<InstagramHashtagReelsOptions>>,
) -> Items<InstagramPost> {
let options = options.into().unwrap_or_default();
Items::new(self.scope.operation(
Method::GET,
"/v1/instagram/hashtags/{identifier}/reels",
options.query(),
options.request_options,
))
}
}
#[derive(Clone, Debug)]
pub struct InstagramHighlightResource {
scope: Scope,
}
impl InstagramHighlightResource {
pub async fn get(
&self,
options: impl Into<Option<InstagramHighlightOptions>>,
) -> Result<InstagramHighlightResponse, Error> {
let options = options.into().unwrap_or_default();
self.scope
.operation(
Method::GET,
"/v1/instagram/highlights/{identifier}",
options.query(),
options.request_options,
)?
.send()
.await
}
}
#[derive(Clone, Debug)]
pub struct InstagramLocationResource {
scope: Scope,
}
impl InstagramLocationResource {
pub fn posts(&self) -> InstagramLocationPostsResource {
InstagramLocationPostsResource {
scope: self.scope.clone(),
}
}
pub async fn get(
&self,
options: impl Into<Option<InstagramLocationOptions>>,
) -> Result<InstagramLocationResponse, Error> {
let options = options.into().unwrap_or_default();
self.scope
.operation(
Method::GET,
"/v1/instagram/locations/{identifier}",
options.query(),
options.request_options,
)?
.send()
.await
}
}
#[derive(Clone, Debug)]
pub struct InstagramLocationPostsResource {
scope: Scope,
}
impl InstagramLocationPostsResource {
pub async fn list(
&self,
options: impl Into<Option<InstagramLocationPostsOptions>>,
) -> Result<InstagramLocationPostsPage, Error> {
let options = options.into().unwrap_or_default();
self.scope
.operation(
Method::GET,
"/v1/instagram/locations/{identifier}/posts",
options.query(),
options.request_options,
)?
.send_page()
.await
}
pub fn items(
&self,
options: impl Into<Option<InstagramLocationPostsOptions>>,
) -> Items<InstagramPost> {
let options = options.into().unwrap_or_default();
Items::new(self.scope.operation(
Method::GET,
"/v1/instagram/locations/{identifier}/posts",
options.query(),
options.request_options,
))
}
}
#[derive(Clone, Debug)]
pub struct InstagramMusicResource {
scope: Scope,
}
impl InstagramMusicResource {
pub fn stream(&self) -> InstagramMusicStreamResource {
InstagramMusicStreamResource {
scope: self.scope.clone(),
}
}
pub async fn get(
&self,
options: impl Into<Option<InstagramMusicOptions>>,
) -> Result<InstagramMusicResponse, Error> {
let options = options.into().unwrap_or_default();
self.scope
.operation(
Method::GET,
"/v1/instagram/music/{identifier}",
options.query(),
options.request_options,
)?
.send()
.await
}
}
#[derive(Clone, Debug)]
pub struct InstagramMusicStreamResource {
scope: Scope,
}
impl InstagramMusicStreamResource {
pub async fn list(
&self,
options: impl Into<Option<InstagramMusicStreamOptions>>,
) -> Result<InstagramMusicStreamPage, Error> {
let options = options.into().unwrap_or_default();
self.scope
.operation(
Method::GET,
"/v1/instagram/music/{identifier}/stream",
options.query(),
options.request_options,
)?
.send_page()
.await
}
pub fn items(
&self,
options: impl Into<Option<InstagramMusicStreamOptions>>,
) -> Items<InstagramMusicStream> {
let options = options.into().unwrap_or_default();
Items::new(self.scope.operation(
Method::GET,
"/v1/instagram/music/{identifier}/stream",
options.query(),
options.request_options,
))
}
}
#[derive(Clone, Debug)]
pub struct InstagramPostResource {
scope: Scope,
}
impl InstagramPostResource {
pub fn clip_metadata(&self) -> InstagramPostClipMetadataResource {
InstagramPostClipMetadataResource {
scope: self.scope.clone(),
}
}
pub fn comment(&self, reference: impl Into<ResourceReference>) -> InstagramPostCommentResource {
InstagramPostCommentResource {
scope: self.scope.select(
"comment_id",
"instagram",
"comment",
Reference::from(reference.into()),
),
}
}
pub fn comment_metadata(&self) -> InstagramPostCommentMetadataResource {
InstagramPostCommentMetadataResource {
scope: self.scope.clone(),
}
}
pub fn comment_moderation(&self) -> InstagramPostCommentModerationResource {
InstagramPostCommentModerationResource {
scope: self.scope.clone(),
}
}
pub fn comments(&self) -> InstagramPostCommentsResource {
InstagramPostCommentsResource {
scope: self.scope.clone(),
}
}
pub fn insights(&self) -> InstagramPostInsightsResource {
InstagramPostInsightsResource {
scope: self.scope.clone(),
}
}
pub fn likers(&self) -> InstagramPostLikersResource {
InstagramPostLikersResource {
scope: self.scope.clone(),
}
}
pub fn oembed(&self) -> InstagramPostOEmbedResource {
InstagramPostOEmbedResource {
scope: self.scope.clone(),
}
}
pub fn tagged_users(&self) -> InstagramPostTaggedUsersResource {
InstagramPostTaggedUsersResource {
scope: self.scope.clone(),
}
}
pub fn template(&self) -> InstagramPostTemplateResource {
InstagramPostTemplateResource {
scope: self.scope.clone(),
}
}
pub async fn get(
&self,
options: impl Into<Option<InstagramPostOptions>>,
) -> Result<InstagramPostResponse, Error> {
let options = options.into().unwrap_or_default();
self.scope
.operation(
Method::GET,
"/v1/instagram/posts/{identifier}",
options.query(),
options.request_options,
)?
.send()
.await
}
}
#[derive(Clone, Debug)]
pub struct InstagramPostClipMetadataResource {
scope: Scope,
}
impl InstagramPostClipMetadataResource {
pub async fn get(
&self,
options: impl Into<Option<InstagramPostClipMetadataOptions>>,
) -> Result<InstagramPostClipMetadataResponse, Error> {
let options = options.into().unwrap_or_default();
self.scope
.operation(
Method::GET,
"/v1/instagram/posts/{identifier}/clip-metadata",
options.query(),
options.request_options,
)?
.send()
.await
}
}
#[derive(Clone, Debug)]
pub struct InstagramPostCommentResource {
scope: Scope,
}
impl InstagramPostCommentResource {
pub fn replies(&self) -> InstagramPostCommentRepliesResource {
InstagramPostCommentRepliesResource {
scope: self.scope.clone(),
}
}
}
#[derive(Clone, Debug)]
pub struct InstagramPostCommentRepliesResource {
scope: Scope,
}
impl InstagramPostCommentRepliesResource {
pub async fn list(
&self,
options: impl Into<Option<InstagramPostCommentRepliesOptions>>,
) -> Result<InstagramPostCommentRepliesPage, Error> {
let options = options.into().unwrap_or_default();
self.scope
.operation(
Method::GET,
"/v1/instagram/posts/{identifier}/comments/{comment_id}/replies",
options.query(),
options.request_options,
)?
.send_page()
.await
}
pub fn items(
&self,
options: impl Into<Option<InstagramPostCommentRepliesOptions>>,
) -> Items<InstagramComment> {
let options = options.into().unwrap_or_default();
Items::new(self.scope.operation(
Method::GET,
"/v1/instagram/posts/{identifier}/comments/{comment_id}/replies",
options.query(),
options.request_options,
))
}
}
#[derive(Clone, Debug)]
pub struct InstagramPostCommentMetadataResource {
scope: Scope,
}
impl InstagramPostCommentMetadataResource {
pub async fn get(
&self,
options: impl Into<Option<InstagramPostCommentMetadataOptions>>,
) -> Result<InstagramPostCommentMetadataResponse, Error> {
let options = options.into().unwrap_or_default();
self.scope
.operation(
Method::GET,
"/v1/instagram/posts/{identifier}/comment-metadata",
options.query(),
options.request_options,
)?
.send()
.await
}
}
#[derive(Clone, Debug)]
pub struct InstagramPostCommentModerationResource {
scope: Scope,
}
impl InstagramPostCommentModerationResource {
pub async fn get(
&self,
options: InstagramPostCommentModerationOptions,
) -> Result<InstagramPostCommentModerationResponse, Error> {
self.scope
.operation(
Method::GET,
"/v1/instagram/posts/{identifier}/comment-moderation",
options.query(),
options.request_options,
)?
.send()
.await
}
}
#[derive(Clone, Debug)]
pub struct InstagramPostCommentsResource {
scope: Scope,
}
impl InstagramPostCommentsResource {
pub async fn list(
&self,
options: impl Into<Option<InstagramPostCommentsOptions>>,
) -> Result<InstagramPostCommentsPage, Error> {
let options = options.into().unwrap_or_default();
self.scope
.operation(
Method::GET,
"/v1/instagram/posts/{identifier}/comments",
options.query(),
options.request_options,
)?
.send_page()
.await
}
pub fn items(
&self,
options: impl Into<Option<InstagramPostCommentsOptions>>,
) -> Items<InstagramComment> {
let options = options.into().unwrap_or_default();
Items::new(self.scope.operation(
Method::GET,
"/v1/instagram/posts/{identifier}/comments",
options.query(),
options.request_options,
))
}
}
#[derive(Clone, Debug)]
pub struct InstagramPostInsightsResource {
scope: Scope,
}
impl InstagramPostInsightsResource {
pub async fn get(
&self,
options: impl Into<Option<InstagramPostInsightsOptions>>,
) -> Result<InstagramPostInsightsResponse, Error> {
let options = options.into().unwrap_or_default();
self.scope
.operation(
Method::GET,
"/v1/instagram/posts/{identifier}/insights",
options.query(),
options.request_options,
)?
.send()
.await
}
}
#[derive(Clone, Debug)]
pub struct InstagramPostLikersResource {
scope: Scope,
}
impl InstagramPostLikersResource {
pub async fn list(
&self,
options: impl Into<Option<InstagramPostLikersOptions>>,
) -> Result<InstagramPostLikersPage, Error> {
let options = options.into().unwrap_or_default();
self.scope
.operation(
Method::GET,
"/v1/instagram/posts/{identifier}/likers",
options.query(),
options.request_options,
)?
.send_page()
.await
}
pub fn items(
&self,
options: impl Into<Option<InstagramPostLikersOptions>>,
) -> Items<InstagramProfile> {
let options = options.into().unwrap_or_default();
Items::new(self.scope.operation(
Method::GET,
"/v1/instagram/posts/{identifier}/likers",
options.query(),
options.request_options,
))
}
}
#[derive(Clone, Debug)]
pub struct InstagramPostOEmbedResource {
scope: Scope,
}
impl InstagramPostOEmbedResource {
pub async fn get(
&self,
options: impl Into<Option<InstagramPostOEmbedOptions>>,
) -> Result<InstagramPostOEmbedResponse, Error> {
let options = options.into().unwrap_or_default();
self.scope
.operation(
Method::GET,
"/v1/instagram/posts/{identifier}/oembed",
options.query(),
options.request_options,
)?
.send()
.await
}
}
#[derive(Clone, Debug)]
pub struct InstagramPostTaggedUsersResource {
scope: Scope,
}
impl InstagramPostTaggedUsersResource {
pub async fn list(
&self,
options: impl Into<Option<InstagramPostTaggedUsersOptions>>,
) -> Result<InstagramPostTaggedUsersPage, Error> {
let options = options.into().unwrap_or_default();
self.scope
.operation(
Method::GET,
"/v1/instagram/posts/{identifier}/tagged-users",
options.query(),
options.request_options,
)?
.send_page()
.await
}
pub fn items(
&self,
options: impl Into<Option<InstagramPostTaggedUsersOptions>>,
) -> Items<InstagramUserTag> {
let options = options.into().unwrap_or_default();
Items::new(self.scope.operation(
Method::GET,
"/v1/instagram/posts/{identifier}/tagged-users",
options.query(),
options.request_options,
))
}
}
#[derive(Clone, Debug)]
pub struct InstagramPostTemplateResource {
scope: Scope,
}
impl InstagramPostTemplateResource {
pub async fn get(
&self,
options: impl Into<Option<InstagramPostTemplateOptions>>,
) -> Result<InstagramPostTemplateResponse, Error> {
let options = options.into().unwrap_or_default();
self.scope
.operation(
Method::GET,
"/v1/instagram/posts/{identifier}/template",
options.query(),
options.request_options,
)?
.send()
.await
}
}
#[derive(Clone, Debug)]
pub struct InstagramProfileResource {
scope: Scope,
}
impl InstagramProfileResource {
pub fn about(&self) -> InstagramProfileAboutResource {
InstagramProfileAboutResource {
scope: self.scope.clone(),
}
}
pub fn business_recommendations(&self) -> InstagramProfileBusinessRecommendationsResource {
InstagramProfileBusinessRecommendationsResource {
scope: self.scope.clone(),
}
}
pub fn followers(&self) -> InstagramProfileFollowersResource {
InstagramProfileFollowersResource {
scope: self.scope.clone(),
}
}
pub fn following(&self) -> InstagramProfileFollowingResource {
InstagramProfileFollowingResource {
scope: self.scope.clone(),
}
}
pub fn highlights(&self) -> InstagramProfileHighlightsResource {
InstagramProfileHighlightsResource {
scope: self.scope.clone(),
}
}
pub fn pinned_posts(&self) -> InstagramProfilePinnedPostsResource {
InstagramProfilePinnedPostsResource {
scope: self.scope.clone(),
}
}
pub fn posts(&self) -> InstagramProfilePostsResource {
InstagramProfilePostsResource {
scope: self.scope.clone(),
}
}
pub fn reels(&self) -> InstagramProfileReelsResource {
InstagramProfileReelsResource {
scope: self.scope.clone(),
}
}
pub fn reposts(&self) -> InstagramProfileRepostsResource {
InstagramProfileRepostsResource {
scope: self.scope.clone(),
}
}
pub fn stories(&self) -> InstagramProfileStoriesResource {
InstagramProfileStoriesResource {
scope: self.scope.clone(),
}
}
pub fn suggested(&self) -> InstagramProfileSuggestedResource {
InstagramProfileSuggestedResource {
scope: self.scope.clone(),
}
}
pub fn tagged_posts(&self) -> InstagramProfileTaggedPostsResource {
InstagramProfileTaggedPostsResource {
scope: self.scope.clone(),
}
}
pub fn videos(&self) -> InstagramProfileVideosResource {
InstagramProfileVideosResource {
scope: self.scope.clone(),
}
}
pub async fn get(
&self,
options: impl Into<Option<InstagramProfileOptions>>,
) -> Result<InstagramProfileResponse, Error> {
let options = options.into().unwrap_or_default();
self.scope
.operation(
Method::GET,
"/v1/instagram/profiles/{identifier}",
options.query(),
options.request_options,
)?
.send()
.await
}
}
#[derive(Clone, Debug)]
pub struct InstagramProfileAboutResource {
scope: Scope,
}
impl InstagramProfileAboutResource {
pub async fn get(
&self,
options: impl Into<Option<InstagramProfileAboutOptions>>,
) -> Result<InstagramProfileAboutResponse, Error> {
let options = options.into().unwrap_or_default();
self.scope
.operation(
Method::GET,
"/v1/instagram/profiles/{identifier}/about",
options.query(),
options.request_options,
)?
.send()
.await
}
}
#[derive(Clone, Debug)]
pub struct InstagramProfileBusinessRecommendationsResource {
scope: Scope,
}
impl InstagramProfileBusinessRecommendationsResource {
pub async fn list(
&self,
options: impl Into<Option<InstagramProfileBusinessRecommendationsOptions>>,
) -> Result<InstagramProfileBusinessRecommendationsPage, Error> {
let options = options.into().unwrap_or_default();
self.scope
.operation(
Method::GET,
"/v1/instagram/profiles/{identifier}/business-recommendations",
options.query(),
options.request_options,
)?
.send_page()
.await
}
pub fn items(
&self,
options: impl Into<Option<InstagramProfileBusinessRecommendationsOptions>>,
) -> Items<InstagramProfileSummary> {
let options = options.into().unwrap_or_default();
Items::new(self.scope.operation(
Method::GET,
"/v1/instagram/profiles/{identifier}/business-recommendations",
options.query(),
options.request_options,
))
}
}
#[derive(Clone, Debug)]
pub struct InstagramProfileFollowersResource {
scope: Scope,
}
impl InstagramProfileFollowersResource {
pub async fn list(
&self,
options: impl Into<Option<InstagramProfileFollowersOptions>>,
) -> Result<InstagramProfileFollowersPage, Error> {
let options = options.into().unwrap_or_default();
self.scope
.operation(
Method::GET,
"/v1/instagram/profiles/{identifier}/followers",
options.query(),
options.request_options,
)?
.send_page()
.await
}
pub fn items(
&self,
options: impl Into<Option<InstagramProfileFollowersOptions>>,
) -> Items<InstagramProfile> {
let options = options.into().unwrap_or_default();
Items::new(self.scope.operation(
Method::GET,
"/v1/instagram/profiles/{identifier}/followers",
options.query(),
options.request_options,
))
}
pub async fn search(
&self,
options: InstagramProfileFollowersSearchOptions,
) -> Result<InstagramProfileFollowersSearchPage, Error> {
self.scope
.operation(
Method::GET,
"/v1/instagram/profiles/{identifier}/followers/search",
options.query(),
options.request_options,
)?
.send_page()
.await
}
pub fn search_items(
&self,
options: InstagramProfileFollowersSearchOptions,
) -> Items<InstagramProfile> {
Items::new(self.scope.operation(
Method::GET,
"/v1/instagram/profiles/{identifier}/followers/search",
options.query(),
options.request_options,
))
}
}
#[derive(Clone, Debug)]
pub struct InstagramProfileFollowingResource {
scope: Scope,
}
impl InstagramProfileFollowingResource {
pub async fn list(
&self,
options: impl Into<Option<InstagramProfileFollowingOptions>>,
) -> Result<InstagramProfileFollowingPage, Error> {
let options = options.into().unwrap_or_default();
self.scope
.operation(
Method::GET,
"/v1/instagram/profiles/{identifier}/following",
options.query(),
options.request_options,
)?
.send_page()
.await
}
pub fn items(
&self,
options: impl Into<Option<InstagramProfileFollowingOptions>>,
) -> Items<InstagramProfile> {
let options = options.into().unwrap_or_default();
Items::new(self.scope.operation(
Method::GET,
"/v1/instagram/profiles/{identifier}/following",
options.query(),
options.request_options,
))
}
pub async fn search(
&self,
options: InstagramProfileFollowingSearchOptions,
) -> Result<InstagramProfileFollowingSearchPage, Error> {
self.scope
.operation(
Method::GET,
"/v1/instagram/profiles/{identifier}/following/search",
options.query(),
options.request_options,
)?
.send_page()
.await
}
pub fn search_items(
&self,
options: InstagramProfileFollowingSearchOptions,
) -> Items<InstagramProfile> {
Items::new(self.scope.operation(
Method::GET,
"/v1/instagram/profiles/{identifier}/following/search",
options.query(),
options.request_options,
))
}
}
#[derive(Clone, Debug)]
pub struct InstagramProfileHighlightsResource {
scope: Scope,
}
impl InstagramProfileHighlightsResource {
pub async fn list(
&self,
options: impl Into<Option<InstagramProfileHighlightsOptions>>,
) -> Result<InstagramProfileHighlightsPage, Error> {
let options = options.into().unwrap_or_default();
self.scope
.operation(
Method::GET,
"/v1/instagram/profiles/{identifier}/highlights",
options.query(),
options.request_options,
)?
.send_page()
.await
}
pub fn items(
&self,
options: impl Into<Option<InstagramProfileHighlightsOptions>>,
) -> Items<InstagramHighlight> {
let options = options.into().unwrap_or_default();
Items::new(self.scope.operation(
Method::GET,
"/v1/instagram/profiles/{identifier}/highlights",
options.query(),
options.request_options,
))
}
}
#[derive(Clone, Debug)]
pub struct InstagramProfilePinnedPostsResource {
scope: Scope,
}
impl InstagramProfilePinnedPostsResource {
pub async fn list(
&self,
options: impl Into<Option<InstagramProfilePinnedPostsOptions>>,
) -> Result<InstagramProfilePinnedPostsPage, Error> {
let options = options.into().unwrap_or_default();
self.scope
.operation(
Method::GET,
"/v1/instagram/profiles/{identifier}/pinned-posts",
options.query(),
options.request_options,
)?
.send_page()
.await
}
pub fn items(
&self,
options: impl Into<Option<InstagramProfilePinnedPostsOptions>>,
) -> Items<InstagramPost> {
let options = options.into().unwrap_or_default();
Items::new(self.scope.operation(
Method::GET,
"/v1/instagram/profiles/{identifier}/pinned-posts",
options.query(),
options.request_options,
))
}
}
#[derive(Clone, Debug)]
pub struct InstagramProfilePostsResource {
scope: Scope,
}
impl InstagramProfilePostsResource {
pub async fn list(
&self,
options: impl Into<Option<InstagramProfilePostsOptions>>,
) -> Result<InstagramProfilePostsPage, Error> {
let options = options.into().unwrap_or_default();
self.scope
.operation(
Method::GET,
"/v1/instagram/profiles/{identifier}/posts",
options.query(),
options.request_options,
)?
.send_page()
.await
}
pub fn items(
&self,
options: impl Into<Option<InstagramProfilePostsOptions>>,
) -> Items<InstagramPost> {
let options = options.into().unwrap_or_default();
Items::new(self.scope.operation(
Method::GET,
"/v1/instagram/profiles/{identifier}/posts",
options.query(),
options.request_options,
))
}
}
#[derive(Clone, Debug)]
pub struct InstagramProfileReelsResource {
scope: Scope,
}
impl InstagramProfileReelsResource {
pub async fn list(
&self,
options: impl Into<Option<InstagramProfileReelsOptions>>,
) -> Result<InstagramProfileReelsPage, Error> {
let options = options.into().unwrap_or_default();
self.scope
.operation(
Method::GET,
"/v1/instagram/profiles/{identifier}/reels",
options.query(),
options.request_options,
)?
.send_page()
.await
}
pub fn items(
&self,
options: impl Into<Option<InstagramProfileReelsOptions>>,
) -> Items<InstagramPost> {
let options = options.into().unwrap_or_default();
Items::new(self.scope.operation(
Method::GET,
"/v1/instagram/profiles/{identifier}/reels",
options.query(),
options.request_options,
))
}
}
#[derive(Clone, Debug)]
pub struct InstagramProfileRepostsResource {
scope: Scope,
}
impl InstagramProfileRepostsResource {
pub async fn list(
&self,
options: impl Into<Option<InstagramProfileRepostsOptions>>,
) -> Result<InstagramProfileRepostsPage, Error> {
let options = options.into().unwrap_or_default();
self.scope
.operation(
Method::GET,
"/v1/instagram/profiles/{identifier}/reposts",
options.query(),
options.request_options,
)?
.send_page()
.await
}
pub fn items(
&self,
options: impl Into<Option<InstagramProfileRepostsOptions>>,
) -> Items<InstagramPost> {
let options = options.into().unwrap_or_default();
Items::new(self.scope.operation(
Method::GET,
"/v1/instagram/profiles/{identifier}/reposts",
options.query(),
options.request_options,
))
}
}
#[derive(Clone, Debug)]
pub struct InstagramProfileStoriesResource {
scope: Scope,
}
impl InstagramProfileStoriesResource {
pub async fn list(
&self,
options: impl Into<Option<InstagramProfileStoriesOptions>>,
) -> Result<InstagramProfileStoriesPage, Error> {
let options = options.into().unwrap_or_default();
self.scope
.operation(
Method::GET,
"/v1/instagram/profiles/{identifier}/stories",
options.query(),
options.request_options,
)?
.send_page()
.await
}
pub fn items(
&self,
options: impl Into<Option<InstagramProfileStoriesOptions>>,
) -> Items<InstagramStory> {
let options = options.into().unwrap_or_default();
Items::new(self.scope.operation(
Method::GET,
"/v1/instagram/profiles/{identifier}/stories",
options.query(),
options.request_options,
))
}
}
#[derive(Clone, Debug)]
pub struct InstagramProfileSuggestedResource {
scope: Scope,
}
impl InstagramProfileSuggestedResource {
pub async fn list(
&self,
options: impl Into<Option<InstagramProfileSuggestedOptions>>,
) -> Result<InstagramProfileSuggestedPage, Error> {
let options = options.into().unwrap_or_default();
self.scope
.operation(
Method::GET,
"/v1/instagram/profiles/{identifier}/suggested",
options.query(),
options.request_options,
)?
.send_page()
.await
}
pub fn items(
&self,
options: impl Into<Option<InstagramProfileSuggestedOptions>>,
) -> Items<InstagramProfile> {
let options = options.into().unwrap_or_default();
Items::new(self.scope.operation(
Method::GET,
"/v1/instagram/profiles/{identifier}/suggested",
options.query(),
options.request_options,
))
}
}
#[derive(Clone, Debug)]
pub struct InstagramProfileTaggedPostsResource {
scope: Scope,
}
impl InstagramProfileTaggedPostsResource {
pub async fn list(
&self,
options: impl Into<Option<InstagramProfileTaggedPostsOptions>>,
) -> Result<InstagramProfileTaggedPostsPage, Error> {
let options = options.into().unwrap_or_default();
self.scope
.operation(
Method::GET,
"/v1/instagram/profiles/{identifier}/tagged-posts",
options.query(),
options.request_options,
)?
.send_page()
.await
}
pub fn items(
&self,
options: impl Into<Option<InstagramProfileTaggedPostsOptions>>,
) -> Items<InstagramPost> {
let options = options.into().unwrap_or_default();
Items::new(self.scope.operation(
Method::GET,
"/v1/instagram/profiles/{identifier}/tagged-posts",
options.query(),
options.request_options,
))
}
}
#[derive(Clone, Debug)]
pub struct InstagramProfileVideosResource {
scope: Scope,
}
impl InstagramProfileVideosResource {
pub async fn list(
&self,
options: impl Into<Option<InstagramProfileVideosOptions>>,
) -> Result<InstagramProfileVideosPage, Error> {
let options = options.into().unwrap_or_default();
self.scope
.operation(
Method::GET,
"/v1/instagram/profiles/{identifier}/videos",
options.query(),
options.request_options,
)?
.send_page()
.await
}
pub fn items(
&self,
options: impl Into<Option<InstagramProfileVideosOptions>>,
) -> Items<InstagramPost> {
let options = options.into().unwrap_or_default();
Items::new(self.scope.operation(
Method::GET,
"/v1/instagram/profiles/{identifier}/videos",
options.query(),
options.request_options,
))
}
}
#[derive(Clone, Debug)]
pub struct InstagramSearchResource {
scope: Scope,
}
impl InstagramSearchResource {
pub fn hashtags(&self) -> InstagramSearchHashtagsResource {
InstagramSearchHashtagsResource {
scope: self.scope.clone(),
}
}
pub fn music(&self) -> InstagramSearchMusicResource {
InstagramSearchMusicResource {
scope: self.scope.clone(),
}
}
pub fn places(&self) -> InstagramSearchPlacesResource {
InstagramSearchPlacesResource {
scope: self.scope.clone(),
}
}
pub fn profiles(&self) -> InstagramSearchProfilesResource {
InstagramSearchProfilesResource {
scope: self.scope.clone(),
}
}
pub fn reels(&self) -> InstagramSearchReelsResource {
InstagramSearchReelsResource {
scope: self.scope.clone(),
}
}
pub fn top(&self) -> InstagramSearchTopResource {
InstagramSearchTopResource {
scope: self.scope.clone(),
}
}
}
#[derive(Clone, Debug)]
pub struct InstagramSearchHashtagsResource {
scope: Scope,
}
impl InstagramSearchHashtagsResource {
pub async fn list(
&self,
options: InstagramSearchHashtagsOptions,
) -> Result<InstagramSearchHashtagsPage, Error> {
self.scope
.operation(
Method::GET,
"/v1/instagram/search/hashtags",
options.query(),
options.request_options,
)?
.send_page()
.await
}
pub fn items(&self, options: InstagramSearchHashtagsOptions) -> Items<InstagramHashtag> {
Items::new(self.scope.operation(
Method::GET,
"/v1/instagram/search/hashtags",
options.query(),
options.request_options,
))
}
}
#[derive(Clone, Debug)]
pub struct InstagramSearchMusicResource {
scope: Scope,
}
impl InstagramSearchMusicResource {
pub async fn list(
&self,
options: InstagramSearchMusicOptions,
) -> Result<InstagramSearchMusicPage, Error> {
self.scope
.operation(
Method::GET,
"/v1/instagram/search/music",
options.query(),
options.request_options,
)?
.send_page()
.await
}
pub fn items(&self, options: InstagramSearchMusicOptions) -> Items<InstagramMusic> {
Items::new(self.scope.operation(
Method::GET,
"/v1/instagram/search/music",
options.query(),
options.request_options,
))
}
}
#[derive(Clone, Debug)]
pub struct InstagramSearchPlacesResource {
scope: Scope,
}
impl InstagramSearchPlacesResource {
pub async fn list(
&self,
options: InstagramSearchPlacesOptions,
) -> Result<InstagramSearchPlacesPage, Error> {
self.scope
.operation(
Method::GET,
"/v1/instagram/search/places",
options.query(),
options.request_options,
)?
.send_page()
.await
}
pub fn items(&self, options: InstagramSearchPlacesOptions) -> Items<InstagramLocation> {
Items::new(self.scope.operation(
Method::GET,
"/v1/instagram/search/places",
options.query(),
options.request_options,
))
}
}
#[derive(Clone, Debug)]
pub struct InstagramSearchProfilesResource {
scope: Scope,
}
impl InstagramSearchProfilesResource {
pub async fn list(
&self,
options: InstagramSearchProfilesOptions,
) -> Result<InstagramSearchProfilesPage, Error> {
self.scope
.operation(
Method::GET,
"/v1/instagram/search/profiles",
options.query(),
options.request_options,
)?
.send_page()
.await
}
pub fn items(&self, options: InstagramSearchProfilesOptions) -> Items<InstagramProfile> {
Items::new(self.scope.operation(
Method::GET,
"/v1/instagram/search/profiles",
options.query(),
options.request_options,
))
}
}
#[derive(Clone, Debug)]
pub struct InstagramSearchReelsResource {
scope: Scope,
}
impl InstagramSearchReelsResource {
pub async fn list(
&self,
options: InstagramSearchReelsOptions,
) -> Result<InstagramSearchReelsPage, Error> {
self.scope
.operation(
Method::GET,
"/v1/instagram/search/reels",
options.query(),
options.request_options,
)?
.send_page()
.await
}
pub fn items(&self, options: InstagramSearchReelsOptions) -> Items<InstagramPost> {
Items::new(self.scope.operation(
Method::GET,
"/v1/instagram/search/reels",
options.query(),
options.request_options,
))
}
}
#[derive(Clone, Debug)]
pub struct InstagramSearchTopResource {
scope: Scope,
}
impl InstagramSearchTopResource {
pub async fn list(
&self,
options: InstagramSearchTopOptions,
) -> Result<InstagramSearchTopPage, Error> {
self.scope
.operation(
Method::GET,
"/v1/instagram/search/top",
options.query(),
options.request_options,
)?
.send_page()
.await
}
pub fn items(&self, options: InstagramSearchTopOptions) -> Items<InstagramSearchResult> {
Items::new(self.scope.operation(
Method::GET,
"/v1/instagram/search/top",
options.query(),
options.request_options,
))
}
}
#[derive(Clone, Debug)]
pub struct InstagramStoryResource {
scope: Scope,
}
impl InstagramStoryResource {
pub async fn get(
&self,
options: impl Into<Option<InstagramStoryOptions>>,
) -> Result<InstagramStoryResponse, Error> {
let options = options.into().unwrap_or_default();
self.scope
.operation(
Method::GET,
"/v1/instagram/stories/{identifier}",
options.query(),
options.request_options,
)?
.send()
.await
}
}
#[derive(Clone, Debug)]
pub struct RedditResource {
scope: Scope,
}
impl RedditResource {
pub fn domain(&self, reference: impl Into<ResourceReference>) -> RedditDomainResource {
RedditDomainResource {
scope: self.scope.select(
"identifier",
"reddit",
"domain",
Reference::from(reference.into()),
),
}
}
pub fn post(&self, reference: impl Into<ResourceReference>) -> RedditPostResource {
RedditPostResource {
scope: self.scope.select(
"identifier",
"reddit",
"post",
Reference::from(reference.into()),
),
}
}
pub fn profile(&self, reference: impl Into<ProfileReference>) -> RedditProfileResource {
RedditProfileResource {
scope: self.scope.select(
"identifier",
"reddit",
"profile",
Reference::from(reference.into()),
),
}
}
pub fn search(&self) -> RedditSearchResource {
RedditSearchResource {
scope: self.scope.clone(),
}
}
pub fn subreddit(&self, reference: impl Into<ResourceReference>) -> RedditSubredditResource {
RedditSubredditResource {
scope: self.scope.select(
"identifier",
"reddit",
"subreddit",
Reference::from(reference.into()),
),
}
}
pub fn subreddits(&self) -> RedditSubredditsResource {
RedditSubredditsResource {
scope: self.scope.clone(),
}
}
pub fn trending(&self) -> RedditTrendingResource {
RedditTrendingResource {
scope: self.scope.clone(),
}
}
}
#[derive(Clone, Debug)]
pub struct RedditDomainResource {
scope: Scope,
}
impl RedditDomainResource {
pub fn posts(&self) -> RedditDomainPostsResource {
RedditDomainPostsResource {
scope: self.scope.clone(),
}
}
}
#[derive(Clone, Debug)]
pub struct RedditDomainPostsResource {
scope: Scope,
}
impl RedditDomainPostsResource {
pub async fn list(
&self,
options: impl Into<Option<RedditDomainPostsOptions>>,
) -> Result<RedditDomainPostsPage, Error> {
let options = options.into().unwrap_or_default();
self.scope
.operation(
Method::GET,
"/v1/reddit/domains/{identifier}/posts",
options.query(),
options.request_options,
)?
.send_page()
.await
}
pub fn items(&self, options: impl Into<Option<RedditDomainPostsOptions>>) -> Items<RedditPost> {
let options = options.into().unwrap_or_default();
Items::new(self.scope.operation(
Method::GET,
"/v1/reddit/domains/{identifier}/posts",
options.query(),
options.request_options,
))
}
}
#[derive(Clone, Debug)]
pub struct RedditPostResource {
scope: Scope,
}
impl RedditPostResource {
pub fn comments(&self) -> RedditPostCommentsResource {
RedditPostCommentsResource {
scope: self.scope.clone(),
}
}
pub fn duplicates(&self) -> RedditPostDuplicatesResource {
RedditPostDuplicatesResource {
scope: self.scope.clone(),
}
}
pub async fn get(
&self,
options: impl Into<Option<RedditPostOptions>>,
) -> Result<RedditPostResponse, Error> {
let options = options.into().unwrap_or_default();
self.scope
.operation(
Method::GET,
"/v1/reddit/posts/{identifier}",
options.query(),
options.request_options,
)?
.send()
.await
}
}
#[derive(Clone, Debug)]
pub struct RedditPostCommentsResource {
scope: Scope,
}
impl RedditPostCommentsResource {
pub async fn list(
&self,
options: impl Into<Option<RedditPostCommentsOptions>>,
) -> Result<RedditPostCommentsResponse, Error> {
let options = options.into().unwrap_or_default();
self.scope
.operation(
Method::GET,
"/v1/reddit/posts/{identifier}/comments",
options.query(),
options.request_options,
)?
.send()
.await
}
}
#[derive(Clone, Debug)]
pub struct RedditPostDuplicatesResource {
scope: Scope,
}
impl RedditPostDuplicatesResource {
pub async fn list(
&self,
options: impl Into<Option<RedditPostDuplicatesOptions>>,
) -> Result<RedditPostDuplicatesPage, Error> {
let options = options.into().unwrap_or_default();
self.scope
.operation(
Method::GET,
"/v1/reddit/posts/{identifier}/duplicates",
options.query(),
options.request_options,
)?
.send_page()
.await
}
pub fn items(
&self,
options: impl Into<Option<RedditPostDuplicatesOptions>>,
) -> Items<RedditPost> {
let options = options.into().unwrap_or_default();
Items::new(self.scope.operation(
Method::GET,
"/v1/reddit/posts/{identifier}/duplicates",
options.query(),
options.request_options,
))
}
}
#[derive(Clone, Debug)]
pub struct RedditProfileResource {
scope: Scope,
}
impl RedditProfileResource {
pub fn comments(&self) -> RedditProfileCommentsResource {
RedditProfileCommentsResource {
scope: self.scope.clone(),
}
}
pub fn moderated(&self) -> RedditProfileModeratedResource {
RedditProfileModeratedResource {
scope: self.scope.clone(),
}
}
pub fn posts(&self) -> RedditProfilePostsResource {
RedditProfilePostsResource {
scope: self.scope.clone(),
}
}
pub fn trophies(&self) -> RedditProfileTrophiesResource {
RedditProfileTrophiesResource {
scope: self.scope.clone(),
}
}
pub async fn get(
&self,
options: impl Into<Option<RedditProfileOptions>>,
) -> Result<RedditProfileResponse, Error> {
let options = options.into().unwrap_or_default();
self.scope
.operation(
Method::GET,
"/v1/reddit/profiles/{identifier}",
options.query(),
options.request_options,
)?
.send()
.await
}
}
#[derive(Clone, Debug)]
pub struct RedditProfileCommentsResource {
scope: Scope,
}
impl RedditProfileCommentsResource {
pub async fn list(
&self,
options: impl Into<Option<RedditProfileCommentsOptions>>,
) -> Result<RedditProfileCommentsPage, Error> {
let options = options.into().unwrap_or_default();
self.scope
.operation(
Method::GET,
"/v1/reddit/profiles/{identifier}/comments",
options.query(),
options.request_options,
)?
.send_page()
.await
}
pub fn items(
&self,
options: impl Into<Option<RedditProfileCommentsOptions>>,
) -> Items<RedditComment> {
let options = options.into().unwrap_or_default();
Items::new(self.scope.operation(
Method::GET,
"/v1/reddit/profiles/{identifier}/comments",
options.query(),
options.request_options,
))
}
}
#[derive(Clone, Debug)]
pub struct RedditProfileModeratedResource {
scope: Scope,
}
impl RedditProfileModeratedResource {
pub async fn list(
&self,
options: impl Into<Option<RedditProfileModeratedOptions>>,
) -> Result<RedditProfileModeratedResponse, Error> {
let options = options.into().unwrap_or_default();
self.scope
.operation(
Method::GET,
"/v1/reddit/profiles/{identifier}/moderated",
options.query(),
options.request_options,
)?
.send()
.await
}
}
#[derive(Clone, Debug)]
pub struct RedditProfilePostsResource {
scope: Scope,
}
impl RedditProfilePostsResource {
pub async fn list(
&self,
options: impl Into<Option<RedditProfilePostsOptions>>,
) -> Result<RedditProfilePostsPage, Error> {
let options = options.into().unwrap_or_default();
self.scope
.operation(
Method::GET,
"/v1/reddit/profiles/{identifier}/posts",
options.query(),
options.request_options,
)?
.send_page()
.await
}
pub fn items(
&self,
options: impl Into<Option<RedditProfilePostsOptions>>,
) -> Items<RedditPost> {
let options = options.into().unwrap_or_default();
Items::new(self.scope.operation(
Method::GET,
"/v1/reddit/profiles/{identifier}/posts",
options.query(),
options.request_options,
))
}
}
#[derive(Clone, Debug)]
pub struct RedditProfileTrophiesResource {
scope: Scope,
}
impl RedditProfileTrophiesResource {
pub async fn list(
&self,
options: impl Into<Option<RedditProfileTrophiesOptions>>,
) -> Result<RedditProfileTrophiesResponse, Error> {
let options = options.into().unwrap_or_default();
self.scope
.operation(
Method::GET,
"/v1/reddit/profiles/{identifier}/trophies",
options.query(),
options.request_options,
)?
.send()
.await
}
}
#[derive(Clone, Debug)]
pub struct RedditSearchResource {
scope: Scope,
}
impl RedditSearchResource {
pub fn posts(&self) -> RedditSearchPostsResource {
RedditSearchPostsResource {
scope: self.scope.clone(),
}
}
pub fn profiles(&self) -> RedditSearchProfilesResource {
RedditSearchProfilesResource {
scope: self.scope.clone(),
}
}
pub fn subreddits(&self) -> RedditSearchSubredditsResource {
RedditSearchSubredditsResource {
scope: self.scope.clone(),
}
}
}
#[derive(Clone, Debug)]
pub struct RedditSearchPostsResource {
scope: Scope,
}
impl RedditSearchPostsResource {
pub async fn list(
&self,
options: RedditSearchPostsOptions,
) -> Result<RedditSearchPostsPage, Error> {
self.scope
.operation(
Method::GET,
"/v1/reddit/search/posts",
options.query(),
options.request_options,
)?
.send_page()
.await
}
pub fn items(&self, options: RedditSearchPostsOptions) -> Items<RedditPost> {
Items::new(self.scope.operation(
Method::GET,
"/v1/reddit/search/posts",
options.query(),
options.request_options,
))
}
}
#[derive(Clone, Debug)]
pub struct RedditSearchProfilesResource {
scope: Scope,
}
impl RedditSearchProfilesResource {
pub async fn list(
&self,
options: RedditSearchProfilesOptions,
) -> Result<RedditSearchProfilesPage, Error> {
self.scope
.operation(
Method::GET,
"/v1/reddit/search/profiles",
options.query(),
options.request_options,
)?
.send_page()
.await
}
pub fn items(&self, options: RedditSearchProfilesOptions) -> Items<RedditProfile> {
Items::new(self.scope.operation(
Method::GET,
"/v1/reddit/search/profiles",
options.query(),
options.request_options,
))
}
}
#[derive(Clone, Debug)]
pub struct RedditSearchSubredditsResource {
scope: Scope,
}
impl RedditSearchSubredditsResource {
pub async fn list(
&self,
options: RedditSearchSubredditsOptions,
) -> Result<RedditSearchSubredditsPage, Error> {
self.scope
.operation(
Method::GET,
"/v1/reddit/search/subreddits",
options.query(),
options.request_options,
)?
.send_page()
.await
}
pub fn items(&self, options: RedditSearchSubredditsOptions) -> Items<RedditSubreddit> {
Items::new(self.scope.operation(
Method::GET,
"/v1/reddit/search/subreddits",
options.query(),
options.request_options,
))
}
}
#[derive(Clone, Debug)]
pub struct RedditSubredditResource {
scope: Scope,
}
impl RedditSubredditResource {
pub fn posts(&self) -> RedditSubredditPostsResource {
RedditSubredditPostsResource {
scope: self.scope.clone(),
}
}
pub fn rules(&self) -> RedditSubredditRulesResource {
RedditSubredditRulesResource {
scope: self.scope.clone(),
}
}
pub fn wiki_page(
&self,
reference: impl Into<ResourceReference>,
) -> RedditSubredditWikiPageResource {
RedditSubredditWikiPageResource {
scope: self.scope.select(
"page",
"reddit",
"wikiPage",
Reference::from(reference.into()),
),
}
}
pub fn wiki_pages(&self) -> RedditSubredditWikiPagesResource {
RedditSubredditWikiPagesResource {
scope: self.scope.clone(),
}
}
pub async fn get(
&self,
options: impl Into<Option<RedditSubredditOptions>>,
) -> Result<RedditSubredditResponse, Error> {
let options = options.into().unwrap_or_default();
self.scope
.operation(
Method::GET,
"/v1/reddit/subreddits/{identifier}",
options.query(),
options.request_options,
)?
.send()
.await
}
}
#[derive(Clone, Debug)]
pub struct RedditSubredditPostsResource {
scope: Scope,
}
impl RedditSubredditPostsResource {
pub async fn list(
&self,
options: impl Into<Option<RedditSubredditPostsOptions>>,
) -> Result<RedditSubredditPostsPage, Error> {
let options = options.into().unwrap_or_default();
self.scope
.operation(
Method::GET,
"/v1/reddit/subreddits/{identifier}/posts",
options.query(),
options.request_options,
)?
.send_page()
.await
}
pub fn items(
&self,
options: impl Into<Option<RedditSubredditPostsOptions>>,
) -> Items<RedditPost> {
let options = options.into().unwrap_or_default();
Items::new(self.scope.operation(
Method::GET,
"/v1/reddit/subreddits/{identifier}/posts",
options.query(),
options.request_options,
))
}
}
#[derive(Clone, Debug)]
pub struct RedditSubredditRulesResource {
scope: Scope,
}
impl RedditSubredditRulesResource {
pub async fn list(
&self,
options: impl Into<Option<RedditSubredditRulesOptions>>,
) -> Result<RedditSubredditRulesResponse, Error> {
let options = options.into().unwrap_or_default();
self.scope
.operation(
Method::GET,
"/v1/reddit/subreddits/{identifier}/rules",
options.query(),
options.request_options,
)?
.send()
.await
}
}
#[derive(Clone, Debug)]
pub struct RedditSubredditWikiPageResource {
scope: Scope,
}
impl RedditSubredditWikiPageResource {
pub async fn get(
&self,
options: impl Into<Option<RedditSubredditWikiPageOptions>>,
) -> Result<RedditSubredditWikiPageResponse, Error> {
let options = options.into().unwrap_or_default();
self.scope
.operation(
Method::GET,
"/v1/reddit/subreddits/{identifier}/wiki-pages/{page}",
options.query(),
options.request_options,
)?
.send()
.await
}
}
#[derive(Clone, Debug)]
pub struct RedditSubredditWikiPagesResource {
scope: Scope,
}
impl RedditSubredditWikiPagesResource {
pub async fn list(
&self,
options: impl Into<Option<RedditSubredditWikiPagesOptions>>,
) -> Result<RedditSubredditWikiPagesResponse, Error> {
let options = options.into().unwrap_or_default();
self.scope
.operation(
Method::GET,
"/v1/reddit/subreddits/{identifier}/wiki-pages",
options.query(),
options.request_options,
)?
.send()
.await
}
}
#[derive(Clone, Debug)]
pub struct RedditSubredditsResource {
scope: Scope,
}
impl RedditSubredditsResource {
#[allow(clippy::new_ret_no_self)]
pub fn new(&self) -> RedditSubredditsNewResource {
RedditSubredditsNewResource {
scope: self.scope.clone(),
}
}
pub fn popular(&self) -> RedditSubredditsPopularResource {
RedditSubredditsPopularResource {
scope: self.scope.clone(),
}
}
}
#[derive(Clone, Debug)]
pub struct RedditSubredditsNewResource {
scope: Scope,
}
impl RedditSubredditsNewResource {
pub async fn list(
&self,
options: impl Into<Option<RedditSubredditsNewOptions>>,
) -> Result<RedditSubredditsNewPage, Error> {
let options = options.into().unwrap_or_default();
self.scope
.operation(
Method::GET,
"/v1/reddit/subreddits/new",
options.query(),
options.request_options,
)?
.send_page()
.await
}
pub fn items(
&self,
options: impl Into<Option<RedditSubredditsNewOptions>>,
) -> Items<RedditSubreddit> {
let options = options.into().unwrap_or_default();
Items::new(self.scope.operation(
Method::GET,
"/v1/reddit/subreddits/new",
options.query(),
options.request_options,
))
}
}
#[derive(Clone, Debug)]
pub struct RedditSubredditsPopularResource {
scope: Scope,
}
impl RedditSubredditsPopularResource {
pub async fn list(
&self,
options: impl Into<Option<RedditSubredditsPopularOptions>>,
) -> Result<RedditSubredditsPopularPage, Error> {
let options = options.into().unwrap_or_default();
self.scope
.operation(
Method::GET,
"/v1/reddit/subreddits/popular",
options.query(),
options.request_options,
)?
.send_page()
.await
}
pub fn items(
&self,
options: impl Into<Option<RedditSubredditsPopularOptions>>,
) -> Items<RedditSubreddit> {
let options = options.into().unwrap_or_default();
Items::new(self.scope.operation(
Method::GET,
"/v1/reddit/subreddits/popular",
options.query(),
options.request_options,
))
}
}
#[derive(Clone, Debug)]
pub struct RedditTrendingResource {
scope: Scope,
}
impl RedditTrendingResource {
pub fn posts(&self) -> RedditTrendingPostsResource {
RedditTrendingPostsResource {
scope: self.scope.clone(),
}
}
}
#[derive(Clone, Debug)]
pub struct RedditTrendingPostsResource {
scope: Scope,
}
impl RedditTrendingPostsResource {
pub async fn list(
&self,
options: impl Into<Option<RedditTrendingPostsOptions>>,
) -> Result<RedditTrendingPostsPage, Error> {
let options = options.into().unwrap_or_default();
self.scope
.operation(
Method::GET,
"/v1/reddit/trending/posts",
options.query(),
options.request_options,
)?
.send_page()
.await
}
pub fn items(
&self,
options: impl Into<Option<RedditTrendingPostsOptions>>,
) -> Items<RedditPost> {
let options = options.into().unwrap_or_default();
Items::new(self.scope.operation(
Method::GET,
"/v1/reddit/trending/posts",
options.query(),
options.request_options,
))
}
}
#[derive(Clone, Debug)]
pub struct TestDataResource {
scope: Scope,
}
impl TestDataResource {
pub fn entry(&self, reference: impl Into<ResourceReference>) -> TestDataEntryResource {
TestDataEntryResource {
scope: self.scope.select(
"id",
"testData",
"testDataEntry",
Reference::from(reference.into()),
),
}
}
pub async fn list(
&self,
options: impl Into<Option<TestDataOptions>>,
) -> Result<TestDataResponse, Error> {
let options = options.into().unwrap_or_default();
self.scope
.operation(
Method::GET,
"/v1/test-data",
options.query(),
options.request_options,
)?
.send()
.await
}
}
#[derive(Clone, Debug)]
pub struct TestDataEntryResource {
scope: Scope,
}
impl TestDataEntryResource {
pub async fn get(
&self,
options: impl Into<Option<TestDataEntryOptions>>,
) -> Result<TestDataEntryResponse, Error> {
let options = options.into().unwrap_or_default();
self.scope
.operation(
Method::GET,
"/v1/test-data/{id}",
options.query(),
options.request_options,
)?
.send()
.await
}
}
#[derive(Clone, Debug)]
pub struct TikTokResource {
scope: Scope,
}
impl TikTokResource {
pub fn effect(&self, reference: impl Into<ResourceReference>) -> TikTokEffectResource {
TikTokEffectResource {
scope: self.scope.select(
"identifier",
"tiktok",
"effect",
Reference::from(reference.into()),
),
}
}
pub fn effects(&self) -> TikTokEffectsResource {
TikTokEffectsResource {
scope: self.scope.clone(),
}
}
pub fn hashtag(&self, reference: impl Into<ResourceReference>) -> TikTokHashtagResource {
TikTokHashtagResource {
scope: self.scope.select(
"identifier",
"tiktok",
"hashtag",
Reference::from(reference.into()),
),
}
}
pub fn location(&self, reference: impl Into<ResourceReference>) -> TikTokLocationResource {
TikTokLocationResource {
scope: self.scope.select(
"identifier",
"tiktok",
"location",
Reference::from(reference.into()),
),
}
}
pub fn music(&self, reference: impl Into<ResourceReference>) -> TikTokMusicResource {
TikTokMusicResource {
scope: self.scope.select(
"identifier",
"tiktok",
"music",
Reference::from(reference.into()),
),
}
}
pub fn post(&self, reference: impl Into<ResourceReference>) -> TikTokPostResource {
TikTokPostResource {
scope: self.scope.select(
"identifier",
"tiktok",
"post",
Reference::from(reference.into()),
),
}
}
pub fn profile(&self, reference: impl Into<ProfileReference>) -> TikTokProfileResource {
TikTokProfileResource {
scope: self.scope.select(
"identifier",
"tiktok",
"profile",
Reference::from(reference.into()),
),
}
}
pub fn search(&self) -> TikTokSearchResource {
TikTokSearchResource {
scope: self.scope.clone(),
}
}
pub fn trending(&self) -> TikTokTrendingResource {
TikTokTrendingResource {
scope: self.scope.clone(),
}
}
}
#[derive(Clone, Debug)]
pub struct TikTokEffectResource {
scope: Scope,
}
impl TikTokEffectResource {
pub fn posts(&self) -> TikTokEffectPostsResource {
TikTokEffectPostsResource {
scope: self.scope.clone(),
}
}
pub async fn get(
&self,
options: impl Into<Option<TikTokEffectOptions>>,
) -> Result<TikTokEffectResponse, Error> {
let options = options.into().unwrap_or_default();
self.scope
.operation(
Method::GET,
"/v1/tiktok/effects/{identifier}",
options.query(),
options.request_options,
)?
.send()
.await
}
}
#[derive(Clone, Debug)]
pub struct TikTokEffectPostsResource {
scope: Scope,
}
impl TikTokEffectPostsResource {
pub async fn list(
&self,
options: impl Into<Option<TikTokEffectPostsOptions>>,
) -> Result<TikTokEffectPostsPage, Error> {
let options = options.into().unwrap_or_default();
self.scope
.operation(
Method::GET,
"/v1/tiktok/effects/{identifier}/posts",
options.query(),
options.request_options,
)?
.send_page()
.await
}
pub fn items(&self, options: impl Into<Option<TikTokEffectPostsOptions>>) -> Items<TikTokPost> {
let options = options.into().unwrap_or_default();
Items::new(self.scope.operation(
Method::GET,
"/v1/tiktok/effects/{identifier}/posts",
options.query(),
options.request_options,
))
}
}
#[derive(Clone, Debug)]
pub struct TikTokEffectsResource {
scope: Scope,
}
impl TikTokEffectsResource {
pub async fn list(&self, options: TikTokEffectsOptions) -> Result<TikTokEffectsPage, Error> {
self.scope
.operation(
Method::GET,
"/v1/tiktok/effects",
options.query(),
options.request_options,
)?
.send_page()
.await
}
pub fn items(&self, options: TikTokEffectsOptions) -> Items<TikTokEffect> {
Items::new(self.scope.operation(
Method::GET,
"/v1/tiktok/effects",
options.query(),
options.request_options,
))
}
}
#[derive(Clone, Debug)]
pub struct TikTokHashtagResource {
scope: Scope,
}
impl TikTokHashtagResource {
pub fn posts(&self) -> TikTokHashtagPostsResource {
TikTokHashtagPostsResource {
scope: self.scope.clone(),
}
}
pub async fn get(
&self,
options: impl Into<Option<TikTokHashtagOptions>>,
) -> Result<TikTokHashtagResponse, Error> {
let options = options.into().unwrap_or_default();
self.scope
.operation(
Method::GET,
"/v1/tiktok/hashtags/{identifier}",
options.query(),
options.request_options,
)?
.send()
.await
}
}
#[derive(Clone, Debug)]
pub struct TikTokHashtagPostsResource {
scope: Scope,
}
impl TikTokHashtagPostsResource {
pub async fn list(
&self,
options: impl Into<Option<TikTokHashtagPostsOptions>>,
) -> Result<TikTokHashtagPostsPage, Error> {
let options = options.into().unwrap_or_default();
self.scope
.operation(
Method::GET,
"/v1/tiktok/hashtags/{identifier}/posts",
options.query(),
options.request_options,
)?
.send_page()
.await
}
pub fn items(
&self,
options: impl Into<Option<TikTokHashtagPostsOptions>>,
) -> Items<TikTokPost> {
let options = options.into().unwrap_or_default();
Items::new(self.scope.operation(
Method::GET,
"/v1/tiktok/hashtags/{identifier}/posts",
options.query(),
options.request_options,
))
}
}
#[derive(Clone, Debug)]
pub struct TikTokLocationResource {
scope: Scope,
}
impl TikTokLocationResource {
pub fn posts(&self) -> TikTokLocationPostsResource {
TikTokLocationPostsResource {
scope: self.scope.clone(),
}
}
pub async fn get(
&self,
options: impl Into<Option<TikTokLocationOptions>>,
) -> Result<TikTokLocationResponse, Error> {
let options = options.into().unwrap_or_default();
self.scope
.operation(
Method::GET,
"/v1/tiktok/locations/{identifier}",
options.query(),
options.request_options,
)?
.send()
.await
}
}
#[derive(Clone, Debug)]
pub struct TikTokLocationPostsResource {
scope: Scope,
}
impl TikTokLocationPostsResource {
pub async fn list(
&self,
options: impl Into<Option<TikTokLocationPostsOptions>>,
) -> Result<TikTokLocationPostsPage, Error> {
let options = options.into().unwrap_or_default();
self.scope
.operation(
Method::GET,
"/v1/tiktok/locations/{identifier}/posts",
options.query(),
options.request_options,
)?
.send_page()
.await
}
pub fn items(
&self,
options: impl Into<Option<TikTokLocationPostsOptions>>,
) -> Items<TikTokPost> {
let options = options.into().unwrap_or_default();
Items::new(self.scope.operation(
Method::GET,
"/v1/tiktok/locations/{identifier}/posts",
options.query(),
options.request_options,
))
}
}
#[derive(Clone, Debug)]
pub struct TikTokMusicResource {
scope: Scope,
}
impl TikTokMusicResource {
pub fn posts(&self) -> TikTokMusicPostsResource {
TikTokMusicPostsResource {
scope: self.scope.clone(),
}
}
pub async fn get(
&self,
options: impl Into<Option<TikTokMusicOptions>>,
) -> Result<TikTokMusicResponse, Error> {
let options = options.into().unwrap_or_default();
self.scope
.operation(
Method::GET,
"/v1/tiktok/music/{identifier}",
options.query(),
options.request_options,
)?
.send()
.await
}
}
#[derive(Clone, Debug)]
pub struct TikTokMusicPostsResource {
scope: Scope,
}
impl TikTokMusicPostsResource {
pub async fn list(
&self,
options: impl Into<Option<TikTokMusicPostsOptions>>,
) -> Result<TikTokMusicPostsPage, Error> {
let options = options.into().unwrap_or_default();
self.scope
.operation(
Method::GET,
"/v1/tiktok/music/{identifier}/posts",
options.query(),
options.request_options,
)?
.send_page()
.await
}
pub fn items(&self, options: impl Into<Option<TikTokMusicPostsOptions>>) -> Items<TikTokPost> {
let options = options.into().unwrap_or_default();
Items::new(self.scope.operation(
Method::GET,
"/v1/tiktok/music/{identifier}/posts",
options.query(),
options.request_options,
))
}
}
#[derive(Clone, Debug)]
pub struct TikTokPostResource {
scope: Scope,
}
impl TikTokPostResource {
pub fn comment(&self, reference: impl Into<ResourceReference>) -> TikTokPostCommentResource {
TikTokPostCommentResource {
scope: self.scope.select(
"comment_id",
"tiktok",
"comment",
Reference::from(reference.into()),
),
}
}
pub fn comments(&self) -> TikTokPostCommentsResource {
TikTokPostCommentsResource {
scope: self.scope.clone(),
}
}
pub async fn get(
&self,
options: impl Into<Option<TikTokPostOptions>>,
) -> Result<TikTokPostResponse, Error> {
let options = options.into().unwrap_or_default();
self.scope
.operation(
Method::GET,
"/v1/tiktok/posts/{identifier}",
options.query(),
options.request_options,
)?
.send()
.await
}
}
#[derive(Clone, Debug)]
pub struct TikTokPostCommentResource {
scope: Scope,
}
impl TikTokPostCommentResource {
pub fn replies(&self) -> TikTokPostCommentRepliesResource {
TikTokPostCommentRepliesResource {
scope: self.scope.clone(),
}
}
}
#[derive(Clone, Debug)]
pub struct TikTokPostCommentRepliesResource {
scope: Scope,
}
impl TikTokPostCommentRepliesResource {
pub async fn list(
&self,
options: impl Into<Option<TikTokPostCommentRepliesOptions>>,
) -> Result<TikTokPostCommentRepliesPage, Error> {
let options = options.into().unwrap_or_default();
self.scope
.operation(
Method::GET,
"/v1/tiktok/posts/{identifier}/comments/{comment_id}/replies",
options.query(),
options.request_options,
)?
.send_page()
.await
}
pub fn items(
&self,
options: impl Into<Option<TikTokPostCommentRepliesOptions>>,
) -> Items<TikTokComment> {
let options = options.into().unwrap_or_default();
Items::new(self.scope.operation(
Method::GET,
"/v1/tiktok/posts/{identifier}/comments/{comment_id}/replies",
options.query(),
options.request_options,
))
}
}
#[derive(Clone, Debug)]
pub struct TikTokPostCommentsResource {
scope: Scope,
}
impl TikTokPostCommentsResource {
pub async fn list(
&self,
options: impl Into<Option<TikTokPostCommentsOptions>>,
) -> Result<TikTokPostCommentsPage, Error> {
let options = options.into().unwrap_or_default();
self.scope
.operation(
Method::GET,
"/v1/tiktok/posts/{identifier}/comments",
options.query(),
options.request_options,
)?
.send_page()
.await
}
pub fn items(
&self,
options: impl Into<Option<TikTokPostCommentsOptions>>,
) -> Items<TikTokComment> {
let options = options.into().unwrap_or_default();
Items::new(self.scope.operation(
Method::GET,
"/v1/tiktok/posts/{identifier}/comments",
options.query(),
options.request_options,
))
}
}
#[derive(Clone, Debug)]
pub struct TikTokProfileResource {
scope: Scope,
}
impl TikTokProfileResource {
pub fn followers(&self) -> TikTokProfileFollowersResource {
TikTokProfileFollowersResource {
scope: self.scope.clone(),
}
}
pub fn following(&self) -> TikTokProfileFollowingResource {
TikTokProfileFollowingResource {
scope: self.scope.clone(),
}
}
pub fn liked_posts(&self) -> TikTokProfileLikedPostsResource {
TikTokProfileLikedPostsResource {
scope: self.scope.clone(),
}
}
pub fn playlist(
&self,
reference: impl Into<ResourceReference>,
) -> TikTokProfilePlaylistResource {
TikTokProfilePlaylistResource {
scope: self.scope.select(
"playlist_id",
"tiktok",
"playlist",
Reference::from(reference.into()),
),
}
}
pub fn playlists(&self) -> TikTokProfilePlaylistsResource {
TikTokProfilePlaylistsResource {
scope: self.scope.clone(),
}
}
pub fn posts(&self) -> TikTokProfilePostsResource {
TikTokProfilePostsResource {
scope: self.scope.clone(),
}
}
pub async fn get(
&self,
options: impl Into<Option<TikTokProfileOptions>>,
) -> Result<TikTokProfileResponse, Error> {
let options = options.into().unwrap_or_default();
self.scope
.operation(
Method::GET,
"/v1/tiktok/profiles/{identifier}",
options.query(),
options.request_options,
)?
.send()
.await
}
}
#[derive(Clone, Debug)]
pub struct TikTokProfileFollowersResource {
scope: Scope,
}
impl TikTokProfileFollowersResource {
pub async fn list(
&self,
options: impl Into<Option<TikTokProfileFollowersOptions>>,
) -> Result<TikTokProfileFollowersPage, Error> {
let options = options.into().unwrap_or_default();
self.scope
.operation(
Method::GET,
"/v1/tiktok/profiles/{identifier}/followers",
options.query(),
options.request_options,
)?
.send_page()
.await
}
pub fn items(
&self,
options: impl Into<Option<TikTokProfileFollowersOptions>>,
) -> Items<TikTokProfile> {
let options = options.into().unwrap_or_default();
Items::new(self.scope.operation(
Method::GET,
"/v1/tiktok/profiles/{identifier}/followers",
options.query(),
options.request_options,
))
}
}
#[derive(Clone, Debug)]
pub struct TikTokProfileFollowingResource {
scope: Scope,
}
impl TikTokProfileFollowingResource {
pub async fn list(
&self,
options: impl Into<Option<TikTokProfileFollowingOptions>>,
) -> Result<TikTokProfileFollowingPage, Error> {
let options = options.into().unwrap_or_default();
self.scope
.operation(
Method::GET,
"/v1/tiktok/profiles/{identifier}/following",
options.query(),
options.request_options,
)?
.send_page()
.await
}
pub fn items(
&self,
options: impl Into<Option<TikTokProfileFollowingOptions>>,
) -> Items<TikTokProfile> {
let options = options.into().unwrap_or_default();
Items::new(self.scope.operation(
Method::GET,
"/v1/tiktok/profiles/{identifier}/following",
options.query(),
options.request_options,
))
}
}
#[derive(Clone, Debug)]
pub struct TikTokProfileLikedPostsResource {
scope: Scope,
}
impl TikTokProfileLikedPostsResource {
pub async fn list(
&self,
options: impl Into<Option<TikTokProfileLikedPostsOptions>>,
) -> Result<TikTokProfileLikedPostsPage, Error> {
let options = options.into().unwrap_or_default();
self.scope
.operation(
Method::GET,
"/v1/tiktok/profiles/{identifier}/liked-posts",
options.query(),
options.request_options,
)?
.send_page()
.await
}
pub fn items(
&self,
options: impl Into<Option<TikTokProfileLikedPostsOptions>>,
) -> Items<TikTokPost> {
let options = options.into().unwrap_or_default();
Items::new(self.scope.operation(
Method::GET,
"/v1/tiktok/profiles/{identifier}/liked-posts",
options.query(),
options.request_options,
))
}
}
#[derive(Clone, Debug)]
pub struct TikTokProfilePlaylistResource {
scope: Scope,
}
impl TikTokProfilePlaylistResource {
pub fn posts(&self) -> TikTokProfilePlaylistPostsResource {
TikTokProfilePlaylistPostsResource {
scope: self.scope.clone(),
}
}
pub async fn get(
&self,
options: impl Into<Option<TikTokProfilePlaylistOptions>>,
) -> Result<TikTokProfilePlaylistResponse, Error> {
let options = options.into().unwrap_or_default();
self.scope
.operation(
Method::GET,
"/v1/tiktok/profiles/{identifier}/playlists/{playlist_id}",
options.query(),
options.request_options,
)?
.send()
.await
}
}
#[derive(Clone, Debug)]
pub struct TikTokProfilePlaylistPostsResource {
scope: Scope,
}
impl TikTokProfilePlaylistPostsResource {
pub async fn list(
&self,
options: impl Into<Option<TikTokProfilePlaylistPostsOptions>>,
) -> Result<TikTokProfilePlaylistPostsPage, Error> {
let options = options.into().unwrap_or_default();
self.scope
.operation(
Method::GET,
"/v1/tiktok/profiles/{identifier}/playlists/{playlist_id}/posts",
options.query(),
options.request_options,
)?
.send_page()
.await
}
pub fn items(
&self,
options: impl Into<Option<TikTokProfilePlaylistPostsOptions>>,
) -> Items<TikTokPost> {
let options = options.into().unwrap_or_default();
Items::new(self.scope.operation(
Method::GET,
"/v1/tiktok/profiles/{identifier}/playlists/{playlist_id}/posts",
options.query(),
options.request_options,
))
}
}
#[derive(Clone, Debug)]
pub struct TikTokProfilePlaylistsResource {
scope: Scope,
}
impl TikTokProfilePlaylistsResource {
pub async fn list(
&self,
options: impl Into<Option<TikTokProfilePlaylistsOptions>>,
) -> Result<TikTokProfilePlaylistsPage, Error> {
let options = options.into().unwrap_or_default();
self.scope
.operation(
Method::GET,
"/v1/tiktok/profiles/{identifier}/playlists",
options.query(),
options.request_options,
)?
.send_page()
.await
}
pub fn items(
&self,
options: impl Into<Option<TikTokProfilePlaylistsOptions>>,
) -> Items<TikTokPlaylist> {
let options = options.into().unwrap_or_default();
Items::new(self.scope.operation(
Method::GET,
"/v1/tiktok/profiles/{identifier}/playlists",
options.query(),
options.request_options,
))
}
}
#[derive(Clone, Debug)]
pub struct TikTokProfilePostsResource {
scope: Scope,
}
impl TikTokProfilePostsResource {
pub async fn list(
&self,
options: impl Into<Option<TikTokProfilePostsOptions>>,
) -> Result<TikTokProfilePostsPage, Error> {
let options = options.into().unwrap_or_default();
self.scope
.operation(
Method::GET,
"/v1/tiktok/profiles/{identifier}/posts",
options.query(),
options.request_options,
)?
.send_page()
.await
}
pub fn items(
&self,
options: impl Into<Option<TikTokProfilePostsOptions>>,
) -> Items<TikTokPost> {
let options = options.into().unwrap_or_default();
Items::new(self.scope.operation(
Method::GET,
"/v1/tiktok/profiles/{identifier}/posts",
options.query(),
options.request_options,
))
}
}
#[derive(Clone, Debug)]
pub struct TikTokSearchResource {
scope: Scope,
}
impl TikTokSearchResource {
pub fn hashtags(&self) -> TikTokSearchHashtagsResource {
TikTokSearchHashtagsResource {
scope: self.scope.clone(),
}
}
pub fn locations(&self) -> TikTokSearchLocationsResource {
TikTokSearchLocationsResource {
scope: self.scope.clone(),
}
}
pub fn music(&self) -> TikTokSearchMusicResource {
TikTokSearchMusicResource {
scope: self.scope.clone(),
}
}
pub fn posts(&self) -> TikTokSearchPostsResource {
TikTokSearchPostsResource {
scope: self.scope.clone(),
}
}
pub fn profiles(&self) -> TikTokSearchProfilesResource {
TikTokSearchProfilesResource {
scope: self.scope.clone(),
}
}
}
#[derive(Clone, Debug)]
pub struct TikTokSearchHashtagsResource {
scope: Scope,
}
impl TikTokSearchHashtagsResource {
pub async fn list(
&self,
options: TikTokSearchHashtagsOptions,
) -> Result<TikTokSearchHashtagsPage, Error> {
self.scope
.operation(
Method::GET,
"/v1/tiktok/search/hashtags",
options.query(),
options.request_options,
)?
.send_page()
.await
}
pub fn items(&self, options: TikTokSearchHashtagsOptions) -> Items<TikTokHashtag> {
Items::new(self.scope.operation(
Method::GET,
"/v1/tiktok/search/hashtags",
options.query(),
options.request_options,
))
}
}
#[derive(Clone, Debug)]
pub struct TikTokSearchLocationsResource {
scope: Scope,
}
impl TikTokSearchLocationsResource {
pub async fn list(
&self,
options: TikTokSearchLocationsOptions,
) -> Result<TikTokSearchLocationsPage, Error> {
self.scope
.operation(
Method::GET,
"/v1/tiktok/search/locations",
options.query(),
options.request_options,
)?
.send_page()
.await
}
pub fn items(&self, options: TikTokSearchLocationsOptions) -> Items<TikTokLocation> {
Items::new(self.scope.operation(
Method::GET,
"/v1/tiktok/search/locations",
options.query(),
options.request_options,
))
}
}
#[derive(Clone, Debug)]
pub struct TikTokSearchMusicResource {
scope: Scope,
}
impl TikTokSearchMusicResource {
pub async fn list(
&self,
options: TikTokSearchMusicOptions,
) -> Result<TikTokSearchMusicPage, Error> {
self.scope
.operation(
Method::GET,
"/v1/tiktok/search/music",
options.query(),
options.request_options,
)?
.send_page()
.await
}
pub fn items(&self, options: TikTokSearchMusicOptions) -> Items<TikTokMusic> {
Items::new(self.scope.operation(
Method::GET,
"/v1/tiktok/search/music",
options.query(),
options.request_options,
))
}
}
#[derive(Clone, Debug)]
pub struct TikTokSearchPostsResource {
scope: Scope,
}
impl TikTokSearchPostsResource {
pub async fn list(
&self,
options: TikTokSearchPostsOptions,
) -> Result<TikTokSearchPostsPage, Error> {
self.scope
.operation(
Method::GET,
"/v1/tiktok/search/posts",
options.query(),
options.request_options,
)?
.send_page()
.await
}
pub fn items(&self, options: TikTokSearchPostsOptions) -> Items<TikTokPost> {
Items::new(self.scope.operation(
Method::GET,
"/v1/tiktok/search/posts",
options.query(),
options.request_options,
))
}
}
#[derive(Clone, Debug)]
pub struct TikTokSearchProfilesResource {
scope: Scope,
}
impl TikTokSearchProfilesResource {
pub async fn list(
&self,
options: TikTokSearchProfilesOptions,
) -> Result<TikTokSearchProfilesPage, Error> {
self.scope
.operation(
Method::GET,
"/v1/tiktok/search/profiles",
options.query(),
options.request_options,
)?
.send_page()
.await
}
pub fn items(&self, options: TikTokSearchProfilesOptions) -> Items<TikTokProfile> {
Items::new(self.scope.operation(
Method::GET,
"/v1/tiktok/search/profiles",
options.query(),
options.request_options,
))
}
}
#[derive(Clone, Debug)]
pub struct TikTokTrendingResource {
scope: Scope,
}
impl TikTokTrendingResource {
pub fn categories(&self) -> TikTokTrendingCategoriesResource {
TikTokTrendingCategoriesResource {
scope: self.scope.clone(),
}
}
pub fn music(&self) -> TikTokTrendingMusicResource {
TikTokTrendingMusicResource {
scope: self.scope.clone(),
}
}
pub fn posts(&self) -> TikTokTrendingPostsResource {
TikTokTrendingPostsResource {
scope: self.scope.clone(),
}
}
}
#[derive(Clone, Debug)]
pub struct TikTokTrendingCategoriesResource {
scope: Scope,
}
impl TikTokTrendingCategoriesResource {
pub async fn list(
&self,
options: impl Into<Option<TikTokTrendingCategoriesOptions>>,
) -> Result<TikTokTrendingCategoriesPage, Error> {
let options = options.into().unwrap_or_default();
self.scope
.operation(
Method::GET,
"/v1/tiktok/trending/categories",
options.query(),
options.request_options,
)?
.send_page()
.await
}
pub fn items(
&self,
options: impl Into<Option<TikTokTrendingCategoriesOptions>>,
) -> Items<TikTokCategory> {
let options = options.into().unwrap_or_default();
Items::new(self.scope.operation(
Method::GET,
"/v1/tiktok/trending/categories",
options.query(),
options.request_options,
))
}
}
#[derive(Clone, Debug)]
pub struct TikTokTrendingMusicResource {
scope: Scope,
}
impl TikTokTrendingMusicResource {
pub async fn list(
&self,
options: impl Into<Option<TikTokTrendingMusicOptions>>,
) -> Result<TikTokTrendingMusicPage, Error> {
let options = options.into().unwrap_or_default();
self.scope
.operation(
Method::GET,
"/v1/tiktok/trending/music",
options.query(),
options.request_options,
)?
.send_page()
.await
}
pub fn items(
&self,
options: impl Into<Option<TikTokTrendingMusicOptions>>,
) -> Items<TikTokMusic> {
let options = options.into().unwrap_or_default();
Items::new(self.scope.operation(
Method::GET,
"/v1/tiktok/trending/music",
options.query(),
options.request_options,
))
}
}
#[derive(Clone, Debug)]
pub struct TikTokTrendingPostsResource {
scope: Scope,
}
impl TikTokTrendingPostsResource {
pub async fn list(
&self,
options: impl Into<Option<TikTokTrendingPostsOptions>>,
) -> Result<TikTokTrendingPostsPage, Error> {
let options = options.into().unwrap_or_default();
self.scope
.operation(
Method::GET,
"/v1/tiktok/trending/posts",
options.query(),
options.request_options,
)?
.send_page()
.await
}
pub fn items(
&self,
options: impl Into<Option<TikTokTrendingPostsOptions>>,
) -> Items<TikTokPost> {
let options = options.into().unwrap_or_default();
Items::new(self.scope.operation(
Method::GET,
"/v1/tiktok/trending/posts",
options.query(),
options.request_options,
))
}
}
#[derive(Clone, Debug)]
pub struct TwitterResource {
scope: Scope,
}
impl TwitterResource {
pub fn list(&self, reference: impl Into<ResourceReference>) -> TwitterListResource {
TwitterListResource {
scope: self.scope.select(
"identifier",
"twitter",
"list",
Reference::from(reference.into()),
),
}
}
pub fn post(&self, reference: impl Into<ResourceReference>) -> TwitterPostResource {
TwitterPostResource {
scope: self.scope.select(
"identifier",
"twitter",
"post",
Reference::from(reference.into()),
),
}
}
pub fn profile(&self, reference: impl Into<ProfileReference>) -> TwitterProfileResource {
TwitterProfileResource {
scope: self.scope.select(
"identifier",
"twitter",
"profile",
Reference::from(reference.into()),
),
}
}
pub fn search(&self) -> TwitterSearchResource {
TwitterSearchResource {
scope: self.scope.clone(),
}
}
}
#[derive(Clone, Debug)]
pub struct TwitterListResource {
scope: Scope,
}
impl TwitterListResource {
pub fn posts(&self) -> TwitterListPostsResource {
TwitterListPostsResource {
scope: self.scope.clone(),
}
}
}
#[derive(Clone, Debug)]
pub struct TwitterListPostsResource {
scope: Scope,
}
impl TwitterListPostsResource {
pub async fn list(
&self,
options: impl Into<Option<TwitterListPostsOptions>>,
) -> Result<TwitterListPostsPage, Error> {
let options = options.into().unwrap_or_default();
self.scope
.operation(
Method::GET,
"/v1/twitter/lists/{identifier}/posts",
options.query(),
options.request_options,
)?
.send_page()
.await
}
pub fn items(&self, options: impl Into<Option<TwitterListPostsOptions>>) -> Items<TwitterPost> {
let options = options.into().unwrap_or_default();
Items::new(self.scope.operation(
Method::GET,
"/v1/twitter/lists/{identifier}/posts",
options.query(),
options.request_options,
))
}
}
#[derive(Clone, Debug)]
pub struct TwitterPostResource {
scope: Scope,
}
impl TwitterPostResource {
pub fn comment(&self, reference: impl Into<ResourceReference>) -> TwitterPostCommentResource {
TwitterPostCommentResource {
scope: self.scope.select(
"comment_id",
"twitter",
"comment",
Reference::from(reference.into()),
),
}
}
pub fn comments(&self) -> TwitterPostCommentsResource {
TwitterPostCommentsResource {
scope: self.scope.clone(),
}
}
pub fn reposters(&self) -> TwitterPostRepostersResource {
TwitterPostRepostersResource {
scope: self.scope.clone(),
}
}
pub async fn get(
&self,
options: impl Into<Option<TwitterPostOptions>>,
) -> Result<TwitterPostResponse, Error> {
let options = options.into().unwrap_or_default();
self.scope
.operation(
Method::GET,
"/v1/twitter/posts/{identifier}",
options.query(),
options.request_options,
)?
.send()
.await
}
}
#[derive(Clone, Debug)]
pub struct TwitterPostCommentResource {
scope: Scope,
}
impl TwitterPostCommentResource {
pub fn replies(&self) -> TwitterPostCommentRepliesResource {
TwitterPostCommentRepliesResource {
scope: self.scope.clone(),
}
}
}
#[derive(Clone, Debug)]
pub struct TwitterPostCommentRepliesResource {
scope: Scope,
}
impl TwitterPostCommentRepliesResource {
pub async fn list(
&self,
options: impl Into<Option<TwitterPostCommentRepliesOptions>>,
) -> Result<TwitterPostCommentRepliesPage, Error> {
let options = options.into().unwrap_or_default();
self.scope
.operation(
Method::GET,
"/v1/twitter/posts/{identifier}/comments/{comment_id}/replies",
options.query(),
options.request_options,
)?
.send_page()
.await
}
pub fn items(
&self,
options: impl Into<Option<TwitterPostCommentRepliesOptions>>,
) -> Items<TwitterPost> {
let options = options.into().unwrap_or_default();
Items::new(self.scope.operation(
Method::GET,
"/v1/twitter/posts/{identifier}/comments/{comment_id}/replies",
options.query(),
options.request_options,
))
}
}
#[derive(Clone, Debug)]
pub struct TwitterPostCommentsResource {
scope: Scope,
}
impl TwitterPostCommentsResource {
pub async fn list(
&self,
options: impl Into<Option<TwitterPostCommentsOptions>>,
) -> Result<TwitterPostCommentsPage, Error> {
let options = options.into().unwrap_or_default();
self.scope
.operation(
Method::GET,
"/v1/twitter/posts/{identifier}/comments",
options.query(),
options.request_options,
)?
.send_page()
.await
}
pub fn items(
&self,
options: impl Into<Option<TwitterPostCommentsOptions>>,
) -> Items<TwitterPost> {
let options = options.into().unwrap_or_default();
Items::new(self.scope.operation(
Method::GET,
"/v1/twitter/posts/{identifier}/comments",
options.query(),
options.request_options,
))
}
}
#[derive(Clone, Debug)]
pub struct TwitterPostRepostersResource {
scope: Scope,
}
impl TwitterPostRepostersResource {
pub async fn list(
&self,
options: impl Into<Option<TwitterPostRepostersOptions>>,
) -> Result<TwitterPostRepostersPage, Error> {
let options = options.into().unwrap_or_default();
self.scope
.operation(
Method::GET,
"/v1/twitter/posts/{identifier}/reposters",
options.query(),
options.request_options,
)?
.send_page()
.await
}
pub fn items(
&self,
options: impl Into<Option<TwitterPostRepostersOptions>>,
) -> Items<TwitterProfile> {
let options = options.into().unwrap_or_default();
Items::new(self.scope.operation(
Method::GET,
"/v1/twitter/posts/{identifier}/reposters",
options.query(),
options.request_options,
))
}
}
#[derive(Clone, Debug)]
pub struct TwitterProfileResource {
scope: Scope,
}
impl TwitterProfileResource {
pub fn followers(&self) -> TwitterProfileFollowersResource {
TwitterProfileFollowersResource {
scope: self.scope.clone(),
}
}
pub fn following(&self) -> TwitterProfileFollowingResource {
TwitterProfileFollowingResource {
scope: self.scope.clone(),
}
}
pub fn media(&self) -> TwitterProfileMediaResource {
TwitterProfileMediaResource {
scope: self.scope.clone(),
}
}
pub fn posts(&self) -> TwitterProfilePostsResource {
TwitterProfilePostsResource {
scope: self.scope.clone(),
}
}
pub fn replies(&self) -> TwitterProfileRepliesResource {
TwitterProfileRepliesResource {
scope: self.scope.clone(),
}
}
pub async fn get(
&self,
options: impl Into<Option<TwitterProfileOptions>>,
) -> Result<TwitterProfileResponse, Error> {
let options = options.into().unwrap_or_default();
self.scope
.operation(
Method::GET,
"/v1/twitter/profiles/{identifier}",
options.query(),
options.request_options,
)?
.send()
.await
}
}
#[derive(Clone, Debug)]
pub struct TwitterProfileFollowersResource {
scope: Scope,
}
impl TwitterProfileFollowersResource {
pub async fn list(
&self,
options: impl Into<Option<TwitterProfileFollowersOptions>>,
) -> Result<TwitterProfileFollowersPage, Error> {
let options = options.into().unwrap_or_default();
self.scope
.operation(
Method::GET,
"/v1/twitter/profiles/{identifier}/followers",
options.query(),
options.request_options,
)?
.send_page()
.await
}
pub fn items(
&self,
options: impl Into<Option<TwitterProfileFollowersOptions>>,
) -> Items<TwitterProfile> {
let options = options.into().unwrap_or_default();
Items::new(self.scope.operation(
Method::GET,
"/v1/twitter/profiles/{identifier}/followers",
options.query(),
options.request_options,
))
}
}
#[derive(Clone, Debug)]
pub struct TwitterProfileFollowingResource {
scope: Scope,
}
impl TwitterProfileFollowingResource {
pub async fn list(
&self,
options: impl Into<Option<TwitterProfileFollowingOptions>>,
) -> Result<TwitterProfileFollowingPage, Error> {
let options = options.into().unwrap_or_default();
self.scope
.operation(
Method::GET,
"/v1/twitter/profiles/{identifier}/following",
options.query(),
options.request_options,
)?
.send_page()
.await
}
pub fn items(
&self,
options: impl Into<Option<TwitterProfileFollowingOptions>>,
) -> Items<TwitterProfile> {
let options = options.into().unwrap_or_default();
Items::new(self.scope.operation(
Method::GET,
"/v1/twitter/profiles/{identifier}/following",
options.query(),
options.request_options,
))
}
}
#[derive(Clone, Debug)]
pub struct TwitterProfileMediaResource {
scope: Scope,
}
impl TwitterProfileMediaResource {
pub async fn list(
&self,
options: impl Into<Option<TwitterProfileMediaOptions>>,
) -> Result<TwitterProfileMediaPage, Error> {
let options = options.into().unwrap_or_default();
self.scope
.operation(
Method::GET,
"/v1/twitter/profiles/{identifier}/media",
options.query(),
options.request_options,
)?
.send_page()
.await
}
pub fn items(
&self,
options: impl Into<Option<TwitterProfileMediaOptions>>,
) -> Items<TwitterPost> {
let options = options.into().unwrap_or_default();
Items::new(self.scope.operation(
Method::GET,
"/v1/twitter/profiles/{identifier}/media",
options.query(),
options.request_options,
))
}
}
#[derive(Clone, Debug)]
pub struct TwitterProfilePostsResource {
scope: Scope,
}
impl TwitterProfilePostsResource {
pub async fn list(
&self,
options: impl Into<Option<TwitterProfilePostsOptions>>,
) -> Result<TwitterProfilePostsPage, Error> {
let options = options.into().unwrap_or_default();
self.scope
.operation(
Method::GET,
"/v1/twitter/profiles/{identifier}/posts",
options.query(),
options.request_options,
)?
.send_page()
.await
}
pub fn items(
&self,
options: impl Into<Option<TwitterProfilePostsOptions>>,
) -> Items<TwitterPost> {
let options = options.into().unwrap_or_default();
Items::new(self.scope.operation(
Method::GET,
"/v1/twitter/profiles/{identifier}/posts",
options.query(),
options.request_options,
))
}
}
#[derive(Clone, Debug)]
pub struct TwitterProfileRepliesResource {
scope: Scope,
}
impl TwitterProfileRepliesResource {
pub async fn list(
&self,
options: impl Into<Option<TwitterProfileRepliesOptions>>,
) -> Result<TwitterProfileRepliesPage, Error> {
let options = options.into().unwrap_or_default();
self.scope
.operation(
Method::GET,
"/v1/twitter/profiles/{identifier}/replies",
options.query(),
options.request_options,
)?
.send_page()
.await
}
pub fn items(
&self,
options: impl Into<Option<TwitterProfileRepliesOptions>>,
) -> Items<TwitterPost> {
let options = options.into().unwrap_or_default();
Items::new(self.scope.operation(
Method::GET,
"/v1/twitter/profiles/{identifier}/replies",
options.query(),
options.request_options,
))
}
}
#[derive(Clone, Debug)]
pub struct TwitterSearchResource {
scope: Scope,
}
impl TwitterSearchResource {
pub fn media(&self) -> TwitterSearchMediaResource {
TwitterSearchMediaResource {
scope: self.scope.clone(),
}
}
pub fn posts(&self) -> TwitterSearchPostsResource {
TwitterSearchPostsResource {
scope: self.scope.clone(),
}
}
pub fn suggestions(&self) -> TwitterSearchSuggestionsResource {
TwitterSearchSuggestionsResource {
scope: self.scope.clone(),
}
}
pub fn users(&self) -> TwitterSearchUsersResource {
TwitterSearchUsersResource {
scope: self.scope.clone(),
}
}
}
#[derive(Clone, Debug)]
pub struct TwitterSearchMediaResource {
scope: Scope,
}
impl TwitterSearchMediaResource {
pub async fn list(
&self,
options: TwitterSearchMediaOptions,
) -> Result<TwitterSearchMediaPage, Error> {
self.scope
.operation(
Method::GET,
"/v1/twitter/search/media",
options.query(),
options.request_options,
)?
.send_page()
.await
}
pub fn items(&self, options: TwitterSearchMediaOptions) -> Items<TwitterPost> {
Items::new(self.scope.operation(
Method::GET,
"/v1/twitter/search/media",
options.query(),
options.request_options,
))
}
}
#[derive(Clone, Debug)]
pub struct TwitterSearchPostsResource {
scope: Scope,
}
impl TwitterSearchPostsResource {
pub async fn list(
&self,
options: TwitterSearchPostsOptions,
) -> Result<TwitterSearchPostsPage, Error> {
self.scope
.operation(
Method::GET,
"/v1/twitter/search/posts",
options.query(),
options.request_options,
)?
.send_page()
.await
}
pub fn items(&self, options: TwitterSearchPostsOptions) -> Items<TwitterPost> {
Items::new(self.scope.operation(
Method::GET,
"/v1/twitter/search/posts",
options.query(),
options.request_options,
))
}
}
#[derive(Clone, Debug)]
pub struct TwitterSearchSuggestionsResource {
scope: Scope,
}
impl TwitterSearchSuggestionsResource {
pub async fn list(
&self,
options: TwitterSearchSuggestionsOptions,
) -> Result<TwitterSearchSuggestionsPage, Error> {
self.scope
.operation(
Method::GET,
"/v1/twitter/search/suggestions",
options.query(),
options.request_options,
)?
.send_page()
.await
}
pub fn items(&self, options: TwitterSearchSuggestionsOptions) -> Items<TwitterProfile> {
Items::new(self.scope.operation(
Method::GET,
"/v1/twitter/search/suggestions",
options.query(),
options.request_options,
))
}
}
#[derive(Clone, Debug)]
pub struct TwitterSearchUsersResource {
scope: Scope,
}
impl TwitterSearchUsersResource {
pub async fn list(
&self,
options: TwitterSearchUsersOptions,
) -> Result<TwitterSearchUsersPage, Error> {
self.scope
.operation(
Method::GET,
"/v1/twitter/search/users",
options.query(),
options.request_options,
)?
.send_page()
.await
}
pub fn items(&self, options: TwitterSearchUsersOptions) -> Items<TwitterProfile> {
Items::new(self.scope.operation(
Method::GET,
"/v1/twitter/search/users",
options.query(),
options.request_options,
))
}
}
#[derive(Clone, Debug)]
pub struct YouTubeResource {
scope: Scope,
}
impl YouTubeResource {
pub fn charts(&self) -> YouTubeChartsResource {
YouTubeChartsResource {
scope: self.scope.clone(),
}
}
pub fn community_post(
&self,
reference: impl Into<ResourceReference>,
) -> YouTubeCommunityPostResource {
YouTubeCommunityPostResource {
scope: self.scope.select(
"identifier",
"youtube",
"communityPost",
Reference::from(reference.into()),
),
}
}
pub fn hashtag(&self, reference: impl Into<ResourceReference>) -> YouTubeHashtagResource {
YouTubeHashtagResource {
scope: self.scope.select(
"identifier",
"youtube",
"hashtag",
Reference::from(reference.into()),
),
}
}
pub fn playlist(&self, reference: impl Into<ResourceReference>) -> YouTubePlaylistResource {
YouTubePlaylistResource {
scope: self.scope.select(
"identifier",
"youtube",
"playlist",
Reference::from(reference.into()),
),
}
}
pub fn post(&self, reference: impl Into<ResourceReference>) -> YouTubePostResource {
YouTubePostResource {
scope: self.scope.select(
"identifier",
"youtube",
"post",
Reference::from(reference.into()),
),
}
}
pub fn profile(&self, reference: impl Into<ProfileReference>) -> YouTubeProfileResource {
YouTubeProfileResource {
scope: self.scope.select(
"identifier",
"youtube",
"profile",
Reference::from(reference.into()),
),
}
}
pub fn search(&self) -> YouTubeSearchResource {
YouTubeSearchResource {
scope: self.scope.clone(),
}
}
pub fn trending(&self) -> YouTubeTrendingResource {
YouTubeTrendingResource {
scope: self.scope.clone(),
}
}
}
#[derive(Clone, Debug)]
pub struct YouTubeChartsResource {
scope: Scope,
}
impl YouTubeChartsResource {
pub fn artists(&self) -> YouTubeChartsArtistsResource {
YouTubeChartsArtistsResource {
scope: self.scope.clone(),
}
}
pub fn tracks(&self) -> YouTubeChartsTracksResource {
YouTubeChartsTracksResource {
scope: self.scope.clone(),
}
}
pub fn videos(&self) -> YouTubeChartsVideosResource {
YouTubeChartsVideosResource {
scope: self.scope.clone(),
}
}
}
#[derive(Clone, Debug)]
pub struct YouTubeChartsArtistsResource {
scope: Scope,
}
impl YouTubeChartsArtistsResource {
pub async fn list(
&self,
options: impl Into<Option<YouTubeChartsArtistsOptions>>,
) -> Result<YouTubeChartsArtistsResponse, Error> {
let options = options.into().unwrap_or_default();
self.scope
.operation(
Method::GET,
"/v1/youtube/charts/artists",
options.query(),
options.request_options,
)?
.send()
.await
}
}
#[derive(Clone, Debug)]
pub struct YouTubeChartsTracksResource {
scope: Scope,
}
impl YouTubeChartsTracksResource {
pub async fn list(
&self,
options: impl Into<Option<YouTubeChartsTracksOptions>>,
) -> Result<YouTubeChartsTracksResponse, Error> {
let options = options.into().unwrap_or_default();
self.scope
.operation(
Method::GET,
"/v1/youtube/charts/tracks",
options.query(),
options.request_options,
)?
.send()
.await
}
}
#[derive(Clone, Debug)]
pub struct YouTubeChartsVideosResource {
scope: Scope,
}
impl YouTubeChartsVideosResource {
pub async fn list(
&self,
options: impl Into<Option<YouTubeChartsVideosOptions>>,
) -> Result<YouTubeChartsVideosResponse, Error> {
let options = options.into().unwrap_or_default();
self.scope
.operation(
Method::GET,
"/v1/youtube/charts/videos",
options.query(),
options.request_options,
)?
.send()
.await
}
}
#[derive(Clone, Debug)]
pub struct YouTubeCommunityPostResource {
scope: Scope,
}
impl YouTubeCommunityPostResource {
pub fn comments(&self) -> YouTubeCommunityPostCommentsResource {
YouTubeCommunityPostCommentsResource {
scope: self.scope.clone(),
}
}
pub async fn get(
&self,
options: impl Into<Option<YouTubeCommunityPostOptions>>,
) -> Result<YouTubeCommunityPostResponse, Error> {
let options = options.into().unwrap_or_default();
self.scope
.operation(
Method::GET,
"/v1/youtube/community-posts/{identifier}",
options.query(),
options.request_options,
)?
.send()
.await
}
}
#[derive(Clone, Debug)]
pub struct YouTubeCommunityPostCommentsResource {
scope: Scope,
}
impl YouTubeCommunityPostCommentsResource {
pub async fn list(
&self,
options: impl Into<Option<YouTubeCommunityPostCommentsOptions>>,
) -> Result<YouTubeCommunityPostCommentsPage, Error> {
let options = options.into().unwrap_or_default();
self.scope
.operation(
Method::GET,
"/v1/youtube/community-posts/{identifier}/comments",
options.query(),
options.request_options,
)?
.send_page()
.await
}
pub fn items(
&self,
options: impl Into<Option<YouTubeCommunityPostCommentsOptions>>,
) -> Items<YouTubeComment> {
let options = options.into().unwrap_or_default();
Items::new(self.scope.operation(
Method::GET,
"/v1/youtube/community-posts/{identifier}/comments",
options.query(),
options.request_options,
))
}
}
#[derive(Clone, Debug)]
pub struct YouTubeHashtagResource {
scope: Scope,
}
impl YouTubeHashtagResource {
pub fn posts(&self) -> YouTubeHashtagPostsResource {
YouTubeHashtagPostsResource {
scope: self.scope.clone(),
}
}
}
#[derive(Clone, Debug)]
pub struct YouTubeHashtagPostsResource {
scope: Scope,
}
impl YouTubeHashtagPostsResource {
pub async fn list(
&self,
options: impl Into<Option<YouTubeHashtagPostsOptions>>,
) -> Result<YouTubeHashtagPostsPage, Error> {
let options = options.into().unwrap_or_default();
self.scope
.operation(
Method::GET,
"/v1/youtube/hashtags/{identifier}/posts",
options.query(),
options.request_options,
)?
.send_page()
.await
}
pub fn items(
&self,
options: impl Into<Option<YouTubeHashtagPostsOptions>>,
) -> Items<YouTubePost> {
let options = options.into().unwrap_or_default();
Items::new(self.scope.operation(
Method::GET,
"/v1/youtube/hashtags/{identifier}/posts",
options.query(),
options.request_options,
))
}
}
#[derive(Clone, Debug)]
pub struct YouTubePlaylistResource {
scope: Scope,
}
impl YouTubePlaylistResource {
pub fn posts(&self) -> YouTubePlaylistPostsResource {
YouTubePlaylistPostsResource {
scope: self.scope.clone(),
}
}
}
#[derive(Clone, Debug)]
pub struct YouTubePlaylistPostsResource {
scope: Scope,
}
impl YouTubePlaylistPostsResource {
pub async fn list(
&self,
options: impl Into<Option<YouTubePlaylistPostsOptions>>,
) -> Result<YouTubePlaylistPostsPage, Error> {
let options = options.into().unwrap_or_default();
self.scope
.operation(
Method::GET,
"/v1/youtube/playlists/{identifier}/posts",
options.query(),
options.request_options,
)?
.send_page()
.await
}
pub fn items(
&self,
options: impl Into<Option<YouTubePlaylistPostsOptions>>,
) -> Items<YouTubePost> {
let options = options.into().unwrap_or_default();
Items::new(self.scope.operation(
Method::GET,
"/v1/youtube/playlists/{identifier}/posts",
options.query(),
options.request_options,
))
}
}
#[derive(Clone, Debug)]
pub struct YouTubePostResource {
scope: Scope,
}
impl YouTubePostResource {
pub fn comment(&self, reference: impl Into<ResourceReference>) -> YouTubePostCommentResource {
YouTubePostCommentResource {
scope: self.scope.select(
"comment_id",
"youtube",
"comment",
Reference::from(reference.into()),
),
}
}
pub fn comments(&self) -> YouTubePostCommentsResource {
YouTubePostCommentsResource {
scope: self.scope.clone(),
}
}
pub fn files(&self) -> YouTubePostFilesResource {
YouTubePostFilesResource {
scope: self.scope.clone(),
}
}
pub fn frame(&self) -> YouTubePostFrameResource {
YouTubePostFrameResource {
scope: self.scope.clone(),
}
}
pub fn related(&self) -> YouTubePostRelatedResource {
YouTubePostRelatedResource {
scope: self.scope.clone(),
}
}
pub fn sound_posts(&self) -> YouTubePostSoundPostsResource {
YouTubePostSoundPostsResource {
scope: self.scope.clone(),
}
}
pub fn storyboard(&self) -> YouTubePostStoryboardResource {
YouTubePostStoryboardResource {
scope: self.scope.clone(),
}
}
pub fn transcript(&self) -> YouTubePostTranscriptResource {
YouTubePostTranscriptResource {
scope: self.scope.clone(),
}
}
pub async fn get(
&self,
options: impl Into<Option<YouTubePostOptions>>,
) -> Result<YouTubePostResponse, Error> {
let options = options.into().unwrap_or_default();
self.scope
.operation(
Method::GET,
"/v1/youtube/posts/{identifier}",
options.query(),
options.request_options,
)?
.send()
.await
}
}
#[derive(Clone, Debug)]
pub struct YouTubePostCommentResource {
scope: Scope,
}
impl YouTubePostCommentResource {
pub fn replies(&self) -> YouTubePostCommentRepliesResource {
YouTubePostCommentRepliesResource {
scope: self.scope.clone(),
}
}
}
#[derive(Clone, Debug)]
pub struct YouTubePostCommentRepliesResource {
scope: Scope,
}
impl YouTubePostCommentRepliesResource {
pub async fn list(
&self,
options: YouTubePostCommentRepliesOptions,
) -> Result<YouTubePostCommentRepliesPage, Error> {
self.scope
.operation(
Method::GET,
"/v1/youtube/posts/{identifier}/comments/{comment_id}/replies",
options.query(),
options.request_options,
)?
.send_page()
.await
}
pub fn items(&self, options: YouTubePostCommentRepliesOptions) -> Items<YouTubeComment> {
Items::new(self.scope.operation(
Method::GET,
"/v1/youtube/posts/{identifier}/comments/{comment_id}/replies",
options.query(),
options.request_options,
))
}
}
#[derive(Clone, Debug)]
pub struct YouTubePostCommentsResource {
scope: Scope,
}
impl YouTubePostCommentsResource {
pub async fn list(
&self,
options: impl Into<Option<YouTubePostCommentsOptions>>,
) -> Result<YouTubePostCommentsPage, Error> {
let options = options.into().unwrap_or_default();
self.scope
.operation(
Method::GET,
"/v1/youtube/posts/{identifier}/comments",
options.query(),
options.request_options,
)?
.send_page()
.await
}
pub fn items(
&self,
options: impl Into<Option<YouTubePostCommentsOptions>>,
) -> Items<YouTubeComment> {
let options = options.into().unwrap_or_default();
Items::new(self.scope.operation(
Method::GET,
"/v1/youtube/posts/{identifier}/comments",
options.query(),
options.request_options,
))
}
}
#[derive(Clone, Debug)]
pub struct YouTubePostFilesResource {
scope: Scope,
}
impl YouTubePostFilesResource {
pub async fn get(
&self,
options: impl Into<Option<YouTubePostFilesOptions>>,
) -> Result<YouTubePostFilesResponse, Error> {
let options = options.into().unwrap_or_default();
self.scope
.operation(
Method::GET,
"/v1/youtube/posts/{identifier}/files",
options.query(),
options.request_options,
)?
.send()
.await
}
}
#[derive(Clone, Debug)]
pub struct YouTubePostFrameResource {
scope: Scope,
}
impl YouTubePostFrameResource {
pub async fn get(
&self,
options: YouTubePostFrameOptions,
) -> Result<YouTubePostFrameResponse, Error> {
self.scope
.operation(
Method::GET,
"/v1/youtube/posts/{identifier}/frame",
options.query(),
options.request_options,
)?
.send()
.await
}
}
#[derive(Clone, Debug)]
pub struct YouTubePostRelatedResource {
scope: Scope,
}
impl YouTubePostRelatedResource {
pub async fn list(
&self,
options: impl Into<Option<YouTubePostRelatedOptions>>,
) -> Result<YouTubePostRelatedPage, Error> {
let options = options.into().unwrap_or_default();
self.scope
.operation(
Method::GET,
"/v1/youtube/posts/{identifier}/related",
options.query(),
options.request_options,
)?
.send_page()
.await
}
pub fn items(
&self,
options: impl Into<Option<YouTubePostRelatedOptions>>,
) -> Items<YouTubePost> {
let options = options.into().unwrap_or_default();
Items::new(self.scope.operation(
Method::GET,
"/v1/youtube/posts/{identifier}/related",
options.query(),
options.request_options,
))
}
}
#[derive(Clone, Debug)]
pub struct YouTubePostSoundPostsResource {
scope: Scope,
}
impl YouTubePostSoundPostsResource {
pub async fn list(
&self,
options: impl Into<Option<YouTubePostSoundPostsOptions>>,
) -> Result<YouTubePostSoundPostsPage, Error> {
let options = options.into().unwrap_or_default();
self.scope
.operation(
Method::GET,
"/v1/youtube/posts/{identifier}/sound-posts",
options.query(),
options.request_options,
)?
.send_page()
.await
}
pub fn items(
&self,
options: impl Into<Option<YouTubePostSoundPostsOptions>>,
) -> Items<YouTubePost> {
let options = options.into().unwrap_or_default();
Items::new(self.scope.operation(
Method::GET,
"/v1/youtube/posts/{identifier}/sound-posts",
options.query(),
options.request_options,
))
}
}
#[derive(Clone, Debug)]
pub struct YouTubePostStoryboardResource {
scope: Scope,
}
impl YouTubePostStoryboardResource {
pub async fn get(
&self,
options: impl Into<Option<YouTubePostStoryboardOptions>>,
) -> Result<YouTubePostStoryboardResponse, Error> {
let options = options.into().unwrap_or_default();
self.scope
.operation(
Method::GET,
"/v1/youtube/posts/{identifier}/storyboard",
options.query(),
options.request_options,
)?
.send()
.await
}
}
#[derive(Clone, Debug)]
pub struct YouTubePostTranscriptResource {
scope: Scope,
}
impl YouTubePostTranscriptResource {
pub async fn get(
&self,
options: impl Into<Option<YouTubePostTranscriptOptions>>,
) -> Result<YouTubePostTranscriptResponse, Error> {
let options = options.into().unwrap_or_default();
self.scope
.operation(
Method::GET,
"/v1/youtube/posts/{identifier}/transcript",
options.query(),
options.request_options,
)?
.send()
.await
}
}
#[derive(Clone, Debug)]
pub struct YouTubeProfileResource {
scope: Scope,
}
impl YouTubeProfileResource {
pub fn community_posts(&self) -> YouTubeProfileCommunityPostsResource {
YouTubeProfileCommunityPostsResource {
scope: self.scope.clone(),
}
}
pub fn livestreams(&self) -> YouTubeProfileLivestreamsResource {
YouTubeProfileLivestreamsResource {
scope: self.scope.clone(),
}
}
pub fn playlists(&self) -> YouTubeProfilePlaylistsResource {
YouTubeProfilePlaylistsResource {
scope: self.scope.clone(),
}
}
pub fn products(&self) -> YouTubeProfileProductsResource {
YouTubeProfileProductsResource {
scope: self.scope.clone(),
}
}
pub fn search(&self) -> YouTubeProfileSearchResource {
YouTubeProfileSearchResource {
scope: self.scope.clone(),
}
}
pub fn shorts(&self) -> YouTubeProfileShortsResource {
YouTubeProfileShortsResource {
scope: self.scope.clone(),
}
}
pub fn videos(&self) -> YouTubeProfileVideosResource {
YouTubeProfileVideosResource {
scope: self.scope.clone(),
}
}
pub async fn get(
&self,
options: impl Into<Option<YouTubeProfileOptions>>,
) -> Result<YouTubeProfileResponse, Error> {
let options = options.into().unwrap_or_default();
self.scope
.operation(
Method::GET,
"/v1/youtube/profiles/{identifier}",
options.query(),
options.request_options,
)?
.send()
.await
}
}
#[derive(Clone, Debug)]
pub struct YouTubeProfileCommunityPostsResource {
scope: Scope,
}
impl YouTubeProfileCommunityPostsResource {
pub async fn list(
&self,
options: impl Into<Option<YouTubeProfileCommunityPostsOptions>>,
) -> Result<YouTubeProfileCommunityPostsPage, Error> {
let options = options.into().unwrap_or_default();
self.scope
.operation(
Method::GET,
"/v1/youtube/profiles/{identifier}/community-posts",
options.query(),
options.request_options,
)?
.send_page()
.await
}
pub fn items(
&self,
options: impl Into<Option<YouTubeProfileCommunityPostsOptions>>,
) -> Items<YouTubeCommunityPost> {
let options = options.into().unwrap_or_default();
Items::new(self.scope.operation(
Method::GET,
"/v1/youtube/profiles/{identifier}/community-posts",
options.query(),
options.request_options,
))
}
}
#[derive(Clone, Debug)]
pub struct YouTubeProfileLivestreamsResource {
scope: Scope,
}
impl YouTubeProfileLivestreamsResource {
pub async fn list(
&self,
options: impl Into<Option<YouTubeProfileLivestreamsOptions>>,
) -> Result<YouTubeProfileLivestreamsPage, Error> {
let options = options.into().unwrap_or_default();
self.scope
.operation(
Method::GET,
"/v1/youtube/profiles/{identifier}/livestreams",
options.query(),
options.request_options,
)?
.send_page()
.await
}
pub fn items(
&self,
options: impl Into<Option<YouTubeProfileLivestreamsOptions>>,
) -> Items<YouTubePost> {
let options = options.into().unwrap_or_default();
Items::new(self.scope.operation(
Method::GET,
"/v1/youtube/profiles/{identifier}/livestreams",
options.query(),
options.request_options,
))
}
}
#[derive(Clone, Debug)]
pub struct YouTubeProfilePlaylistsResource {
scope: Scope,
}
impl YouTubeProfilePlaylistsResource {
pub async fn list(
&self,
options: impl Into<Option<YouTubeProfilePlaylistsOptions>>,
) -> Result<YouTubeProfilePlaylistsPage, Error> {
let options = options.into().unwrap_or_default();
self.scope
.operation(
Method::GET,
"/v1/youtube/profiles/{identifier}/playlists",
options.query(),
options.request_options,
)?
.send_page()
.await
}
pub fn items(
&self,
options: impl Into<Option<YouTubeProfilePlaylistsOptions>>,
) -> Items<YouTubePlaylist> {
let options = options.into().unwrap_or_default();
Items::new(self.scope.operation(
Method::GET,
"/v1/youtube/profiles/{identifier}/playlists",
options.query(),
options.request_options,
))
}
}
#[derive(Clone, Debug)]
pub struct YouTubeProfileProductsResource {
scope: Scope,
}
impl YouTubeProfileProductsResource {
pub async fn list(
&self,
options: impl Into<Option<YouTubeProfileProductsOptions>>,
) -> Result<YouTubeProfileProductsPage, Error> {
let options = options.into().unwrap_or_default();
self.scope
.operation(
Method::GET,
"/v1/youtube/profiles/{identifier}/products",
options.query(),
options.request_options,
)?
.send_page()
.await
}
pub fn items(
&self,
options: impl Into<Option<YouTubeProfileProductsOptions>>,
) -> Items<YouTubeProduct> {
let options = options.into().unwrap_or_default();
Items::new(self.scope.operation(
Method::GET,
"/v1/youtube/profiles/{identifier}/products",
options.query(),
options.request_options,
))
}
}
#[derive(Clone, Debug)]
pub struct YouTubeProfileSearchResource {
scope: Scope,
}
impl YouTubeProfileSearchResource {
pub async fn list(
&self,
options: YouTubeProfileSearchOptions,
) -> Result<YouTubeProfileSearchPage, Error> {
self.scope
.operation(
Method::GET,
"/v1/youtube/profiles/{identifier}/search",
options.query(),
options.request_options,
)?
.send_page()
.await
}
pub fn items(&self, options: YouTubeProfileSearchOptions) -> Items<YouTubePost> {
Items::new(self.scope.operation(
Method::GET,
"/v1/youtube/profiles/{identifier}/search",
options.query(),
options.request_options,
))
}
}
#[derive(Clone, Debug)]
pub struct YouTubeProfileShortsResource {
scope: Scope,
}
impl YouTubeProfileShortsResource {
pub async fn list(
&self,
options: impl Into<Option<YouTubeProfileShortsOptions>>,
) -> Result<YouTubeProfileShortsPage, Error> {
let options = options.into().unwrap_or_default();
self.scope
.operation(
Method::GET,
"/v1/youtube/profiles/{identifier}/shorts",
options.query(),
options.request_options,
)?
.send_page()
.await
}
pub fn items(
&self,
options: impl Into<Option<YouTubeProfileShortsOptions>>,
) -> Items<YouTubePost> {
let options = options.into().unwrap_or_default();
Items::new(self.scope.operation(
Method::GET,
"/v1/youtube/profiles/{identifier}/shorts",
options.query(),
options.request_options,
))
}
}
#[derive(Clone, Debug)]
pub struct YouTubeProfileVideosResource {
scope: Scope,
}
impl YouTubeProfileVideosResource {
pub async fn list(
&self,
options: impl Into<Option<YouTubeProfileVideosOptions>>,
) -> Result<YouTubeProfileVideosPage, Error> {
let options = options.into().unwrap_or_default();
self.scope
.operation(
Method::GET,
"/v1/youtube/profiles/{identifier}/videos",
options.query(),
options.request_options,
)?
.send_page()
.await
}
pub fn items(
&self,
options: impl Into<Option<YouTubeProfileVideosOptions>>,
) -> Items<YouTubePost> {
let options = options.into().unwrap_or_default();
Items::new(self.scope.operation(
Method::GET,
"/v1/youtube/profiles/{identifier}/videos",
options.query(),
options.request_options,
))
}
}
#[derive(Clone, Debug)]
pub struct YouTubeSearchResource {
scope: Scope,
}
impl YouTubeSearchResource {
pub fn playlists(&self) -> YouTubeSearchPlaylistsResource {
YouTubeSearchPlaylistsResource {
scope: self.scope.clone(),
}
}
pub fn posts(&self) -> YouTubeSearchPostsResource {
YouTubeSearchPostsResource {
scope: self.scope.clone(),
}
}
pub fn profiles(&self) -> YouTubeSearchProfilesResource {
YouTubeSearchProfilesResource {
scope: self.scope.clone(),
}
}
pub fn suggestions(&self) -> YouTubeSearchSuggestionsResource {
YouTubeSearchSuggestionsResource {
scope: self.scope.clone(),
}
}
}
#[derive(Clone, Debug)]
pub struct YouTubeSearchPlaylistsResource {
scope: Scope,
}
impl YouTubeSearchPlaylistsResource {
pub async fn list(
&self,
options: YouTubeSearchPlaylistsOptions,
) -> Result<YouTubeSearchPlaylistsPage, Error> {
self.scope
.operation(
Method::GET,
"/v1/youtube/search/playlists",
options.query(),
options.request_options,
)?
.send_page()
.await
}
pub fn items(&self, options: YouTubeSearchPlaylistsOptions) -> Items<YouTubePlaylist> {
Items::new(self.scope.operation(
Method::GET,
"/v1/youtube/search/playlists",
options.query(),
options.request_options,
))
}
}
#[derive(Clone, Debug)]
pub struct YouTubeSearchPostsResource {
scope: Scope,
}
impl YouTubeSearchPostsResource {
pub async fn list(
&self,
options: YouTubeSearchPostsOptions,
) -> Result<YouTubeSearchPostsPage, Error> {
self.scope
.operation(
Method::GET,
"/v1/youtube/search/posts",
options.query(),
options.request_options,
)?
.send_page()
.await
}
pub fn items(&self, options: YouTubeSearchPostsOptions) -> Items<YouTubePost> {
Items::new(self.scope.operation(
Method::GET,
"/v1/youtube/search/posts",
options.query(),
options.request_options,
))
}
}
#[derive(Clone, Debug)]
pub struct YouTubeSearchProfilesResource {
scope: Scope,
}
impl YouTubeSearchProfilesResource {
pub async fn list(
&self,
options: YouTubeSearchProfilesOptions,
) -> Result<YouTubeSearchProfilesPage, Error> {
self.scope
.operation(
Method::GET,
"/v1/youtube/search/profiles",
options.query(),
options.request_options,
)?
.send_page()
.await
}
pub fn items(&self, options: YouTubeSearchProfilesOptions) -> Items<YouTubeProfile> {
Items::new(self.scope.operation(
Method::GET,
"/v1/youtube/search/profiles",
options.query(),
options.request_options,
))
}
}
#[derive(Clone, Debug)]
pub struct YouTubeSearchSuggestionsResource {
scope: Scope,
}
impl YouTubeSearchSuggestionsResource {
pub async fn list(
&self,
options: YouTubeSearchSuggestionsOptions,
) -> Result<YouTubeSearchSuggestionsResponse, Error> {
self.scope
.operation(
Method::GET,
"/v1/youtube/search/suggestions",
options.query(),
options.request_options,
)?
.send()
.await
}
}
#[derive(Clone, Debug)]
pub struct YouTubeTrendingResource {
scope: Scope,
}
impl YouTubeTrendingResource {
pub fn posts(&self) -> YouTubeTrendingPostsResource {
YouTubeTrendingPostsResource {
scope: self.scope.clone(),
}
}
}
#[derive(Clone, Debug)]
pub struct YouTubeTrendingPostsResource {
scope: Scope,
}
impl YouTubeTrendingPostsResource {
pub async fn list(
&self,
options: impl Into<Option<YouTubeTrendingPostsOptions>>,
) -> Result<YouTubeTrendingPostsResponse, Error> {
let options = options.into().unwrap_or_default();
self.scope
.operation(
Method::GET,
"/v1/youtube/trending/posts",
options.query(),
options.request_options,
)?
.send()
.await
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum FetchResource {
InstagramProfile(Box<InstagramProfile>),
InstagramPost(Box<InstagramPost>),
InstagramStory(Box<InstagramStory>),
InstagramHighlight(Box<InstagramHighlight>),
TikTokProfile(Box<TikTokProfile>),
TikTokPost(Box<TikTokPost>),
TwitterProfile(Box<TwitterProfile>),
TwitterPost(Box<TwitterPost>),
RedditProfile(Box<RedditProfile>),
RedditPost(Box<RedditPost>),
RedditSubreddit(Box<RedditSubreddit>),
YouTubeProfile(Box<YouTubeProfile>),
YouTubePost(Box<YouTubePost>),
}
impl FetchResource {
pub(crate) fn decode(
platform: &str,
resource: &str,
data: serde_json::Value,
) -> Result<Option<Self>, serde_json::Error> {
match (platform, resource) {
("instagram", "profile") => serde_json::from_value(data)
.map(|value| Some(Self::InstagramProfile(Box::new(value)))),
("instagram", "post") => {
serde_json::from_value(data).map(|value| Some(Self::InstagramPost(Box::new(value))))
}
("instagram", "story") => serde_json::from_value(data)
.map(|value| Some(Self::InstagramStory(Box::new(value)))),
("instagram", "highlight") => serde_json::from_value(data)
.map(|value| Some(Self::InstagramHighlight(Box::new(value)))),
("tiktok", "profile") => {
serde_json::from_value(data).map(|value| Some(Self::TikTokProfile(Box::new(value))))
}
("tiktok", "post") => {
serde_json::from_value(data).map(|value| Some(Self::TikTokPost(Box::new(value))))
}
("twitter", "profile") => serde_json::from_value(data)
.map(|value| Some(Self::TwitterProfile(Box::new(value)))),
("twitter", "post") => {
serde_json::from_value(data).map(|value| Some(Self::TwitterPost(Box::new(value))))
}
("reddit", "profile") => {
serde_json::from_value(data).map(|value| Some(Self::RedditProfile(Box::new(value))))
}
("reddit", "post") => {
serde_json::from_value(data).map(|value| Some(Self::RedditPost(Box::new(value))))
}
("reddit", "subreddit") => serde_json::from_value(data)
.map(|value| Some(Self::RedditSubreddit(Box::new(value)))),
("youtube", "profile") => serde_json::from_value(data)
.map(|value| Some(Self::YouTubeProfile(Box::new(value)))),
("youtube", "post") => {
serde_json::from_value(data).map(|value| Some(Self::YouTubePost(Box::new(value))))
}
_ => Ok(None),
}
}
}
pub type FetchResponse = Response<FetchResource>;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub struct InstagramCommentLikersOptions {
pub media_id: String,
pub freshness: Option<crate::options::Freshness>,
pub cursor: Option<String>,
pub request_options: RequestOptions,
}
impl InstagramCommentLikersOptions {
pub fn new(media_id: impl Into<String>) -> Self {
Self {
media_id: media_id.into(),
freshness: None,
cursor: None,
request_options: RequestOptions::default(),
}
}
pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
self.freshness = Some(value);
self
}
pub fn cursor(mut self, value: impl Into<String>) -> Self {
self.cursor = Some(value.into());
self
}
pub fn max_retries(mut self, value: u32) -> Self {
self.request_options.max_retries = Some(value);
self
}
pub fn timeout(mut self, value: Duration) -> Self {
self.request_options.timeout = Some(value);
self
}
pub(crate) fn query(&self) -> Result<Query, Error> {
let mut query = Query::default();
query.require("media_id", &self.media_id)?;
query.push("freshness", &self.freshness);
query.push("cursor", &self.cursor);
Ok(query)
}
}
pub type InstagramCommentLikersPage = Page<InstagramProfileSummary>;
#[derive(Clone, Debug, Default, PartialEq)]
#[non_exhaustive]
pub struct InstagramHashtagOptions {
pub freshness: Option<crate::options::Freshness>,
pub request_options: RequestOptions,
}
impl InstagramHashtagOptions {
pub fn new() -> Self {
Self::default()
}
pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
self.freshness = Some(value);
self
}
pub fn max_retries(mut self, value: u32) -> Self {
self.request_options.max_retries = Some(value);
self
}
pub fn timeout(mut self, value: Duration) -> Self {
self.request_options.timeout = Some(value);
self
}
pub(crate) fn query(&self) -> Result<Query, Error> {
let mut query = Query::default();
query.push("freshness", &self.freshness);
Ok(query)
}
}
pub type InstagramHashtagResponse = Response<InstagramHashtag>;
#[derive(Clone, Debug, Default, PartialEq)]
#[non_exhaustive]
pub struct InstagramHashtagPostsOptions {
pub sort: Option<String>,
pub freshness: Option<crate::options::Freshness>,
pub cursor: Option<String>,
pub request_options: RequestOptions,
}
impl InstagramHashtagPostsOptions {
pub fn new() -> Self {
Self::default()
}
pub fn sort(mut self, value: impl Into<String>) -> Self {
self.sort = Some(value.into());
self
}
pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
self.freshness = Some(value);
self
}
pub fn cursor(mut self, value: impl Into<String>) -> Self {
self.cursor = Some(value.into());
self
}
pub fn max_retries(mut self, value: u32) -> Self {
self.request_options.max_retries = Some(value);
self
}
pub fn timeout(mut self, value: Duration) -> Self {
self.request_options.timeout = Some(value);
self
}
pub(crate) fn query(&self) -> Result<Query, Error> {
let mut query = Query::default();
query.push("sort", &self.sort);
query.push("freshness", &self.freshness);
query.push("cursor", &self.cursor);
Ok(query)
}
}
pub type InstagramHashtagPostsPage = Page<InstagramPost>;
#[derive(Clone, Debug, Default, PartialEq)]
#[non_exhaustive]
pub struct InstagramHashtagReelsOptions {
pub freshness: Option<crate::options::Freshness>,
pub cursor: Option<String>,
pub request_options: RequestOptions,
}
impl InstagramHashtagReelsOptions {
pub fn new() -> Self {
Self::default()
}
pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
self.freshness = Some(value);
self
}
pub fn cursor(mut self, value: impl Into<String>) -> Self {
self.cursor = Some(value.into());
self
}
pub fn max_retries(mut self, value: u32) -> Self {
self.request_options.max_retries = Some(value);
self
}
pub fn timeout(mut self, value: Duration) -> Self {
self.request_options.timeout = Some(value);
self
}
pub(crate) fn query(&self) -> Result<Query, Error> {
let mut query = Query::default();
query.push("freshness", &self.freshness);
query.push("cursor", &self.cursor);
Ok(query)
}
}
pub type InstagramHashtagReelsPage = Page<InstagramPost>;
#[derive(Clone, Debug, Default, PartialEq)]
#[non_exhaustive]
pub struct InstagramHighlightOptions {
pub freshness: Option<crate::options::Freshness>,
pub request_options: RequestOptions,
}
impl InstagramHighlightOptions {
pub fn new() -> Self {
Self::default()
}
pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
self.freshness = Some(value);
self
}
pub fn max_retries(mut self, value: u32) -> Self {
self.request_options.max_retries = Some(value);
self
}
pub fn timeout(mut self, value: Duration) -> Self {
self.request_options.timeout = Some(value);
self
}
pub(crate) fn query(&self) -> Result<Query, Error> {
let mut query = Query::default();
query.push("freshness", &self.freshness);
Ok(query)
}
}
pub type InstagramHighlightResponse = Response<InstagramHighlight>;
#[derive(Clone, Debug, Default, PartialEq)]
#[non_exhaustive]
pub struct InstagramLocationOptions {
pub freshness: Option<crate::options::Freshness>,
pub request_options: RequestOptions,
}
impl InstagramLocationOptions {
pub fn new() -> Self {
Self::default()
}
pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
self.freshness = Some(value);
self
}
pub fn max_retries(mut self, value: u32) -> Self {
self.request_options.max_retries = Some(value);
self
}
pub fn timeout(mut self, value: Duration) -> Self {
self.request_options.timeout = Some(value);
self
}
pub(crate) fn query(&self) -> Result<Query, Error> {
let mut query = Query::default();
query.push("freshness", &self.freshness);
Ok(query)
}
}
pub type InstagramLocationResponse = Response<InstagramLocation>;
#[derive(Clone, Debug, Default, PartialEq)]
#[non_exhaustive]
pub struct InstagramLocationPostsOptions {
pub sort: Option<String>,
pub freshness: Option<crate::options::Freshness>,
pub cursor: Option<String>,
pub request_options: RequestOptions,
}
impl InstagramLocationPostsOptions {
pub fn new() -> Self {
Self::default()
}
pub fn sort(mut self, value: impl Into<String>) -> Self {
self.sort = Some(value.into());
self
}
pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
self.freshness = Some(value);
self
}
pub fn cursor(mut self, value: impl Into<String>) -> Self {
self.cursor = Some(value.into());
self
}
pub fn max_retries(mut self, value: u32) -> Self {
self.request_options.max_retries = Some(value);
self
}
pub fn timeout(mut self, value: Duration) -> Self {
self.request_options.timeout = Some(value);
self
}
pub(crate) fn query(&self) -> Result<Query, Error> {
let mut query = Query::default();
query.push("sort", &self.sort);
query.push("freshness", &self.freshness);
query.push("cursor", &self.cursor);
Ok(query)
}
}
pub type InstagramLocationPostsPage = Page<InstagramPost>;
#[derive(Clone, Debug, Default, PartialEq)]
#[non_exhaustive]
pub struct InstagramMusicOptions {
pub freshness: Option<crate::options::Freshness>,
pub request_options: RequestOptions,
}
impl InstagramMusicOptions {
pub fn new() -> Self {
Self::default()
}
pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
self.freshness = Some(value);
self
}
pub fn max_retries(mut self, value: u32) -> Self {
self.request_options.max_retries = Some(value);
self
}
pub fn timeout(mut self, value: Duration) -> Self {
self.request_options.timeout = Some(value);
self
}
pub(crate) fn query(&self) -> Result<Query, Error> {
let mut query = Query::default();
query.push("freshness", &self.freshness);
Ok(query)
}
}
pub type InstagramMusicResponse = Response<InstagramMusic>;
#[derive(Clone, Debug, Default, PartialEq)]
#[non_exhaustive]
pub struct InstagramMusicStreamOptions {
pub freshness: Option<crate::options::Freshness>,
pub cursor: Option<String>,
pub request_options: RequestOptions,
}
impl InstagramMusicStreamOptions {
pub fn new() -> Self {
Self::default()
}
pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
self.freshness = Some(value);
self
}
pub fn cursor(mut self, value: impl Into<String>) -> Self {
self.cursor = Some(value.into());
self
}
pub fn max_retries(mut self, value: u32) -> Self {
self.request_options.max_retries = Some(value);
self
}
pub fn timeout(mut self, value: Duration) -> Self {
self.request_options.timeout = Some(value);
self
}
pub(crate) fn query(&self) -> Result<Query, Error> {
let mut query = Query::default();
query.push("freshness", &self.freshness);
query.push("cursor", &self.cursor);
Ok(query)
}
}
pub type InstagramMusicStreamPage = Page<InstagramMusicStream>;
#[derive(Clone, Debug, Default, PartialEq)]
#[non_exhaustive]
pub struct InstagramPostOptions {
pub freshness: Option<crate::options::Freshness>,
pub request_options: RequestOptions,
}
impl InstagramPostOptions {
pub fn new() -> Self {
Self::default()
}
pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
self.freshness = Some(value);
self
}
pub fn max_retries(mut self, value: u32) -> Self {
self.request_options.max_retries = Some(value);
self
}
pub fn timeout(mut self, value: Duration) -> Self {
self.request_options.timeout = Some(value);
self
}
pub(crate) fn query(&self) -> Result<Query, Error> {
let mut query = Query::default();
query.push("freshness", &self.freshness);
Ok(query)
}
}
pub type InstagramPostResponse = Response<InstagramPost>;
#[derive(Clone, Debug, Default, PartialEq)]
#[non_exhaustive]
pub struct InstagramPostClipMetadataOptions {
pub freshness: Option<crate::options::Freshness>,
pub request_options: RequestOptions,
}
impl InstagramPostClipMetadataOptions {
pub fn new() -> Self {
Self::default()
}
pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
self.freshness = Some(value);
self
}
pub fn max_retries(mut self, value: u32) -> Self {
self.request_options.max_retries = Some(value);
self
}
pub fn timeout(mut self, value: Duration) -> Self {
self.request_options.timeout = Some(value);
self
}
pub(crate) fn query(&self) -> Result<Query, Error> {
let mut query = Query::default();
query.push("freshness", &self.freshness);
Ok(query)
}
}
pub type InstagramPostClipMetadataResponse = Response<InstagramClipMetadata>;
#[derive(Clone, Debug, Default, PartialEq)]
#[non_exhaustive]
pub struct InstagramPostCommentRepliesOptions {
pub freshness: Option<crate::options::Freshness>,
pub cursor: Option<String>,
pub request_options: RequestOptions,
}
impl InstagramPostCommentRepliesOptions {
pub fn new() -> Self {
Self::default()
}
pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
self.freshness = Some(value);
self
}
pub fn cursor(mut self, value: impl Into<String>) -> Self {
self.cursor = Some(value.into());
self
}
pub fn max_retries(mut self, value: u32) -> Self {
self.request_options.max_retries = Some(value);
self
}
pub fn timeout(mut self, value: Duration) -> Self {
self.request_options.timeout = Some(value);
self
}
pub(crate) fn query(&self) -> Result<Query, Error> {
let mut query = Query::default();
query.push("freshness", &self.freshness);
query.push("cursor", &self.cursor);
Ok(query)
}
}
pub type InstagramPostCommentRepliesPage = Page<InstagramComment>;
#[derive(Clone, Debug, Default, PartialEq)]
#[non_exhaustive]
pub struct InstagramPostCommentMetadataOptions {
pub freshness: Option<crate::options::Freshness>,
pub request_options: RequestOptions,
}
impl InstagramPostCommentMetadataOptions {
pub fn new() -> Self {
Self::default()
}
pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
self.freshness = Some(value);
self
}
pub fn max_retries(mut self, value: u32) -> Self {
self.request_options.max_retries = Some(value);
self
}
pub fn timeout(mut self, value: Duration) -> Self {
self.request_options.timeout = Some(value);
self
}
pub(crate) fn query(&self) -> Result<Query, Error> {
let mut query = Query::default();
query.push("freshness", &self.freshness);
Ok(query)
}
}
pub type InstagramPostCommentMetadataResponse = Response<InstagramCommentMetadata>;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub struct InstagramPostCommentModerationOptions {
pub comment: String,
pub freshness: Option<crate::options::Freshness>,
pub request_options: RequestOptions,
}
impl InstagramPostCommentModerationOptions {
pub fn new(comment: impl Into<String>) -> Self {
Self {
comment: comment.into(),
freshness: None,
request_options: RequestOptions::default(),
}
}
pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
self.freshness = Some(value);
self
}
pub fn max_retries(mut self, value: u32) -> Self {
self.request_options.max_retries = Some(value);
self
}
pub fn timeout(mut self, value: Duration) -> Self {
self.request_options.timeout = Some(value);
self
}
pub(crate) fn query(&self) -> Result<Query, Error> {
let mut query = Query::default();
query.require("comment", &self.comment)?;
query.push("freshness", &self.freshness);
Ok(query)
}
}
pub type InstagramPostCommentModerationResponse = Response<InstagramCommentModeration>;
#[derive(Clone, Debug, Default, PartialEq)]
#[non_exhaustive]
pub struct InstagramPostCommentsOptions {
pub freshness: Option<crate::options::Freshness>,
pub cursor: Option<String>,
pub request_options: RequestOptions,
}
impl InstagramPostCommentsOptions {
pub fn new() -> Self {
Self::default()
}
pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
self.freshness = Some(value);
self
}
pub fn cursor(mut self, value: impl Into<String>) -> Self {
self.cursor = Some(value.into());
self
}
pub fn max_retries(mut self, value: u32) -> Self {
self.request_options.max_retries = Some(value);
self
}
pub fn timeout(mut self, value: Duration) -> Self {
self.request_options.timeout = Some(value);
self
}
pub(crate) fn query(&self) -> Result<Query, Error> {
let mut query = Query::default();
query.push("freshness", &self.freshness);
query.push("cursor", &self.cursor);
Ok(query)
}
}
pub type InstagramPostCommentsPage = Page<InstagramComment>;
#[derive(Clone, Debug, Default, PartialEq)]
#[non_exhaustive]
pub struct InstagramPostInsightsOptions {
pub freshness: Option<crate::options::Freshness>,
pub request_options: RequestOptions,
}
impl InstagramPostInsightsOptions {
pub fn new() -> Self {
Self::default()
}
pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
self.freshness = Some(value);
self
}
pub fn max_retries(mut self, value: u32) -> Self {
self.request_options.max_retries = Some(value);
self
}
pub fn timeout(mut self, value: Duration) -> Self {
self.request_options.timeout = Some(value);
self
}
pub(crate) fn query(&self) -> Result<Query, Error> {
let mut query = Query::default();
query.push("freshness", &self.freshness);
Ok(query)
}
}
pub type InstagramPostInsightsResponse = Response<InstagramPostInsight>;
#[derive(Clone, Debug, Default, PartialEq)]
#[non_exhaustive]
pub struct InstagramPostLikersOptions {
pub freshness: Option<crate::options::Freshness>,
pub cursor: Option<String>,
pub request_options: RequestOptions,
}
impl InstagramPostLikersOptions {
pub fn new() -> Self {
Self::default()
}
pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
self.freshness = Some(value);
self
}
pub fn cursor(mut self, value: impl Into<String>) -> Self {
self.cursor = Some(value.into());
self
}
pub fn max_retries(mut self, value: u32) -> Self {
self.request_options.max_retries = Some(value);
self
}
pub fn timeout(mut self, value: Duration) -> Self {
self.request_options.timeout = Some(value);
self
}
pub(crate) fn query(&self) -> Result<Query, Error> {
let mut query = Query::default();
query.push("freshness", &self.freshness);
query.push("cursor", &self.cursor);
Ok(query)
}
}
pub type InstagramPostLikersPage = Page<InstagramProfile>;
#[derive(Clone, Debug, Default, PartialEq)]
#[non_exhaustive]
pub struct InstagramPostOEmbedOptions {
pub freshness: Option<crate::options::Freshness>,
pub request_options: RequestOptions,
}
impl InstagramPostOEmbedOptions {
pub fn new() -> Self {
Self::default()
}
pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
self.freshness = Some(value);
self
}
pub fn max_retries(mut self, value: u32) -> Self {
self.request_options.max_retries = Some(value);
self
}
pub fn timeout(mut self, value: Duration) -> Self {
self.request_options.timeout = Some(value);
self
}
pub(crate) fn query(&self) -> Result<Query, Error> {
let mut query = Query::default();
query.push("freshness", &self.freshness);
Ok(query)
}
}
pub type InstagramPostOEmbedResponse = Response<InstagramOEmbed>;
#[derive(Clone, Debug, Default, PartialEq)]
#[non_exhaustive]
pub struct InstagramPostTaggedUsersOptions {
pub freshness: Option<crate::options::Freshness>,
pub cursor: Option<String>,
pub request_options: RequestOptions,
}
impl InstagramPostTaggedUsersOptions {
pub fn new() -> Self {
Self::default()
}
pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
self.freshness = Some(value);
self
}
pub fn cursor(mut self, value: impl Into<String>) -> Self {
self.cursor = Some(value.into());
self
}
pub fn max_retries(mut self, value: u32) -> Self {
self.request_options.max_retries = Some(value);
self
}
pub fn timeout(mut self, value: Duration) -> Self {
self.request_options.timeout = Some(value);
self
}
pub(crate) fn query(&self) -> Result<Query, Error> {
let mut query = Query::default();
query.push("freshness", &self.freshness);
query.push("cursor", &self.cursor);
Ok(query)
}
}
pub type InstagramPostTaggedUsersPage = Page<InstagramUserTag>;
#[derive(Clone, Debug, Default, PartialEq)]
#[non_exhaustive]
pub struct InstagramPostTemplateOptions {
pub freshness: Option<crate::options::Freshness>,
pub request_options: RequestOptions,
}
impl InstagramPostTemplateOptions {
pub fn new() -> Self {
Self::default()
}
pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
self.freshness = Some(value);
self
}
pub fn max_retries(mut self, value: u32) -> Self {
self.request_options.max_retries = Some(value);
self
}
pub fn timeout(mut self, value: Duration) -> Self {
self.request_options.timeout = Some(value);
self
}
pub(crate) fn query(&self) -> Result<Query, Error> {
let mut query = Query::default();
query.push("freshness", &self.freshness);
Ok(query)
}
}
pub type InstagramPostTemplateResponse = Response<InstagramTemplate>;
#[derive(Clone, Debug, Default, PartialEq)]
#[non_exhaustive]
pub struct InstagramProfileOptions {
pub freshness: Option<crate::options::Freshness>,
pub request_options: RequestOptions,
}
impl InstagramProfileOptions {
pub fn new() -> Self {
Self::default()
}
pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
self.freshness = Some(value);
self
}
pub fn max_retries(mut self, value: u32) -> Self {
self.request_options.max_retries = Some(value);
self
}
pub fn timeout(mut self, value: Duration) -> Self {
self.request_options.timeout = Some(value);
self
}
pub(crate) fn query(&self) -> Result<Query, Error> {
let mut query = Query::default();
query.push("freshness", &self.freshness);
Ok(query)
}
}
pub type InstagramProfileResponse = Response<InstagramProfile>;
#[derive(Clone, Debug, Default, PartialEq)]
#[non_exhaustive]
pub struct InstagramProfileAboutOptions {
pub freshness: Option<crate::options::Freshness>,
pub request_options: RequestOptions,
}
impl InstagramProfileAboutOptions {
pub fn new() -> Self {
Self::default()
}
pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
self.freshness = Some(value);
self
}
pub fn max_retries(mut self, value: u32) -> Self {
self.request_options.max_retries = Some(value);
self
}
pub fn timeout(mut self, value: Duration) -> Self {
self.request_options.timeout = Some(value);
self
}
pub(crate) fn query(&self) -> Result<Query, Error> {
let mut query = Query::default();
query.push("freshness", &self.freshness);
Ok(query)
}
}
pub type InstagramProfileAboutResponse = Response<InstagramProfileAbout>;
#[derive(Clone, Debug, Default, PartialEq)]
#[non_exhaustive]
pub struct InstagramProfileBusinessRecommendationsOptions {
pub freshness: Option<crate::options::Freshness>,
pub cursor: Option<String>,
pub request_options: RequestOptions,
}
impl InstagramProfileBusinessRecommendationsOptions {
pub fn new() -> Self {
Self::default()
}
pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
self.freshness = Some(value);
self
}
pub fn cursor(mut self, value: impl Into<String>) -> Self {
self.cursor = Some(value.into());
self
}
pub fn max_retries(mut self, value: u32) -> Self {
self.request_options.max_retries = Some(value);
self
}
pub fn timeout(mut self, value: Duration) -> Self {
self.request_options.timeout = Some(value);
self
}
pub(crate) fn query(&self) -> Result<Query, Error> {
let mut query = Query::default();
query.push("freshness", &self.freshness);
query.push("cursor", &self.cursor);
Ok(query)
}
}
pub type InstagramProfileBusinessRecommendationsPage = Page<InstagramProfileSummary>;
#[derive(Clone, Debug, Default, PartialEq)]
#[non_exhaustive]
pub struct InstagramProfileFollowersOptions {
pub freshness: Option<crate::options::Freshness>,
pub cursor: Option<String>,
pub request_options: RequestOptions,
}
impl InstagramProfileFollowersOptions {
pub fn new() -> Self {
Self::default()
}
pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
self.freshness = Some(value);
self
}
pub fn cursor(mut self, value: impl Into<String>) -> Self {
self.cursor = Some(value.into());
self
}
pub fn max_retries(mut self, value: u32) -> Self {
self.request_options.max_retries = Some(value);
self
}
pub fn timeout(mut self, value: Duration) -> Self {
self.request_options.timeout = Some(value);
self
}
pub(crate) fn query(&self) -> Result<Query, Error> {
let mut query = Query::default();
query.push("freshness", &self.freshness);
query.push("cursor", &self.cursor);
Ok(query)
}
}
pub type InstagramProfileFollowersPage = Page<InstagramProfile>;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub struct InstagramProfileFollowersSearchOptions {
pub q: String,
pub freshness: Option<crate::options::Freshness>,
pub cursor: Option<String>,
pub request_options: RequestOptions,
}
impl InstagramProfileFollowersSearchOptions {
pub fn new(q: impl Into<String>) -> Self {
Self {
q: q.into(),
freshness: None,
cursor: None,
request_options: RequestOptions::default(),
}
}
pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
self.freshness = Some(value);
self
}
pub fn cursor(mut self, value: impl Into<String>) -> Self {
self.cursor = Some(value.into());
self
}
pub fn max_retries(mut self, value: u32) -> Self {
self.request_options.max_retries = Some(value);
self
}
pub fn timeout(mut self, value: Duration) -> Self {
self.request_options.timeout = Some(value);
self
}
pub(crate) fn query(&self) -> Result<Query, Error> {
let mut query = Query::default();
query.require("q", &self.q)?;
query.push("freshness", &self.freshness);
query.push("cursor", &self.cursor);
Ok(query)
}
}
pub type InstagramProfileFollowersSearchPage = Page<InstagramProfile>;
#[derive(Clone, Debug, Default, PartialEq)]
#[non_exhaustive]
pub struct InstagramProfileFollowingOptions {
pub freshness: Option<crate::options::Freshness>,
pub cursor: Option<String>,
pub request_options: RequestOptions,
}
impl InstagramProfileFollowingOptions {
pub fn new() -> Self {
Self::default()
}
pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
self.freshness = Some(value);
self
}
pub fn cursor(mut self, value: impl Into<String>) -> Self {
self.cursor = Some(value.into());
self
}
pub fn max_retries(mut self, value: u32) -> Self {
self.request_options.max_retries = Some(value);
self
}
pub fn timeout(mut self, value: Duration) -> Self {
self.request_options.timeout = Some(value);
self
}
pub(crate) fn query(&self) -> Result<Query, Error> {
let mut query = Query::default();
query.push("freshness", &self.freshness);
query.push("cursor", &self.cursor);
Ok(query)
}
}
pub type InstagramProfileFollowingPage = Page<InstagramProfile>;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub struct InstagramProfileFollowingSearchOptions {
pub q: String,
pub freshness: Option<crate::options::Freshness>,
pub cursor: Option<String>,
pub request_options: RequestOptions,
}
impl InstagramProfileFollowingSearchOptions {
pub fn new(q: impl Into<String>) -> Self {
Self {
q: q.into(),
freshness: None,
cursor: None,
request_options: RequestOptions::default(),
}
}
pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
self.freshness = Some(value);
self
}
pub fn cursor(mut self, value: impl Into<String>) -> Self {
self.cursor = Some(value.into());
self
}
pub fn max_retries(mut self, value: u32) -> Self {
self.request_options.max_retries = Some(value);
self
}
pub fn timeout(mut self, value: Duration) -> Self {
self.request_options.timeout = Some(value);
self
}
pub(crate) fn query(&self) -> Result<Query, Error> {
let mut query = Query::default();
query.require("q", &self.q)?;
query.push("freshness", &self.freshness);
query.push("cursor", &self.cursor);
Ok(query)
}
}
pub type InstagramProfileFollowingSearchPage = Page<InstagramProfile>;
#[derive(Clone, Debug, Default, PartialEq)]
#[non_exhaustive]
pub struct InstagramProfileHighlightsOptions {
pub freshness: Option<crate::options::Freshness>,
pub cursor: Option<String>,
pub request_options: RequestOptions,
}
impl InstagramProfileHighlightsOptions {
pub fn new() -> Self {
Self::default()
}
pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
self.freshness = Some(value);
self
}
pub fn cursor(mut self, value: impl Into<String>) -> Self {
self.cursor = Some(value.into());
self
}
pub fn max_retries(mut self, value: u32) -> Self {
self.request_options.max_retries = Some(value);
self
}
pub fn timeout(mut self, value: Duration) -> Self {
self.request_options.timeout = Some(value);
self
}
pub(crate) fn query(&self) -> Result<Query, Error> {
let mut query = Query::default();
query.push("freshness", &self.freshness);
query.push("cursor", &self.cursor);
Ok(query)
}
}
pub type InstagramProfileHighlightsPage = Page<InstagramHighlight>;
#[derive(Clone, Debug, Default, PartialEq)]
#[non_exhaustive]
pub struct InstagramProfilePinnedPostsOptions {
pub freshness: Option<crate::options::Freshness>,
pub cursor: Option<String>,
pub request_options: RequestOptions,
}
impl InstagramProfilePinnedPostsOptions {
pub fn new() -> Self {
Self::default()
}
pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
self.freshness = Some(value);
self
}
pub fn cursor(mut self, value: impl Into<String>) -> Self {
self.cursor = Some(value.into());
self
}
pub fn max_retries(mut self, value: u32) -> Self {
self.request_options.max_retries = Some(value);
self
}
pub fn timeout(mut self, value: Duration) -> Self {
self.request_options.timeout = Some(value);
self
}
pub(crate) fn query(&self) -> Result<Query, Error> {
let mut query = Query::default();
query.push("freshness", &self.freshness);
query.push("cursor", &self.cursor);
Ok(query)
}
}
pub type InstagramProfilePinnedPostsPage = Page<InstagramPost>;
#[derive(Clone, Debug, Default, PartialEq)]
#[non_exhaustive]
pub struct InstagramProfilePostsOptions {
pub freshness: Option<crate::options::Freshness>,
pub cursor: Option<String>,
pub since: Option<chrono::DateTime<chrono::Utc>>,
pub request_options: RequestOptions,
}
impl InstagramProfilePostsOptions {
pub fn new() -> Self {
Self::default()
}
pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
self.freshness = Some(value);
self
}
pub fn cursor(mut self, value: impl Into<String>) -> Self {
self.cursor = Some(value.into());
self
}
pub fn since(mut self, value: chrono::DateTime<chrono::Utc>) -> Self {
self.since = Some(value);
self
}
pub fn max_retries(mut self, value: u32) -> Self {
self.request_options.max_retries = Some(value);
self
}
pub fn timeout(mut self, value: Duration) -> Self {
self.request_options.timeout = Some(value);
self
}
pub(crate) fn query(&self) -> Result<Query, Error> {
let mut query = Query::default();
query.push("freshness", &self.freshness);
query.push("cursor", &self.cursor);
query.push("since", &self.since);
Ok(query)
}
}
pub type InstagramProfilePostsPage = Page<InstagramPost>;
#[derive(Clone, Debug, Default, PartialEq)]
#[non_exhaustive]
pub struct InstagramProfileReelsOptions {
pub freshness: Option<crate::options::Freshness>,
pub cursor: Option<String>,
pub request_options: RequestOptions,
}
impl InstagramProfileReelsOptions {
pub fn new() -> Self {
Self::default()
}
pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
self.freshness = Some(value);
self
}
pub fn cursor(mut self, value: impl Into<String>) -> Self {
self.cursor = Some(value.into());
self
}
pub fn max_retries(mut self, value: u32) -> Self {
self.request_options.max_retries = Some(value);
self
}
pub fn timeout(mut self, value: Duration) -> Self {
self.request_options.timeout = Some(value);
self
}
pub(crate) fn query(&self) -> Result<Query, Error> {
let mut query = Query::default();
query.push("freshness", &self.freshness);
query.push("cursor", &self.cursor);
Ok(query)
}
}
pub type InstagramProfileReelsPage = Page<InstagramPost>;
#[derive(Clone, Debug, Default, PartialEq)]
#[non_exhaustive]
pub struct InstagramProfileRepostsOptions {
pub freshness: Option<crate::options::Freshness>,
pub cursor: Option<String>,
pub request_options: RequestOptions,
}
impl InstagramProfileRepostsOptions {
pub fn new() -> Self {
Self::default()
}
pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
self.freshness = Some(value);
self
}
pub fn cursor(mut self, value: impl Into<String>) -> Self {
self.cursor = Some(value.into());
self
}
pub fn max_retries(mut self, value: u32) -> Self {
self.request_options.max_retries = Some(value);
self
}
pub fn timeout(mut self, value: Duration) -> Self {
self.request_options.timeout = Some(value);
self
}
pub(crate) fn query(&self) -> Result<Query, Error> {
let mut query = Query::default();
query.push("freshness", &self.freshness);
query.push("cursor", &self.cursor);
Ok(query)
}
}
pub type InstagramProfileRepostsPage = Page<InstagramPost>;
#[derive(Clone, Debug, Default, PartialEq)]
#[non_exhaustive]
pub struct InstagramProfileStoriesOptions {
pub freshness: Option<crate::options::Freshness>,
pub cursor: Option<String>,
pub request_options: RequestOptions,
}
impl InstagramProfileStoriesOptions {
pub fn new() -> Self {
Self::default()
}
pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
self.freshness = Some(value);
self
}
pub fn cursor(mut self, value: impl Into<String>) -> Self {
self.cursor = Some(value.into());
self
}
pub fn max_retries(mut self, value: u32) -> Self {
self.request_options.max_retries = Some(value);
self
}
pub fn timeout(mut self, value: Duration) -> Self {
self.request_options.timeout = Some(value);
self
}
pub(crate) fn query(&self) -> Result<Query, Error> {
let mut query = Query::default();
query.push("freshness", &self.freshness);
query.push("cursor", &self.cursor);
Ok(query)
}
}
pub type InstagramProfileStoriesPage = Page<InstagramStory>;
#[derive(Clone, Debug, Default, PartialEq)]
#[non_exhaustive]
pub struct InstagramProfileSuggestedOptions {
pub freshness: Option<crate::options::Freshness>,
pub cursor: Option<String>,
pub request_options: RequestOptions,
}
impl InstagramProfileSuggestedOptions {
pub fn new() -> Self {
Self::default()
}
pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
self.freshness = Some(value);
self
}
pub fn cursor(mut self, value: impl Into<String>) -> Self {
self.cursor = Some(value.into());
self
}
pub fn max_retries(mut self, value: u32) -> Self {
self.request_options.max_retries = Some(value);
self
}
pub fn timeout(mut self, value: Duration) -> Self {
self.request_options.timeout = Some(value);
self
}
pub(crate) fn query(&self) -> Result<Query, Error> {
let mut query = Query::default();
query.push("freshness", &self.freshness);
query.push("cursor", &self.cursor);
Ok(query)
}
}
pub type InstagramProfileSuggestedPage = Page<InstagramProfile>;
#[derive(Clone, Debug, Default, PartialEq)]
#[non_exhaustive]
pub struct InstagramProfileTaggedPostsOptions {
pub freshness: Option<crate::options::Freshness>,
pub cursor: Option<String>,
pub request_options: RequestOptions,
}
impl InstagramProfileTaggedPostsOptions {
pub fn new() -> Self {
Self::default()
}
pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
self.freshness = Some(value);
self
}
pub fn cursor(mut self, value: impl Into<String>) -> Self {
self.cursor = Some(value.into());
self
}
pub fn max_retries(mut self, value: u32) -> Self {
self.request_options.max_retries = Some(value);
self
}
pub fn timeout(mut self, value: Duration) -> Self {
self.request_options.timeout = Some(value);
self
}
pub(crate) fn query(&self) -> Result<Query, Error> {
let mut query = Query::default();
query.push("freshness", &self.freshness);
query.push("cursor", &self.cursor);
Ok(query)
}
}
pub type InstagramProfileTaggedPostsPage = Page<InstagramPost>;
#[derive(Clone, Debug, Default, PartialEq)]
#[non_exhaustive]
pub struct InstagramProfileVideosOptions {
pub freshness: Option<crate::options::Freshness>,
pub cursor: Option<String>,
pub request_options: RequestOptions,
}
impl InstagramProfileVideosOptions {
pub fn new() -> Self {
Self::default()
}
pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
self.freshness = Some(value);
self
}
pub fn cursor(mut self, value: impl Into<String>) -> Self {
self.cursor = Some(value.into());
self
}
pub fn max_retries(mut self, value: u32) -> Self {
self.request_options.max_retries = Some(value);
self
}
pub fn timeout(mut self, value: Duration) -> Self {
self.request_options.timeout = Some(value);
self
}
pub(crate) fn query(&self) -> Result<Query, Error> {
let mut query = Query::default();
query.push("freshness", &self.freshness);
query.push("cursor", &self.cursor);
Ok(query)
}
}
pub type InstagramProfileVideosPage = Page<InstagramPost>;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub struct InstagramSearchHashtagsOptions {
pub q: String,
pub freshness: Option<crate::options::Freshness>,
pub cursor: Option<String>,
pub request_options: RequestOptions,
}
impl InstagramSearchHashtagsOptions {
pub fn new(q: impl Into<String>) -> Self {
Self {
q: q.into(),
freshness: None,
cursor: None,
request_options: RequestOptions::default(),
}
}
pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
self.freshness = Some(value);
self
}
pub fn cursor(mut self, value: impl Into<String>) -> Self {
self.cursor = Some(value.into());
self
}
pub fn max_retries(mut self, value: u32) -> Self {
self.request_options.max_retries = Some(value);
self
}
pub fn timeout(mut self, value: Duration) -> Self {
self.request_options.timeout = Some(value);
self
}
pub(crate) fn query(&self) -> Result<Query, Error> {
let mut query = Query::default();
query.require("q", &self.q)?;
query.push("freshness", &self.freshness);
query.push("cursor", &self.cursor);
Ok(query)
}
}
pub type InstagramSearchHashtagsPage = Page<InstagramHashtag>;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub struct InstagramSearchMusicOptions {
pub q: String,
pub freshness: Option<crate::options::Freshness>,
pub cursor: Option<String>,
pub request_options: RequestOptions,
}
impl InstagramSearchMusicOptions {
pub fn new(q: impl Into<String>) -> Self {
Self {
q: q.into(),
freshness: None,
cursor: None,
request_options: RequestOptions::default(),
}
}
pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
self.freshness = Some(value);
self
}
pub fn cursor(mut self, value: impl Into<String>) -> Self {
self.cursor = Some(value.into());
self
}
pub fn max_retries(mut self, value: u32) -> Self {
self.request_options.max_retries = Some(value);
self
}
pub fn timeout(mut self, value: Duration) -> Self {
self.request_options.timeout = Some(value);
self
}
pub(crate) fn query(&self) -> Result<Query, Error> {
let mut query = Query::default();
query.require("q", &self.q)?;
query.push("freshness", &self.freshness);
query.push("cursor", &self.cursor);
Ok(query)
}
}
pub type InstagramSearchMusicPage = Page<InstagramMusic>;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub struct InstagramSearchPlacesOptions {
pub q: String,
pub freshness: Option<crate::options::Freshness>,
pub cursor: Option<String>,
pub request_options: RequestOptions,
}
impl InstagramSearchPlacesOptions {
pub fn new(q: impl Into<String>) -> Self {
Self {
q: q.into(),
freshness: None,
cursor: None,
request_options: RequestOptions::default(),
}
}
pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
self.freshness = Some(value);
self
}
pub fn cursor(mut self, value: impl Into<String>) -> Self {
self.cursor = Some(value.into());
self
}
pub fn max_retries(mut self, value: u32) -> Self {
self.request_options.max_retries = Some(value);
self
}
pub fn timeout(mut self, value: Duration) -> Self {
self.request_options.timeout = Some(value);
self
}
pub(crate) fn query(&self) -> Result<Query, Error> {
let mut query = Query::default();
query.require("q", &self.q)?;
query.push("freshness", &self.freshness);
query.push("cursor", &self.cursor);
Ok(query)
}
}
pub type InstagramSearchPlacesPage = Page<InstagramLocation>;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub struct InstagramSearchProfilesOptions {
pub q: String,
pub freshness: Option<crate::options::Freshness>,
pub cursor: Option<String>,
pub request_options: RequestOptions,
}
impl InstagramSearchProfilesOptions {
pub fn new(q: impl Into<String>) -> Self {
Self {
q: q.into(),
freshness: None,
cursor: None,
request_options: RequestOptions::default(),
}
}
pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
self.freshness = Some(value);
self
}
pub fn cursor(mut self, value: impl Into<String>) -> Self {
self.cursor = Some(value.into());
self
}
pub fn max_retries(mut self, value: u32) -> Self {
self.request_options.max_retries = Some(value);
self
}
pub fn timeout(mut self, value: Duration) -> Self {
self.request_options.timeout = Some(value);
self
}
pub(crate) fn query(&self) -> Result<Query, Error> {
let mut query = Query::default();
query.require("q", &self.q)?;
query.push("freshness", &self.freshness);
query.push("cursor", &self.cursor);
Ok(query)
}
}
pub type InstagramSearchProfilesPage = Page<InstagramProfile>;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub struct InstagramSearchReelsOptions {
pub q: String,
pub freshness: Option<crate::options::Freshness>,
pub cursor: Option<String>,
pub request_options: RequestOptions,
}
impl InstagramSearchReelsOptions {
pub fn new(q: impl Into<String>) -> Self {
Self {
q: q.into(),
freshness: None,
cursor: None,
request_options: RequestOptions::default(),
}
}
pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
self.freshness = Some(value);
self
}
pub fn cursor(mut self, value: impl Into<String>) -> Self {
self.cursor = Some(value.into());
self
}
pub fn max_retries(mut self, value: u32) -> Self {
self.request_options.max_retries = Some(value);
self
}
pub fn timeout(mut self, value: Duration) -> Self {
self.request_options.timeout = Some(value);
self
}
pub(crate) fn query(&self) -> Result<Query, Error> {
let mut query = Query::default();
query.require("q", &self.q)?;
query.push("freshness", &self.freshness);
query.push("cursor", &self.cursor);
Ok(query)
}
}
pub type InstagramSearchReelsPage = Page<InstagramPost>;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub struct InstagramSearchTopOptions {
pub q: String,
pub freshness: Option<crate::options::Freshness>,
pub cursor: Option<String>,
pub request_options: RequestOptions,
}
impl InstagramSearchTopOptions {
pub fn new(q: impl Into<String>) -> Self {
Self {
q: q.into(),
freshness: None,
cursor: None,
request_options: RequestOptions::default(),
}
}
pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
self.freshness = Some(value);
self
}
pub fn cursor(mut self, value: impl Into<String>) -> Self {
self.cursor = Some(value.into());
self
}
pub fn max_retries(mut self, value: u32) -> Self {
self.request_options.max_retries = Some(value);
self
}
pub fn timeout(mut self, value: Duration) -> Self {
self.request_options.timeout = Some(value);
self
}
pub(crate) fn query(&self) -> Result<Query, Error> {
let mut query = Query::default();
query.require("q", &self.q)?;
query.push("freshness", &self.freshness);
query.push("cursor", &self.cursor);
Ok(query)
}
}
pub type InstagramSearchTopPage = Page<InstagramSearchResult>;
#[derive(Clone, Debug, Default, PartialEq)]
#[non_exhaustive]
pub struct InstagramStoryOptions {
pub freshness: Option<crate::options::Freshness>,
pub request_options: RequestOptions,
}
impl InstagramStoryOptions {
pub fn new() -> Self {
Self::default()
}
pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
self.freshness = Some(value);
self
}
pub fn max_retries(mut self, value: u32) -> Self {
self.request_options.max_retries = Some(value);
self
}
pub fn timeout(mut self, value: Duration) -> Self {
self.request_options.timeout = Some(value);
self
}
pub(crate) fn query(&self) -> Result<Query, Error> {
let mut query = Query::default();
query.push("freshness", &self.freshness);
Ok(query)
}
}
pub type InstagramStoryResponse = Response<InstagramStory>;
#[derive(Clone, Debug, Default, PartialEq)]
#[non_exhaustive]
pub struct RedditDomainPostsOptions {
pub sort: Option<String>,
pub t: Option<String>,
pub limit: Option<i64>,
pub freshness: Option<crate::options::Freshness>,
pub cursor: Option<String>,
pub request_options: RequestOptions,
}
impl RedditDomainPostsOptions {
pub fn new() -> Self {
Self::default()
}
pub fn sort(mut self, value: impl Into<String>) -> Self {
self.sort = Some(value.into());
self
}
pub fn t(mut self, value: impl Into<String>) -> Self {
self.t = Some(value.into());
self
}
pub fn limit(mut self, value: i64) -> Self {
self.limit = Some(value);
self
}
pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
self.freshness = Some(value);
self
}
pub fn cursor(mut self, value: impl Into<String>) -> Self {
self.cursor = Some(value.into());
self
}
pub fn max_retries(mut self, value: u32) -> Self {
self.request_options.max_retries = Some(value);
self
}
pub fn timeout(mut self, value: Duration) -> Self {
self.request_options.timeout = Some(value);
self
}
pub(crate) fn query(&self) -> Result<Query, Error> {
let mut query = Query::default();
query.push("sort", &self.sort);
query.push("t", &self.t);
query.push("limit", &self.limit);
query.push("freshness", &self.freshness);
query.push("cursor", &self.cursor);
Ok(query)
}
}
pub type RedditDomainPostsPage = Page<RedditPost>;
#[derive(Clone, Debug, Default, PartialEq)]
#[non_exhaustive]
pub struct RedditPostOptions {
pub freshness: Option<crate::options::Freshness>,
pub request_options: RequestOptions,
}
impl RedditPostOptions {
pub fn new() -> Self {
Self::default()
}
pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
self.freshness = Some(value);
self
}
pub fn max_retries(mut self, value: u32) -> Self {
self.request_options.max_retries = Some(value);
self
}
pub fn timeout(mut self, value: Duration) -> Self {
self.request_options.timeout = Some(value);
self
}
pub(crate) fn query(&self) -> Result<Query, Error> {
let mut query = Query::default();
query.push("freshness", &self.freshness);
Ok(query)
}
}
pub type RedditPostResponse = Response<RedditPost>;
#[derive(Clone, Debug, Default, PartialEq)]
#[non_exhaustive]
pub struct RedditPostCommentsOptions {
pub sort: Option<String>,
pub limit: Option<i64>,
pub depth: Option<i64>,
pub freshness: Option<crate::options::Freshness>,
pub request_options: RequestOptions,
}
impl RedditPostCommentsOptions {
pub fn new() -> Self {
Self::default()
}
pub fn sort(mut self, value: impl Into<String>) -> Self {
self.sort = Some(value.into());
self
}
pub fn limit(mut self, value: i64) -> Self {
self.limit = Some(value);
self
}
pub fn depth(mut self, value: i64) -> Self {
self.depth = Some(value);
self
}
pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
self.freshness = Some(value);
self
}
pub fn max_retries(mut self, value: u32) -> Self {
self.request_options.max_retries = Some(value);
self
}
pub fn timeout(mut self, value: Duration) -> Self {
self.request_options.timeout = Some(value);
self
}
pub(crate) fn query(&self) -> Result<Query, Error> {
let mut query = Query::default();
query.push("sort", &self.sort);
query.push("limit", &self.limit);
query.push("depth", &self.depth);
query.push("freshness", &self.freshness);
Ok(query)
}
}
pub type RedditPostCommentsResponse = Response<Vec<RedditComment>>;
#[derive(Clone, Debug, Default, PartialEq)]
#[non_exhaustive]
pub struct RedditPostDuplicatesOptions {
pub limit: Option<i64>,
pub freshness: Option<crate::options::Freshness>,
pub cursor: Option<String>,
pub request_options: RequestOptions,
}
impl RedditPostDuplicatesOptions {
pub fn new() -> Self {
Self::default()
}
pub fn limit(mut self, value: i64) -> Self {
self.limit = Some(value);
self
}
pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
self.freshness = Some(value);
self
}
pub fn cursor(mut self, value: impl Into<String>) -> Self {
self.cursor = Some(value.into());
self
}
pub fn max_retries(mut self, value: u32) -> Self {
self.request_options.max_retries = Some(value);
self
}
pub fn timeout(mut self, value: Duration) -> Self {
self.request_options.timeout = Some(value);
self
}
pub(crate) fn query(&self) -> Result<Query, Error> {
let mut query = Query::default();
query.push("limit", &self.limit);
query.push("freshness", &self.freshness);
query.push("cursor", &self.cursor);
Ok(query)
}
}
pub type RedditPostDuplicatesPage = Page<RedditPost>;
#[derive(Clone, Debug, Default, PartialEq)]
#[non_exhaustive]
pub struct RedditProfileOptions {
pub freshness: Option<crate::options::Freshness>,
pub request_options: RequestOptions,
}
impl RedditProfileOptions {
pub fn new() -> Self {
Self::default()
}
pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
self.freshness = Some(value);
self
}
pub fn max_retries(mut self, value: u32) -> Self {
self.request_options.max_retries = Some(value);
self
}
pub fn timeout(mut self, value: Duration) -> Self {
self.request_options.timeout = Some(value);
self
}
pub(crate) fn query(&self) -> Result<Query, Error> {
let mut query = Query::default();
query.push("freshness", &self.freshness);
Ok(query)
}
}
pub type RedditProfileResponse = Response<RedditProfile>;
#[derive(Clone, Debug, Default, PartialEq)]
#[non_exhaustive]
pub struct RedditProfileCommentsOptions {
pub sort: Option<String>,
pub t: Option<String>,
pub limit: Option<i64>,
pub freshness: Option<crate::options::Freshness>,
pub cursor: Option<String>,
pub request_options: RequestOptions,
}
impl RedditProfileCommentsOptions {
pub fn new() -> Self {
Self::default()
}
pub fn sort(mut self, value: impl Into<String>) -> Self {
self.sort = Some(value.into());
self
}
pub fn t(mut self, value: impl Into<String>) -> Self {
self.t = Some(value.into());
self
}
pub fn limit(mut self, value: i64) -> Self {
self.limit = Some(value);
self
}
pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
self.freshness = Some(value);
self
}
pub fn cursor(mut self, value: impl Into<String>) -> Self {
self.cursor = Some(value.into());
self
}
pub fn max_retries(mut self, value: u32) -> Self {
self.request_options.max_retries = Some(value);
self
}
pub fn timeout(mut self, value: Duration) -> Self {
self.request_options.timeout = Some(value);
self
}
pub(crate) fn query(&self) -> Result<Query, Error> {
let mut query = Query::default();
query.push("sort", &self.sort);
query.push("t", &self.t);
query.push("limit", &self.limit);
query.push("freshness", &self.freshness);
query.push("cursor", &self.cursor);
Ok(query)
}
}
pub type RedditProfileCommentsPage = Page<RedditComment>;
#[derive(Clone, Debug, Default, PartialEq)]
#[non_exhaustive]
pub struct RedditProfileModeratedOptions {
pub freshness: Option<crate::options::Freshness>,
pub request_options: RequestOptions,
}
impl RedditProfileModeratedOptions {
pub fn new() -> Self {
Self::default()
}
pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
self.freshness = Some(value);
self
}
pub fn max_retries(mut self, value: u32) -> Self {
self.request_options.max_retries = Some(value);
self
}
pub fn timeout(mut self, value: Duration) -> Self {
self.request_options.timeout = Some(value);
self
}
pub(crate) fn query(&self) -> Result<Query, Error> {
let mut query = Query::default();
query.push("freshness", &self.freshness);
Ok(query)
}
}
pub type RedditProfileModeratedResponse = Response<Vec<RedditSubreddit>>;
#[derive(Clone, Debug, Default, PartialEq)]
#[non_exhaustive]
pub struct RedditProfilePostsOptions {
pub sort: Option<String>,
pub t: Option<String>,
pub limit: Option<i64>,
pub freshness: Option<crate::options::Freshness>,
pub cursor: Option<String>,
pub request_options: RequestOptions,
}
impl RedditProfilePostsOptions {
pub fn new() -> Self {
Self::default()
}
pub fn sort(mut self, value: impl Into<String>) -> Self {
self.sort = Some(value.into());
self
}
pub fn t(mut self, value: impl Into<String>) -> Self {
self.t = Some(value.into());
self
}
pub fn limit(mut self, value: i64) -> Self {
self.limit = Some(value);
self
}
pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
self.freshness = Some(value);
self
}
pub fn cursor(mut self, value: impl Into<String>) -> Self {
self.cursor = Some(value.into());
self
}
pub fn max_retries(mut self, value: u32) -> Self {
self.request_options.max_retries = Some(value);
self
}
pub fn timeout(mut self, value: Duration) -> Self {
self.request_options.timeout = Some(value);
self
}
pub(crate) fn query(&self) -> Result<Query, Error> {
let mut query = Query::default();
query.push("sort", &self.sort);
query.push("t", &self.t);
query.push("limit", &self.limit);
query.push("freshness", &self.freshness);
query.push("cursor", &self.cursor);
Ok(query)
}
}
pub type RedditProfilePostsPage = Page<RedditPost>;
#[derive(Clone, Debug, Default, PartialEq)]
#[non_exhaustive]
pub struct RedditProfileTrophiesOptions {
pub freshness: Option<crate::options::Freshness>,
pub request_options: RequestOptions,
}
impl RedditProfileTrophiesOptions {
pub fn new() -> Self {
Self::default()
}
pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
self.freshness = Some(value);
self
}
pub fn max_retries(mut self, value: u32) -> Self {
self.request_options.max_retries = Some(value);
self
}
pub fn timeout(mut self, value: Duration) -> Self {
self.request_options.timeout = Some(value);
self
}
pub(crate) fn query(&self) -> Result<Query, Error> {
let mut query = Query::default();
query.push("freshness", &self.freshness);
Ok(query)
}
}
pub type RedditProfileTrophiesResponse = Response<Vec<RedditTrophy>>;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub struct RedditSearchPostsOptions {
pub q: String,
pub sort: Option<String>,
pub subreddit: Option<String>,
pub t: Option<String>,
pub limit: Option<i64>,
pub freshness: Option<crate::options::Freshness>,
pub cursor: Option<String>,
pub request_options: RequestOptions,
}
impl RedditSearchPostsOptions {
pub fn new(q: impl Into<String>) -> Self {
Self {
q: q.into(),
sort: None,
subreddit: None,
t: None,
limit: None,
freshness: None,
cursor: None,
request_options: RequestOptions::default(),
}
}
pub fn sort(mut self, value: impl Into<String>) -> Self {
self.sort = Some(value.into());
self
}
pub fn subreddit(mut self, value: impl Into<String>) -> Self {
self.subreddit = Some(value.into());
self
}
pub fn t(mut self, value: impl Into<String>) -> Self {
self.t = Some(value.into());
self
}
pub fn limit(mut self, value: i64) -> Self {
self.limit = Some(value);
self
}
pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
self.freshness = Some(value);
self
}
pub fn cursor(mut self, value: impl Into<String>) -> Self {
self.cursor = Some(value.into());
self
}
pub fn max_retries(mut self, value: u32) -> Self {
self.request_options.max_retries = Some(value);
self
}
pub fn timeout(mut self, value: Duration) -> Self {
self.request_options.timeout = Some(value);
self
}
pub(crate) fn query(&self) -> Result<Query, Error> {
let mut query = Query::default();
query.require("q", &self.q)?;
query.push("sort", &self.sort);
query.push("subreddit", &self.subreddit);
query.push("t", &self.t);
query.push("limit", &self.limit);
query.push("freshness", &self.freshness);
query.push("cursor", &self.cursor);
Ok(query)
}
}
pub type RedditSearchPostsPage = Page<RedditPost>;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub struct RedditSearchProfilesOptions {
pub q: String,
pub limit: Option<i64>,
pub freshness: Option<crate::options::Freshness>,
pub cursor: Option<String>,
pub request_options: RequestOptions,
}
impl RedditSearchProfilesOptions {
pub fn new(q: impl Into<String>) -> Self {
Self {
q: q.into(),
limit: None,
freshness: None,
cursor: None,
request_options: RequestOptions::default(),
}
}
pub fn limit(mut self, value: i64) -> Self {
self.limit = Some(value);
self
}
pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
self.freshness = Some(value);
self
}
pub fn cursor(mut self, value: impl Into<String>) -> Self {
self.cursor = Some(value.into());
self
}
pub fn max_retries(mut self, value: u32) -> Self {
self.request_options.max_retries = Some(value);
self
}
pub fn timeout(mut self, value: Duration) -> Self {
self.request_options.timeout = Some(value);
self
}
pub(crate) fn query(&self) -> Result<Query, Error> {
let mut query = Query::default();
query.require("q", &self.q)?;
query.push("limit", &self.limit);
query.push("freshness", &self.freshness);
query.push("cursor", &self.cursor);
Ok(query)
}
}
pub type RedditSearchProfilesPage = Page<RedditProfile>;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub struct RedditSearchSubredditsOptions {
pub q: String,
pub limit: Option<i64>,
pub freshness: Option<crate::options::Freshness>,
pub cursor: Option<String>,
pub request_options: RequestOptions,
}
impl RedditSearchSubredditsOptions {
pub fn new(q: impl Into<String>) -> Self {
Self {
q: q.into(),
limit: None,
freshness: None,
cursor: None,
request_options: RequestOptions::default(),
}
}
pub fn limit(mut self, value: i64) -> Self {
self.limit = Some(value);
self
}
pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
self.freshness = Some(value);
self
}
pub fn cursor(mut self, value: impl Into<String>) -> Self {
self.cursor = Some(value.into());
self
}
pub fn max_retries(mut self, value: u32) -> Self {
self.request_options.max_retries = Some(value);
self
}
pub fn timeout(mut self, value: Duration) -> Self {
self.request_options.timeout = Some(value);
self
}
pub(crate) fn query(&self) -> Result<Query, Error> {
let mut query = Query::default();
query.require("q", &self.q)?;
query.push("limit", &self.limit);
query.push("freshness", &self.freshness);
query.push("cursor", &self.cursor);
Ok(query)
}
}
pub type RedditSearchSubredditsPage = Page<RedditSubreddit>;
#[derive(Clone, Debug, Default, PartialEq)]
#[non_exhaustive]
pub struct RedditSubredditOptions {
pub freshness: Option<crate::options::Freshness>,
pub request_options: RequestOptions,
}
impl RedditSubredditOptions {
pub fn new() -> Self {
Self::default()
}
pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
self.freshness = Some(value);
self
}
pub fn max_retries(mut self, value: u32) -> Self {
self.request_options.max_retries = Some(value);
self
}
pub fn timeout(mut self, value: Duration) -> Self {
self.request_options.timeout = Some(value);
self
}
pub(crate) fn query(&self) -> Result<Query, Error> {
let mut query = Query::default();
query.push("freshness", &self.freshness);
Ok(query)
}
}
pub type RedditSubredditResponse = Response<RedditSubreddit>;
#[derive(Clone, Debug, Default, PartialEq)]
#[non_exhaustive]
pub struct RedditSubredditPostsOptions {
pub sort: Option<String>,
pub t: Option<String>,
pub limit: Option<i64>,
pub freshness: Option<crate::options::Freshness>,
pub cursor: Option<String>,
pub request_options: RequestOptions,
}
impl RedditSubredditPostsOptions {
pub fn new() -> Self {
Self::default()
}
pub fn sort(mut self, value: impl Into<String>) -> Self {
self.sort = Some(value.into());
self
}
pub fn t(mut self, value: impl Into<String>) -> Self {
self.t = Some(value.into());
self
}
pub fn limit(mut self, value: i64) -> Self {
self.limit = Some(value);
self
}
pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
self.freshness = Some(value);
self
}
pub fn cursor(mut self, value: impl Into<String>) -> Self {
self.cursor = Some(value.into());
self
}
pub fn max_retries(mut self, value: u32) -> Self {
self.request_options.max_retries = Some(value);
self
}
pub fn timeout(mut self, value: Duration) -> Self {
self.request_options.timeout = Some(value);
self
}
pub(crate) fn query(&self) -> Result<Query, Error> {
let mut query = Query::default();
query.push("sort", &self.sort);
query.push("t", &self.t);
query.push("limit", &self.limit);
query.push("freshness", &self.freshness);
query.push("cursor", &self.cursor);
Ok(query)
}
}
pub type RedditSubredditPostsPage = Page<RedditPost>;
#[derive(Clone, Debug, Default, PartialEq)]
#[non_exhaustive]
pub struct RedditSubredditRulesOptions {
pub freshness: Option<crate::options::Freshness>,
pub request_options: RequestOptions,
}
impl RedditSubredditRulesOptions {
pub fn new() -> Self {
Self::default()
}
pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
self.freshness = Some(value);
self
}
pub fn max_retries(mut self, value: u32) -> Self {
self.request_options.max_retries = Some(value);
self
}
pub fn timeout(mut self, value: Duration) -> Self {
self.request_options.timeout = Some(value);
self
}
pub(crate) fn query(&self) -> Result<Query, Error> {
let mut query = Query::default();
query.push("freshness", &self.freshness);
Ok(query)
}
}
pub type RedditSubredditRulesResponse = Response<Vec<RedditRule>>;
#[derive(Clone, Debug, Default, PartialEq)]
#[non_exhaustive]
pub struct RedditSubredditWikiPageOptions {
pub freshness: Option<crate::options::Freshness>,
pub request_options: RequestOptions,
}
impl RedditSubredditWikiPageOptions {
pub fn new() -> Self {
Self::default()
}
pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
self.freshness = Some(value);
self
}
pub fn max_retries(mut self, value: u32) -> Self {
self.request_options.max_retries = Some(value);
self
}
pub fn timeout(mut self, value: Duration) -> Self {
self.request_options.timeout = Some(value);
self
}
pub(crate) fn query(&self) -> Result<Query, Error> {
let mut query = Query::default();
query.push("freshness", &self.freshness);
Ok(query)
}
}
pub type RedditSubredditWikiPageResponse = Response<RedditWikiPage>;
#[derive(Clone, Debug, Default, PartialEq)]
#[non_exhaustive]
pub struct RedditSubredditWikiPagesOptions {
pub freshness: Option<crate::options::Freshness>,
pub request_options: RequestOptions,
}
impl RedditSubredditWikiPagesOptions {
pub fn new() -> Self {
Self::default()
}
pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
self.freshness = Some(value);
self
}
pub fn max_retries(mut self, value: u32) -> Self {
self.request_options.max_retries = Some(value);
self
}
pub fn timeout(mut self, value: Duration) -> Self {
self.request_options.timeout = Some(value);
self
}
pub(crate) fn query(&self) -> Result<Query, Error> {
let mut query = Query::default();
query.push("freshness", &self.freshness);
Ok(query)
}
}
pub type RedditSubredditWikiPagesResponse = Response<Vec<RedditWikiPage>>;
#[derive(Clone, Debug, Default, PartialEq)]
#[non_exhaustive]
pub struct RedditSubredditsNewOptions {
pub limit: Option<i64>,
pub freshness: Option<crate::options::Freshness>,
pub cursor: Option<String>,
pub request_options: RequestOptions,
}
impl RedditSubredditsNewOptions {
pub fn new() -> Self {
Self::default()
}
pub fn limit(mut self, value: i64) -> Self {
self.limit = Some(value);
self
}
pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
self.freshness = Some(value);
self
}
pub fn cursor(mut self, value: impl Into<String>) -> Self {
self.cursor = Some(value.into());
self
}
pub fn max_retries(mut self, value: u32) -> Self {
self.request_options.max_retries = Some(value);
self
}
pub fn timeout(mut self, value: Duration) -> Self {
self.request_options.timeout = Some(value);
self
}
pub(crate) fn query(&self) -> Result<Query, Error> {
let mut query = Query::default();
query.push("limit", &self.limit);
query.push("freshness", &self.freshness);
query.push("cursor", &self.cursor);
Ok(query)
}
}
pub type RedditSubredditsNewPage = Page<RedditSubreddit>;
#[derive(Clone, Debug, Default, PartialEq)]
#[non_exhaustive]
pub struct RedditSubredditsPopularOptions {
pub limit: Option<i64>,
pub freshness: Option<crate::options::Freshness>,
pub cursor: Option<String>,
pub request_options: RequestOptions,
}
impl RedditSubredditsPopularOptions {
pub fn new() -> Self {
Self::default()
}
pub fn limit(mut self, value: i64) -> Self {
self.limit = Some(value);
self
}
pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
self.freshness = Some(value);
self
}
pub fn cursor(mut self, value: impl Into<String>) -> Self {
self.cursor = Some(value.into());
self
}
pub fn max_retries(mut self, value: u32) -> Self {
self.request_options.max_retries = Some(value);
self
}
pub fn timeout(mut self, value: Duration) -> Self {
self.request_options.timeout = Some(value);
self
}
pub(crate) fn query(&self) -> Result<Query, Error> {
let mut query = Query::default();
query.push("limit", &self.limit);
query.push("freshness", &self.freshness);
query.push("cursor", &self.cursor);
Ok(query)
}
}
pub type RedditSubredditsPopularPage = Page<RedditSubreddit>;
#[derive(Clone, Debug, Default, PartialEq)]
#[non_exhaustive]
pub struct RedditTrendingPostsOptions {
pub sort: Option<String>,
pub t: Option<String>,
pub limit: Option<i64>,
pub freshness: Option<crate::options::Freshness>,
pub cursor: Option<String>,
pub request_options: RequestOptions,
}
impl RedditTrendingPostsOptions {
pub fn new() -> Self {
Self::default()
}
pub fn sort(mut self, value: impl Into<String>) -> Self {
self.sort = Some(value.into());
self
}
pub fn t(mut self, value: impl Into<String>) -> Self {
self.t = Some(value.into());
self
}
pub fn limit(mut self, value: i64) -> Self {
self.limit = Some(value);
self
}
pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
self.freshness = Some(value);
self
}
pub fn cursor(mut self, value: impl Into<String>) -> Self {
self.cursor = Some(value.into());
self
}
pub fn max_retries(mut self, value: u32) -> Self {
self.request_options.max_retries = Some(value);
self
}
pub fn timeout(mut self, value: Duration) -> Self {
self.request_options.timeout = Some(value);
self
}
pub(crate) fn query(&self) -> Result<Query, Error> {
let mut query = Query::default();
query.push("sort", &self.sort);
query.push("t", &self.t);
query.push("limit", &self.limit);
query.push("freshness", &self.freshness);
query.push("cursor", &self.cursor);
Ok(query)
}
}
pub type RedditTrendingPostsPage = Page<RedditPost>;
#[derive(Clone, Debug, Default, PartialEq)]
#[non_exhaustive]
pub struct TestDataOptions {
pub platform: Option<crate::options::Platform>,
pub resource: Option<String>,
pub operation: Option<String>,
pub traits: Option<String>,
pub status: Option<i64>,
pub error_code: Option<String>,
pub search: Option<String>,
pub limit: Option<i64>,
pub request_options: RequestOptions,
}
impl TestDataOptions {
pub fn new() -> Self {
Self::default()
}
pub fn platform(mut self, value: crate::options::Platform) -> Self {
self.platform = Some(value);
self
}
pub fn resource(mut self, value: impl Into<String>) -> Self {
self.resource = Some(value.into());
self
}
pub fn operation(mut self, value: impl Into<String>) -> Self {
self.operation = Some(value.into());
self
}
pub fn traits(mut self, value: impl Into<String>) -> Self {
self.traits = Some(value.into());
self
}
pub fn status(mut self, value: i64) -> Self {
self.status = Some(value);
self
}
pub fn error_code(mut self, value: impl Into<String>) -> Self {
self.error_code = Some(value.into());
self
}
pub fn search(mut self, value: impl Into<String>) -> Self {
self.search = Some(value.into());
self
}
pub fn limit(mut self, value: i64) -> Self {
self.limit = Some(value);
self
}
pub fn max_retries(mut self, value: u32) -> Self {
self.request_options.max_retries = Some(value);
self
}
pub fn timeout(mut self, value: Duration) -> Self {
self.request_options.timeout = Some(value);
self
}
pub(crate) fn query(&self) -> Result<Query, Error> {
let mut query = Query::default();
query.push("platform", &self.platform);
query.push("resource", &self.resource);
query.push("operation", &self.operation);
query.push("traits", &self.traits);
query.push("status", &self.status);
query.push("errorCode", &self.error_code);
query.push("search", &self.search);
query.push("limit", &self.limit);
Ok(query)
}
}
pub type TestDataResponse = Response<TestDataCatalog>;
#[derive(Clone, Debug, Default, PartialEq)]
#[non_exhaustive]
pub struct TestDataEntryOptions {
pub request_options: RequestOptions,
}
impl TestDataEntryOptions {
pub fn new() -> Self {
Self::default()
}
pub fn max_retries(mut self, value: u32) -> Self {
self.request_options.max_retries = Some(value);
self
}
pub fn timeout(mut self, value: Duration) -> Self {
self.request_options.timeout = Some(value);
self
}
pub(crate) fn query(&self) -> Result<Query, Error> {
Ok(Query::default())
}
}
pub type TestDataEntryResponse = Response<TestDataEntry>;
#[derive(Clone, Debug, Default, PartialEq)]
#[non_exhaustive]
pub struct TikTokEffectOptions {
pub freshness: Option<crate::options::Freshness>,
pub request_options: RequestOptions,
}
impl TikTokEffectOptions {
pub fn new() -> Self {
Self::default()
}
pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
self.freshness = Some(value);
self
}
pub fn max_retries(mut self, value: u32) -> Self {
self.request_options.max_retries = Some(value);
self
}
pub fn timeout(mut self, value: Duration) -> Self {
self.request_options.timeout = Some(value);
self
}
pub(crate) fn query(&self) -> Result<Query, Error> {
let mut query = Query::default();
query.push("freshness", &self.freshness);
Ok(query)
}
}
pub type TikTokEffectResponse = Response<TikTokEffect>;
#[derive(Clone, Debug, Default, PartialEq)]
#[non_exhaustive]
pub struct TikTokEffectPostsOptions {
pub freshness: Option<crate::options::Freshness>,
pub cursor: Option<String>,
pub request_options: RequestOptions,
}
impl TikTokEffectPostsOptions {
pub fn new() -> Self {
Self::default()
}
pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
self.freshness = Some(value);
self
}
pub fn cursor(mut self, value: impl Into<String>) -> Self {
self.cursor = Some(value.into());
self
}
pub fn max_retries(mut self, value: u32) -> Self {
self.request_options.max_retries = Some(value);
self
}
pub fn timeout(mut self, value: Duration) -> Self {
self.request_options.timeout = Some(value);
self
}
pub(crate) fn query(&self) -> Result<Query, Error> {
let mut query = Query::default();
query.push("freshness", &self.freshness);
query.push("cursor", &self.cursor);
Ok(query)
}
}
pub type TikTokEffectPostsPage = Page<TikTokPost>;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub struct TikTokEffectsOptions {
pub ids: String,
pub freshness: Option<crate::options::Freshness>,
pub cursor: Option<String>,
pub request_options: RequestOptions,
}
impl TikTokEffectsOptions {
pub fn new(ids: impl Into<String>) -> Self {
Self {
ids: ids.into(),
freshness: None,
cursor: None,
request_options: RequestOptions::default(),
}
}
pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
self.freshness = Some(value);
self
}
pub fn cursor(mut self, value: impl Into<String>) -> Self {
self.cursor = Some(value.into());
self
}
pub fn max_retries(mut self, value: u32) -> Self {
self.request_options.max_retries = Some(value);
self
}
pub fn timeout(mut self, value: Duration) -> Self {
self.request_options.timeout = Some(value);
self
}
pub(crate) fn query(&self) -> Result<Query, Error> {
let mut query = Query::default();
query.require("ids", &self.ids)?;
query.push("freshness", &self.freshness);
query.push("cursor", &self.cursor);
Ok(query)
}
}
pub type TikTokEffectsPage = Page<TikTokEffect>;
#[derive(Clone, Debug, Default, PartialEq)]
#[non_exhaustive]
pub struct TikTokHashtagOptions {
pub freshness: Option<crate::options::Freshness>,
pub request_options: RequestOptions,
}
impl TikTokHashtagOptions {
pub fn new() -> Self {
Self::default()
}
pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
self.freshness = Some(value);
self
}
pub fn max_retries(mut self, value: u32) -> Self {
self.request_options.max_retries = Some(value);
self
}
pub fn timeout(mut self, value: Duration) -> Self {
self.request_options.timeout = Some(value);
self
}
pub(crate) fn query(&self) -> Result<Query, Error> {
let mut query = Query::default();
query.push("freshness", &self.freshness);
Ok(query)
}
}
pub type TikTokHashtagResponse = Response<TikTokHashtag>;
#[derive(Clone, Debug, Default, PartialEq)]
#[non_exhaustive]
pub struct TikTokHashtagPostsOptions {
pub freshness: Option<crate::options::Freshness>,
pub cursor: Option<String>,
pub request_options: RequestOptions,
}
impl TikTokHashtagPostsOptions {
pub fn new() -> Self {
Self::default()
}
pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
self.freshness = Some(value);
self
}
pub fn cursor(mut self, value: impl Into<String>) -> Self {
self.cursor = Some(value.into());
self
}
pub fn max_retries(mut self, value: u32) -> Self {
self.request_options.max_retries = Some(value);
self
}
pub fn timeout(mut self, value: Duration) -> Self {
self.request_options.timeout = Some(value);
self
}
pub(crate) fn query(&self) -> Result<Query, Error> {
let mut query = Query::default();
query.push("freshness", &self.freshness);
query.push("cursor", &self.cursor);
Ok(query)
}
}
pub type TikTokHashtagPostsPage = Page<TikTokPost>;
#[derive(Clone, Debug, Default, PartialEq)]
#[non_exhaustive]
pub struct TikTokLocationOptions {
pub freshness: Option<crate::options::Freshness>,
pub request_options: RequestOptions,
}
impl TikTokLocationOptions {
pub fn new() -> Self {
Self::default()
}
pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
self.freshness = Some(value);
self
}
pub fn max_retries(mut self, value: u32) -> Self {
self.request_options.max_retries = Some(value);
self
}
pub fn timeout(mut self, value: Duration) -> Self {
self.request_options.timeout = Some(value);
self
}
pub(crate) fn query(&self) -> Result<Query, Error> {
let mut query = Query::default();
query.push("freshness", &self.freshness);
Ok(query)
}
}
pub type TikTokLocationResponse = Response<TikTokLocation>;
#[derive(Clone, Debug, Default, PartialEq)]
#[non_exhaustive]
pub struct TikTokLocationPostsOptions {
pub freshness: Option<crate::options::Freshness>,
pub cursor: Option<String>,
pub request_options: RequestOptions,
}
impl TikTokLocationPostsOptions {
pub fn new() -> Self {
Self::default()
}
pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
self.freshness = Some(value);
self
}
pub fn cursor(mut self, value: impl Into<String>) -> Self {
self.cursor = Some(value.into());
self
}
pub fn max_retries(mut self, value: u32) -> Self {
self.request_options.max_retries = Some(value);
self
}
pub fn timeout(mut self, value: Duration) -> Self {
self.request_options.timeout = Some(value);
self
}
pub(crate) fn query(&self) -> Result<Query, Error> {
let mut query = Query::default();
query.push("freshness", &self.freshness);
query.push("cursor", &self.cursor);
Ok(query)
}
}
pub type TikTokLocationPostsPage = Page<TikTokPost>;
#[derive(Clone, Debug, Default, PartialEq)]
#[non_exhaustive]
pub struct TikTokMusicOptions {
pub freshness: Option<crate::options::Freshness>,
pub request_options: RequestOptions,
}
impl TikTokMusicOptions {
pub fn new() -> Self {
Self::default()
}
pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
self.freshness = Some(value);
self
}
pub fn max_retries(mut self, value: u32) -> Self {
self.request_options.max_retries = Some(value);
self
}
pub fn timeout(mut self, value: Duration) -> Self {
self.request_options.timeout = Some(value);
self
}
pub(crate) fn query(&self) -> Result<Query, Error> {
let mut query = Query::default();
query.push("freshness", &self.freshness);
Ok(query)
}
}
pub type TikTokMusicResponse = Response<TikTokMusic>;
#[derive(Clone, Debug, Default, PartialEq)]
#[non_exhaustive]
pub struct TikTokMusicPostsOptions {
pub freshness: Option<crate::options::Freshness>,
pub cursor: Option<String>,
pub request_options: RequestOptions,
}
impl TikTokMusicPostsOptions {
pub fn new() -> Self {
Self::default()
}
pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
self.freshness = Some(value);
self
}
pub fn cursor(mut self, value: impl Into<String>) -> Self {
self.cursor = Some(value.into());
self
}
pub fn max_retries(mut self, value: u32) -> Self {
self.request_options.max_retries = Some(value);
self
}
pub fn timeout(mut self, value: Duration) -> Self {
self.request_options.timeout = Some(value);
self
}
pub(crate) fn query(&self) -> Result<Query, Error> {
let mut query = Query::default();
query.push("freshness", &self.freshness);
query.push("cursor", &self.cursor);
Ok(query)
}
}
pub type TikTokMusicPostsPage = Page<TikTokPost>;
#[derive(Clone, Debug, Default, PartialEq)]
#[non_exhaustive]
pub struct TikTokPostOptions {
pub freshness: Option<crate::options::Freshness>,
pub request_options: RequestOptions,
}
impl TikTokPostOptions {
pub fn new() -> Self {
Self::default()
}
pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
self.freshness = Some(value);
self
}
pub fn max_retries(mut self, value: u32) -> Self {
self.request_options.max_retries = Some(value);
self
}
pub fn timeout(mut self, value: Duration) -> Self {
self.request_options.timeout = Some(value);
self
}
pub(crate) fn query(&self) -> Result<Query, Error> {
let mut query = Query::default();
query.push("freshness", &self.freshness);
Ok(query)
}
}
pub type TikTokPostResponse = Response<TikTokPost>;
#[derive(Clone, Debug, Default, PartialEq)]
#[non_exhaustive]
pub struct TikTokPostCommentRepliesOptions {
pub freshness: Option<crate::options::Freshness>,
pub cursor: Option<String>,
pub request_options: RequestOptions,
}
impl TikTokPostCommentRepliesOptions {
pub fn new() -> Self {
Self::default()
}
pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
self.freshness = Some(value);
self
}
pub fn cursor(mut self, value: impl Into<String>) -> Self {
self.cursor = Some(value.into());
self
}
pub fn max_retries(mut self, value: u32) -> Self {
self.request_options.max_retries = Some(value);
self
}
pub fn timeout(mut self, value: Duration) -> Self {
self.request_options.timeout = Some(value);
self
}
pub(crate) fn query(&self) -> Result<Query, Error> {
let mut query = Query::default();
query.push("freshness", &self.freshness);
query.push("cursor", &self.cursor);
Ok(query)
}
}
pub type TikTokPostCommentRepliesPage = Page<TikTokComment>;
#[derive(Clone, Debug, Default, PartialEq)]
#[non_exhaustive]
pub struct TikTokPostCommentsOptions {
pub freshness: Option<crate::options::Freshness>,
pub cursor: Option<String>,
pub request_options: RequestOptions,
}
impl TikTokPostCommentsOptions {
pub fn new() -> Self {
Self::default()
}
pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
self.freshness = Some(value);
self
}
pub fn cursor(mut self, value: impl Into<String>) -> Self {
self.cursor = Some(value.into());
self
}
pub fn max_retries(mut self, value: u32) -> Self {
self.request_options.max_retries = Some(value);
self
}
pub fn timeout(mut self, value: Duration) -> Self {
self.request_options.timeout = Some(value);
self
}
pub(crate) fn query(&self) -> Result<Query, Error> {
let mut query = Query::default();
query.push("freshness", &self.freshness);
query.push("cursor", &self.cursor);
Ok(query)
}
}
pub type TikTokPostCommentsPage = Page<TikTokComment>;
#[derive(Clone, Debug, Default, PartialEq)]
#[non_exhaustive]
pub struct TikTokProfileOptions {
pub freshness: Option<crate::options::Freshness>,
pub request_options: RequestOptions,
}
impl TikTokProfileOptions {
pub fn new() -> Self {
Self::default()
}
pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
self.freshness = Some(value);
self
}
pub fn max_retries(mut self, value: u32) -> Self {
self.request_options.max_retries = Some(value);
self
}
pub fn timeout(mut self, value: Duration) -> Self {
self.request_options.timeout = Some(value);
self
}
pub(crate) fn query(&self) -> Result<Query, Error> {
let mut query = Query::default();
query.push("freshness", &self.freshness);
Ok(query)
}
}
pub type TikTokProfileResponse = Response<TikTokProfile>;
#[derive(Clone, Debug, Default, PartialEq)]
#[non_exhaustive]
pub struct TikTokProfileFollowersOptions {
pub freshness: Option<crate::options::Freshness>,
pub cursor: Option<String>,
pub request_options: RequestOptions,
}
impl TikTokProfileFollowersOptions {
pub fn new() -> Self {
Self::default()
}
pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
self.freshness = Some(value);
self
}
pub fn cursor(mut self, value: impl Into<String>) -> Self {
self.cursor = Some(value.into());
self
}
pub fn max_retries(mut self, value: u32) -> Self {
self.request_options.max_retries = Some(value);
self
}
pub fn timeout(mut self, value: Duration) -> Self {
self.request_options.timeout = Some(value);
self
}
pub(crate) fn query(&self) -> Result<Query, Error> {
let mut query = Query::default();
query.push("freshness", &self.freshness);
query.push("cursor", &self.cursor);
Ok(query)
}
}
pub type TikTokProfileFollowersPage = Page<TikTokProfile>;
#[derive(Clone, Debug, Default, PartialEq)]
#[non_exhaustive]
pub struct TikTokProfileFollowingOptions {
pub freshness: Option<crate::options::Freshness>,
pub cursor: Option<String>,
pub request_options: RequestOptions,
}
impl TikTokProfileFollowingOptions {
pub fn new() -> Self {
Self::default()
}
pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
self.freshness = Some(value);
self
}
pub fn cursor(mut self, value: impl Into<String>) -> Self {
self.cursor = Some(value.into());
self
}
pub fn max_retries(mut self, value: u32) -> Self {
self.request_options.max_retries = Some(value);
self
}
pub fn timeout(mut self, value: Duration) -> Self {
self.request_options.timeout = Some(value);
self
}
pub(crate) fn query(&self) -> Result<Query, Error> {
let mut query = Query::default();
query.push("freshness", &self.freshness);
query.push("cursor", &self.cursor);
Ok(query)
}
}
pub type TikTokProfileFollowingPage = Page<TikTokProfile>;
#[derive(Clone, Debug, Default, PartialEq)]
#[non_exhaustive]
pub struct TikTokProfileLikedPostsOptions {
pub freshness: Option<crate::options::Freshness>,
pub cursor: Option<String>,
pub request_options: RequestOptions,
}
impl TikTokProfileLikedPostsOptions {
pub fn new() -> Self {
Self::default()
}
pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
self.freshness = Some(value);
self
}
pub fn cursor(mut self, value: impl Into<String>) -> Self {
self.cursor = Some(value.into());
self
}
pub fn max_retries(mut self, value: u32) -> Self {
self.request_options.max_retries = Some(value);
self
}
pub fn timeout(mut self, value: Duration) -> Self {
self.request_options.timeout = Some(value);
self
}
pub(crate) fn query(&self) -> Result<Query, Error> {
let mut query = Query::default();
query.push("freshness", &self.freshness);
query.push("cursor", &self.cursor);
Ok(query)
}
}
pub type TikTokProfileLikedPostsPage = Page<TikTokPost>;
#[derive(Clone, Debug, Default, PartialEq)]
#[non_exhaustive]
pub struct TikTokProfilePlaylistOptions {
pub freshness: Option<crate::options::Freshness>,
pub request_options: RequestOptions,
}
impl TikTokProfilePlaylistOptions {
pub fn new() -> Self {
Self::default()
}
pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
self.freshness = Some(value);
self
}
pub fn max_retries(mut self, value: u32) -> Self {
self.request_options.max_retries = Some(value);
self
}
pub fn timeout(mut self, value: Duration) -> Self {
self.request_options.timeout = Some(value);
self
}
pub(crate) fn query(&self) -> Result<Query, Error> {
let mut query = Query::default();
query.push("freshness", &self.freshness);
Ok(query)
}
}
pub type TikTokProfilePlaylistResponse = Response<TikTokPlaylist>;
#[derive(Clone, Debug, Default, PartialEq)]
#[non_exhaustive]
pub struct TikTokProfilePlaylistPostsOptions {
pub freshness: Option<crate::options::Freshness>,
pub cursor: Option<String>,
pub request_options: RequestOptions,
}
impl TikTokProfilePlaylistPostsOptions {
pub fn new() -> Self {
Self::default()
}
pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
self.freshness = Some(value);
self
}
pub fn cursor(mut self, value: impl Into<String>) -> Self {
self.cursor = Some(value.into());
self
}
pub fn max_retries(mut self, value: u32) -> Self {
self.request_options.max_retries = Some(value);
self
}
pub fn timeout(mut self, value: Duration) -> Self {
self.request_options.timeout = Some(value);
self
}
pub(crate) fn query(&self) -> Result<Query, Error> {
let mut query = Query::default();
query.push("freshness", &self.freshness);
query.push("cursor", &self.cursor);
Ok(query)
}
}
pub type TikTokProfilePlaylistPostsPage = Page<TikTokPost>;
#[derive(Clone, Debug, Default, PartialEq)]
#[non_exhaustive]
pub struct TikTokProfilePlaylistsOptions {
pub freshness: Option<crate::options::Freshness>,
pub cursor: Option<String>,
pub request_options: RequestOptions,
}
impl TikTokProfilePlaylistsOptions {
pub fn new() -> Self {
Self::default()
}
pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
self.freshness = Some(value);
self
}
pub fn cursor(mut self, value: impl Into<String>) -> Self {
self.cursor = Some(value.into());
self
}
pub fn max_retries(mut self, value: u32) -> Self {
self.request_options.max_retries = Some(value);
self
}
pub fn timeout(mut self, value: Duration) -> Self {
self.request_options.timeout = Some(value);
self
}
pub(crate) fn query(&self) -> Result<Query, Error> {
let mut query = Query::default();
query.push("freshness", &self.freshness);
query.push("cursor", &self.cursor);
Ok(query)
}
}
pub type TikTokProfilePlaylistsPage = Page<TikTokPlaylist>;
#[derive(Clone, Debug, Default, PartialEq)]
#[non_exhaustive]
pub struct TikTokProfilePostsOptions {
pub freshness: Option<crate::options::Freshness>,
pub cursor: Option<String>,
pub since: Option<chrono::DateTime<chrono::Utc>>,
pub request_options: RequestOptions,
}
impl TikTokProfilePostsOptions {
pub fn new() -> Self {
Self::default()
}
pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
self.freshness = Some(value);
self
}
pub fn cursor(mut self, value: impl Into<String>) -> Self {
self.cursor = Some(value.into());
self
}
pub fn since(mut self, value: chrono::DateTime<chrono::Utc>) -> Self {
self.since = Some(value);
self
}
pub fn max_retries(mut self, value: u32) -> Self {
self.request_options.max_retries = Some(value);
self
}
pub fn timeout(mut self, value: Duration) -> Self {
self.request_options.timeout = Some(value);
self
}
pub(crate) fn query(&self) -> Result<Query, Error> {
let mut query = Query::default();
query.push("freshness", &self.freshness);
query.push("cursor", &self.cursor);
query.push("since", &self.since);
Ok(query)
}
}
pub type TikTokProfilePostsPage = Page<TikTokPost>;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub struct TikTokSearchHashtagsOptions {
pub q: String,
pub freshness: Option<crate::options::Freshness>,
pub cursor: Option<String>,
pub request_options: RequestOptions,
}
impl TikTokSearchHashtagsOptions {
pub fn new(q: impl Into<String>) -> Self {
Self {
q: q.into(),
freshness: None,
cursor: None,
request_options: RequestOptions::default(),
}
}
pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
self.freshness = Some(value);
self
}
pub fn cursor(mut self, value: impl Into<String>) -> Self {
self.cursor = Some(value.into());
self
}
pub fn max_retries(mut self, value: u32) -> Self {
self.request_options.max_retries = Some(value);
self
}
pub fn timeout(mut self, value: Duration) -> Self {
self.request_options.timeout = Some(value);
self
}
pub(crate) fn query(&self) -> Result<Query, Error> {
let mut query = Query::default();
query.require("q", &self.q)?;
query.push("freshness", &self.freshness);
query.push("cursor", &self.cursor);
Ok(query)
}
}
pub type TikTokSearchHashtagsPage = Page<TikTokHashtag>;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub struct TikTokSearchLocationsOptions {
pub q: String,
pub freshness: Option<crate::options::Freshness>,
pub cursor: Option<String>,
pub request_options: RequestOptions,
}
impl TikTokSearchLocationsOptions {
pub fn new(q: impl Into<String>) -> Self {
Self {
q: q.into(),
freshness: None,
cursor: None,
request_options: RequestOptions::default(),
}
}
pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
self.freshness = Some(value);
self
}
pub fn cursor(mut self, value: impl Into<String>) -> Self {
self.cursor = Some(value.into());
self
}
pub fn max_retries(mut self, value: u32) -> Self {
self.request_options.max_retries = Some(value);
self
}
pub fn timeout(mut self, value: Duration) -> Self {
self.request_options.timeout = Some(value);
self
}
pub(crate) fn query(&self) -> Result<Query, Error> {
let mut query = Query::default();
query.require("q", &self.q)?;
query.push("freshness", &self.freshness);
query.push("cursor", &self.cursor);
Ok(query)
}
}
pub type TikTokSearchLocationsPage = Page<TikTokLocation>;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub struct TikTokSearchMusicOptions {
pub q: String,
pub freshness: Option<crate::options::Freshness>,
pub cursor: Option<String>,
pub request_options: RequestOptions,
}
impl TikTokSearchMusicOptions {
pub fn new(q: impl Into<String>) -> Self {
Self {
q: q.into(),
freshness: None,
cursor: None,
request_options: RequestOptions::default(),
}
}
pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
self.freshness = Some(value);
self
}
pub fn cursor(mut self, value: impl Into<String>) -> Self {
self.cursor = Some(value.into());
self
}
pub fn max_retries(mut self, value: u32) -> Self {
self.request_options.max_retries = Some(value);
self
}
pub fn timeout(mut self, value: Duration) -> Self {
self.request_options.timeout = Some(value);
self
}
pub(crate) fn query(&self) -> Result<Query, Error> {
let mut query = Query::default();
query.require("q", &self.q)?;
query.push("freshness", &self.freshness);
query.push("cursor", &self.cursor);
Ok(query)
}
}
pub type TikTokSearchMusicPage = Page<TikTokMusic>;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub struct TikTokSearchPostsOptions {
pub q: String,
pub freshness: Option<crate::options::Freshness>,
pub cursor: Option<String>,
pub request_options: RequestOptions,
}
impl TikTokSearchPostsOptions {
pub fn new(q: impl Into<String>) -> Self {
Self {
q: q.into(),
freshness: None,
cursor: None,
request_options: RequestOptions::default(),
}
}
pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
self.freshness = Some(value);
self
}
pub fn cursor(mut self, value: impl Into<String>) -> Self {
self.cursor = Some(value.into());
self
}
pub fn max_retries(mut self, value: u32) -> Self {
self.request_options.max_retries = Some(value);
self
}
pub fn timeout(mut self, value: Duration) -> Self {
self.request_options.timeout = Some(value);
self
}
pub(crate) fn query(&self) -> Result<Query, Error> {
let mut query = Query::default();
query.require("q", &self.q)?;
query.push("freshness", &self.freshness);
query.push("cursor", &self.cursor);
Ok(query)
}
}
pub type TikTokSearchPostsPage = Page<TikTokPost>;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub struct TikTokSearchProfilesOptions {
pub q: String,
pub freshness: Option<crate::options::Freshness>,
pub cursor: Option<String>,
pub request_options: RequestOptions,
}
impl TikTokSearchProfilesOptions {
pub fn new(q: impl Into<String>) -> Self {
Self {
q: q.into(),
freshness: None,
cursor: None,
request_options: RequestOptions::default(),
}
}
pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
self.freshness = Some(value);
self
}
pub fn cursor(mut self, value: impl Into<String>) -> Self {
self.cursor = Some(value.into());
self
}
pub fn max_retries(mut self, value: u32) -> Self {
self.request_options.max_retries = Some(value);
self
}
pub fn timeout(mut self, value: Duration) -> Self {
self.request_options.timeout = Some(value);
self
}
pub(crate) fn query(&self) -> Result<Query, Error> {
let mut query = Query::default();
query.require("q", &self.q)?;
query.push("freshness", &self.freshness);
query.push("cursor", &self.cursor);
Ok(query)
}
}
pub type TikTokSearchProfilesPage = Page<TikTokProfile>;
#[derive(Clone, Debug, Default, PartialEq)]
#[non_exhaustive]
pub struct TikTokTrendingCategoriesOptions {
pub freshness: Option<crate::options::Freshness>,
pub cursor: Option<String>,
pub request_options: RequestOptions,
}
impl TikTokTrendingCategoriesOptions {
pub fn new() -> Self {
Self::default()
}
pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
self.freshness = Some(value);
self
}
pub fn cursor(mut self, value: impl Into<String>) -> Self {
self.cursor = Some(value.into());
self
}
pub fn max_retries(mut self, value: u32) -> Self {
self.request_options.max_retries = Some(value);
self
}
pub fn timeout(mut self, value: Duration) -> Self {
self.request_options.timeout = Some(value);
self
}
pub(crate) fn query(&self) -> Result<Query, Error> {
let mut query = Query::default();
query.push("freshness", &self.freshness);
query.push("cursor", &self.cursor);
Ok(query)
}
}
pub type TikTokTrendingCategoriesPage = Page<TikTokCategory>;
#[derive(Clone, Debug, Default, PartialEq)]
#[non_exhaustive]
pub struct TikTokTrendingMusicOptions {
pub freshness: Option<crate::options::Freshness>,
pub cursor: Option<String>,
pub request_options: RequestOptions,
}
impl TikTokTrendingMusicOptions {
pub fn new() -> Self {
Self::default()
}
pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
self.freshness = Some(value);
self
}
pub fn cursor(mut self, value: impl Into<String>) -> Self {
self.cursor = Some(value.into());
self
}
pub fn max_retries(mut self, value: u32) -> Self {
self.request_options.max_retries = Some(value);
self
}
pub fn timeout(mut self, value: Duration) -> Self {
self.request_options.timeout = Some(value);
self
}
pub(crate) fn query(&self) -> Result<Query, Error> {
let mut query = Query::default();
query.push("freshness", &self.freshness);
query.push("cursor", &self.cursor);
Ok(query)
}
}
pub type TikTokTrendingMusicPage = Page<TikTokMusic>;
#[derive(Clone, Debug, Default, PartialEq)]
#[non_exhaustive]
pub struct TikTokTrendingPostsOptions {
pub freshness: Option<crate::options::Freshness>,
pub cursor: Option<String>,
pub request_options: RequestOptions,
}
impl TikTokTrendingPostsOptions {
pub fn new() -> Self {
Self::default()
}
pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
self.freshness = Some(value);
self
}
pub fn cursor(mut self, value: impl Into<String>) -> Self {
self.cursor = Some(value.into());
self
}
pub fn max_retries(mut self, value: u32) -> Self {
self.request_options.max_retries = Some(value);
self
}
pub fn timeout(mut self, value: Duration) -> Self {
self.request_options.timeout = Some(value);
self
}
pub(crate) fn query(&self) -> Result<Query, Error> {
let mut query = Query::default();
query.push("freshness", &self.freshness);
query.push("cursor", &self.cursor);
Ok(query)
}
}
pub type TikTokTrendingPostsPage = Page<TikTokPost>;
#[derive(Clone, Debug, Default, PartialEq)]
#[non_exhaustive]
pub struct TwitterListPostsOptions {
pub freshness: Option<crate::options::Freshness>,
pub cursor: Option<String>,
pub request_options: RequestOptions,
}
impl TwitterListPostsOptions {
pub fn new() -> Self {
Self::default()
}
pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
self.freshness = Some(value);
self
}
pub fn cursor(mut self, value: impl Into<String>) -> Self {
self.cursor = Some(value.into());
self
}
pub fn max_retries(mut self, value: u32) -> Self {
self.request_options.max_retries = Some(value);
self
}
pub fn timeout(mut self, value: Duration) -> Self {
self.request_options.timeout = Some(value);
self
}
pub(crate) fn query(&self) -> Result<Query, Error> {
let mut query = Query::default();
query.push("freshness", &self.freshness);
query.push("cursor", &self.cursor);
Ok(query)
}
}
pub type TwitterListPostsPage = Page<TwitterPost>;
#[derive(Clone, Debug, Default, PartialEq)]
#[non_exhaustive]
pub struct TwitterPostOptions {
pub freshness: Option<crate::options::Freshness>,
pub request_options: RequestOptions,
}
impl TwitterPostOptions {
pub fn new() -> Self {
Self::default()
}
pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
self.freshness = Some(value);
self
}
pub fn max_retries(mut self, value: u32) -> Self {
self.request_options.max_retries = Some(value);
self
}
pub fn timeout(mut self, value: Duration) -> Self {
self.request_options.timeout = Some(value);
self
}
pub(crate) fn query(&self) -> Result<Query, Error> {
let mut query = Query::default();
query.push("freshness", &self.freshness);
Ok(query)
}
}
pub type TwitterPostResponse = Response<TwitterPost>;
#[derive(Clone, Debug, Default, PartialEq)]
#[non_exhaustive]
pub struct TwitterPostCommentRepliesOptions {
pub freshness: Option<crate::options::Freshness>,
pub cursor: Option<String>,
pub request_options: RequestOptions,
}
impl TwitterPostCommentRepliesOptions {
pub fn new() -> Self {
Self::default()
}
pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
self.freshness = Some(value);
self
}
pub fn cursor(mut self, value: impl Into<String>) -> Self {
self.cursor = Some(value.into());
self
}
pub fn max_retries(mut self, value: u32) -> Self {
self.request_options.max_retries = Some(value);
self
}
pub fn timeout(mut self, value: Duration) -> Self {
self.request_options.timeout = Some(value);
self
}
pub(crate) fn query(&self) -> Result<Query, Error> {
let mut query = Query::default();
query.push("freshness", &self.freshness);
query.push("cursor", &self.cursor);
Ok(query)
}
}
pub type TwitterPostCommentRepliesPage = Page<TwitterPost>;
#[derive(Clone, Debug, Default, PartialEq)]
#[non_exhaustive]
pub struct TwitterPostCommentsOptions {
pub freshness: Option<crate::options::Freshness>,
pub cursor: Option<String>,
pub request_options: RequestOptions,
}
impl TwitterPostCommentsOptions {
pub fn new() -> Self {
Self::default()
}
pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
self.freshness = Some(value);
self
}
pub fn cursor(mut self, value: impl Into<String>) -> Self {
self.cursor = Some(value.into());
self
}
pub fn max_retries(mut self, value: u32) -> Self {
self.request_options.max_retries = Some(value);
self
}
pub fn timeout(mut self, value: Duration) -> Self {
self.request_options.timeout = Some(value);
self
}
pub(crate) fn query(&self) -> Result<Query, Error> {
let mut query = Query::default();
query.push("freshness", &self.freshness);
query.push("cursor", &self.cursor);
Ok(query)
}
}
pub type TwitterPostCommentsPage = Page<TwitterPost>;
#[derive(Clone, Debug, Default, PartialEq)]
#[non_exhaustive]
pub struct TwitterPostRepostersOptions {
pub freshness: Option<crate::options::Freshness>,
pub cursor: Option<String>,
pub request_options: RequestOptions,
}
impl TwitterPostRepostersOptions {
pub fn new() -> Self {
Self::default()
}
pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
self.freshness = Some(value);
self
}
pub fn cursor(mut self, value: impl Into<String>) -> Self {
self.cursor = Some(value.into());
self
}
pub fn max_retries(mut self, value: u32) -> Self {
self.request_options.max_retries = Some(value);
self
}
pub fn timeout(mut self, value: Duration) -> Self {
self.request_options.timeout = Some(value);
self
}
pub(crate) fn query(&self) -> Result<Query, Error> {
let mut query = Query::default();
query.push("freshness", &self.freshness);
query.push("cursor", &self.cursor);
Ok(query)
}
}
pub type TwitterPostRepostersPage = Page<TwitterProfile>;
#[derive(Clone, Debug, Default, PartialEq)]
#[non_exhaustive]
pub struct TwitterProfileOptions {
pub freshness: Option<crate::options::Freshness>,
pub request_options: RequestOptions,
}
impl TwitterProfileOptions {
pub fn new() -> Self {
Self::default()
}
pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
self.freshness = Some(value);
self
}
pub fn max_retries(mut self, value: u32) -> Self {
self.request_options.max_retries = Some(value);
self
}
pub fn timeout(mut self, value: Duration) -> Self {
self.request_options.timeout = Some(value);
self
}
pub(crate) fn query(&self) -> Result<Query, Error> {
let mut query = Query::default();
query.push("freshness", &self.freshness);
Ok(query)
}
}
pub type TwitterProfileResponse = Response<TwitterProfile>;
#[derive(Clone, Debug, Default, PartialEq)]
#[non_exhaustive]
pub struct TwitterProfileFollowersOptions {
pub freshness: Option<crate::options::Freshness>,
pub cursor: Option<String>,
pub request_options: RequestOptions,
}
impl TwitterProfileFollowersOptions {
pub fn new() -> Self {
Self::default()
}
pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
self.freshness = Some(value);
self
}
pub fn cursor(mut self, value: impl Into<String>) -> Self {
self.cursor = Some(value.into());
self
}
pub fn max_retries(mut self, value: u32) -> Self {
self.request_options.max_retries = Some(value);
self
}
pub fn timeout(mut self, value: Duration) -> Self {
self.request_options.timeout = Some(value);
self
}
pub(crate) fn query(&self) -> Result<Query, Error> {
let mut query = Query::default();
query.push("freshness", &self.freshness);
query.push("cursor", &self.cursor);
Ok(query)
}
}
pub type TwitterProfileFollowersPage = Page<TwitterProfile>;
#[derive(Clone, Debug, Default, PartialEq)]
#[non_exhaustive]
pub struct TwitterProfileFollowingOptions {
pub freshness: Option<crate::options::Freshness>,
pub cursor: Option<String>,
pub request_options: RequestOptions,
}
impl TwitterProfileFollowingOptions {
pub fn new() -> Self {
Self::default()
}
pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
self.freshness = Some(value);
self
}
pub fn cursor(mut self, value: impl Into<String>) -> Self {
self.cursor = Some(value.into());
self
}
pub fn max_retries(mut self, value: u32) -> Self {
self.request_options.max_retries = Some(value);
self
}
pub fn timeout(mut self, value: Duration) -> Self {
self.request_options.timeout = Some(value);
self
}
pub(crate) fn query(&self) -> Result<Query, Error> {
let mut query = Query::default();
query.push("freshness", &self.freshness);
query.push("cursor", &self.cursor);
Ok(query)
}
}
pub type TwitterProfileFollowingPage = Page<TwitterProfile>;
#[derive(Clone, Debug, Default, PartialEq)]
#[non_exhaustive]
pub struct TwitterProfileMediaOptions {
pub freshness: Option<crate::options::Freshness>,
pub cursor: Option<String>,
pub request_options: RequestOptions,
}
impl TwitterProfileMediaOptions {
pub fn new() -> Self {
Self::default()
}
pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
self.freshness = Some(value);
self
}
pub fn cursor(mut self, value: impl Into<String>) -> Self {
self.cursor = Some(value.into());
self
}
pub fn max_retries(mut self, value: u32) -> Self {
self.request_options.max_retries = Some(value);
self
}
pub fn timeout(mut self, value: Duration) -> Self {
self.request_options.timeout = Some(value);
self
}
pub(crate) fn query(&self) -> Result<Query, Error> {
let mut query = Query::default();
query.push("freshness", &self.freshness);
query.push("cursor", &self.cursor);
Ok(query)
}
}
pub type TwitterProfileMediaPage = Page<TwitterPost>;
#[derive(Clone, Debug, Default, PartialEq)]
#[non_exhaustive]
pub struct TwitterProfilePostsOptions {
pub freshness: Option<crate::options::Freshness>,
pub cursor: Option<String>,
pub since: Option<chrono::DateTime<chrono::Utc>>,
pub request_options: RequestOptions,
}
impl TwitterProfilePostsOptions {
pub fn new() -> Self {
Self::default()
}
pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
self.freshness = Some(value);
self
}
pub fn cursor(mut self, value: impl Into<String>) -> Self {
self.cursor = Some(value.into());
self
}
pub fn since(mut self, value: chrono::DateTime<chrono::Utc>) -> Self {
self.since = Some(value);
self
}
pub fn max_retries(mut self, value: u32) -> Self {
self.request_options.max_retries = Some(value);
self
}
pub fn timeout(mut self, value: Duration) -> Self {
self.request_options.timeout = Some(value);
self
}
pub(crate) fn query(&self) -> Result<Query, Error> {
let mut query = Query::default();
query.push("freshness", &self.freshness);
query.push("cursor", &self.cursor);
query.push("since", &self.since);
Ok(query)
}
}
pub type TwitterProfilePostsPage = Page<TwitterPost>;
#[derive(Clone, Debug, Default, PartialEq)]
#[non_exhaustive]
pub struct TwitterProfileRepliesOptions {
pub freshness: Option<crate::options::Freshness>,
pub cursor: Option<String>,
pub request_options: RequestOptions,
}
impl TwitterProfileRepliesOptions {
pub fn new() -> Self {
Self::default()
}
pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
self.freshness = Some(value);
self
}
pub fn cursor(mut self, value: impl Into<String>) -> Self {
self.cursor = Some(value.into());
self
}
pub fn max_retries(mut self, value: u32) -> Self {
self.request_options.max_retries = Some(value);
self
}
pub fn timeout(mut self, value: Duration) -> Self {
self.request_options.timeout = Some(value);
self
}
pub(crate) fn query(&self) -> Result<Query, Error> {
let mut query = Query::default();
query.push("freshness", &self.freshness);
query.push("cursor", &self.cursor);
Ok(query)
}
}
pub type TwitterProfileRepliesPage = Page<TwitterPost>;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub struct TwitterSearchMediaOptions {
pub q: String,
pub r#type: String,
pub freshness: Option<crate::options::Freshness>,
pub cursor: Option<String>,
pub request_options: RequestOptions,
}
impl TwitterSearchMediaOptions {
pub fn new(q: impl Into<String>, r#type: impl Into<String>) -> Self {
Self {
q: q.into(),
r#type: r#type.into(),
freshness: None,
cursor: None,
request_options: RequestOptions::default(),
}
}
pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
self.freshness = Some(value);
self
}
pub fn cursor(mut self, value: impl Into<String>) -> Self {
self.cursor = Some(value.into());
self
}
pub fn max_retries(mut self, value: u32) -> Self {
self.request_options.max_retries = Some(value);
self
}
pub fn timeout(mut self, value: Duration) -> Self {
self.request_options.timeout = Some(value);
self
}
pub(crate) fn query(&self) -> Result<Query, Error> {
let mut query = Query::default();
query.require("q", &self.q)?;
query.require("type", &self.r#type)?;
query.push("freshness", &self.freshness);
query.push("cursor", &self.cursor);
Ok(query)
}
}
pub type TwitterSearchMediaPage = Page<TwitterPost>;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub struct TwitterSearchPostsOptions {
pub q: String,
pub sort: Option<String>,
pub freshness: Option<crate::options::Freshness>,
pub cursor: Option<String>,
pub request_options: RequestOptions,
}
impl TwitterSearchPostsOptions {
pub fn new(q: impl Into<String>) -> Self {
Self {
q: q.into(),
sort: None,
freshness: None,
cursor: None,
request_options: RequestOptions::default(),
}
}
pub fn sort(mut self, value: impl Into<String>) -> Self {
self.sort = Some(value.into());
self
}
pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
self.freshness = Some(value);
self
}
pub fn cursor(mut self, value: impl Into<String>) -> Self {
self.cursor = Some(value.into());
self
}
pub fn max_retries(mut self, value: u32) -> Self {
self.request_options.max_retries = Some(value);
self
}
pub fn timeout(mut self, value: Duration) -> Self {
self.request_options.timeout = Some(value);
self
}
pub(crate) fn query(&self) -> Result<Query, Error> {
let mut query = Query::default();
query.require("q", &self.q)?;
query.push("sort", &self.sort);
query.push("freshness", &self.freshness);
query.push("cursor", &self.cursor);
Ok(query)
}
}
pub type TwitterSearchPostsPage = Page<TwitterPost>;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub struct TwitterSearchSuggestionsOptions {
pub q: String,
pub freshness: Option<crate::options::Freshness>,
pub cursor: Option<String>,
pub request_options: RequestOptions,
}
impl TwitterSearchSuggestionsOptions {
pub fn new(q: impl Into<String>) -> Self {
Self {
q: q.into(),
freshness: None,
cursor: None,
request_options: RequestOptions::default(),
}
}
pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
self.freshness = Some(value);
self
}
pub fn cursor(mut self, value: impl Into<String>) -> Self {
self.cursor = Some(value.into());
self
}
pub fn max_retries(mut self, value: u32) -> Self {
self.request_options.max_retries = Some(value);
self
}
pub fn timeout(mut self, value: Duration) -> Self {
self.request_options.timeout = Some(value);
self
}
pub(crate) fn query(&self) -> Result<Query, Error> {
let mut query = Query::default();
query.require("q", &self.q)?;
query.push("freshness", &self.freshness);
query.push("cursor", &self.cursor);
Ok(query)
}
}
pub type TwitterSearchSuggestionsPage = Page<TwitterProfile>;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub struct TwitterSearchUsersOptions {
pub q: String,
pub freshness: Option<crate::options::Freshness>,
pub cursor: Option<String>,
pub request_options: RequestOptions,
}
impl TwitterSearchUsersOptions {
pub fn new(q: impl Into<String>) -> Self {
Self {
q: q.into(),
freshness: None,
cursor: None,
request_options: RequestOptions::default(),
}
}
pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
self.freshness = Some(value);
self
}
pub fn cursor(mut self, value: impl Into<String>) -> Self {
self.cursor = Some(value.into());
self
}
pub fn max_retries(mut self, value: u32) -> Self {
self.request_options.max_retries = Some(value);
self
}
pub fn timeout(mut self, value: Duration) -> Self {
self.request_options.timeout = Some(value);
self
}
pub(crate) fn query(&self) -> Result<Query, Error> {
let mut query = Query::default();
query.require("q", &self.q)?;
query.push("freshness", &self.freshness);
query.push("cursor", &self.cursor);
Ok(query)
}
}
pub type TwitterSearchUsersPage = Page<TwitterProfile>;
#[derive(Clone, Debug, Default, PartialEq)]
#[non_exhaustive]
pub struct YouTubeChartsArtistsOptions {
pub country: Option<String>,
pub freshness: Option<crate::options::Freshness>,
pub request_options: RequestOptions,
}
impl YouTubeChartsArtistsOptions {
pub fn new() -> Self {
Self::default()
}
pub fn country(mut self, value: impl Into<String>) -> Self {
self.country = Some(value.into());
self
}
pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
self.freshness = Some(value);
self
}
pub fn max_retries(mut self, value: u32) -> Self {
self.request_options.max_retries = Some(value);
self
}
pub fn timeout(mut self, value: Duration) -> Self {
self.request_options.timeout = Some(value);
self
}
pub(crate) fn query(&self) -> Result<Query, Error> {
let mut query = Query::default();
query.push("country", &self.country);
query.push("freshness", &self.freshness);
Ok(query)
}
}
pub type YouTubeChartsArtistsResponse = Response<Vec<YouTubeChartEntry>>;
#[derive(Clone, Debug, Default, PartialEq)]
#[non_exhaustive]
pub struct YouTubeChartsTracksOptions {
pub country: Option<String>,
pub freshness: Option<crate::options::Freshness>,
pub request_options: RequestOptions,
}
impl YouTubeChartsTracksOptions {
pub fn new() -> Self {
Self::default()
}
pub fn country(mut self, value: impl Into<String>) -> Self {
self.country = Some(value.into());
self
}
pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
self.freshness = Some(value);
self
}
pub fn max_retries(mut self, value: u32) -> Self {
self.request_options.max_retries = Some(value);
self
}
pub fn timeout(mut self, value: Duration) -> Self {
self.request_options.timeout = Some(value);
self
}
pub(crate) fn query(&self) -> Result<Query, Error> {
let mut query = Query::default();
query.push("country", &self.country);
query.push("freshness", &self.freshness);
Ok(query)
}
}
pub type YouTubeChartsTracksResponse = Response<Vec<YouTubeChartEntry>>;
#[derive(Clone, Debug, Default, PartialEq)]
#[non_exhaustive]
pub struct YouTubeChartsVideosOptions {
pub country: Option<String>,
pub freshness: Option<crate::options::Freshness>,
pub request_options: RequestOptions,
}
impl YouTubeChartsVideosOptions {
pub fn new() -> Self {
Self::default()
}
pub fn country(mut self, value: impl Into<String>) -> Self {
self.country = Some(value.into());
self
}
pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
self.freshness = Some(value);
self
}
pub fn max_retries(mut self, value: u32) -> Self {
self.request_options.max_retries = Some(value);
self
}
pub fn timeout(mut self, value: Duration) -> Self {
self.request_options.timeout = Some(value);
self
}
pub(crate) fn query(&self) -> Result<Query, Error> {
let mut query = Query::default();
query.push("country", &self.country);
query.push("freshness", &self.freshness);
Ok(query)
}
}
pub type YouTubeChartsVideosResponse = Response<Vec<YouTubeChartEntry>>;
#[derive(Clone, Debug, Default, PartialEq)]
#[non_exhaustive]
pub struct YouTubeCommunityPostOptions {
pub freshness: Option<crate::options::Freshness>,
pub request_options: RequestOptions,
}
impl YouTubeCommunityPostOptions {
pub fn new() -> Self {
Self::default()
}
pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
self.freshness = Some(value);
self
}
pub fn max_retries(mut self, value: u32) -> Self {
self.request_options.max_retries = Some(value);
self
}
pub fn timeout(mut self, value: Duration) -> Self {
self.request_options.timeout = Some(value);
self
}
pub(crate) fn query(&self) -> Result<Query, Error> {
let mut query = Query::default();
query.push("freshness", &self.freshness);
Ok(query)
}
}
pub type YouTubeCommunityPostResponse = Response<YouTubeCommunityPost>;
#[derive(Clone, Debug, Default, PartialEq)]
#[non_exhaustive]
pub struct YouTubeCommunityPostCommentsOptions {
pub sort: Option<String>,
pub freshness: Option<crate::options::Freshness>,
pub cursor: Option<String>,
pub request_options: RequestOptions,
}
impl YouTubeCommunityPostCommentsOptions {
pub fn new() -> Self {
Self::default()
}
pub fn sort(mut self, value: impl Into<String>) -> Self {
self.sort = Some(value.into());
self
}
pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
self.freshness = Some(value);
self
}
pub fn cursor(mut self, value: impl Into<String>) -> Self {
self.cursor = Some(value.into());
self
}
pub fn max_retries(mut self, value: u32) -> Self {
self.request_options.max_retries = Some(value);
self
}
pub fn timeout(mut self, value: Duration) -> Self {
self.request_options.timeout = Some(value);
self
}
pub(crate) fn query(&self) -> Result<Query, Error> {
let mut query = Query::default();
query.push("sort", &self.sort);
query.push("freshness", &self.freshness);
query.push("cursor", &self.cursor);
Ok(query)
}
}
pub type YouTubeCommunityPostCommentsPage = Page<YouTubeComment>;
#[derive(Clone, Debug, Default, PartialEq)]
#[non_exhaustive]
pub struct YouTubeHashtagPostsOptions {
pub freshness: Option<crate::options::Freshness>,
pub cursor: Option<String>,
pub request_options: RequestOptions,
}
impl YouTubeHashtagPostsOptions {
pub fn new() -> Self {
Self::default()
}
pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
self.freshness = Some(value);
self
}
pub fn cursor(mut self, value: impl Into<String>) -> Self {
self.cursor = Some(value.into());
self
}
pub fn max_retries(mut self, value: u32) -> Self {
self.request_options.max_retries = Some(value);
self
}
pub fn timeout(mut self, value: Duration) -> Self {
self.request_options.timeout = Some(value);
self
}
pub(crate) fn query(&self) -> Result<Query, Error> {
let mut query = Query::default();
query.push("freshness", &self.freshness);
query.push("cursor", &self.cursor);
Ok(query)
}
}
pub type YouTubeHashtagPostsPage = Page<YouTubePost>;
#[derive(Clone, Debug, Default, PartialEq)]
#[non_exhaustive]
pub struct YouTubePlaylistPostsOptions {
pub freshness: Option<crate::options::Freshness>,
pub cursor: Option<String>,
pub request_options: RequestOptions,
}
impl YouTubePlaylistPostsOptions {
pub fn new() -> Self {
Self::default()
}
pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
self.freshness = Some(value);
self
}
pub fn cursor(mut self, value: impl Into<String>) -> Self {
self.cursor = Some(value.into());
self
}
pub fn max_retries(mut self, value: u32) -> Self {
self.request_options.max_retries = Some(value);
self
}
pub fn timeout(mut self, value: Duration) -> Self {
self.request_options.timeout = Some(value);
self
}
pub(crate) fn query(&self) -> Result<Query, Error> {
let mut query = Query::default();
query.push("freshness", &self.freshness);
query.push("cursor", &self.cursor);
Ok(query)
}
}
pub type YouTubePlaylistPostsPage = Page<YouTubePost>;
#[derive(Clone, Debug, Default, PartialEq)]
#[non_exhaustive]
pub struct YouTubePostOptions {
pub freshness: Option<crate::options::Freshness>,
pub request_options: RequestOptions,
}
impl YouTubePostOptions {
pub fn new() -> Self {
Self::default()
}
pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
self.freshness = Some(value);
self
}
pub fn max_retries(mut self, value: u32) -> Self {
self.request_options.max_retries = Some(value);
self
}
pub fn timeout(mut self, value: Duration) -> Self {
self.request_options.timeout = Some(value);
self
}
pub(crate) fn query(&self) -> Result<Query, Error> {
let mut query = Query::default();
query.push("freshness", &self.freshness);
Ok(query)
}
}
pub type YouTubePostResponse = Response<YouTubePost>;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub struct YouTubePostCommentRepliesOptions {
pub token: String,
pub freshness: Option<crate::options::Freshness>,
pub cursor: Option<String>,
pub request_options: RequestOptions,
}
impl YouTubePostCommentRepliesOptions {
pub fn new(token: impl Into<String>) -> Self {
Self {
token: token.into(),
freshness: None,
cursor: None,
request_options: RequestOptions::default(),
}
}
pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
self.freshness = Some(value);
self
}
pub fn cursor(mut self, value: impl Into<String>) -> Self {
self.cursor = Some(value.into());
self
}
pub fn max_retries(mut self, value: u32) -> Self {
self.request_options.max_retries = Some(value);
self
}
pub fn timeout(mut self, value: Duration) -> Self {
self.request_options.timeout = Some(value);
self
}
pub(crate) fn query(&self) -> Result<Query, Error> {
let mut query = Query::default();
query.require("token", &self.token)?;
query.push("freshness", &self.freshness);
query.push("cursor", &self.cursor);
Ok(query)
}
}
pub type YouTubePostCommentRepliesPage = Page<YouTubeComment>;
#[derive(Clone, Debug, Default, PartialEq)]
#[non_exhaustive]
pub struct YouTubePostCommentsOptions {
pub sort: Option<String>,
pub freshness: Option<crate::options::Freshness>,
pub cursor: Option<String>,
pub request_options: RequestOptions,
}
impl YouTubePostCommentsOptions {
pub fn new() -> Self {
Self::default()
}
pub fn sort(mut self, value: impl Into<String>) -> Self {
self.sort = Some(value.into());
self
}
pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
self.freshness = Some(value);
self
}
pub fn cursor(mut self, value: impl Into<String>) -> Self {
self.cursor = Some(value.into());
self
}
pub fn max_retries(mut self, value: u32) -> Self {
self.request_options.max_retries = Some(value);
self
}
pub fn timeout(mut self, value: Duration) -> Self {
self.request_options.timeout = Some(value);
self
}
pub(crate) fn query(&self) -> Result<Query, Error> {
let mut query = Query::default();
query.push("sort", &self.sort);
query.push("freshness", &self.freshness);
query.push("cursor", &self.cursor);
Ok(query)
}
}
pub type YouTubePostCommentsPage = Page<YouTubeComment>;
#[derive(Clone, Debug, Default, PartialEq)]
#[non_exhaustive]
pub struct YouTubePostFilesOptions {
pub freshness: Option<crate::options::Freshness>,
pub request_options: RequestOptions,
}
impl YouTubePostFilesOptions {
pub fn new() -> Self {
Self::default()
}
pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
self.freshness = Some(value);
self
}
pub fn max_retries(mut self, value: u32) -> Self {
self.request_options.max_retries = Some(value);
self
}
pub fn timeout(mut self, value: Duration) -> Self {
self.request_options.timeout = Some(value);
self
}
pub(crate) fn query(&self) -> Result<Query, Error> {
let mut query = Query::default();
query.push("freshness", &self.freshness);
Ok(query)
}
}
pub type YouTubePostFilesResponse = Response<YouTubeFiles>;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub struct YouTubePostFrameOptions {
pub at: i64,
pub freshness: Option<crate::options::Freshness>,
pub request_options: RequestOptions,
}
impl YouTubePostFrameOptions {
pub fn new(at: i64) -> Self {
Self {
at,
freshness: None,
request_options: RequestOptions::default(),
}
}
pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
self.freshness = Some(value);
self
}
pub fn max_retries(mut self, value: u32) -> Self {
self.request_options.max_retries = Some(value);
self
}
pub fn timeout(mut self, value: Duration) -> Self {
self.request_options.timeout = Some(value);
self
}
pub(crate) fn query(&self) -> Result<Query, Error> {
let mut query = Query::default();
query.require("at", &self.at)?;
query.push("freshness", &self.freshness);
Ok(query)
}
}
pub type YouTubePostFrameResponse = Response<YouTubeFrame>;
#[derive(Clone, Debug, Default, PartialEq)]
#[non_exhaustive]
pub struct YouTubePostRelatedOptions {
pub freshness: Option<crate::options::Freshness>,
pub cursor: Option<String>,
pub request_options: RequestOptions,
}
impl YouTubePostRelatedOptions {
pub fn new() -> Self {
Self::default()
}
pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
self.freshness = Some(value);
self
}
pub fn cursor(mut self, value: impl Into<String>) -> Self {
self.cursor = Some(value.into());
self
}
pub fn max_retries(mut self, value: u32) -> Self {
self.request_options.max_retries = Some(value);
self
}
pub fn timeout(mut self, value: Duration) -> Self {
self.request_options.timeout = Some(value);
self
}
pub(crate) fn query(&self) -> Result<Query, Error> {
let mut query = Query::default();
query.push("freshness", &self.freshness);
query.push("cursor", &self.cursor);
Ok(query)
}
}
pub type YouTubePostRelatedPage = Page<YouTubePost>;
#[derive(Clone, Debug, Default, PartialEq)]
#[non_exhaustive]
pub struct YouTubePostSoundPostsOptions {
pub freshness: Option<crate::options::Freshness>,
pub cursor: Option<String>,
pub request_options: RequestOptions,
}
impl YouTubePostSoundPostsOptions {
pub fn new() -> Self {
Self::default()
}
pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
self.freshness = Some(value);
self
}
pub fn cursor(mut self, value: impl Into<String>) -> Self {
self.cursor = Some(value.into());
self
}
pub fn max_retries(mut self, value: u32) -> Self {
self.request_options.max_retries = Some(value);
self
}
pub fn timeout(mut self, value: Duration) -> Self {
self.request_options.timeout = Some(value);
self
}
pub(crate) fn query(&self) -> Result<Query, Error> {
let mut query = Query::default();
query.push("freshness", &self.freshness);
query.push("cursor", &self.cursor);
Ok(query)
}
}
pub type YouTubePostSoundPostsPage = Page<YouTubePost>;
#[derive(Clone, Debug, Default, PartialEq)]
#[non_exhaustive]
pub struct YouTubePostStoryboardOptions {
pub freshness: Option<crate::options::Freshness>,
pub request_options: RequestOptions,
}
impl YouTubePostStoryboardOptions {
pub fn new() -> Self {
Self::default()
}
pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
self.freshness = Some(value);
self
}
pub fn max_retries(mut self, value: u32) -> Self {
self.request_options.max_retries = Some(value);
self
}
pub fn timeout(mut self, value: Duration) -> Self {
self.request_options.timeout = Some(value);
self
}
pub(crate) fn query(&self) -> Result<Query, Error> {
let mut query = Query::default();
query.push("freshness", &self.freshness);
Ok(query)
}
}
pub type YouTubePostStoryboardResponse = Response<YouTubeStoryboard>;
#[derive(Clone, Debug, Default, PartialEq)]
#[non_exhaustive]
pub struct YouTubePostTranscriptOptions {
pub language: Option<String>,
pub freshness: Option<crate::options::Freshness>,
pub request_options: RequestOptions,
}
impl YouTubePostTranscriptOptions {
pub fn new() -> Self {
Self::default()
}
pub fn language(mut self, value: impl Into<String>) -> Self {
self.language = Some(value.into());
self
}
pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
self.freshness = Some(value);
self
}
pub fn max_retries(mut self, value: u32) -> Self {
self.request_options.max_retries = Some(value);
self
}
pub fn timeout(mut self, value: Duration) -> Self {
self.request_options.timeout = Some(value);
self
}
pub(crate) fn query(&self) -> Result<Query, Error> {
let mut query = Query::default();
query.push("language", &self.language);
query.push("freshness", &self.freshness);
Ok(query)
}
}
pub type YouTubePostTranscriptResponse = Response<YouTubeTranscript>;
#[derive(Clone, Debug, Default, PartialEq)]
#[non_exhaustive]
pub struct YouTubeProfileOptions {
pub freshness: Option<crate::options::Freshness>,
pub request_options: RequestOptions,
}
impl YouTubeProfileOptions {
pub fn new() -> Self {
Self::default()
}
pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
self.freshness = Some(value);
self
}
pub fn max_retries(mut self, value: u32) -> Self {
self.request_options.max_retries = Some(value);
self
}
pub fn timeout(mut self, value: Duration) -> Self {
self.request_options.timeout = Some(value);
self
}
pub(crate) fn query(&self) -> Result<Query, Error> {
let mut query = Query::default();
query.push("freshness", &self.freshness);
Ok(query)
}
}
pub type YouTubeProfileResponse = Response<YouTubeProfile>;
#[derive(Clone, Debug, Default, PartialEq)]
#[non_exhaustive]
pub struct YouTubeProfileCommunityPostsOptions {
pub freshness: Option<crate::options::Freshness>,
pub cursor: Option<String>,
pub request_options: RequestOptions,
}
impl YouTubeProfileCommunityPostsOptions {
pub fn new() -> Self {
Self::default()
}
pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
self.freshness = Some(value);
self
}
pub fn cursor(mut self, value: impl Into<String>) -> Self {
self.cursor = Some(value.into());
self
}
pub fn max_retries(mut self, value: u32) -> Self {
self.request_options.max_retries = Some(value);
self
}
pub fn timeout(mut self, value: Duration) -> Self {
self.request_options.timeout = Some(value);
self
}
pub(crate) fn query(&self) -> Result<Query, Error> {
let mut query = Query::default();
query.push("freshness", &self.freshness);
query.push("cursor", &self.cursor);
Ok(query)
}
}
pub type YouTubeProfileCommunityPostsPage = Page<YouTubeCommunityPost>;
#[derive(Clone, Debug, Default, PartialEq)]
#[non_exhaustive]
pub struct YouTubeProfileLivestreamsOptions {
pub sort: Option<String>,
pub freshness: Option<crate::options::Freshness>,
pub cursor: Option<String>,
pub request_options: RequestOptions,
}
impl YouTubeProfileLivestreamsOptions {
pub fn new() -> Self {
Self::default()
}
pub fn sort(mut self, value: impl Into<String>) -> Self {
self.sort = Some(value.into());
self
}
pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
self.freshness = Some(value);
self
}
pub fn cursor(mut self, value: impl Into<String>) -> Self {
self.cursor = Some(value.into());
self
}
pub fn max_retries(mut self, value: u32) -> Self {
self.request_options.max_retries = Some(value);
self
}
pub fn timeout(mut self, value: Duration) -> Self {
self.request_options.timeout = Some(value);
self
}
pub(crate) fn query(&self) -> Result<Query, Error> {
let mut query = Query::default();
query.push("sort", &self.sort);
query.push("freshness", &self.freshness);
query.push("cursor", &self.cursor);
Ok(query)
}
}
pub type YouTubeProfileLivestreamsPage = Page<YouTubePost>;
#[derive(Clone, Debug, Default, PartialEq)]
#[non_exhaustive]
pub struct YouTubeProfilePlaylistsOptions {
pub freshness: Option<crate::options::Freshness>,
pub cursor: Option<String>,
pub request_options: RequestOptions,
}
impl YouTubeProfilePlaylistsOptions {
pub fn new() -> Self {
Self::default()
}
pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
self.freshness = Some(value);
self
}
pub fn cursor(mut self, value: impl Into<String>) -> Self {
self.cursor = Some(value.into());
self
}
pub fn max_retries(mut self, value: u32) -> Self {
self.request_options.max_retries = Some(value);
self
}
pub fn timeout(mut self, value: Duration) -> Self {
self.request_options.timeout = Some(value);
self
}
pub(crate) fn query(&self) -> Result<Query, Error> {
let mut query = Query::default();
query.push("freshness", &self.freshness);
query.push("cursor", &self.cursor);
Ok(query)
}
}
pub type YouTubeProfilePlaylistsPage = Page<YouTubePlaylist>;
#[derive(Clone, Debug, Default, PartialEq)]
#[non_exhaustive]
pub struct YouTubeProfileProductsOptions {
pub freshness: Option<crate::options::Freshness>,
pub cursor: Option<String>,
pub request_options: RequestOptions,
}
impl YouTubeProfileProductsOptions {
pub fn new() -> Self {
Self::default()
}
pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
self.freshness = Some(value);
self
}
pub fn cursor(mut self, value: impl Into<String>) -> Self {
self.cursor = Some(value.into());
self
}
pub fn max_retries(mut self, value: u32) -> Self {
self.request_options.max_retries = Some(value);
self
}
pub fn timeout(mut self, value: Duration) -> Self {
self.request_options.timeout = Some(value);
self
}
pub(crate) fn query(&self) -> Result<Query, Error> {
let mut query = Query::default();
query.push("freshness", &self.freshness);
query.push("cursor", &self.cursor);
Ok(query)
}
}
pub type YouTubeProfileProductsPage = Page<YouTubeProduct>;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub struct YouTubeProfileSearchOptions {
pub q: String,
pub freshness: Option<crate::options::Freshness>,
pub cursor: Option<String>,
pub request_options: RequestOptions,
}
impl YouTubeProfileSearchOptions {
pub fn new(q: impl Into<String>) -> Self {
Self {
q: q.into(),
freshness: None,
cursor: None,
request_options: RequestOptions::default(),
}
}
pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
self.freshness = Some(value);
self
}
pub fn cursor(mut self, value: impl Into<String>) -> Self {
self.cursor = Some(value.into());
self
}
pub fn max_retries(mut self, value: u32) -> Self {
self.request_options.max_retries = Some(value);
self
}
pub fn timeout(mut self, value: Duration) -> Self {
self.request_options.timeout = Some(value);
self
}
pub(crate) fn query(&self) -> Result<Query, Error> {
let mut query = Query::default();
query.require("q", &self.q)?;
query.push("freshness", &self.freshness);
query.push("cursor", &self.cursor);
Ok(query)
}
}
pub type YouTubeProfileSearchPage = Page<YouTubePost>;
#[derive(Clone, Debug, Default, PartialEq)]
#[non_exhaustive]
pub struct YouTubeProfileShortsOptions {
pub sort: Option<String>,
pub freshness: Option<crate::options::Freshness>,
pub cursor: Option<String>,
pub request_options: RequestOptions,
}
impl YouTubeProfileShortsOptions {
pub fn new() -> Self {
Self::default()
}
pub fn sort(mut self, value: impl Into<String>) -> Self {
self.sort = Some(value.into());
self
}
pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
self.freshness = Some(value);
self
}
pub fn cursor(mut self, value: impl Into<String>) -> Self {
self.cursor = Some(value.into());
self
}
pub fn max_retries(mut self, value: u32) -> Self {
self.request_options.max_retries = Some(value);
self
}
pub fn timeout(mut self, value: Duration) -> Self {
self.request_options.timeout = Some(value);
self
}
pub(crate) fn query(&self) -> Result<Query, Error> {
let mut query = Query::default();
query.push("sort", &self.sort);
query.push("freshness", &self.freshness);
query.push("cursor", &self.cursor);
Ok(query)
}
}
pub type YouTubeProfileShortsPage = Page<YouTubePost>;
#[derive(Clone, Debug, Default, PartialEq)]
#[non_exhaustive]
pub struct YouTubeProfileVideosOptions {
pub sort: Option<String>,
pub since: Option<chrono::DateTime<chrono::Utc>>,
pub freshness: Option<crate::options::Freshness>,
pub cursor: Option<String>,
pub request_options: RequestOptions,
}
impl YouTubeProfileVideosOptions {
pub fn new() -> Self {
Self::default()
}
pub fn sort(mut self, value: impl Into<String>) -> Self {
self.sort = Some(value.into());
self
}
pub fn since(mut self, value: chrono::DateTime<chrono::Utc>) -> Self {
self.since = Some(value);
self
}
pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
self.freshness = Some(value);
self
}
pub fn cursor(mut self, value: impl Into<String>) -> Self {
self.cursor = Some(value.into());
self
}
pub fn max_retries(mut self, value: u32) -> Self {
self.request_options.max_retries = Some(value);
self
}
pub fn timeout(mut self, value: Duration) -> Self {
self.request_options.timeout = Some(value);
self
}
pub(crate) fn query(&self) -> Result<Query, Error> {
let mut query = Query::default();
query.push("sort", &self.sort);
query.push("since", &self.since);
query.push("freshness", &self.freshness);
query.push("cursor", &self.cursor);
Ok(query)
}
}
pub type YouTubeProfileVideosPage = Page<YouTubePost>;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub struct YouTubeSearchPlaylistsOptions {
pub q: String,
pub freshness: Option<crate::options::Freshness>,
pub cursor: Option<String>,
pub request_options: RequestOptions,
}
impl YouTubeSearchPlaylistsOptions {
pub fn new(q: impl Into<String>) -> Self {
Self {
q: q.into(),
freshness: None,
cursor: None,
request_options: RequestOptions::default(),
}
}
pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
self.freshness = Some(value);
self
}
pub fn cursor(mut self, value: impl Into<String>) -> Self {
self.cursor = Some(value.into());
self
}
pub fn max_retries(mut self, value: u32) -> Self {
self.request_options.max_retries = Some(value);
self
}
pub fn timeout(mut self, value: Duration) -> Self {
self.request_options.timeout = Some(value);
self
}
pub(crate) fn query(&self) -> Result<Query, Error> {
let mut query = Query::default();
query.require("q", &self.q)?;
query.push("freshness", &self.freshness);
query.push("cursor", &self.cursor);
Ok(query)
}
}
pub type YouTubeSearchPlaylistsPage = Page<YouTubePlaylist>;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub struct YouTubeSearchPostsOptions {
pub q: String,
pub sort: Option<String>,
pub r#type: Option<String>,
pub duration: Option<String>,
pub uploaded: Option<String>,
pub freshness: Option<crate::options::Freshness>,
pub cursor: Option<String>,
pub request_options: RequestOptions,
}
impl YouTubeSearchPostsOptions {
pub fn new(q: impl Into<String>) -> Self {
Self {
q: q.into(),
sort: None,
r#type: None,
duration: None,
uploaded: None,
freshness: None,
cursor: None,
request_options: RequestOptions::default(),
}
}
pub fn sort(mut self, value: impl Into<String>) -> Self {
self.sort = Some(value.into());
self
}
pub fn r#type(mut self, value: impl Into<String>) -> Self {
self.r#type = Some(value.into());
self
}
pub fn duration(mut self, value: impl Into<String>) -> Self {
self.duration = Some(value.into());
self
}
pub fn uploaded(mut self, value: impl Into<String>) -> Self {
self.uploaded = Some(value.into());
self
}
pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
self.freshness = Some(value);
self
}
pub fn cursor(mut self, value: impl Into<String>) -> Self {
self.cursor = Some(value.into());
self
}
pub fn max_retries(mut self, value: u32) -> Self {
self.request_options.max_retries = Some(value);
self
}
pub fn timeout(mut self, value: Duration) -> Self {
self.request_options.timeout = Some(value);
self
}
pub(crate) fn query(&self) -> Result<Query, Error> {
let mut query = Query::default();
query.require("q", &self.q)?;
query.push("sort", &self.sort);
query.push("type", &self.r#type);
query.push("duration", &self.duration);
query.push("uploaded", &self.uploaded);
query.push("freshness", &self.freshness);
query.push("cursor", &self.cursor);
Ok(query)
}
}
pub type YouTubeSearchPostsPage = Page<YouTubePost>;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub struct YouTubeSearchProfilesOptions {
pub q: String,
pub freshness: Option<crate::options::Freshness>,
pub cursor: Option<String>,
pub request_options: RequestOptions,
}
impl YouTubeSearchProfilesOptions {
pub fn new(q: impl Into<String>) -> Self {
Self {
q: q.into(),
freshness: None,
cursor: None,
request_options: RequestOptions::default(),
}
}
pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
self.freshness = Some(value);
self
}
pub fn cursor(mut self, value: impl Into<String>) -> Self {
self.cursor = Some(value.into());
self
}
pub fn max_retries(mut self, value: u32) -> Self {
self.request_options.max_retries = Some(value);
self
}
pub fn timeout(mut self, value: Duration) -> Self {
self.request_options.timeout = Some(value);
self
}
pub(crate) fn query(&self) -> Result<Query, Error> {
let mut query = Query::default();
query.require("q", &self.q)?;
query.push("freshness", &self.freshness);
query.push("cursor", &self.cursor);
Ok(query)
}
}
pub type YouTubeSearchProfilesPage = Page<YouTubeProfile>;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub struct YouTubeSearchSuggestionsOptions {
pub q: String,
pub freshness: Option<crate::options::Freshness>,
pub request_options: RequestOptions,
}
impl YouTubeSearchSuggestionsOptions {
pub fn new(q: impl Into<String>) -> Self {
Self {
q: q.into(),
freshness: None,
request_options: RequestOptions::default(),
}
}
pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
self.freshness = Some(value);
self
}
pub fn max_retries(mut self, value: u32) -> Self {
self.request_options.max_retries = Some(value);
self
}
pub fn timeout(mut self, value: Duration) -> Self {
self.request_options.timeout = Some(value);
self
}
pub(crate) fn query(&self) -> Result<Query, Error> {
let mut query = Query::default();
query.require("q", &self.q)?;
query.push("freshness", &self.freshness);
Ok(query)
}
}
pub type YouTubeSearchSuggestionsResponse = Response<Vec<YouTubeSuggestion>>;
#[derive(Clone, Debug, Default, PartialEq)]
#[non_exhaustive]
pub struct YouTubeTrendingPostsOptions {
pub country: Option<String>,
pub category: Option<String>,
pub freshness: Option<crate::options::Freshness>,
pub request_options: RequestOptions,
}
impl YouTubeTrendingPostsOptions {
pub fn new() -> Self {
Self::default()
}
pub fn country(mut self, value: impl Into<String>) -> Self {
self.country = Some(value.into());
self
}
pub fn category(mut self, value: impl Into<String>) -> Self {
self.category = Some(value.into());
self
}
pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
self.freshness = Some(value);
self
}
pub fn max_retries(mut self, value: u32) -> Self {
self.request_options.max_retries = Some(value);
self
}
pub fn timeout(mut self, value: Duration) -> Self {
self.request_options.timeout = Some(value);
self
}
pub(crate) fn query(&self) -> Result<Query, Error> {
let mut query = Query::default();
query.push("country", &self.country);
query.push("category", &self.category);
query.push("freshness", &self.freshness);
Ok(query)
}
}
pub type YouTubeTrendingPostsResponse = Response<Vec<YouTubePost>>;