Skip to main content

openhandle/generated/
resources.rs

1// Code generated by `cargo xtask generate`. DO NOT EDIT.
2
3//! The resource graph, operation options, and response types generated from the
4//! `x-openhandle-sdk` operation metadata.
5
6use std::time::Duration;
7
8use reqwest::Method;
9
10use super::models::*;
11use crate::client::Client;
12use crate::errors::Error;
13use crate::options::{FetchOptions, Query, RequestOptions};
14use crate::references::{ProfileReference, Reference, ResourceReference};
15use crate::response::{Items, Page, Response};
16use crate::transport::Scope;
17
18impl Client {
19    /// Selects the Instagram resources. This never sends a request.
20    pub fn instagram(&self) -> InstagramResource {
21        InstagramResource {
22            scope: Scope::new(self.clone()),
23        }
24    }
25
26    /// Selects the Reddit resources. This never sends a request.
27    pub fn reddit(&self) -> RedditResource {
28        RedditResource {
29            scope: Scope::new(self.clone()),
30        }
31    }
32
33    /// Selects the Test data catalog resources. This never sends a request.
34    pub fn test_data(&self) -> TestDataResource {
35        TestDataResource {
36            scope: Scope::new(self.clone()),
37        }
38    }
39
40    /// Selects the TikTok resources. This never sends a request.
41    pub fn tiktok(&self) -> TikTokResource {
42        TikTokResource {
43            scope: Scope::new(self.clone()),
44        }
45    }
46
47    /// Selects the X (Twitter) resources. This never sends a request.
48    pub fn twitter(&self) -> TwitterResource {
49        TwitterResource {
50            scope: Scope::new(self.clone()),
51        }
52    }
53
54    /// Selects the YouTube resources. This never sends a request.
55    pub fn youtube(&self) -> YouTubeResource {
56        YouTubeResource {
57            scope: Scope::new(self.clone()),
58        }
59    }
60
61    /// Fetch the resource at a social URL.
62    ///
63    /// Parse a supported social URL locally, then return the same typed resource as its
64    /// canonical Openhandle operation. TikTok short links such as tiktok.com/t/… and
65    /// vm.tiktok.com/… are expanded through their redirect first. The underlying data
66    /// read is metered once.
67    ///
68    /// `POST /v1/urls/fetch`
69    pub async fn fetch(
70        &self,
71        url: &str,
72        options: impl Into<Option<FetchOptions>>,
73    ) -> Result<FetchResponse, Error> {
74        let options = options.into().unwrap_or_default();
75        Scope::new(self.clone())
76            .fetch(url, options.freshness, options.request_options)?
77            .send_fetch()
78            .await
79    }
80}
81
82/// The `instagram` resources.
83///
84/// Selecting a resource never sends a request. Only its terminal operations do.
85#[derive(Clone, Debug)]
86pub struct InstagramResource {
87    scope: Scope,
88}
89
90impl InstagramResource {
91    /// Selects one comment. This never sends a request.
92    ///
93    /// A raw string is the native ID or shorthand unless it is a supported social
94    /// URL. Pass [`Id`](crate::Id) or [`Url`](crate::Url) to state the meaning.
95    /// An invalid reference fails the first operation, before any request.
96    pub fn comment(&self, reference: impl Into<ResourceReference>) -> InstagramCommentResource {
97        InstagramCommentResource {
98            scope: self.scope.select(
99                "identifier",
100                "instagram",
101                "comment",
102                Reference::from(reference.into()),
103            ),
104        }
105    }
106
107    /// Selects one hashtag. This never sends a request.
108    ///
109    /// A raw string is the native ID or shorthand unless it is a supported social
110    /// URL. Pass [`Id`](crate::Id) or [`Url`](crate::Url) to state the meaning.
111    /// An invalid reference fails the first operation, before any request.
112    pub fn hashtag(&self, reference: impl Into<ResourceReference>) -> InstagramHashtagResource {
113        InstagramHashtagResource {
114            scope: self.scope.select(
115                "identifier",
116                "instagram",
117                "hashtag",
118                Reference::from(reference.into()),
119            ),
120        }
121    }
122
123    /// Selects one highlight. This never sends a request.
124    ///
125    /// A raw string is the native ID or shorthand unless it is a supported social
126    /// URL. Pass [`Id`](crate::Id) or [`Url`](crate::Url) to state the meaning.
127    /// An invalid reference fails the first operation, before any request.
128    pub fn highlight(&self, reference: impl Into<ResourceReference>) -> InstagramHighlightResource {
129        InstagramHighlightResource {
130            scope: self.scope.select(
131                "identifier",
132                "instagram",
133                "highlight",
134                Reference::from(reference.into()),
135            ),
136        }
137    }
138
139    /// Selects one location. This never sends a request.
140    ///
141    /// A raw string is the native ID or shorthand unless it is a supported social
142    /// URL. Pass [`Id`](crate::Id) or [`Url`](crate::Url) to state the meaning.
143    /// An invalid reference fails the first operation, before any request.
144    pub fn location(&self, reference: impl Into<ResourceReference>) -> InstagramLocationResource {
145        InstagramLocationResource {
146            scope: self.scope.select(
147                "identifier",
148                "instagram",
149                "location",
150                Reference::from(reference.into()),
151            ),
152        }
153    }
154
155    /// Selects one music. This never sends a request.
156    ///
157    /// A raw string is the native ID or shorthand unless it is a supported social
158    /// URL. Pass [`Id`](crate::Id) or [`Url`](crate::Url) to state the meaning.
159    /// An invalid reference fails the first operation, before any request.
160    pub fn music(&self, reference: impl Into<ResourceReference>) -> InstagramMusicResource {
161        InstagramMusicResource {
162            scope: self.scope.select(
163                "identifier",
164                "instagram",
165                "music",
166                Reference::from(reference.into()),
167            ),
168        }
169    }
170
171    /// Selects one post. This never sends a request.
172    ///
173    /// A raw string is the native ID or shorthand unless it is a supported social
174    /// URL. Pass [`Id`](crate::Id) or [`Url`](crate::Url) to state the meaning.
175    /// An invalid reference fails the first operation, before any request.
176    pub fn post(&self, reference: impl Into<ResourceReference>) -> InstagramPostResource {
177        InstagramPostResource {
178            scope: self.scope.select(
179                "identifier",
180                "instagram",
181                "post",
182                Reference::from(reference.into()),
183            ),
184        }
185    }
186
187    /// Selects one profile. This never sends a request.
188    ///
189    /// A raw string is a username unless it is a supported social URL. Pass
190    /// [`Username`](crate::Username), [`Id`](crate::Id), or [`Url`](crate::Url) to state the meaning.
191    /// An invalid reference fails the first operation, before any request.
192    pub fn profile(&self, reference: impl Into<ProfileReference>) -> InstagramProfileResource {
193        InstagramProfileResource {
194            scope: self.scope.select(
195                "identifier",
196                "instagram",
197                "profile",
198                Reference::from(reference.into()),
199            ),
200        }
201    }
202
203    /// Selects the search resources. This never sends a request.
204    pub fn search(&self) -> InstagramSearchResource {
205        InstagramSearchResource {
206            scope: self.scope.clone(),
207        }
208    }
209
210    /// Selects one story. This never sends a request.
211    ///
212    /// A raw string is the native ID or shorthand unless it is a supported social
213    /// URL. Pass [`Id`](crate::Id) or [`Url`](crate::Url) to state the meaning.
214    /// An invalid reference fails the first operation, before any request.
215    pub fn story(&self, reference: impl Into<ResourceReference>) -> InstagramStoryResource {
216        InstagramStoryResource {
217            scope: self.scope.select(
218                "identifier",
219                "instagram",
220                "story",
221                Reference::from(reference.into()),
222            ),
223        }
224    }
225}
226
227/// One selected comment on Instagram.
228///
229/// Selecting a resource never sends a request. Only its terminal operations do.
230#[derive(Clone, Debug)]
231pub struct InstagramCommentResource {
232    scope: Scope,
233}
234
235impl InstagramCommentResource {
236    /// Selects the likers resources. This never sends a request.
237    pub fn likers(&self) -> InstagramCommentLikersResource {
238        InstagramCommentLikersResource {
239            scope: self.scope.clone(),
240        }
241    }
242}
243
244/// The `instagram.comment.likers` resources.
245///
246/// Selecting a resource never sends a request. Only its terminal operations do.
247#[derive(Clone, Debug)]
248pub struct InstagramCommentLikersResource {
249    scope: Scope,
250}
251
252impl InstagramCommentLikersResource {
253    /// List comment likers.
254    ///
255    /// List comment likers from public Instagram data. Test and Live use the same
256    /// route, parameters, response schema, pagination, and errors. In Test, null means
257    /// unavailable, not zero.
258    ///
259    /// `GET /v1/instagram/comments/{identifier}/likers`
260    pub async fn list(
261        &self,
262        options: InstagramCommentLikersOptions,
263    ) -> Result<InstagramCommentLikersPage, Error> {
264        self.scope
265            .operation(
266                Method::GET,
267                "/v1/instagram/comments/{identifier}/likers",
268                options.query(),
269                options.request_options,
270            )?
271            .send_page()
272            .await
273    }
274
275    /// Iterates lazily over every item of [`list`](Self::list), one page per request.
276    pub fn items(&self, options: InstagramCommentLikersOptions) -> Items<InstagramProfileSummary> {
277        Items::new(self.scope.operation(
278            Method::GET,
279            "/v1/instagram/comments/{identifier}/likers",
280            options.query(),
281            options.request_options,
282        ))
283    }
284}
285
286/// One selected hashtag on Instagram.
287///
288/// Selecting a resource never sends a request. Only its terminal operations do.
289#[derive(Clone, Debug)]
290pub struct InstagramHashtagResource {
291    scope: Scope,
292}
293
294impl InstagramHashtagResource {
295    /// Selects the posts resources. This never sends a request.
296    pub fn posts(&self) -> InstagramHashtagPostsResource {
297        InstagramHashtagPostsResource {
298            scope: self.scope.clone(),
299        }
300    }
301
302    /// Selects the reels resources. This never sends a request.
303    pub fn reels(&self) -> InstagramHashtagReelsResource {
304        InstagramHashtagReelsResource {
305            scope: self.scope.clone(),
306        }
307    }
308
309    /// Get a hashtag.
310    ///
311    /// Return one public hashtag by its native identifier. Test and Live use the same
312    /// route, parameters, response schema, pagination, and errors. In Test, null means
313    /// unavailable, not zero.
314    ///
315    /// `GET /v1/instagram/hashtags/{identifier}`
316    pub async fn get(
317        &self,
318        options: impl Into<Option<InstagramHashtagOptions>>,
319    ) -> Result<InstagramHashtagResponse, Error> {
320        let options = options.into().unwrap_or_default();
321        self.scope
322            .operation(
323                Method::GET,
324                "/v1/instagram/hashtags/{identifier}",
325                options.query(),
326                options.request_options,
327            )?
328            .send()
329            .await
330    }
331}
332
333/// The `instagram.hashtag.posts` resources.
334///
335/// Selecting a resource never sends a request. Only its terminal operations do.
336#[derive(Clone, Debug)]
337pub struct InstagramHashtagPostsResource {
338    scope: Scope,
339}
340
341impl InstagramHashtagPostsResource {
342    /// List hashtag posts.
343    ///
344    /// Return a cursor-paginated collection of public posts. Test and Live use the same
345    /// route, parameters, response schema, pagination, and errors. In Test, null means
346    /// unavailable, not zero.
347    ///
348    /// `GET /v1/instagram/hashtags/{identifier}/posts`
349    pub async fn list(
350        &self,
351        options: impl Into<Option<InstagramHashtagPostsOptions>>,
352    ) -> Result<InstagramHashtagPostsPage, Error> {
353        let options = options.into().unwrap_or_default();
354        self.scope
355            .operation(
356                Method::GET,
357                "/v1/instagram/hashtags/{identifier}/posts",
358                options.query(),
359                options.request_options,
360            )?
361            .send_page()
362            .await
363    }
364
365    /// Iterates lazily over every item of [`list`](Self::list), one page per request.
366    pub fn items(
367        &self,
368        options: impl Into<Option<InstagramHashtagPostsOptions>>,
369    ) -> Items<InstagramPost> {
370        let options = options.into().unwrap_or_default();
371        Items::new(self.scope.operation(
372            Method::GET,
373            "/v1/instagram/hashtags/{identifier}/posts",
374            options.query(),
375            options.request_options,
376        ))
377    }
378}
379
380/// The `instagram.hashtag.reels` resources.
381///
382/// Selecting a resource never sends a request. Only its terminal operations do.
383#[derive(Clone, Debug)]
384pub struct InstagramHashtagReelsResource {
385    scope: Scope,
386}
387
388impl InstagramHashtagReelsResource {
389    /// List hashtag reels.
390    ///
391    /// Return a cursor-paginated collection of Instagram reels for a hashtag. Test and
392    /// Live use the same route, parameters, response schema, pagination, and errors. In
393    /// Test, null means unavailable, not zero.
394    ///
395    /// `GET /v1/instagram/hashtags/{identifier}/reels`
396    pub async fn list(
397        &self,
398        options: impl Into<Option<InstagramHashtagReelsOptions>>,
399    ) -> Result<InstagramHashtagReelsPage, Error> {
400        let options = options.into().unwrap_or_default();
401        self.scope
402            .operation(
403                Method::GET,
404                "/v1/instagram/hashtags/{identifier}/reels",
405                options.query(),
406                options.request_options,
407            )?
408            .send_page()
409            .await
410    }
411
412    /// Iterates lazily over every item of [`list`](Self::list), one page per request.
413    pub fn items(
414        &self,
415        options: impl Into<Option<InstagramHashtagReelsOptions>>,
416    ) -> Items<InstagramPost> {
417        let options = options.into().unwrap_or_default();
418        Items::new(self.scope.operation(
419            Method::GET,
420            "/v1/instagram/hashtags/{identifier}/reels",
421            options.query(),
422            options.request_options,
423        ))
424    }
425}
426
427/// One selected highlight on Instagram.
428///
429/// Selecting a resource never sends a request. Only its terminal operations do.
430#[derive(Clone, Debug)]
431pub struct InstagramHighlightResource {
432    scope: Scope,
433}
434
435impl InstagramHighlightResource {
436    /// Get a highlight.
437    ///
438    /// Get a highlight from public Instagram data. Test and Live use the same route,
439    /// parameters, response schema, pagination, and errors. In Test, null means
440    /// unavailable, not zero.
441    ///
442    /// `GET /v1/instagram/highlights/{identifier}`
443    pub async fn get(
444        &self,
445        options: impl Into<Option<InstagramHighlightOptions>>,
446    ) -> Result<InstagramHighlightResponse, Error> {
447        let options = options.into().unwrap_or_default();
448        self.scope
449            .operation(
450                Method::GET,
451                "/v1/instagram/highlights/{identifier}",
452                options.query(),
453                options.request_options,
454            )?
455            .send()
456            .await
457    }
458}
459
460/// One selected location on Instagram.
461///
462/// Selecting a resource never sends a request. Only its terminal operations do.
463#[derive(Clone, Debug)]
464pub struct InstagramLocationResource {
465    scope: Scope,
466}
467
468impl InstagramLocationResource {
469    /// Selects the posts resources. This never sends a request.
470    pub fn posts(&self) -> InstagramLocationPostsResource {
471        InstagramLocationPostsResource {
472            scope: self.scope.clone(),
473        }
474    }
475
476    /// Get a location.
477    ///
478    /// Return one public location by its native identifier. Test and Live use the same
479    /// route, parameters, response schema, pagination, and errors. In Test, null means
480    /// unavailable, not zero.
481    ///
482    /// `GET /v1/instagram/locations/{identifier}`
483    pub async fn get(
484        &self,
485        options: impl Into<Option<InstagramLocationOptions>>,
486    ) -> Result<InstagramLocationResponse, Error> {
487        let options = options.into().unwrap_or_default();
488        self.scope
489            .operation(
490                Method::GET,
491                "/v1/instagram/locations/{identifier}",
492                options.query(),
493                options.request_options,
494            )?
495            .send()
496            .await
497    }
498}
499
500/// The `instagram.location.posts` resources.
501///
502/// Selecting a resource never sends a request. Only its terminal operations do.
503#[derive(Clone, Debug)]
504pub struct InstagramLocationPostsResource {
505    scope: Scope,
506}
507
508impl InstagramLocationPostsResource {
509    /// List location posts.
510    ///
511    /// Return a cursor-paginated collection of public posts. Test and Live use the same
512    /// route, parameters, response schema, pagination, and errors. In Test, null means
513    /// unavailable, not zero.
514    ///
515    /// `GET /v1/instagram/locations/{identifier}/posts`
516    pub async fn list(
517        &self,
518        options: impl Into<Option<InstagramLocationPostsOptions>>,
519    ) -> Result<InstagramLocationPostsPage, Error> {
520        let options = options.into().unwrap_or_default();
521        self.scope
522            .operation(
523                Method::GET,
524                "/v1/instagram/locations/{identifier}/posts",
525                options.query(),
526                options.request_options,
527            )?
528            .send_page()
529            .await
530    }
531
532    /// Iterates lazily over every item of [`list`](Self::list), one page per request.
533    pub fn items(
534        &self,
535        options: impl Into<Option<InstagramLocationPostsOptions>>,
536    ) -> Items<InstagramPost> {
537        let options = options.into().unwrap_or_default();
538        Items::new(self.scope.operation(
539            Method::GET,
540            "/v1/instagram/locations/{identifier}/posts",
541            options.query(),
542            options.request_options,
543        ))
544    }
545}
546
547/// One selected music on Instagram.
548///
549/// Selecting a resource never sends a request. Only its terminal operations do.
550#[derive(Clone, Debug)]
551pub struct InstagramMusicResource {
552    scope: Scope,
553}
554
555impl InstagramMusicResource {
556    /// Selects the stream resources. This never sends a request.
557    pub fn stream(&self) -> InstagramMusicStreamResource {
558        InstagramMusicStreamResource {
559            scope: self.scope.clone(),
560        }
561    }
562
563    /// Get a music.
564    ///
565    /// Return one public music by its native identifier. Test and Live use the same
566    /// route, parameters, response schema, pagination, and errors. In Test, null means
567    /// unavailable, not zero.
568    ///
569    /// `GET /v1/instagram/music/{identifier}`
570    pub async fn get(
571        &self,
572        options: impl Into<Option<InstagramMusicOptions>>,
573    ) -> Result<InstagramMusicResponse, Error> {
574        let options = options.into().unwrap_or_default();
575        self.scope
576            .operation(
577                Method::GET,
578                "/v1/instagram/music/{identifier}",
579                options.query(),
580                options.request_options,
581            )?
582            .send()
583            .await
584    }
585}
586
587/// The `instagram.music.stream` resources.
588///
589/// Selecting a resource never sends a request. Only its terminal operations do.
590#[derive(Clone, Debug)]
591pub struct InstagramMusicStreamResource {
592    scope: Scope,
593}
594
595impl InstagramMusicStreamResource {
596    /// List music stream pages.
597    ///
598    /// List music stream pages from public Instagram data. Test and Live use the same
599    /// route, parameters, response schema, pagination, and errors. In Test, null means
600    /// unavailable, not zero.
601    ///
602    /// `GET /v1/instagram/music/{identifier}/stream`
603    pub async fn list(
604        &self,
605        options: impl Into<Option<InstagramMusicStreamOptions>>,
606    ) -> Result<InstagramMusicStreamPage, Error> {
607        let options = options.into().unwrap_or_default();
608        self.scope
609            .operation(
610                Method::GET,
611                "/v1/instagram/music/{identifier}/stream",
612                options.query(),
613                options.request_options,
614            )?
615            .send_page()
616            .await
617    }
618
619    /// Iterates lazily over every item of [`list`](Self::list), one page per request.
620    pub fn items(
621        &self,
622        options: impl Into<Option<InstagramMusicStreamOptions>>,
623    ) -> Items<InstagramMusicStream> {
624        let options = options.into().unwrap_or_default();
625        Items::new(self.scope.operation(
626            Method::GET,
627            "/v1/instagram/music/{identifier}/stream",
628            options.query(),
629            options.request_options,
630        ))
631    }
632}
633
634/// One selected post on Instagram.
635///
636/// Selecting a resource never sends a request. Only its terminal operations do.
637#[derive(Clone, Debug)]
638pub struct InstagramPostResource {
639    scope: Scope,
640}
641
642impl InstagramPostResource {
643    /// Selects the clip metadata resources. This never sends a request.
644    pub fn clip_metadata(&self) -> InstagramPostClipMetadataResource {
645        InstagramPostClipMetadataResource {
646            scope: self.scope.clone(),
647        }
648    }
649
650    /// Selects one comment. This never sends a request.
651    ///
652    /// A raw string is the native ID or shorthand unless it is a supported social
653    /// URL. Pass [`Id`](crate::Id) or [`Url`](crate::Url) to state the meaning.
654    /// An invalid reference fails the first operation, before any request.
655    pub fn comment(&self, reference: impl Into<ResourceReference>) -> InstagramPostCommentResource {
656        InstagramPostCommentResource {
657            scope: self.scope.select(
658                "comment_id",
659                "instagram",
660                "comment",
661                Reference::from(reference.into()),
662            ),
663        }
664    }
665
666    /// Selects the comment metadata resources. This never sends a request.
667    pub fn comment_metadata(&self) -> InstagramPostCommentMetadataResource {
668        InstagramPostCommentMetadataResource {
669            scope: self.scope.clone(),
670        }
671    }
672
673    /// Selects the comment moderation resources. This never sends a request.
674    pub fn comment_moderation(&self) -> InstagramPostCommentModerationResource {
675        InstagramPostCommentModerationResource {
676            scope: self.scope.clone(),
677        }
678    }
679
680    /// Selects the comments resources. This never sends a request.
681    pub fn comments(&self) -> InstagramPostCommentsResource {
682        InstagramPostCommentsResource {
683            scope: self.scope.clone(),
684        }
685    }
686
687    /// Selects the insights resources. This never sends a request.
688    pub fn insights(&self) -> InstagramPostInsightsResource {
689        InstagramPostInsightsResource {
690            scope: self.scope.clone(),
691        }
692    }
693
694    /// Selects the likers resources. This never sends a request.
695    pub fn likers(&self) -> InstagramPostLikersResource {
696        InstagramPostLikersResource {
697            scope: self.scope.clone(),
698        }
699    }
700
701    /// Selects the oembed resources. This never sends a request.
702    pub fn oembed(&self) -> InstagramPostOEmbedResource {
703        InstagramPostOEmbedResource {
704            scope: self.scope.clone(),
705        }
706    }
707
708    /// Selects the tagged users resources. This never sends a request.
709    pub fn tagged_users(&self) -> InstagramPostTaggedUsersResource {
710        InstagramPostTaggedUsersResource {
711            scope: self.scope.clone(),
712        }
713    }
714
715    /// Selects the template resources. This never sends a request.
716    pub fn template(&self) -> InstagramPostTemplateResource {
717        InstagramPostTemplateResource {
718            scope: self.scope.clone(),
719        }
720    }
721
722    /// Get a post.
723    ///
724    /// Get a post by a canonical platform identifier. URLs must be converted before
725    /// calling a data endpoint. Test and Live use the same route, parameters, response
726    /// schema, pagination, and errors. In Test, null means unavailable, not zero.
727    ///
728    /// `GET /v1/instagram/posts/{identifier}`
729    pub async fn get(
730        &self,
731        options: impl Into<Option<InstagramPostOptions>>,
732    ) -> Result<InstagramPostResponse, Error> {
733        let options = options.into().unwrap_or_default();
734        self.scope
735            .operation(
736                Method::GET,
737                "/v1/instagram/posts/{identifier}",
738                options.query(),
739                options.request_options,
740            )?
741            .send()
742            .await
743    }
744}
745
746/// The `instagram.post.clipMetadata` resources.
747///
748/// Selecting a resource never sends a request. Only its terminal operations do.
749#[derive(Clone, Debug)]
750pub struct InstagramPostClipMetadataResource {
751    scope: Scope,
752}
753
754impl InstagramPostClipMetadataResource {
755    /// Get clip metadata.
756    ///
757    /// Get clip metadata from public Instagram data. Test and Live use the same route,
758    /// parameters, response schema, pagination, and errors. In Test, null means
759    /// unavailable, not zero.
760    ///
761    /// `GET /v1/instagram/posts/{identifier}/clip-metadata`
762    pub async fn get(
763        &self,
764        options: impl Into<Option<InstagramPostClipMetadataOptions>>,
765    ) -> Result<InstagramPostClipMetadataResponse, Error> {
766        let options = options.into().unwrap_or_default();
767        self.scope
768            .operation(
769                Method::GET,
770                "/v1/instagram/posts/{identifier}/clip-metadata",
771                options.query(),
772                options.request_options,
773            )?
774            .send()
775            .await
776    }
777}
778
779/// One selected comment on Instagram.
780///
781/// Selecting a resource never sends a request. Only its terminal operations do.
782#[derive(Clone, Debug)]
783pub struct InstagramPostCommentResource {
784    scope: Scope,
785}
786
787impl InstagramPostCommentResource {
788    /// Selects the replies resources. This never sends a request.
789    pub fn replies(&self) -> InstagramPostCommentRepliesResource {
790        InstagramPostCommentRepliesResource {
791            scope: self.scope.clone(),
792        }
793    }
794}
795
796/// The `instagram.post.comment.replies` resources.
797///
798/// Selecting a resource never sends a request. Only its terminal operations do.
799#[derive(Clone, Debug)]
800pub struct InstagramPostCommentRepliesResource {
801    scope: Scope,
802}
803
804impl InstagramPostCommentRepliesResource {
805    /// List comment replies.
806    ///
807    /// Return a stable page of replies for one comment. Use find_test_data to discover
808    /// compatible post and comment IDs. Test and Live use the same route, parameters,
809    /// response schema, pagination, and errors. In Test, null means unavailable, not
810    /// zero.
811    ///
812    /// `GET /v1/instagram/posts/{identifier}/comments/{comment_id}/replies`
813    pub async fn list(
814        &self,
815        options: impl Into<Option<InstagramPostCommentRepliesOptions>>,
816    ) -> Result<InstagramPostCommentRepliesPage, Error> {
817        let options = options.into().unwrap_or_default();
818        self.scope
819            .operation(
820                Method::GET,
821                "/v1/instagram/posts/{identifier}/comments/{comment_id}/replies",
822                options.query(),
823                options.request_options,
824            )?
825            .send_page()
826            .await
827    }
828
829    /// Iterates lazily over every item of [`list`](Self::list), one page per request.
830    pub fn items(
831        &self,
832        options: impl Into<Option<InstagramPostCommentRepliesOptions>>,
833    ) -> Items<InstagramComment> {
834        let options = options.into().unwrap_or_default();
835        Items::new(self.scope.operation(
836            Method::GET,
837            "/v1/instagram/posts/{identifier}/comments/{comment_id}/replies",
838            options.query(),
839            options.request_options,
840        ))
841    }
842}
843
844/// The `instagram.post.commentMetadata` resources.
845///
846/// Selecting a resource never sends a request. Only its terminal operations do.
847#[derive(Clone, Debug)]
848pub struct InstagramPostCommentMetadataResource {
849    scope: Scope,
850}
851
852impl InstagramPostCommentMetadataResource {
853    /// Get comment metadata.
854    ///
855    /// Get comment metadata from public Instagram data. Test and Live use the same
856    /// route, parameters, response schema, pagination, and errors. In Test, null means
857    /// unavailable, not zero.
858    ///
859    /// `GET /v1/instagram/posts/{identifier}/comment-metadata`
860    pub async fn get(
861        &self,
862        options: impl Into<Option<InstagramPostCommentMetadataOptions>>,
863    ) -> Result<InstagramPostCommentMetadataResponse, Error> {
864        let options = options.into().unwrap_or_default();
865        self.scope
866            .operation(
867                Method::GET,
868                "/v1/instagram/posts/{identifier}/comment-metadata",
869                options.query(),
870                options.request_options,
871            )?
872            .send()
873            .await
874    }
875}
876
877/// The `instagram.post.commentModeration` resources.
878///
879/// Selecting a resource never sends a request. Only its terminal operations do.
880#[derive(Clone, Debug)]
881pub struct InstagramPostCommentModerationResource {
882    scope: Scope,
883}
884
885impl InstagramPostCommentModerationResource {
886    /// Check comment moderation.
887    ///
888    /// Check comment moderation from public Instagram data. Test and Live use the same
889    /// route, parameters, response schema, pagination, and errors. In Test, null means
890    /// unavailable, not zero.
891    ///
892    /// `GET /v1/instagram/posts/{identifier}/comment-moderation`
893    pub async fn get(
894        &self,
895        options: InstagramPostCommentModerationOptions,
896    ) -> Result<InstagramPostCommentModerationResponse, Error> {
897        self.scope
898            .operation(
899                Method::GET,
900                "/v1/instagram/posts/{identifier}/comment-moderation",
901                options.query(),
902                options.request_options,
903            )?
904            .send()
905            .await
906    }
907}
908
909/// The `instagram.post.comments` resources.
910///
911/// Selecting a resource never sends a request. Only its terminal operations do.
912#[derive(Clone, Debug)]
913pub struct InstagramPostCommentsResource {
914    scope: Scope,
915}
916
917impl InstagramPostCommentsResource {
918    /// List post comments.
919    ///
920    /// List post comments by a canonical platform identifier. URLs must be converted
921    /// before calling a data endpoint. Test and Live use the same route, parameters,
922    /// response schema, pagination, and errors. In Test, null means unavailable, not
923    /// zero.
924    ///
925    /// `GET /v1/instagram/posts/{identifier}/comments`
926    pub async fn list(
927        &self,
928        options: impl Into<Option<InstagramPostCommentsOptions>>,
929    ) -> Result<InstagramPostCommentsPage, Error> {
930        let options = options.into().unwrap_or_default();
931        self.scope
932            .operation(
933                Method::GET,
934                "/v1/instagram/posts/{identifier}/comments",
935                options.query(),
936                options.request_options,
937            )?
938            .send_page()
939            .await
940    }
941
942    /// Iterates lazily over every item of [`list`](Self::list), one page per request.
943    pub fn items(
944        &self,
945        options: impl Into<Option<InstagramPostCommentsOptions>>,
946    ) -> Items<InstagramComment> {
947        let options = options.into().unwrap_or_default();
948        Items::new(self.scope.operation(
949            Method::GET,
950            "/v1/instagram/posts/{identifier}/comments",
951            options.query(),
952            options.request_options,
953        ))
954    }
955}
956
957/// The `instagram.post.insights` resources.
958///
959/// Selecting a resource never sends a request. Only its terminal operations do.
960#[derive(Clone, Debug)]
961pub struct InstagramPostInsightsResource {
962    scope: Scope,
963}
964
965impl InstagramPostInsightsResource {
966    /// Get post insights.
967    ///
968    /// Get post insights from public Instagram data. Test and Live use the same route,
969    /// parameters, response schema, pagination, and errors. In Test, null means
970    /// unavailable, not zero.
971    ///
972    /// `GET /v1/instagram/posts/{identifier}/insights`
973    pub async fn get(
974        &self,
975        options: impl Into<Option<InstagramPostInsightsOptions>>,
976    ) -> Result<InstagramPostInsightsResponse, Error> {
977        let options = options.into().unwrap_or_default();
978        self.scope
979            .operation(
980                Method::GET,
981                "/v1/instagram/posts/{identifier}/insights",
982                options.query(),
983                options.request_options,
984            )?
985            .send()
986            .await
987    }
988}
989
990/// The `instagram.post.likers` resources.
991///
992/// Selecting a resource never sends a request. Only its terminal operations do.
993#[derive(Clone, Debug)]
994pub struct InstagramPostLikersResource {
995    scope: Scope,
996}
997
998impl InstagramPostLikersResource {
999    /// List post likers.
1000    ///
1001    /// Return public profiles that liked an Instagram post. Test and Live use the same
1002    /// route, parameters, response schema, pagination, and errors. In Test, null means
1003    /// unavailable, not zero.
1004    ///
1005    /// `GET /v1/instagram/posts/{identifier}/likers`
1006    pub async fn list(
1007        &self,
1008        options: impl Into<Option<InstagramPostLikersOptions>>,
1009    ) -> Result<InstagramPostLikersPage, Error> {
1010        let options = options.into().unwrap_or_default();
1011        self.scope
1012            .operation(
1013                Method::GET,
1014                "/v1/instagram/posts/{identifier}/likers",
1015                options.query(),
1016                options.request_options,
1017            )?
1018            .send_page()
1019            .await
1020    }
1021
1022    /// Iterates lazily over every item of [`list`](Self::list), one page per request.
1023    pub fn items(
1024        &self,
1025        options: impl Into<Option<InstagramPostLikersOptions>>,
1026    ) -> Items<InstagramProfile> {
1027        let options = options.into().unwrap_or_default();
1028        Items::new(self.scope.operation(
1029            Method::GET,
1030            "/v1/instagram/posts/{identifier}/likers",
1031            options.query(),
1032            options.request_options,
1033        ))
1034    }
1035}
1036
1037/// The `instagram.post.oembed` resources.
1038///
1039/// Selecting a resource never sends a request. Only its terminal operations do.
1040#[derive(Clone, Debug)]
1041pub struct InstagramPostOEmbedResource {
1042    scope: Scope,
1043}
1044
1045impl InstagramPostOEmbedResource {
1046    /// Get post oEmbed data.
1047    ///
1048    /// Get post oEmbed data from public Instagram data. Test and Live use the same
1049    /// route, parameters, response schema, pagination, and errors. In Test, null means
1050    /// unavailable, not zero.
1051    ///
1052    /// `GET /v1/instagram/posts/{identifier}/oembed`
1053    pub async fn get(
1054        &self,
1055        options: impl Into<Option<InstagramPostOEmbedOptions>>,
1056    ) -> Result<InstagramPostOEmbedResponse, Error> {
1057        let options = options.into().unwrap_or_default();
1058        self.scope
1059            .operation(
1060                Method::GET,
1061                "/v1/instagram/posts/{identifier}/oembed",
1062                options.query(),
1063                options.request_options,
1064            )?
1065            .send()
1066            .await
1067    }
1068}
1069
1070/// The `instagram.post.taggedUsers` resources.
1071///
1072/// Selecting a resource never sends a request. Only its terminal operations do.
1073#[derive(Clone, Debug)]
1074pub struct InstagramPostTaggedUsersResource {
1075    scope: Scope,
1076}
1077
1078impl InstagramPostTaggedUsersResource {
1079    /// List tagged users.
1080    ///
1081    /// Return public profiles tagged in an Instagram post. Test and Live use the same
1082    /// route, parameters, response schema, pagination, and errors. In Test, null means
1083    /// unavailable, not zero.
1084    ///
1085    /// `GET /v1/instagram/posts/{identifier}/tagged-users`
1086    pub async fn list(
1087        &self,
1088        options: impl Into<Option<InstagramPostTaggedUsersOptions>>,
1089    ) -> Result<InstagramPostTaggedUsersPage, Error> {
1090        let options = options.into().unwrap_or_default();
1091        self.scope
1092            .operation(
1093                Method::GET,
1094                "/v1/instagram/posts/{identifier}/tagged-users",
1095                options.query(),
1096                options.request_options,
1097            )?
1098            .send_page()
1099            .await
1100    }
1101
1102    /// Iterates lazily over every item of [`list`](Self::list), one page per request.
1103    pub fn items(
1104        &self,
1105        options: impl Into<Option<InstagramPostTaggedUsersOptions>>,
1106    ) -> Items<InstagramUserTag> {
1107        let options = options.into().unwrap_or_default();
1108        Items::new(self.scope.operation(
1109            Method::GET,
1110            "/v1/instagram/posts/{identifier}/tagged-users",
1111            options.query(),
1112            options.request_options,
1113        ))
1114    }
1115}
1116
1117/// The `instagram.post.template` resources.
1118///
1119/// Selecting a resource never sends a request. Only its terminal operations do.
1120#[derive(Clone, Debug)]
1121pub struct InstagramPostTemplateResource {
1122    scope: Scope,
1123}
1124
1125impl InstagramPostTemplateResource {
1126    /// Get post template.
1127    ///
1128    /// Get post template from public Instagram data. Test and Live use the same route,
1129    /// parameters, response schema, pagination, and errors. In Test, null means
1130    /// unavailable, not zero.
1131    ///
1132    /// `GET /v1/instagram/posts/{identifier}/template`
1133    pub async fn get(
1134        &self,
1135        options: impl Into<Option<InstagramPostTemplateOptions>>,
1136    ) -> Result<InstagramPostTemplateResponse, Error> {
1137        let options = options.into().unwrap_or_default();
1138        self.scope
1139            .operation(
1140                Method::GET,
1141                "/v1/instagram/posts/{identifier}/template",
1142                options.query(),
1143                options.request_options,
1144            )?
1145            .send()
1146            .await
1147    }
1148}
1149
1150/// One selected profile on Instagram.
1151///
1152/// Selecting a resource never sends a request. Only its terminal operations do.
1153#[derive(Clone, Debug)]
1154pub struct InstagramProfileResource {
1155    scope: Scope,
1156}
1157
1158impl InstagramProfileResource {
1159    /// Selects the about resources. This never sends a request.
1160    pub fn about(&self) -> InstagramProfileAboutResource {
1161        InstagramProfileAboutResource {
1162            scope: self.scope.clone(),
1163        }
1164    }
1165
1166    /// Selects the business recommendations resources. This never sends a request.
1167    pub fn business_recommendations(&self) -> InstagramProfileBusinessRecommendationsResource {
1168        InstagramProfileBusinessRecommendationsResource {
1169            scope: self.scope.clone(),
1170        }
1171    }
1172
1173    /// Selects the followers resources. This never sends a request.
1174    pub fn followers(&self) -> InstagramProfileFollowersResource {
1175        InstagramProfileFollowersResource {
1176            scope: self.scope.clone(),
1177        }
1178    }
1179
1180    /// Selects the following resources. This never sends a request.
1181    pub fn following(&self) -> InstagramProfileFollowingResource {
1182        InstagramProfileFollowingResource {
1183            scope: self.scope.clone(),
1184        }
1185    }
1186
1187    /// Selects the highlights resources. This never sends a request.
1188    pub fn highlights(&self) -> InstagramProfileHighlightsResource {
1189        InstagramProfileHighlightsResource {
1190            scope: self.scope.clone(),
1191        }
1192    }
1193
1194    /// Selects the pinned posts resources. This never sends a request.
1195    pub fn pinned_posts(&self) -> InstagramProfilePinnedPostsResource {
1196        InstagramProfilePinnedPostsResource {
1197            scope: self.scope.clone(),
1198        }
1199    }
1200
1201    /// Selects the posts resources. This never sends a request.
1202    pub fn posts(&self) -> InstagramProfilePostsResource {
1203        InstagramProfilePostsResource {
1204            scope: self.scope.clone(),
1205        }
1206    }
1207
1208    /// Selects the reels resources. This never sends a request.
1209    pub fn reels(&self) -> InstagramProfileReelsResource {
1210        InstagramProfileReelsResource {
1211            scope: self.scope.clone(),
1212        }
1213    }
1214
1215    /// Selects the reposts resources. This never sends a request.
1216    pub fn reposts(&self) -> InstagramProfileRepostsResource {
1217        InstagramProfileRepostsResource {
1218            scope: self.scope.clone(),
1219        }
1220    }
1221
1222    /// Selects the stories resources. This never sends a request.
1223    pub fn stories(&self) -> InstagramProfileStoriesResource {
1224        InstagramProfileStoriesResource {
1225            scope: self.scope.clone(),
1226        }
1227    }
1228
1229    /// Selects the suggested resources. This never sends a request.
1230    pub fn suggested(&self) -> InstagramProfileSuggestedResource {
1231        InstagramProfileSuggestedResource {
1232            scope: self.scope.clone(),
1233        }
1234    }
1235
1236    /// Selects the tagged posts resources. This never sends a request.
1237    pub fn tagged_posts(&self) -> InstagramProfileTaggedPostsResource {
1238        InstagramProfileTaggedPostsResource {
1239            scope: self.scope.clone(),
1240        }
1241    }
1242
1243    /// Selects the videos resources. This never sends a request.
1244    pub fn videos(&self) -> InstagramProfileVideosResource {
1245        InstagramProfileVideosResource {
1246            scope: self.scope.clone(),
1247        }
1248    }
1249
1250    /// Get a profile.
1251    ///
1252    /// Return one public profile. Use @username or a platform ID as the identifier.
1253    /// Test and Live use the same route, parameters, response schema, pagination, and
1254    /// errors. In Test, null means unavailable, not zero.
1255    ///
1256    /// `GET /v1/instagram/profiles/{identifier}`
1257    pub async fn get(
1258        &self,
1259        options: impl Into<Option<InstagramProfileOptions>>,
1260    ) -> Result<InstagramProfileResponse, Error> {
1261        let options = options.into().unwrap_or_default();
1262        self.scope
1263            .operation(
1264                Method::GET,
1265                "/v1/instagram/profiles/{identifier}",
1266                options.query(),
1267                options.request_options,
1268            )?
1269            .send()
1270            .await
1271    }
1272}
1273
1274/// The `instagram.profile.about` resources.
1275///
1276/// Selecting a resource never sends a request. Only its terminal operations do.
1277#[derive(Clone, Debug)]
1278pub struct InstagramProfileAboutResource {
1279    scope: Scope,
1280}
1281
1282impl InstagramProfileAboutResource {
1283    /// Get profile about information.
1284    ///
1285    /// Get profile about information from public Instagram data. Test and Live use the
1286    /// same route, parameters, response schema, pagination, and errors. In Test, null
1287    /// means unavailable, not zero.
1288    ///
1289    /// `GET /v1/instagram/profiles/{identifier}/about`
1290    pub async fn get(
1291        &self,
1292        options: impl Into<Option<InstagramProfileAboutOptions>>,
1293    ) -> Result<InstagramProfileAboutResponse, Error> {
1294        let options = options.into().unwrap_or_default();
1295        self.scope
1296            .operation(
1297                Method::GET,
1298                "/v1/instagram/profiles/{identifier}/about",
1299                options.query(),
1300                options.request_options,
1301            )?
1302            .send()
1303            .await
1304    }
1305}
1306
1307/// The `instagram.profile.businessRecommendations` resources.
1308///
1309/// Selecting a resource never sends a request. Only its terminal operations do.
1310#[derive(Clone, Debug)]
1311pub struct InstagramProfileBusinessRecommendationsResource {
1312    scope: Scope,
1313}
1314
1315impl InstagramProfileBusinessRecommendationsResource {
1316    /// List business recommendations.
1317    ///
1318    /// List business recommendations from public Instagram data. Test and Live use the
1319    /// same route, parameters, response schema, pagination, and errors. In Test, null
1320    /// means unavailable, not zero.
1321    ///
1322    /// `GET /v1/instagram/profiles/{identifier}/business-recommendations`
1323    pub async fn list(
1324        &self,
1325        options: impl Into<Option<InstagramProfileBusinessRecommendationsOptions>>,
1326    ) -> Result<InstagramProfileBusinessRecommendationsPage, Error> {
1327        let options = options.into().unwrap_or_default();
1328        self.scope
1329            .operation(
1330                Method::GET,
1331                "/v1/instagram/profiles/{identifier}/business-recommendations",
1332                options.query(),
1333                options.request_options,
1334            )?
1335            .send_page()
1336            .await
1337    }
1338
1339    /// Iterates lazily over every item of [`list`](Self::list), one page per request.
1340    pub fn items(
1341        &self,
1342        options: impl Into<Option<InstagramProfileBusinessRecommendationsOptions>>,
1343    ) -> Items<InstagramProfileSummary> {
1344        let options = options.into().unwrap_or_default();
1345        Items::new(self.scope.operation(
1346            Method::GET,
1347            "/v1/instagram/profiles/{identifier}/business-recommendations",
1348            options.query(),
1349            options.request_options,
1350        ))
1351    }
1352}
1353
1354/// The `instagram.profile.followers` resources.
1355///
1356/// Selecting a resource never sends a request. Only its terminal operations do.
1357#[derive(Clone, Debug)]
1358pub struct InstagramProfileFollowersResource {
1359    scope: Scope,
1360}
1361
1362impl InstagramProfileFollowersResource {
1363    /// List profile followers.
1364    ///
1365    /// Return a cursor-paginated collection of Instagram profiles. Test and Live use
1366    /// the same route, parameters, response schema, pagination, and errors. In Test,
1367    /// null means unavailable, not zero.
1368    ///
1369    /// `GET /v1/instagram/profiles/{identifier}/followers`
1370    pub async fn list(
1371        &self,
1372        options: impl Into<Option<InstagramProfileFollowersOptions>>,
1373    ) -> Result<InstagramProfileFollowersPage, Error> {
1374        let options = options.into().unwrap_or_default();
1375        self.scope
1376            .operation(
1377                Method::GET,
1378                "/v1/instagram/profiles/{identifier}/followers",
1379                options.query(),
1380                options.request_options,
1381            )?
1382            .send_page()
1383            .await
1384    }
1385
1386    /// Iterates lazily over every item of [`list`](Self::list), one page per request.
1387    pub fn items(
1388        &self,
1389        options: impl Into<Option<InstagramProfileFollowersOptions>>,
1390    ) -> Items<InstagramProfile> {
1391        let options = options.into().unwrap_or_default();
1392        Items::new(self.scope.operation(
1393            Method::GET,
1394            "/v1/instagram/profiles/{identifier}/followers",
1395            options.query(),
1396            options.request_options,
1397        ))
1398    }
1399
1400    /// Search profile followers.
1401    ///
1402    /// Search within a public profile's followers collection. Test and Live use the
1403    /// same route, parameters, response schema, pagination, and errors. In Test, null
1404    /// means unavailable, not zero.
1405    ///
1406    /// `GET /v1/instagram/profiles/{identifier}/followers/search`
1407    pub async fn search(
1408        &self,
1409        options: InstagramProfileFollowersSearchOptions,
1410    ) -> Result<InstagramProfileFollowersSearchPage, Error> {
1411        self.scope
1412            .operation(
1413                Method::GET,
1414                "/v1/instagram/profiles/{identifier}/followers/search",
1415                options.query(),
1416                options.request_options,
1417            )?
1418            .send_page()
1419            .await
1420    }
1421
1422    /// Iterates lazily over every item of [`search`](Self::search), one page per request.
1423    pub fn search_items(
1424        &self,
1425        options: InstagramProfileFollowersSearchOptions,
1426    ) -> Items<InstagramProfile> {
1427        Items::new(self.scope.operation(
1428            Method::GET,
1429            "/v1/instagram/profiles/{identifier}/followers/search",
1430            options.query(),
1431            options.request_options,
1432        ))
1433    }
1434}
1435
1436/// The `instagram.profile.following` resources.
1437///
1438/// Selecting a resource never sends a request. Only its terminal operations do.
1439#[derive(Clone, Debug)]
1440pub struct InstagramProfileFollowingResource {
1441    scope: Scope,
1442}
1443
1444impl InstagramProfileFollowingResource {
1445    /// List profile following.
1446    ///
1447    /// Return a cursor-paginated collection of Instagram profiles. Test and Live use
1448    /// the same route, parameters, response schema, pagination, and errors. In Test,
1449    /// null means unavailable, not zero.
1450    ///
1451    /// `GET /v1/instagram/profiles/{identifier}/following`
1452    pub async fn list(
1453        &self,
1454        options: impl Into<Option<InstagramProfileFollowingOptions>>,
1455    ) -> Result<InstagramProfileFollowingPage, Error> {
1456        let options = options.into().unwrap_or_default();
1457        self.scope
1458            .operation(
1459                Method::GET,
1460                "/v1/instagram/profiles/{identifier}/following",
1461                options.query(),
1462                options.request_options,
1463            )?
1464            .send_page()
1465            .await
1466    }
1467
1468    /// Iterates lazily over every item of [`list`](Self::list), one page per request.
1469    pub fn items(
1470        &self,
1471        options: impl Into<Option<InstagramProfileFollowingOptions>>,
1472    ) -> Items<InstagramProfile> {
1473        let options = options.into().unwrap_or_default();
1474        Items::new(self.scope.operation(
1475            Method::GET,
1476            "/v1/instagram/profiles/{identifier}/following",
1477            options.query(),
1478            options.request_options,
1479        ))
1480    }
1481
1482    /// Search profile following.
1483    ///
1484    /// Search within a public profile's following collection. Test and Live use the
1485    /// same route, parameters, response schema, pagination, and errors. In Test, null
1486    /// means unavailable, not zero.
1487    ///
1488    /// `GET /v1/instagram/profiles/{identifier}/following/search`
1489    pub async fn search(
1490        &self,
1491        options: InstagramProfileFollowingSearchOptions,
1492    ) -> Result<InstagramProfileFollowingSearchPage, Error> {
1493        self.scope
1494            .operation(
1495                Method::GET,
1496                "/v1/instagram/profiles/{identifier}/following/search",
1497                options.query(),
1498                options.request_options,
1499            )?
1500            .send_page()
1501            .await
1502    }
1503
1504    /// Iterates lazily over every item of [`search`](Self::search), one page per request.
1505    pub fn search_items(
1506        &self,
1507        options: InstagramProfileFollowingSearchOptions,
1508    ) -> Items<InstagramProfile> {
1509        Items::new(self.scope.operation(
1510            Method::GET,
1511            "/v1/instagram/profiles/{identifier}/following/search",
1512            options.query(),
1513            options.request_options,
1514        ))
1515    }
1516}
1517
1518/// The `instagram.profile.highlights` resources.
1519///
1520/// Selecting a resource never sends a request. Only its terminal operations do.
1521#[derive(Clone, Debug)]
1522pub struct InstagramProfileHighlightsResource {
1523    scope: Scope,
1524}
1525
1526impl InstagramProfileHighlightsResource {
1527    /// List profile highlights.
1528    ///
1529    /// List profile highlights from public Instagram data. Test and Live use the same
1530    /// route, parameters, response schema, pagination, and errors. In Test, null means
1531    /// unavailable, not zero.
1532    ///
1533    /// `GET /v1/instagram/profiles/{identifier}/highlights`
1534    pub async fn list(
1535        &self,
1536        options: impl Into<Option<InstagramProfileHighlightsOptions>>,
1537    ) -> Result<InstagramProfileHighlightsPage, Error> {
1538        let options = options.into().unwrap_or_default();
1539        self.scope
1540            .operation(
1541                Method::GET,
1542                "/v1/instagram/profiles/{identifier}/highlights",
1543                options.query(),
1544                options.request_options,
1545            )?
1546            .send_page()
1547            .await
1548    }
1549
1550    /// Iterates lazily over every item of [`list`](Self::list), one page per request.
1551    pub fn items(
1552        &self,
1553        options: impl Into<Option<InstagramProfileHighlightsOptions>>,
1554    ) -> Items<InstagramHighlight> {
1555        let options = options.into().unwrap_or_default();
1556        Items::new(self.scope.operation(
1557            Method::GET,
1558            "/v1/instagram/profiles/{identifier}/highlights",
1559            options.query(),
1560            options.request_options,
1561        ))
1562    }
1563}
1564
1565/// The `instagram.profile.pinnedPosts` resources.
1566///
1567/// Selecting a resource never sends a request. Only its terminal operations do.
1568#[derive(Clone, Debug)]
1569pub struct InstagramProfilePinnedPostsResource {
1570    scope: Scope,
1571}
1572
1573impl InstagramProfilePinnedPostsResource {
1574    /// List profile pinned posts.
1575    ///
1576    /// Return a cursor-paginated collection of a public Instagram profile's pinned
1577    /// posts. Test and Live use the same route, parameters, response schema,
1578    /// pagination, and errors. In Test, null means unavailable, not zero.
1579    ///
1580    /// `GET /v1/instagram/profiles/{identifier}/pinned-posts`
1581    pub async fn list(
1582        &self,
1583        options: impl Into<Option<InstagramProfilePinnedPostsOptions>>,
1584    ) -> Result<InstagramProfilePinnedPostsPage, Error> {
1585        let options = options.into().unwrap_or_default();
1586        self.scope
1587            .operation(
1588                Method::GET,
1589                "/v1/instagram/profiles/{identifier}/pinned-posts",
1590                options.query(),
1591                options.request_options,
1592            )?
1593            .send_page()
1594            .await
1595    }
1596
1597    /// Iterates lazily over every item of [`list`](Self::list), one page per request.
1598    pub fn items(
1599        &self,
1600        options: impl Into<Option<InstagramProfilePinnedPostsOptions>>,
1601    ) -> Items<InstagramPost> {
1602        let options = options.into().unwrap_or_default();
1603        Items::new(self.scope.operation(
1604            Method::GET,
1605            "/v1/instagram/profiles/{identifier}/pinned-posts",
1606            options.query(),
1607            options.request_options,
1608        ))
1609    }
1610}
1611
1612/// The `instagram.profile.posts` resources.
1613///
1614/// Selecting a resource never sends a request. Only its terminal operations do.
1615#[derive(Clone, Debug)]
1616pub struct InstagramProfilePostsResource {
1617    scope: Scope,
1618}
1619
1620impl InstagramProfilePostsResource {
1621    /// List profile posts.
1622    ///
1623    /// Return a stable page of posts for one public profile. Test and Live use the same
1624    /// route, parameters, response schema, pagination, and errors. In Test, null means
1625    /// unavailable, not zero.
1626    ///
1627    /// `GET /v1/instagram/profiles/{identifier}/posts`
1628    pub async fn list(
1629        &self,
1630        options: impl Into<Option<InstagramProfilePostsOptions>>,
1631    ) -> Result<InstagramProfilePostsPage, Error> {
1632        let options = options.into().unwrap_or_default();
1633        self.scope
1634            .operation(
1635                Method::GET,
1636                "/v1/instagram/profiles/{identifier}/posts",
1637                options.query(),
1638                options.request_options,
1639            )?
1640            .send_page()
1641            .await
1642    }
1643
1644    /// Iterates lazily over every item of [`list`](Self::list), one page per request.
1645    pub fn items(
1646        &self,
1647        options: impl Into<Option<InstagramProfilePostsOptions>>,
1648    ) -> Items<InstagramPost> {
1649        let options = options.into().unwrap_or_default();
1650        Items::new(self.scope.operation(
1651            Method::GET,
1652            "/v1/instagram/profiles/{identifier}/posts",
1653            options.query(),
1654            options.request_options,
1655        ))
1656    }
1657}
1658
1659/// The `instagram.profile.reels` resources.
1660///
1661/// Selecting a resource never sends a request. Only its terminal operations do.
1662#[derive(Clone, Debug)]
1663pub struct InstagramProfileReelsResource {
1664    scope: Scope,
1665}
1666
1667impl InstagramProfileReelsResource {
1668    /// List profile reels.
1669    ///
1670    /// Return a cursor-paginated collection of a public Instagram profile's reels. Test
1671    /// and Live use the same route, parameters, response schema, pagination, and
1672    /// errors. In Test, null means unavailable, not zero.
1673    ///
1674    /// `GET /v1/instagram/profiles/{identifier}/reels`
1675    pub async fn list(
1676        &self,
1677        options: impl Into<Option<InstagramProfileReelsOptions>>,
1678    ) -> Result<InstagramProfileReelsPage, Error> {
1679        let options = options.into().unwrap_or_default();
1680        self.scope
1681            .operation(
1682                Method::GET,
1683                "/v1/instagram/profiles/{identifier}/reels",
1684                options.query(),
1685                options.request_options,
1686            )?
1687            .send_page()
1688            .await
1689    }
1690
1691    /// Iterates lazily over every item of [`list`](Self::list), one page per request.
1692    pub fn items(
1693        &self,
1694        options: impl Into<Option<InstagramProfileReelsOptions>>,
1695    ) -> Items<InstagramPost> {
1696        let options = options.into().unwrap_or_default();
1697        Items::new(self.scope.operation(
1698            Method::GET,
1699            "/v1/instagram/profiles/{identifier}/reels",
1700            options.query(),
1701            options.request_options,
1702        ))
1703    }
1704}
1705
1706/// The `instagram.profile.reposts` resources.
1707///
1708/// Selecting a resource never sends a request. Only its terminal operations do.
1709#[derive(Clone, Debug)]
1710pub struct InstagramProfileRepostsResource {
1711    scope: Scope,
1712}
1713
1714impl InstagramProfileRepostsResource {
1715    /// List profile reposts.
1716    ///
1717    /// Return a cursor-paginated collection of a public Instagram profile's reposts.
1718    /// Test and Live use the same route, parameters, response schema, pagination, and
1719    /// errors. In Test, null means unavailable, not zero.
1720    ///
1721    /// `GET /v1/instagram/profiles/{identifier}/reposts`
1722    pub async fn list(
1723        &self,
1724        options: impl Into<Option<InstagramProfileRepostsOptions>>,
1725    ) -> Result<InstagramProfileRepostsPage, Error> {
1726        let options = options.into().unwrap_or_default();
1727        self.scope
1728            .operation(
1729                Method::GET,
1730                "/v1/instagram/profiles/{identifier}/reposts",
1731                options.query(),
1732                options.request_options,
1733            )?
1734            .send_page()
1735            .await
1736    }
1737
1738    /// Iterates lazily over every item of [`list`](Self::list), one page per request.
1739    pub fn items(
1740        &self,
1741        options: impl Into<Option<InstagramProfileRepostsOptions>>,
1742    ) -> Items<InstagramPost> {
1743        let options = options.into().unwrap_or_default();
1744        Items::new(self.scope.operation(
1745            Method::GET,
1746            "/v1/instagram/profiles/{identifier}/reposts",
1747            options.query(),
1748            options.request_options,
1749        ))
1750    }
1751}
1752
1753/// The `instagram.profile.stories` resources.
1754///
1755/// Selecting a resource never sends a request. Only its terminal operations do.
1756#[derive(Clone, Debug)]
1757pub struct InstagramProfileStoriesResource {
1758    scope: Scope,
1759}
1760
1761impl InstagramProfileStoriesResource {
1762    /// List profile stories.
1763    ///
1764    /// List profile stories from public Instagram data. Test and Live use the same
1765    /// route, parameters, response schema, pagination, and errors. In Test, null means
1766    /// unavailable, not zero.
1767    ///
1768    /// `GET /v1/instagram/profiles/{identifier}/stories`
1769    pub async fn list(
1770        &self,
1771        options: impl Into<Option<InstagramProfileStoriesOptions>>,
1772    ) -> Result<InstagramProfileStoriesPage, Error> {
1773        let options = options.into().unwrap_or_default();
1774        self.scope
1775            .operation(
1776                Method::GET,
1777                "/v1/instagram/profiles/{identifier}/stories",
1778                options.query(),
1779                options.request_options,
1780            )?
1781            .send_page()
1782            .await
1783    }
1784
1785    /// Iterates lazily over every item of [`list`](Self::list), one page per request.
1786    pub fn items(
1787        &self,
1788        options: impl Into<Option<InstagramProfileStoriesOptions>>,
1789    ) -> Items<InstagramStory> {
1790        let options = options.into().unwrap_or_default();
1791        Items::new(self.scope.operation(
1792            Method::GET,
1793            "/v1/instagram/profiles/{identifier}/stories",
1794            options.query(),
1795            options.request_options,
1796        ))
1797    }
1798}
1799
1800/// The `instagram.profile.suggested` resources.
1801///
1802/// Selecting a resource never sends a request. Only its terminal operations do.
1803#[derive(Clone, Debug)]
1804pub struct InstagramProfileSuggestedResource {
1805    scope: Scope,
1806}
1807
1808impl InstagramProfileSuggestedResource {
1809    /// List profile suggested.
1810    ///
1811    /// Return a cursor-paginated collection of Instagram profiles. Test and Live use
1812    /// the same route, parameters, response schema, pagination, and errors. In Test,
1813    /// null means unavailable, not zero.
1814    ///
1815    /// `GET /v1/instagram/profiles/{identifier}/suggested`
1816    pub async fn list(
1817        &self,
1818        options: impl Into<Option<InstagramProfileSuggestedOptions>>,
1819    ) -> Result<InstagramProfileSuggestedPage, Error> {
1820        let options = options.into().unwrap_or_default();
1821        self.scope
1822            .operation(
1823                Method::GET,
1824                "/v1/instagram/profiles/{identifier}/suggested",
1825                options.query(),
1826                options.request_options,
1827            )?
1828            .send_page()
1829            .await
1830    }
1831
1832    /// Iterates lazily over every item of [`list`](Self::list), one page per request.
1833    pub fn items(
1834        &self,
1835        options: impl Into<Option<InstagramProfileSuggestedOptions>>,
1836    ) -> Items<InstagramProfile> {
1837        let options = options.into().unwrap_or_default();
1838        Items::new(self.scope.operation(
1839            Method::GET,
1840            "/v1/instagram/profiles/{identifier}/suggested",
1841            options.query(),
1842            options.request_options,
1843        ))
1844    }
1845}
1846
1847/// The `instagram.profile.taggedPosts` resources.
1848///
1849/// Selecting a resource never sends a request. Only its terminal operations do.
1850#[derive(Clone, Debug)]
1851pub struct InstagramProfileTaggedPostsResource {
1852    scope: Scope,
1853}
1854
1855impl InstagramProfileTaggedPostsResource {
1856    /// List profile tagged posts.
1857    ///
1858    /// Return a cursor-paginated collection of a public Instagram profile's tagged
1859    /// posts. Test and Live use the same route, parameters, response schema,
1860    /// pagination, and errors. In Test, null means unavailable, not zero.
1861    ///
1862    /// `GET /v1/instagram/profiles/{identifier}/tagged-posts`
1863    pub async fn list(
1864        &self,
1865        options: impl Into<Option<InstagramProfileTaggedPostsOptions>>,
1866    ) -> Result<InstagramProfileTaggedPostsPage, Error> {
1867        let options = options.into().unwrap_or_default();
1868        self.scope
1869            .operation(
1870                Method::GET,
1871                "/v1/instagram/profiles/{identifier}/tagged-posts",
1872                options.query(),
1873                options.request_options,
1874            )?
1875            .send_page()
1876            .await
1877    }
1878
1879    /// Iterates lazily over every item of [`list`](Self::list), one page per request.
1880    pub fn items(
1881        &self,
1882        options: impl Into<Option<InstagramProfileTaggedPostsOptions>>,
1883    ) -> Items<InstagramPost> {
1884        let options = options.into().unwrap_or_default();
1885        Items::new(self.scope.operation(
1886            Method::GET,
1887            "/v1/instagram/profiles/{identifier}/tagged-posts",
1888            options.query(),
1889            options.request_options,
1890        ))
1891    }
1892}
1893
1894/// The `instagram.profile.videos` resources.
1895///
1896/// Selecting a resource never sends a request. Only its terminal operations do.
1897#[derive(Clone, Debug)]
1898pub struct InstagramProfileVideosResource {
1899    scope: Scope,
1900}
1901
1902impl InstagramProfileVideosResource {
1903    /// List profile videos.
1904    ///
1905    /// Return a cursor-paginated collection of a public Instagram profile's videos.
1906    /// Test and Live use the same route, parameters, response schema, pagination, and
1907    /// errors. In Test, null means unavailable, not zero.
1908    ///
1909    /// `GET /v1/instagram/profiles/{identifier}/videos`
1910    pub async fn list(
1911        &self,
1912        options: impl Into<Option<InstagramProfileVideosOptions>>,
1913    ) -> Result<InstagramProfileVideosPage, Error> {
1914        let options = options.into().unwrap_or_default();
1915        self.scope
1916            .operation(
1917                Method::GET,
1918                "/v1/instagram/profiles/{identifier}/videos",
1919                options.query(),
1920                options.request_options,
1921            )?
1922            .send_page()
1923            .await
1924    }
1925
1926    /// Iterates lazily over every item of [`list`](Self::list), one page per request.
1927    pub fn items(
1928        &self,
1929        options: impl Into<Option<InstagramProfileVideosOptions>>,
1930    ) -> Items<InstagramPost> {
1931        let options = options.into().unwrap_or_default();
1932        Items::new(self.scope.operation(
1933            Method::GET,
1934            "/v1/instagram/profiles/{identifier}/videos",
1935            options.query(),
1936            options.request_options,
1937        ))
1938    }
1939}
1940
1941/// The `instagram.search` resources.
1942///
1943/// Selecting a resource never sends a request. Only its terminal operations do.
1944#[derive(Clone, Debug)]
1945pub struct InstagramSearchResource {
1946    scope: Scope,
1947}
1948
1949impl InstagramSearchResource {
1950    /// Selects the hashtags resources. This never sends a request.
1951    pub fn hashtags(&self) -> InstagramSearchHashtagsResource {
1952        InstagramSearchHashtagsResource {
1953            scope: self.scope.clone(),
1954        }
1955    }
1956
1957    /// Selects the music resources. This never sends a request.
1958    pub fn music(&self) -> InstagramSearchMusicResource {
1959        InstagramSearchMusicResource {
1960            scope: self.scope.clone(),
1961        }
1962    }
1963
1964    /// Selects the places resources. This never sends a request.
1965    pub fn places(&self) -> InstagramSearchPlacesResource {
1966        InstagramSearchPlacesResource {
1967            scope: self.scope.clone(),
1968        }
1969    }
1970
1971    /// Selects the profiles resources. This never sends a request.
1972    pub fn profiles(&self) -> InstagramSearchProfilesResource {
1973        InstagramSearchProfilesResource {
1974            scope: self.scope.clone(),
1975        }
1976    }
1977
1978    /// Selects the reels resources. This never sends a request.
1979    pub fn reels(&self) -> InstagramSearchReelsResource {
1980        InstagramSearchReelsResource {
1981            scope: self.scope.clone(),
1982        }
1983    }
1984
1985    /// Selects the top resources. This never sends a request.
1986    pub fn top(&self) -> InstagramSearchTopResource {
1987        InstagramSearchTopResource {
1988            scope: self.scope.clone(),
1989        }
1990    }
1991}
1992
1993/// The `instagram.search.hashtags` resources.
1994///
1995/// Selecting a resource never sends a request. Only its terminal operations do.
1996#[derive(Clone, Debug)]
1997pub struct InstagramSearchHashtagsResource {
1998    scope: Scope,
1999}
2000
2001impl InstagramSearchHashtagsResource {
2002    /// Search Instagram hashtags.
2003    ///
2004    /// Search public Instagram hashtags with cursor pagination. Test and Live use the
2005    /// same route, parameters, response schema, pagination, and errors. In Test, null
2006    /// means unavailable, not zero.
2007    ///
2008    /// `GET /v1/instagram/search/hashtags`
2009    pub async fn list(
2010        &self,
2011        options: InstagramSearchHashtagsOptions,
2012    ) -> Result<InstagramSearchHashtagsPage, Error> {
2013        self.scope
2014            .operation(
2015                Method::GET,
2016                "/v1/instagram/search/hashtags",
2017                options.query(),
2018                options.request_options,
2019            )?
2020            .send_page()
2021            .await
2022    }
2023
2024    /// Iterates lazily over every item of [`list`](Self::list), one page per request.
2025    pub fn items(&self, options: InstagramSearchHashtagsOptions) -> Items<InstagramHashtag> {
2026        Items::new(self.scope.operation(
2027            Method::GET,
2028            "/v1/instagram/search/hashtags",
2029            options.query(),
2030            options.request_options,
2031        ))
2032    }
2033}
2034
2035/// The `instagram.search.music` resources.
2036///
2037/// Selecting a resource never sends a request. Only its terminal operations do.
2038#[derive(Clone, Debug)]
2039pub struct InstagramSearchMusicResource {
2040    scope: Scope,
2041}
2042
2043impl InstagramSearchMusicResource {
2044    /// Search Instagram music.
2045    ///
2046    /// Search public Instagram music with cursor pagination. Test and Live use the same
2047    /// route, parameters, response schema, pagination, and errors. In Test, null means
2048    /// unavailable, not zero.
2049    ///
2050    /// `GET /v1/instagram/search/music`
2051    pub async fn list(
2052        &self,
2053        options: InstagramSearchMusicOptions,
2054    ) -> Result<InstagramSearchMusicPage, Error> {
2055        self.scope
2056            .operation(
2057                Method::GET,
2058                "/v1/instagram/search/music",
2059                options.query(),
2060                options.request_options,
2061            )?
2062            .send_page()
2063            .await
2064    }
2065
2066    /// Iterates lazily over every item of [`list`](Self::list), one page per request.
2067    pub fn items(&self, options: InstagramSearchMusicOptions) -> Items<InstagramMusic> {
2068        Items::new(self.scope.operation(
2069            Method::GET,
2070            "/v1/instagram/search/music",
2071            options.query(),
2072            options.request_options,
2073        ))
2074    }
2075}
2076
2077/// The `instagram.search.places` resources.
2078///
2079/// Selecting a resource never sends a request. Only its terminal operations do.
2080#[derive(Clone, Debug)]
2081pub struct InstagramSearchPlacesResource {
2082    scope: Scope,
2083}
2084
2085impl InstagramSearchPlacesResource {
2086    /// Search Instagram places.
2087    ///
2088    /// Search public Instagram places with cursor pagination. Test and Live use the
2089    /// same route, parameters, response schema, pagination, and errors. In Test, null
2090    /// means unavailable, not zero.
2091    ///
2092    /// `GET /v1/instagram/search/places`
2093    pub async fn list(
2094        &self,
2095        options: InstagramSearchPlacesOptions,
2096    ) -> Result<InstagramSearchPlacesPage, Error> {
2097        self.scope
2098            .operation(
2099                Method::GET,
2100                "/v1/instagram/search/places",
2101                options.query(),
2102                options.request_options,
2103            )?
2104            .send_page()
2105            .await
2106    }
2107
2108    /// Iterates lazily over every item of [`list`](Self::list), one page per request.
2109    pub fn items(&self, options: InstagramSearchPlacesOptions) -> Items<InstagramLocation> {
2110        Items::new(self.scope.operation(
2111            Method::GET,
2112            "/v1/instagram/search/places",
2113            options.query(),
2114            options.request_options,
2115        ))
2116    }
2117}
2118
2119/// The `instagram.search.profiles` resources.
2120///
2121/// Selecting a resource never sends a request. Only its terminal operations do.
2122#[derive(Clone, Debug)]
2123pub struct InstagramSearchProfilesResource {
2124    scope: Scope,
2125}
2126
2127impl InstagramSearchProfilesResource {
2128    /// Search Instagram profiles.
2129    ///
2130    /// Search public Instagram profiles with cursor pagination. Test and Live use the
2131    /// same route, parameters, response schema, pagination, and errors. In Test, null
2132    /// means unavailable, not zero.
2133    ///
2134    /// `GET /v1/instagram/search/profiles`
2135    pub async fn list(
2136        &self,
2137        options: InstagramSearchProfilesOptions,
2138    ) -> Result<InstagramSearchProfilesPage, Error> {
2139        self.scope
2140            .operation(
2141                Method::GET,
2142                "/v1/instagram/search/profiles",
2143                options.query(),
2144                options.request_options,
2145            )?
2146            .send_page()
2147            .await
2148    }
2149
2150    /// Iterates lazily over every item of [`list`](Self::list), one page per request.
2151    pub fn items(&self, options: InstagramSearchProfilesOptions) -> Items<InstagramProfile> {
2152        Items::new(self.scope.operation(
2153            Method::GET,
2154            "/v1/instagram/search/profiles",
2155            options.query(),
2156            options.request_options,
2157        ))
2158    }
2159}
2160
2161/// The `instagram.search.reels` resources.
2162///
2163/// Selecting a resource never sends a request. Only its terminal operations do.
2164#[derive(Clone, Debug)]
2165pub struct InstagramSearchReelsResource {
2166    scope: Scope,
2167}
2168
2169impl InstagramSearchReelsResource {
2170    /// Search Instagram reels.
2171    ///
2172    /// Search public Instagram reels with cursor pagination. Test and Live use the same
2173    /// route, parameters, response schema, pagination, and errors. In Test, null means
2174    /// unavailable, not zero.
2175    ///
2176    /// `GET /v1/instagram/search/reels`
2177    pub async fn list(
2178        &self,
2179        options: InstagramSearchReelsOptions,
2180    ) -> Result<InstagramSearchReelsPage, Error> {
2181        self.scope
2182            .operation(
2183                Method::GET,
2184                "/v1/instagram/search/reels",
2185                options.query(),
2186                options.request_options,
2187            )?
2188            .send_page()
2189            .await
2190    }
2191
2192    /// Iterates lazily over every item of [`list`](Self::list), one page per request.
2193    pub fn items(&self, options: InstagramSearchReelsOptions) -> Items<InstagramPost> {
2194        Items::new(self.scope.operation(
2195            Method::GET,
2196            "/v1/instagram/search/reels",
2197            options.query(),
2198            options.request_options,
2199        ))
2200    }
2201}
2202
2203/// The `instagram.search.top` resources.
2204///
2205/// Selecting a resource never sends a request. Only its terminal operations do.
2206#[derive(Clone, Debug)]
2207pub struct InstagramSearchTopResource {
2208    scope: Scope,
2209}
2210
2211impl InstagramSearchTopResource {
2212    /// Search all Instagram results.
2213    ///
2214    /// Search all Instagram results from public Instagram data. Test and Live use the
2215    /// same route, parameters, response schema, pagination, and errors. In Test, null
2216    /// means unavailable, not zero.
2217    ///
2218    /// `GET /v1/instagram/search/top`
2219    pub async fn list(
2220        &self,
2221        options: InstagramSearchTopOptions,
2222    ) -> Result<InstagramSearchTopPage, Error> {
2223        self.scope
2224            .operation(
2225                Method::GET,
2226                "/v1/instagram/search/top",
2227                options.query(),
2228                options.request_options,
2229            )?
2230            .send_page()
2231            .await
2232    }
2233
2234    /// Iterates lazily over every item of [`list`](Self::list), one page per request.
2235    pub fn items(&self, options: InstagramSearchTopOptions) -> Items<InstagramSearchResult> {
2236        Items::new(self.scope.operation(
2237            Method::GET,
2238            "/v1/instagram/search/top",
2239            options.query(),
2240            options.request_options,
2241        ))
2242    }
2243}
2244
2245/// One selected story on Instagram.
2246///
2247/// Selecting a resource never sends a request. Only its terminal operations do.
2248#[derive(Clone, Debug)]
2249pub struct InstagramStoryResource {
2250    scope: Scope,
2251}
2252
2253impl InstagramStoryResource {
2254    /// Get a story.
2255    ///
2256    /// Get a story from public Instagram data. Test and Live use the same route,
2257    /// parameters, response schema, pagination, and errors. In Test, null means
2258    /// unavailable, not zero.
2259    ///
2260    /// `GET /v1/instagram/stories/{identifier}`
2261    pub async fn get(
2262        &self,
2263        options: impl Into<Option<InstagramStoryOptions>>,
2264    ) -> Result<InstagramStoryResponse, Error> {
2265        let options = options.into().unwrap_or_default();
2266        self.scope
2267            .operation(
2268                Method::GET,
2269                "/v1/instagram/stories/{identifier}",
2270                options.query(),
2271                options.request_options,
2272            )?
2273            .send()
2274            .await
2275    }
2276}
2277
2278/// The `reddit` resources.
2279///
2280/// Selecting a resource never sends a request. Only its terminal operations do.
2281#[derive(Clone, Debug)]
2282pub struct RedditResource {
2283    scope: Scope,
2284}
2285
2286impl RedditResource {
2287    /// Selects one domain. This never sends a request.
2288    ///
2289    /// A raw string is the native ID or shorthand unless it is a supported social
2290    /// URL. Pass [`Id`](crate::Id) or [`Url`](crate::Url) to state the meaning.
2291    /// An invalid reference fails the first operation, before any request.
2292    pub fn domain(&self, reference: impl Into<ResourceReference>) -> RedditDomainResource {
2293        RedditDomainResource {
2294            scope: self.scope.select(
2295                "identifier",
2296                "reddit",
2297                "domain",
2298                Reference::from(reference.into()),
2299            ),
2300        }
2301    }
2302
2303    /// Selects one post. This never sends a request.
2304    ///
2305    /// A raw string is the native ID or shorthand unless it is a supported social
2306    /// URL. Pass [`Id`](crate::Id) or [`Url`](crate::Url) to state the meaning.
2307    /// An invalid reference fails the first operation, before any request.
2308    pub fn post(&self, reference: impl Into<ResourceReference>) -> RedditPostResource {
2309        RedditPostResource {
2310            scope: self.scope.select(
2311                "identifier",
2312                "reddit",
2313                "post",
2314                Reference::from(reference.into()),
2315            ),
2316        }
2317    }
2318
2319    /// Selects one profile. This never sends a request.
2320    ///
2321    /// A raw string is a username unless it is a supported social URL. Pass
2322    /// [`Username`](crate::Username), [`Id`](crate::Id), or [`Url`](crate::Url) to state the meaning.
2323    /// An invalid reference fails the first operation, before any request.
2324    pub fn profile(&self, reference: impl Into<ProfileReference>) -> RedditProfileResource {
2325        RedditProfileResource {
2326            scope: self.scope.select(
2327                "identifier",
2328                "reddit",
2329                "profile",
2330                Reference::from(reference.into()),
2331            ),
2332        }
2333    }
2334
2335    /// Selects the search resources. This never sends a request.
2336    pub fn search(&self) -> RedditSearchResource {
2337        RedditSearchResource {
2338            scope: self.scope.clone(),
2339        }
2340    }
2341
2342    /// Selects one subreddit. This never sends a request.
2343    ///
2344    /// A raw string is the native ID or shorthand unless it is a supported social
2345    /// URL. Pass [`Id`](crate::Id) or [`Url`](crate::Url) to state the meaning.
2346    /// An invalid reference fails the first operation, before any request.
2347    pub fn subreddit(&self, reference: impl Into<ResourceReference>) -> RedditSubredditResource {
2348        RedditSubredditResource {
2349            scope: self.scope.select(
2350                "identifier",
2351                "reddit",
2352                "subreddit",
2353                Reference::from(reference.into()),
2354            ),
2355        }
2356    }
2357
2358    /// Selects the subreddits resources. This never sends a request.
2359    pub fn subreddits(&self) -> RedditSubredditsResource {
2360        RedditSubredditsResource {
2361            scope: self.scope.clone(),
2362        }
2363    }
2364
2365    /// Selects the trending resources. This never sends a request.
2366    pub fn trending(&self) -> RedditTrendingResource {
2367        RedditTrendingResource {
2368            scope: self.scope.clone(),
2369        }
2370    }
2371}
2372
2373/// One selected domain on Reddit.
2374///
2375/// Selecting a resource never sends a request. Only its terminal operations do.
2376#[derive(Clone, Debug)]
2377pub struct RedditDomainResource {
2378    scope: Scope,
2379}
2380
2381impl RedditDomainResource {
2382    /// Selects the posts resources. This never sends a request.
2383    pub fn posts(&self) -> RedditDomainPostsResource {
2384        RedditDomainPostsResource {
2385            scope: self.scope.clone(),
2386        }
2387    }
2388}
2389
2390/// The `reddit.domain.posts` resources.
2391///
2392/// Selecting a resource never sends a request. Only its terminal operations do.
2393#[derive(Clone, Debug)]
2394pub struct RedditDomainPostsResource {
2395    scope: Scope,
2396}
2397
2398impl RedditDomainPostsResource {
2399    /// List domain posts.
2400    ///
2401    /// List domain posts from public Reddit data. Test and Live use the same route,
2402    /// parameters, response schema, pagination, and errors. In Test, null means
2403    /// unavailable, not zero.
2404    ///
2405    /// `GET /v1/reddit/domains/{identifier}/posts`
2406    pub async fn list(
2407        &self,
2408        options: impl Into<Option<RedditDomainPostsOptions>>,
2409    ) -> Result<RedditDomainPostsPage, Error> {
2410        let options = options.into().unwrap_or_default();
2411        self.scope
2412            .operation(
2413                Method::GET,
2414                "/v1/reddit/domains/{identifier}/posts",
2415                options.query(),
2416                options.request_options,
2417            )?
2418            .send_page()
2419            .await
2420    }
2421
2422    /// Iterates lazily over every item of [`list`](Self::list), one page per request.
2423    pub fn items(&self, options: impl Into<Option<RedditDomainPostsOptions>>) -> Items<RedditPost> {
2424        let options = options.into().unwrap_or_default();
2425        Items::new(self.scope.operation(
2426            Method::GET,
2427            "/v1/reddit/domains/{identifier}/posts",
2428            options.query(),
2429            options.request_options,
2430        ))
2431    }
2432}
2433
2434/// One selected post on Reddit.
2435///
2436/// Selecting a resource never sends a request. Only its terminal operations do.
2437#[derive(Clone, Debug)]
2438pub struct RedditPostResource {
2439    scope: Scope,
2440}
2441
2442impl RedditPostResource {
2443    /// Selects the comments resources. This never sends a request.
2444    pub fn comments(&self) -> RedditPostCommentsResource {
2445        RedditPostCommentsResource {
2446            scope: self.scope.clone(),
2447        }
2448    }
2449
2450    /// Selects the duplicates resources. This never sends a request.
2451    pub fn duplicates(&self) -> RedditPostDuplicatesResource {
2452        RedditPostDuplicatesResource {
2453            scope: self.scope.clone(),
2454        }
2455    }
2456
2457    /// Get a post.
2458    ///
2459    /// Get a post from public Reddit data. Test and Live use the same route,
2460    /// parameters, response schema, pagination, and errors. In Test, null means
2461    /// unavailable, not zero.
2462    ///
2463    /// `GET /v1/reddit/posts/{identifier}`
2464    pub async fn get(
2465        &self,
2466        options: impl Into<Option<RedditPostOptions>>,
2467    ) -> Result<RedditPostResponse, Error> {
2468        let options = options.into().unwrap_or_default();
2469        self.scope
2470            .operation(
2471                Method::GET,
2472                "/v1/reddit/posts/{identifier}",
2473                options.query(),
2474                options.request_options,
2475            )?
2476            .send()
2477            .await
2478    }
2479}
2480
2481/// The `reddit.post.comments` resources.
2482///
2483/// Selecting a resource never sends a request. Only its terminal operations do.
2484#[derive(Clone, Debug)]
2485pub struct RedditPostCommentsResource {
2486    scope: Scope,
2487}
2488
2489impl RedditPostCommentsResource {
2490    /// List post comments.
2491    ///
2492    /// List post comments from public Reddit data. Test and Live use the same route,
2493    /// parameters, response schema, pagination, and errors. In Test, null means
2494    /// unavailable, not zero.
2495    ///
2496    /// `GET /v1/reddit/posts/{identifier}/comments`
2497    pub async fn list(
2498        &self,
2499        options: impl Into<Option<RedditPostCommentsOptions>>,
2500    ) -> Result<RedditPostCommentsResponse, Error> {
2501        let options = options.into().unwrap_or_default();
2502        self.scope
2503            .operation(
2504                Method::GET,
2505                "/v1/reddit/posts/{identifier}/comments",
2506                options.query(),
2507                options.request_options,
2508            )?
2509            .send()
2510            .await
2511    }
2512}
2513
2514/// The `reddit.post.duplicates` resources.
2515///
2516/// Selecting a resource never sends a request. Only its terminal operations do.
2517#[derive(Clone, Debug)]
2518pub struct RedditPostDuplicatesResource {
2519    scope: Scope,
2520}
2521
2522impl RedditPostDuplicatesResource {
2523    /// List duplicate posts.
2524    ///
2525    /// List duplicate posts from public Reddit data. Test and Live use the same route,
2526    /// parameters, response schema, pagination, and errors. In Test, null means
2527    /// unavailable, not zero.
2528    ///
2529    /// `GET /v1/reddit/posts/{identifier}/duplicates`
2530    pub async fn list(
2531        &self,
2532        options: impl Into<Option<RedditPostDuplicatesOptions>>,
2533    ) -> Result<RedditPostDuplicatesPage, Error> {
2534        let options = options.into().unwrap_or_default();
2535        self.scope
2536            .operation(
2537                Method::GET,
2538                "/v1/reddit/posts/{identifier}/duplicates",
2539                options.query(),
2540                options.request_options,
2541            )?
2542            .send_page()
2543            .await
2544    }
2545
2546    /// Iterates lazily over every item of [`list`](Self::list), one page per request.
2547    pub fn items(
2548        &self,
2549        options: impl Into<Option<RedditPostDuplicatesOptions>>,
2550    ) -> Items<RedditPost> {
2551        let options = options.into().unwrap_or_default();
2552        Items::new(self.scope.operation(
2553            Method::GET,
2554            "/v1/reddit/posts/{identifier}/duplicates",
2555            options.query(),
2556            options.request_options,
2557        ))
2558    }
2559}
2560
2561/// One selected profile on Reddit.
2562///
2563/// Selecting a resource never sends a request. Only its terminal operations do.
2564#[derive(Clone, Debug)]
2565pub struct RedditProfileResource {
2566    scope: Scope,
2567}
2568
2569impl RedditProfileResource {
2570    /// Selects the comments resources. This never sends a request.
2571    pub fn comments(&self) -> RedditProfileCommentsResource {
2572        RedditProfileCommentsResource {
2573            scope: self.scope.clone(),
2574        }
2575    }
2576
2577    /// Selects the moderated resources. This never sends a request.
2578    pub fn moderated(&self) -> RedditProfileModeratedResource {
2579        RedditProfileModeratedResource {
2580            scope: self.scope.clone(),
2581        }
2582    }
2583
2584    /// Selects the posts resources. This never sends a request.
2585    pub fn posts(&self) -> RedditProfilePostsResource {
2586        RedditProfilePostsResource {
2587            scope: self.scope.clone(),
2588        }
2589    }
2590
2591    /// Selects the trophies resources. This never sends a request.
2592    pub fn trophies(&self) -> RedditProfileTrophiesResource {
2593        RedditProfileTrophiesResource {
2594            scope: self.scope.clone(),
2595        }
2596    }
2597
2598    /// Get a profile.
2599    ///
2600    /// Return one public Reddit profile. Use @username or a t2_ profile ID. An ID
2601    /// resolves only after the profile was read by username once. Test and Live use the
2602    /// same route, parameters, response schema, pagination, and errors. In Test, null
2603    /// means unavailable, not zero.
2604    ///
2605    /// `GET /v1/reddit/profiles/{identifier}`
2606    pub async fn get(
2607        &self,
2608        options: impl Into<Option<RedditProfileOptions>>,
2609    ) -> Result<RedditProfileResponse, Error> {
2610        let options = options.into().unwrap_or_default();
2611        self.scope
2612            .operation(
2613                Method::GET,
2614                "/v1/reddit/profiles/{identifier}",
2615                options.query(),
2616                options.request_options,
2617            )?
2618            .send()
2619            .await
2620    }
2621}
2622
2623/// The `reddit.profile.comments` resources.
2624///
2625/// Selecting a resource never sends a request. Only its terminal operations do.
2626#[derive(Clone, Debug)]
2627pub struct RedditProfileCommentsResource {
2628    scope: Scope,
2629}
2630
2631impl RedditProfileCommentsResource {
2632    /// List profile comments.
2633    ///
2634    /// List profile comments from public Reddit data. Test and Live use the same route,
2635    /// parameters, response schema, pagination, and errors. In Test, null means
2636    /// unavailable, not zero.
2637    ///
2638    /// `GET /v1/reddit/profiles/{identifier}/comments`
2639    pub async fn list(
2640        &self,
2641        options: impl Into<Option<RedditProfileCommentsOptions>>,
2642    ) -> Result<RedditProfileCommentsPage, Error> {
2643        let options = options.into().unwrap_or_default();
2644        self.scope
2645            .operation(
2646                Method::GET,
2647                "/v1/reddit/profiles/{identifier}/comments",
2648                options.query(),
2649                options.request_options,
2650            )?
2651            .send_page()
2652            .await
2653    }
2654
2655    /// Iterates lazily over every item of [`list`](Self::list), one page per request.
2656    pub fn items(
2657        &self,
2658        options: impl Into<Option<RedditProfileCommentsOptions>>,
2659    ) -> Items<RedditComment> {
2660        let options = options.into().unwrap_or_default();
2661        Items::new(self.scope.operation(
2662            Method::GET,
2663            "/v1/reddit/profiles/{identifier}/comments",
2664            options.query(),
2665            options.request_options,
2666        ))
2667    }
2668}
2669
2670/// The `reddit.profile.moderated` resources.
2671///
2672/// Selecting a resource never sends a request. Only its terminal operations do.
2673#[derive(Clone, Debug)]
2674pub struct RedditProfileModeratedResource {
2675    scope: Scope,
2676}
2677
2678impl RedditProfileModeratedResource {
2679    /// List moderated subreddits.
2680    ///
2681    /// List moderated subreddits from public Reddit data. Test and Live use the same
2682    /// route, parameters, response schema, pagination, and errors. In Test, null means
2683    /// unavailable, not zero.
2684    ///
2685    /// `GET /v1/reddit/profiles/{identifier}/moderated`
2686    pub async fn list(
2687        &self,
2688        options: impl Into<Option<RedditProfileModeratedOptions>>,
2689    ) -> Result<RedditProfileModeratedResponse, Error> {
2690        let options = options.into().unwrap_or_default();
2691        self.scope
2692            .operation(
2693                Method::GET,
2694                "/v1/reddit/profiles/{identifier}/moderated",
2695                options.query(),
2696                options.request_options,
2697            )?
2698            .send()
2699            .await
2700    }
2701}
2702
2703/// The `reddit.profile.posts` resources.
2704///
2705/// Selecting a resource never sends a request. Only its terminal operations do.
2706#[derive(Clone, Debug)]
2707pub struct RedditProfilePostsResource {
2708    scope: Scope,
2709}
2710
2711impl RedditProfilePostsResource {
2712    /// List profile posts.
2713    ///
2714    /// List profile posts from public Reddit data. Test and Live use the same route,
2715    /// parameters, response schema, pagination, and errors. In Test, null means
2716    /// unavailable, not zero.
2717    ///
2718    /// `GET /v1/reddit/profiles/{identifier}/posts`
2719    pub async fn list(
2720        &self,
2721        options: impl Into<Option<RedditProfilePostsOptions>>,
2722    ) -> Result<RedditProfilePostsPage, Error> {
2723        let options = options.into().unwrap_or_default();
2724        self.scope
2725            .operation(
2726                Method::GET,
2727                "/v1/reddit/profiles/{identifier}/posts",
2728                options.query(),
2729                options.request_options,
2730            )?
2731            .send_page()
2732            .await
2733    }
2734
2735    /// Iterates lazily over every item of [`list`](Self::list), one page per request.
2736    pub fn items(
2737        &self,
2738        options: impl Into<Option<RedditProfilePostsOptions>>,
2739    ) -> Items<RedditPost> {
2740        let options = options.into().unwrap_or_default();
2741        Items::new(self.scope.operation(
2742            Method::GET,
2743            "/v1/reddit/profiles/{identifier}/posts",
2744            options.query(),
2745            options.request_options,
2746        ))
2747    }
2748}
2749
2750/// The `reddit.profile.trophies` resources.
2751///
2752/// Selecting a resource never sends a request. Only its terminal operations do.
2753#[derive(Clone, Debug)]
2754pub struct RedditProfileTrophiesResource {
2755    scope: Scope,
2756}
2757
2758impl RedditProfileTrophiesResource {
2759    /// List profile trophies.
2760    ///
2761    /// List profile trophies from public Reddit data. Test and Live use the same route,
2762    /// parameters, response schema, pagination, and errors. In Test, null means
2763    /// unavailable, not zero.
2764    ///
2765    /// `GET /v1/reddit/profiles/{identifier}/trophies`
2766    pub async fn list(
2767        &self,
2768        options: impl Into<Option<RedditProfileTrophiesOptions>>,
2769    ) -> Result<RedditProfileTrophiesResponse, Error> {
2770        let options = options.into().unwrap_or_default();
2771        self.scope
2772            .operation(
2773                Method::GET,
2774                "/v1/reddit/profiles/{identifier}/trophies",
2775                options.query(),
2776                options.request_options,
2777            )?
2778            .send()
2779            .await
2780    }
2781}
2782
2783/// The `reddit.search` resources.
2784///
2785/// Selecting a resource never sends a request. Only its terminal operations do.
2786#[derive(Clone, Debug)]
2787pub struct RedditSearchResource {
2788    scope: Scope,
2789}
2790
2791impl RedditSearchResource {
2792    /// Selects the posts resources. This never sends a request.
2793    pub fn posts(&self) -> RedditSearchPostsResource {
2794        RedditSearchPostsResource {
2795            scope: self.scope.clone(),
2796        }
2797    }
2798
2799    /// Selects the profiles resources. This never sends a request.
2800    pub fn profiles(&self) -> RedditSearchProfilesResource {
2801        RedditSearchProfilesResource {
2802            scope: self.scope.clone(),
2803        }
2804    }
2805
2806    /// Selects the subreddits resources. This never sends a request.
2807    pub fn subreddits(&self) -> RedditSearchSubredditsResource {
2808        RedditSearchSubredditsResource {
2809            scope: self.scope.clone(),
2810        }
2811    }
2812}
2813
2814/// The `reddit.search.posts` resources.
2815///
2816/// Selecting a resource never sends a request. Only its terminal operations do.
2817#[derive(Clone, Debug)]
2818pub struct RedditSearchPostsResource {
2819    scope: Scope,
2820}
2821
2822impl RedditSearchPostsResource {
2823    /// Search posts.
2824    ///
2825    /// Search posts from public Reddit data. Test and Live use the same route,
2826    /// parameters, response schema, pagination, and errors. In Test, null means
2827    /// unavailable, not zero.
2828    ///
2829    /// `GET /v1/reddit/search/posts`
2830    pub async fn list(
2831        &self,
2832        options: RedditSearchPostsOptions,
2833    ) -> Result<RedditSearchPostsPage, Error> {
2834        self.scope
2835            .operation(
2836                Method::GET,
2837                "/v1/reddit/search/posts",
2838                options.query(),
2839                options.request_options,
2840            )?
2841            .send_page()
2842            .await
2843    }
2844
2845    /// Iterates lazily over every item of [`list`](Self::list), one page per request.
2846    pub fn items(&self, options: RedditSearchPostsOptions) -> Items<RedditPost> {
2847        Items::new(self.scope.operation(
2848            Method::GET,
2849            "/v1/reddit/search/posts",
2850            options.query(),
2851            options.request_options,
2852        ))
2853    }
2854}
2855
2856/// The `reddit.search.profiles` resources.
2857///
2858/// Selecting a resource never sends a request. Only its terminal operations do.
2859#[derive(Clone, Debug)]
2860pub struct RedditSearchProfilesResource {
2861    scope: Scope,
2862}
2863
2864impl RedditSearchProfilesResource {
2865    /// Search profiles.
2866    ///
2867    /// Search profiles from public Reddit data. Test and Live use the same route,
2868    /// parameters, response schema, pagination, and errors. In Test, null means
2869    /// unavailable, not zero.
2870    ///
2871    /// `GET /v1/reddit/search/profiles`
2872    pub async fn list(
2873        &self,
2874        options: RedditSearchProfilesOptions,
2875    ) -> Result<RedditSearchProfilesPage, Error> {
2876        self.scope
2877            .operation(
2878                Method::GET,
2879                "/v1/reddit/search/profiles",
2880                options.query(),
2881                options.request_options,
2882            )?
2883            .send_page()
2884            .await
2885    }
2886
2887    /// Iterates lazily over every item of [`list`](Self::list), one page per request.
2888    pub fn items(&self, options: RedditSearchProfilesOptions) -> Items<RedditProfile> {
2889        Items::new(self.scope.operation(
2890            Method::GET,
2891            "/v1/reddit/search/profiles",
2892            options.query(),
2893            options.request_options,
2894        ))
2895    }
2896}
2897
2898/// The `reddit.search.subreddits` resources.
2899///
2900/// Selecting a resource never sends a request. Only its terminal operations do.
2901#[derive(Clone, Debug)]
2902pub struct RedditSearchSubredditsResource {
2903    scope: Scope,
2904}
2905
2906impl RedditSearchSubredditsResource {
2907    /// Search subreddits.
2908    ///
2909    /// Search subreddits from public Reddit data. Test and Live use the same route,
2910    /// parameters, response schema, pagination, and errors. In Test, null means
2911    /// unavailable, not zero.
2912    ///
2913    /// `GET /v1/reddit/search/subreddits`
2914    pub async fn list(
2915        &self,
2916        options: RedditSearchSubredditsOptions,
2917    ) -> Result<RedditSearchSubredditsPage, Error> {
2918        self.scope
2919            .operation(
2920                Method::GET,
2921                "/v1/reddit/search/subreddits",
2922                options.query(),
2923                options.request_options,
2924            )?
2925            .send_page()
2926            .await
2927    }
2928
2929    /// Iterates lazily over every item of [`list`](Self::list), one page per request.
2930    pub fn items(&self, options: RedditSearchSubredditsOptions) -> Items<RedditSubreddit> {
2931        Items::new(self.scope.operation(
2932            Method::GET,
2933            "/v1/reddit/search/subreddits",
2934            options.query(),
2935            options.request_options,
2936        ))
2937    }
2938}
2939
2940/// One selected subreddit on Reddit.
2941///
2942/// Selecting a resource never sends a request. Only its terminal operations do.
2943#[derive(Clone, Debug)]
2944pub struct RedditSubredditResource {
2945    scope: Scope,
2946}
2947
2948impl RedditSubredditResource {
2949    /// Selects the posts resources. This never sends a request.
2950    pub fn posts(&self) -> RedditSubredditPostsResource {
2951        RedditSubredditPostsResource {
2952            scope: self.scope.clone(),
2953        }
2954    }
2955
2956    /// Selects the rules resources. This never sends a request.
2957    pub fn rules(&self) -> RedditSubredditRulesResource {
2958        RedditSubredditRulesResource {
2959            scope: self.scope.clone(),
2960        }
2961    }
2962
2963    /// Selects one wiki page. This never sends a request.
2964    ///
2965    /// A raw string is the native ID or shorthand unless it is a supported social
2966    /// URL. Pass [`Id`](crate::Id) or [`Url`](crate::Url) to state the meaning.
2967    /// An invalid reference fails the first operation, before any request.
2968    pub fn wiki_page(
2969        &self,
2970        reference: impl Into<ResourceReference>,
2971    ) -> RedditSubredditWikiPageResource {
2972        RedditSubredditWikiPageResource {
2973            scope: self.scope.select(
2974                "page",
2975                "reddit",
2976                "wikiPage",
2977                Reference::from(reference.into()),
2978            ),
2979        }
2980    }
2981
2982    /// Selects the wiki pages resources. This never sends a request.
2983    pub fn wiki_pages(&self) -> RedditSubredditWikiPagesResource {
2984        RedditSubredditWikiPagesResource {
2985            scope: self.scope.clone(),
2986        }
2987    }
2988
2989    /// Get a subreddit.
2990    ///
2991    /// Get a subreddit from public Reddit data. Test and Live use the same route,
2992    /// parameters, response schema, pagination, and errors. In Test, null means
2993    /// unavailable, not zero.
2994    ///
2995    /// `GET /v1/reddit/subreddits/{identifier}`
2996    pub async fn get(
2997        &self,
2998        options: impl Into<Option<RedditSubredditOptions>>,
2999    ) -> Result<RedditSubredditResponse, Error> {
3000        let options = options.into().unwrap_or_default();
3001        self.scope
3002            .operation(
3003                Method::GET,
3004                "/v1/reddit/subreddits/{identifier}",
3005                options.query(),
3006                options.request_options,
3007            )?
3008            .send()
3009            .await
3010    }
3011}
3012
3013/// The `reddit.subreddit.posts` resources.
3014///
3015/// Selecting a resource never sends a request. Only its terminal operations do.
3016#[derive(Clone, Debug)]
3017pub struct RedditSubredditPostsResource {
3018    scope: Scope,
3019}
3020
3021impl RedditSubredditPostsResource {
3022    /// List subreddit posts.
3023    ///
3024    /// List subreddit posts from public Reddit data. Test and Live use the same route,
3025    /// parameters, response schema, pagination, and errors. In Test, null means
3026    /// unavailable, not zero.
3027    ///
3028    /// `GET /v1/reddit/subreddits/{identifier}/posts`
3029    pub async fn list(
3030        &self,
3031        options: impl Into<Option<RedditSubredditPostsOptions>>,
3032    ) -> Result<RedditSubredditPostsPage, Error> {
3033        let options = options.into().unwrap_or_default();
3034        self.scope
3035            .operation(
3036                Method::GET,
3037                "/v1/reddit/subreddits/{identifier}/posts",
3038                options.query(),
3039                options.request_options,
3040            )?
3041            .send_page()
3042            .await
3043    }
3044
3045    /// Iterates lazily over every item of [`list`](Self::list), one page per request.
3046    pub fn items(
3047        &self,
3048        options: impl Into<Option<RedditSubredditPostsOptions>>,
3049    ) -> Items<RedditPost> {
3050        let options = options.into().unwrap_or_default();
3051        Items::new(self.scope.operation(
3052            Method::GET,
3053            "/v1/reddit/subreddits/{identifier}/posts",
3054            options.query(),
3055            options.request_options,
3056        ))
3057    }
3058}
3059
3060/// The `reddit.subreddit.rules` resources.
3061///
3062/// Selecting a resource never sends a request. Only its terminal operations do.
3063#[derive(Clone, Debug)]
3064pub struct RedditSubredditRulesResource {
3065    scope: Scope,
3066}
3067
3068impl RedditSubredditRulesResource {
3069    /// List subreddit rules.
3070    ///
3071    /// List subreddit rules from public Reddit data. Test and Live use the same route,
3072    /// parameters, response schema, pagination, and errors. In Test, null means
3073    /// unavailable, not zero.
3074    ///
3075    /// `GET /v1/reddit/subreddits/{identifier}/rules`
3076    pub async fn list(
3077        &self,
3078        options: impl Into<Option<RedditSubredditRulesOptions>>,
3079    ) -> Result<RedditSubredditRulesResponse, Error> {
3080        let options = options.into().unwrap_or_default();
3081        self.scope
3082            .operation(
3083                Method::GET,
3084                "/v1/reddit/subreddits/{identifier}/rules",
3085                options.query(),
3086                options.request_options,
3087            )?
3088            .send()
3089            .await
3090    }
3091}
3092
3093/// One selected wiki page on Reddit.
3094///
3095/// Selecting a resource never sends a request. Only its terminal operations do.
3096#[derive(Clone, Debug)]
3097pub struct RedditSubredditWikiPageResource {
3098    scope: Scope,
3099}
3100
3101impl RedditSubredditWikiPageResource {
3102    /// Get a wiki page.
3103    ///
3104    /// Get a wiki page from public Reddit data. Test and Live use the same route,
3105    /// parameters, response schema, pagination, and errors. In Test, null means
3106    /// unavailable, not zero.
3107    ///
3108    /// `GET /v1/reddit/subreddits/{identifier}/wiki-pages/{page}`
3109    pub async fn get(
3110        &self,
3111        options: impl Into<Option<RedditSubredditWikiPageOptions>>,
3112    ) -> Result<RedditSubredditWikiPageResponse, Error> {
3113        let options = options.into().unwrap_or_default();
3114        self.scope
3115            .operation(
3116                Method::GET,
3117                "/v1/reddit/subreddits/{identifier}/wiki-pages/{page}",
3118                options.query(),
3119                options.request_options,
3120            )?
3121            .send()
3122            .await
3123    }
3124}
3125
3126/// The `reddit.subreddit.wikiPages` resources.
3127///
3128/// Selecting a resource never sends a request. Only its terminal operations do.
3129#[derive(Clone, Debug)]
3130pub struct RedditSubredditWikiPagesResource {
3131    scope: Scope,
3132}
3133
3134impl RedditSubredditWikiPagesResource {
3135    /// List wiki pages.
3136    ///
3137    /// List wiki pages from public Reddit data. Test and Live use the same route,
3138    /// parameters, response schema, pagination, and errors. In Test, null means
3139    /// unavailable, not zero.
3140    ///
3141    /// `GET /v1/reddit/subreddits/{identifier}/wiki-pages`
3142    pub async fn list(
3143        &self,
3144        options: impl Into<Option<RedditSubredditWikiPagesOptions>>,
3145    ) -> Result<RedditSubredditWikiPagesResponse, Error> {
3146        let options = options.into().unwrap_or_default();
3147        self.scope
3148            .operation(
3149                Method::GET,
3150                "/v1/reddit/subreddits/{identifier}/wiki-pages",
3151                options.query(),
3152                options.request_options,
3153            )?
3154            .send()
3155            .await
3156    }
3157}
3158
3159/// The `reddit.subreddits` resources.
3160///
3161/// Selecting a resource never sends a request. Only its terminal operations do.
3162#[derive(Clone, Debug)]
3163pub struct RedditSubredditsResource {
3164    scope: Scope,
3165}
3166
3167impl RedditSubredditsResource {
3168    /// Selects the new resources. This never sends a request.
3169    #[allow(clippy::new_ret_no_self)]
3170    pub fn new(&self) -> RedditSubredditsNewResource {
3171        RedditSubredditsNewResource {
3172            scope: self.scope.clone(),
3173        }
3174    }
3175
3176    /// Selects the popular resources. This never sends a request.
3177    pub fn popular(&self) -> RedditSubredditsPopularResource {
3178        RedditSubredditsPopularResource {
3179            scope: self.scope.clone(),
3180        }
3181    }
3182}
3183
3184/// The `reddit.subreddits.new` resources.
3185///
3186/// Selecting a resource never sends a request. Only its terminal operations do.
3187#[derive(Clone, Debug)]
3188pub struct RedditSubredditsNewResource {
3189    scope: Scope,
3190}
3191
3192impl RedditSubredditsNewResource {
3193    /// List new subreddits.
3194    ///
3195    /// List new subreddits from public Reddit data. Test and Live use the same route,
3196    /// parameters, response schema, pagination, and errors. In Test, null means
3197    /// unavailable, not zero.
3198    ///
3199    /// `GET /v1/reddit/subreddits/new`
3200    pub async fn list(
3201        &self,
3202        options: impl Into<Option<RedditSubredditsNewOptions>>,
3203    ) -> Result<RedditSubredditsNewPage, Error> {
3204        let options = options.into().unwrap_or_default();
3205        self.scope
3206            .operation(
3207                Method::GET,
3208                "/v1/reddit/subreddits/new",
3209                options.query(),
3210                options.request_options,
3211            )?
3212            .send_page()
3213            .await
3214    }
3215
3216    /// Iterates lazily over every item of [`list`](Self::list), one page per request.
3217    pub fn items(
3218        &self,
3219        options: impl Into<Option<RedditSubredditsNewOptions>>,
3220    ) -> Items<RedditSubreddit> {
3221        let options = options.into().unwrap_or_default();
3222        Items::new(self.scope.operation(
3223            Method::GET,
3224            "/v1/reddit/subreddits/new",
3225            options.query(),
3226            options.request_options,
3227        ))
3228    }
3229}
3230
3231/// The `reddit.subreddits.popular` resources.
3232///
3233/// Selecting a resource never sends a request. Only its terminal operations do.
3234#[derive(Clone, Debug)]
3235pub struct RedditSubredditsPopularResource {
3236    scope: Scope,
3237}
3238
3239impl RedditSubredditsPopularResource {
3240    /// List popular subreddits.
3241    ///
3242    /// List popular subreddits from public Reddit data. Test and Live use the same
3243    /// route, parameters, response schema, pagination, and errors. In Test, null means
3244    /// unavailable, not zero.
3245    ///
3246    /// `GET /v1/reddit/subreddits/popular`
3247    pub async fn list(
3248        &self,
3249        options: impl Into<Option<RedditSubredditsPopularOptions>>,
3250    ) -> Result<RedditSubredditsPopularPage, Error> {
3251        let options = options.into().unwrap_or_default();
3252        self.scope
3253            .operation(
3254                Method::GET,
3255                "/v1/reddit/subreddits/popular",
3256                options.query(),
3257                options.request_options,
3258            )?
3259            .send_page()
3260            .await
3261    }
3262
3263    /// Iterates lazily over every item of [`list`](Self::list), one page per request.
3264    pub fn items(
3265        &self,
3266        options: impl Into<Option<RedditSubredditsPopularOptions>>,
3267    ) -> Items<RedditSubreddit> {
3268        let options = options.into().unwrap_or_default();
3269        Items::new(self.scope.operation(
3270            Method::GET,
3271            "/v1/reddit/subreddits/popular",
3272            options.query(),
3273            options.request_options,
3274        ))
3275    }
3276}
3277
3278/// The `reddit.trending` resources.
3279///
3280/// Selecting a resource never sends a request. Only its terminal operations do.
3281#[derive(Clone, Debug)]
3282pub struct RedditTrendingResource {
3283    scope: Scope,
3284}
3285
3286impl RedditTrendingResource {
3287    /// Selects the posts resources. This never sends a request.
3288    pub fn posts(&self) -> RedditTrendingPostsResource {
3289        RedditTrendingPostsResource {
3290            scope: self.scope.clone(),
3291        }
3292    }
3293}
3294
3295/// The `reddit.trending.posts` resources.
3296///
3297/// Selecting a resource never sends a request. Only its terminal operations do.
3298#[derive(Clone, Debug)]
3299pub struct RedditTrendingPostsResource {
3300    scope: Scope,
3301}
3302
3303impl RedditTrendingPostsResource {
3304    /// List trending posts.
3305    ///
3306    /// List trending posts from public Reddit data. Test and Live use the same route,
3307    /// parameters, response schema, pagination, and errors. In Test, null means
3308    /// unavailable, not zero.
3309    ///
3310    /// `GET /v1/reddit/trending/posts`
3311    pub async fn list(
3312        &self,
3313        options: impl Into<Option<RedditTrendingPostsOptions>>,
3314    ) -> Result<RedditTrendingPostsPage, Error> {
3315        let options = options.into().unwrap_or_default();
3316        self.scope
3317            .operation(
3318                Method::GET,
3319                "/v1/reddit/trending/posts",
3320                options.query(),
3321                options.request_options,
3322            )?
3323            .send_page()
3324            .await
3325    }
3326
3327    /// Iterates lazily over every item of [`list`](Self::list), one page per request.
3328    pub fn items(
3329        &self,
3330        options: impl Into<Option<RedditTrendingPostsOptions>>,
3331    ) -> Items<RedditPost> {
3332        let options = options.into().unwrap_or_default();
3333        Items::new(self.scope.operation(
3334            Method::GET,
3335            "/v1/reddit/trending/posts",
3336            options.query(),
3337            options.request_options,
3338        ))
3339    }
3340}
3341
3342/// The `testData` resources.
3343///
3344/// Selecting a resource never sends a request. Only its terminal operations do.
3345#[derive(Clone, Debug)]
3346pub struct TestDataResource {
3347    scope: Scope,
3348}
3349
3350impl TestDataResource {
3351    /// Selects one entry. This never sends a request.
3352    ///
3353    /// A raw string is the native ID or shorthand unless it is a supported social
3354    /// URL. Pass [`Id`](crate::Id) or [`Url`](crate::Url) to state the meaning.
3355    /// An invalid reference fails the first operation, before any request.
3356    pub fn entry(&self, reference: impl Into<ResourceReference>) -> TestDataEntryResource {
3357        TestDataEntryResource {
3358            scope: self.scope.select(
3359                "id",
3360                "testData",
3361                "testDataEntry",
3362                Reference::from(reference.into()),
3363            ),
3364        }
3365    }
3366
3367    /// Search the synthetic test-data catalog.
3368    ///
3369    /// Public, unmetered discovery. Filter by platform, resource, operation, traits,
3370    /// expected status, error code, or text.
3371    ///
3372    /// `GET /v1/test-data`
3373    pub async fn list(
3374        &self,
3375        options: impl Into<Option<TestDataOptions>>,
3376    ) -> Result<TestDataResponse, Error> {
3377        let options = options.into().unwrap_or_default();
3378        self.scope
3379            .operation(
3380                Method::GET,
3381                "/v1/test-data",
3382                options.query(),
3383                options.request_options,
3384            )?
3385            .send()
3386            .await
3387    }
3388}
3389
3390/// One selected entry on Test data catalog.
3391///
3392/// Selecting a resource never sends a request. Only its terminal operations do.
3393#[derive(Clone, Debug)]
3394pub struct TestDataEntryResource {
3395    scope: Scope,
3396}
3397
3398impl TestDataEntryResource {
3399    /// Get one synthetic catalog entry.
3400    ///
3401    /// `GET /v1/test-data/{id}`
3402    pub async fn get(
3403        &self,
3404        options: impl Into<Option<TestDataEntryOptions>>,
3405    ) -> Result<TestDataEntryResponse, Error> {
3406        let options = options.into().unwrap_or_default();
3407        self.scope
3408            .operation(
3409                Method::GET,
3410                "/v1/test-data/{id}",
3411                options.query(),
3412                options.request_options,
3413            )?
3414            .send()
3415            .await
3416    }
3417}
3418
3419/// The `tiktok` resources.
3420///
3421/// Selecting a resource never sends a request. Only its terminal operations do.
3422#[derive(Clone, Debug)]
3423pub struct TikTokResource {
3424    scope: Scope,
3425}
3426
3427impl TikTokResource {
3428    /// Selects one effect. This never sends a request.
3429    ///
3430    /// A raw string is the native ID or shorthand unless it is a supported social
3431    /// URL. Pass [`Id`](crate::Id) or [`Url`](crate::Url) to state the meaning.
3432    /// An invalid reference fails the first operation, before any request.
3433    pub fn effect(&self, reference: impl Into<ResourceReference>) -> TikTokEffectResource {
3434        TikTokEffectResource {
3435            scope: self.scope.select(
3436                "identifier",
3437                "tiktok",
3438                "effect",
3439                Reference::from(reference.into()),
3440            ),
3441        }
3442    }
3443
3444    /// Selects the effects resources. This never sends a request.
3445    pub fn effects(&self) -> TikTokEffectsResource {
3446        TikTokEffectsResource {
3447            scope: self.scope.clone(),
3448        }
3449    }
3450
3451    /// Selects one hashtag. This never sends a request.
3452    ///
3453    /// A raw string is the native ID or shorthand unless it is a supported social
3454    /// URL. Pass [`Id`](crate::Id) or [`Url`](crate::Url) to state the meaning.
3455    /// An invalid reference fails the first operation, before any request.
3456    pub fn hashtag(&self, reference: impl Into<ResourceReference>) -> TikTokHashtagResource {
3457        TikTokHashtagResource {
3458            scope: self.scope.select(
3459                "identifier",
3460                "tiktok",
3461                "hashtag",
3462                Reference::from(reference.into()),
3463            ),
3464        }
3465    }
3466
3467    /// Selects one location. This never sends a request.
3468    ///
3469    /// A raw string is the native ID or shorthand unless it is a supported social
3470    /// URL. Pass [`Id`](crate::Id) or [`Url`](crate::Url) to state the meaning.
3471    /// An invalid reference fails the first operation, before any request.
3472    pub fn location(&self, reference: impl Into<ResourceReference>) -> TikTokLocationResource {
3473        TikTokLocationResource {
3474            scope: self.scope.select(
3475                "identifier",
3476                "tiktok",
3477                "location",
3478                Reference::from(reference.into()),
3479            ),
3480        }
3481    }
3482
3483    /// Selects one music. This never sends a request.
3484    ///
3485    /// A raw string is the native ID or shorthand unless it is a supported social
3486    /// URL. Pass [`Id`](crate::Id) or [`Url`](crate::Url) to state the meaning.
3487    /// An invalid reference fails the first operation, before any request.
3488    pub fn music(&self, reference: impl Into<ResourceReference>) -> TikTokMusicResource {
3489        TikTokMusicResource {
3490            scope: self.scope.select(
3491                "identifier",
3492                "tiktok",
3493                "music",
3494                Reference::from(reference.into()),
3495            ),
3496        }
3497    }
3498
3499    /// Selects one post. This never sends a request.
3500    ///
3501    /// A raw string is the native ID or shorthand unless it is a supported social
3502    /// URL. Pass [`Id`](crate::Id) or [`Url`](crate::Url) to state the meaning.
3503    /// An invalid reference fails the first operation, before any request.
3504    pub fn post(&self, reference: impl Into<ResourceReference>) -> TikTokPostResource {
3505        TikTokPostResource {
3506            scope: self.scope.select(
3507                "identifier",
3508                "tiktok",
3509                "post",
3510                Reference::from(reference.into()),
3511            ),
3512        }
3513    }
3514
3515    /// Selects one profile. This never sends a request.
3516    ///
3517    /// A raw string is a username unless it is a supported social URL. Pass
3518    /// [`Username`](crate::Username), [`Id`](crate::Id), or [`Url`](crate::Url) to state the meaning.
3519    /// An invalid reference fails the first operation, before any request.
3520    pub fn profile(&self, reference: impl Into<ProfileReference>) -> TikTokProfileResource {
3521        TikTokProfileResource {
3522            scope: self.scope.select(
3523                "identifier",
3524                "tiktok",
3525                "profile",
3526                Reference::from(reference.into()),
3527            ),
3528        }
3529    }
3530
3531    /// Selects the search resources. This never sends a request.
3532    pub fn search(&self) -> TikTokSearchResource {
3533        TikTokSearchResource {
3534            scope: self.scope.clone(),
3535        }
3536    }
3537
3538    /// Selects the trending resources. This never sends a request.
3539    pub fn trending(&self) -> TikTokTrendingResource {
3540        TikTokTrendingResource {
3541            scope: self.scope.clone(),
3542        }
3543    }
3544}
3545
3546/// One selected effect on TikTok.
3547///
3548/// Selecting a resource never sends a request. Only its terminal operations do.
3549#[derive(Clone, Debug)]
3550pub struct TikTokEffectResource {
3551    scope: Scope,
3552}
3553
3554impl TikTokEffectResource {
3555    /// Selects the posts resources. This never sends a request.
3556    pub fn posts(&self) -> TikTokEffectPostsResource {
3557        TikTokEffectPostsResource {
3558            scope: self.scope.clone(),
3559        }
3560    }
3561
3562    /// Get an effect.
3563    ///
3564    /// Get an effect from public Tiktok data. Test and Live use the same route,
3565    /// parameters, response schema, pagination, and errors. In Test, null means
3566    /// unavailable, not zero.
3567    ///
3568    /// `GET /v1/tiktok/effects/{identifier}`
3569    pub async fn get(
3570        &self,
3571        options: impl Into<Option<TikTokEffectOptions>>,
3572    ) -> Result<TikTokEffectResponse, Error> {
3573        let options = options.into().unwrap_or_default();
3574        self.scope
3575            .operation(
3576                Method::GET,
3577                "/v1/tiktok/effects/{identifier}",
3578                options.query(),
3579                options.request_options,
3580            )?
3581            .send()
3582            .await
3583    }
3584}
3585
3586/// The `tiktok.effect.posts` resources.
3587///
3588/// Selecting a resource never sends a request. Only its terminal operations do.
3589#[derive(Clone, Debug)]
3590pub struct TikTokEffectPostsResource {
3591    scope: Scope,
3592}
3593
3594impl TikTokEffectPostsResource {
3595    /// List effect posts.
3596    ///
3597    /// Return a cursor-paginated collection of TikTok posts that use an effect. Test
3598    /// and Live use the same route, parameters, response schema, pagination, and
3599    /// errors. In Test, null means unavailable, not zero.
3600    ///
3601    /// `GET /v1/tiktok/effects/{identifier}/posts`
3602    pub async fn list(
3603        &self,
3604        options: impl Into<Option<TikTokEffectPostsOptions>>,
3605    ) -> Result<TikTokEffectPostsPage, Error> {
3606        let options = options.into().unwrap_or_default();
3607        self.scope
3608            .operation(
3609                Method::GET,
3610                "/v1/tiktok/effects/{identifier}/posts",
3611                options.query(),
3612                options.request_options,
3613            )?
3614            .send_page()
3615            .await
3616    }
3617
3618    /// Iterates lazily over every item of [`list`](Self::list), one page per request.
3619    pub fn items(&self, options: impl Into<Option<TikTokEffectPostsOptions>>) -> Items<TikTokPost> {
3620        let options = options.into().unwrap_or_default();
3621        Items::new(self.scope.operation(
3622            Method::GET,
3623            "/v1/tiktok/effects/{identifier}/posts",
3624            options.query(),
3625            options.request_options,
3626        ))
3627    }
3628}
3629
3630/// The `tiktok.effects` resources.
3631///
3632/// Selecting a resource never sends a request. Only its terminal operations do.
3633#[derive(Clone, Debug)]
3634pub struct TikTokEffectsResource {
3635    scope: Scope,
3636}
3637
3638impl TikTokEffectsResource {
3639    /// Get effects in a batch.
3640    ///
3641    /// Get effects in a batch from public Tiktok data. Test and Live use the same
3642    /// route, parameters, response schema, pagination, and errors. In Test, null means
3643    /// unavailable, not zero.
3644    ///
3645    /// `GET /v1/tiktok/effects`
3646    pub async fn list(&self, options: TikTokEffectsOptions) -> Result<TikTokEffectsPage, Error> {
3647        self.scope
3648            .operation(
3649                Method::GET,
3650                "/v1/tiktok/effects",
3651                options.query(),
3652                options.request_options,
3653            )?
3654            .send_page()
3655            .await
3656    }
3657
3658    /// Iterates lazily over every item of [`list`](Self::list), one page per request.
3659    pub fn items(&self, options: TikTokEffectsOptions) -> Items<TikTokEffect> {
3660        Items::new(self.scope.operation(
3661            Method::GET,
3662            "/v1/tiktok/effects",
3663            options.query(),
3664            options.request_options,
3665        ))
3666    }
3667}
3668
3669/// One selected hashtag on TikTok.
3670///
3671/// Selecting a resource never sends a request. Only its terminal operations do.
3672#[derive(Clone, Debug)]
3673pub struct TikTokHashtagResource {
3674    scope: Scope,
3675}
3676
3677impl TikTokHashtagResource {
3678    /// Selects the posts resources. This never sends a request.
3679    pub fn posts(&self) -> TikTokHashtagPostsResource {
3680        TikTokHashtagPostsResource {
3681            scope: self.scope.clone(),
3682        }
3683    }
3684
3685    /// Get a hashtag.
3686    ///
3687    /// Return one public hashtag by its native identifier. Test and Live use the same
3688    /// route, parameters, response schema, pagination, and errors. In Test, null means
3689    /// unavailable, not zero.
3690    ///
3691    /// `GET /v1/tiktok/hashtags/{identifier}`
3692    pub async fn get(
3693        &self,
3694        options: impl Into<Option<TikTokHashtagOptions>>,
3695    ) -> Result<TikTokHashtagResponse, Error> {
3696        let options = options.into().unwrap_or_default();
3697        self.scope
3698            .operation(
3699                Method::GET,
3700                "/v1/tiktok/hashtags/{identifier}",
3701                options.query(),
3702                options.request_options,
3703            )?
3704            .send()
3705            .await
3706    }
3707}
3708
3709/// The `tiktok.hashtag.posts` resources.
3710///
3711/// Selecting a resource never sends a request. Only its terminal operations do.
3712#[derive(Clone, Debug)]
3713pub struct TikTokHashtagPostsResource {
3714    scope: Scope,
3715}
3716
3717impl TikTokHashtagPostsResource {
3718    /// List hashtag posts.
3719    ///
3720    /// Return a cursor-paginated collection of public posts. Test and Live use the same
3721    /// route, parameters, response schema, pagination, and errors. In Test, null means
3722    /// unavailable, not zero.
3723    ///
3724    /// `GET /v1/tiktok/hashtags/{identifier}/posts`
3725    pub async fn list(
3726        &self,
3727        options: impl Into<Option<TikTokHashtagPostsOptions>>,
3728    ) -> Result<TikTokHashtagPostsPage, Error> {
3729        let options = options.into().unwrap_or_default();
3730        self.scope
3731            .operation(
3732                Method::GET,
3733                "/v1/tiktok/hashtags/{identifier}/posts",
3734                options.query(),
3735                options.request_options,
3736            )?
3737            .send_page()
3738            .await
3739    }
3740
3741    /// Iterates lazily over every item of [`list`](Self::list), one page per request.
3742    pub fn items(
3743        &self,
3744        options: impl Into<Option<TikTokHashtagPostsOptions>>,
3745    ) -> Items<TikTokPost> {
3746        let options = options.into().unwrap_or_default();
3747        Items::new(self.scope.operation(
3748            Method::GET,
3749            "/v1/tiktok/hashtags/{identifier}/posts",
3750            options.query(),
3751            options.request_options,
3752        ))
3753    }
3754}
3755
3756/// One selected location on TikTok.
3757///
3758/// Selecting a resource never sends a request. Only its terminal operations do.
3759#[derive(Clone, Debug)]
3760pub struct TikTokLocationResource {
3761    scope: Scope,
3762}
3763
3764impl TikTokLocationResource {
3765    /// Selects the posts resources. This never sends a request.
3766    pub fn posts(&self) -> TikTokLocationPostsResource {
3767        TikTokLocationPostsResource {
3768            scope: self.scope.clone(),
3769        }
3770    }
3771
3772    /// Get a location.
3773    ///
3774    /// Return one public location by its native identifier. Test and Live use the same
3775    /// route, parameters, response schema, pagination, and errors. In Test, null means
3776    /// unavailable, not zero.
3777    ///
3778    /// `GET /v1/tiktok/locations/{identifier}`
3779    pub async fn get(
3780        &self,
3781        options: impl Into<Option<TikTokLocationOptions>>,
3782    ) -> Result<TikTokLocationResponse, Error> {
3783        let options = options.into().unwrap_or_default();
3784        self.scope
3785            .operation(
3786                Method::GET,
3787                "/v1/tiktok/locations/{identifier}",
3788                options.query(),
3789                options.request_options,
3790            )?
3791            .send()
3792            .await
3793    }
3794}
3795
3796/// The `tiktok.location.posts` resources.
3797///
3798/// Selecting a resource never sends a request. Only its terminal operations do.
3799#[derive(Clone, Debug)]
3800pub struct TikTokLocationPostsResource {
3801    scope: Scope,
3802}
3803
3804impl TikTokLocationPostsResource {
3805    /// List location posts.
3806    ///
3807    /// Return a cursor-paginated collection of public posts. Test and Live use the same
3808    /// route, parameters, response schema, pagination, and errors. In Test, null means
3809    /// unavailable, not zero.
3810    ///
3811    /// `GET /v1/tiktok/locations/{identifier}/posts`
3812    pub async fn list(
3813        &self,
3814        options: impl Into<Option<TikTokLocationPostsOptions>>,
3815    ) -> Result<TikTokLocationPostsPage, Error> {
3816        let options = options.into().unwrap_or_default();
3817        self.scope
3818            .operation(
3819                Method::GET,
3820                "/v1/tiktok/locations/{identifier}/posts",
3821                options.query(),
3822                options.request_options,
3823            )?
3824            .send_page()
3825            .await
3826    }
3827
3828    /// Iterates lazily over every item of [`list`](Self::list), one page per request.
3829    pub fn items(
3830        &self,
3831        options: impl Into<Option<TikTokLocationPostsOptions>>,
3832    ) -> Items<TikTokPost> {
3833        let options = options.into().unwrap_or_default();
3834        Items::new(self.scope.operation(
3835            Method::GET,
3836            "/v1/tiktok/locations/{identifier}/posts",
3837            options.query(),
3838            options.request_options,
3839        ))
3840    }
3841}
3842
3843/// One selected music on TikTok.
3844///
3845/// Selecting a resource never sends a request. Only its terminal operations do.
3846#[derive(Clone, Debug)]
3847pub struct TikTokMusicResource {
3848    scope: Scope,
3849}
3850
3851impl TikTokMusicResource {
3852    /// Selects the posts resources. This never sends a request.
3853    pub fn posts(&self) -> TikTokMusicPostsResource {
3854        TikTokMusicPostsResource {
3855            scope: self.scope.clone(),
3856        }
3857    }
3858
3859    /// Get a music.
3860    ///
3861    /// Return one public music by its native identifier. Test and Live use the same
3862    /// route, parameters, response schema, pagination, and errors. In Test, null means
3863    /// unavailable, not zero.
3864    ///
3865    /// `GET /v1/tiktok/music/{identifier}`
3866    pub async fn get(
3867        &self,
3868        options: impl Into<Option<TikTokMusicOptions>>,
3869    ) -> Result<TikTokMusicResponse, Error> {
3870        let options = options.into().unwrap_or_default();
3871        self.scope
3872            .operation(
3873                Method::GET,
3874                "/v1/tiktok/music/{identifier}",
3875                options.query(),
3876                options.request_options,
3877            )?
3878            .send()
3879            .await
3880    }
3881}
3882
3883/// The `tiktok.music.posts` resources.
3884///
3885/// Selecting a resource never sends a request. Only its terminal operations do.
3886#[derive(Clone, Debug)]
3887pub struct TikTokMusicPostsResource {
3888    scope: Scope,
3889}
3890
3891impl TikTokMusicPostsResource {
3892    /// List music posts.
3893    ///
3894    /// Return a cursor-paginated collection of public posts. Test and Live use the same
3895    /// route, parameters, response schema, pagination, and errors. In Test, null means
3896    /// unavailable, not zero.
3897    ///
3898    /// `GET /v1/tiktok/music/{identifier}/posts`
3899    pub async fn list(
3900        &self,
3901        options: impl Into<Option<TikTokMusicPostsOptions>>,
3902    ) -> Result<TikTokMusicPostsPage, Error> {
3903        let options = options.into().unwrap_or_default();
3904        self.scope
3905            .operation(
3906                Method::GET,
3907                "/v1/tiktok/music/{identifier}/posts",
3908                options.query(),
3909                options.request_options,
3910            )?
3911            .send_page()
3912            .await
3913    }
3914
3915    /// Iterates lazily over every item of [`list`](Self::list), one page per request.
3916    pub fn items(&self, options: impl Into<Option<TikTokMusicPostsOptions>>) -> Items<TikTokPost> {
3917        let options = options.into().unwrap_or_default();
3918        Items::new(self.scope.operation(
3919            Method::GET,
3920            "/v1/tiktok/music/{identifier}/posts",
3921            options.query(),
3922            options.request_options,
3923        ))
3924    }
3925}
3926
3927/// One selected post on TikTok.
3928///
3929/// Selecting a resource never sends a request. Only its terminal operations do.
3930#[derive(Clone, Debug)]
3931pub struct TikTokPostResource {
3932    scope: Scope,
3933}
3934
3935impl TikTokPostResource {
3936    /// Selects one comment. This never sends a request.
3937    ///
3938    /// A raw string is the native ID or shorthand unless it is a supported social
3939    /// URL. Pass [`Id`](crate::Id) or [`Url`](crate::Url) to state the meaning.
3940    /// An invalid reference fails the first operation, before any request.
3941    pub fn comment(&self, reference: impl Into<ResourceReference>) -> TikTokPostCommentResource {
3942        TikTokPostCommentResource {
3943            scope: self.scope.select(
3944                "comment_id",
3945                "tiktok",
3946                "comment",
3947                Reference::from(reference.into()),
3948            ),
3949        }
3950    }
3951
3952    /// Selects the comments resources. This never sends a request.
3953    pub fn comments(&self) -> TikTokPostCommentsResource {
3954        TikTokPostCommentsResource {
3955            scope: self.scope.clone(),
3956        }
3957    }
3958
3959    /// Get a post.
3960    ///
3961    /// Get a post by a canonical platform identifier. URLs must be converted before
3962    /// calling a data endpoint. Test and Live use the same route, parameters, response
3963    /// schema, pagination, and errors. In Test, null means unavailable, not zero.
3964    ///
3965    /// `GET /v1/tiktok/posts/{identifier}`
3966    pub async fn get(
3967        &self,
3968        options: impl Into<Option<TikTokPostOptions>>,
3969    ) -> Result<TikTokPostResponse, Error> {
3970        let options = options.into().unwrap_or_default();
3971        self.scope
3972            .operation(
3973                Method::GET,
3974                "/v1/tiktok/posts/{identifier}",
3975                options.query(),
3976                options.request_options,
3977            )?
3978            .send()
3979            .await
3980    }
3981}
3982
3983/// One selected comment on TikTok.
3984///
3985/// Selecting a resource never sends a request. Only its terminal operations do.
3986#[derive(Clone, Debug)]
3987pub struct TikTokPostCommentResource {
3988    scope: Scope,
3989}
3990
3991impl TikTokPostCommentResource {
3992    /// Selects the replies resources. This never sends a request.
3993    pub fn replies(&self) -> TikTokPostCommentRepliesResource {
3994        TikTokPostCommentRepliesResource {
3995            scope: self.scope.clone(),
3996        }
3997    }
3998}
3999
4000/// The `tiktok.post.comment.replies` resources.
4001///
4002/// Selecting a resource never sends a request. Only its terminal operations do.
4003#[derive(Clone, Debug)]
4004pub struct TikTokPostCommentRepliesResource {
4005    scope: Scope,
4006}
4007
4008impl TikTokPostCommentRepliesResource {
4009    /// List comment replies.
4010    ///
4011    /// Return a stable page of replies for one comment. Use find_test_data to discover
4012    /// compatible post and comment IDs. Test and Live use the same route, parameters,
4013    /// response schema, pagination, and errors. In Test, null means unavailable, not
4014    /// zero.
4015    ///
4016    /// `GET /v1/tiktok/posts/{identifier}/comments/{comment_id}/replies`
4017    pub async fn list(
4018        &self,
4019        options: impl Into<Option<TikTokPostCommentRepliesOptions>>,
4020    ) -> Result<TikTokPostCommentRepliesPage, Error> {
4021        let options = options.into().unwrap_or_default();
4022        self.scope
4023            .operation(
4024                Method::GET,
4025                "/v1/tiktok/posts/{identifier}/comments/{comment_id}/replies",
4026                options.query(),
4027                options.request_options,
4028            )?
4029            .send_page()
4030            .await
4031    }
4032
4033    /// Iterates lazily over every item of [`list`](Self::list), one page per request.
4034    pub fn items(
4035        &self,
4036        options: impl Into<Option<TikTokPostCommentRepliesOptions>>,
4037    ) -> Items<TikTokComment> {
4038        let options = options.into().unwrap_or_default();
4039        Items::new(self.scope.operation(
4040            Method::GET,
4041            "/v1/tiktok/posts/{identifier}/comments/{comment_id}/replies",
4042            options.query(),
4043            options.request_options,
4044        ))
4045    }
4046}
4047
4048/// The `tiktok.post.comments` resources.
4049///
4050/// Selecting a resource never sends a request. Only its terminal operations do.
4051#[derive(Clone, Debug)]
4052pub struct TikTokPostCommentsResource {
4053    scope: Scope,
4054}
4055
4056impl TikTokPostCommentsResource {
4057    /// List post comments.
4058    ///
4059    /// List post comments by a canonical platform identifier. URLs must be converted
4060    /// before calling a data endpoint. Test and Live use the same route, parameters,
4061    /// response schema, pagination, and errors. In Test, null means unavailable, not
4062    /// zero.
4063    ///
4064    /// `GET /v1/tiktok/posts/{identifier}/comments`
4065    pub async fn list(
4066        &self,
4067        options: impl Into<Option<TikTokPostCommentsOptions>>,
4068    ) -> Result<TikTokPostCommentsPage, Error> {
4069        let options = options.into().unwrap_or_default();
4070        self.scope
4071            .operation(
4072                Method::GET,
4073                "/v1/tiktok/posts/{identifier}/comments",
4074                options.query(),
4075                options.request_options,
4076            )?
4077            .send_page()
4078            .await
4079    }
4080
4081    /// Iterates lazily over every item of [`list`](Self::list), one page per request.
4082    pub fn items(
4083        &self,
4084        options: impl Into<Option<TikTokPostCommentsOptions>>,
4085    ) -> Items<TikTokComment> {
4086        let options = options.into().unwrap_or_default();
4087        Items::new(self.scope.operation(
4088            Method::GET,
4089            "/v1/tiktok/posts/{identifier}/comments",
4090            options.query(),
4091            options.request_options,
4092        ))
4093    }
4094}
4095
4096/// One selected profile on TikTok.
4097///
4098/// Selecting a resource never sends a request. Only its terminal operations do.
4099#[derive(Clone, Debug)]
4100pub struct TikTokProfileResource {
4101    scope: Scope,
4102}
4103
4104impl TikTokProfileResource {
4105    /// Selects the followers resources. This never sends a request.
4106    pub fn followers(&self) -> TikTokProfileFollowersResource {
4107        TikTokProfileFollowersResource {
4108            scope: self.scope.clone(),
4109        }
4110    }
4111
4112    /// Selects the following resources. This never sends a request.
4113    pub fn following(&self) -> TikTokProfileFollowingResource {
4114        TikTokProfileFollowingResource {
4115            scope: self.scope.clone(),
4116        }
4117    }
4118
4119    /// Selects the liked posts resources. This never sends a request.
4120    pub fn liked_posts(&self) -> TikTokProfileLikedPostsResource {
4121        TikTokProfileLikedPostsResource {
4122            scope: self.scope.clone(),
4123        }
4124    }
4125
4126    /// Selects one playlist. This never sends a request.
4127    ///
4128    /// A raw string is the native ID or shorthand unless it is a supported social
4129    /// URL. Pass [`Id`](crate::Id) or [`Url`](crate::Url) to state the meaning.
4130    /// An invalid reference fails the first operation, before any request.
4131    pub fn playlist(
4132        &self,
4133        reference: impl Into<ResourceReference>,
4134    ) -> TikTokProfilePlaylistResource {
4135        TikTokProfilePlaylistResource {
4136            scope: self.scope.select(
4137                "playlist_id",
4138                "tiktok",
4139                "playlist",
4140                Reference::from(reference.into()),
4141            ),
4142        }
4143    }
4144
4145    /// Selects the playlists resources. This never sends a request.
4146    pub fn playlists(&self) -> TikTokProfilePlaylistsResource {
4147        TikTokProfilePlaylistsResource {
4148            scope: self.scope.clone(),
4149        }
4150    }
4151
4152    /// Selects the posts resources. This never sends a request.
4153    pub fn posts(&self) -> TikTokProfilePostsResource {
4154        TikTokProfilePostsResource {
4155            scope: self.scope.clone(),
4156        }
4157    }
4158
4159    /// Get a profile.
4160    ///
4161    /// Return one public profile. Use @username or a platform ID as the identifier.
4162    /// Test and Live use the same route, parameters, response schema, pagination, and
4163    /// errors. In Test, null means unavailable, not zero.
4164    ///
4165    /// `GET /v1/tiktok/profiles/{identifier}`
4166    pub async fn get(
4167        &self,
4168        options: impl Into<Option<TikTokProfileOptions>>,
4169    ) -> Result<TikTokProfileResponse, Error> {
4170        let options = options.into().unwrap_or_default();
4171        self.scope
4172            .operation(
4173                Method::GET,
4174                "/v1/tiktok/profiles/{identifier}",
4175                options.query(),
4176                options.request_options,
4177            )?
4178            .send()
4179            .await
4180    }
4181}
4182
4183/// The `tiktok.profile.followers` resources.
4184///
4185/// Selecting a resource never sends a request. Only its terminal operations do.
4186#[derive(Clone, Debug)]
4187pub struct TikTokProfileFollowersResource {
4188    scope: Scope,
4189}
4190
4191impl TikTokProfileFollowersResource {
4192    /// List profile followers.
4193    ///
4194    /// Return a cursor-paginated collection of Tiktok profiles. Test and Live use the
4195    /// same route, parameters, response schema, pagination, and errors. In Test, null
4196    /// means unavailable, not zero.
4197    ///
4198    /// `GET /v1/tiktok/profiles/{identifier}/followers`
4199    pub async fn list(
4200        &self,
4201        options: impl Into<Option<TikTokProfileFollowersOptions>>,
4202    ) -> Result<TikTokProfileFollowersPage, Error> {
4203        let options = options.into().unwrap_or_default();
4204        self.scope
4205            .operation(
4206                Method::GET,
4207                "/v1/tiktok/profiles/{identifier}/followers",
4208                options.query(),
4209                options.request_options,
4210            )?
4211            .send_page()
4212            .await
4213    }
4214
4215    /// Iterates lazily over every item of [`list`](Self::list), one page per request.
4216    pub fn items(
4217        &self,
4218        options: impl Into<Option<TikTokProfileFollowersOptions>>,
4219    ) -> Items<TikTokProfile> {
4220        let options = options.into().unwrap_or_default();
4221        Items::new(self.scope.operation(
4222            Method::GET,
4223            "/v1/tiktok/profiles/{identifier}/followers",
4224            options.query(),
4225            options.request_options,
4226        ))
4227    }
4228}
4229
4230/// The `tiktok.profile.following` resources.
4231///
4232/// Selecting a resource never sends a request. Only its terminal operations do.
4233#[derive(Clone, Debug)]
4234pub struct TikTokProfileFollowingResource {
4235    scope: Scope,
4236}
4237
4238impl TikTokProfileFollowingResource {
4239    /// List profile following.
4240    ///
4241    /// Return a cursor-paginated collection of Tiktok profiles. Test and Live use the
4242    /// same route, parameters, response schema, pagination, and errors. In Test, null
4243    /// means unavailable, not zero.
4244    ///
4245    /// `GET /v1/tiktok/profiles/{identifier}/following`
4246    pub async fn list(
4247        &self,
4248        options: impl Into<Option<TikTokProfileFollowingOptions>>,
4249    ) -> Result<TikTokProfileFollowingPage, Error> {
4250        let options = options.into().unwrap_or_default();
4251        self.scope
4252            .operation(
4253                Method::GET,
4254                "/v1/tiktok/profiles/{identifier}/following",
4255                options.query(),
4256                options.request_options,
4257            )?
4258            .send_page()
4259            .await
4260    }
4261
4262    /// Iterates lazily over every item of [`list`](Self::list), one page per request.
4263    pub fn items(
4264        &self,
4265        options: impl Into<Option<TikTokProfileFollowingOptions>>,
4266    ) -> Items<TikTokProfile> {
4267        let options = options.into().unwrap_or_default();
4268        Items::new(self.scope.operation(
4269            Method::GET,
4270            "/v1/tiktok/profiles/{identifier}/following",
4271            options.query(),
4272            options.request_options,
4273        ))
4274    }
4275}
4276
4277/// The `tiktok.profile.likedPosts` resources.
4278///
4279/// Selecting a resource never sends a request. Only its terminal operations do.
4280#[derive(Clone, Debug)]
4281pub struct TikTokProfileLikedPostsResource {
4282    scope: Scope,
4283}
4284
4285impl TikTokProfileLikedPostsResource {
4286    /// List profile liked posts.
4287    ///
4288    /// Return a cursor-paginated collection of a public Tiktok profile's liked posts.
4289    /// Test and Live use the same route, parameters, response schema, pagination, and
4290    /// errors. In Test, null means unavailable, not zero.
4291    ///
4292    /// `GET /v1/tiktok/profiles/{identifier}/liked-posts`
4293    pub async fn list(
4294        &self,
4295        options: impl Into<Option<TikTokProfileLikedPostsOptions>>,
4296    ) -> Result<TikTokProfileLikedPostsPage, Error> {
4297        let options = options.into().unwrap_or_default();
4298        self.scope
4299            .operation(
4300                Method::GET,
4301                "/v1/tiktok/profiles/{identifier}/liked-posts",
4302                options.query(),
4303                options.request_options,
4304            )?
4305            .send_page()
4306            .await
4307    }
4308
4309    /// Iterates lazily over every item of [`list`](Self::list), one page per request.
4310    pub fn items(
4311        &self,
4312        options: impl Into<Option<TikTokProfileLikedPostsOptions>>,
4313    ) -> Items<TikTokPost> {
4314        let options = options.into().unwrap_or_default();
4315        Items::new(self.scope.operation(
4316            Method::GET,
4317            "/v1/tiktok/profiles/{identifier}/liked-posts",
4318            options.query(),
4319            options.request_options,
4320        ))
4321    }
4322}
4323
4324/// One selected playlist on TikTok.
4325///
4326/// Selecting a resource never sends a request. Only its terminal operations do.
4327#[derive(Clone, Debug)]
4328pub struct TikTokProfilePlaylistResource {
4329    scope: Scope,
4330}
4331
4332impl TikTokProfilePlaylistResource {
4333    /// Selects the posts resources. This never sends a request.
4334    pub fn posts(&self) -> TikTokProfilePlaylistPostsResource {
4335        TikTokProfilePlaylistPostsResource {
4336            scope: self.scope.clone(),
4337        }
4338    }
4339
4340    /// Get a playlist.
4341    ///
4342    /// Get a playlist from public Tiktok data. Test and Live use the same route,
4343    /// parameters, response schema, pagination, and errors. In Test, null means
4344    /// unavailable, not zero.
4345    ///
4346    /// `GET /v1/tiktok/profiles/{identifier}/playlists/{playlist_id}`
4347    pub async fn get(
4348        &self,
4349        options: impl Into<Option<TikTokProfilePlaylistOptions>>,
4350    ) -> Result<TikTokProfilePlaylistResponse, Error> {
4351        let options = options.into().unwrap_or_default();
4352        self.scope
4353            .operation(
4354                Method::GET,
4355                "/v1/tiktok/profiles/{identifier}/playlists/{playlist_id}",
4356                options.query(),
4357                options.request_options,
4358            )?
4359            .send()
4360            .await
4361    }
4362}
4363
4364/// The `tiktok.profile.playlist.posts` resources.
4365///
4366/// Selecting a resource never sends a request. Only its terminal operations do.
4367#[derive(Clone, Debug)]
4368pub struct TikTokProfilePlaylistPostsResource {
4369    scope: Scope,
4370}
4371
4372impl TikTokProfilePlaylistPostsResource {
4373    /// List playlist posts.
4374    ///
4375    /// Return a cursor-paginated collection of posts in a public TikTok profile
4376    /// playlist. Test and Live use the same route, parameters, response schema,
4377    /// pagination, and errors. In Test, null means unavailable, not zero.
4378    ///
4379    /// `GET /v1/tiktok/profiles/{identifier}/playlists/{playlist_id}/posts`
4380    pub async fn list(
4381        &self,
4382        options: impl Into<Option<TikTokProfilePlaylistPostsOptions>>,
4383    ) -> Result<TikTokProfilePlaylistPostsPage, Error> {
4384        let options = options.into().unwrap_or_default();
4385        self.scope
4386            .operation(
4387                Method::GET,
4388                "/v1/tiktok/profiles/{identifier}/playlists/{playlist_id}/posts",
4389                options.query(),
4390                options.request_options,
4391            )?
4392            .send_page()
4393            .await
4394    }
4395
4396    /// Iterates lazily over every item of [`list`](Self::list), one page per request.
4397    pub fn items(
4398        &self,
4399        options: impl Into<Option<TikTokProfilePlaylistPostsOptions>>,
4400    ) -> Items<TikTokPost> {
4401        let options = options.into().unwrap_or_default();
4402        Items::new(self.scope.operation(
4403            Method::GET,
4404            "/v1/tiktok/profiles/{identifier}/playlists/{playlist_id}/posts",
4405            options.query(),
4406            options.request_options,
4407        ))
4408    }
4409}
4410
4411/// The `tiktok.profile.playlists` resources.
4412///
4413/// Selecting a resource never sends a request. Only its terminal operations do.
4414#[derive(Clone, Debug)]
4415pub struct TikTokProfilePlaylistsResource {
4416    scope: Scope,
4417}
4418
4419impl TikTokProfilePlaylistsResource {
4420    /// List profile playlists.
4421    ///
4422    /// List profile playlists from public Tiktok data. Test and Live use the same
4423    /// route, parameters, response schema, pagination, and errors. In Test, null means
4424    /// unavailable, not zero.
4425    ///
4426    /// `GET /v1/tiktok/profiles/{identifier}/playlists`
4427    pub async fn list(
4428        &self,
4429        options: impl Into<Option<TikTokProfilePlaylistsOptions>>,
4430    ) -> Result<TikTokProfilePlaylistsPage, Error> {
4431        let options = options.into().unwrap_or_default();
4432        self.scope
4433            .operation(
4434                Method::GET,
4435                "/v1/tiktok/profiles/{identifier}/playlists",
4436                options.query(),
4437                options.request_options,
4438            )?
4439            .send_page()
4440            .await
4441    }
4442
4443    /// Iterates lazily over every item of [`list`](Self::list), one page per request.
4444    pub fn items(
4445        &self,
4446        options: impl Into<Option<TikTokProfilePlaylistsOptions>>,
4447    ) -> Items<TikTokPlaylist> {
4448        let options = options.into().unwrap_or_default();
4449        Items::new(self.scope.operation(
4450            Method::GET,
4451            "/v1/tiktok/profiles/{identifier}/playlists",
4452            options.query(),
4453            options.request_options,
4454        ))
4455    }
4456}
4457
4458/// The `tiktok.profile.posts` resources.
4459///
4460/// Selecting a resource never sends a request. Only its terminal operations do.
4461#[derive(Clone, Debug)]
4462pub struct TikTokProfilePostsResource {
4463    scope: Scope,
4464}
4465
4466impl TikTokProfilePostsResource {
4467    /// List profile posts.
4468    ///
4469    /// Return a stable page of posts for one public profile. Test and Live use the same
4470    /// route, parameters, response schema, pagination, and errors. In Test, null means
4471    /// unavailable, not zero.
4472    ///
4473    /// `GET /v1/tiktok/profiles/{identifier}/posts`
4474    pub async fn list(
4475        &self,
4476        options: impl Into<Option<TikTokProfilePostsOptions>>,
4477    ) -> Result<TikTokProfilePostsPage, Error> {
4478        let options = options.into().unwrap_or_default();
4479        self.scope
4480            .operation(
4481                Method::GET,
4482                "/v1/tiktok/profiles/{identifier}/posts",
4483                options.query(),
4484                options.request_options,
4485            )?
4486            .send_page()
4487            .await
4488    }
4489
4490    /// Iterates lazily over every item of [`list`](Self::list), one page per request.
4491    pub fn items(
4492        &self,
4493        options: impl Into<Option<TikTokProfilePostsOptions>>,
4494    ) -> Items<TikTokPost> {
4495        let options = options.into().unwrap_or_default();
4496        Items::new(self.scope.operation(
4497            Method::GET,
4498            "/v1/tiktok/profiles/{identifier}/posts",
4499            options.query(),
4500            options.request_options,
4501        ))
4502    }
4503}
4504
4505/// The `tiktok.search` resources.
4506///
4507/// Selecting a resource never sends a request. Only its terminal operations do.
4508#[derive(Clone, Debug)]
4509pub struct TikTokSearchResource {
4510    scope: Scope,
4511}
4512
4513impl TikTokSearchResource {
4514    /// Selects the hashtags resources. This never sends a request.
4515    pub fn hashtags(&self) -> TikTokSearchHashtagsResource {
4516        TikTokSearchHashtagsResource {
4517            scope: self.scope.clone(),
4518        }
4519    }
4520
4521    /// Selects the locations resources. This never sends a request.
4522    pub fn locations(&self) -> TikTokSearchLocationsResource {
4523        TikTokSearchLocationsResource {
4524            scope: self.scope.clone(),
4525        }
4526    }
4527
4528    /// Selects the music resources. This never sends a request.
4529    pub fn music(&self) -> TikTokSearchMusicResource {
4530        TikTokSearchMusicResource {
4531            scope: self.scope.clone(),
4532        }
4533    }
4534
4535    /// Selects the posts resources. This never sends a request.
4536    pub fn posts(&self) -> TikTokSearchPostsResource {
4537        TikTokSearchPostsResource {
4538            scope: self.scope.clone(),
4539        }
4540    }
4541
4542    /// Selects the profiles resources. This never sends a request.
4543    pub fn profiles(&self) -> TikTokSearchProfilesResource {
4544        TikTokSearchProfilesResource {
4545            scope: self.scope.clone(),
4546        }
4547    }
4548}
4549
4550/// The `tiktok.search.hashtags` resources.
4551///
4552/// Selecting a resource never sends a request. Only its terminal operations do.
4553#[derive(Clone, Debug)]
4554pub struct TikTokSearchHashtagsResource {
4555    scope: Scope,
4556}
4557
4558impl TikTokSearchHashtagsResource {
4559    /// Search Tiktok hashtags.
4560    ///
4561    /// Search public Tiktok hashtags with cursor pagination. Test and Live use the same
4562    /// route, parameters, response schema, pagination, and errors. In Test, null means
4563    /// unavailable, not zero.
4564    ///
4565    /// `GET /v1/tiktok/search/hashtags`
4566    pub async fn list(
4567        &self,
4568        options: TikTokSearchHashtagsOptions,
4569    ) -> Result<TikTokSearchHashtagsPage, Error> {
4570        self.scope
4571            .operation(
4572                Method::GET,
4573                "/v1/tiktok/search/hashtags",
4574                options.query(),
4575                options.request_options,
4576            )?
4577            .send_page()
4578            .await
4579    }
4580
4581    /// Iterates lazily over every item of [`list`](Self::list), one page per request.
4582    pub fn items(&self, options: TikTokSearchHashtagsOptions) -> Items<TikTokHashtag> {
4583        Items::new(self.scope.operation(
4584            Method::GET,
4585            "/v1/tiktok/search/hashtags",
4586            options.query(),
4587            options.request_options,
4588        ))
4589    }
4590}
4591
4592/// The `tiktok.search.locations` resources.
4593///
4594/// Selecting a resource never sends a request. Only its terminal operations do.
4595#[derive(Clone, Debug)]
4596pub struct TikTokSearchLocationsResource {
4597    scope: Scope,
4598}
4599
4600impl TikTokSearchLocationsResource {
4601    /// Search Tiktok locations.
4602    ///
4603    /// Search public Tiktok locations with cursor pagination. Test and Live use the
4604    /// same route, parameters, response schema, pagination, and errors. In Test, null
4605    /// means unavailable, not zero.
4606    ///
4607    /// `GET /v1/tiktok/search/locations`
4608    pub async fn list(
4609        &self,
4610        options: TikTokSearchLocationsOptions,
4611    ) -> Result<TikTokSearchLocationsPage, Error> {
4612        self.scope
4613            .operation(
4614                Method::GET,
4615                "/v1/tiktok/search/locations",
4616                options.query(),
4617                options.request_options,
4618            )?
4619            .send_page()
4620            .await
4621    }
4622
4623    /// Iterates lazily over every item of [`list`](Self::list), one page per request.
4624    pub fn items(&self, options: TikTokSearchLocationsOptions) -> Items<TikTokLocation> {
4625        Items::new(self.scope.operation(
4626            Method::GET,
4627            "/v1/tiktok/search/locations",
4628            options.query(),
4629            options.request_options,
4630        ))
4631    }
4632}
4633
4634/// The `tiktok.search.music` resources.
4635///
4636/// Selecting a resource never sends a request. Only its terminal operations do.
4637#[derive(Clone, Debug)]
4638pub struct TikTokSearchMusicResource {
4639    scope: Scope,
4640}
4641
4642impl TikTokSearchMusicResource {
4643    /// Search Tiktok music.
4644    ///
4645    /// Search public Tiktok music with cursor pagination. Test and Live use the same
4646    /// route, parameters, response schema, pagination, and errors. In Test, null means
4647    /// unavailable, not zero.
4648    ///
4649    /// `GET /v1/tiktok/search/music`
4650    pub async fn list(
4651        &self,
4652        options: TikTokSearchMusicOptions,
4653    ) -> Result<TikTokSearchMusicPage, Error> {
4654        self.scope
4655            .operation(
4656                Method::GET,
4657                "/v1/tiktok/search/music",
4658                options.query(),
4659                options.request_options,
4660            )?
4661            .send_page()
4662            .await
4663    }
4664
4665    /// Iterates lazily over every item of [`list`](Self::list), one page per request.
4666    pub fn items(&self, options: TikTokSearchMusicOptions) -> Items<TikTokMusic> {
4667        Items::new(self.scope.operation(
4668            Method::GET,
4669            "/v1/tiktok/search/music",
4670            options.query(),
4671            options.request_options,
4672        ))
4673    }
4674}
4675
4676/// The `tiktok.search.posts` resources.
4677///
4678/// Selecting a resource never sends a request. Only its terminal operations do.
4679#[derive(Clone, Debug)]
4680pub struct TikTokSearchPostsResource {
4681    scope: Scope,
4682}
4683
4684impl TikTokSearchPostsResource {
4685    /// Search Tiktok posts.
4686    ///
4687    /// Search public Tiktok posts with cursor pagination. Test and Live use the same
4688    /// route, parameters, response schema, pagination, and errors. In Test, null means
4689    /// unavailable, not zero.
4690    ///
4691    /// `GET /v1/tiktok/search/posts`
4692    pub async fn list(
4693        &self,
4694        options: TikTokSearchPostsOptions,
4695    ) -> Result<TikTokSearchPostsPage, Error> {
4696        self.scope
4697            .operation(
4698                Method::GET,
4699                "/v1/tiktok/search/posts",
4700                options.query(),
4701                options.request_options,
4702            )?
4703            .send_page()
4704            .await
4705    }
4706
4707    /// Iterates lazily over every item of [`list`](Self::list), one page per request.
4708    pub fn items(&self, options: TikTokSearchPostsOptions) -> Items<TikTokPost> {
4709        Items::new(self.scope.operation(
4710            Method::GET,
4711            "/v1/tiktok/search/posts",
4712            options.query(),
4713            options.request_options,
4714        ))
4715    }
4716}
4717
4718/// The `tiktok.search.profiles` resources.
4719///
4720/// Selecting a resource never sends a request. Only its terminal operations do.
4721#[derive(Clone, Debug)]
4722pub struct TikTokSearchProfilesResource {
4723    scope: Scope,
4724}
4725
4726impl TikTokSearchProfilesResource {
4727    /// Search Tiktok profiles.
4728    ///
4729    /// Search public Tiktok profiles with cursor pagination. Test and Live use the same
4730    /// route, parameters, response schema, pagination, and errors. In Test, null means
4731    /// unavailable, not zero.
4732    ///
4733    /// `GET /v1/tiktok/search/profiles`
4734    pub async fn list(
4735        &self,
4736        options: TikTokSearchProfilesOptions,
4737    ) -> Result<TikTokSearchProfilesPage, Error> {
4738        self.scope
4739            .operation(
4740                Method::GET,
4741                "/v1/tiktok/search/profiles",
4742                options.query(),
4743                options.request_options,
4744            )?
4745            .send_page()
4746            .await
4747    }
4748
4749    /// Iterates lazily over every item of [`list`](Self::list), one page per request.
4750    pub fn items(&self, options: TikTokSearchProfilesOptions) -> Items<TikTokProfile> {
4751        Items::new(self.scope.operation(
4752            Method::GET,
4753            "/v1/tiktok/search/profiles",
4754            options.query(),
4755            options.request_options,
4756        ))
4757    }
4758}
4759
4760/// The `tiktok.trending` resources.
4761///
4762/// Selecting a resource never sends a request. Only its terminal operations do.
4763#[derive(Clone, Debug)]
4764pub struct TikTokTrendingResource {
4765    scope: Scope,
4766}
4767
4768impl TikTokTrendingResource {
4769    /// Selects the categories resources. This never sends a request.
4770    pub fn categories(&self) -> TikTokTrendingCategoriesResource {
4771        TikTokTrendingCategoriesResource {
4772            scope: self.scope.clone(),
4773        }
4774    }
4775
4776    /// Selects the music resources. This never sends a request.
4777    pub fn music(&self) -> TikTokTrendingMusicResource {
4778        TikTokTrendingMusicResource {
4779            scope: self.scope.clone(),
4780        }
4781    }
4782
4783    /// Selects the posts resources. This never sends a request.
4784    pub fn posts(&self) -> TikTokTrendingPostsResource {
4785        TikTokTrendingPostsResource {
4786            scope: self.scope.clone(),
4787        }
4788    }
4789}
4790
4791/// The `tiktok.trending.categories` resources.
4792///
4793/// Selecting a resource never sends a request. Only its terminal operations do.
4794#[derive(Clone, Debug)]
4795pub struct TikTokTrendingCategoriesResource {
4796    scope: Scope,
4797}
4798
4799impl TikTokTrendingCategoriesResource {
4800    /// List trending categories.
4801    ///
4802    /// Return TikTok trending categories. Test and Live use the same route, parameters,
4803    /// response schema, pagination, and errors. In Test, null means unavailable, not
4804    /// zero.
4805    ///
4806    /// `GET /v1/tiktok/trending/categories`
4807    pub async fn list(
4808        &self,
4809        options: impl Into<Option<TikTokTrendingCategoriesOptions>>,
4810    ) -> Result<TikTokTrendingCategoriesPage, Error> {
4811        let options = options.into().unwrap_or_default();
4812        self.scope
4813            .operation(
4814                Method::GET,
4815                "/v1/tiktok/trending/categories",
4816                options.query(),
4817                options.request_options,
4818            )?
4819            .send_page()
4820            .await
4821    }
4822
4823    /// Iterates lazily over every item of [`list`](Self::list), one page per request.
4824    pub fn items(
4825        &self,
4826        options: impl Into<Option<TikTokTrendingCategoriesOptions>>,
4827    ) -> Items<TikTokCategory> {
4828        let options = options.into().unwrap_or_default();
4829        Items::new(self.scope.operation(
4830            Method::GET,
4831            "/v1/tiktok/trending/categories",
4832            options.query(),
4833            options.request_options,
4834        ))
4835    }
4836}
4837
4838/// The `tiktok.trending.music` resources.
4839///
4840/// Selecting a resource never sends a request. Only its terminal operations do.
4841#[derive(Clone, Debug)]
4842pub struct TikTokTrendingMusicResource {
4843    scope: Scope,
4844}
4845
4846impl TikTokTrendingMusicResource {
4847    /// List trending music.
4848    ///
4849    /// Return TikTok's public Top 50 music chart for the configured provider region.
4850    /// Test and Live use the same route, parameters, response schema, pagination, and
4851    /// errors. In Test, null means unavailable, not zero.
4852    ///
4853    /// `GET /v1/tiktok/trending/music`
4854    pub async fn list(
4855        &self,
4856        options: impl Into<Option<TikTokTrendingMusicOptions>>,
4857    ) -> Result<TikTokTrendingMusicPage, Error> {
4858        let options = options.into().unwrap_or_default();
4859        self.scope
4860            .operation(
4861                Method::GET,
4862                "/v1/tiktok/trending/music",
4863                options.query(),
4864                options.request_options,
4865            )?
4866            .send_page()
4867            .await
4868    }
4869
4870    /// Iterates lazily over every item of [`list`](Self::list), one page per request.
4871    pub fn items(
4872        &self,
4873        options: impl Into<Option<TikTokTrendingMusicOptions>>,
4874    ) -> Items<TikTokMusic> {
4875        let options = options.into().unwrap_or_default();
4876        Items::new(self.scope.operation(
4877            Method::GET,
4878            "/v1/tiktok/trending/music",
4879            options.query(),
4880            options.request_options,
4881        ))
4882    }
4883}
4884
4885/// The `tiktok.trending.posts` resources.
4886///
4887/// Selecting a resource never sends a request. Only its terminal operations do.
4888#[derive(Clone, Debug)]
4889pub struct TikTokTrendingPostsResource {
4890    scope: Scope,
4891}
4892
4893impl TikTokTrendingPostsResource {
4894    /// List trending posts.
4895    ///
4896    /// Return TikTok's public recommended feed. Test and Live use the same route,
4897    /// parameters, response schema, pagination, and errors. In Test, null means
4898    /// unavailable, not zero.
4899    ///
4900    /// `GET /v1/tiktok/trending/posts`
4901    pub async fn list(
4902        &self,
4903        options: impl Into<Option<TikTokTrendingPostsOptions>>,
4904    ) -> Result<TikTokTrendingPostsPage, Error> {
4905        let options = options.into().unwrap_or_default();
4906        self.scope
4907            .operation(
4908                Method::GET,
4909                "/v1/tiktok/trending/posts",
4910                options.query(),
4911                options.request_options,
4912            )?
4913            .send_page()
4914            .await
4915    }
4916
4917    /// Iterates lazily over every item of [`list`](Self::list), one page per request.
4918    pub fn items(
4919        &self,
4920        options: impl Into<Option<TikTokTrendingPostsOptions>>,
4921    ) -> Items<TikTokPost> {
4922        let options = options.into().unwrap_or_default();
4923        Items::new(self.scope.operation(
4924            Method::GET,
4925            "/v1/tiktok/trending/posts",
4926            options.query(),
4927            options.request_options,
4928        ))
4929    }
4930}
4931
4932/// The `twitter` resources.
4933///
4934/// Selecting a resource never sends a request. Only its terminal operations do.
4935#[derive(Clone, Debug)]
4936pub struct TwitterResource {
4937    scope: Scope,
4938}
4939
4940impl TwitterResource {
4941    /// Selects one list. This never sends a request.
4942    ///
4943    /// A raw string is the native ID or shorthand unless it is a supported social
4944    /// URL. Pass [`Id`](crate::Id) or [`Url`](crate::Url) to state the meaning.
4945    /// An invalid reference fails the first operation, before any request.
4946    pub fn list(&self, reference: impl Into<ResourceReference>) -> TwitterListResource {
4947        TwitterListResource {
4948            scope: self.scope.select(
4949                "identifier",
4950                "twitter",
4951                "list",
4952                Reference::from(reference.into()),
4953            ),
4954        }
4955    }
4956
4957    /// Selects one post. This never sends a request.
4958    ///
4959    /// A raw string is the native ID or shorthand unless it is a supported social
4960    /// URL. Pass [`Id`](crate::Id) or [`Url`](crate::Url) to state the meaning.
4961    /// An invalid reference fails the first operation, before any request.
4962    pub fn post(&self, reference: impl Into<ResourceReference>) -> TwitterPostResource {
4963        TwitterPostResource {
4964            scope: self.scope.select(
4965                "identifier",
4966                "twitter",
4967                "post",
4968                Reference::from(reference.into()),
4969            ),
4970        }
4971    }
4972
4973    /// Selects one profile. This never sends a request.
4974    ///
4975    /// A raw string is a username unless it is a supported social URL. Pass
4976    /// [`Username`](crate::Username), [`Id`](crate::Id), or [`Url`](crate::Url) to state the meaning.
4977    /// An invalid reference fails the first operation, before any request.
4978    pub fn profile(&self, reference: impl Into<ProfileReference>) -> TwitterProfileResource {
4979        TwitterProfileResource {
4980            scope: self.scope.select(
4981                "identifier",
4982                "twitter",
4983                "profile",
4984                Reference::from(reference.into()),
4985            ),
4986        }
4987    }
4988
4989    /// Selects the search resources. This never sends a request.
4990    pub fn search(&self) -> TwitterSearchResource {
4991        TwitterSearchResource {
4992            scope: self.scope.clone(),
4993        }
4994    }
4995}
4996
4997/// One selected list on X (Twitter).
4998///
4999/// Selecting a resource never sends a request. Only its terminal operations do.
5000#[derive(Clone, Debug)]
5001pub struct TwitterListResource {
5002    scope: Scope,
5003}
5004
5005impl TwitterListResource {
5006    /// Selects the posts resources. This never sends a request.
5007    pub fn posts(&self) -> TwitterListPostsResource {
5008        TwitterListPostsResource {
5009            scope: self.scope.clone(),
5010        }
5011    }
5012}
5013
5014/// The `twitter.list.posts` resources.
5015///
5016/// Selecting a resource never sends a request. Only its terminal operations do.
5017#[derive(Clone, Debug)]
5018pub struct TwitterListPostsResource {
5019    scope: Scope,
5020}
5021
5022impl TwitterListPostsResource {
5023    /// List Twitter list posts.
5024    ///
5025    /// Return the cursor-paginated timeline for a Twitter list. Test and Live use the
5026    /// same route, parameters, response schema, pagination, and errors. In Test, null
5027    /// means unavailable, not zero.
5028    ///
5029    /// `GET /v1/twitter/lists/{identifier}/posts`
5030    pub async fn list(
5031        &self,
5032        options: impl Into<Option<TwitterListPostsOptions>>,
5033    ) -> Result<TwitterListPostsPage, Error> {
5034        let options = options.into().unwrap_or_default();
5035        self.scope
5036            .operation(
5037                Method::GET,
5038                "/v1/twitter/lists/{identifier}/posts",
5039                options.query(),
5040                options.request_options,
5041            )?
5042            .send_page()
5043            .await
5044    }
5045
5046    /// Iterates lazily over every item of [`list`](Self::list), one page per request.
5047    pub fn items(&self, options: impl Into<Option<TwitterListPostsOptions>>) -> Items<TwitterPost> {
5048        let options = options.into().unwrap_or_default();
5049        Items::new(self.scope.operation(
5050            Method::GET,
5051            "/v1/twitter/lists/{identifier}/posts",
5052            options.query(),
5053            options.request_options,
5054        ))
5055    }
5056}
5057
5058/// One selected post on X (Twitter).
5059///
5060/// Selecting a resource never sends a request. Only its terminal operations do.
5061#[derive(Clone, Debug)]
5062pub struct TwitterPostResource {
5063    scope: Scope,
5064}
5065
5066impl TwitterPostResource {
5067    /// Selects one comment. This never sends a request.
5068    ///
5069    /// A raw string is the native ID or shorthand unless it is a supported social
5070    /// URL. Pass [`Id`](crate::Id) or [`Url`](crate::Url) to state the meaning.
5071    /// An invalid reference fails the first operation, before any request.
5072    pub fn comment(&self, reference: impl Into<ResourceReference>) -> TwitterPostCommentResource {
5073        TwitterPostCommentResource {
5074            scope: self.scope.select(
5075                "comment_id",
5076                "twitter",
5077                "comment",
5078                Reference::from(reference.into()),
5079            ),
5080        }
5081    }
5082
5083    /// Selects the comments resources. This never sends a request.
5084    pub fn comments(&self) -> TwitterPostCommentsResource {
5085        TwitterPostCommentsResource {
5086            scope: self.scope.clone(),
5087        }
5088    }
5089
5090    /// Selects the reposters resources. This never sends a request.
5091    pub fn reposters(&self) -> TwitterPostRepostersResource {
5092        TwitterPostRepostersResource {
5093            scope: self.scope.clone(),
5094        }
5095    }
5096
5097    /// Get a post.
5098    ///
5099    /// Get a post by a canonical platform identifier. URLs must be converted before
5100    /// calling a data endpoint. Test and Live use the same route, parameters, response
5101    /// schema, pagination, and errors. In Test, null means unavailable, not zero.
5102    ///
5103    /// `GET /v1/twitter/posts/{identifier}`
5104    pub async fn get(
5105        &self,
5106        options: impl Into<Option<TwitterPostOptions>>,
5107    ) -> Result<TwitterPostResponse, Error> {
5108        let options = options.into().unwrap_or_default();
5109        self.scope
5110            .operation(
5111                Method::GET,
5112                "/v1/twitter/posts/{identifier}",
5113                options.query(),
5114                options.request_options,
5115            )?
5116            .send()
5117            .await
5118    }
5119}
5120
5121/// One selected comment on X (Twitter).
5122///
5123/// Selecting a resource never sends a request. Only its terminal operations do.
5124#[derive(Clone, Debug)]
5125pub struct TwitterPostCommentResource {
5126    scope: Scope,
5127}
5128
5129impl TwitterPostCommentResource {
5130    /// Selects the replies resources. This never sends a request.
5131    pub fn replies(&self) -> TwitterPostCommentRepliesResource {
5132        TwitterPostCommentRepliesResource {
5133            scope: self.scope.clone(),
5134        }
5135    }
5136}
5137
5138/// The `twitter.post.comment.replies` resources.
5139///
5140/// Selecting a resource never sends a request. Only its terminal operations do.
5141#[derive(Clone, Debug)]
5142pub struct TwitterPostCommentRepliesResource {
5143    scope: Scope,
5144}
5145
5146impl TwitterPostCommentRepliesResource {
5147    /// List comment replies.
5148    ///
5149    /// Return a stable page of replies for one comment. Use find_test_data to discover
5150    /// compatible post and comment IDs. Test and Live use the same route, parameters,
5151    /// response schema, pagination, and errors. In Test, null means unavailable, not
5152    /// zero.
5153    ///
5154    /// `GET /v1/twitter/posts/{identifier}/comments/{comment_id}/replies`
5155    pub async fn list(
5156        &self,
5157        options: impl Into<Option<TwitterPostCommentRepliesOptions>>,
5158    ) -> Result<TwitterPostCommentRepliesPage, Error> {
5159        let options = options.into().unwrap_or_default();
5160        self.scope
5161            .operation(
5162                Method::GET,
5163                "/v1/twitter/posts/{identifier}/comments/{comment_id}/replies",
5164                options.query(),
5165                options.request_options,
5166            )?
5167            .send_page()
5168            .await
5169    }
5170
5171    /// Iterates lazily over every item of [`list`](Self::list), one page per request.
5172    pub fn items(
5173        &self,
5174        options: impl Into<Option<TwitterPostCommentRepliesOptions>>,
5175    ) -> Items<TwitterPost> {
5176        let options = options.into().unwrap_or_default();
5177        Items::new(self.scope.operation(
5178            Method::GET,
5179            "/v1/twitter/posts/{identifier}/comments/{comment_id}/replies",
5180            options.query(),
5181            options.request_options,
5182        ))
5183    }
5184}
5185
5186/// The `twitter.post.comments` resources.
5187///
5188/// Selecting a resource never sends a request. Only its terminal operations do.
5189#[derive(Clone, Debug)]
5190pub struct TwitterPostCommentsResource {
5191    scope: Scope,
5192}
5193
5194impl TwitterPostCommentsResource {
5195    /// List post comments.
5196    ///
5197    /// List post comments by a canonical platform identifier. URLs must be converted
5198    /// before calling a data endpoint. Test and Live use the same route, parameters,
5199    /// response schema, pagination, and errors. In Test, null means unavailable, not
5200    /// zero.
5201    ///
5202    /// `GET /v1/twitter/posts/{identifier}/comments`
5203    pub async fn list(
5204        &self,
5205        options: impl Into<Option<TwitterPostCommentsOptions>>,
5206    ) -> Result<TwitterPostCommentsPage, Error> {
5207        let options = options.into().unwrap_or_default();
5208        self.scope
5209            .operation(
5210                Method::GET,
5211                "/v1/twitter/posts/{identifier}/comments",
5212                options.query(),
5213                options.request_options,
5214            )?
5215            .send_page()
5216            .await
5217    }
5218
5219    /// Iterates lazily over every item of [`list`](Self::list), one page per request.
5220    pub fn items(
5221        &self,
5222        options: impl Into<Option<TwitterPostCommentsOptions>>,
5223    ) -> Items<TwitterPost> {
5224        let options = options.into().unwrap_or_default();
5225        Items::new(self.scope.operation(
5226            Method::GET,
5227            "/v1/twitter/posts/{identifier}/comments",
5228            options.query(),
5229            options.request_options,
5230        ))
5231    }
5232}
5233
5234/// The `twitter.post.reposters` resources.
5235///
5236/// Selecting a resource never sends a request. Only its terminal operations do.
5237#[derive(Clone, Debug)]
5238pub struct TwitterPostRepostersResource {
5239    scope: Scope,
5240}
5241
5242impl TwitterPostRepostersResource {
5243    /// List post reposters.
5244    ///
5245    /// Return public profiles that interacted with a Twitter post. Test and Live use
5246    /// the same route, parameters, response schema, pagination, and errors. In Test,
5247    /// null means unavailable, not zero.
5248    ///
5249    /// `GET /v1/twitter/posts/{identifier}/reposters`
5250    pub async fn list(
5251        &self,
5252        options: impl Into<Option<TwitterPostRepostersOptions>>,
5253    ) -> Result<TwitterPostRepostersPage, Error> {
5254        let options = options.into().unwrap_or_default();
5255        self.scope
5256            .operation(
5257                Method::GET,
5258                "/v1/twitter/posts/{identifier}/reposters",
5259                options.query(),
5260                options.request_options,
5261            )?
5262            .send_page()
5263            .await
5264    }
5265
5266    /// Iterates lazily over every item of [`list`](Self::list), one page per request.
5267    pub fn items(
5268        &self,
5269        options: impl Into<Option<TwitterPostRepostersOptions>>,
5270    ) -> Items<TwitterProfile> {
5271        let options = options.into().unwrap_or_default();
5272        Items::new(self.scope.operation(
5273            Method::GET,
5274            "/v1/twitter/posts/{identifier}/reposters",
5275            options.query(),
5276            options.request_options,
5277        ))
5278    }
5279}
5280
5281/// One selected profile on X (Twitter).
5282///
5283/// Selecting a resource never sends a request. Only its terminal operations do.
5284#[derive(Clone, Debug)]
5285pub struct TwitterProfileResource {
5286    scope: Scope,
5287}
5288
5289impl TwitterProfileResource {
5290    /// Selects the followers resources. This never sends a request.
5291    pub fn followers(&self) -> TwitterProfileFollowersResource {
5292        TwitterProfileFollowersResource {
5293            scope: self.scope.clone(),
5294        }
5295    }
5296
5297    /// Selects the following resources. This never sends a request.
5298    pub fn following(&self) -> TwitterProfileFollowingResource {
5299        TwitterProfileFollowingResource {
5300            scope: self.scope.clone(),
5301        }
5302    }
5303
5304    /// Selects the media resources. This never sends a request.
5305    pub fn media(&self) -> TwitterProfileMediaResource {
5306        TwitterProfileMediaResource {
5307            scope: self.scope.clone(),
5308        }
5309    }
5310
5311    /// Selects the posts resources. This never sends a request.
5312    pub fn posts(&self) -> TwitterProfilePostsResource {
5313        TwitterProfilePostsResource {
5314            scope: self.scope.clone(),
5315        }
5316    }
5317
5318    /// Selects the replies resources. This never sends a request.
5319    pub fn replies(&self) -> TwitterProfileRepliesResource {
5320        TwitterProfileRepliesResource {
5321            scope: self.scope.clone(),
5322        }
5323    }
5324
5325    /// Get a profile.
5326    ///
5327    /// Return one public profile. Use @username or a platform ID as the identifier.
5328    /// Test and Live use the same route, parameters, response schema, pagination, and
5329    /// errors. In Test, null means unavailable, not zero.
5330    ///
5331    /// `GET /v1/twitter/profiles/{identifier}`
5332    pub async fn get(
5333        &self,
5334        options: impl Into<Option<TwitterProfileOptions>>,
5335    ) -> Result<TwitterProfileResponse, Error> {
5336        let options = options.into().unwrap_or_default();
5337        self.scope
5338            .operation(
5339                Method::GET,
5340                "/v1/twitter/profiles/{identifier}",
5341                options.query(),
5342                options.request_options,
5343            )?
5344            .send()
5345            .await
5346    }
5347}
5348
5349/// The `twitter.profile.followers` resources.
5350///
5351/// Selecting a resource never sends a request. Only its terminal operations do.
5352#[derive(Clone, Debug)]
5353pub struct TwitterProfileFollowersResource {
5354    scope: Scope,
5355}
5356
5357impl TwitterProfileFollowersResource {
5358    /// List profile followers.
5359    ///
5360    /// Return a cursor-paginated collection of Twitter profiles. Test and Live use the
5361    /// same route, parameters, response schema, pagination, and errors. In Test, null
5362    /// means unavailable, not zero.
5363    ///
5364    /// `GET /v1/twitter/profiles/{identifier}/followers`
5365    pub async fn list(
5366        &self,
5367        options: impl Into<Option<TwitterProfileFollowersOptions>>,
5368    ) -> Result<TwitterProfileFollowersPage, Error> {
5369        let options = options.into().unwrap_or_default();
5370        self.scope
5371            .operation(
5372                Method::GET,
5373                "/v1/twitter/profiles/{identifier}/followers",
5374                options.query(),
5375                options.request_options,
5376            )?
5377            .send_page()
5378            .await
5379    }
5380
5381    /// Iterates lazily over every item of [`list`](Self::list), one page per request.
5382    pub fn items(
5383        &self,
5384        options: impl Into<Option<TwitterProfileFollowersOptions>>,
5385    ) -> Items<TwitterProfile> {
5386        let options = options.into().unwrap_or_default();
5387        Items::new(self.scope.operation(
5388            Method::GET,
5389            "/v1/twitter/profiles/{identifier}/followers",
5390            options.query(),
5391            options.request_options,
5392        ))
5393    }
5394}
5395
5396/// The `twitter.profile.following` resources.
5397///
5398/// Selecting a resource never sends a request. Only its terminal operations do.
5399#[derive(Clone, Debug)]
5400pub struct TwitterProfileFollowingResource {
5401    scope: Scope,
5402}
5403
5404impl TwitterProfileFollowingResource {
5405    /// List profile following.
5406    ///
5407    /// Return a cursor-paginated collection of Twitter profiles. Test and Live use the
5408    /// same route, parameters, response schema, pagination, and errors. In Test, null
5409    /// means unavailable, not zero.
5410    ///
5411    /// `GET /v1/twitter/profiles/{identifier}/following`
5412    pub async fn list(
5413        &self,
5414        options: impl Into<Option<TwitterProfileFollowingOptions>>,
5415    ) -> Result<TwitterProfileFollowingPage, Error> {
5416        let options = options.into().unwrap_or_default();
5417        self.scope
5418            .operation(
5419                Method::GET,
5420                "/v1/twitter/profiles/{identifier}/following",
5421                options.query(),
5422                options.request_options,
5423            )?
5424            .send_page()
5425            .await
5426    }
5427
5428    /// Iterates lazily over every item of [`list`](Self::list), one page per request.
5429    pub fn items(
5430        &self,
5431        options: impl Into<Option<TwitterProfileFollowingOptions>>,
5432    ) -> Items<TwitterProfile> {
5433        let options = options.into().unwrap_or_default();
5434        Items::new(self.scope.operation(
5435            Method::GET,
5436            "/v1/twitter/profiles/{identifier}/following",
5437            options.query(),
5438            options.request_options,
5439        ))
5440    }
5441}
5442
5443/// The `twitter.profile.media` resources.
5444///
5445/// Selecting a resource never sends a request. Only its terminal operations do.
5446#[derive(Clone, Debug)]
5447pub struct TwitterProfileMediaResource {
5448    scope: Scope,
5449}
5450
5451impl TwitterProfileMediaResource {
5452    /// List profile media.
5453    ///
5454    /// Return a cursor-paginated collection of a public Twitter profile's media. Test
5455    /// and Live use the same route, parameters, response schema, pagination, and
5456    /// errors. In Test, null means unavailable, not zero.
5457    ///
5458    /// `GET /v1/twitter/profiles/{identifier}/media`
5459    pub async fn list(
5460        &self,
5461        options: impl Into<Option<TwitterProfileMediaOptions>>,
5462    ) -> Result<TwitterProfileMediaPage, Error> {
5463        let options = options.into().unwrap_or_default();
5464        self.scope
5465            .operation(
5466                Method::GET,
5467                "/v1/twitter/profiles/{identifier}/media",
5468                options.query(),
5469                options.request_options,
5470            )?
5471            .send_page()
5472            .await
5473    }
5474
5475    /// Iterates lazily over every item of [`list`](Self::list), one page per request.
5476    pub fn items(
5477        &self,
5478        options: impl Into<Option<TwitterProfileMediaOptions>>,
5479    ) -> Items<TwitterPost> {
5480        let options = options.into().unwrap_or_default();
5481        Items::new(self.scope.operation(
5482            Method::GET,
5483            "/v1/twitter/profiles/{identifier}/media",
5484            options.query(),
5485            options.request_options,
5486        ))
5487    }
5488}
5489
5490/// The `twitter.profile.posts` resources.
5491///
5492/// Selecting a resource never sends a request. Only its terminal operations do.
5493#[derive(Clone, Debug)]
5494pub struct TwitterProfilePostsResource {
5495    scope: Scope,
5496}
5497
5498impl TwitterProfilePostsResource {
5499    /// List profile posts.
5500    ///
5501    /// Return a stable page of posts for one public profile. Test and Live use the same
5502    /// route, parameters, response schema, pagination, and errors. In Test, null means
5503    /// unavailable, not zero.
5504    ///
5505    /// `GET /v1/twitter/profiles/{identifier}/posts`
5506    pub async fn list(
5507        &self,
5508        options: impl Into<Option<TwitterProfilePostsOptions>>,
5509    ) -> Result<TwitterProfilePostsPage, Error> {
5510        let options = options.into().unwrap_or_default();
5511        self.scope
5512            .operation(
5513                Method::GET,
5514                "/v1/twitter/profiles/{identifier}/posts",
5515                options.query(),
5516                options.request_options,
5517            )?
5518            .send_page()
5519            .await
5520    }
5521
5522    /// Iterates lazily over every item of [`list`](Self::list), one page per request.
5523    pub fn items(
5524        &self,
5525        options: impl Into<Option<TwitterProfilePostsOptions>>,
5526    ) -> Items<TwitterPost> {
5527        let options = options.into().unwrap_or_default();
5528        Items::new(self.scope.operation(
5529            Method::GET,
5530            "/v1/twitter/profiles/{identifier}/posts",
5531            options.query(),
5532            options.request_options,
5533        ))
5534    }
5535}
5536
5537/// The `twitter.profile.replies` resources.
5538///
5539/// Selecting a resource never sends a request. Only its terminal operations do.
5540#[derive(Clone, Debug)]
5541pub struct TwitterProfileRepliesResource {
5542    scope: Scope,
5543}
5544
5545impl TwitterProfileRepliesResource {
5546    /// List profile replies.
5547    ///
5548    /// Return a cursor-paginated collection of a public Twitter profile's replies. Test
5549    /// and Live use the same route, parameters, response schema, pagination, and
5550    /// errors. In Test, null means unavailable, not zero.
5551    ///
5552    /// `GET /v1/twitter/profiles/{identifier}/replies`
5553    pub async fn list(
5554        &self,
5555        options: impl Into<Option<TwitterProfileRepliesOptions>>,
5556    ) -> Result<TwitterProfileRepliesPage, Error> {
5557        let options = options.into().unwrap_or_default();
5558        self.scope
5559            .operation(
5560                Method::GET,
5561                "/v1/twitter/profiles/{identifier}/replies",
5562                options.query(),
5563                options.request_options,
5564            )?
5565            .send_page()
5566            .await
5567    }
5568
5569    /// Iterates lazily over every item of [`list`](Self::list), one page per request.
5570    pub fn items(
5571        &self,
5572        options: impl Into<Option<TwitterProfileRepliesOptions>>,
5573    ) -> Items<TwitterPost> {
5574        let options = options.into().unwrap_or_default();
5575        Items::new(self.scope.operation(
5576            Method::GET,
5577            "/v1/twitter/profiles/{identifier}/replies",
5578            options.query(),
5579            options.request_options,
5580        ))
5581    }
5582}
5583
5584/// The `twitter.search` resources.
5585///
5586/// Selecting a resource never sends a request. Only its terminal operations do.
5587#[derive(Clone, Debug)]
5588pub struct TwitterSearchResource {
5589    scope: Scope,
5590}
5591
5592impl TwitterSearchResource {
5593    /// Selects the media resources. This never sends a request.
5594    pub fn media(&self) -> TwitterSearchMediaResource {
5595        TwitterSearchMediaResource {
5596            scope: self.scope.clone(),
5597        }
5598    }
5599
5600    /// Selects the posts resources. This never sends a request.
5601    pub fn posts(&self) -> TwitterSearchPostsResource {
5602        TwitterSearchPostsResource {
5603            scope: self.scope.clone(),
5604        }
5605    }
5606
5607    /// Selects the suggestions resources. This never sends a request.
5608    pub fn suggestions(&self) -> TwitterSearchSuggestionsResource {
5609        TwitterSearchSuggestionsResource {
5610            scope: self.scope.clone(),
5611        }
5612    }
5613
5614    /// Selects the users resources. This never sends a request.
5615    pub fn users(&self) -> TwitterSearchUsersResource {
5616        TwitterSearchUsersResource {
5617            scope: self.scope.clone(),
5618        }
5619    }
5620}
5621
5622/// The `twitter.search.media` resources.
5623///
5624/// Selecting a resource never sends a request. Only its terminal operations do.
5625#[derive(Clone, Debug)]
5626pub struct TwitterSearchMediaResource {
5627    scope: Scope,
5628}
5629
5630impl TwitterSearchMediaResource {
5631    /// Search Twitter media.
5632    ///
5633    /// Search public Twitter media with cursor pagination. Test and Live use the same
5634    /// route, parameters, response schema, pagination, and errors. In Test, null means
5635    /// unavailable, not zero.
5636    ///
5637    /// `GET /v1/twitter/search/media`
5638    pub async fn list(
5639        &self,
5640        options: TwitterSearchMediaOptions,
5641    ) -> Result<TwitterSearchMediaPage, Error> {
5642        self.scope
5643            .operation(
5644                Method::GET,
5645                "/v1/twitter/search/media",
5646                options.query(),
5647                options.request_options,
5648            )?
5649            .send_page()
5650            .await
5651    }
5652
5653    /// Iterates lazily over every item of [`list`](Self::list), one page per request.
5654    pub fn items(&self, options: TwitterSearchMediaOptions) -> Items<TwitterPost> {
5655        Items::new(self.scope.operation(
5656            Method::GET,
5657            "/v1/twitter/search/media",
5658            options.query(),
5659            options.request_options,
5660        ))
5661    }
5662}
5663
5664/// The `twitter.search.posts` resources.
5665///
5666/// Selecting a resource never sends a request. Only its terminal operations do.
5667#[derive(Clone, Debug)]
5668pub struct TwitterSearchPostsResource {
5669    scope: Scope,
5670}
5671
5672impl TwitterSearchPostsResource {
5673    /// Search Twitter posts.
5674    ///
5675    /// Search public Twitter posts with cursor pagination. Test and Live use the same
5676    /// route, parameters, response schema, pagination, and errors. In Test, null means
5677    /// unavailable, not zero.
5678    ///
5679    /// `GET /v1/twitter/search/posts`
5680    pub async fn list(
5681        &self,
5682        options: TwitterSearchPostsOptions,
5683    ) -> Result<TwitterSearchPostsPage, Error> {
5684        self.scope
5685            .operation(
5686                Method::GET,
5687                "/v1/twitter/search/posts",
5688                options.query(),
5689                options.request_options,
5690            )?
5691            .send_page()
5692            .await
5693    }
5694
5695    /// Iterates lazily over every item of [`list`](Self::list), one page per request.
5696    pub fn items(&self, options: TwitterSearchPostsOptions) -> Items<TwitterPost> {
5697        Items::new(self.scope.operation(
5698            Method::GET,
5699            "/v1/twitter/search/posts",
5700            options.query(),
5701            options.request_options,
5702        ))
5703    }
5704}
5705
5706/// The `twitter.search.suggestions` resources.
5707///
5708/// Selecting a resource never sends a request. Only its terminal operations do.
5709#[derive(Clone, Debug)]
5710pub struct TwitterSearchSuggestionsResource {
5711    scope: Scope,
5712}
5713
5714impl TwitterSearchSuggestionsResource {
5715    /// Search suggestions.
5716    ///
5717    /// Search suggestions from public Twitter data. Test and Live use the same route,
5718    /// parameters, response schema, pagination, and errors. In Test, null means
5719    /// unavailable, not zero.
5720    ///
5721    /// `GET /v1/twitter/search/suggestions`
5722    pub async fn list(
5723        &self,
5724        options: TwitterSearchSuggestionsOptions,
5725    ) -> Result<TwitterSearchSuggestionsPage, Error> {
5726        self.scope
5727            .operation(
5728                Method::GET,
5729                "/v1/twitter/search/suggestions",
5730                options.query(),
5731                options.request_options,
5732            )?
5733            .send_page()
5734            .await
5735    }
5736
5737    /// Iterates lazily over every item of [`list`](Self::list), one page per request.
5738    pub fn items(&self, options: TwitterSearchSuggestionsOptions) -> Items<TwitterProfile> {
5739        Items::new(self.scope.operation(
5740            Method::GET,
5741            "/v1/twitter/search/suggestions",
5742            options.query(),
5743            options.request_options,
5744        ))
5745    }
5746}
5747
5748/// The `twitter.search.users` resources.
5749///
5750/// Selecting a resource never sends a request. Only its terminal operations do.
5751#[derive(Clone, Debug)]
5752pub struct TwitterSearchUsersResource {
5753    scope: Scope,
5754}
5755
5756impl TwitterSearchUsersResource {
5757    /// Search Twitter users.
5758    ///
5759    /// Search public Twitter users with cursor pagination. Test and Live use the same
5760    /// route, parameters, response schema, pagination, and errors. In Test, null means
5761    /// unavailable, not zero.
5762    ///
5763    /// `GET /v1/twitter/search/users`
5764    pub async fn list(
5765        &self,
5766        options: TwitterSearchUsersOptions,
5767    ) -> Result<TwitterSearchUsersPage, Error> {
5768        self.scope
5769            .operation(
5770                Method::GET,
5771                "/v1/twitter/search/users",
5772                options.query(),
5773                options.request_options,
5774            )?
5775            .send_page()
5776            .await
5777    }
5778
5779    /// Iterates lazily over every item of [`list`](Self::list), one page per request.
5780    pub fn items(&self, options: TwitterSearchUsersOptions) -> Items<TwitterProfile> {
5781        Items::new(self.scope.operation(
5782            Method::GET,
5783            "/v1/twitter/search/users",
5784            options.query(),
5785            options.request_options,
5786        ))
5787    }
5788}
5789
5790/// The `youtube` resources.
5791///
5792/// Selecting a resource never sends a request. Only its terminal operations do.
5793#[derive(Clone, Debug)]
5794pub struct YouTubeResource {
5795    scope: Scope,
5796}
5797
5798impl YouTubeResource {
5799    /// Selects the charts resources. This never sends a request.
5800    pub fn charts(&self) -> YouTubeChartsResource {
5801        YouTubeChartsResource {
5802            scope: self.scope.clone(),
5803        }
5804    }
5805
5806    /// Selects one community post. This never sends a request.
5807    ///
5808    /// A raw string is the native ID or shorthand unless it is a supported social
5809    /// URL. Pass [`Id`](crate::Id) or [`Url`](crate::Url) to state the meaning.
5810    /// An invalid reference fails the first operation, before any request.
5811    pub fn community_post(
5812        &self,
5813        reference: impl Into<ResourceReference>,
5814    ) -> YouTubeCommunityPostResource {
5815        YouTubeCommunityPostResource {
5816            scope: self.scope.select(
5817                "identifier",
5818                "youtube",
5819                "communityPost",
5820                Reference::from(reference.into()),
5821            ),
5822        }
5823    }
5824
5825    /// Selects one hashtag. This never sends a request.
5826    ///
5827    /// A raw string is the native ID or shorthand unless it is a supported social
5828    /// URL. Pass [`Id`](crate::Id) or [`Url`](crate::Url) to state the meaning.
5829    /// An invalid reference fails the first operation, before any request.
5830    pub fn hashtag(&self, reference: impl Into<ResourceReference>) -> YouTubeHashtagResource {
5831        YouTubeHashtagResource {
5832            scope: self.scope.select(
5833                "identifier",
5834                "youtube",
5835                "hashtag",
5836                Reference::from(reference.into()),
5837            ),
5838        }
5839    }
5840
5841    /// Selects one playlist. This never sends a request.
5842    ///
5843    /// A raw string is the native ID or shorthand unless it is a supported social
5844    /// URL. Pass [`Id`](crate::Id) or [`Url`](crate::Url) to state the meaning.
5845    /// An invalid reference fails the first operation, before any request.
5846    pub fn playlist(&self, reference: impl Into<ResourceReference>) -> YouTubePlaylistResource {
5847        YouTubePlaylistResource {
5848            scope: self.scope.select(
5849                "identifier",
5850                "youtube",
5851                "playlist",
5852                Reference::from(reference.into()),
5853            ),
5854        }
5855    }
5856
5857    /// Selects one post. This never sends a request.
5858    ///
5859    /// A raw string is the native ID or shorthand unless it is a supported social
5860    /// URL. Pass [`Id`](crate::Id) or [`Url`](crate::Url) to state the meaning.
5861    /// An invalid reference fails the first operation, before any request.
5862    pub fn post(&self, reference: impl Into<ResourceReference>) -> YouTubePostResource {
5863        YouTubePostResource {
5864            scope: self.scope.select(
5865                "identifier",
5866                "youtube",
5867                "post",
5868                Reference::from(reference.into()),
5869            ),
5870        }
5871    }
5872
5873    /// Selects one profile. This never sends a request.
5874    ///
5875    /// A raw string is a username unless it is a supported social URL. Pass
5876    /// [`Username`](crate::Username), [`Id`](crate::Id), or [`Url`](crate::Url) to state the meaning.
5877    /// An invalid reference fails the first operation, before any request.
5878    pub fn profile(&self, reference: impl Into<ProfileReference>) -> YouTubeProfileResource {
5879        YouTubeProfileResource {
5880            scope: self.scope.select(
5881                "identifier",
5882                "youtube",
5883                "profile",
5884                Reference::from(reference.into()),
5885            ),
5886        }
5887    }
5888
5889    /// Selects the search resources. This never sends a request.
5890    pub fn search(&self) -> YouTubeSearchResource {
5891        YouTubeSearchResource {
5892            scope: self.scope.clone(),
5893        }
5894    }
5895
5896    /// Selects the trending resources. This never sends a request.
5897    pub fn trending(&self) -> YouTubeTrendingResource {
5898        YouTubeTrendingResource {
5899            scope: self.scope.clone(),
5900        }
5901    }
5902}
5903
5904/// The `youtube.charts` resources.
5905///
5906/// Selecting a resource never sends a request. Only its terminal operations do.
5907#[derive(Clone, Debug)]
5908pub struct YouTubeChartsResource {
5909    scope: Scope,
5910}
5911
5912impl YouTubeChartsResource {
5913    /// Selects the artists resources. This never sends a request.
5914    pub fn artists(&self) -> YouTubeChartsArtistsResource {
5915        YouTubeChartsArtistsResource {
5916            scope: self.scope.clone(),
5917        }
5918    }
5919
5920    /// Selects the tracks resources. This never sends a request.
5921    pub fn tracks(&self) -> YouTubeChartsTracksResource {
5922        YouTubeChartsTracksResource {
5923            scope: self.scope.clone(),
5924        }
5925    }
5926
5927    /// Selects the videos resources. This never sends a request.
5928    pub fn videos(&self) -> YouTubeChartsVideosResource {
5929        YouTubeChartsVideosResource {
5930            scope: self.scope.clone(),
5931        }
5932    }
5933}
5934
5935/// The `youtube.charts.artists` resources.
5936///
5937/// Selecting a resource never sends a request. Only its terminal operations do.
5938#[derive(Clone, Debug)]
5939pub struct YouTubeChartsArtistsResource {
5940    scope: Scope,
5941}
5942
5943impl YouTubeChartsArtistsResource {
5944    /// List top artists.
5945    ///
5946    /// Return the weekly top artists chart of one country. Test and Live use the same
5947    /// route, parameters, response schema, pagination, and errors. In Test, null means
5948    /// unavailable, not zero.
5949    ///
5950    /// `GET /v1/youtube/charts/artists`
5951    pub async fn list(
5952        &self,
5953        options: impl Into<Option<YouTubeChartsArtistsOptions>>,
5954    ) -> Result<YouTubeChartsArtistsResponse, Error> {
5955        let options = options.into().unwrap_or_default();
5956        self.scope
5957            .operation(
5958                Method::GET,
5959                "/v1/youtube/charts/artists",
5960                options.query(),
5961                options.request_options,
5962            )?
5963            .send()
5964            .await
5965    }
5966}
5967
5968/// The `youtube.charts.tracks` resources.
5969///
5970/// Selecting a resource never sends a request. Only its terminal operations do.
5971#[derive(Clone, Debug)]
5972pub struct YouTubeChartsTracksResource {
5973    scope: Scope,
5974}
5975
5976impl YouTubeChartsTracksResource {
5977    /// List top songs.
5978    ///
5979    /// Return the weekly top songs chart of one country. Test and Live use the same
5980    /// route, parameters, response schema, pagination, and errors. In Test, null means
5981    /// unavailable, not zero.
5982    ///
5983    /// `GET /v1/youtube/charts/tracks`
5984    pub async fn list(
5985        &self,
5986        options: impl Into<Option<YouTubeChartsTracksOptions>>,
5987    ) -> Result<YouTubeChartsTracksResponse, Error> {
5988        let options = options.into().unwrap_or_default();
5989        self.scope
5990            .operation(
5991                Method::GET,
5992                "/v1/youtube/charts/tracks",
5993                options.query(),
5994                options.request_options,
5995            )?
5996            .send()
5997            .await
5998    }
5999}
6000
6001/// The `youtube.charts.videos` resources.
6002///
6003/// Selecting a resource never sends a request. Only its terminal operations do.
6004#[derive(Clone, Debug)]
6005pub struct YouTubeChartsVideosResource {
6006    scope: Scope,
6007}
6008
6009impl YouTubeChartsVideosResource {
6010    /// List top music videos.
6011    ///
6012    /// Return the weekly top music videos chart of one country. Test and Live use the
6013    /// same route, parameters, response schema, pagination, and errors. In Test, null
6014    /// means unavailable, not zero.
6015    ///
6016    /// `GET /v1/youtube/charts/videos`
6017    pub async fn list(
6018        &self,
6019        options: impl Into<Option<YouTubeChartsVideosOptions>>,
6020    ) -> Result<YouTubeChartsVideosResponse, Error> {
6021        let options = options.into().unwrap_or_default();
6022        self.scope
6023            .operation(
6024                Method::GET,
6025                "/v1/youtube/charts/videos",
6026                options.query(),
6027                options.request_options,
6028            )?
6029            .send()
6030            .await
6031    }
6032}
6033
6034/// One selected community post on YouTube.
6035///
6036/// Selecting a resource never sends a request. Only its terminal operations do.
6037#[derive(Clone, Debug)]
6038pub struct YouTubeCommunityPostResource {
6039    scope: Scope,
6040}
6041
6042impl YouTubeCommunityPostResource {
6043    /// Selects the comments resources. This never sends a request.
6044    pub fn comments(&self) -> YouTubeCommunityPostCommentsResource {
6045        YouTubeCommunityPostCommentsResource {
6046            scope: self.scope.clone(),
6047        }
6048    }
6049
6050    /// Get a community post.
6051    ///
6052    /// Return one public YouTube community post. Test and Live use the same route,
6053    /// parameters, response schema, pagination, and errors. In Test, null means
6054    /// unavailable, not zero.
6055    ///
6056    /// `GET /v1/youtube/community-posts/{identifier}`
6057    pub async fn get(
6058        &self,
6059        options: impl Into<Option<YouTubeCommunityPostOptions>>,
6060    ) -> Result<YouTubeCommunityPostResponse, Error> {
6061        let options = options.into().unwrap_or_default();
6062        self.scope
6063            .operation(
6064                Method::GET,
6065                "/v1/youtube/community-posts/{identifier}",
6066                options.query(),
6067                options.request_options,
6068            )?
6069            .send()
6070            .await
6071    }
6072}
6073
6074/// The `youtube.communityPost.comments` resources.
6075///
6076/// Selecting a resource never sends a request. Only its terminal operations do.
6077#[derive(Clone, Debug)]
6078pub struct YouTubeCommunityPostCommentsResource {
6079    scope: Scope,
6080}
6081
6082impl YouTubeCommunityPostCommentsResource {
6083    /// List community post comments.
6084    ///
6085    /// Return the comments of a public YouTube community post. Test and Live use the
6086    /// same route, parameters, response schema, pagination, and errors. In Test, null
6087    /// means unavailable, not zero.
6088    ///
6089    /// `GET /v1/youtube/community-posts/{identifier}/comments`
6090    pub async fn list(
6091        &self,
6092        options: impl Into<Option<YouTubeCommunityPostCommentsOptions>>,
6093    ) -> Result<YouTubeCommunityPostCommentsPage, Error> {
6094        let options = options.into().unwrap_or_default();
6095        self.scope
6096            .operation(
6097                Method::GET,
6098                "/v1/youtube/community-posts/{identifier}/comments",
6099                options.query(),
6100                options.request_options,
6101            )?
6102            .send_page()
6103            .await
6104    }
6105
6106    /// Iterates lazily over every item of [`list`](Self::list), one page per request.
6107    pub fn items(
6108        &self,
6109        options: impl Into<Option<YouTubeCommunityPostCommentsOptions>>,
6110    ) -> Items<YouTubeComment> {
6111        let options = options.into().unwrap_or_default();
6112        Items::new(self.scope.operation(
6113            Method::GET,
6114            "/v1/youtube/community-posts/{identifier}/comments",
6115            options.query(),
6116            options.request_options,
6117        ))
6118    }
6119}
6120
6121/// One selected hashtag on YouTube.
6122///
6123/// Selecting a resource never sends a request. Only its terminal operations do.
6124#[derive(Clone, Debug)]
6125pub struct YouTubeHashtagResource {
6126    scope: Scope,
6127}
6128
6129impl YouTubeHashtagResource {
6130    /// Selects the posts resources. This never sends a request.
6131    pub fn posts(&self) -> YouTubeHashtagPostsResource {
6132        YouTubeHashtagPostsResource {
6133            scope: self.scope.clone(),
6134        }
6135    }
6136}
6137
6138/// The `youtube.hashtag.posts` resources.
6139///
6140/// Selecting a resource never sends a request. Only its terminal operations do.
6141#[derive(Clone, Debug)]
6142pub struct YouTubeHashtagPostsResource {
6143    scope: Scope,
6144}
6145
6146impl YouTubeHashtagPostsResource {
6147    /// List hashtag posts.
6148    ///
6149    /// Return the public YouTube videos and Shorts of one hashtag. Test and Live use
6150    /// the same route, parameters, response schema, pagination, and errors. In Test,
6151    /// null means unavailable, not zero.
6152    ///
6153    /// `GET /v1/youtube/hashtags/{identifier}/posts`
6154    pub async fn list(
6155        &self,
6156        options: impl Into<Option<YouTubeHashtagPostsOptions>>,
6157    ) -> Result<YouTubeHashtagPostsPage, Error> {
6158        let options = options.into().unwrap_or_default();
6159        self.scope
6160            .operation(
6161                Method::GET,
6162                "/v1/youtube/hashtags/{identifier}/posts",
6163                options.query(),
6164                options.request_options,
6165            )?
6166            .send_page()
6167            .await
6168    }
6169
6170    /// Iterates lazily over every item of [`list`](Self::list), one page per request.
6171    pub fn items(
6172        &self,
6173        options: impl Into<Option<YouTubeHashtagPostsOptions>>,
6174    ) -> Items<YouTubePost> {
6175        let options = options.into().unwrap_or_default();
6176        Items::new(self.scope.operation(
6177            Method::GET,
6178            "/v1/youtube/hashtags/{identifier}/posts",
6179            options.query(),
6180            options.request_options,
6181        ))
6182    }
6183}
6184
6185/// One selected playlist on YouTube.
6186///
6187/// Selecting a resource never sends a request. Only its terminal operations do.
6188#[derive(Clone, Debug)]
6189pub struct YouTubePlaylistResource {
6190    scope: Scope,
6191}
6192
6193impl YouTubePlaylistResource {
6194    /// Selects the posts resources. This never sends a request.
6195    pub fn posts(&self) -> YouTubePlaylistPostsResource {
6196        YouTubePlaylistPostsResource {
6197            scope: self.scope.clone(),
6198        }
6199    }
6200}
6201
6202/// The `youtube.playlist.posts` resources.
6203///
6204/// Selecting a resource never sends a request. Only its terminal operations do.
6205#[derive(Clone, Debug)]
6206pub struct YouTubePlaylistPostsResource {
6207    scope: Scope,
6208}
6209
6210impl YouTubePlaylistPostsResource {
6211    /// List playlist posts.
6212    ///
6213    /// Return the videos of a public YouTube playlist. Test and Live use the same
6214    /// route, parameters, response schema, pagination, and errors. In Test, null means
6215    /// unavailable, not zero.
6216    ///
6217    /// `GET /v1/youtube/playlists/{identifier}/posts`
6218    pub async fn list(
6219        &self,
6220        options: impl Into<Option<YouTubePlaylistPostsOptions>>,
6221    ) -> Result<YouTubePlaylistPostsPage, Error> {
6222        let options = options.into().unwrap_or_default();
6223        self.scope
6224            .operation(
6225                Method::GET,
6226                "/v1/youtube/playlists/{identifier}/posts",
6227                options.query(),
6228                options.request_options,
6229            )?
6230            .send_page()
6231            .await
6232    }
6233
6234    /// Iterates lazily over every item of [`list`](Self::list), one page per request.
6235    pub fn items(
6236        &self,
6237        options: impl Into<Option<YouTubePlaylistPostsOptions>>,
6238    ) -> Items<YouTubePost> {
6239        let options = options.into().unwrap_or_default();
6240        Items::new(self.scope.operation(
6241            Method::GET,
6242            "/v1/youtube/playlists/{identifier}/posts",
6243            options.query(),
6244            options.request_options,
6245        ))
6246    }
6247}
6248
6249/// One selected post on YouTube.
6250///
6251/// Selecting a resource never sends a request. Only its terminal operations do.
6252#[derive(Clone, Debug)]
6253pub struct YouTubePostResource {
6254    scope: Scope,
6255}
6256
6257impl YouTubePostResource {
6258    /// Selects one comment. This never sends a request.
6259    ///
6260    /// A raw string is the native ID or shorthand unless it is a supported social
6261    /// URL. Pass [`Id`](crate::Id) or [`Url`](crate::Url) to state the meaning.
6262    /// An invalid reference fails the first operation, before any request.
6263    pub fn comment(&self, reference: impl Into<ResourceReference>) -> YouTubePostCommentResource {
6264        YouTubePostCommentResource {
6265            scope: self.scope.select(
6266                "comment_id",
6267                "youtube",
6268                "comment",
6269                Reference::from(reference.into()),
6270            ),
6271        }
6272    }
6273
6274    /// Selects the comments resources. This never sends a request.
6275    pub fn comments(&self) -> YouTubePostCommentsResource {
6276        YouTubePostCommentsResource {
6277            scope: self.scope.clone(),
6278        }
6279    }
6280
6281    /// Selects the files resources. This never sends a request.
6282    pub fn files(&self) -> YouTubePostFilesResource {
6283        YouTubePostFilesResource {
6284            scope: self.scope.clone(),
6285        }
6286    }
6287
6288    /// Selects the frame resources. This never sends a request.
6289    pub fn frame(&self) -> YouTubePostFrameResource {
6290        YouTubePostFrameResource {
6291            scope: self.scope.clone(),
6292        }
6293    }
6294
6295    /// Selects the related resources. This never sends a request.
6296    pub fn related(&self) -> YouTubePostRelatedResource {
6297        YouTubePostRelatedResource {
6298            scope: self.scope.clone(),
6299        }
6300    }
6301
6302    /// Selects the sound posts resources. This never sends a request.
6303    pub fn sound_posts(&self) -> YouTubePostSoundPostsResource {
6304        YouTubePostSoundPostsResource {
6305            scope: self.scope.clone(),
6306        }
6307    }
6308
6309    /// Selects the storyboard resources. This never sends a request.
6310    pub fn storyboard(&self) -> YouTubePostStoryboardResource {
6311        YouTubePostStoryboardResource {
6312            scope: self.scope.clone(),
6313        }
6314    }
6315
6316    /// Selects the transcript resources. This never sends a request.
6317    pub fn transcript(&self) -> YouTubePostTranscriptResource {
6318        YouTubePostTranscriptResource {
6319            scope: self.scope.clone(),
6320        }
6321    }
6322
6323    /// Get a post.
6324    ///
6325    /// Return one public YouTube video, Short, or livestream with its exact counts and
6326    /// publication time. Test and Live use the same route, parameters, response schema,
6327    /// pagination, and errors. In Test, null means unavailable, not zero.
6328    ///
6329    /// `GET /v1/youtube/posts/{identifier}`
6330    pub async fn get(
6331        &self,
6332        options: impl Into<Option<YouTubePostOptions>>,
6333    ) -> Result<YouTubePostResponse, Error> {
6334        let options = options.into().unwrap_or_default();
6335        self.scope
6336            .operation(
6337                Method::GET,
6338                "/v1/youtube/posts/{identifier}",
6339                options.query(),
6340                options.request_options,
6341            )?
6342            .send()
6343            .await
6344    }
6345}
6346
6347/// One selected comment on YouTube.
6348///
6349/// Selecting a resource never sends a request. Only its terminal operations do.
6350#[derive(Clone, Debug)]
6351pub struct YouTubePostCommentResource {
6352    scope: Scope,
6353}
6354
6355impl YouTubePostCommentResource {
6356    /// Selects the replies resources. This never sends a request.
6357    pub fn replies(&self) -> YouTubePostCommentRepliesResource {
6358        YouTubePostCommentRepliesResource {
6359            scope: self.scope.clone(),
6360        }
6361    }
6362}
6363
6364/// The `youtube.post.comment.replies` resources.
6365///
6366/// Selecting a resource never sends a request. Only its terminal operations do.
6367#[derive(Clone, Debug)]
6368pub struct YouTubePostCommentRepliesResource {
6369    scope: Scope,
6370}
6371
6372impl YouTubePostCommentRepliesResource {
6373    /// List comment replies.
6374    ///
6375    /// Return the replies of one YouTube comment. Pass the repliesToken that comment
6376    /// carried. Test and Live use the same route, parameters, response schema,
6377    /// pagination, and errors. In Test, null means unavailable, not zero.
6378    ///
6379    /// `GET /v1/youtube/posts/{identifier}/comments/{comment_id}/replies`
6380    pub async fn list(
6381        &self,
6382        options: YouTubePostCommentRepliesOptions,
6383    ) -> Result<YouTubePostCommentRepliesPage, Error> {
6384        self.scope
6385            .operation(
6386                Method::GET,
6387                "/v1/youtube/posts/{identifier}/comments/{comment_id}/replies",
6388                options.query(),
6389                options.request_options,
6390            )?
6391            .send_page()
6392            .await
6393    }
6394
6395    /// Iterates lazily over every item of [`list`](Self::list), one page per request.
6396    pub fn items(&self, options: YouTubePostCommentRepliesOptions) -> Items<YouTubeComment> {
6397        Items::new(self.scope.operation(
6398            Method::GET,
6399            "/v1/youtube/posts/{identifier}/comments/{comment_id}/replies",
6400            options.query(),
6401            options.request_options,
6402        ))
6403    }
6404}
6405
6406/// The `youtube.post.comments` resources.
6407///
6408/// Selecting a resource never sends a request. Only its terminal operations do.
6409#[derive(Clone, Debug)]
6410pub struct YouTubePostCommentsResource {
6411    scope: Scope,
6412}
6413
6414impl YouTubePostCommentsResource {
6415    /// List post comments.
6416    ///
6417    /// Return the top-level comments of a public YouTube video or Short. Test and Live
6418    /// use the same route, parameters, response schema, pagination, and errors. In
6419    /// Test, null means unavailable, not zero.
6420    ///
6421    /// `GET /v1/youtube/posts/{identifier}/comments`
6422    pub async fn list(
6423        &self,
6424        options: impl Into<Option<YouTubePostCommentsOptions>>,
6425    ) -> Result<YouTubePostCommentsPage, Error> {
6426        let options = options.into().unwrap_or_default();
6427        self.scope
6428            .operation(
6429                Method::GET,
6430                "/v1/youtube/posts/{identifier}/comments",
6431                options.query(),
6432                options.request_options,
6433            )?
6434            .send_page()
6435            .await
6436    }
6437
6438    /// Iterates lazily over every item of [`list`](Self::list), one page per request.
6439    pub fn items(
6440        &self,
6441        options: impl Into<Option<YouTubePostCommentsOptions>>,
6442    ) -> Items<YouTubeComment> {
6443        let options = options.into().unwrap_or_default();
6444        Items::new(self.scope.operation(
6445            Method::GET,
6446            "/v1/youtube/posts/{identifier}/comments",
6447            options.query(),
6448            options.request_options,
6449        ))
6450    }
6451}
6452
6453/// The `youtube.post.files` resources.
6454///
6455/// Selecting a resource never sends a request. Only its terminal operations do.
6456#[derive(Clone, Debug)]
6457pub struct YouTubePostFilesResource {
6458    scope: Scope,
6459}
6460
6461impl YouTubePostFilesResource {
6462    /// Get post files.
6463    ///
6464    /// Return the video and audio streams of a public YouTube video as download links.
6465    /// Openhandle refreshes the links, so they keep working. Test and Live use the same
6466    /// route, parameters, response schema, pagination, and errors. In Test, null means
6467    /// unavailable, not zero.
6468    ///
6469    /// `GET /v1/youtube/posts/{identifier}/files`
6470    pub async fn get(
6471        &self,
6472        options: impl Into<Option<YouTubePostFilesOptions>>,
6473    ) -> Result<YouTubePostFilesResponse, Error> {
6474        let options = options.into().unwrap_or_default();
6475        self.scope
6476            .operation(
6477                Method::GET,
6478                "/v1/youtube/posts/{identifier}/files",
6479                options.query(),
6480                options.request_options,
6481            )?
6482            .send()
6483            .await
6484    }
6485}
6486
6487/// The `youtube.post.frame` resources.
6488///
6489/// Selecting a resource never sends a request. Only its terminal operations do.
6490#[derive(Clone, Debug)]
6491pub struct YouTubePostFrameResource {
6492    scope: Scope,
6493}
6494
6495impl YouTubePostFrameResource {
6496    /// Get post frame.
6497    ///
6498    /// Return one still frame of a public video at a time in seconds, in every
6499    /// resolution the video has. Test and Live use the same route, parameters, response
6500    /// schema, pagination, and errors. In Test, null means unavailable, not zero.
6501    ///
6502    /// `GET /v1/youtube/posts/{identifier}/frame`
6503    pub async fn get(
6504        &self,
6505        options: YouTubePostFrameOptions,
6506    ) -> Result<YouTubePostFrameResponse, Error> {
6507        self.scope
6508            .operation(
6509                Method::GET,
6510                "/v1/youtube/posts/{identifier}/frame",
6511                options.query(),
6512                options.request_options,
6513            )?
6514            .send()
6515            .await
6516    }
6517}
6518
6519/// The `youtube.post.related` resources.
6520///
6521/// Selecting a resource never sends a request. Only its terminal operations do.
6522#[derive(Clone, Debug)]
6523pub struct YouTubePostRelatedResource {
6524    scope: Scope,
6525}
6526
6527impl YouTubePostRelatedResource {
6528    /// List related posts.
6529    ///
6530    /// Return the videos YouTube suggests next to a public video. Test and Live use the
6531    /// same route, parameters, response schema, pagination, and errors. In Test, null
6532    /// means unavailable, not zero.
6533    ///
6534    /// `GET /v1/youtube/posts/{identifier}/related`
6535    pub async fn list(
6536        &self,
6537        options: impl Into<Option<YouTubePostRelatedOptions>>,
6538    ) -> Result<YouTubePostRelatedPage, Error> {
6539        let options = options.into().unwrap_or_default();
6540        self.scope
6541            .operation(
6542                Method::GET,
6543                "/v1/youtube/posts/{identifier}/related",
6544                options.query(),
6545                options.request_options,
6546            )?
6547            .send_page()
6548            .await
6549    }
6550
6551    /// Iterates lazily over every item of [`list`](Self::list), one page per request.
6552    pub fn items(
6553        &self,
6554        options: impl Into<Option<YouTubePostRelatedOptions>>,
6555    ) -> Items<YouTubePost> {
6556        let options = options.into().unwrap_or_default();
6557        Items::new(self.scope.operation(
6558            Method::GET,
6559            "/v1/youtube/posts/{identifier}/related",
6560            options.query(),
6561            options.request_options,
6562        ))
6563    }
6564}
6565
6566/// The `youtube.post.soundPosts` resources.
6567///
6568/// Selecting a resource never sends a request. Only its terminal operations do.
6569#[derive(Clone, Debug)]
6570pub struct YouTubePostSoundPostsResource {
6571    scope: Scope,
6572}
6573
6574impl YouTubePostSoundPostsResource {
6575    /// List posts using the same sound.
6576    ///
6577    /// Return the Shorts that use the sound of a public Short. Test and Live use the
6578    /// same route, parameters, response schema, pagination, and errors. In Test, null
6579    /// means unavailable, not zero.
6580    ///
6581    /// `GET /v1/youtube/posts/{identifier}/sound-posts`
6582    pub async fn list(
6583        &self,
6584        options: impl Into<Option<YouTubePostSoundPostsOptions>>,
6585    ) -> Result<YouTubePostSoundPostsPage, Error> {
6586        let options = options.into().unwrap_or_default();
6587        self.scope
6588            .operation(
6589                Method::GET,
6590                "/v1/youtube/posts/{identifier}/sound-posts",
6591                options.query(),
6592                options.request_options,
6593            )?
6594            .send_page()
6595            .await
6596    }
6597
6598    /// Iterates lazily over every item of [`list`](Self::list), one page per request.
6599    pub fn items(
6600        &self,
6601        options: impl Into<Option<YouTubePostSoundPostsOptions>>,
6602    ) -> Items<YouTubePost> {
6603        let options = options.into().unwrap_or_default();
6604        Items::new(self.scope.operation(
6605            Method::GET,
6606            "/v1/youtube/posts/{identifier}/sound-posts",
6607            options.query(),
6608            options.request_options,
6609        ))
6610    }
6611}
6612
6613/// The `youtube.post.storyboard` resources.
6614///
6615/// Selecting a resource never sends a request. Only its terminal operations do.
6616#[derive(Clone, Debug)]
6617pub struct YouTubePostStoryboardResource {
6618    scope: Scope,
6619}
6620
6621impl YouTubePostStoryboardResource {
6622    /// Get post storyboard.
6623    ///
6624    /// Return YouTube's preview frames of a public video: one small frame every few
6625    /// seconds, packed into image sheets, with the position of every frame. Test and
6626    /// Live use the same route, parameters, response schema, pagination, and errors. In
6627    /// Test, null means unavailable, not zero.
6628    ///
6629    /// `GET /v1/youtube/posts/{identifier}/storyboard`
6630    pub async fn get(
6631        &self,
6632        options: impl Into<Option<YouTubePostStoryboardOptions>>,
6633    ) -> Result<YouTubePostStoryboardResponse, Error> {
6634        let options = options.into().unwrap_or_default();
6635        self.scope
6636            .operation(
6637                Method::GET,
6638                "/v1/youtube/posts/{identifier}/storyboard",
6639                options.query(),
6640                options.request_options,
6641            )?
6642            .send()
6643            .await
6644    }
6645}
6646
6647/// The `youtube.post.transcript` resources.
6648///
6649/// Selecting a resource never sends a request. Only its terminal operations do.
6650#[derive(Clone, Debug)]
6651pub struct YouTubePostTranscriptResource {
6652    scope: Scope,
6653}
6654
6655impl YouTubePostTranscriptResource {
6656    /// Get a transcript.
6657    ///
6658    /// Return the timed caption text of a public YouTube video in one of its caption
6659    /// languages. Test and Live use the same route, parameters, response schema,
6660    /// pagination, and errors. In Test, null means unavailable, not zero.
6661    ///
6662    /// `GET /v1/youtube/posts/{identifier}/transcript`
6663    pub async fn get(
6664        &self,
6665        options: impl Into<Option<YouTubePostTranscriptOptions>>,
6666    ) -> Result<YouTubePostTranscriptResponse, Error> {
6667        let options = options.into().unwrap_or_default();
6668        self.scope
6669            .operation(
6670                Method::GET,
6671                "/v1/youtube/posts/{identifier}/transcript",
6672                options.query(),
6673                options.request_options,
6674            )?
6675            .send()
6676            .await
6677    }
6678}
6679
6680/// One selected profile on YouTube.
6681///
6682/// Selecting a resource never sends a request. Only its terminal operations do.
6683#[derive(Clone, Debug)]
6684pub struct YouTubeProfileResource {
6685    scope: Scope,
6686}
6687
6688impl YouTubeProfileResource {
6689    /// Selects the community posts resources. This never sends a request.
6690    pub fn community_posts(&self) -> YouTubeProfileCommunityPostsResource {
6691        YouTubeProfileCommunityPostsResource {
6692            scope: self.scope.clone(),
6693        }
6694    }
6695
6696    /// Selects the livestreams resources. This never sends a request.
6697    pub fn livestreams(&self) -> YouTubeProfileLivestreamsResource {
6698        YouTubeProfileLivestreamsResource {
6699            scope: self.scope.clone(),
6700        }
6701    }
6702
6703    /// Selects the playlists resources. This never sends a request.
6704    pub fn playlists(&self) -> YouTubeProfilePlaylistsResource {
6705        YouTubeProfilePlaylistsResource {
6706            scope: self.scope.clone(),
6707        }
6708    }
6709
6710    /// Selects the products resources. This never sends a request.
6711    pub fn products(&self) -> YouTubeProfileProductsResource {
6712        YouTubeProfileProductsResource {
6713            scope: self.scope.clone(),
6714        }
6715    }
6716
6717    /// Selects the search resources. This never sends a request.
6718    pub fn search(&self) -> YouTubeProfileSearchResource {
6719        YouTubeProfileSearchResource {
6720            scope: self.scope.clone(),
6721        }
6722    }
6723
6724    /// Selects the shorts resources. This never sends a request.
6725    pub fn shorts(&self) -> YouTubeProfileShortsResource {
6726        YouTubeProfileShortsResource {
6727            scope: self.scope.clone(),
6728        }
6729    }
6730
6731    /// Selects the videos resources. This never sends a request.
6732    pub fn videos(&self) -> YouTubeProfileVideosResource {
6733        YouTubeProfileVideosResource {
6734            scope: self.scope.clone(),
6735        }
6736    }
6737
6738    /// Get a profile.
6739    ///
6740    /// Return one public YouTube channel. Use @handle or the UC channel ID. Test and
6741    /// Live use the same route, parameters, response schema, pagination, and errors. In
6742    /// Test, null means unavailable, not zero.
6743    ///
6744    /// `GET /v1/youtube/profiles/{identifier}`
6745    pub async fn get(
6746        &self,
6747        options: impl Into<Option<YouTubeProfileOptions>>,
6748    ) -> Result<YouTubeProfileResponse, Error> {
6749        let options = options.into().unwrap_or_default();
6750        self.scope
6751            .operation(
6752                Method::GET,
6753                "/v1/youtube/profiles/{identifier}",
6754                options.query(),
6755                options.request_options,
6756            )?
6757            .send()
6758            .await
6759    }
6760}
6761
6762/// The `youtube.profile.communityPosts` resources.
6763///
6764/// Selecting a resource never sends a request. Only its terminal operations do.
6765#[derive(Clone, Debug)]
6766pub struct YouTubeProfileCommunityPostsResource {
6767    scope: Scope,
6768}
6769
6770impl YouTubeProfileCommunityPostsResource {
6771    /// List profile community posts.
6772    ///
6773    /// Return the text, image, and poll posts of a public YouTube channel. Test and
6774    /// Live use the same route, parameters, response schema, pagination, and errors. In
6775    /// Test, null means unavailable, not zero.
6776    ///
6777    /// `GET /v1/youtube/profiles/{identifier}/community-posts`
6778    pub async fn list(
6779        &self,
6780        options: impl Into<Option<YouTubeProfileCommunityPostsOptions>>,
6781    ) -> Result<YouTubeProfileCommunityPostsPage, Error> {
6782        let options = options.into().unwrap_or_default();
6783        self.scope
6784            .operation(
6785                Method::GET,
6786                "/v1/youtube/profiles/{identifier}/community-posts",
6787                options.query(),
6788                options.request_options,
6789            )?
6790            .send_page()
6791            .await
6792    }
6793
6794    /// Iterates lazily over every item of [`list`](Self::list), one page per request.
6795    pub fn items(
6796        &self,
6797        options: impl Into<Option<YouTubeProfileCommunityPostsOptions>>,
6798    ) -> Items<YouTubeCommunityPost> {
6799        let options = options.into().unwrap_or_default();
6800        Items::new(self.scope.operation(
6801            Method::GET,
6802            "/v1/youtube/profiles/{identifier}/community-posts",
6803            options.query(),
6804            options.request_options,
6805        ))
6806    }
6807}
6808
6809/// The `youtube.profile.livestreams` resources.
6810///
6811/// Selecting a resource never sends a request. Only its terminal operations do.
6812#[derive(Clone, Debug)]
6813pub struct YouTubeProfileLivestreamsResource {
6814    scope: Scope,
6815}
6816
6817impl YouTubeProfileLivestreamsResource {
6818    /// List profile livestreams.
6819    ///
6820    /// Return the current, upcoming, and past livestreams of a public YouTube channel.
6821    /// Test and Live use the same route, parameters, response schema, pagination, and
6822    /// errors. In Test, null means unavailable, not zero.
6823    ///
6824    /// `GET /v1/youtube/profiles/{identifier}/livestreams`
6825    pub async fn list(
6826        &self,
6827        options: impl Into<Option<YouTubeProfileLivestreamsOptions>>,
6828    ) -> Result<YouTubeProfileLivestreamsPage, Error> {
6829        let options = options.into().unwrap_or_default();
6830        self.scope
6831            .operation(
6832                Method::GET,
6833                "/v1/youtube/profiles/{identifier}/livestreams",
6834                options.query(),
6835                options.request_options,
6836            )?
6837            .send_page()
6838            .await
6839    }
6840
6841    /// Iterates lazily over every item of [`list`](Self::list), one page per request.
6842    pub fn items(
6843        &self,
6844        options: impl Into<Option<YouTubeProfileLivestreamsOptions>>,
6845    ) -> Items<YouTubePost> {
6846        let options = options.into().unwrap_or_default();
6847        Items::new(self.scope.operation(
6848            Method::GET,
6849            "/v1/youtube/profiles/{identifier}/livestreams",
6850            options.query(),
6851            options.request_options,
6852        ))
6853    }
6854}
6855
6856/// The `youtube.profile.playlists` resources.
6857///
6858/// Selecting a resource never sends a request. Only its terminal operations do.
6859#[derive(Clone, Debug)]
6860pub struct YouTubeProfilePlaylistsResource {
6861    scope: Scope,
6862}
6863
6864impl YouTubeProfilePlaylistsResource {
6865    /// List profile playlists.
6866    ///
6867    /// Return the public playlists of a YouTube channel. Test and Live use the same
6868    /// route, parameters, response schema, pagination, and errors. In Test, null means
6869    /// unavailable, not zero.
6870    ///
6871    /// `GET /v1/youtube/profiles/{identifier}/playlists`
6872    pub async fn list(
6873        &self,
6874        options: impl Into<Option<YouTubeProfilePlaylistsOptions>>,
6875    ) -> Result<YouTubeProfilePlaylistsPage, Error> {
6876        let options = options.into().unwrap_or_default();
6877        self.scope
6878            .operation(
6879                Method::GET,
6880                "/v1/youtube/profiles/{identifier}/playlists",
6881                options.query(),
6882                options.request_options,
6883            )?
6884            .send_page()
6885            .await
6886    }
6887
6888    /// Iterates lazily over every item of [`list`](Self::list), one page per request.
6889    pub fn items(
6890        &self,
6891        options: impl Into<Option<YouTubeProfilePlaylistsOptions>>,
6892    ) -> Items<YouTubePlaylist> {
6893        let options = options.into().unwrap_or_default();
6894        Items::new(self.scope.operation(
6895            Method::GET,
6896            "/v1/youtube/profiles/{identifier}/playlists",
6897            options.query(),
6898            options.request_options,
6899        ))
6900    }
6901}
6902
6903/// The `youtube.profile.products` resources.
6904///
6905/// Selecting a resource never sends a request. Only its terminal operations do.
6906#[derive(Clone, Debug)]
6907pub struct YouTubeProfileProductsResource {
6908    scope: Scope,
6909}
6910
6911impl YouTubeProfileProductsResource {
6912    /// List profile products.
6913    ///
6914    /// Return the products on the store shelf of a public YouTube channel. Test and
6915    /// Live use the same route, parameters, response schema, pagination, and errors. In
6916    /// Test, null means unavailable, not zero.
6917    ///
6918    /// `GET /v1/youtube/profiles/{identifier}/products`
6919    pub async fn list(
6920        &self,
6921        options: impl Into<Option<YouTubeProfileProductsOptions>>,
6922    ) -> Result<YouTubeProfileProductsPage, Error> {
6923        let options = options.into().unwrap_or_default();
6924        self.scope
6925            .operation(
6926                Method::GET,
6927                "/v1/youtube/profiles/{identifier}/products",
6928                options.query(),
6929                options.request_options,
6930            )?
6931            .send_page()
6932            .await
6933    }
6934
6935    /// Iterates lazily over every item of [`list`](Self::list), one page per request.
6936    pub fn items(
6937        &self,
6938        options: impl Into<Option<YouTubeProfileProductsOptions>>,
6939    ) -> Items<YouTubeProduct> {
6940        let options = options.into().unwrap_or_default();
6941        Items::new(self.scope.operation(
6942            Method::GET,
6943            "/v1/youtube/profiles/{identifier}/products",
6944            options.query(),
6945            options.request_options,
6946        ))
6947    }
6948}
6949
6950/// The `youtube.profile.search` resources.
6951///
6952/// Selecting a resource never sends a request. Only its terminal operations do.
6953#[derive(Clone, Debug)]
6954pub struct YouTubeProfileSearchResource {
6955    scope: Scope,
6956}
6957
6958impl YouTubeProfileSearchResource {
6959    /// Search profile videos.
6960    ///
6961    /// Search the videos of one public YouTube channel. Test and Live use the same
6962    /// route, parameters, response schema, pagination, and errors. In Test, null means
6963    /// unavailable, not zero.
6964    ///
6965    /// `GET /v1/youtube/profiles/{identifier}/search`
6966    pub async fn list(
6967        &self,
6968        options: YouTubeProfileSearchOptions,
6969    ) -> Result<YouTubeProfileSearchPage, Error> {
6970        self.scope
6971            .operation(
6972                Method::GET,
6973                "/v1/youtube/profiles/{identifier}/search",
6974                options.query(),
6975                options.request_options,
6976            )?
6977            .send_page()
6978            .await
6979    }
6980
6981    /// Iterates lazily over every item of [`list`](Self::list), one page per request.
6982    pub fn items(&self, options: YouTubeProfileSearchOptions) -> Items<YouTubePost> {
6983        Items::new(self.scope.operation(
6984            Method::GET,
6985            "/v1/youtube/profiles/{identifier}/search",
6986            options.query(),
6987            options.request_options,
6988        ))
6989    }
6990}
6991
6992/// The `youtube.profile.shorts` resources.
6993///
6994/// Selecting a resource never sends a request. Only its terminal operations do.
6995#[derive(Clone, Debug)]
6996pub struct YouTubeProfileShortsResource {
6997    scope: Scope,
6998}
6999
7000impl YouTubeProfileShortsResource {
7001    /// List profile Shorts.
7002    ///
7003    /// Return the Shorts of a public YouTube channel. Test and Live use the same route,
7004    /// parameters, response schema, pagination, and errors. In Test, null means
7005    /// unavailable, not zero.
7006    ///
7007    /// `GET /v1/youtube/profiles/{identifier}/shorts`
7008    pub async fn list(
7009        &self,
7010        options: impl Into<Option<YouTubeProfileShortsOptions>>,
7011    ) -> Result<YouTubeProfileShortsPage, Error> {
7012        let options = options.into().unwrap_or_default();
7013        self.scope
7014            .operation(
7015                Method::GET,
7016                "/v1/youtube/profiles/{identifier}/shorts",
7017                options.query(),
7018                options.request_options,
7019            )?
7020            .send_page()
7021            .await
7022    }
7023
7024    /// Iterates lazily over every item of [`list`](Self::list), one page per request.
7025    pub fn items(
7026        &self,
7027        options: impl Into<Option<YouTubeProfileShortsOptions>>,
7028    ) -> Items<YouTubePost> {
7029        let options = options.into().unwrap_or_default();
7030        Items::new(self.scope.operation(
7031            Method::GET,
7032            "/v1/youtube/profiles/{identifier}/shorts",
7033            options.query(),
7034            options.request_options,
7035        ))
7036    }
7037}
7038
7039/// The `youtube.profile.videos` resources.
7040///
7041/// Selecting a resource never sends a request. Only its terminal operations do.
7042#[derive(Clone, Debug)]
7043pub struct YouTubeProfileVideosResource {
7044    scope: Scope,
7045}
7046
7047impl YouTubeProfileVideosResource {
7048    /// List profile videos.
7049    ///
7050    /// Return the videos of a public YouTube channel. Test and Live use the same route,
7051    /// parameters, response schema, pagination, and errors. In Test, null means
7052    /// unavailable, not zero.
7053    ///
7054    /// `GET /v1/youtube/profiles/{identifier}/videos`
7055    pub async fn list(
7056        &self,
7057        options: impl Into<Option<YouTubeProfileVideosOptions>>,
7058    ) -> Result<YouTubeProfileVideosPage, Error> {
7059        let options = options.into().unwrap_or_default();
7060        self.scope
7061            .operation(
7062                Method::GET,
7063                "/v1/youtube/profiles/{identifier}/videos",
7064                options.query(),
7065                options.request_options,
7066            )?
7067            .send_page()
7068            .await
7069    }
7070
7071    /// Iterates lazily over every item of [`list`](Self::list), one page per request.
7072    pub fn items(
7073        &self,
7074        options: impl Into<Option<YouTubeProfileVideosOptions>>,
7075    ) -> Items<YouTubePost> {
7076        let options = options.into().unwrap_or_default();
7077        Items::new(self.scope.operation(
7078            Method::GET,
7079            "/v1/youtube/profiles/{identifier}/videos",
7080            options.query(),
7081            options.request_options,
7082        ))
7083    }
7084}
7085
7086/// The `youtube.search` resources.
7087///
7088/// Selecting a resource never sends a request. Only its terminal operations do.
7089#[derive(Clone, Debug)]
7090pub struct YouTubeSearchResource {
7091    scope: Scope,
7092}
7093
7094impl YouTubeSearchResource {
7095    /// Selects the playlists resources. This never sends a request.
7096    pub fn playlists(&self) -> YouTubeSearchPlaylistsResource {
7097        YouTubeSearchPlaylistsResource {
7098            scope: self.scope.clone(),
7099        }
7100    }
7101
7102    /// Selects the posts resources. This never sends a request.
7103    pub fn posts(&self) -> YouTubeSearchPostsResource {
7104        YouTubeSearchPostsResource {
7105            scope: self.scope.clone(),
7106        }
7107    }
7108
7109    /// Selects the profiles resources. This never sends a request.
7110    pub fn profiles(&self) -> YouTubeSearchProfilesResource {
7111        YouTubeSearchProfilesResource {
7112            scope: self.scope.clone(),
7113        }
7114    }
7115
7116    /// Selects the suggestions resources. This never sends a request.
7117    pub fn suggestions(&self) -> YouTubeSearchSuggestionsResource {
7118        YouTubeSearchSuggestionsResource {
7119            scope: self.scope.clone(),
7120        }
7121    }
7122}
7123
7124/// The `youtube.search.playlists` resources.
7125///
7126/// Selecting a resource never sends a request. Only its terminal operations do.
7127#[derive(Clone, Debug)]
7128pub struct YouTubeSearchPlaylistsResource {
7129    scope: Scope,
7130}
7131
7132impl YouTubeSearchPlaylistsResource {
7133    /// Search playlists.
7134    ///
7135    /// Search public YouTube playlists and podcasts. Test and Live use the same route,
7136    /// parameters, response schema, pagination, and errors. In Test, null means
7137    /// unavailable, not zero.
7138    ///
7139    /// `GET /v1/youtube/search/playlists`
7140    pub async fn list(
7141        &self,
7142        options: YouTubeSearchPlaylistsOptions,
7143    ) -> Result<YouTubeSearchPlaylistsPage, Error> {
7144        self.scope
7145            .operation(
7146                Method::GET,
7147                "/v1/youtube/search/playlists",
7148                options.query(),
7149                options.request_options,
7150            )?
7151            .send_page()
7152            .await
7153    }
7154
7155    /// Iterates lazily over every item of [`list`](Self::list), one page per request.
7156    pub fn items(&self, options: YouTubeSearchPlaylistsOptions) -> Items<YouTubePlaylist> {
7157        Items::new(self.scope.operation(
7158            Method::GET,
7159            "/v1/youtube/search/playlists",
7160            options.query(),
7161            options.request_options,
7162        ))
7163    }
7164}
7165
7166/// The `youtube.search.posts` resources.
7167///
7168/// Selecting a resource never sends a request. Only its terminal operations do.
7169#[derive(Clone, Debug)]
7170pub struct YouTubeSearchPostsResource {
7171    scope: Scope,
7172}
7173
7174impl YouTubeSearchPostsResource {
7175    /// Search posts.
7176    ///
7177    /// Search public YouTube videos or Shorts. Test and Live use the same route,
7178    /// parameters, response schema, pagination, and errors. In Test, null means
7179    /// unavailable, not zero.
7180    ///
7181    /// `GET /v1/youtube/search/posts`
7182    pub async fn list(
7183        &self,
7184        options: YouTubeSearchPostsOptions,
7185    ) -> Result<YouTubeSearchPostsPage, Error> {
7186        self.scope
7187            .operation(
7188                Method::GET,
7189                "/v1/youtube/search/posts",
7190                options.query(),
7191                options.request_options,
7192            )?
7193            .send_page()
7194            .await
7195    }
7196
7197    /// Iterates lazily over every item of [`list`](Self::list), one page per request.
7198    pub fn items(&self, options: YouTubeSearchPostsOptions) -> Items<YouTubePost> {
7199        Items::new(self.scope.operation(
7200            Method::GET,
7201            "/v1/youtube/search/posts",
7202            options.query(),
7203            options.request_options,
7204        ))
7205    }
7206}
7207
7208/// The `youtube.search.profiles` resources.
7209///
7210/// Selecting a resource never sends a request. Only its terminal operations do.
7211#[derive(Clone, Debug)]
7212pub struct YouTubeSearchProfilesResource {
7213    scope: Scope,
7214}
7215
7216impl YouTubeSearchProfilesResource {
7217    /// Search profiles.
7218    ///
7219    /// Search public YouTube channels. Test and Live use the same route, parameters,
7220    /// response schema, pagination, and errors. In Test, null means unavailable, not
7221    /// zero.
7222    ///
7223    /// `GET /v1/youtube/search/profiles`
7224    pub async fn list(
7225        &self,
7226        options: YouTubeSearchProfilesOptions,
7227    ) -> Result<YouTubeSearchProfilesPage, Error> {
7228        self.scope
7229            .operation(
7230                Method::GET,
7231                "/v1/youtube/search/profiles",
7232                options.query(),
7233                options.request_options,
7234            )?
7235            .send_page()
7236            .await
7237    }
7238
7239    /// Iterates lazily over every item of [`list`](Self::list), one page per request.
7240    pub fn items(&self, options: YouTubeSearchProfilesOptions) -> Items<YouTubeProfile> {
7241        Items::new(self.scope.operation(
7242            Method::GET,
7243            "/v1/youtube/search/profiles",
7244            options.query(),
7245            options.request_options,
7246        ))
7247    }
7248}
7249
7250/// The `youtube.search.suggestions` resources.
7251///
7252/// Selecting a resource never sends a request. Only its terminal operations do.
7253#[derive(Clone, Debug)]
7254pub struct YouTubeSearchSuggestionsResource {
7255    scope: Scope,
7256}
7257
7258impl YouTubeSearchSuggestionsResource {
7259    /// Search suggestions.
7260    ///
7261    /// Return the autocomplete queries YouTube offers for a partial search. Test and
7262    /// Live use the same route, parameters, response schema, pagination, and errors. In
7263    /// Test, null means unavailable, not zero.
7264    ///
7265    /// `GET /v1/youtube/search/suggestions`
7266    pub async fn list(
7267        &self,
7268        options: YouTubeSearchSuggestionsOptions,
7269    ) -> Result<YouTubeSearchSuggestionsResponse, Error> {
7270        self.scope
7271            .operation(
7272                Method::GET,
7273                "/v1/youtube/search/suggestions",
7274                options.query(),
7275                options.request_options,
7276            )?
7277            .send()
7278            .await
7279    }
7280}
7281
7282/// The `youtube.trending` resources.
7283///
7284/// Selecting a resource never sends a request. Only its terminal operations do.
7285#[derive(Clone, Debug)]
7286pub struct YouTubeTrendingResource {
7287    scope: Scope,
7288}
7289
7290impl YouTubeTrendingResource {
7291    /// Selects the posts resources. This never sends a request.
7292    pub fn posts(&self) -> YouTubeTrendingPostsResource {
7293        YouTubeTrendingPostsResource {
7294            scope: self.scope.clone(),
7295        }
7296    }
7297}
7298
7299/// The `youtube.trending.posts` resources.
7300///
7301/// Selecting a resource never sends a request. Only its terminal operations do.
7302#[derive(Clone, Debug)]
7303pub struct YouTubeTrendingPostsResource {
7304    scope: Scope,
7305}
7306
7307impl YouTubeTrendingPostsResource {
7308    /// List trending posts.
7309    ///
7310    /// Return the trending YouTube videos of one country. Test and Live use the same
7311    /// route, parameters, response schema, pagination, and errors. In Test, null means
7312    /// unavailable, not zero.
7313    ///
7314    /// `GET /v1/youtube/trending/posts`
7315    pub async fn list(
7316        &self,
7317        options: impl Into<Option<YouTubeTrendingPostsOptions>>,
7318    ) -> Result<YouTubeTrendingPostsResponse, Error> {
7319        let options = options.into().unwrap_or_default();
7320        self.scope
7321            .operation(
7322                Method::GET,
7323                "/v1/youtube/trending/posts",
7324                options.query(),
7325                options.request_options,
7326            )?
7327            .send()
7328            .await
7329    }
7330}
7331
7332/// The resource returned by [`Client::fetch`]. The variant follows the
7333/// platform and resource the URL represents.
7334#[derive(Clone, Debug, PartialEq)]
7335#[non_exhaustive]
7336pub enum FetchResource {
7337    /// A instagram profile.
7338    InstagramProfile(Box<InstagramProfile>),
7339    /// A instagram post.
7340    InstagramPost(Box<InstagramPost>),
7341    /// A instagram story.
7342    InstagramStory(Box<InstagramStory>),
7343    /// A instagram highlight.
7344    InstagramHighlight(Box<InstagramHighlight>),
7345    /// A tiktok profile.
7346    TikTokProfile(Box<TikTokProfile>),
7347    /// A tiktok post.
7348    TikTokPost(Box<TikTokPost>),
7349    /// A twitter profile.
7350    TwitterProfile(Box<TwitterProfile>),
7351    /// A twitter post.
7352    TwitterPost(Box<TwitterPost>),
7353    /// A reddit profile.
7354    RedditProfile(Box<RedditProfile>),
7355    /// A reddit post.
7356    RedditPost(Box<RedditPost>),
7357    /// A reddit subreddit.
7358    RedditSubreddit(Box<RedditSubreddit>),
7359    /// A youtube profile.
7360    YouTubeProfile(Box<YouTubeProfile>),
7361    /// A youtube post.
7362    YouTubePost(Box<YouTubePost>),
7363}
7364
7365impl FetchResource {
7366    pub(crate) fn decode(
7367        platform: &str,
7368        resource: &str,
7369        data: serde_json::Value,
7370    ) -> Result<Option<Self>, serde_json::Error> {
7371        match (platform, resource) {
7372            ("instagram", "profile") => serde_json::from_value(data)
7373                .map(|value| Some(Self::InstagramProfile(Box::new(value)))),
7374            ("instagram", "post") => {
7375                serde_json::from_value(data).map(|value| Some(Self::InstagramPost(Box::new(value))))
7376            }
7377            ("instagram", "story") => serde_json::from_value(data)
7378                .map(|value| Some(Self::InstagramStory(Box::new(value)))),
7379            ("instagram", "highlight") => serde_json::from_value(data)
7380                .map(|value| Some(Self::InstagramHighlight(Box::new(value)))),
7381            ("tiktok", "profile") => {
7382                serde_json::from_value(data).map(|value| Some(Self::TikTokProfile(Box::new(value))))
7383            }
7384            ("tiktok", "post") => {
7385                serde_json::from_value(data).map(|value| Some(Self::TikTokPost(Box::new(value))))
7386            }
7387            ("twitter", "profile") => serde_json::from_value(data)
7388                .map(|value| Some(Self::TwitterProfile(Box::new(value)))),
7389            ("twitter", "post") => {
7390                serde_json::from_value(data).map(|value| Some(Self::TwitterPost(Box::new(value))))
7391            }
7392            ("reddit", "profile") => {
7393                serde_json::from_value(data).map(|value| Some(Self::RedditProfile(Box::new(value))))
7394            }
7395            ("reddit", "post") => {
7396                serde_json::from_value(data).map(|value| Some(Self::RedditPost(Box::new(value))))
7397            }
7398            ("reddit", "subreddit") => serde_json::from_value(data)
7399                .map(|value| Some(Self::RedditSubreddit(Box::new(value)))),
7400            ("youtube", "profile") => serde_json::from_value(data)
7401                .map(|value| Some(Self::YouTubeProfile(Box::new(value)))),
7402            ("youtube", "post") => {
7403                serde_json::from_value(data).map(|value| Some(Self::YouTubePost(Box::new(value))))
7404            }
7405            _ => Ok(None),
7406        }
7407    }
7408}
7409
7410/// Typed result of [`Client::fetch`].
7411pub type FetchResponse = Response<FetchResource>;
7412
7413/// Options for `instagram.comment.likers.list`.
7414#[derive(Clone, Debug, PartialEq)]
7415#[non_exhaustive]
7416pub struct InstagramCommentLikersOptions {
7417    /// Opaque native media ID associated with the selected resource.
7418    pub media_id: String,
7419    /// Maximum accepted data age. The default is 24h.
7420    pub freshness: Option<crate::options::Freshness>,
7421    /// Opaque cursor returned by the previous page.
7422    pub cursor: Option<String>,
7423    /// Retry and timeout controls for this request.
7424    pub request_options: RequestOptions,
7425}
7426
7427impl InstagramCommentLikersOptions {
7428    /// Creates options with the required values.
7429    pub fn new(media_id: impl Into<String>) -> Self {
7430        Self {
7431            media_id: media_id.into(),
7432            freshness: None,
7433            cursor: None,
7434            request_options: RequestOptions::default(),
7435        }
7436    }
7437
7438    /// Maximum accepted data age. The default is 24h.
7439    pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
7440        self.freshness = Some(value);
7441        self
7442    }
7443
7444    /// Opaque cursor returned by the previous page.
7445    pub fn cursor(mut self, value: impl Into<String>) -> Self {
7446        self.cursor = Some(value.into());
7447        self
7448    }
7449
7450    /// Sets the retry attempts after the first request.
7451    pub fn max_retries(mut self, value: u32) -> Self {
7452        self.request_options.max_retries = Some(value);
7453        self
7454    }
7455
7456    /// Sets the timeout for each attempt.
7457    pub fn timeout(mut self, value: Duration) -> Self {
7458        self.request_options.timeout = Some(value);
7459        self
7460    }
7461
7462    pub(crate) fn query(&self) -> Result<Query, Error> {
7463        let mut query = Query::default();
7464        query.require("media_id", &self.media_id)?;
7465        query.push("freshness", &self.freshness);
7466        query.push("cursor", &self.cursor);
7467        Ok(query)
7468    }
7469}
7470
7471/// One page returned by `instagram.comment.likers.list`.
7472pub type InstagramCommentLikersPage = Page<InstagramProfileSummary>;
7473
7474/// Options for `instagram.hashtag.get`.
7475#[derive(Clone, Debug, Default, PartialEq)]
7476#[non_exhaustive]
7477pub struct InstagramHashtagOptions {
7478    /// Maximum accepted data age. The default is 24h.
7479    pub freshness: Option<crate::options::Freshness>,
7480    /// Retry and timeout controls for this request.
7481    pub request_options: RequestOptions,
7482}
7483
7484impl InstagramHashtagOptions {
7485    /// Creates options that use the API and client defaults.
7486    pub fn new() -> Self {
7487        Self::default()
7488    }
7489
7490    /// Maximum accepted data age. The default is 24h.
7491    pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
7492        self.freshness = Some(value);
7493        self
7494    }
7495
7496    /// Sets the retry attempts after the first request.
7497    pub fn max_retries(mut self, value: u32) -> Self {
7498        self.request_options.max_retries = Some(value);
7499        self
7500    }
7501
7502    /// Sets the timeout for each attempt.
7503    pub fn timeout(mut self, value: Duration) -> Self {
7504        self.request_options.timeout = Some(value);
7505        self
7506    }
7507
7508    pub(crate) fn query(&self) -> Result<Query, Error> {
7509        let mut query = Query::default();
7510        query.push("freshness", &self.freshness);
7511        Ok(query)
7512    }
7513}
7514
7515/// Typed result of `instagram.hashtag.get`.
7516pub type InstagramHashtagResponse = Response<InstagramHashtag>;
7517
7518/// Options for `instagram.hashtag.posts.list`.
7519#[derive(Clone, Debug, Default, PartialEq)]
7520#[non_exhaustive]
7521pub struct InstagramHashtagPostsOptions {
7522    /// Result ordering for this operation. One of `recent`, or `top`. The API default
7523    /// is `recent`.
7524    pub sort: Option<String>,
7525    /// Maximum accepted data age. The default is 24h.
7526    pub freshness: Option<crate::options::Freshness>,
7527    /// Opaque cursor returned by the previous page.
7528    pub cursor: Option<String>,
7529    /// Retry and timeout controls for this request.
7530    pub request_options: RequestOptions,
7531}
7532
7533impl InstagramHashtagPostsOptions {
7534    /// Creates options that use the API and client defaults.
7535    pub fn new() -> Self {
7536        Self::default()
7537    }
7538
7539    /// Result ordering for this operation. One of `recent`, or `top`. The API default
7540    /// is `recent`.
7541    pub fn sort(mut self, value: impl Into<String>) -> Self {
7542        self.sort = Some(value.into());
7543        self
7544    }
7545
7546    /// Maximum accepted data age. The default is 24h.
7547    pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
7548        self.freshness = Some(value);
7549        self
7550    }
7551
7552    /// Opaque cursor returned by the previous page.
7553    pub fn cursor(mut self, value: impl Into<String>) -> Self {
7554        self.cursor = Some(value.into());
7555        self
7556    }
7557
7558    /// Sets the retry attempts after the first request.
7559    pub fn max_retries(mut self, value: u32) -> Self {
7560        self.request_options.max_retries = Some(value);
7561        self
7562    }
7563
7564    /// Sets the timeout for each attempt.
7565    pub fn timeout(mut self, value: Duration) -> Self {
7566        self.request_options.timeout = Some(value);
7567        self
7568    }
7569
7570    pub(crate) fn query(&self) -> Result<Query, Error> {
7571        let mut query = Query::default();
7572        query.push("sort", &self.sort);
7573        query.push("freshness", &self.freshness);
7574        query.push("cursor", &self.cursor);
7575        Ok(query)
7576    }
7577}
7578
7579/// One page returned by `instagram.hashtag.posts.list`.
7580pub type InstagramHashtagPostsPage = Page<InstagramPost>;
7581
7582/// Options for `instagram.hashtag.reels.list`.
7583#[derive(Clone, Debug, Default, PartialEq)]
7584#[non_exhaustive]
7585pub struct InstagramHashtagReelsOptions {
7586    /// Maximum accepted data age. The default is 24h.
7587    pub freshness: Option<crate::options::Freshness>,
7588    /// Opaque cursor returned by the previous page.
7589    pub cursor: Option<String>,
7590    /// Retry and timeout controls for this request.
7591    pub request_options: RequestOptions,
7592}
7593
7594impl InstagramHashtagReelsOptions {
7595    /// Creates options that use the API and client defaults.
7596    pub fn new() -> Self {
7597        Self::default()
7598    }
7599
7600    /// Maximum accepted data age. The default is 24h.
7601    pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
7602        self.freshness = Some(value);
7603        self
7604    }
7605
7606    /// Opaque cursor returned by the previous page.
7607    pub fn cursor(mut self, value: impl Into<String>) -> Self {
7608        self.cursor = Some(value.into());
7609        self
7610    }
7611
7612    /// Sets the retry attempts after the first request.
7613    pub fn max_retries(mut self, value: u32) -> Self {
7614        self.request_options.max_retries = Some(value);
7615        self
7616    }
7617
7618    /// Sets the timeout for each attempt.
7619    pub fn timeout(mut self, value: Duration) -> Self {
7620        self.request_options.timeout = Some(value);
7621        self
7622    }
7623
7624    pub(crate) fn query(&self) -> Result<Query, Error> {
7625        let mut query = Query::default();
7626        query.push("freshness", &self.freshness);
7627        query.push("cursor", &self.cursor);
7628        Ok(query)
7629    }
7630}
7631
7632/// One page returned by `instagram.hashtag.reels.list`.
7633pub type InstagramHashtagReelsPage = Page<InstagramPost>;
7634
7635/// Options for `instagram.highlight.get`.
7636#[derive(Clone, Debug, Default, PartialEq)]
7637#[non_exhaustive]
7638pub struct InstagramHighlightOptions {
7639    /// Maximum accepted data age. The default is 24h.
7640    pub freshness: Option<crate::options::Freshness>,
7641    /// Retry and timeout controls for this request.
7642    pub request_options: RequestOptions,
7643}
7644
7645impl InstagramHighlightOptions {
7646    /// Creates options that use the API and client defaults.
7647    pub fn new() -> Self {
7648        Self::default()
7649    }
7650
7651    /// Maximum accepted data age. The default is 24h.
7652    pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
7653        self.freshness = Some(value);
7654        self
7655    }
7656
7657    /// Sets the retry attempts after the first request.
7658    pub fn max_retries(mut self, value: u32) -> Self {
7659        self.request_options.max_retries = Some(value);
7660        self
7661    }
7662
7663    /// Sets the timeout for each attempt.
7664    pub fn timeout(mut self, value: Duration) -> Self {
7665        self.request_options.timeout = Some(value);
7666        self
7667    }
7668
7669    pub(crate) fn query(&self) -> Result<Query, Error> {
7670        let mut query = Query::default();
7671        query.push("freshness", &self.freshness);
7672        Ok(query)
7673    }
7674}
7675
7676/// Typed result of `instagram.highlight.get`.
7677pub type InstagramHighlightResponse = Response<InstagramHighlight>;
7678
7679/// Options for `instagram.location.get`.
7680#[derive(Clone, Debug, Default, PartialEq)]
7681#[non_exhaustive]
7682pub struct InstagramLocationOptions {
7683    /// Maximum accepted data age. The default is 24h.
7684    pub freshness: Option<crate::options::Freshness>,
7685    /// Retry and timeout controls for this request.
7686    pub request_options: RequestOptions,
7687}
7688
7689impl InstagramLocationOptions {
7690    /// Creates options that use the API and client defaults.
7691    pub fn new() -> Self {
7692        Self::default()
7693    }
7694
7695    /// Maximum accepted data age. The default is 24h.
7696    pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
7697        self.freshness = Some(value);
7698        self
7699    }
7700
7701    /// Sets the retry attempts after the first request.
7702    pub fn max_retries(mut self, value: u32) -> Self {
7703        self.request_options.max_retries = Some(value);
7704        self
7705    }
7706
7707    /// Sets the timeout for each attempt.
7708    pub fn timeout(mut self, value: Duration) -> Self {
7709        self.request_options.timeout = Some(value);
7710        self
7711    }
7712
7713    pub(crate) fn query(&self) -> Result<Query, Error> {
7714        let mut query = Query::default();
7715        query.push("freshness", &self.freshness);
7716        Ok(query)
7717    }
7718}
7719
7720/// Typed result of `instagram.location.get`.
7721pub type InstagramLocationResponse = Response<InstagramLocation>;
7722
7723/// Options for `instagram.location.posts.list`.
7724#[derive(Clone, Debug, Default, PartialEq)]
7725#[non_exhaustive]
7726pub struct InstagramLocationPostsOptions {
7727    /// Result ordering for this operation. One of `recent`, or `top`. The API default
7728    /// is `recent`.
7729    pub sort: Option<String>,
7730    /// Maximum accepted data age. The default is 24h.
7731    pub freshness: Option<crate::options::Freshness>,
7732    /// Opaque cursor returned by the previous page.
7733    pub cursor: Option<String>,
7734    /// Retry and timeout controls for this request.
7735    pub request_options: RequestOptions,
7736}
7737
7738impl InstagramLocationPostsOptions {
7739    /// Creates options that use the API and client defaults.
7740    pub fn new() -> Self {
7741        Self::default()
7742    }
7743
7744    /// Result ordering for this operation. One of `recent`, or `top`. The API default
7745    /// is `recent`.
7746    pub fn sort(mut self, value: impl Into<String>) -> Self {
7747        self.sort = Some(value.into());
7748        self
7749    }
7750
7751    /// Maximum accepted data age. The default is 24h.
7752    pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
7753        self.freshness = Some(value);
7754        self
7755    }
7756
7757    /// Opaque cursor returned by the previous page.
7758    pub fn cursor(mut self, value: impl Into<String>) -> Self {
7759        self.cursor = Some(value.into());
7760        self
7761    }
7762
7763    /// Sets the retry attempts after the first request.
7764    pub fn max_retries(mut self, value: u32) -> Self {
7765        self.request_options.max_retries = Some(value);
7766        self
7767    }
7768
7769    /// Sets the timeout for each attempt.
7770    pub fn timeout(mut self, value: Duration) -> Self {
7771        self.request_options.timeout = Some(value);
7772        self
7773    }
7774
7775    pub(crate) fn query(&self) -> Result<Query, Error> {
7776        let mut query = Query::default();
7777        query.push("sort", &self.sort);
7778        query.push("freshness", &self.freshness);
7779        query.push("cursor", &self.cursor);
7780        Ok(query)
7781    }
7782}
7783
7784/// One page returned by `instagram.location.posts.list`.
7785pub type InstagramLocationPostsPage = Page<InstagramPost>;
7786
7787/// Options for `instagram.music.get`.
7788#[derive(Clone, Debug, Default, PartialEq)]
7789#[non_exhaustive]
7790pub struct InstagramMusicOptions {
7791    /// Maximum accepted data age. The default is 24h.
7792    pub freshness: Option<crate::options::Freshness>,
7793    /// Retry and timeout controls for this request.
7794    pub request_options: RequestOptions,
7795}
7796
7797impl InstagramMusicOptions {
7798    /// Creates options that use the API and client defaults.
7799    pub fn new() -> Self {
7800        Self::default()
7801    }
7802
7803    /// Maximum accepted data age. The default is 24h.
7804    pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
7805        self.freshness = Some(value);
7806        self
7807    }
7808
7809    /// Sets the retry attempts after the first request.
7810    pub fn max_retries(mut self, value: u32) -> Self {
7811        self.request_options.max_retries = Some(value);
7812        self
7813    }
7814
7815    /// Sets the timeout for each attempt.
7816    pub fn timeout(mut self, value: Duration) -> Self {
7817        self.request_options.timeout = Some(value);
7818        self
7819    }
7820
7821    pub(crate) fn query(&self) -> Result<Query, Error> {
7822        let mut query = Query::default();
7823        query.push("freshness", &self.freshness);
7824        Ok(query)
7825    }
7826}
7827
7828/// Typed result of `instagram.music.get`.
7829pub type InstagramMusicResponse = Response<InstagramMusic>;
7830
7831/// Options for `instagram.music.stream.list`.
7832#[derive(Clone, Debug, Default, PartialEq)]
7833#[non_exhaustive]
7834pub struct InstagramMusicStreamOptions {
7835    /// Maximum accepted data age. The default is 24h.
7836    pub freshness: Option<crate::options::Freshness>,
7837    /// Opaque cursor returned by the previous page.
7838    pub cursor: Option<String>,
7839    /// Retry and timeout controls for this request.
7840    pub request_options: RequestOptions,
7841}
7842
7843impl InstagramMusicStreamOptions {
7844    /// Creates options that use the API and client defaults.
7845    pub fn new() -> Self {
7846        Self::default()
7847    }
7848
7849    /// Maximum accepted data age. The default is 24h.
7850    pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
7851        self.freshness = Some(value);
7852        self
7853    }
7854
7855    /// Opaque cursor returned by the previous page.
7856    pub fn cursor(mut self, value: impl Into<String>) -> Self {
7857        self.cursor = Some(value.into());
7858        self
7859    }
7860
7861    /// Sets the retry attempts after the first request.
7862    pub fn max_retries(mut self, value: u32) -> Self {
7863        self.request_options.max_retries = Some(value);
7864        self
7865    }
7866
7867    /// Sets the timeout for each attempt.
7868    pub fn timeout(mut self, value: Duration) -> Self {
7869        self.request_options.timeout = Some(value);
7870        self
7871    }
7872
7873    pub(crate) fn query(&self) -> Result<Query, Error> {
7874        let mut query = Query::default();
7875        query.push("freshness", &self.freshness);
7876        query.push("cursor", &self.cursor);
7877        Ok(query)
7878    }
7879}
7880
7881/// One page returned by `instagram.music.stream.list`.
7882pub type InstagramMusicStreamPage = Page<InstagramMusicStream>;
7883
7884/// Options for `instagram.post.get`.
7885#[derive(Clone, Debug, Default, PartialEq)]
7886#[non_exhaustive]
7887pub struct InstagramPostOptions {
7888    /// Maximum accepted data age. The default is 24h.
7889    pub freshness: Option<crate::options::Freshness>,
7890    /// Retry and timeout controls for this request.
7891    pub request_options: RequestOptions,
7892}
7893
7894impl InstagramPostOptions {
7895    /// Creates options that use the API and client defaults.
7896    pub fn new() -> Self {
7897        Self::default()
7898    }
7899
7900    /// Maximum accepted data age. The default is 24h.
7901    pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
7902        self.freshness = Some(value);
7903        self
7904    }
7905
7906    /// Sets the retry attempts after the first request.
7907    pub fn max_retries(mut self, value: u32) -> Self {
7908        self.request_options.max_retries = Some(value);
7909        self
7910    }
7911
7912    /// Sets the timeout for each attempt.
7913    pub fn timeout(mut self, value: Duration) -> Self {
7914        self.request_options.timeout = Some(value);
7915        self
7916    }
7917
7918    pub(crate) fn query(&self) -> Result<Query, Error> {
7919        let mut query = Query::default();
7920        query.push("freshness", &self.freshness);
7921        Ok(query)
7922    }
7923}
7924
7925/// Typed result of `instagram.post.get`.
7926pub type InstagramPostResponse = Response<InstagramPost>;
7927
7928/// Options for `instagram.post.clipMetadata.get`.
7929#[derive(Clone, Debug, Default, PartialEq)]
7930#[non_exhaustive]
7931pub struct InstagramPostClipMetadataOptions {
7932    /// Maximum accepted data age. The default is 24h.
7933    pub freshness: Option<crate::options::Freshness>,
7934    /// Retry and timeout controls for this request.
7935    pub request_options: RequestOptions,
7936}
7937
7938impl InstagramPostClipMetadataOptions {
7939    /// Creates options that use the API and client defaults.
7940    pub fn new() -> Self {
7941        Self::default()
7942    }
7943
7944    /// Maximum accepted data age. The default is 24h.
7945    pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
7946        self.freshness = Some(value);
7947        self
7948    }
7949
7950    /// Sets the retry attempts after the first request.
7951    pub fn max_retries(mut self, value: u32) -> Self {
7952        self.request_options.max_retries = Some(value);
7953        self
7954    }
7955
7956    /// Sets the timeout for each attempt.
7957    pub fn timeout(mut self, value: Duration) -> Self {
7958        self.request_options.timeout = Some(value);
7959        self
7960    }
7961
7962    pub(crate) fn query(&self) -> Result<Query, Error> {
7963        let mut query = Query::default();
7964        query.push("freshness", &self.freshness);
7965        Ok(query)
7966    }
7967}
7968
7969/// Typed result of `instagram.post.clipMetadata.get`.
7970pub type InstagramPostClipMetadataResponse = Response<InstagramClipMetadata>;
7971
7972/// Options for `instagram.post.comment.replies.list`.
7973#[derive(Clone, Debug, Default, PartialEq)]
7974#[non_exhaustive]
7975pub struct InstagramPostCommentRepliesOptions {
7976    /// Maximum accepted data age. The default is 24h.
7977    pub freshness: Option<crate::options::Freshness>,
7978    /// Opaque cursor returned by the previous page.
7979    pub cursor: Option<String>,
7980    /// Retry and timeout controls for this request.
7981    pub request_options: RequestOptions,
7982}
7983
7984impl InstagramPostCommentRepliesOptions {
7985    /// Creates options that use the API and client defaults.
7986    pub fn new() -> Self {
7987        Self::default()
7988    }
7989
7990    /// Maximum accepted data age. The default is 24h.
7991    pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
7992        self.freshness = Some(value);
7993        self
7994    }
7995
7996    /// Opaque cursor returned by the previous page.
7997    pub fn cursor(mut self, value: impl Into<String>) -> Self {
7998        self.cursor = Some(value.into());
7999        self
8000    }
8001
8002    /// Sets the retry attempts after the first request.
8003    pub fn max_retries(mut self, value: u32) -> Self {
8004        self.request_options.max_retries = Some(value);
8005        self
8006    }
8007
8008    /// Sets the timeout for each attempt.
8009    pub fn timeout(mut self, value: Duration) -> Self {
8010        self.request_options.timeout = Some(value);
8011        self
8012    }
8013
8014    pub(crate) fn query(&self) -> Result<Query, Error> {
8015        let mut query = Query::default();
8016        query.push("freshness", &self.freshness);
8017        query.push("cursor", &self.cursor);
8018        Ok(query)
8019    }
8020}
8021
8022/// One page returned by `instagram.post.comment.replies.list`.
8023pub type InstagramPostCommentRepliesPage = Page<InstagramComment>;
8024
8025/// Options for `instagram.post.commentMetadata.get`.
8026#[derive(Clone, Debug, Default, PartialEq)]
8027#[non_exhaustive]
8028pub struct InstagramPostCommentMetadataOptions {
8029    /// Maximum accepted data age. The default is 24h.
8030    pub freshness: Option<crate::options::Freshness>,
8031    /// Retry and timeout controls for this request.
8032    pub request_options: RequestOptions,
8033}
8034
8035impl InstagramPostCommentMetadataOptions {
8036    /// Creates options that use the API and client defaults.
8037    pub fn new() -> Self {
8038        Self::default()
8039    }
8040
8041    /// Maximum accepted data age. The default is 24h.
8042    pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
8043        self.freshness = Some(value);
8044        self
8045    }
8046
8047    /// Sets the retry attempts after the first request.
8048    pub fn max_retries(mut self, value: u32) -> Self {
8049        self.request_options.max_retries = Some(value);
8050        self
8051    }
8052
8053    /// Sets the timeout for each attempt.
8054    pub fn timeout(mut self, value: Duration) -> Self {
8055        self.request_options.timeout = Some(value);
8056        self
8057    }
8058
8059    pub(crate) fn query(&self) -> Result<Query, Error> {
8060        let mut query = Query::default();
8061        query.push("freshness", &self.freshness);
8062        Ok(query)
8063    }
8064}
8065
8066/// Typed result of `instagram.post.commentMetadata.get`.
8067pub type InstagramPostCommentMetadataResponse = Response<InstagramCommentMetadata>;
8068
8069/// Options for `instagram.post.commentModeration.get`.
8070#[derive(Clone, Debug, PartialEq)]
8071#[non_exhaustive]
8072pub struct InstagramPostCommentModerationOptions {
8073    /// Comment text to check.
8074    pub comment: String,
8075    /// Maximum accepted data age. The default is 24h.
8076    pub freshness: Option<crate::options::Freshness>,
8077    /// Retry and timeout controls for this request.
8078    pub request_options: RequestOptions,
8079}
8080
8081impl InstagramPostCommentModerationOptions {
8082    /// Creates options with the required values.
8083    pub fn new(comment: impl Into<String>) -> Self {
8084        Self {
8085            comment: comment.into(),
8086            freshness: None,
8087            request_options: RequestOptions::default(),
8088        }
8089    }
8090
8091    /// Maximum accepted data age. The default is 24h.
8092    pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
8093        self.freshness = Some(value);
8094        self
8095    }
8096
8097    /// Sets the retry attempts after the first request.
8098    pub fn max_retries(mut self, value: u32) -> Self {
8099        self.request_options.max_retries = Some(value);
8100        self
8101    }
8102
8103    /// Sets the timeout for each attempt.
8104    pub fn timeout(mut self, value: Duration) -> Self {
8105        self.request_options.timeout = Some(value);
8106        self
8107    }
8108
8109    pub(crate) fn query(&self) -> Result<Query, Error> {
8110        let mut query = Query::default();
8111        query.require("comment", &self.comment)?;
8112        query.push("freshness", &self.freshness);
8113        Ok(query)
8114    }
8115}
8116
8117/// Typed result of `instagram.post.commentModeration.get`.
8118pub type InstagramPostCommentModerationResponse = Response<InstagramCommentModeration>;
8119
8120/// Options for `instagram.post.comments.list`.
8121#[derive(Clone, Debug, Default, PartialEq)]
8122#[non_exhaustive]
8123pub struct InstagramPostCommentsOptions {
8124    /// Maximum accepted data age. The default is 24h.
8125    pub freshness: Option<crate::options::Freshness>,
8126    /// Opaque cursor returned by the previous page.
8127    pub cursor: Option<String>,
8128    /// Retry and timeout controls for this request.
8129    pub request_options: RequestOptions,
8130}
8131
8132impl InstagramPostCommentsOptions {
8133    /// Creates options that use the API and client defaults.
8134    pub fn new() -> Self {
8135        Self::default()
8136    }
8137
8138    /// Maximum accepted data age. The default is 24h.
8139    pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
8140        self.freshness = Some(value);
8141        self
8142    }
8143
8144    /// Opaque cursor returned by the previous page.
8145    pub fn cursor(mut self, value: impl Into<String>) -> Self {
8146        self.cursor = Some(value.into());
8147        self
8148    }
8149
8150    /// Sets the retry attempts after the first request.
8151    pub fn max_retries(mut self, value: u32) -> Self {
8152        self.request_options.max_retries = Some(value);
8153        self
8154    }
8155
8156    /// Sets the timeout for each attempt.
8157    pub fn timeout(mut self, value: Duration) -> Self {
8158        self.request_options.timeout = Some(value);
8159        self
8160    }
8161
8162    pub(crate) fn query(&self) -> Result<Query, Error> {
8163        let mut query = Query::default();
8164        query.push("freshness", &self.freshness);
8165        query.push("cursor", &self.cursor);
8166        Ok(query)
8167    }
8168}
8169
8170/// One page returned by `instagram.post.comments.list`.
8171pub type InstagramPostCommentsPage = Page<InstagramComment>;
8172
8173/// Options for `instagram.post.insights.get`.
8174#[derive(Clone, Debug, Default, PartialEq)]
8175#[non_exhaustive]
8176pub struct InstagramPostInsightsOptions {
8177    /// Maximum accepted data age. The default is 24h.
8178    pub freshness: Option<crate::options::Freshness>,
8179    /// Retry and timeout controls for this request.
8180    pub request_options: RequestOptions,
8181}
8182
8183impl InstagramPostInsightsOptions {
8184    /// Creates options that use the API and client defaults.
8185    pub fn new() -> Self {
8186        Self::default()
8187    }
8188
8189    /// Maximum accepted data age. The default is 24h.
8190    pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
8191        self.freshness = Some(value);
8192        self
8193    }
8194
8195    /// Sets the retry attempts after the first request.
8196    pub fn max_retries(mut self, value: u32) -> Self {
8197        self.request_options.max_retries = Some(value);
8198        self
8199    }
8200
8201    /// Sets the timeout for each attempt.
8202    pub fn timeout(mut self, value: Duration) -> Self {
8203        self.request_options.timeout = Some(value);
8204        self
8205    }
8206
8207    pub(crate) fn query(&self) -> Result<Query, Error> {
8208        let mut query = Query::default();
8209        query.push("freshness", &self.freshness);
8210        Ok(query)
8211    }
8212}
8213
8214/// Typed result of `instagram.post.insights.get`.
8215pub type InstagramPostInsightsResponse = Response<InstagramPostInsight>;
8216
8217/// Options for `instagram.post.likers.list`.
8218#[derive(Clone, Debug, Default, PartialEq)]
8219#[non_exhaustive]
8220pub struct InstagramPostLikersOptions {
8221    /// Maximum accepted data age. The default is 24h.
8222    pub freshness: Option<crate::options::Freshness>,
8223    /// Opaque cursor returned by the previous page.
8224    pub cursor: Option<String>,
8225    /// Retry and timeout controls for this request.
8226    pub request_options: RequestOptions,
8227}
8228
8229impl InstagramPostLikersOptions {
8230    /// Creates options that use the API and client defaults.
8231    pub fn new() -> Self {
8232        Self::default()
8233    }
8234
8235    /// Maximum accepted data age. The default is 24h.
8236    pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
8237        self.freshness = Some(value);
8238        self
8239    }
8240
8241    /// Opaque cursor returned by the previous page.
8242    pub fn cursor(mut self, value: impl Into<String>) -> Self {
8243        self.cursor = Some(value.into());
8244        self
8245    }
8246
8247    /// Sets the retry attempts after the first request.
8248    pub fn max_retries(mut self, value: u32) -> Self {
8249        self.request_options.max_retries = Some(value);
8250        self
8251    }
8252
8253    /// Sets the timeout for each attempt.
8254    pub fn timeout(mut self, value: Duration) -> Self {
8255        self.request_options.timeout = Some(value);
8256        self
8257    }
8258
8259    pub(crate) fn query(&self) -> Result<Query, Error> {
8260        let mut query = Query::default();
8261        query.push("freshness", &self.freshness);
8262        query.push("cursor", &self.cursor);
8263        Ok(query)
8264    }
8265}
8266
8267/// One page returned by `instagram.post.likers.list`.
8268pub type InstagramPostLikersPage = Page<InstagramProfile>;
8269
8270/// Options for `instagram.post.oembed.get`.
8271#[derive(Clone, Debug, Default, PartialEq)]
8272#[non_exhaustive]
8273pub struct InstagramPostOEmbedOptions {
8274    /// Maximum accepted data age. The default is 24h.
8275    pub freshness: Option<crate::options::Freshness>,
8276    /// Retry and timeout controls for this request.
8277    pub request_options: RequestOptions,
8278}
8279
8280impl InstagramPostOEmbedOptions {
8281    /// Creates options that use the API and client defaults.
8282    pub fn new() -> Self {
8283        Self::default()
8284    }
8285
8286    /// Maximum accepted data age. The default is 24h.
8287    pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
8288        self.freshness = Some(value);
8289        self
8290    }
8291
8292    /// Sets the retry attempts after the first request.
8293    pub fn max_retries(mut self, value: u32) -> Self {
8294        self.request_options.max_retries = Some(value);
8295        self
8296    }
8297
8298    /// Sets the timeout for each attempt.
8299    pub fn timeout(mut self, value: Duration) -> Self {
8300        self.request_options.timeout = Some(value);
8301        self
8302    }
8303
8304    pub(crate) fn query(&self) -> Result<Query, Error> {
8305        let mut query = Query::default();
8306        query.push("freshness", &self.freshness);
8307        Ok(query)
8308    }
8309}
8310
8311/// Typed result of `instagram.post.oembed.get`.
8312pub type InstagramPostOEmbedResponse = Response<InstagramOEmbed>;
8313
8314/// Options for `instagram.post.taggedUsers.list`.
8315#[derive(Clone, Debug, Default, PartialEq)]
8316#[non_exhaustive]
8317pub struct InstagramPostTaggedUsersOptions {
8318    /// Maximum accepted data age. The default is 24h.
8319    pub freshness: Option<crate::options::Freshness>,
8320    /// Opaque cursor returned by the previous page.
8321    pub cursor: Option<String>,
8322    /// Retry and timeout controls for this request.
8323    pub request_options: RequestOptions,
8324}
8325
8326impl InstagramPostTaggedUsersOptions {
8327    /// Creates options that use the API and client defaults.
8328    pub fn new() -> Self {
8329        Self::default()
8330    }
8331
8332    /// Maximum accepted data age. The default is 24h.
8333    pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
8334        self.freshness = Some(value);
8335        self
8336    }
8337
8338    /// Opaque cursor returned by the previous page.
8339    pub fn cursor(mut self, value: impl Into<String>) -> Self {
8340        self.cursor = Some(value.into());
8341        self
8342    }
8343
8344    /// Sets the retry attempts after the first request.
8345    pub fn max_retries(mut self, value: u32) -> Self {
8346        self.request_options.max_retries = Some(value);
8347        self
8348    }
8349
8350    /// Sets the timeout for each attempt.
8351    pub fn timeout(mut self, value: Duration) -> Self {
8352        self.request_options.timeout = Some(value);
8353        self
8354    }
8355
8356    pub(crate) fn query(&self) -> Result<Query, Error> {
8357        let mut query = Query::default();
8358        query.push("freshness", &self.freshness);
8359        query.push("cursor", &self.cursor);
8360        Ok(query)
8361    }
8362}
8363
8364/// One page returned by `instagram.post.taggedUsers.list`.
8365pub type InstagramPostTaggedUsersPage = Page<InstagramUserTag>;
8366
8367/// Options for `instagram.post.template.get`.
8368#[derive(Clone, Debug, Default, PartialEq)]
8369#[non_exhaustive]
8370pub struct InstagramPostTemplateOptions {
8371    /// Maximum accepted data age. The default is 24h.
8372    pub freshness: Option<crate::options::Freshness>,
8373    /// Retry and timeout controls for this request.
8374    pub request_options: RequestOptions,
8375}
8376
8377impl InstagramPostTemplateOptions {
8378    /// Creates options that use the API and client defaults.
8379    pub fn new() -> Self {
8380        Self::default()
8381    }
8382
8383    /// Maximum accepted data age. The default is 24h.
8384    pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
8385        self.freshness = Some(value);
8386        self
8387    }
8388
8389    /// Sets the retry attempts after the first request.
8390    pub fn max_retries(mut self, value: u32) -> Self {
8391        self.request_options.max_retries = Some(value);
8392        self
8393    }
8394
8395    /// Sets the timeout for each attempt.
8396    pub fn timeout(mut self, value: Duration) -> Self {
8397        self.request_options.timeout = Some(value);
8398        self
8399    }
8400
8401    pub(crate) fn query(&self) -> Result<Query, Error> {
8402        let mut query = Query::default();
8403        query.push("freshness", &self.freshness);
8404        Ok(query)
8405    }
8406}
8407
8408/// Typed result of `instagram.post.template.get`.
8409pub type InstagramPostTemplateResponse = Response<InstagramTemplate>;
8410
8411/// Options for `instagram.profile.get`.
8412#[derive(Clone, Debug, Default, PartialEq)]
8413#[non_exhaustive]
8414pub struct InstagramProfileOptions {
8415    /// Maximum accepted data age. The default is 24h.
8416    pub freshness: Option<crate::options::Freshness>,
8417    /// Retry and timeout controls for this request.
8418    pub request_options: RequestOptions,
8419}
8420
8421impl InstagramProfileOptions {
8422    /// Creates options that use the API and client defaults.
8423    pub fn new() -> Self {
8424        Self::default()
8425    }
8426
8427    /// Maximum accepted data age. The default is 24h.
8428    pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
8429        self.freshness = Some(value);
8430        self
8431    }
8432
8433    /// Sets the retry attempts after the first request.
8434    pub fn max_retries(mut self, value: u32) -> Self {
8435        self.request_options.max_retries = Some(value);
8436        self
8437    }
8438
8439    /// Sets the timeout for each attempt.
8440    pub fn timeout(mut self, value: Duration) -> Self {
8441        self.request_options.timeout = Some(value);
8442        self
8443    }
8444
8445    pub(crate) fn query(&self) -> Result<Query, Error> {
8446        let mut query = Query::default();
8447        query.push("freshness", &self.freshness);
8448        Ok(query)
8449    }
8450}
8451
8452/// Typed result of `instagram.profile.get`.
8453pub type InstagramProfileResponse = Response<InstagramProfile>;
8454
8455/// Options for `instagram.profile.about.get`.
8456#[derive(Clone, Debug, Default, PartialEq)]
8457#[non_exhaustive]
8458pub struct InstagramProfileAboutOptions {
8459    /// Maximum accepted data age. The default is 24h.
8460    pub freshness: Option<crate::options::Freshness>,
8461    /// Retry and timeout controls for this request.
8462    pub request_options: RequestOptions,
8463}
8464
8465impl InstagramProfileAboutOptions {
8466    /// Creates options that use the API and client defaults.
8467    pub fn new() -> Self {
8468        Self::default()
8469    }
8470
8471    /// Maximum accepted data age. The default is 24h.
8472    pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
8473        self.freshness = Some(value);
8474        self
8475    }
8476
8477    /// Sets the retry attempts after the first request.
8478    pub fn max_retries(mut self, value: u32) -> Self {
8479        self.request_options.max_retries = Some(value);
8480        self
8481    }
8482
8483    /// Sets the timeout for each attempt.
8484    pub fn timeout(mut self, value: Duration) -> Self {
8485        self.request_options.timeout = Some(value);
8486        self
8487    }
8488
8489    pub(crate) fn query(&self) -> Result<Query, Error> {
8490        let mut query = Query::default();
8491        query.push("freshness", &self.freshness);
8492        Ok(query)
8493    }
8494}
8495
8496/// Typed result of `instagram.profile.about.get`.
8497pub type InstagramProfileAboutResponse = Response<InstagramProfileAbout>;
8498
8499/// Options for `instagram.profile.businessRecommendations.list`.
8500#[derive(Clone, Debug, Default, PartialEq)]
8501#[non_exhaustive]
8502pub struct InstagramProfileBusinessRecommendationsOptions {
8503    /// Maximum accepted data age. The default is 24h.
8504    pub freshness: Option<crate::options::Freshness>,
8505    /// Opaque cursor returned by the previous page.
8506    pub cursor: Option<String>,
8507    /// Retry and timeout controls for this request.
8508    pub request_options: RequestOptions,
8509}
8510
8511impl InstagramProfileBusinessRecommendationsOptions {
8512    /// Creates options that use the API and client defaults.
8513    pub fn new() -> Self {
8514        Self::default()
8515    }
8516
8517    /// Maximum accepted data age. The default is 24h.
8518    pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
8519        self.freshness = Some(value);
8520        self
8521    }
8522
8523    /// Opaque cursor returned by the previous page.
8524    pub fn cursor(mut self, value: impl Into<String>) -> Self {
8525        self.cursor = Some(value.into());
8526        self
8527    }
8528
8529    /// Sets the retry attempts after the first request.
8530    pub fn max_retries(mut self, value: u32) -> Self {
8531        self.request_options.max_retries = Some(value);
8532        self
8533    }
8534
8535    /// Sets the timeout for each attempt.
8536    pub fn timeout(mut self, value: Duration) -> Self {
8537        self.request_options.timeout = Some(value);
8538        self
8539    }
8540
8541    pub(crate) fn query(&self) -> Result<Query, Error> {
8542        let mut query = Query::default();
8543        query.push("freshness", &self.freshness);
8544        query.push("cursor", &self.cursor);
8545        Ok(query)
8546    }
8547}
8548
8549/// One page returned by `instagram.profile.businessRecommendations.list`.
8550pub type InstagramProfileBusinessRecommendationsPage = Page<InstagramProfileSummary>;
8551
8552/// Options for `instagram.profile.followers.list`.
8553#[derive(Clone, Debug, Default, PartialEq)]
8554#[non_exhaustive]
8555pub struct InstagramProfileFollowersOptions {
8556    /// Maximum accepted data age. The default is 24h.
8557    pub freshness: Option<crate::options::Freshness>,
8558    /// Opaque cursor returned by the previous page.
8559    pub cursor: Option<String>,
8560    /// Retry and timeout controls for this request.
8561    pub request_options: RequestOptions,
8562}
8563
8564impl InstagramProfileFollowersOptions {
8565    /// Creates options that use the API and client defaults.
8566    pub fn new() -> Self {
8567        Self::default()
8568    }
8569
8570    /// Maximum accepted data age. The default is 24h.
8571    pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
8572        self.freshness = Some(value);
8573        self
8574    }
8575
8576    /// Opaque cursor returned by the previous page.
8577    pub fn cursor(mut self, value: impl Into<String>) -> Self {
8578        self.cursor = Some(value.into());
8579        self
8580    }
8581
8582    /// Sets the retry attempts after the first request.
8583    pub fn max_retries(mut self, value: u32) -> Self {
8584        self.request_options.max_retries = Some(value);
8585        self
8586    }
8587
8588    /// Sets the timeout for each attempt.
8589    pub fn timeout(mut self, value: Duration) -> Self {
8590        self.request_options.timeout = Some(value);
8591        self
8592    }
8593
8594    pub(crate) fn query(&self) -> Result<Query, Error> {
8595        let mut query = Query::default();
8596        query.push("freshness", &self.freshness);
8597        query.push("cursor", &self.cursor);
8598        Ok(query)
8599    }
8600}
8601
8602/// One page returned by `instagram.profile.followers.list`.
8603pub type InstagramProfileFollowersPage = Page<InstagramProfile>;
8604
8605/// Options for `instagram.profile.followers.search`.
8606#[derive(Clone, Debug, PartialEq)]
8607#[non_exhaustive]
8608pub struct InstagramProfileFollowersSearchOptions {
8609    /// Public search query.
8610    pub q: String,
8611    /// Maximum accepted data age. The default is 24h.
8612    pub freshness: Option<crate::options::Freshness>,
8613    /// Opaque cursor returned by the previous page.
8614    pub cursor: Option<String>,
8615    /// Retry and timeout controls for this request.
8616    pub request_options: RequestOptions,
8617}
8618
8619impl InstagramProfileFollowersSearchOptions {
8620    /// Creates options with the required values.
8621    pub fn new(q: impl Into<String>) -> Self {
8622        Self {
8623            q: q.into(),
8624            freshness: None,
8625            cursor: None,
8626            request_options: RequestOptions::default(),
8627        }
8628    }
8629
8630    /// Maximum accepted data age. The default is 24h.
8631    pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
8632        self.freshness = Some(value);
8633        self
8634    }
8635
8636    /// Opaque cursor returned by the previous page.
8637    pub fn cursor(mut self, value: impl Into<String>) -> Self {
8638        self.cursor = Some(value.into());
8639        self
8640    }
8641
8642    /// Sets the retry attempts after the first request.
8643    pub fn max_retries(mut self, value: u32) -> Self {
8644        self.request_options.max_retries = Some(value);
8645        self
8646    }
8647
8648    /// Sets the timeout for each attempt.
8649    pub fn timeout(mut self, value: Duration) -> Self {
8650        self.request_options.timeout = Some(value);
8651        self
8652    }
8653
8654    pub(crate) fn query(&self) -> Result<Query, Error> {
8655        let mut query = Query::default();
8656        query.require("q", &self.q)?;
8657        query.push("freshness", &self.freshness);
8658        query.push("cursor", &self.cursor);
8659        Ok(query)
8660    }
8661}
8662
8663/// One page returned by `instagram.profile.followers.search`.
8664pub type InstagramProfileFollowersSearchPage = Page<InstagramProfile>;
8665
8666/// Options for `instagram.profile.following.list`.
8667#[derive(Clone, Debug, Default, PartialEq)]
8668#[non_exhaustive]
8669pub struct InstagramProfileFollowingOptions {
8670    /// Maximum accepted data age. The default is 24h.
8671    pub freshness: Option<crate::options::Freshness>,
8672    /// Opaque cursor returned by the previous page.
8673    pub cursor: Option<String>,
8674    /// Retry and timeout controls for this request.
8675    pub request_options: RequestOptions,
8676}
8677
8678impl InstagramProfileFollowingOptions {
8679    /// Creates options that use the API and client defaults.
8680    pub fn new() -> Self {
8681        Self::default()
8682    }
8683
8684    /// Maximum accepted data age. The default is 24h.
8685    pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
8686        self.freshness = Some(value);
8687        self
8688    }
8689
8690    /// Opaque cursor returned by the previous page.
8691    pub fn cursor(mut self, value: impl Into<String>) -> Self {
8692        self.cursor = Some(value.into());
8693        self
8694    }
8695
8696    /// Sets the retry attempts after the first request.
8697    pub fn max_retries(mut self, value: u32) -> Self {
8698        self.request_options.max_retries = Some(value);
8699        self
8700    }
8701
8702    /// Sets the timeout for each attempt.
8703    pub fn timeout(mut self, value: Duration) -> Self {
8704        self.request_options.timeout = Some(value);
8705        self
8706    }
8707
8708    pub(crate) fn query(&self) -> Result<Query, Error> {
8709        let mut query = Query::default();
8710        query.push("freshness", &self.freshness);
8711        query.push("cursor", &self.cursor);
8712        Ok(query)
8713    }
8714}
8715
8716/// One page returned by `instagram.profile.following.list`.
8717pub type InstagramProfileFollowingPage = Page<InstagramProfile>;
8718
8719/// Options for `instagram.profile.following.search`.
8720#[derive(Clone, Debug, PartialEq)]
8721#[non_exhaustive]
8722pub struct InstagramProfileFollowingSearchOptions {
8723    /// Public search query.
8724    pub q: String,
8725    /// Maximum accepted data age. The default is 24h.
8726    pub freshness: Option<crate::options::Freshness>,
8727    /// Opaque cursor returned by the previous page.
8728    pub cursor: Option<String>,
8729    /// Retry and timeout controls for this request.
8730    pub request_options: RequestOptions,
8731}
8732
8733impl InstagramProfileFollowingSearchOptions {
8734    /// Creates options with the required values.
8735    pub fn new(q: impl Into<String>) -> Self {
8736        Self {
8737            q: q.into(),
8738            freshness: None,
8739            cursor: None,
8740            request_options: RequestOptions::default(),
8741        }
8742    }
8743
8744    /// Maximum accepted data age. The default is 24h.
8745    pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
8746        self.freshness = Some(value);
8747        self
8748    }
8749
8750    /// Opaque cursor returned by the previous page.
8751    pub fn cursor(mut self, value: impl Into<String>) -> Self {
8752        self.cursor = Some(value.into());
8753        self
8754    }
8755
8756    /// Sets the retry attempts after the first request.
8757    pub fn max_retries(mut self, value: u32) -> Self {
8758        self.request_options.max_retries = Some(value);
8759        self
8760    }
8761
8762    /// Sets the timeout for each attempt.
8763    pub fn timeout(mut self, value: Duration) -> Self {
8764        self.request_options.timeout = Some(value);
8765        self
8766    }
8767
8768    pub(crate) fn query(&self) -> Result<Query, Error> {
8769        let mut query = Query::default();
8770        query.require("q", &self.q)?;
8771        query.push("freshness", &self.freshness);
8772        query.push("cursor", &self.cursor);
8773        Ok(query)
8774    }
8775}
8776
8777/// One page returned by `instagram.profile.following.search`.
8778pub type InstagramProfileFollowingSearchPage = Page<InstagramProfile>;
8779
8780/// Options for `instagram.profile.highlights.list`.
8781#[derive(Clone, Debug, Default, PartialEq)]
8782#[non_exhaustive]
8783pub struct InstagramProfileHighlightsOptions {
8784    /// Maximum accepted data age. The default is 24h.
8785    pub freshness: Option<crate::options::Freshness>,
8786    /// Opaque cursor returned by the previous page.
8787    pub cursor: Option<String>,
8788    /// Retry and timeout controls for this request.
8789    pub request_options: RequestOptions,
8790}
8791
8792impl InstagramProfileHighlightsOptions {
8793    /// Creates options that use the API and client defaults.
8794    pub fn new() -> Self {
8795        Self::default()
8796    }
8797
8798    /// Maximum accepted data age. The default is 24h.
8799    pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
8800        self.freshness = Some(value);
8801        self
8802    }
8803
8804    /// Opaque cursor returned by the previous page.
8805    pub fn cursor(mut self, value: impl Into<String>) -> Self {
8806        self.cursor = Some(value.into());
8807        self
8808    }
8809
8810    /// Sets the retry attempts after the first request.
8811    pub fn max_retries(mut self, value: u32) -> Self {
8812        self.request_options.max_retries = Some(value);
8813        self
8814    }
8815
8816    /// Sets the timeout for each attempt.
8817    pub fn timeout(mut self, value: Duration) -> Self {
8818        self.request_options.timeout = Some(value);
8819        self
8820    }
8821
8822    pub(crate) fn query(&self) -> Result<Query, Error> {
8823        let mut query = Query::default();
8824        query.push("freshness", &self.freshness);
8825        query.push("cursor", &self.cursor);
8826        Ok(query)
8827    }
8828}
8829
8830/// One page returned by `instagram.profile.highlights.list`.
8831pub type InstagramProfileHighlightsPage = Page<InstagramHighlight>;
8832
8833/// Options for `instagram.profile.pinnedPosts.list`.
8834#[derive(Clone, Debug, Default, PartialEq)]
8835#[non_exhaustive]
8836pub struct InstagramProfilePinnedPostsOptions {
8837    /// Maximum accepted data age. The default is 24h.
8838    pub freshness: Option<crate::options::Freshness>,
8839    /// Opaque cursor returned by the previous page.
8840    pub cursor: Option<String>,
8841    /// Retry and timeout controls for this request.
8842    pub request_options: RequestOptions,
8843}
8844
8845impl InstagramProfilePinnedPostsOptions {
8846    /// Creates options that use the API and client defaults.
8847    pub fn new() -> Self {
8848        Self::default()
8849    }
8850
8851    /// Maximum accepted data age. The default is 24h.
8852    pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
8853        self.freshness = Some(value);
8854        self
8855    }
8856
8857    /// Opaque cursor returned by the previous page.
8858    pub fn cursor(mut self, value: impl Into<String>) -> Self {
8859        self.cursor = Some(value.into());
8860        self
8861    }
8862
8863    /// Sets the retry attempts after the first request.
8864    pub fn max_retries(mut self, value: u32) -> Self {
8865        self.request_options.max_retries = Some(value);
8866        self
8867    }
8868
8869    /// Sets the timeout for each attempt.
8870    pub fn timeout(mut self, value: Duration) -> Self {
8871        self.request_options.timeout = Some(value);
8872        self
8873    }
8874
8875    pub(crate) fn query(&self) -> Result<Query, Error> {
8876        let mut query = Query::default();
8877        query.push("freshness", &self.freshness);
8878        query.push("cursor", &self.cursor);
8879        Ok(query)
8880    }
8881}
8882
8883/// One page returned by `instagram.profile.pinnedPosts.list`.
8884pub type InstagramProfilePinnedPostsPage = Page<InstagramPost>;
8885
8886/// Options for `instagram.profile.posts.list`.
8887#[derive(Clone, Debug, Default, PartialEq)]
8888#[non_exhaustive]
8889pub struct InstagramProfilePostsOptions {
8890    /// Maximum accepted data age. The default is 24h.
8891    pub freshness: Option<crate::options::Freshness>,
8892    /// Opaque cursor returned by the previous page.
8893    pub cursor: Option<String>,
8894    /// Return posts captured at or after this RFC 3339 timestamp.
8895    pub since: Option<chrono::DateTime<chrono::Utc>>,
8896    /// Retry and timeout controls for this request.
8897    pub request_options: RequestOptions,
8898}
8899
8900impl InstagramProfilePostsOptions {
8901    /// Creates options that use the API and client defaults.
8902    pub fn new() -> Self {
8903        Self::default()
8904    }
8905
8906    /// Maximum accepted data age. The default is 24h.
8907    pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
8908        self.freshness = Some(value);
8909        self
8910    }
8911
8912    /// Opaque cursor returned by the previous page.
8913    pub fn cursor(mut self, value: impl Into<String>) -> Self {
8914        self.cursor = Some(value.into());
8915        self
8916    }
8917
8918    /// Return posts captured at or after this RFC 3339 timestamp.
8919    pub fn since(mut self, value: chrono::DateTime<chrono::Utc>) -> Self {
8920        self.since = Some(value);
8921        self
8922    }
8923
8924    /// Sets the retry attempts after the first request.
8925    pub fn max_retries(mut self, value: u32) -> Self {
8926        self.request_options.max_retries = Some(value);
8927        self
8928    }
8929
8930    /// Sets the timeout for each attempt.
8931    pub fn timeout(mut self, value: Duration) -> Self {
8932        self.request_options.timeout = Some(value);
8933        self
8934    }
8935
8936    pub(crate) fn query(&self) -> Result<Query, Error> {
8937        let mut query = Query::default();
8938        query.push("freshness", &self.freshness);
8939        query.push("cursor", &self.cursor);
8940        query.push("since", &self.since);
8941        Ok(query)
8942    }
8943}
8944
8945/// One page returned by `instagram.profile.posts.list`.
8946pub type InstagramProfilePostsPage = Page<InstagramPost>;
8947
8948/// Options for `instagram.profile.reels.list`.
8949#[derive(Clone, Debug, Default, PartialEq)]
8950#[non_exhaustive]
8951pub struct InstagramProfileReelsOptions {
8952    /// Maximum accepted data age. The default is 24h.
8953    pub freshness: Option<crate::options::Freshness>,
8954    /// Opaque cursor returned by the previous page.
8955    pub cursor: Option<String>,
8956    /// Retry and timeout controls for this request.
8957    pub request_options: RequestOptions,
8958}
8959
8960impl InstagramProfileReelsOptions {
8961    /// Creates options that use the API and client defaults.
8962    pub fn new() -> Self {
8963        Self::default()
8964    }
8965
8966    /// Maximum accepted data age. The default is 24h.
8967    pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
8968        self.freshness = Some(value);
8969        self
8970    }
8971
8972    /// Opaque cursor returned by the previous page.
8973    pub fn cursor(mut self, value: impl Into<String>) -> Self {
8974        self.cursor = Some(value.into());
8975        self
8976    }
8977
8978    /// Sets the retry attempts after the first request.
8979    pub fn max_retries(mut self, value: u32) -> Self {
8980        self.request_options.max_retries = Some(value);
8981        self
8982    }
8983
8984    /// Sets the timeout for each attempt.
8985    pub fn timeout(mut self, value: Duration) -> Self {
8986        self.request_options.timeout = Some(value);
8987        self
8988    }
8989
8990    pub(crate) fn query(&self) -> Result<Query, Error> {
8991        let mut query = Query::default();
8992        query.push("freshness", &self.freshness);
8993        query.push("cursor", &self.cursor);
8994        Ok(query)
8995    }
8996}
8997
8998/// One page returned by `instagram.profile.reels.list`.
8999pub type InstagramProfileReelsPage = Page<InstagramPost>;
9000
9001/// Options for `instagram.profile.reposts.list`.
9002#[derive(Clone, Debug, Default, PartialEq)]
9003#[non_exhaustive]
9004pub struct InstagramProfileRepostsOptions {
9005    /// Maximum accepted data age. The default is 24h.
9006    pub freshness: Option<crate::options::Freshness>,
9007    /// Opaque cursor returned by the previous page.
9008    pub cursor: Option<String>,
9009    /// Retry and timeout controls for this request.
9010    pub request_options: RequestOptions,
9011}
9012
9013impl InstagramProfileRepostsOptions {
9014    /// Creates options that use the API and client defaults.
9015    pub fn new() -> Self {
9016        Self::default()
9017    }
9018
9019    /// Maximum accepted data age. The default is 24h.
9020    pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
9021        self.freshness = Some(value);
9022        self
9023    }
9024
9025    /// Opaque cursor returned by the previous page.
9026    pub fn cursor(mut self, value: impl Into<String>) -> Self {
9027        self.cursor = Some(value.into());
9028        self
9029    }
9030
9031    /// Sets the retry attempts after the first request.
9032    pub fn max_retries(mut self, value: u32) -> Self {
9033        self.request_options.max_retries = Some(value);
9034        self
9035    }
9036
9037    /// Sets the timeout for each attempt.
9038    pub fn timeout(mut self, value: Duration) -> Self {
9039        self.request_options.timeout = Some(value);
9040        self
9041    }
9042
9043    pub(crate) fn query(&self) -> Result<Query, Error> {
9044        let mut query = Query::default();
9045        query.push("freshness", &self.freshness);
9046        query.push("cursor", &self.cursor);
9047        Ok(query)
9048    }
9049}
9050
9051/// One page returned by `instagram.profile.reposts.list`.
9052pub type InstagramProfileRepostsPage = Page<InstagramPost>;
9053
9054/// Options for `instagram.profile.stories.list`.
9055#[derive(Clone, Debug, Default, PartialEq)]
9056#[non_exhaustive]
9057pub struct InstagramProfileStoriesOptions {
9058    /// Maximum accepted data age. The default is 24h.
9059    pub freshness: Option<crate::options::Freshness>,
9060    /// Opaque cursor returned by the previous page.
9061    pub cursor: Option<String>,
9062    /// Retry and timeout controls for this request.
9063    pub request_options: RequestOptions,
9064}
9065
9066impl InstagramProfileStoriesOptions {
9067    /// Creates options that use the API and client defaults.
9068    pub fn new() -> Self {
9069        Self::default()
9070    }
9071
9072    /// Maximum accepted data age. The default is 24h.
9073    pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
9074        self.freshness = Some(value);
9075        self
9076    }
9077
9078    /// Opaque cursor returned by the previous page.
9079    pub fn cursor(mut self, value: impl Into<String>) -> Self {
9080        self.cursor = Some(value.into());
9081        self
9082    }
9083
9084    /// Sets the retry attempts after the first request.
9085    pub fn max_retries(mut self, value: u32) -> Self {
9086        self.request_options.max_retries = Some(value);
9087        self
9088    }
9089
9090    /// Sets the timeout for each attempt.
9091    pub fn timeout(mut self, value: Duration) -> Self {
9092        self.request_options.timeout = Some(value);
9093        self
9094    }
9095
9096    pub(crate) fn query(&self) -> Result<Query, Error> {
9097        let mut query = Query::default();
9098        query.push("freshness", &self.freshness);
9099        query.push("cursor", &self.cursor);
9100        Ok(query)
9101    }
9102}
9103
9104/// One page returned by `instagram.profile.stories.list`.
9105pub type InstagramProfileStoriesPage = Page<InstagramStory>;
9106
9107/// Options for `instagram.profile.suggested.list`.
9108#[derive(Clone, Debug, Default, PartialEq)]
9109#[non_exhaustive]
9110pub struct InstagramProfileSuggestedOptions {
9111    /// Maximum accepted data age. The default is 24h.
9112    pub freshness: Option<crate::options::Freshness>,
9113    /// Opaque cursor returned by the previous page.
9114    pub cursor: Option<String>,
9115    /// Retry and timeout controls for this request.
9116    pub request_options: RequestOptions,
9117}
9118
9119impl InstagramProfileSuggestedOptions {
9120    /// Creates options that use the API and client defaults.
9121    pub fn new() -> Self {
9122        Self::default()
9123    }
9124
9125    /// Maximum accepted data age. The default is 24h.
9126    pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
9127        self.freshness = Some(value);
9128        self
9129    }
9130
9131    /// Opaque cursor returned by the previous page.
9132    pub fn cursor(mut self, value: impl Into<String>) -> Self {
9133        self.cursor = Some(value.into());
9134        self
9135    }
9136
9137    /// Sets the retry attempts after the first request.
9138    pub fn max_retries(mut self, value: u32) -> Self {
9139        self.request_options.max_retries = Some(value);
9140        self
9141    }
9142
9143    /// Sets the timeout for each attempt.
9144    pub fn timeout(mut self, value: Duration) -> Self {
9145        self.request_options.timeout = Some(value);
9146        self
9147    }
9148
9149    pub(crate) fn query(&self) -> Result<Query, Error> {
9150        let mut query = Query::default();
9151        query.push("freshness", &self.freshness);
9152        query.push("cursor", &self.cursor);
9153        Ok(query)
9154    }
9155}
9156
9157/// One page returned by `instagram.profile.suggested.list`.
9158pub type InstagramProfileSuggestedPage = Page<InstagramProfile>;
9159
9160/// Options for `instagram.profile.taggedPosts.list`.
9161#[derive(Clone, Debug, Default, PartialEq)]
9162#[non_exhaustive]
9163pub struct InstagramProfileTaggedPostsOptions {
9164    /// Maximum accepted data age. The default is 24h.
9165    pub freshness: Option<crate::options::Freshness>,
9166    /// Opaque cursor returned by the previous page.
9167    pub cursor: Option<String>,
9168    /// Retry and timeout controls for this request.
9169    pub request_options: RequestOptions,
9170}
9171
9172impl InstagramProfileTaggedPostsOptions {
9173    /// Creates options that use the API and client defaults.
9174    pub fn new() -> Self {
9175        Self::default()
9176    }
9177
9178    /// Maximum accepted data age. The default is 24h.
9179    pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
9180        self.freshness = Some(value);
9181        self
9182    }
9183
9184    /// Opaque cursor returned by the previous page.
9185    pub fn cursor(mut self, value: impl Into<String>) -> Self {
9186        self.cursor = Some(value.into());
9187        self
9188    }
9189
9190    /// Sets the retry attempts after the first request.
9191    pub fn max_retries(mut self, value: u32) -> Self {
9192        self.request_options.max_retries = Some(value);
9193        self
9194    }
9195
9196    /// Sets the timeout for each attempt.
9197    pub fn timeout(mut self, value: Duration) -> Self {
9198        self.request_options.timeout = Some(value);
9199        self
9200    }
9201
9202    pub(crate) fn query(&self) -> Result<Query, Error> {
9203        let mut query = Query::default();
9204        query.push("freshness", &self.freshness);
9205        query.push("cursor", &self.cursor);
9206        Ok(query)
9207    }
9208}
9209
9210/// One page returned by `instagram.profile.taggedPosts.list`.
9211pub type InstagramProfileTaggedPostsPage = Page<InstagramPost>;
9212
9213/// Options for `instagram.profile.videos.list`.
9214#[derive(Clone, Debug, Default, PartialEq)]
9215#[non_exhaustive]
9216pub struct InstagramProfileVideosOptions {
9217    /// Maximum accepted data age. The default is 24h.
9218    pub freshness: Option<crate::options::Freshness>,
9219    /// Opaque cursor returned by the previous page.
9220    pub cursor: Option<String>,
9221    /// Retry and timeout controls for this request.
9222    pub request_options: RequestOptions,
9223}
9224
9225impl InstagramProfileVideosOptions {
9226    /// Creates options that use the API and client defaults.
9227    pub fn new() -> Self {
9228        Self::default()
9229    }
9230
9231    /// Maximum accepted data age. The default is 24h.
9232    pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
9233        self.freshness = Some(value);
9234        self
9235    }
9236
9237    /// Opaque cursor returned by the previous page.
9238    pub fn cursor(mut self, value: impl Into<String>) -> Self {
9239        self.cursor = Some(value.into());
9240        self
9241    }
9242
9243    /// Sets the retry attempts after the first request.
9244    pub fn max_retries(mut self, value: u32) -> Self {
9245        self.request_options.max_retries = Some(value);
9246        self
9247    }
9248
9249    /// Sets the timeout for each attempt.
9250    pub fn timeout(mut self, value: Duration) -> Self {
9251        self.request_options.timeout = Some(value);
9252        self
9253    }
9254
9255    pub(crate) fn query(&self) -> Result<Query, Error> {
9256        let mut query = Query::default();
9257        query.push("freshness", &self.freshness);
9258        query.push("cursor", &self.cursor);
9259        Ok(query)
9260    }
9261}
9262
9263/// One page returned by `instagram.profile.videos.list`.
9264pub type InstagramProfileVideosPage = Page<InstagramPost>;
9265
9266/// Options for `instagram.search.hashtags.list`.
9267#[derive(Clone, Debug, PartialEq)]
9268#[non_exhaustive]
9269pub struct InstagramSearchHashtagsOptions {
9270    /// Public search query.
9271    pub q: String,
9272    /// Maximum accepted data age. The default is 24h.
9273    pub freshness: Option<crate::options::Freshness>,
9274    /// Opaque cursor returned by the previous page.
9275    pub cursor: Option<String>,
9276    /// Retry and timeout controls for this request.
9277    pub request_options: RequestOptions,
9278}
9279
9280impl InstagramSearchHashtagsOptions {
9281    /// Creates options with the required values.
9282    pub fn new(q: impl Into<String>) -> Self {
9283        Self {
9284            q: q.into(),
9285            freshness: None,
9286            cursor: None,
9287            request_options: RequestOptions::default(),
9288        }
9289    }
9290
9291    /// Maximum accepted data age. The default is 24h.
9292    pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
9293        self.freshness = Some(value);
9294        self
9295    }
9296
9297    /// Opaque cursor returned by the previous page.
9298    pub fn cursor(mut self, value: impl Into<String>) -> Self {
9299        self.cursor = Some(value.into());
9300        self
9301    }
9302
9303    /// Sets the retry attempts after the first request.
9304    pub fn max_retries(mut self, value: u32) -> Self {
9305        self.request_options.max_retries = Some(value);
9306        self
9307    }
9308
9309    /// Sets the timeout for each attempt.
9310    pub fn timeout(mut self, value: Duration) -> Self {
9311        self.request_options.timeout = Some(value);
9312        self
9313    }
9314
9315    pub(crate) fn query(&self) -> Result<Query, Error> {
9316        let mut query = Query::default();
9317        query.require("q", &self.q)?;
9318        query.push("freshness", &self.freshness);
9319        query.push("cursor", &self.cursor);
9320        Ok(query)
9321    }
9322}
9323
9324/// One page returned by `instagram.search.hashtags.list`.
9325pub type InstagramSearchHashtagsPage = Page<InstagramHashtag>;
9326
9327/// Options for `instagram.search.music.list`.
9328#[derive(Clone, Debug, PartialEq)]
9329#[non_exhaustive]
9330pub struct InstagramSearchMusicOptions {
9331    /// Public search query.
9332    pub q: String,
9333    /// Maximum accepted data age. The default is 24h.
9334    pub freshness: Option<crate::options::Freshness>,
9335    /// Opaque cursor returned by the previous page.
9336    pub cursor: Option<String>,
9337    /// Retry and timeout controls for this request.
9338    pub request_options: RequestOptions,
9339}
9340
9341impl InstagramSearchMusicOptions {
9342    /// Creates options with the required values.
9343    pub fn new(q: impl Into<String>) -> Self {
9344        Self {
9345            q: q.into(),
9346            freshness: None,
9347            cursor: None,
9348            request_options: RequestOptions::default(),
9349        }
9350    }
9351
9352    /// Maximum accepted data age. The default is 24h.
9353    pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
9354        self.freshness = Some(value);
9355        self
9356    }
9357
9358    /// Opaque cursor returned by the previous page.
9359    pub fn cursor(mut self, value: impl Into<String>) -> Self {
9360        self.cursor = Some(value.into());
9361        self
9362    }
9363
9364    /// Sets the retry attempts after the first request.
9365    pub fn max_retries(mut self, value: u32) -> Self {
9366        self.request_options.max_retries = Some(value);
9367        self
9368    }
9369
9370    /// Sets the timeout for each attempt.
9371    pub fn timeout(mut self, value: Duration) -> Self {
9372        self.request_options.timeout = Some(value);
9373        self
9374    }
9375
9376    pub(crate) fn query(&self) -> Result<Query, Error> {
9377        let mut query = Query::default();
9378        query.require("q", &self.q)?;
9379        query.push("freshness", &self.freshness);
9380        query.push("cursor", &self.cursor);
9381        Ok(query)
9382    }
9383}
9384
9385/// One page returned by `instagram.search.music.list`.
9386pub type InstagramSearchMusicPage = Page<InstagramMusic>;
9387
9388/// Options for `instagram.search.places.list`.
9389#[derive(Clone, Debug, PartialEq)]
9390#[non_exhaustive]
9391pub struct InstagramSearchPlacesOptions {
9392    /// Public search query.
9393    pub q: String,
9394    /// Maximum accepted data age. The default is 24h.
9395    pub freshness: Option<crate::options::Freshness>,
9396    /// Opaque cursor returned by the previous page.
9397    pub cursor: Option<String>,
9398    /// Retry and timeout controls for this request.
9399    pub request_options: RequestOptions,
9400}
9401
9402impl InstagramSearchPlacesOptions {
9403    /// Creates options with the required values.
9404    pub fn new(q: impl Into<String>) -> Self {
9405        Self {
9406            q: q.into(),
9407            freshness: None,
9408            cursor: None,
9409            request_options: RequestOptions::default(),
9410        }
9411    }
9412
9413    /// Maximum accepted data age. The default is 24h.
9414    pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
9415        self.freshness = Some(value);
9416        self
9417    }
9418
9419    /// Opaque cursor returned by the previous page.
9420    pub fn cursor(mut self, value: impl Into<String>) -> Self {
9421        self.cursor = Some(value.into());
9422        self
9423    }
9424
9425    /// Sets the retry attempts after the first request.
9426    pub fn max_retries(mut self, value: u32) -> Self {
9427        self.request_options.max_retries = Some(value);
9428        self
9429    }
9430
9431    /// Sets the timeout for each attempt.
9432    pub fn timeout(mut self, value: Duration) -> Self {
9433        self.request_options.timeout = Some(value);
9434        self
9435    }
9436
9437    pub(crate) fn query(&self) -> Result<Query, Error> {
9438        let mut query = Query::default();
9439        query.require("q", &self.q)?;
9440        query.push("freshness", &self.freshness);
9441        query.push("cursor", &self.cursor);
9442        Ok(query)
9443    }
9444}
9445
9446/// One page returned by `instagram.search.places.list`.
9447pub type InstagramSearchPlacesPage = Page<InstagramLocation>;
9448
9449/// Options for `instagram.search.profiles.list`.
9450#[derive(Clone, Debug, PartialEq)]
9451#[non_exhaustive]
9452pub struct InstagramSearchProfilesOptions {
9453    /// Public search query.
9454    pub q: String,
9455    /// Maximum accepted data age. The default is 24h.
9456    pub freshness: Option<crate::options::Freshness>,
9457    /// Opaque cursor returned by the previous page.
9458    pub cursor: Option<String>,
9459    /// Retry and timeout controls for this request.
9460    pub request_options: RequestOptions,
9461}
9462
9463impl InstagramSearchProfilesOptions {
9464    /// Creates options with the required values.
9465    pub fn new(q: impl Into<String>) -> Self {
9466        Self {
9467            q: q.into(),
9468            freshness: None,
9469            cursor: None,
9470            request_options: RequestOptions::default(),
9471        }
9472    }
9473
9474    /// Maximum accepted data age. The default is 24h.
9475    pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
9476        self.freshness = Some(value);
9477        self
9478    }
9479
9480    /// Opaque cursor returned by the previous page.
9481    pub fn cursor(mut self, value: impl Into<String>) -> Self {
9482        self.cursor = Some(value.into());
9483        self
9484    }
9485
9486    /// Sets the retry attempts after the first request.
9487    pub fn max_retries(mut self, value: u32) -> Self {
9488        self.request_options.max_retries = Some(value);
9489        self
9490    }
9491
9492    /// Sets the timeout for each attempt.
9493    pub fn timeout(mut self, value: Duration) -> Self {
9494        self.request_options.timeout = Some(value);
9495        self
9496    }
9497
9498    pub(crate) fn query(&self) -> Result<Query, Error> {
9499        let mut query = Query::default();
9500        query.require("q", &self.q)?;
9501        query.push("freshness", &self.freshness);
9502        query.push("cursor", &self.cursor);
9503        Ok(query)
9504    }
9505}
9506
9507/// One page returned by `instagram.search.profiles.list`.
9508pub type InstagramSearchProfilesPage = Page<InstagramProfile>;
9509
9510/// Options for `instagram.search.reels.list`.
9511#[derive(Clone, Debug, PartialEq)]
9512#[non_exhaustive]
9513pub struct InstagramSearchReelsOptions {
9514    /// Public search query.
9515    pub q: String,
9516    /// Maximum accepted data age. The default is 24h.
9517    pub freshness: Option<crate::options::Freshness>,
9518    /// Opaque cursor returned by the previous page.
9519    pub cursor: Option<String>,
9520    /// Retry and timeout controls for this request.
9521    pub request_options: RequestOptions,
9522}
9523
9524impl InstagramSearchReelsOptions {
9525    /// Creates options with the required values.
9526    pub fn new(q: impl Into<String>) -> Self {
9527        Self {
9528            q: q.into(),
9529            freshness: None,
9530            cursor: None,
9531            request_options: RequestOptions::default(),
9532        }
9533    }
9534
9535    /// Maximum accepted data age. The default is 24h.
9536    pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
9537        self.freshness = Some(value);
9538        self
9539    }
9540
9541    /// Opaque cursor returned by the previous page.
9542    pub fn cursor(mut self, value: impl Into<String>) -> Self {
9543        self.cursor = Some(value.into());
9544        self
9545    }
9546
9547    /// Sets the retry attempts after the first request.
9548    pub fn max_retries(mut self, value: u32) -> Self {
9549        self.request_options.max_retries = Some(value);
9550        self
9551    }
9552
9553    /// Sets the timeout for each attempt.
9554    pub fn timeout(mut self, value: Duration) -> Self {
9555        self.request_options.timeout = Some(value);
9556        self
9557    }
9558
9559    pub(crate) fn query(&self) -> Result<Query, Error> {
9560        let mut query = Query::default();
9561        query.require("q", &self.q)?;
9562        query.push("freshness", &self.freshness);
9563        query.push("cursor", &self.cursor);
9564        Ok(query)
9565    }
9566}
9567
9568/// One page returned by `instagram.search.reels.list`.
9569pub type InstagramSearchReelsPage = Page<InstagramPost>;
9570
9571/// Options for `instagram.search.top.list`.
9572#[derive(Clone, Debug, PartialEq)]
9573#[non_exhaustive]
9574pub struct InstagramSearchTopOptions {
9575    /// Public search query.
9576    pub q: String,
9577    /// Maximum accepted data age. The default is 24h.
9578    pub freshness: Option<crate::options::Freshness>,
9579    /// Opaque cursor returned by the previous page.
9580    pub cursor: Option<String>,
9581    /// Retry and timeout controls for this request.
9582    pub request_options: RequestOptions,
9583}
9584
9585impl InstagramSearchTopOptions {
9586    /// Creates options with the required values.
9587    pub fn new(q: impl Into<String>) -> Self {
9588        Self {
9589            q: q.into(),
9590            freshness: None,
9591            cursor: None,
9592            request_options: RequestOptions::default(),
9593        }
9594    }
9595
9596    /// Maximum accepted data age. The default is 24h.
9597    pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
9598        self.freshness = Some(value);
9599        self
9600    }
9601
9602    /// Opaque cursor returned by the previous page.
9603    pub fn cursor(mut self, value: impl Into<String>) -> Self {
9604        self.cursor = Some(value.into());
9605        self
9606    }
9607
9608    /// Sets the retry attempts after the first request.
9609    pub fn max_retries(mut self, value: u32) -> Self {
9610        self.request_options.max_retries = Some(value);
9611        self
9612    }
9613
9614    /// Sets the timeout for each attempt.
9615    pub fn timeout(mut self, value: Duration) -> Self {
9616        self.request_options.timeout = Some(value);
9617        self
9618    }
9619
9620    pub(crate) fn query(&self) -> Result<Query, Error> {
9621        let mut query = Query::default();
9622        query.require("q", &self.q)?;
9623        query.push("freshness", &self.freshness);
9624        query.push("cursor", &self.cursor);
9625        Ok(query)
9626    }
9627}
9628
9629/// One page returned by `instagram.search.top.list`.
9630pub type InstagramSearchTopPage = Page<InstagramSearchResult>;
9631
9632/// Options for `instagram.story.get`.
9633#[derive(Clone, Debug, Default, PartialEq)]
9634#[non_exhaustive]
9635pub struct InstagramStoryOptions {
9636    /// Maximum accepted data age. The default is 24h.
9637    pub freshness: Option<crate::options::Freshness>,
9638    /// Retry and timeout controls for this request.
9639    pub request_options: RequestOptions,
9640}
9641
9642impl InstagramStoryOptions {
9643    /// Creates options that use the API and client defaults.
9644    pub fn new() -> Self {
9645        Self::default()
9646    }
9647
9648    /// Maximum accepted data age. The default is 24h.
9649    pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
9650        self.freshness = Some(value);
9651        self
9652    }
9653
9654    /// Sets the retry attempts after the first request.
9655    pub fn max_retries(mut self, value: u32) -> Self {
9656        self.request_options.max_retries = Some(value);
9657        self
9658    }
9659
9660    /// Sets the timeout for each attempt.
9661    pub fn timeout(mut self, value: Duration) -> Self {
9662        self.request_options.timeout = Some(value);
9663        self
9664    }
9665
9666    pub(crate) fn query(&self) -> Result<Query, Error> {
9667        let mut query = Query::default();
9668        query.push("freshness", &self.freshness);
9669        Ok(query)
9670    }
9671}
9672
9673/// Typed result of `instagram.story.get`.
9674pub type InstagramStoryResponse = Response<InstagramStory>;
9675
9676/// Options for `reddit.domain.posts.list`.
9677#[derive(Clone, Debug, Default, PartialEq)]
9678#[non_exhaustive]
9679pub struct RedditDomainPostsOptions {
9680    /// Result ordering for this operation. One of `hot`, `new`, `top`, `rising`, or
9681    /// `controversial`. The API default is `hot`.
9682    pub sort: Option<String>,
9683    /// Time window for top and controversial results. One of `hour`, `day`, `week`,
9684    /// `month`, `year`, or `all`.
9685    pub t: Option<String>,
9686    /// Maximum number of results to return. The API default is `25`. Accepts 1 to 100.
9687    pub limit: Option<i64>,
9688    /// Maximum accepted data age. The default is 24h.
9689    pub freshness: Option<crate::options::Freshness>,
9690    /// Opaque cursor returned by the previous page.
9691    pub cursor: Option<String>,
9692    /// Retry and timeout controls for this request.
9693    pub request_options: RequestOptions,
9694}
9695
9696impl RedditDomainPostsOptions {
9697    /// Creates options that use the API and client defaults.
9698    pub fn new() -> Self {
9699        Self::default()
9700    }
9701
9702    /// Result ordering for this operation. One of `hot`, `new`, `top`, `rising`, or
9703    /// `controversial`. The API default is `hot`.
9704    pub fn sort(mut self, value: impl Into<String>) -> Self {
9705        self.sort = Some(value.into());
9706        self
9707    }
9708
9709    /// Time window for top and controversial results. One of `hour`, `day`, `week`,
9710    /// `month`, `year`, or `all`.
9711    pub fn t(mut self, value: impl Into<String>) -> Self {
9712        self.t = Some(value.into());
9713        self
9714    }
9715
9716    /// Maximum number of results to return. The API default is `25`. Accepts 1 to 100.
9717    pub fn limit(mut self, value: i64) -> Self {
9718        self.limit = Some(value);
9719        self
9720    }
9721
9722    /// Maximum accepted data age. The default is 24h.
9723    pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
9724        self.freshness = Some(value);
9725        self
9726    }
9727
9728    /// Opaque cursor returned by the previous page.
9729    pub fn cursor(mut self, value: impl Into<String>) -> Self {
9730        self.cursor = Some(value.into());
9731        self
9732    }
9733
9734    /// Sets the retry attempts after the first request.
9735    pub fn max_retries(mut self, value: u32) -> Self {
9736        self.request_options.max_retries = Some(value);
9737        self
9738    }
9739
9740    /// Sets the timeout for each attempt.
9741    pub fn timeout(mut self, value: Duration) -> Self {
9742        self.request_options.timeout = Some(value);
9743        self
9744    }
9745
9746    pub(crate) fn query(&self) -> Result<Query, Error> {
9747        let mut query = Query::default();
9748        query.push("sort", &self.sort);
9749        query.push("t", &self.t);
9750        query.push("limit", &self.limit);
9751        query.push("freshness", &self.freshness);
9752        query.push("cursor", &self.cursor);
9753        Ok(query)
9754    }
9755}
9756
9757/// One page returned by `reddit.domain.posts.list`.
9758pub type RedditDomainPostsPage = Page<RedditPost>;
9759
9760/// Options for `reddit.post.get`.
9761#[derive(Clone, Debug, Default, PartialEq)]
9762#[non_exhaustive]
9763pub struct RedditPostOptions {
9764    /// Maximum accepted data age. The default is 24h.
9765    pub freshness: Option<crate::options::Freshness>,
9766    /// Retry and timeout controls for this request.
9767    pub request_options: RequestOptions,
9768}
9769
9770impl RedditPostOptions {
9771    /// Creates options that use the API and client defaults.
9772    pub fn new() -> Self {
9773        Self::default()
9774    }
9775
9776    /// Maximum accepted data age. The default is 24h.
9777    pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
9778        self.freshness = Some(value);
9779        self
9780    }
9781
9782    /// Sets the retry attempts after the first request.
9783    pub fn max_retries(mut self, value: u32) -> Self {
9784        self.request_options.max_retries = Some(value);
9785        self
9786    }
9787
9788    /// Sets the timeout for each attempt.
9789    pub fn timeout(mut self, value: Duration) -> Self {
9790        self.request_options.timeout = Some(value);
9791        self
9792    }
9793
9794    pub(crate) fn query(&self) -> Result<Query, Error> {
9795        let mut query = Query::default();
9796        query.push("freshness", &self.freshness);
9797        Ok(query)
9798    }
9799}
9800
9801/// Typed result of `reddit.post.get`.
9802pub type RedditPostResponse = Response<RedditPost>;
9803
9804/// Options for `reddit.post.comments.list`.
9805#[derive(Clone, Debug, Default, PartialEq)]
9806#[non_exhaustive]
9807pub struct RedditPostCommentsOptions {
9808    /// Result ordering for this operation. One of `confidence`, `top`, `new`,
9809    /// `controversial`, `old`, or `qa`. The API default is `confidence`.
9810    pub sort: Option<String>,
9811    /// Maximum number of results to return. The API default is `25`. Accepts 1 to 100.
9812    pub limit: Option<i64>,
9813    /// Maximum depth of nested replies. Accepts 0 to 10.
9814    pub depth: Option<i64>,
9815    /// Maximum accepted data age. The default is 24h.
9816    pub freshness: Option<crate::options::Freshness>,
9817    /// Retry and timeout controls for this request.
9818    pub request_options: RequestOptions,
9819}
9820
9821impl RedditPostCommentsOptions {
9822    /// Creates options that use the API and client defaults.
9823    pub fn new() -> Self {
9824        Self::default()
9825    }
9826
9827    /// Result ordering for this operation. One of `confidence`, `top`, `new`,
9828    /// `controversial`, `old`, or `qa`. The API default is `confidence`.
9829    pub fn sort(mut self, value: impl Into<String>) -> Self {
9830        self.sort = Some(value.into());
9831        self
9832    }
9833
9834    /// Maximum number of results to return. The API default is `25`. Accepts 1 to 100.
9835    pub fn limit(mut self, value: i64) -> Self {
9836        self.limit = Some(value);
9837        self
9838    }
9839
9840    /// Maximum depth of nested replies. Accepts 0 to 10.
9841    pub fn depth(mut self, value: i64) -> Self {
9842        self.depth = Some(value);
9843        self
9844    }
9845
9846    /// Maximum accepted data age. The default is 24h.
9847    pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
9848        self.freshness = Some(value);
9849        self
9850    }
9851
9852    /// Sets the retry attempts after the first request.
9853    pub fn max_retries(mut self, value: u32) -> Self {
9854        self.request_options.max_retries = Some(value);
9855        self
9856    }
9857
9858    /// Sets the timeout for each attempt.
9859    pub fn timeout(mut self, value: Duration) -> Self {
9860        self.request_options.timeout = Some(value);
9861        self
9862    }
9863
9864    pub(crate) fn query(&self) -> Result<Query, Error> {
9865        let mut query = Query::default();
9866        query.push("sort", &self.sort);
9867        query.push("limit", &self.limit);
9868        query.push("depth", &self.depth);
9869        query.push("freshness", &self.freshness);
9870        Ok(query)
9871    }
9872}
9873
9874/// Typed result of `reddit.post.comments.list`.
9875pub type RedditPostCommentsResponse = Response<Vec<RedditComment>>;
9876
9877/// Options for `reddit.post.duplicates.list`.
9878#[derive(Clone, Debug, Default, PartialEq)]
9879#[non_exhaustive]
9880pub struct RedditPostDuplicatesOptions {
9881    /// Maximum number of results to return. The API default is `25`. Accepts 1 to 100.
9882    pub limit: Option<i64>,
9883    /// Maximum accepted data age. The default is 24h.
9884    pub freshness: Option<crate::options::Freshness>,
9885    /// Opaque cursor returned by the previous page.
9886    pub cursor: Option<String>,
9887    /// Retry and timeout controls for this request.
9888    pub request_options: RequestOptions,
9889}
9890
9891impl RedditPostDuplicatesOptions {
9892    /// Creates options that use the API and client defaults.
9893    pub fn new() -> Self {
9894        Self::default()
9895    }
9896
9897    /// Maximum number of results to return. The API default is `25`. Accepts 1 to 100.
9898    pub fn limit(mut self, value: i64) -> Self {
9899        self.limit = Some(value);
9900        self
9901    }
9902
9903    /// Maximum accepted data age. The default is 24h.
9904    pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
9905        self.freshness = Some(value);
9906        self
9907    }
9908
9909    /// Opaque cursor returned by the previous page.
9910    pub fn cursor(mut self, value: impl Into<String>) -> Self {
9911        self.cursor = Some(value.into());
9912        self
9913    }
9914
9915    /// Sets the retry attempts after the first request.
9916    pub fn max_retries(mut self, value: u32) -> Self {
9917        self.request_options.max_retries = Some(value);
9918        self
9919    }
9920
9921    /// Sets the timeout for each attempt.
9922    pub fn timeout(mut self, value: Duration) -> Self {
9923        self.request_options.timeout = Some(value);
9924        self
9925    }
9926
9927    pub(crate) fn query(&self) -> Result<Query, Error> {
9928        let mut query = Query::default();
9929        query.push("limit", &self.limit);
9930        query.push("freshness", &self.freshness);
9931        query.push("cursor", &self.cursor);
9932        Ok(query)
9933    }
9934}
9935
9936/// One page returned by `reddit.post.duplicates.list`.
9937pub type RedditPostDuplicatesPage = Page<RedditPost>;
9938
9939/// Options for `reddit.profile.get`.
9940#[derive(Clone, Debug, Default, PartialEq)]
9941#[non_exhaustive]
9942pub struct RedditProfileOptions {
9943    /// Maximum accepted data age. The default is 24h.
9944    pub freshness: Option<crate::options::Freshness>,
9945    /// Retry and timeout controls for this request.
9946    pub request_options: RequestOptions,
9947}
9948
9949impl RedditProfileOptions {
9950    /// Creates options that use the API and client defaults.
9951    pub fn new() -> Self {
9952        Self::default()
9953    }
9954
9955    /// Maximum accepted data age. The default is 24h.
9956    pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
9957        self.freshness = Some(value);
9958        self
9959    }
9960
9961    /// Sets the retry attempts after the first request.
9962    pub fn max_retries(mut self, value: u32) -> Self {
9963        self.request_options.max_retries = Some(value);
9964        self
9965    }
9966
9967    /// Sets the timeout for each attempt.
9968    pub fn timeout(mut self, value: Duration) -> Self {
9969        self.request_options.timeout = Some(value);
9970        self
9971    }
9972
9973    pub(crate) fn query(&self) -> Result<Query, Error> {
9974        let mut query = Query::default();
9975        query.push("freshness", &self.freshness);
9976        Ok(query)
9977    }
9978}
9979
9980/// Typed result of `reddit.profile.get`.
9981pub type RedditProfileResponse = Response<RedditProfile>;
9982
9983/// Options for `reddit.profile.comments.list`.
9984#[derive(Clone, Debug, Default, PartialEq)]
9985#[non_exhaustive]
9986pub struct RedditProfileCommentsOptions {
9987    /// Result ordering for this operation. One of `new`, `hot`, `top`, or
9988    /// `controversial`. The API default is `new`.
9989    pub sort: Option<String>,
9990    /// Time window for top and controversial results. One of `hour`, `day`, `week`,
9991    /// `month`, `year`, or `all`.
9992    pub t: Option<String>,
9993    /// Maximum number of results to return. The API default is `25`. Accepts 1 to 100.
9994    pub limit: Option<i64>,
9995    /// Maximum accepted data age. The default is 24h.
9996    pub freshness: Option<crate::options::Freshness>,
9997    /// Opaque cursor returned by the previous page.
9998    pub cursor: Option<String>,
9999    /// Retry and timeout controls for this request.
10000    pub request_options: RequestOptions,
10001}
10002
10003impl RedditProfileCommentsOptions {
10004    /// Creates options that use the API and client defaults.
10005    pub fn new() -> Self {
10006        Self::default()
10007    }
10008
10009    /// Result ordering for this operation. One of `new`, `hot`, `top`, or
10010    /// `controversial`. The API default is `new`.
10011    pub fn sort(mut self, value: impl Into<String>) -> Self {
10012        self.sort = Some(value.into());
10013        self
10014    }
10015
10016    /// Time window for top and controversial results. One of `hour`, `day`, `week`,
10017    /// `month`, `year`, or `all`.
10018    pub fn t(mut self, value: impl Into<String>) -> Self {
10019        self.t = Some(value.into());
10020        self
10021    }
10022
10023    /// Maximum number of results to return. The API default is `25`. Accepts 1 to 100.
10024    pub fn limit(mut self, value: i64) -> Self {
10025        self.limit = Some(value);
10026        self
10027    }
10028
10029    /// Maximum accepted data age. The default is 24h.
10030    pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
10031        self.freshness = Some(value);
10032        self
10033    }
10034
10035    /// Opaque cursor returned by the previous page.
10036    pub fn cursor(mut self, value: impl Into<String>) -> Self {
10037        self.cursor = Some(value.into());
10038        self
10039    }
10040
10041    /// Sets the retry attempts after the first request.
10042    pub fn max_retries(mut self, value: u32) -> Self {
10043        self.request_options.max_retries = Some(value);
10044        self
10045    }
10046
10047    /// Sets the timeout for each attempt.
10048    pub fn timeout(mut self, value: Duration) -> Self {
10049        self.request_options.timeout = Some(value);
10050        self
10051    }
10052
10053    pub(crate) fn query(&self) -> Result<Query, Error> {
10054        let mut query = Query::default();
10055        query.push("sort", &self.sort);
10056        query.push("t", &self.t);
10057        query.push("limit", &self.limit);
10058        query.push("freshness", &self.freshness);
10059        query.push("cursor", &self.cursor);
10060        Ok(query)
10061    }
10062}
10063
10064/// One page returned by `reddit.profile.comments.list`.
10065pub type RedditProfileCommentsPage = Page<RedditComment>;
10066
10067/// Options for `reddit.profile.moderated.list`.
10068#[derive(Clone, Debug, Default, PartialEq)]
10069#[non_exhaustive]
10070pub struct RedditProfileModeratedOptions {
10071    /// Maximum accepted data age. The default is 24h.
10072    pub freshness: Option<crate::options::Freshness>,
10073    /// Retry and timeout controls for this request.
10074    pub request_options: RequestOptions,
10075}
10076
10077impl RedditProfileModeratedOptions {
10078    /// Creates options that use the API and client defaults.
10079    pub fn new() -> Self {
10080        Self::default()
10081    }
10082
10083    /// Maximum accepted data age. The default is 24h.
10084    pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
10085        self.freshness = Some(value);
10086        self
10087    }
10088
10089    /// Sets the retry attempts after the first request.
10090    pub fn max_retries(mut self, value: u32) -> Self {
10091        self.request_options.max_retries = Some(value);
10092        self
10093    }
10094
10095    /// Sets the timeout for each attempt.
10096    pub fn timeout(mut self, value: Duration) -> Self {
10097        self.request_options.timeout = Some(value);
10098        self
10099    }
10100
10101    pub(crate) fn query(&self) -> Result<Query, Error> {
10102        let mut query = Query::default();
10103        query.push("freshness", &self.freshness);
10104        Ok(query)
10105    }
10106}
10107
10108/// Typed result of `reddit.profile.moderated.list`.
10109pub type RedditProfileModeratedResponse = Response<Vec<RedditSubreddit>>;
10110
10111/// Options for `reddit.profile.posts.list`.
10112#[derive(Clone, Debug, Default, PartialEq)]
10113#[non_exhaustive]
10114pub struct RedditProfilePostsOptions {
10115    /// Result ordering for this operation. One of `new`, `hot`, `top`, or
10116    /// `controversial`. The API default is `new`.
10117    pub sort: Option<String>,
10118    /// Time window for top and controversial results. One of `hour`, `day`, `week`,
10119    /// `month`, `year`, or `all`.
10120    pub t: Option<String>,
10121    /// Maximum number of results to return. The API default is `25`. Accepts 1 to 100.
10122    pub limit: Option<i64>,
10123    /// Maximum accepted data age. The default is 24h.
10124    pub freshness: Option<crate::options::Freshness>,
10125    /// Opaque cursor returned by the previous page.
10126    pub cursor: Option<String>,
10127    /// Retry and timeout controls for this request.
10128    pub request_options: RequestOptions,
10129}
10130
10131impl RedditProfilePostsOptions {
10132    /// Creates options that use the API and client defaults.
10133    pub fn new() -> Self {
10134        Self::default()
10135    }
10136
10137    /// Result ordering for this operation. One of `new`, `hot`, `top`, or
10138    /// `controversial`. The API default is `new`.
10139    pub fn sort(mut self, value: impl Into<String>) -> Self {
10140        self.sort = Some(value.into());
10141        self
10142    }
10143
10144    /// Time window for top and controversial results. One of `hour`, `day`, `week`,
10145    /// `month`, `year`, or `all`.
10146    pub fn t(mut self, value: impl Into<String>) -> Self {
10147        self.t = Some(value.into());
10148        self
10149    }
10150
10151    /// Maximum number of results to return. The API default is `25`. Accepts 1 to 100.
10152    pub fn limit(mut self, value: i64) -> Self {
10153        self.limit = Some(value);
10154        self
10155    }
10156
10157    /// Maximum accepted data age. The default is 24h.
10158    pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
10159        self.freshness = Some(value);
10160        self
10161    }
10162
10163    /// Opaque cursor returned by the previous page.
10164    pub fn cursor(mut self, value: impl Into<String>) -> Self {
10165        self.cursor = Some(value.into());
10166        self
10167    }
10168
10169    /// Sets the retry attempts after the first request.
10170    pub fn max_retries(mut self, value: u32) -> Self {
10171        self.request_options.max_retries = Some(value);
10172        self
10173    }
10174
10175    /// Sets the timeout for each attempt.
10176    pub fn timeout(mut self, value: Duration) -> Self {
10177        self.request_options.timeout = Some(value);
10178        self
10179    }
10180
10181    pub(crate) fn query(&self) -> Result<Query, Error> {
10182        let mut query = Query::default();
10183        query.push("sort", &self.sort);
10184        query.push("t", &self.t);
10185        query.push("limit", &self.limit);
10186        query.push("freshness", &self.freshness);
10187        query.push("cursor", &self.cursor);
10188        Ok(query)
10189    }
10190}
10191
10192/// One page returned by `reddit.profile.posts.list`.
10193pub type RedditProfilePostsPage = Page<RedditPost>;
10194
10195/// Options for `reddit.profile.trophies.list`.
10196#[derive(Clone, Debug, Default, PartialEq)]
10197#[non_exhaustive]
10198pub struct RedditProfileTrophiesOptions {
10199    /// Maximum accepted data age. The default is 24h.
10200    pub freshness: Option<crate::options::Freshness>,
10201    /// Retry and timeout controls for this request.
10202    pub request_options: RequestOptions,
10203}
10204
10205impl RedditProfileTrophiesOptions {
10206    /// Creates options that use the API and client defaults.
10207    pub fn new() -> Self {
10208        Self::default()
10209    }
10210
10211    /// Maximum accepted data age. The default is 24h.
10212    pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
10213        self.freshness = Some(value);
10214        self
10215    }
10216
10217    /// Sets the retry attempts after the first request.
10218    pub fn max_retries(mut self, value: u32) -> Self {
10219        self.request_options.max_retries = Some(value);
10220        self
10221    }
10222
10223    /// Sets the timeout for each attempt.
10224    pub fn timeout(mut self, value: Duration) -> Self {
10225        self.request_options.timeout = Some(value);
10226        self
10227    }
10228
10229    pub(crate) fn query(&self) -> Result<Query, Error> {
10230        let mut query = Query::default();
10231        query.push("freshness", &self.freshness);
10232        Ok(query)
10233    }
10234}
10235
10236/// Typed result of `reddit.profile.trophies.list`.
10237pub type RedditProfileTrophiesResponse = Response<Vec<RedditTrophy>>;
10238
10239/// Options for `reddit.search.posts.list`.
10240#[derive(Clone, Debug, PartialEq)]
10241#[non_exhaustive]
10242pub struct RedditSearchPostsOptions {
10243    /// Public search query.
10244    pub q: String,
10245    /// Result ordering for this operation. One of `relevance`, `hot`, `top`, `new`, or
10246    /// `comments`. The API default is `relevance`.
10247    pub sort: Option<String>,
10248    /// Search inside one subreddit only.
10249    pub subreddit: Option<String>,
10250    /// Time window for top and controversial results. One of `hour`, `day`, `week`,
10251    /// `month`, `year`, or `all`.
10252    pub t: Option<String>,
10253    /// Maximum number of results to return. The API default is `25`. Accepts 1 to 100.
10254    pub limit: Option<i64>,
10255    /// Maximum accepted data age. The default is 24h.
10256    pub freshness: Option<crate::options::Freshness>,
10257    /// Opaque cursor returned by the previous page.
10258    pub cursor: Option<String>,
10259    /// Retry and timeout controls for this request.
10260    pub request_options: RequestOptions,
10261}
10262
10263impl RedditSearchPostsOptions {
10264    /// Creates options with the required values.
10265    pub fn new(q: impl Into<String>) -> Self {
10266        Self {
10267            q: q.into(),
10268            sort: None,
10269            subreddit: None,
10270            t: None,
10271            limit: None,
10272            freshness: None,
10273            cursor: None,
10274            request_options: RequestOptions::default(),
10275        }
10276    }
10277
10278    /// Result ordering for this operation. One of `relevance`, `hot`, `top`, `new`, or
10279    /// `comments`. The API default is `relevance`.
10280    pub fn sort(mut self, value: impl Into<String>) -> Self {
10281        self.sort = Some(value.into());
10282        self
10283    }
10284
10285    /// Search inside one subreddit only.
10286    pub fn subreddit(mut self, value: impl Into<String>) -> Self {
10287        self.subreddit = Some(value.into());
10288        self
10289    }
10290
10291    /// Time window for top and controversial results. One of `hour`, `day`, `week`,
10292    /// `month`, `year`, or `all`.
10293    pub fn t(mut self, value: impl Into<String>) -> Self {
10294        self.t = Some(value.into());
10295        self
10296    }
10297
10298    /// Maximum number of results to return. The API default is `25`. Accepts 1 to 100.
10299    pub fn limit(mut self, value: i64) -> Self {
10300        self.limit = Some(value);
10301        self
10302    }
10303
10304    /// Maximum accepted data age. The default is 24h.
10305    pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
10306        self.freshness = Some(value);
10307        self
10308    }
10309
10310    /// Opaque cursor returned by the previous page.
10311    pub fn cursor(mut self, value: impl Into<String>) -> Self {
10312        self.cursor = Some(value.into());
10313        self
10314    }
10315
10316    /// Sets the retry attempts after the first request.
10317    pub fn max_retries(mut self, value: u32) -> Self {
10318        self.request_options.max_retries = Some(value);
10319        self
10320    }
10321
10322    /// Sets the timeout for each attempt.
10323    pub fn timeout(mut self, value: Duration) -> Self {
10324        self.request_options.timeout = Some(value);
10325        self
10326    }
10327
10328    pub(crate) fn query(&self) -> Result<Query, Error> {
10329        let mut query = Query::default();
10330        query.require("q", &self.q)?;
10331        query.push("sort", &self.sort);
10332        query.push("subreddit", &self.subreddit);
10333        query.push("t", &self.t);
10334        query.push("limit", &self.limit);
10335        query.push("freshness", &self.freshness);
10336        query.push("cursor", &self.cursor);
10337        Ok(query)
10338    }
10339}
10340
10341/// One page returned by `reddit.search.posts.list`.
10342pub type RedditSearchPostsPage = Page<RedditPost>;
10343
10344/// Options for `reddit.search.profiles.list`.
10345#[derive(Clone, Debug, PartialEq)]
10346#[non_exhaustive]
10347pub struct RedditSearchProfilesOptions {
10348    /// Public search query.
10349    pub q: String,
10350    /// Maximum number of results to return. The API default is `25`. Accepts 1 to 100.
10351    pub limit: Option<i64>,
10352    /// Maximum accepted data age. The default is 24h.
10353    pub freshness: Option<crate::options::Freshness>,
10354    /// Opaque cursor returned by the previous page.
10355    pub cursor: Option<String>,
10356    /// Retry and timeout controls for this request.
10357    pub request_options: RequestOptions,
10358}
10359
10360impl RedditSearchProfilesOptions {
10361    /// Creates options with the required values.
10362    pub fn new(q: impl Into<String>) -> Self {
10363        Self {
10364            q: q.into(),
10365            limit: None,
10366            freshness: None,
10367            cursor: None,
10368            request_options: RequestOptions::default(),
10369        }
10370    }
10371
10372    /// Maximum number of results to return. The API default is `25`. Accepts 1 to 100.
10373    pub fn limit(mut self, value: i64) -> Self {
10374        self.limit = Some(value);
10375        self
10376    }
10377
10378    /// Maximum accepted data age. The default is 24h.
10379    pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
10380        self.freshness = Some(value);
10381        self
10382    }
10383
10384    /// Opaque cursor returned by the previous page.
10385    pub fn cursor(mut self, value: impl Into<String>) -> Self {
10386        self.cursor = Some(value.into());
10387        self
10388    }
10389
10390    /// Sets the retry attempts after the first request.
10391    pub fn max_retries(mut self, value: u32) -> Self {
10392        self.request_options.max_retries = Some(value);
10393        self
10394    }
10395
10396    /// Sets the timeout for each attempt.
10397    pub fn timeout(mut self, value: Duration) -> Self {
10398        self.request_options.timeout = Some(value);
10399        self
10400    }
10401
10402    pub(crate) fn query(&self) -> Result<Query, Error> {
10403        let mut query = Query::default();
10404        query.require("q", &self.q)?;
10405        query.push("limit", &self.limit);
10406        query.push("freshness", &self.freshness);
10407        query.push("cursor", &self.cursor);
10408        Ok(query)
10409    }
10410}
10411
10412/// One page returned by `reddit.search.profiles.list`.
10413pub type RedditSearchProfilesPage = Page<RedditProfile>;
10414
10415/// Options for `reddit.search.subreddits.list`.
10416#[derive(Clone, Debug, PartialEq)]
10417#[non_exhaustive]
10418pub struct RedditSearchSubredditsOptions {
10419    /// Public search query.
10420    pub q: String,
10421    /// Maximum number of results to return. The API default is `25`. Accepts 1 to 100.
10422    pub limit: Option<i64>,
10423    /// Maximum accepted data age. The default is 24h.
10424    pub freshness: Option<crate::options::Freshness>,
10425    /// Opaque cursor returned by the previous page.
10426    pub cursor: Option<String>,
10427    /// Retry and timeout controls for this request.
10428    pub request_options: RequestOptions,
10429}
10430
10431impl RedditSearchSubredditsOptions {
10432    /// Creates options with the required values.
10433    pub fn new(q: impl Into<String>) -> Self {
10434        Self {
10435            q: q.into(),
10436            limit: None,
10437            freshness: None,
10438            cursor: None,
10439            request_options: RequestOptions::default(),
10440        }
10441    }
10442
10443    /// Maximum number of results to return. The API default is `25`. Accepts 1 to 100.
10444    pub fn limit(mut self, value: i64) -> Self {
10445        self.limit = Some(value);
10446        self
10447    }
10448
10449    /// Maximum accepted data age. The default is 24h.
10450    pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
10451        self.freshness = Some(value);
10452        self
10453    }
10454
10455    /// Opaque cursor returned by the previous page.
10456    pub fn cursor(mut self, value: impl Into<String>) -> Self {
10457        self.cursor = Some(value.into());
10458        self
10459    }
10460
10461    /// Sets the retry attempts after the first request.
10462    pub fn max_retries(mut self, value: u32) -> Self {
10463        self.request_options.max_retries = Some(value);
10464        self
10465    }
10466
10467    /// Sets the timeout for each attempt.
10468    pub fn timeout(mut self, value: Duration) -> Self {
10469        self.request_options.timeout = Some(value);
10470        self
10471    }
10472
10473    pub(crate) fn query(&self) -> Result<Query, Error> {
10474        let mut query = Query::default();
10475        query.require("q", &self.q)?;
10476        query.push("limit", &self.limit);
10477        query.push("freshness", &self.freshness);
10478        query.push("cursor", &self.cursor);
10479        Ok(query)
10480    }
10481}
10482
10483/// One page returned by `reddit.search.subreddits.list`.
10484pub type RedditSearchSubredditsPage = Page<RedditSubreddit>;
10485
10486/// Options for `reddit.subreddit.get`.
10487#[derive(Clone, Debug, Default, PartialEq)]
10488#[non_exhaustive]
10489pub struct RedditSubredditOptions {
10490    /// Maximum accepted data age. The default is 24h.
10491    pub freshness: Option<crate::options::Freshness>,
10492    /// Retry and timeout controls for this request.
10493    pub request_options: RequestOptions,
10494}
10495
10496impl RedditSubredditOptions {
10497    /// Creates options that use the API and client defaults.
10498    pub fn new() -> Self {
10499        Self::default()
10500    }
10501
10502    /// Maximum accepted data age. The default is 24h.
10503    pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
10504        self.freshness = Some(value);
10505        self
10506    }
10507
10508    /// Sets the retry attempts after the first request.
10509    pub fn max_retries(mut self, value: u32) -> Self {
10510        self.request_options.max_retries = Some(value);
10511        self
10512    }
10513
10514    /// Sets the timeout for each attempt.
10515    pub fn timeout(mut self, value: Duration) -> Self {
10516        self.request_options.timeout = Some(value);
10517        self
10518    }
10519
10520    pub(crate) fn query(&self) -> Result<Query, Error> {
10521        let mut query = Query::default();
10522        query.push("freshness", &self.freshness);
10523        Ok(query)
10524    }
10525}
10526
10527/// Typed result of `reddit.subreddit.get`.
10528pub type RedditSubredditResponse = Response<RedditSubreddit>;
10529
10530/// Options for `reddit.subreddit.posts.list`.
10531#[derive(Clone, Debug, Default, PartialEq)]
10532#[non_exhaustive]
10533pub struct RedditSubredditPostsOptions {
10534    /// Result ordering for this operation. One of `hot`, `new`, `top`, `rising`, or
10535    /// `controversial`. The API default is `hot`.
10536    pub sort: Option<String>,
10537    /// Time window for top and controversial results. One of `hour`, `day`, `week`,
10538    /// `month`, `year`, or `all`.
10539    pub t: Option<String>,
10540    /// Maximum number of results to return. The API default is `25`. Accepts 1 to 100.
10541    pub limit: Option<i64>,
10542    /// Maximum accepted data age. The default is 24h.
10543    pub freshness: Option<crate::options::Freshness>,
10544    /// Opaque cursor returned by the previous page.
10545    pub cursor: Option<String>,
10546    /// Retry and timeout controls for this request.
10547    pub request_options: RequestOptions,
10548}
10549
10550impl RedditSubredditPostsOptions {
10551    /// Creates options that use the API and client defaults.
10552    pub fn new() -> Self {
10553        Self::default()
10554    }
10555
10556    /// Result ordering for this operation. One of `hot`, `new`, `top`, `rising`, or
10557    /// `controversial`. The API default is `hot`.
10558    pub fn sort(mut self, value: impl Into<String>) -> Self {
10559        self.sort = Some(value.into());
10560        self
10561    }
10562
10563    /// Time window for top and controversial results. One of `hour`, `day`, `week`,
10564    /// `month`, `year`, or `all`.
10565    pub fn t(mut self, value: impl Into<String>) -> Self {
10566        self.t = Some(value.into());
10567        self
10568    }
10569
10570    /// Maximum number of results to return. The API default is `25`. Accepts 1 to 100.
10571    pub fn limit(mut self, value: i64) -> Self {
10572        self.limit = Some(value);
10573        self
10574    }
10575
10576    /// Maximum accepted data age. The default is 24h.
10577    pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
10578        self.freshness = Some(value);
10579        self
10580    }
10581
10582    /// Opaque cursor returned by the previous page.
10583    pub fn cursor(mut self, value: impl Into<String>) -> Self {
10584        self.cursor = Some(value.into());
10585        self
10586    }
10587
10588    /// Sets the retry attempts after the first request.
10589    pub fn max_retries(mut self, value: u32) -> Self {
10590        self.request_options.max_retries = Some(value);
10591        self
10592    }
10593
10594    /// Sets the timeout for each attempt.
10595    pub fn timeout(mut self, value: Duration) -> Self {
10596        self.request_options.timeout = Some(value);
10597        self
10598    }
10599
10600    pub(crate) fn query(&self) -> Result<Query, Error> {
10601        let mut query = Query::default();
10602        query.push("sort", &self.sort);
10603        query.push("t", &self.t);
10604        query.push("limit", &self.limit);
10605        query.push("freshness", &self.freshness);
10606        query.push("cursor", &self.cursor);
10607        Ok(query)
10608    }
10609}
10610
10611/// One page returned by `reddit.subreddit.posts.list`.
10612pub type RedditSubredditPostsPage = Page<RedditPost>;
10613
10614/// Options for `reddit.subreddit.rules.list`.
10615#[derive(Clone, Debug, Default, PartialEq)]
10616#[non_exhaustive]
10617pub struct RedditSubredditRulesOptions {
10618    /// Maximum accepted data age. The default is 24h.
10619    pub freshness: Option<crate::options::Freshness>,
10620    /// Retry and timeout controls for this request.
10621    pub request_options: RequestOptions,
10622}
10623
10624impl RedditSubredditRulesOptions {
10625    /// Creates options that use the API and client defaults.
10626    pub fn new() -> Self {
10627        Self::default()
10628    }
10629
10630    /// Maximum accepted data age. The default is 24h.
10631    pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
10632        self.freshness = Some(value);
10633        self
10634    }
10635
10636    /// Sets the retry attempts after the first request.
10637    pub fn max_retries(mut self, value: u32) -> Self {
10638        self.request_options.max_retries = Some(value);
10639        self
10640    }
10641
10642    /// Sets the timeout for each attempt.
10643    pub fn timeout(mut self, value: Duration) -> Self {
10644        self.request_options.timeout = Some(value);
10645        self
10646    }
10647
10648    pub(crate) fn query(&self) -> Result<Query, Error> {
10649        let mut query = Query::default();
10650        query.push("freshness", &self.freshness);
10651        Ok(query)
10652    }
10653}
10654
10655/// Typed result of `reddit.subreddit.rules.list`.
10656pub type RedditSubredditRulesResponse = Response<Vec<RedditRule>>;
10657
10658/// Options for `reddit.subreddit.wikiPage.get`.
10659#[derive(Clone, Debug, Default, PartialEq)]
10660#[non_exhaustive]
10661pub struct RedditSubredditWikiPageOptions {
10662    /// Maximum accepted data age. The default is 24h.
10663    pub freshness: Option<crate::options::Freshness>,
10664    /// Retry and timeout controls for this request.
10665    pub request_options: RequestOptions,
10666}
10667
10668impl RedditSubredditWikiPageOptions {
10669    /// Creates options that use the API and client defaults.
10670    pub fn new() -> Self {
10671        Self::default()
10672    }
10673
10674    /// Maximum accepted data age. The default is 24h.
10675    pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
10676        self.freshness = Some(value);
10677        self
10678    }
10679
10680    /// Sets the retry attempts after the first request.
10681    pub fn max_retries(mut self, value: u32) -> Self {
10682        self.request_options.max_retries = Some(value);
10683        self
10684    }
10685
10686    /// Sets the timeout for each attempt.
10687    pub fn timeout(mut self, value: Duration) -> Self {
10688        self.request_options.timeout = Some(value);
10689        self
10690    }
10691
10692    pub(crate) fn query(&self) -> Result<Query, Error> {
10693        let mut query = Query::default();
10694        query.push("freshness", &self.freshness);
10695        Ok(query)
10696    }
10697}
10698
10699/// Typed result of `reddit.subreddit.wikiPage.get`.
10700pub type RedditSubredditWikiPageResponse = Response<RedditWikiPage>;
10701
10702/// Options for `reddit.subreddit.wikiPages.list`.
10703#[derive(Clone, Debug, Default, PartialEq)]
10704#[non_exhaustive]
10705pub struct RedditSubredditWikiPagesOptions {
10706    /// Maximum accepted data age. The default is 24h.
10707    pub freshness: Option<crate::options::Freshness>,
10708    /// Retry and timeout controls for this request.
10709    pub request_options: RequestOptions,
10710}
10711
10712impl RedditSubredditWikiPagesOptions {
10713    /// Creates options that use the API and client defaults.
10714    pub fn new() -> Self {
10715        Self::default()
10716    }
10717
10718    /// Maximum accepted data age. The default is 24h.
10719    pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
10720        self.freshness = Some(value);
10721        self
10722    }
10723
10724    /// Sets the retry attempts after the first request.
10725    pub fn max_retries(mut self, value: u32) -> Self {
10726        self.request_options.max_retries = Some(value);
10727        self
10728    }
10729
10730    /// Sets the timeout for each attempt.
10731    pub fn timeout(mut self, value: Duration) -> Self {
10732        self.request_options.timeout = Some(value);
10733        self
10734    }
10735
10736    pub(crate) fn query(&self) -> Result<Query, Error> {
10737        let mut query = Query::default();
10738        query.push("freshness", &self.freshness);
10739        Ok(query)
10740    }
10741}
10742
10743/// Typed result of `reddit.subreddit.wikiPages.list`.
10744pub type RedditSubredditWikiPagesResponse = Response<Vec<RedditWikiPage>>;
10745
10746/// Options for `reddit.subreddits.new.list`.
10747#[derive(Clone, Debug, Default, PartialEq)]
10748#[non_exhaustive]
10749pub struct RedditSubredditsNewOptions {
10750    /// Maximum number of results to return. The API default is `25`. Accepts 1 to 100.
10751    pub limit: Option<i64>,
10752    /// Maximum accepted data age. The default is 24h.
10753    pub freshness: Option<crate::options::Freshness>,
10754    /// Opaque cursor returned by the previous page.
10755    pub cursor: Option<String>,
10756    /// Retry and timeout controls for this request.
10757    pub request_options: RequestOptions,
10758}
10759
10760impl RedditSubredditsNewOptions {
10761    /// Creates options that use the API and client defaults.
10762    pub fn new() -> Self {
10763        Self::default()
10764    }
10765
10766    /// Maximum number of results to return. The API default is `25`. Accepts 1 to 100.
10767    pub fn limit(mut self, value: i64) -> Self {
10768        self.limit = Some(value);
10769        self
10770    }
10771
10772    /// Maximum accepted data age. The default is 24h.
10773    pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
10774        self.freshness = Some(value);
10775        self
10776    }
10777
10778    /// Opaque cursor returned by the previous page.
10779    pub fn cursor(mut self, value: impl Into<String>) -> Self {
10780        self.cursor = Some(value.into());
10781        self
10782    }
10783
10784    /// Sets the retry attempts after the first request.
10785    pub fn max_retries(mut self, value: u32) -> Self {
10786        self.request_options.max_retries = Some(value);
10787        self
10788    }
10789
10790    /// Sets the timeout for each attempt.
10791    pub fn timeout(mut self, value: Duration) -> Self {
10792        self.request_options.timeout = Some(value);
10793        self
10794    }
10795
10796    pub(crate) fn query(&self) -> Result<Query, Error> {
10797        let mut query = Query::default();
10798        query.push("limit", &self.limit);
10799        query.push("freshness", &self.freshness);
10800        query.push("cursor", &self.cursor);
10801        Ok(query)
10802    }
10803}
10804
10805/// One page returned by `reddit.subreddits.new.list`.
10806pub type RedditSubredditsNewPage = Page<RedditSubreddit>;
10807
10808/// Options for `reddit.subreddits.popular.list`.
10809#[derive(Clone, Debug, Default, PartialEq)]
10810#[non_exhaustive]
10811pub struct RedditSubredditsPopularOptions {
10812    /// Maximum number of results to return. The API default is `25`. Accepts 1 to 100.
10813    pub limit: Option<i64>,
10814    /// Maximum accepted data age. The default is 24h.
10815    pub freshness: Option<crate::options::Freshness>,
10816    /// Opaque cursor returned by the previous page.
10817    pub cursor: Option<String>,
10818    /// Retry and timeout controls for this request.
10819    pub request_options: RequestOptions,
10820}
10821
10822impl RedditSubredditsPopularOptions {
10823    /// Creates options that use the API and client defaults.
10824    pub fn new() -> Self {
10825        Self::default()
10826    }
10827
10828    /// Maximum number of results to return. The API default is `25`. Accepts 1 to 100.
10829    pub fn limit(mut self, value: i64) -> Self {
10830        self.limit = Some(value);
10831        self
10832    }
10833
10834    /// Maximum accepted data age. The default is 24h.
10835    pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
10836        self.freshness = Some(value);
10837        self
10838    }
10839
10840    /// Opaque cursor returned by the previous page.
10841    pub fn cursor(mut self, value: impl Into<String>) -> Self {
10842        self.cursor = Some(value.into());
10843        self
10844    }
10845
10846    /// Sets the retry attempts after the first request.
10847    pub fn max_retries(mut self, value: u32) -> Self {
10848        self.request_options.max_retries = Some(value);
10849        self
10850    }
10851
10852    /// Sets the timeout for each attempt.
10853    pub fn timeout(mut self, value: Duration) -> Self {
10854        self.request_options.timeout = Some(value);
10855        self
10856    }
10857
10858    pub(crate) fn query(&self) -> Result<Query, Error> {
10859        let mut query = Query::default();
10860        query.push("limit", &self.limit);
10861        query.push("freshness", &self.freshness);
10862        query.push("cursor", &self.cursor);
10863        Ok(query)
10864    }
10865}
10866
10867/// One page returned by `reddit.subreddits.popular.list`.
10868pub type RedditSubredditsPopularPage = Page<RedditSubreddit>;
10869
10870/// Options for `reddit.trending.posts.list`.
10871#[derive(Clone, Debug, Default, PartialEq)]
10872#[non_exhaustive]
10873pub struct RedditTrendingPostsOptions {
10874    /// Result ordering for this operation. One of `hot`, `new`, `top`, `rising`,
10875    /// `controversial`, or `best`. The API default is `hot`.
10876    pub sort: Option<String>,
10877    /// Time window for top and controversial results. One of `hour`, `day`, `week`,
10878    /// `month`, `year`, or `all`.
10879    pub t: Option<String>,
10880    /// Maximum number of results to return. The API default is `25`. Accepts 1 to 100.
10881    pub limit: Option<i64>,
10882    /// Maximum accepted data age. The default is 24h.
10883    pub freshness: Option<crate::options::Freshness>,
10884    /// Opaque cursor returned by the previous page.
10885    pub cursor: Option<String>,
10886    /// Retry and timeout controls for this request.
10887    pub request_options: RequestOptions,
10888}
10889
10890impl RedditTrendingPostsOptions {
10891    /// Creates options that use the API and client defaults.
10892    pub fn new() -> Self {
10893        Self::default()
10894    }
10895
10896    /// Result ordering for this operation. One of `hot`, `new`, `top`, `rising`,
10897    /// `controversial`, or `best`. The API default is `hot`.
10898    pub fn sort(mut self, value: impl Into<String>) -> Self {
10899        self.sort = Some(value.into());
10900        self
10901    }
10902
10903    /// Time window for top and controversial results. One of `hour`, `day`, `week`,
10904    /// `month`, `year`, or `all`.
10905    pub fn t(mut self, value: impl Into<String>) -> Self {
10906        self.t = Some(value.into());
10907        self
10908    }
10909
10910    /// Maximum number of results to return. The API default is `25`. Accepts 1 to 100.
10911    pub fn limit(mut self, value: i64) -> Self {
10912        self.limit = Some(value);
10913        self
10914    }
10915
10916    /// Maximum accepted data age. The default is 24h.
10917    pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
10918        self.freshness = Some(value);
10919        self
10920    }
10921
10922    /// Opaque cursor returned by the previous page.
10923    pub fn cursor(mut self, value: impl Into<String>) -> Self {
10924        self.cursor = Some(value.into());
10925        self
10926    }
10927
10928    /// Sets the retry attempts after the first request.
10929    pub fn max_retries(mut self, value: u32) -> Self {
10930        self.request_options.max_retries = Some(value);
10931        self
10932    }
10933
10934    /// Sets the timeout for each attempt.
10935    pub fn timeout(mut self, value: Duration) -> Self {
10936        self.request_options.timeout = Some(value);
10937        self
10938    }
10939
10940    pub(crate) fn query(&self) -> Result<Query, Error> {
10941        let mut query = Query::default();
10942        query.push("sort", &self.sort);
10943        query.push("t", &self.t);
10944        query.push("limit", &self.limit);
10945        query.push("freshness", &self.freshness);
10946        query.push("cursor", &self.cursor);
10947        Ok(query)
10948    }
10949}
10950
10951/// One page returned by `reddit.trending.posts.list`.
10952pub type RedditTrendingPostsPage = Page<RedditPost>;
10953
10954/// Options for `testData.list`.
10955#[derive(Clone, Debug, Default, PartialEq)]
10956#[non_exhaustive]
10957pub struct TestDataOptions {
10958    /// Provider-specific public-data filter for this operation.
10959    pub platform: Option<crate::options::Platform>,
10960    /// Provider-specific public-data filter for this operation. One of `profile`,
10961    /// `post`, `comment`, `hashtag`, `location`, `music`, `category`, `list`, `entity`,
10962    /// `subreddit`, `rule`, `wiki`, `trophy`, `playlist`, `transcript`, `product`,
10963    /// `chart`, `files`, `storyboard`, or `frame`.
10964    pub resource: Option<String>,
10965    /// Provider-specific public-data filter for this operation.
10966    pub operation: Option<String>,
10967    /// Provider-specific public-data filter for this operation.
10968    pub traits: Option<String>,
10969    /// Provider-specific public-data filter for this operation.
10970    pub status: Option<i64>,
10971    /// Provider-specific public-data filter for this operation.
10972    pub error_code: Option<String>,
10973    /// Provider-specific public-data filter for this operation.
10974    pub search: Option<String>,
10975    /// Maximum number of results to return. The API default is `100`. Accepts 1 to 100.
10976    pub limit: Option<i64>,
10977    /// Retry and timeout controls for this request.
10978    pub request_options: RequestOptions,
10979}
10980
10981impl TestDataOptions {
10982    /// Creates options that use the API and client defaults.
10983    pub fn new() -> Self {
10984        Self::default()
10985    }
10986
10987    /// Provider-specific public-data filter for this operation.
10988    pub fn platform(mut self, value: crate::options::Platform) -> Self {
10989        self.platform = Some(value);
10990        self
10991    }
10992
10993    /// Provider-specific public-data filter for this operation. One of `profile`,
10994    /// `post`, `comment`, `hashtag`, `location`, `music`, `category`, `list`, `entity`,
10995    /// `subreddit`, `rule`, `wiki`, `trophy`, `playlist`, `transcript`, `product`,
10996    /// `chart`, `files`, `storyboard`, or `frame`.
10997    pub fn resource(mut self, value: impl Into<String>) -> Self {
10998        self.resource = Some(value.into());
10999        self
11000    }
11001
11002    /// Provider-specific public-data filter for this operation.
11003    pub fn operation(mut self, value: impl Into<String>) -> Self {
11004        self.operation = Some(value.into());
11005        self
11006    }
11007
11008    /// Provider-specific public-data filter for this operation.
11009    pub fn traits(mut self, value: impl Into<String>) -> Self {
11010        self.traits = Some(value.into());
11011        self
11012    }
11013
11014    /// Provider-specific public-data filter for this operation.
11015    pub fn status(mut self, value: i64) -> Self {
11016        self.status = Some(value);
11017        self
11018    }
11019
11020    /// Provider-specific public-data filter for this operation.
11021    pub fn error_code(mut self, value: impl Into<String>) -> Self {
11022        self.error_code = Some(value.into());
11023        self
11024    }
11025
11026    /// Provider-specific public-data filter for this operation.
11027    pub fn search(mut self, value: impl Into<String>) -> Self {
11028        self.search = Some(value.into());
11029        self
11030    }
11031
11032    /// Maximum number of results to return. The API default is `100`. Accepts 1 to 100.
11033    pub fn limit(mut self, value: i64) -> Self {
11034        self.limit = Some(value);
11035        self
11036    }
11037
11038    /// Sets the retry attempts after the first request.
11039    pub fn max_retries(mut self, value: u32) -> Self {
11040        self.request_options.max_retries = Some(value);
11041        self
11042    }
11043
11044    /// Sets the timeout for each attempt.
11045    pub fn timeout(mut self, value: Duration) -> Self {
11046        self.request_options.timeout = Some(value);
11047        self
11048    }
11049
11050    pub(crate) fn query(&self) -> Result<Query, Error> {
11051        let mut query = Query::default();
11052        query.push("platform", &self.platform);
11053        query.push("resource", &self.resource);
11054        query.push("operation", &self.operation);
11055        query.push("traits", &self.traits);
11056        query.push("status", &self.status);
11057        query.push("errorCode", &self.error_code);
11058        query.push("search", &self.search);
11059        query.push("limit", &self.limit);
11060        Ok(query)
11061    }
11062}
11063
11064/// Typed result of `testData.list`.
11065pub type TestDataResponse = Response<TestDataCatalog>;
11066
11067/// Options for `testData.entry.get`.
11068#[derive(Clone, Debug, Default, PartialEq)]
11069#[non_exhaustive]
11070pub struct TestDataEntryOptions {
11071    /// Retry and timeout controls for this request.
11072    pub request_options: RequestOptions,
11073}
11074
11075impl TestDataEntryOptions {
11076    /// Creates options that use the API and client defaults.
11077    pub fn new() -> Self {
11078        Self::default()
11079    }
11080
11081    /// Sets the retry attempts after the first request.
11082    pub fn max_retries(mut self, value: u32) -> Self {
11083        self.request_options.max_retries = Some(value);
11084        self
11085    }
11086
11087    /// Sets the timeout for each attempt.
11088    pub fn timeout(mut self, value: Duration) -> Self {
11089        self.request_options.timeout = Some(value);
11090        self
11091    }
11092
11093    pub(crate) fn query(&self) -> Result<Query, Error> {
11094        Ok(Query::default())
11095    }
11096}
11097
11098/// Typed result of `testData.entry.get`.
11099pub type TestDataEntryResponse = Response<TestDataEntry>;
11100
11101/// Options for `tiktok.effect.get`.
11102#[derive(Clone, Debug, Default, PartialEq)]
11103#[non_exhaustive]
11104pub struct TikTokEffectOptions {
11105    /// Maximum accepted data age. The default is 24h.
11106    pub freshness: Option<crate::options::Freshness>,
11107    /// Retry and timeout controls for this request.
11108    pub request_options: RequestOptions,
11109}
11110
11111impl TikTokEffectOptions {
11112    /// Creates options that use the API and client defaults.
11113    pub fn new() -> Self {
11114        Self::default()
11115    }
11116
11117    /// Maximum accepted data age. The default is 24h.
11118    pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
11119        self.freshness = Some(value);
11120        self
11121    }
11122
11123    /// Sets the retry attempts after the first request.
11124    pub fn max_retries(mut self, value: u32) -> Self {
11125        self.request_options.max_retries = Some(value);
11126        self
11127    }
11128
11129    /// Sets the timeout for each attempt.
11130    pub fn timeout(mut self, value: Duration) -> Self {
11131        self.request_options.timeout = Some(value);
11132        self
11133    }
11134
11135    pub(crate) fn query(&self) -> Result<Query, Error> {
11136        let mut query = Query::default();
11137        query.push("freshness", &self.freshness);
11138        Ok(query)
11139    }
11140}
11141
11142/// Typed result of `tiktok.effect.get`.
11143pub type TikTokEffectResponse = Response<TikTokEffect>;
11144
11145/// Options for `tiktok.effect.posts.list`.
11146#[derive(Clone, Debug, Default, PartialEq)]
11147#[non_exhaustive]
11148pub struct TikTokEffectPostsOptions {
11149    /// Maximum accepted data age. The default is 24h.
11150    pub freshness: Option<crate::options::Freshness>,
11151    /// Opaque cursor returned by the previous page.
11152    pub cursor: Option<String>,
11153    /// Retry and timeout controls for this request.
11154    pub request_options: RequestOptions,
11155}
11156
11157impl TikTokEffectPostsOptions {
11158    /// Creates options that use the API and client defaults.
11159    pub fn new() -> Self {
11160        Self::default()
11161    }
11162
11163    /// Maximum accepted data age. The default is 24h.
11164    pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
11165        self.freshness = Some(value);
11166        self
11167    }
11168
11169    /// Opaque cursor returned by the previous page.
11170    pub fn cursor(mut self, value: impl Into<String>) -> Self {
11171        self.cursor = Some(value.into());
11172        self
11173    }
11174
11175    /// Sets the retry attempts after the first request.
11176    pub fn max_retries(mut self, value: u32) -> Self {
11177        self.request_options.max_retries = Some(value);
11178        self
11179    }
11180
11181    /// Sets the timeout for each attempt.
11182    pub fn timeout(mut self, value: Duration) -> Self {
11183        self.request_options.timeout = Some(value);
11184        self
11185    }
11186
11187    pub(crate) fn query(&self) -> Result<Query, Error> {
11188        let mut query = Query::default();
11189        query.push("freshness", &self.freshness);
11190        query.push("cursor", &self.cursor);
11191        Ok(query)
11192    }
11193}
11194
11195/// One page returned by `tiktok.effect.posts.list`.
11196pub type TikTokEffectPostsPage = Page<TikTokPost>;
11197
11198/// Options for `tiktok.effects.list`.
11199#[derive(Clone, Debug, PartialEq)]
11200#[non_exhaustive]
11201pub struct TikTokEffectsOptions {
11202    /// Comma-separated opaque native IDs.
11203    pub ids: String,
11204    /// Maximum accepted data age. The default is 24h.
11205    pub freshness: Option<crate::options::Freshness>,
11206    /// Opaque cursor returned by the previous page.
11207    pub cursor: Option<String>,
11208    /// Retry and timeout controls for this request.
11209    pub request_options: RequestOptions,
11210}
11211
11212impl TikTokEffectsOptions {
11213    /// Creates options with the required values.
11214    pub fn new(ids: impl Into<String>) -> Self {
11215        Self {
11216            ids: ids.into(),
11217            freshness: None,
11218            cursor: None,
11219            request_options: RequestOptions::default(),
11220        }
11221    }
11222
11223    /// Maximum accepted data age. The default is 24h.
11224    pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
11225        self.freshness = Some(value);
11226        self
11227    }
11228
11229    /// Opaque cursor returned by the previous page.
11230    pub fn cursor(mut self, value: impl Into<String>) -> Self {
11231        self.cursor = Some(value.into());
11232        self
11233    }
11234
11235    /// Sets the retry attempts after the first request.
11236    pub fn max_retries(mut self, value: u32) -> Self {
11237        self.request_options.max_retries = Some(value);
11238        self
11239    }
11240
11241    /// Sets the timeout for each attempt.
11242    pub fn timeout(mut self, value: Duration) -> Self {
11243        self.request_options.timeout = Some(value);
11244        self
11245    }
11246
11247    pub(crate) fn query(&self) -> Result<Query, Error> {
11248        let mut query = Query::default();
11249        query.require("ids", &self.ids)?;
11250        query.push("freshness", &self.freshness);
11251        query.push("cursor", &self.cursor);
11252        Ok(query)
11253    }
11254}
11255
11256/// One page returned by `tiktok.effects.list`.
11257pub type TikTokEffectsPage = Page<TikTokEffect>;
11258
11259/// Options for `tiktok.hashtag.get`.
11260#[derive(Clone, Debug, Default, PartialEq)]
11261#[non_exhaustive]
11262pub struct TikTokHashtagOptions {
11263    /// Maximum accepted data age. The default is 24h.
11264    pub freshness: Option<crate::options::Freshness>,
11265    /// Retry and timeout controls for this request.
11266    pub request_options: RequestOptions,
11267}
11268
11269impl TikTokHashtagOptions {
11270    /// Creates options that use the API and client defaults.
11271    pub fn new() -> Self {
11272        Self::default()
11273    }
11274
11275    /// Maximum accepted data age. The default is 24h.
11276    pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
11277        self.freshness = Some(value);
11278        self
11279    }
11280
11281    /// Sets the retry attempts after the first request.
11282    pub fn max_retries(mut self, value: u32) -> Self {
11283        self.request_options.max_retries = Some(value);
11284        self
11285    }
11286
11287    /// Sets the timeout for each attempt.
11288    pub fn timeout(mut self, value: Duration) -> Self {
11289        self.request_options.timeout = Some(value);
11290        self
11291    }
11292
11293    pub(crate) fn query(&self) -> Result<Query, Error> {
11294        let mut query = Query::default();
11295        query.push("freshness", &self.freshness);
11296        Ok(query)
11297    }
11298}
11299
11300/// Typed result of `tiktok.hashtag.get`.
11301pub type TikTokHashtagResponse = Response<TikTokHashtag>;
11302
11303/// Options for `tiktok.hashtag.posts.list`.
11304#[derive(Clone, Debug, Default, PartialEq)]
11305#[non_exhaustive]
11306pub struct TikTokHashtagPostsOptions {
11307    /// Maximum accepted data age. The default is 24h.
11308    pub freshness: Option<crate::options::Freshness>,
11309    /// Opaque cursor returned by the previous page.
11310    pub cursor: Option<String>,
11311    /// Retry and timeout controls for this request.
11312    pub request_options: RequestOptions,
11313}
11314
11315impl TikTokHashtagPostsOptions {
11316    /// Creates options that use the API and client defaults.
11317    pub fn new() -> Self {
11318        Self::default()
11319    }
11320
11321    /// Maximum accepted data age. The default is 24h.
11322    pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
11323        self.freshness = Some(value);
11324        self
11325    }
11326
11327    /// Opaque cursor returned by the previous page.
11328    pub fn cursor(mut self, value: impl Into<String>) -> Self {
11329        self.cursor = Some(value.into());
11330        self
11331    }
11332
11333    /// Sets the retry attempts after the first request.
11334    pub fn max_retries(mut self, value: u32) -> Self {
11335        self.request_options.max_retries = Some(value);
11336        self
11337    }
11338
11339    /// Sets the timeout for each attempt.
11340    pub fn timeout(mut self, value: Duration) -> Self {
11341        self.request_options.timeout = Some(value);
11342        self
11343    }
11344
11345    pub(crate) fn query(&self) -> Result<Query, Error> {
11346        let mut query = Query::default();
11347        query.push("freshness", &self.freshness);
11348        query.push("cursor", &self.cursor);
11349        Ok(query)
11350    }
11351}
11352
11353/// One page returned by `tiktok.hashtag.posts.list`.
11354pub type TikTokHashtagPostsPage = Page<TikTokPost>;
11355
11356/// Options for `tiktok.location.get`.
11357#[derive(Clone, Debug, Default, PartialEq)]
11358#[non_exhaustive]
11359pub struct TikTokLocationOptions {
11360    /// Maximum accepted data age. The default is 24h.
11361    pub freshness: Option<crate::options::Freshness>,
11362    /// Retry and timeout controls for this request.
11363    pub request_options: RequestOptions,
11364}
11365
11366impl TikTokLocationOptions {
11367    /// Creates options that use the API and client defaults.
11368    pub fn new() -> Self {
11369        Self::default()
11370    }
11371
11372    /// Maximum accepted data age. The default is 24h.
11373    pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
11374        self.freshness = Some(value);
11375        self
11376    }
11377
11378    /// Sets the retry attempts after the first request.
11379    pub fn max_retries(mut self, value: u32) -> Self {
11380        self.request_options.max_retries = Some(value);
11381        self
11382    }
11383
11384    /// Sets the timeout for each attempt.
11385    pub fn timeout(mut self, value: Duration) -> Self {
11386        self.request_options.timeout = Some(value);
11387        self
11388    }
11389
11390    pub(crate) fn query(&self) -> Result<Query, Error> {
11391        let mut query = Query::default();
11392        query.push("freshness", &self.freshness);
11393        Ok(query)
11394    }
11395}
11396
11397/// Typed result of `tiktok.location.get`.
11398pub type TikTokLocationResponse = Response<TikTokLocation>;
11399
11400/// Options for `tiktok.location.posts.list`.
11401#[derive(Clone, Debug, Default, PartialEq)]
11402#[non_exhaustive]
11403pub struct TikTokLocationPostsOptions {
11404    /// Maximum accepted data age. The default is 24h.
11405    pub freshness: Option<crate::options::Freshness>,
11406    /// Opaque cursor returned by the previous page.
11407    pub cursor: Option<String>,
11408    /// Retry and timeout controls for this request.
11409    pub request_options: RequestOptions,
11410}
11411
11412impl TikTokLocationPostsOptions {
11413    /// Creates options that use the API and client defaults.
11414    pub fn new() -> Self {
11415        Self::default()
11416    }
11417
11418    /// Maximum accepted data age. The default is 24h.
11419    pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
11420        self.freshness = Some(value);
11421        self
11422    }
11423
11424    /// Opaque cursor returned by the previous page.
11425    pub fn cursor(mut self, value: impl Into<String>) -> Self {
11426        self.cursor = Some(value.into());
11427        self
11428    }
11429
11430    /// Sets the retry attempts after the first request.
11431    pub fn max_retries(mut self, value: u32) -> Self {
11432        self.request_options.max_retries = Some(value);
11433        self
11434    }
11435
11436    /// Sets the timeout for each attempt.
11437    pub fn timeout(mut self, value: Duration) -> Self {
11438        self.request_options.timeout = Some(value);
11439        self
11440    }
11441
11442    pub(crate) fn query(&self) -> Result<Query, Error> {
11443        let mut query = Query::default();
11444        query.push("freshness", &self.freshness);
11445        query.push("cursor", &self.cursor);
11446        Ok(query)
11447    }
11448}
11449
11450/// One page returned by `tiktok.location.posts.list`.
11451pub type TikTokLocationPostsPage = Page<TikTokPost>;
11452
11453/// Options for `tiktok.music.get`.
11454#[derive(Clone, Debug, Default, PartialEq)]
11455#[non_exhaustive]
11456pub struct TikTokMusicOptions {
11457    /// Maximum accepted data age. The default is 24h.
11458    pub freshness: Option<crate::options::Freshness>,
11459    /// Retry and timeout controls for this request.
11460    pub request_options: RequestOptions,
11461}
11462
11463impl TikTokMusicOptions {
11464    /// Creates options that use the API and client defaults.
11465    pub fn new() -> Self {
11466        Self::default()
11467    }
11468
11469    /// Maximum accepted data age. The default is 24h.
11470    pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
11471        self.freshness = Some(value);
11472        self
11473    }
11474
11475    /// Sets the retry attempts after the first request.
11476    pub fn max_retries(mut self, value: u32) -> Self {
11477        self.request_options.max_retries = Some(value);
11478        self
11479    }
11480
11481    /// Sets the timeout for each attempt.
11482    pub fn timeout(mut self, value: Duration) -> Self {
11483        self.request_options.timeout = Some(value);
11484        self
11485    }
11486
11487    pub(crate) fn query(&self) -> Result<Query, Error> {
11488        let mut query = Query::default();
11489        query.push("freshness", &self.freshness);
11490        Ok(query)
11491    }
11492}
11493
11494/// Typed result of `tiktok.music.get`.
11495pub type TikTokMusicResponse = Response<TikTokMusic>;
11496
11497/// Options for `tiktok.music.posts.list`.
11498#[derive(Clone, Debug, Default, PartialEq)]
11499#[non_exhaustive]
11500pub struct TikTokMusicPostsOptions {
11501    /// Maximum accepted data age. The default is 24h.
11502    pub freshness: Option<crate::options::Freshness>,
11503    /// Opaque cursor returned by the previous page.
11504    pub cursor: Option<String>,
11505    /// Retry and timeout controls for this request.
11506    pub request_options: RequestOptions,
11507}
11508
11509impl TikTokMusicPostsOptions {
11510    /// Creates options that use the API and client defaults.
11511    pub fn new() -> Self {
11512        Self::default()
11513    }
11514
11515    /// Maximum accepted data age. The default is 24h.
11516    pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
11517        self.freshness = Some(value);
11518        self
11519    }
11520
11521    /// Opaque cursor returned by the previous page.
11522    pub fn cursor(mut self, value: impl Into<String>) -> Self {
11523        self.cursor = Some(value.into());
11524        self
11525    }
11526
11527    /// Sets the retry attempts after the first request.
11528    pub fn max_retries(mut self, value: u32) -> Self {
11529        self.request_options.max_retries = Some(value);
11530        self
11531    }
11532
11533    /// Sets the timeout for each attempt.
11534    pub fn timeout(mut self, value: Duration) -> Self {
11535        self.request_options.timeout = Some(value);
11536        self
11537    }
11538
11539    pub(crate) fn query(&self) -> Result<Query, Error> {
11540        let mut query = Query::default();
11541        query.push("freshness", &self.freshness);
11542        query.push("cursor", &self.cursor);
11543        Ok(query)
11544    }
11545}
11546
11547/// One page returned by `tiktok.music.posts.list`.
11548pub type TikTokMusicPostsPage = Page<TikTokPost>;
11549
11550/// Options for `tiktok.post.get`.
11551#[derive(Clone, Debug, Default, PartialEq)]
11552#[non_exhaustive]
11553pub struct TikTokPostOptions {
11554    /// Maximum accepted data age. The default is 24h.
11555    pub freshness: Option<crate::options::Freshness>,
11556    /// Retry and timeout controls for this request.
11557    pub request_options: RequestOptions,
11558}
11559
11560impl TikTokPostOptions {
11561    /// Creates options that use the API and client defaults.
11562    pub fn new() -> Self {
11563        Self::default()
11564    }
11565
11566    /// Maximum accepted data age. The default is 24h.
11567    pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
11568        self.freshness = Some(value);
11569        self
11570    }
11571
11572    /// Sets the retry attempts after the first request.
11573    pub fn max_retries(mut self, value: u32) -> Self {
11574        self.request_options.max_retries = Some(value);
11575        self
11576    }
11577
11578    /// Sets the timeout for each attempt.
11579    pub fn timeout(mut self, value: Duration) -> Self {
11580        self.request_options.timeout = Some(value);
11581        self
11582    }
11583
11584    pub(crate) fn query(&self) -> Result<Query, Error> {
11585        let mut query = Query::default();
11586        query.push("freshness", &self.freshness);
11587        Ok(query)
11588    }
11589}
11590
11591/// Typed result of `tiktok.post.get`.
11592pub type TikTokPostResponse = Response<TikTokPost>;
11593
11594/// Options for `tiktok.post.comment.replies.list`.
11595#[derive(Clone, Debug, Default, PartialEq)]
11596#[non_exhaustive]
11597pub struct TikTokPostCommentRepliesOptions {
11598    /// Maximum accepted data age. The default is 24h.
11599    pub freshness: Option<crate::options::Freshness>,
11600    /// Opaque cursor returned by the previous page.
11601    pub cursor: Option<String>,
11602    /// Retry and timeout controls for this request.
11603    pub request_options: RequestOptions,
11604}
11605
11606impl TikTokPostCommentRepliesOptions {
11607    /// Creates options that use the API and client defaults.
11608    pub fn new() -> Self {
11609        Self::default()
11610    }
11611
11612    /// Maximum accepted data age. The default is 24h.
11613    pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
11614        self.freshness = Some(value);
11615        self
11616    }
11617
11618    /// Opaque cursor returned by the previous page.
11619    pub fn cursor(mut self, value: impl Into<String>) -> Self {
11620        self.cursor = Some(value.into());
11621        self
11622    }
11623
11624    /// Sets the retry attempts after the first request.
11625    pub fn max_retries(mut self, value: u32) -> Self {
11626        self.request_options.max_retries = Some(value);
11627        self
11628    }
11629
11630    /// Sets the timeout for each attempt.
11631    pub fn timeout(mut self, value: Duration) -> Self {
11632        self.request_options.timeout = Some(value);
11633        self
11634    }
11635
11636    pub(crate) fn query(&self) -> Result<Query, Error> {
11637        let mut query = Query::default();
11638        query.push("freshness", &self.freshness);
11639        query.push("cursor", &self.cursor);
11640        Ok(query)
11641    }
11642}
11643
11644/// One page returned by `tiktok.post.comment.replies.list`.
11645pub type TikTokPostCommentRepliesPage = Page<TikTokComment>;
11646
11647/// Options for `tiktok.post.comments.list`.
11648#[derive(Clone, Debug, Default, PartialEq)]
11649#[non_exhaustive]
11650pub struct TikTokPostCommentsOptions {
11651    /// Maximum accepted data age. The default is 24h.
11652    pub freshness: Option<crate::options::Freshness>,
11653    /// Opaque cursor returned by the previous page.
11654    pub cursor: Option<String>,
11655    /// Retry and timeout controls for this request.
11656    pub request_options: RequestOptions,
11657}
11658
11659impl TikTokPostCommentsOptions {
11660    /// Creates options that use the API and client defaults.
11661    pub fn new() -> Self {
11662        Self::default()
11663    }
11664
11665    /// Maximum accepted data age. The default is 24h.
11666    pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
11667        self.freshness = Some(value);
11668        self
11669    }
11670
11671    /// Opaque cursor returned by the previous page.
11672    pub fn cursor(mut self, value: impl Into<String>) -> Self {
11673        self.cursor = Some(value.into());
11674        self
11675    }
11676
11677    /// Sets the retry attempts after the first request.
11678    pub fn max_retries(mut self, value: u32) -> Self {
11679        self.request_options.max_retries = Some(value);
11680        self
11681    }
11682
11683    /// Sets the timeout for each attempt.
11684    pub fn timeout(mut self, value: Duration) -> Self {
11685        self.request_options.timeout = Some(value);
11686        self
11687    }
11688
11689    pub(crate) fn query(&self) -> Result<Query, Error> {
11690        let mut query = Query::default();
11691        query.push("freshness", &self.freshness);
11692        query.push("cursor", &self.cursor);
11693        Ok(query)
11694    }
11695}
11696
11697/// One page returned by `tiktok.post.comments.list`.
11698pub type TikTokPostCommentsPage = Page<TikTokComment>;
11699
11700/// Options for `tiktok.profile.get`.
11701#[derive(Clone, Debug, Default, PartialEq)]
11702#[non_exhaustive]
11703pub struct TikTokProfileOptions {
11704    /// Maximum accepted data age. The default is 24h.
11705    pub freshness: Option<crate::options::Freshness>,
11706    /// Retry and timeout controls for this request.
11707    pub request_options: RequestOptions,
11708}
11709
11710impl TikTokProfileOptions {
11711    /// Creates options that use the API and client defaults.
11712    pub fn new() -> Self {
11713        Self::default()
11714    }
11715
11716    /// Maximum accepted data age. The default is 24h.
11717    pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
11718        self.freshness = Some(value);
11719        self
11720    }
11721
11722    /// Sets the retry attempts after the first request.
11723    pub fn max_retries(mut self, value: u32) -> Self {
11724        self.request_options.max_retries = Some(value);
11725        self
11726    }
11727
11728    /// Sets the timeout for each attempt.
11729    pub fn timeout(mut self, value: Duration) -> Self {
11730        self.request_options.timeout = Some(value);
11731        self
11732    }
11733
11734    pub(crate) fn query(&self) -> Result<Query, Error> {
11735        let mut query = Query::default();
11736        query.push("freshness", &self.freshness);
11737        Ok(query)
11738    }
11739}
11740
11741/// Typed result of `tiktok.profile.get`.
11742pub type TikTokProfileResponse = Response<TikTokProfile>;
11743
11744/// Options for `tiktok.profile.followers.list`.
11745#[derive(Clone, Debug, Default, PartialEq)]
11746#[non_exhaustive]
11747pub struct TikTokProfileFollowersOptions {
11748    /// Maximum accepted data age. The default is 24h.
11749    pub freshness: Option<crate::options::Freshness>,
11750    /// Opaque cursor returned by the previous page.
11751    pub cursor: Option<String>,
11752    /// Retry and timeout controls for this request.
11753    pub request_options: RequestOptions,
11754}
11755
11756impl TikTokProfileFollowersOptions {
11757    /// Creates options that use the API and client defaults.
11758    pub fn new() -> Self {
11759        Self::default()
11760    }
11761
11762    /// Maximum accepted data age. The default is 24h.
11763    pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
11764        self.freshness = Some(value);
11765        self
11766    }
11767
11768    /// Opaque cursor returned by the previous page.
11769    pub fn cursor(mut self, value: impl Into<String>) -> Self {
11770        self.cursor = Some(value.into());
11771        self
11772    }
11773
11774    /// Sets the retry attempts after the first request.
11775    pub fn max_retries(mut self, value: u32) -> Self {
11776        self.request_options.max_retries = Some(value);
11777        self
11778    }
11779
11780    /// Sets the timeout for each attempt.
11781    pub fn timeout(mut self, value: Duration) -> Self {
11782        self.request_options.timeout = Some(value);
11783        self
11784    }
11785
11786    pub(crate) fn query(&self) -> Result<Query, Error> {
11787        let mut query = Query::default();
11788        query.push("freshness", &self.freshness);
11789        query.push("cursor", &self.cursor);
11790        Ok(query)
11791    }
11792}
11793
11794/// One page returned by `tiktok.profile.followers.list`.
11795pub type TikTokProfileFollowersPage = Page<TikTokProfile>;
11796
11797/// Options for `tiktok.profile.following.list`.
11798#[derive(Clone, Debug, Default, PartialEq)]
11799#[non_exhaustive]
11800pub struct TikTokProfileFollowingOptions {
11801    /// Maximum accepted data age. The default is 24h.
11802    pub freshness: Option<crate::options::Freshness>,
11803    /// Opaque cursor returned by the previous page.
11804    pub cursor: Option<String>,
11805    /// Retry and timeout controls for this request.
11806    pub request_options: RequestOptions,
11807}
11808
11809impl TikTokProfileFollowingOptions {
11810    /// Creates options that use the API and client defaults.
11811    pub fn new() -> Self {
11812        Self::default()
11813    }
11814
11815    /// Maximum accepted data age. The default is 24h.
11816    pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
11817        self.freshness = Some(value);
11818        self
11819    }
11820
11821    /// Opaque cursor returned by the previous page.
11822    pub fn cursor(mut self, value: impl Into<String>) -> Self {
11823        self.cursor = Some(value.into());
11824        self
11825    }
11826
11827    /// Sets the retry attempts after the first request.
11828    pub fn max_retries(mut self, value: u32) -> Self {
11829        self.request_options.max_retries = Some(value);
11830        self
11831    }
11832
11833    /// Sets the timeout for each attempt.
11834    pub fn timeout(mut self, value: Duration) -> Self {
11835        self.request_options.timeout = Some(value);
11836        self
11837    }
11838
11839    pub(crate) fn query(&self) -> Result<Query, Error> {
11840        let mut query = Query::default();
11841        query.push("freshness", &self.freshness);
11842        query.push("cursor", &self.cursor);
11843        Ok(query)
11844    }
11845}
11846
11847/// One page returned by `tiktok.profile.following.list`.
11848pub type TikTokProfileFollowingPage = Page<TikTokProfile>;
11849
11850/// Options for `tiktok.profile.likedPosts.list`.
11851#[derive(Clone, Debug, Default, PartialEq)]
11852#[non_exhaustive]
11853pub struct TikTokProfileLikedPostsOptions {
11854    /// Maximum accepted data age. The default is 24h.
11855    pub freshness: Option<crate::options::Freshness>,
11856    /// Opaque cursor returned by the previous page.
11857    pub cursor: Option<String>,
11858    /// Retry and timeout controls for this request.
11859    pub request_options: RequestOptions,
11860}
11861
11862impl TikTokProfileLikedPostsOptions {
11863    /// Creates options that use the API and client defaults.
11864    pub fn new() -> Self {
11865        Self::default()
11866    }
11867
11868    /// Maximum accepted data age. The default is 24h.
11869    pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
11870        self.freshness = Some(value);
11871        self
11872    }
11873
11874    /// Opaque cursor returned by the previous page.
11875    pub fn cursor(mut self, value: impl Into<String>) -> Self {
11876        self.cursor = Some(value.into());
11877        self
11878    }
11879
11880    /// Sets the retry attempts after the first request.
11881    pub fn max_retries(mut self, value: u32) -> Self {
11882        self.request_options.max_retries = Some(value);
11883        self
11884    }
11885
11886    /// Sets the timeout for each attempt.
11887    pub fn timeout(mut self, value: Duration) -> Self {
11888        self.request_options.timeout = Some(value);
11889        self
11890    }
11891
11892    pub(crate) fn query(&self) -> Result<Query, Error> {
11893        let mut query = Query::default();
11894        query.push("freshness", &self.freshness);
11895        query.push("cursor", &self.cursor);
11896        Ok(query)
11897    }
11898}
11899
11900/// One page returned by `tiktok.profile.likedPosts.list`.
11901pub type TikTokProfileLikedPostsPage = Page<TikTokPost>;
11902
11903/// Options for `tiktok.profile.playlist.get`.
11904#[derive(Clone, Debug, Default, PartialEq)]
11905#[non_exhaustive]
11906pub struct TikTokProfilePlaylistOptions {
11907    /// Maximum accepted data age. The default is 24h.
11908    pub freshness: Option<crate::options::Freshness>,
11909    /// Retry and timeout controls for this request.
11910    pub request_options: RequestOptions,
11911}
11912
11913impl TikTokProfilePlaylistOptions {
11914    /// Creates options that use the API and client defaults.
11915    pub fn new() -> Self {
11916        Self::default()
11917    }
11918
11919    /// Maximum accepted data age. The default is 24h.
11920    pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
11921        self.freshness = Some(value);
11922        self
11923    }
11924
11925    /// Sets the retry attempts after the first request.
11926    pub fn max_retries(mut self, value: u32) -> Self {
11927        self.request_options.max_retries = Some(value);
11928        self
11929    }
11930
11931    /// Sets the timeout for each attempt.
11932    pub fn timeout(mut self, value: Duration) -> Self {
11933        self.request_options.timeout = Some(value);
11934        self
11935    }
11936
11937    pub(crate) fn query(&self) -> Result<Query, Error> {
11938        let mut query = Query::default();
11939        query.push("freshness", &self.freshness);
11940        Ok(query)
11941    }
11942}
11943
11944/// Typed result of `tiktok.profile.playlist.get`.
11945pub type TikTokProfilePlaylistResponse = Response<TikTokPlaylist>;
11946
11947/// Options for `tiktok.profile.playlist.posts.list`.
11948#[derive(Clone, Debug, Default, PartialEq)]
11949#[non_exhaustive]
11950pub struct TikTokProfilePlaylistPostsOptions {
11951    /// Maximum accepted data age. The default is 24h.
11952    pub freshness: Option<crate::options::Freshness>,
11953    /// Opaque cursor returned by the previous page.
11954    pub cursor: Option<String>,
11955    /// Retry and timeout controls for this request.
11956    pub request_options: RequestOptions,
11957}
11958
11959impl TikTokProfilePlaylistPostsOptions {
11960    /// Creates options that use the API and client defaults.
11961    pub fn new() -> Self {
11962        Self::default()
11963    }
11964
11965    /// Maximum accepted data age. The default is 24h.
11966    pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
11967        self.freshness = Some(value);
11968        self
11969    }
11970
11971    /// Opaque cursor returned by the previous page.
11972    pub fn cursor(mut self, value: impl Into<String>) -> Self {
11973        self.cursor = Some(value.into());
11974        self
11975    }
11976
11977    /// Sets the retry attempts after the first request.
11978    pub fn max_retries(mut self, value: u32) -> Self {
11979        self.request_options.max_retries = Some(value);
11980        self
11981    }
11982
11983    /// Sets the timeout for each attempt.
11984    pub fn timeout(mut self, value: Duration) -> Self {
11985        self.request_options.timeout = Some(value);
11986        self
11987    }
11988
11989    pub(crate) fn query(&self) -> Result<Query, Error> {
11990        let mut query = Query::default();
11991        query.push("freshness", &self.freshness);
11992        query.push("cursor", &self.cursor);
11993        Ok(query)
11994    }
11995}
11996
11997/// One page returned by `tiktok.profile.playlist.posts.list`.
11998pub type TikTokProfilePlaylistPostsPage = Page<TikTokPost>;
11999
12000/// Options for `tiktok.profile.playlists.list`.
12001#[derive(Clone, Debug, Default, PartialEq)]
12002#[non_exhaustive]
12003pub struct TikTokProfilePlaylistsOptions {
12004    /// Maximum accepted data age. The default is 24h.
12005    pub freshness: Option<crate::options::Freshness>,
12006    /// Opaque cursor returned by the previous page.
12007    pub cursor: Option<String>,
12008    /// Retry and timeout controls for this request.
12009    pub request_options: RequestOptions,
12010}
12011
12012impl TikTokProfilePlaylistsOptions {
12013    /// Creates options that use the API and client defaults.
12014    pub fn new() -> Self {
12015        Self::default()
12016    }
12017
12018    /// Maximum accepted data age. The default is 24h.
12019    pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
12020        self.freshness = Some(value);
12021        self
12022    }
12023
12024    /// Opaque cursor returned by the previous page.
12025    pub fn cursor(mut self, value: impl Into<String>) -> Self {
12026        self.cursor = Some(value.into());
12027        self
12028    }
12029
12030    /// Sets the retry attempts after the first request.
12031    pub fn max_retries(mut self, value: u32) -> Self {
12032        self.request_options.max_retries = Some(value);
12033        self
12034    }
12035
12036    /// Sets the timeout for each attempt.
12037    pub fn timeout(mut self, value: Duration) -> Self {
12038        self.request_options.timeout = Some(value);
12039        self
12040    }
12041
12042    pub(crate) fn query(&self) -> Result<Query, Error> {
12043        let mut query = Query::default();
12044        query.push("freshness", &self.freshness);
12045        query.push("cursor", &self.cursor);
12046        Ok(query)
12047    }
12048}
12049
12050/// One page returned by `tiktok.profile.playlists.list`.
12051pub type TikTokProfilePlaylistsPage = Page<TikTokPlaylist>;
12052
12053/// Options for `tiktok.profile.posts.list`.
12054#[derive(Clone, Debug, Default, PartialEq)]
12055#[non_exhaustive]
12056pub struct TikTokProfilePostsOptions {
12057    /// Maximum accepted data age. The default is 24h.
12058    pub freshness: Option<crate::options::Freshness>,
12059    /// Opaque cursor returned by the previous page.
12060    pub cursor: Option<String>,
12061    /// Return posts captured at or after this RFC 3339 timestamp.
12062    pub since: Option<chrono::DateTime<chrono::Utc>>,
12063    /// Retry and timeout controls for this request.
12064    pub request_options: RequestOptions,
12065}
12066
12067impl TikTokProfilePostsOptions {
12068    /// Creates options that use the API and client defaults.
12069    pub fn new() -> Self {
12070        Self::default()
12071    }
12072
12073    /// Maximum accepted data age. The default is 24h.
12074    pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
12075        self.freshness = Some(value);
12076        self
12077    }
12078
12079    /// Opaque cursor returned by the previous page.
12080    pub fn cursor(mut self, value: impl Into<String>) -> Self {
12081        self.cursor = Some(value.into());
12082        self
12083    }
12084
12085    /// Return posts captured at or after this RFC 3339 timestamp.
12086    pub fn since(mut self, value: chrono::DateTime<chrono::Utc>) -> Self {
12087        self.since = Some(value);
12088        self
12089    }
12090
12091    /// Sets the retry attempts after the first request.
12092    pub fn max_retries(mut self, value: u32) -> Self {
12093        self.request_options.max_retries = Some(value);
12094        self
12095    }
12096
12097    /// Sets the timeout for each attempt.
12098    pub fn timeout(mut self, value: Duration) -> Self {
12099        self.request_options.timeout = Some(value);
12100        self
12101    }
12102
12103    pub(crate) fn query(&self) -> Result<Query, Error> {
12104        let mut query = Query::default();
12105        query.push("freshness", &self.freshness);
12106        query.push("cursor", &self.cursor);
12107        query.push("since", &self.since);
12108        Ok(query)
12109    }
12110}
12111
12112/// One page returned by `tiktok.profile.posts.list`.
12113pub type TikTokProfilePostsPage = Page<TikTokPost>;
12114
12115/// Options for `tiktok.search.hashtags.list`.
12116#[derive(Clone, Debug, PartialEq)]
12117#[non_exhaustive]
12118pub struct TikTokSearchHashtagsOptions {
12119    /// Public search query.
12120    pub q: String,
12121    /// Maximum accepted data age. The default is 24h.
12122    pub freshness: Option<crate::options::Freshness>,
12123    /// Opaque cursor returned by the previous page.
12124    pub cursor: Option<String>,
12125    /// Retry and timeout controls for this request.
12126    pub request_options: RequestOptions,
12127}
12128
12129impl TikTokSearchHashtagsOptions {
12130    /// Creates options with the required values.
12131    pub fn new(q: impl Into<String>) -> Self {
12132        Self {
12133            q: q.into(),
12134            freshness: None,
12135            cursor: None,
12136            request_options: RequestOptions::default(),
12137        }
12138    }
12139
12140    /// Maximum accepted data age. The default is 24h.
12141    pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
12142        self.freshness = Some(value);
12143        self
12144    }
12145
12146    /// Opaque cursor returned by the previous page.
12147    pub fn cursor(mut self, value: impl Into<String>) -> Self {
12148        self.cursor = Some(value.into());
12149        self
12150    }
12151
12152    /// Sets the retry attempts after the first request.
12153    pub fn max_retries(mut self, value: u32) -> Self {
12154        self.request_options.max_retries = Some(value);
12155        self
12156    }
12157
12158    /// Sets the timeout for each attempt.
12159    pub fn timeout(mut self, value: Duration) -> Self {
12160        self.request_options.timeout = Some(value);
12161        self
12162    }
12163
12164    pub(crate) fn query(&self) -> Result<Query, Error> {
12165        let mut query = Query::default();
12166        query.require("q", &self.q)?;
12167        query.push("freshness", &self.freshness);
12168        query.push("cursor", &self.cursor);
12169        Ok(query)
12170    }
12171}
12172
12173/// One page returned by `tiktok.search.hashtags.list`.
12174pub type TikTokSearchHashtagsPage = Page<TikTokHashtag>;
12175
12176/// Options for `tiktok.search.locations.list`.
12177#[derive(Clone, Debug, PartialEq)]
12178#[non_exhaustive]
12179pub struct TikTokSearchLocationsOptions {
12180    /// Public search query.
12181    pub q: String,
12182    /// Maximum accepted data age. The default is 24h.
12183    pub freshness: Option<crate::options::Freshness>,
12184    /// Opaque cursor returned by the previous page.
12185    pub cursor: Option<String>,
12186    /// Retry and timeout controls for this request.
12187    pub request_options: RequestOptions,
12188}
12189
12190impl TikTokSearchLocationsOptions {
12191    /// Creates options with the required values.
12192    pub fn new(q: impl Into<String>) -> Self {
12193        Self {
12194            q: q.into(),
12195            freshness: None,
12196            cursor: None,
12197            request_options: RequestOptions::default(),
12198        }
12199    }
12200
12201    /// Maximum accepted data age. The default is 24h.
12202    pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
12203        self.freshness = Some(value);
12204        self
12205    }
12206
12207    /// Opaque cursor returned by the previous page.
12208    pub fn cursor(mut self, value: impl Into<String>) -> Self {
12209        self.cursor = Some(value.into());
12210        self
12211    }
12212
12213    /// Sets the retry attempts after the first request.
12214    pub fn max_retries(mut self, value: u32) -> Self {
12215        self.request_options.max_retries = Some(value);
12216        self
12217    }
12218
12219    /// Sets the timeout for each attempt.
12220    pub fn timeout(mut self, value: Duration) -> Self {
12221        self.request_options.timeout = Some(value);
12222        self
12223    }
12224
12225    pub(crate) fn query(&self) -> Result<Query, Error> {
12226        let mut query = Query::default();
12227        query.require("q", &self.q)?;
12228        query.push("freshness", &self.freshness);
12229        query.push("cursor", &self.cursor);
12230        Ok(query)
12231    }
12232}
12233
12234/// One page returned by `tiktok.search.locations.list`.
12235pub type TikTokSearchLocationsPage = Page<TikTokLocation>;
12236
12237/// Options for `tiktok.search.music.list`.
12238#[derive(Clone, Debug, PartialEq)]
12239#[non_exhaustive]
12240pub struct TikTokSearchMusicOptions {
12241    /// Public search query.
12242    pub q: String,
12243    /// Maximum accepted data age. The default is 24h.
12244    pub freshness: Option<crate::options::Freshness>,
12245    /// Opaque cursor returned by the previous page.
12246    pub cursor: Option<String>,
12247    /// Retry and timeout controls for this request.
12248    pub request_options: RequestOptions,
12249}
12250
12251impl TikTokSearchMusicOptions {
12252    /// Creates options with the required values.
12253    pub fn new(q: impl Into<String>) -> Self {
12254        Self {
12255            q: q.into(),
12256            freshness: None,
12257            cursor: None,
12258            request_options: RequestOptions::default(),
12259        }
12260    }
12261
12262    /// Maximum accepted data age. The default is 24h.
12263    pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
12264        self.freshness = Some(value);
12265        self
12266    }
12267
12268    /// Opaque cursor returned by the previous page.
12269    pub fn cursor(mut self, value: impl Into<String>) -> Self {
12270        self.cursor = Some(value.into());
12271        self
12272    }
12273
12274    /// Sets the retry attempts after the first request.
12275    pub fn max_retries(mut self, value: u32) -> Self {
12276        self.request_options.max_retries = Some(value);
12277        self
12278    }
12279
12280    /// Sets the timeout for each attempt.
12281    pub fn timeout(mut self, value: Duration) -> Self {
12282        self.request_options.timeout = Some(value);
12283        self
12284    }
12285
12286    pub(crate) fn query(&self) -> Result<Query, Error> {
12287        let mut query = Query::default();
12288        query.require("q", &self.q)?;
12289        query.push("freshness", &self.freshness);
12290        query.push("cursor", &self.cursor);
12291        Ok(query)
12292    }
12293}
12294
12295/// One page returned by `tiktok.search.music.list`.
12296pub type TikTokSearchMusicPage = Page<TikTokMusic>;
12297
12298/// Options for `tiktok.search.posts.list`.
12299#[derive(Clone, Debug, PartialEq)]
12300#[non_exhaustive]
12301pub struct TikTokSearchPostsOptions {
12302    /// Public search query.
12303    pub q: String,
12304    /// Maximum accepted data age. The default is 24h.
12305    pub freshness: Option<crate::options::Freshness>,
12306    /// Opaque cursor returned by the previous page.
12307    pub cursor: Option<String>,
12308    /// Retry and timeout controls for this request.
12309    pub request_options: RequestOptions,
12310}
12311
12312impl TikTokSearchPostsOptions {
12313    /// Creates options with the required values.
12314    pub fn new(q: impl Into<String>) -> Self {
12315        Self {
12316            q: q.into(),
12317            freshness: None,
12318            cursor: None,
12319            request_options: RequestOptions::default(),
12320        }
12321    }
12322
12323    /// Maximum accepted data age. The default is 24h.
12324    pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
12325        self.freshness = Some(value);
12326        self
12327    }
12328
12329    /// Opaque cursor returned by the previous page.
12330    pub fn cursor(mut self, value: impl Into<String>) -> Self {
12331        self.cursor = Some(value.into());
12332        self
12333    }
12334
12335    /// Sets the retry attempts after the first request.
12336    pub fn max_retries(mut self, value: u32) -> Self {
12337        self.request_options.max_retries = Some(value);
12338        self
12339    }
12340
12341    /// Sets the timeout for each attempt.
12342    pub fn timeout(mut self, value: Duration) -> Self {
12343        self.request_options.timeout = Some(value);
12344        self
12345    }
12346
12347    pub(crate) fn query(&self) -> Result<Query, Error> {
12348        let mut query = Query::default();
12349        query.require("q", &self.q)?;
12350        query.push("freshness", &self.freshness);
12351        query.push("cursor", &self.cursor);
12352        Ok(query)
12353    }
12354}
12355
12356/// One page returned by `tiktok.search.posts.list`.
12357pub type TikTokSearchPostsPage = Page<TikTokPost>;
12358
12359/// Options for `tiktok.search.profiles.list`.
12360#[derive(Clone, Debug, PartialEq)]
12361#[non_exhaustive]
12362pub struct TikTokSearchProfilesOptions {
12363    /// Public search query.
12364    pub q: String,
12365    /// Maximum accepted data age. The default is 24h.
12366    pub freshness: Option<crate::options::Freshness>,
12367    /// Opaque cursor returned by the previous page.
12368    pub cursor: Option<String>,
12369    /// Retry and timeout controls for this request.
12370    pub request_options: RequestOptions,
12371}
12372
12373impl TikTokSearchProfilesOptions {
12374    /// Creates options with the required values.
12375    pub fn new(q: impl Into<String>) -> Self {
12376        Self {
12377            q: q.into(),
12378            freshness: None,
12379            cursor: None,
12380            request_options: RequestOptions::default(),
12381        }
12382    }
12383
12384    /// Maximum accepted data age. The default is 24h.
12385    pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
12386        self.freshness = Some(value);
12387        self
12388    }
12389
12390    /// Opaque cursor returned by the previous page.
12391    pub fn cursor(mut self, value: impl Into<String>) -> Self {
12392        self.cursor = Some(value.into());
12393        self
12394    }
12395
12396    /// Sets the retry attempts after the first request.
12397    pub fn max_retries(mut self, value: u32) -> Self {
12398        self.request_options.max_retries = Some(value);
12399        self
12400    }
12401
12402    /// Sets the timeout for each attempt.
12403    pub fn timeout(mut self, value: Duration) -> Self {
12404        self.request_options.timeout = Some(value);
12405        self
12406    }
12407
12408    pub(crate) fn query(&self) -> Result<Query, Error> {
12409        let mut query = Query::default();
12410        query.require("q", &self.q)?;
12411        query.push("freshness", &self.freshness);
12412        query.push("cursor", &self.cursor);
12413        Ok(query)
12414    }
12415}
12416
12417/// One page returned by `tiktok.search.profiles.list`.
12418pub type TikTokSearchProfilesPage = Page<TikTokProfile>;
12419
12420/// Options for `tiktok.trending.categories.list`.
12421#[derive(Clone, Debug, Default, PartialEq)]
12422#[non_exhaustive]
12423pub struct TikTokTrendingCategoriesOptions {
12424    /// Maximum accepted data age. The default is 24h.
12425    pub freshness: Option<crate::options::Freshness>,
12426    /// Opaque cursor returned by the previous page.
12427    pub cursor: Option<String>,
12428    /// Retry and timeout controls for this request.
12429    pub request_options: RequestOptions,
12430}
12431
12432impl TikTokTrendingCategoriesOptions {
12433    /// Creates options that use the API and client defaults.
12434    pub fn new() -> Self {
12435        Self::default()
12436    }
12437
12438    /// Maximum accepted data age. The default is 24h.
12439    pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
12440        self.freshness = Some(value);
12441        self
12442    }
12443
12444    /// Opaque cursor returned by the previous page.
12445    pub fn cursor(mut self, value: impl Into<String>) -> Self {
12446        self.cursor = Some(value.into());
12447        self
12448    }
12449
12450    /// Sets the retry attempts after the first request.
12451    pub fn max_retries(mut self, value: u32) -> Self {
12452        self.request_options.max_retries = Some(value);
12453        self
12454    }
12455
12456    /// Sets the timeout for each attempt.
12457    pub fn timeout(mut self, value: Duration) -> Self {
12458        self.request_options.timeout = Some(value);
12459        self
12460    }
12461
12462    pub(crate) fn query(&self) -> Result<Query, Error> {
12463        let mut query = Query::default();
12464        query.push("freshness", &self.freshness);
12465        query.push("cursor", &self.cursor);
12466        Ok(query)
12467    }
12468}
12469
12470/// One page returned by `tiktok.trending.categories.list`.
12471pub type TikTokTrendingCategoriesPage = Page<TikTokCategory>;
12472
12473/// Options for `tiktok.trending.music.list`.
12474#[derive(Clone, Debug, Default, PartialEq)]
12475#[non_exhaustive]
12476pub struct TikTokTrendingMusicOptions {
12477    /// Maximum accepted data age. The default is 24h.
12478    pub freshness: Option<crate::options::Freshness>,
12479    /// Opaque cursor returned by the previous page.
12480    pub cursor: Option<String>,
12481    /// Retry and timeout controls for this request.
12482    pub request_options: RequestOptions,
12483}
12484
12485impl TikTokTrendingMusicOptions {
12486    /// Creates options that use the API and client defaults.
12487    pub fn new() -> Self {
12488        Self::default()
12489    }
12490
12491    /// Maximum accepted data age. The default is 24h.
12492    pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
12493        self.freshness = Some(value);
12494        self
12495    }
12496
12497    /// Opaque cursor returned by the previous page.
12498    pub fn cursor(mut self, value: impl Into<String>) -> Self {
12499        self.cursor = Some(value.into());
12500        self
12501    }
12502
12503    /// Sets the retry attempts after the first request.
12504    pub fn max_retries(mut self, value: u32) -> Self {
12505        self.request_options.max_retries = Some(value);
12506        self
12507    }
12508
12509    /// Sets the timeout for each attempt.
12510    pub fn timeout(mut self, value: Duration) -> Self {
12511        self.request_options.timeout = Some(value);
12512        self
12513    }
12514
12515    pub(crate) fn query(&self) -> Result<Query, Error> {
12516        let mut query = Query::default();
12517        query.push("freshness", &self.freshness);
12518        query.push("cursor", &self.cursor);
12519        Ok(query)
12520    }
12521}
12522
12523/// One page returned by `tiktok.trending.music.list`.
12524pub type TikTokTrendingMusicPage = Page<TikTokMusic>;
12525
12526/// Options for `tiktok.trending.posts.list`.
12527#[derive(Clone, Debug, Default, PartialEq)]
12528#[non_exhaustive]
12529pub struct TikTokTrendingPostsOptions {
12530    /// Maximum accepted data age. The default is 24h.
12531    pub freshness: Option<crate::options::Freshness>,
12532    /// Opaque cursor returned by the previous page.
12533    pub cursor: Option<String>,
12534    /// Retry and timeout controls for this request.
12535    pub request_options: RequestOptions,
12536}
12537
12538impl TikTokTrendingPostsOptions {
12539    /// Creates options that use the API and client defaults.
12540    pub fn new() -> Self {
12541        Self::default()
12542    }
12543
12544    /// Maximum accepted data age. The default is 24h.
12545    pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
12546        self.freshness = Some(value);
12547        self
12548    }
12549
12550    /// Opaque cursor returned by the previous page.
12551    pub fn cursor(mut self, value: impl Into<String>) -> Self {
12552        self.cursor = Some(value.into());
12553        self
12554    }
12555
12556    /// Sets the retry attempts after the first request.
12557    pub fn max_retries(mut self, value: u32) -> Self {
12558        self.request_options.max_retries = Some(value);
12559        self
12560    }
12561
12562    /// Sets the timeout for each attempt.
12563    pub fn timeout(mut self, value: Duration) -> Self {
12564        self.request_options.timeout = Some(value);
12565        self
12566    }
12567
12568    pub(crate) fn query(&self) -> Result<Query, Error> {
12569        let mut query = Query::default();
12570        query.push("freshness", &self.freshness);
12571        query.push("cursor", &self.cursor);
12572        Ok(query)
12573    }
12574}
12575
12576/// One page returned by `tiktok.trending.posts.list`.
12577pub type TikTokTrendingPostsPage = Page<TikTokPost>;
12578
12579/// Options for `twitter.list.posts.list`.
12580#[derive(Clone, Debug, Default, PartialEq)]
12581#[non_exhaustive]
12582pub struct TwitterListPostsOptions {
12583    /// Maximum accepted data age. The default is 24h.
12584    pub freshness: Option<crate::options::Freshness>,
12585    /// Opaque cursor returned by the previous page.
12586    pub cursor: Option<String>,
12587    /// Retry and timeout controls for this request.
12588    pub request_options: RequestOptions,
12589}
12590
12591impl TwitterListPostsOptions {
12592    /// Creates options that use the API and client defaults.
12593    pub fn new() -> Self {
12594        Self::default()
12595    }
12596
12597    /// Maximum accepted data age. The default is 24h.
12598    pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
12599        self.freshness = Some(value);
12600        self
12601    }
12602
12603    /// Opaque cursor returned by the previous page.
12604    pub fn cursor(mut self, value: impl Into<String>) -> Self {
12605        self.cursor = Some(value.into());
12606        self
12607    }
12608
12609    /// Sets the retry attempts after the first request.
12610    pub fn max_retries(mut self, value: u32) -> Self {
12611        self.request_options.max_retries = Some(value);
12612        self
12613    }
12614
12615    /// Sets the timeout for each attempt.
12616    pub fn timeout(mut self, value: Duration) -> Self {
12617        self.request_options.timeout = Some(value);
12618        self
12619    }
12620
12621    pub(crate) fn query(&self) -> Result<Query, Error> {
12622        let mut query = Query::default();
12623        query.push("freshness", &self.freshness);
12624        query.push("cursor", &self.cursor);
12625        Ok(query)
12626    }
12627}
12628
12629/// One page returned by `twitter.list.posts.list`.
12630pub type TwitterListPostsPage = Page<TwitterPost>;
12631
12632/// Options for `twitter.post.get`.
12633#[derive(Clone, Debug, Default, PartialEq)]
12634#[non_exhaustive]
12635pub struct TwitterPostOptions {
12636    /// Maximum accepted data age. The default is 24h.
12637    pub freshness: Option<crate::options::Freshness>,
12638    /// Retry and timeout controls for this request.
12639    pub request_options: RequestOptions,
12640}
12641
12642impl TwitterPostOptions {
12643    /// Creates options that use the API and client defaults.
12644    pub fn new() -> Self {
12645        Self::default()
12646    }
12647
12648    /// Maximum accepted data age. The default is 24h.
12649    pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
12650        self.freshness = Some(value);
12651        self
12652    }
12653
12654    /// Sets the retry attempts after the first request.
12655    pub fn max_retries(mut self, value: u32) -> Self {
12656        self.request_options.max_retries = Some(value);
12657        self
12658    }
12659
12660    /// Sets the timeout for each attempt.
12661    pub fn timeout(mut self, value: Duration) -> Self {
12662        self.request_options.timeout = Some(value);
12663        self
12664    }
12665
12666    pub(crate) fn query(&self) -> Result<Query, Error> {
12667        let mut query = Query::default();
12668        query.push("freshness", &self.freshness);
12669        Ok(query)
12670    }
12671}
12672
12673/// Typed result of `twitter.post.get`.
12674pub type TwitterPostResponse = Response<TwitterPost>;
12675
12676/// Options for `twitter.post.comment.replies.list`.
12677#[derive(Clone, Debug, Default, PartialEq)]
12678#[non_exhaustive]
12679pub struct TwitterPostCommentRepliesOptions {
12680    /// Maximum accepted data age. The default is 24h.
12681    pub freshness: Option<crate::options::Freshness>,
12682    /// Opaque cursor returned by the previous page.
12683    pub cursor: Option<String>,
12684    /// Retry and timeout controls for this request.
12685    pub request_options: RequestOptions,
12686}
12687
12688impl TwitterPostCommentRepliesOptions {
12689    /// Creates options that use the API and client defaults.
12690    pub fn new() -> Self {
12691        Self::default()
12692    }
12693
12694    /// Maximum accepted data age. The default is 24h.
12695    pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
12696        self.freshness = Some(value);
12697        self
12698    }
12699
12700    /// Opaque cursor returned by the previous page.
12701    pub fn cursor(mut self, value: impl Into<String>) -> Self {
12702        self.cursor = Some(value.into());
12703        self
12704    }
12705
12706    /// Sets the retry attempts after the first request.
12707    pub fn max_retries(mut self, value: u32) -> Self {
12708        self.request_options.max_retries = Some(value);
12709        self
12710    }
12711
12712    /// Sets the timeout for each attempt.
12713    pub fn timeout(mut self, value: Duration) -> Self {
12714        self.request_options.timeout = Some(value);
12715        self
12716    }
12717
12718    pub(crate) fn query(&self) -> Result<Query, Error> {
12719        let mut query = Query::default();
12720        query.push("freshness", &self.freshness);
12721        query.push("cursor", &self.cursor);
12722        Ok(query)
12723    }
12724}
12725
12726/// One page returned by `twitter.post.comment.replies.list`.
12727pub type TwitterPostCommentRepliesPage = Page<TwitterPost>;
12728
12729/// Options for `twitter.post.comments.list`.
12730#[derive(Clone, Debug, Default, PartialEq)]
12731#[non_exhaustive]
12732pub struct TwitterPostCommentsOptions {
12733    /// Maximum accepted data age. The default is 24h.
12734    pub freshness: Option<crate::options::Freshness>,
12735    /// Opaque cursor returned by the previous page.
12736    pub cursor: Option<String>,
12737    /// Retry and timeout controls for this request.
12738    pub request_options: RequestOptions,
12739}
12740
12741impl TwitterPostCommentsOptions {
12742    /// Creates options that use the API and client defaults.
12743    pub fn new() -> Self {
12744        Self::default()
12745    }
12746
12747    /// Maximum accepted data age. The default is 24h.
12748    pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
12749        self.freshness = Some(value);
12750        self
12751    }
12752
12753    /// Opaque cursor returned by the previous page.
12754    pub fn cursor(mut self, value: impl Into<String>) -> Self {
12755        self.cursor = Some(value.into());
12756        self
12757    }
12758
12759    /// Sets the retry attempts after the first request.
12760    pub fn max_retries(mut self, value: u32) -> Self {
12761        self.request_options.max_retries = Some(value);
12762        self
12763    }
12764
12765    /// Sets the timeout for each attempt.
12766    pub fn timeout(mut self, value: Duration) -> Self {
12767        self.request_options.timeout = Some(value);
12768        self
12769    }
12770
12771    pub(crate) fn query(&self) -> Result<Query, Error> {
12772        let mut query = Query::default();
12773        query.push("freshness", &self.freshness);
12774        query.push("cursor", &self.cursor);
12775        Ok(query)
12776    }
12777}
12778
12779/// One page returned by `twitter.post.comments.list`.
12780pub type TwitterPostCommentsPage = Page<TwitterPost>;
12781
12782/// Options for `twitter.post.reposters.list`.
12783#[derive(Clone, Debug, Default, PartialEq)]
12784#[non_exhaustive]
12785pub struct TwitterPostRepostersOptions {
12786    /// Maximum accepted data age. The default is 24h.
12787    pub freshness: Option<crate::options::Freshness>,
12788    /// Opaque cursor returned by the previous page.
12789    pub cursor: Option<String>,
12790    /// Retry and timeout controls for this request.
12791    pub request_options: RequestOptions,
12792}
12793
12794impl TwitterPostRepostersOptions {
12795    /// Creates options that use the API and client defaults.
12796    pub fn new() -> Self {
12797        Self::default()
12798    }
12799
12800    /// Maximum accepted data age. The default is 24h.
12801    pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
12802        self.freshness = Some(value);
12803        self
12804    }
12805
12806    /// Opaque cursor returned by the previous page.
12807    pub fn cursor(mut self, value: impl Into<String>) -> Self {
12808        self.cursor = Some(value.into());
12809        self
12810    }
12811
12812    /// Sets the retry attempts after the first request.
12813    pub fn max_retries(mut self, value: u32) -> Self {
12814        self.request_options.max_retries = Some(value);
12815        self
12816    }
12817
12818    /// Sets the timeout for each attempt.
12819    pub fn timeout(mut self, value: Duration) -> Self {
12820        self.request_options.timeout = Some(value);
12821        self
12822    }
12823
12824    pub(crate) fn query(&self) -> Result<Query, Error> {
12825        let mut query = Query::default();
12826        query.push("freshness", &self.freshness);
12827        query.push("cursor", &self.cursor);
12828        Ok(query)
12829    }
12830}
12831
12832/// One page returned by `twitter.post.reposters.list`.
12833pub type TwitterPostRepostersPage = Page<TwitterProfile>;
12834
12835/// Options for `twitter.profile.get`.
12836#[derive(Clone, Debug, Default, PartialEq)]
12837#[non_exhaustive]
12838pub struct TwitterProfileOptions {
12839    /// Maximum accepted data age. The default is 24h.
12840    pub freshness: Option<crate::options::Freshness>,
12841    /// Retry and timeout controls for this request.
12842    pub request_options: RequestOptions,
12843}
12844
12845impl TwitterProfileOptions {
12846    /// Creates options that use the API and client defaults.
12847    pub fn new() -> Self {
12848        Self::default()
12849    }
12850
12851    /// Maximum accepted data age. The default is 24h.
12852    pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
12853        self.freshness = Some(value);
12854        self
12855    }
12856
12857    /// Sets the retry attempts after the first request.
12858    pub fn max_retries(mut self, value: u32) -> Self {
12859        self.request_options.max_retries = Some(value);
12860        self
12861    }
12862
12863    /// Sets the timeout for each attempt.
12864    pub fn timeout(mut self, value: Duration) -> Self {
12865        self.request_options.timeout = Some(value);
12866        self
12867    }
12868
12869    pub(crate) fn query(&self) -> Result<Query, Error> {
12870        let mut query = Query::default();
12871        query.push("freshness", &self.freshness);
12872        Ok(query)
12873    }
12874}
12875
12876/// Typed result of `twitter.profile.get`.
12877pub type TwitterProfileResponse = Response<TwitterProfile>;
12878
12879/// Options for `twitter.profile.followers.list`.
12880#[derive(Clone, Debug, Default, PartialEq)]
12881#[non_exhaustive]
12882pub struct TwitterProfileFollowersOptions {
12883    /// Maximum accepted data age. The default is 24h.
12884    pub freshness: Option<crate::options::Freshness>,
12885    /// Opaque cursor returned by the previous page.
12886    pub cursor: Option<String>,
12887    /// Retry and timeout controls for this request.
12888    pub request_options: RequestOptions,
12889}
12890
12891impl TwitterProfileFollowersOptions {
12892    /// Creates options that use the API and client defaults.
12893    pub fn new() -> Self {
12894        Self::default()
12895    }
12896
12897    /// Maximum accepted data age. The default is 24h.
12898    pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
12899        self.freshness = Some(value);
12900        self
12901    }
12902
12903    /// Opaque cursor returned by the previous page.
12904    pub fn cursor(mut self, value: impl Into<String>) -> Self {
12905        self.cursor = Some(value.into());
12906        self
12907    }
12908
12909    /// Sets the retry attempts after the first request.
12910    pub fn max_retries(mut self, value: u32) -> Self {
12911        self.request_options.max_retries = Some(value);
12912        self
12913    }
12914
12915    /// Sets the timeout for each attempt.
12916    pub fn timeout(mut self, value: Duration) -> Self {
12917        self.request_options.timeout = Some(value);
12918        self
12919    }
12920
12921    pub(crate) fn query(&self) -> Result<Query, Error> {
12922        let mut query = Query::default();
12923        query.push("freshness", &self.freshness);
12924        query.push("cursor", &self.cursor);
12925        Ok(query)
12926    }
12927}
12928
12929/// One page returned by `twitter.profile.followers.list`.
12930pub type TwitterProfileFollowersPage = Page<TwitterProfile>;
12931
12932/// Options for `twitter.profile.following.list`.
12933#[derive(Clone, Debug, Default, PartialEq)]
12934#[non_exhaustive]
12935pub struct TwitterProfileFollowingOptions {
12936    /// Maximum accepted data age. The default is 24h.
12937    pub freshness: Option<crate::options::Freshness>,
12938    /// Opaque cursor returned by the previous page.
12939    pub cursor: Option<String>,
12940    /// Retry and timeout controls for this request.
12941    pub request_options: RequestOptions,
12942}
12943
12944impl TwitterProfileFollowingOptions {
12945    /// Creates options that use the API and client defaults.
12946    pub fn new() -> Self {
12947        Self::default()
12948    }
12949
12950    /// Maximum accepted data age. The default is 24h.
12951    pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
12952        self.freshness = Some(value);
12953        self
12954    }
12955
12956    /// Opaque cursor returned by the previous page.
12957    pub fn cursor(mut self, value: impl Into<String>) -> Self {
12958        self.cursor = Some(value.into());
12959        self
12960    }
12961
12962    /// Sets the retry attempts after the first request.
12963    pub fn max_retries(mut self, value: u32) -> Self {
12964        self.request_options.max_retries = Some(value);
12965        self
12966    }
12967
12968    /// Sets the timeout for each attempt.
12969    pub fn timeout(mut self, value: Duration) -> Self {
12970        self.request_options.timeout = Some(value);
12971        self
12972    }
12973
12974    pub(crate) fn query(&self) -> Result<Query, Error> {
12975        let mut query = Query::default();
12976        query.push("freshness", &self.freshness);
12977        query.push("cursor", &self.cursor);
12978        Ok(query)
12979    }
12980}
12981
12982/// One page returned by `twitter.profile.following.list`.
12983pub type TwitterProfileFollowingPage = Page<TwitterProfile>;
12984
12985/// Options for `twitter.profile.media.list`.
12986#[derive(Clone, Debug, Default, PartialEq)]
12987#[non_exhaustive]
12988pub struct TwitterProfileMediaOptions {
12989    /// Maximum accepted data age. The default is 24h.
12990    pub freshness: Option<crate::options::Freshness>,
12991    /// Opaque cursor returned by the previous page.
12992    pub cursor: Option<String>,
12993    /// Retry and timeout controls for this request.
12994    pub request_options: RequestOptions,
12995}
12996
12997impl TwitterProfileMediaOptions {
12998    /// Creates options that use the API and client defaults.
12999    pub fn new() -> Self {
13000        Self::default()
13001    }
13002
13003    /// Maximum accepted data age. The default is 24h.
13004    pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
13005        self.freshness = Some(value);
13006        self
13007    }
13008
13009    /// Opaque cursor returned by the previous page.
13010    pub fn cursor(mut self, value: impl Into<String>) -> Self {
13011        self.cursor = Some(value.into());
13012        self
13013    }
13014
13015    /// Sets the retry attempts after the first request.
13016    pub fn max_retries(mut self, value: u32) -> Self {
13017        self.request_options.max_retries = Some(value);
13018        self
13019    }
13020
13021    /// Sets the timeout for each attempt.
13022    pub fn timeout(mut self, value: Duration) -> Self {
13023        self.request_options.timeout = Some(value);
13024        self
13025    }
13026
13027    pub(crate) fn query(&self) -> Result<Query, Error> {
13028        let mut query = Query::default();
13029        query.push("freshness", &self.freshness);
13030        query.push("cursor", &self.cursor);
13031        Ok(query)
13032    }
13033}
13034
13035/// One page returned by `twitter.profile.media.list`.
13036pub type TwitterProfileMediaPage = Page<TwitterPost>;
13037
13038/// Options for `twitter.profile.posts.list`.
13039#[derive(Clone, Debug, Default, PartialEq)]
13040#[non_exhaustive]
13041pub struct TwitterProfilePostsOptions {
13042    /// Maximum accepted data age. The default is 24h.
13043    pub freshness: Option<crate::options::Freshness>,
13044    /// Opaque cursor returned by the previous page.
13045    pub cursor: Option<String>,
13046    /// Return posts captured at or after this RFC 3339 timestamp.
13047    pub since: Option<chrono::DateTime<chrono::Utc>>,
13048    /// Retry and timeout controls for this request.
13049    pub request_options: RequestOptions,
13050}
13051
13052impl TwitterProfilePostsOptions {
13053    /// Creates options that use the API and client defaults.
13054    pub fn new() -> Self {
13055        Self::default()
13056    }
13057
13058    /// Maximum accepted data age. The default is 24h.
13059    pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
13060        self.freshness = Some(value);
13061        self
13062    }
13063
13064    /// Opaque cursor returned by the previous page.
13065    pub fn cursor(mut self, value: impl Into<String>) -> Self {
13066        self.cursor = Some(value.into());
13067        self
13068    }
13069
13070    /// Return posts captured at or after this RFC 3339 timestamp.
13071    pub fn since(mut self, value: chrono::DateTime<chrono::Utc>) -> Self {
13072        self.since = Some(value);
13073        self
13074    }
13075
13076    /// Sets the retry attempts after the first request.
13077    pub fn max_retries(mut self, value: u32) -> Self {
13078        self.request_options.max_retries = Some(value);
13079        self
13080    }
13081
13082    /// Sets the timeout for each attempt.
13083    pub fn timeout(mut self, value: Duration) -> Self {
13084        self.request_options.timeout = Some(value);
13085        self
13086    }
13087
13088    pub(crate) fn query(&self) -> Result<Query, Error> {
13089        let mut query = Query::default();
13090        query.push("freshness", &self.freshness);
13091        query.push("cursor", &self.cursor);
13092        query.push("since", &self.since);
13093        Ok(query)
13094    }
13095}
13096
13097/// One page returned by `twitter.profile.posts.list`.
13098pub type TwitterProfilePostsPage = Page<TwitterPost>;
13099
13100/// Options for `twitter.profile.replies.list`.
13101#[derive(Clone, Debug, Default, PartialEq)]
13102#[non_exhaustive]
13103pub struct TwitterProfileRepliesOptions {
13104    /// Maximum accepted data age. The default is 24h.
13105    pub freshness: Option<crate::options::Freshness>,
13106    /// Opaque cursor returned by the previous page.
13107    pub cursor: Option<String>,
13108    /// Retry and timeout controls for this request.
13109    pub request_options: RequestOptions,
13110}
13111
13112impl TwitterProfileRepliesOptions {
13113    /// Creates options that use the API and client defaults.
13114    pub fn new() -> Self {
13115        Self::default()
13116    }
13117
13118    /// Maximum accepted data age. The default is 24h.
13119    pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
13120        self.freshness = Some(value);
13121        self
13122    }
13123
13124    /// Opaque cursor returned by the previous page.
13125    pub fn cursor(mut self, value: impl Into<String>) -> Self {
13126        self.cursor = Some(value.into());
13127        self
13128    }
13129
13130    /// Sets the retry attempts after the first request.
13131    pub fn max_retries(mut self, value: u32) -> Self {
13132        self.request_options.max_retries = Some(value);
13133        self
13134    }
13135
13136    /// Sets the timeout for each attempt.
13137    pub fn timeout(mut self, value: Duration) -> Self {
13138        self.request_options.timeout = Some(value);
13139        self
13140    }
13141
13142    pub(crate) fn query(&self) -> Result<Query, Error> {
13143        let mut query = Query::default();
13144        query.push("freshness", &self.freshness);
13145        query.push("cursor", &self.cursor);
13146        Ok(query)
13147    }
13148}
13149
13150/// One page returned by `twitter.profile.replies.list`.
13151pub type TwitterProfileRepliesPage = Page<TwitterPost>;
13152
13153/// Options for `twitter.search.media.list`.
13154#[derive(Clone, Debug, PartialEq)]
13155#[non_exhaustive]
13156pub struct TwitterSearchMediaOptions {
13157    /// Public search query.
13158    pub q: String,
13159    /// Media type filter. One of `image`, or `video`.
13160    pub r#type: String,
13161    /// Maximum accepted data age. The default is 24h.
13162    pub freshness: Option<crate::options::Freshness>,
13163    /// Opaque cursor returned by the previous page.
13164    pub cursor: Option<String>,
13165    /// Retry and timeout controls for this request.
13166    pub request_options: RequestOptions,
13167}
13168
13169impl TwitterSearchMediaOptions {
13170    /// Creates options with the required values.
13171    pub fn new(q: impl Into<String>, r#type: impl Into<String>) -> Self {
13172        Self {
13173            q: q.into(),
13174            r#type: r#type.into(),
13175            freshness: None,
13176            cursor: None,
13177            request_options: RequestOptions::default(),
13178        }
13179    }
13180
13181    /// Maximum accepted data age. The default is 24h.
13182    pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
13183        self.freshness = Some(value);
13184        self
13185    }
13186
13187    /// Opaque cursor returned by the previous page.
13188    pub fn cursor(mut self, value: impl Into<String>) -> Self {
13189        self.cursor = Some(value.into());
13190        self
13191    }
13192
13193    /// Sets the retry attempts after the first request.
13194    pub fn max_retries(mut self, value: u32) -> Self {
13195        self.request_options.max_retries = Some(value);
13196        self
13197    }
13198
13199    /// Sets the timeout for each attempt.
13200    pub fn timeout(mut self, value: Duration) -> Self {
13201        self.request_options.timeout = Some(value);
13202        self
13203    }
13204
13205    pub(crate) fn query(&self) -> Result<Query, Error> {
13206        let mut query = Query::default();
13207        query.require("q", &self.q)?;
13208        query.require("type", &self.r#type)?;
13209        query.push("freshness", &self.freshness);
13210        query.push("cursor", &self.cursor);
13211        Ok(query)
13212    }
13213}
13214
13215/// One page returned by `twitter.search.media.list`.
13216pub type TwitterSearchMediaPage = Page<TwitterPost>;
13217
13218/// Options for `twitter.search.posts.list`.
13219#[derive(Clone, Debug, PartialEq)]
13220#[non_exhaustive]
13221pub struct TwitterSearchPostsOptions {
13222    /// Public search query.
13223    pub q: String,
13224    /// Result ordering for this operation. One of `latest`, or `top`. The API default
13225    /// is `latest`.
13226    pub sort: Option<String>,
13227    /// Maximum accepted data age. The default is 24h.
13228    pub freshness: Option<crate::options::Freshness>,
13229    /// Opaque cursor returned by the previous page.
13230    pub cursor: Option<String>,
13231    /// Retry and timeout controls for this request.
13232    pub request_options: RequestOptions,
13233}
13234
13235impl TwitterSearchPostsOptions {
13236    /// Creates options with the required values.
13237    pub fn new(q: impl Into<String>) -> Self {
13238        Self {
13239            q: q.into(),
13240            sort: None,
13241            freshness: None,
13242            cursor: None,
13243            request_options: RequestOptions::default(),
13244        }
13245    }
13246
13247    /// Result ordering for this operation. One of `latest`, or `top`. The API default
13248    /// is `latest`.
13249    pub fn sort(mut self, value: impl Into<String>) -> Self {
13250        self.sort = Some(value.into());
13251        self
13252    }
13253
13254    /// Maximum accepted data age. The default is 24h.
13255    pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
13256        self.freshness = Some(value);
13257        self
13258    }
13259
13260    /// Opaque cursor returned by the previous page.
13261    pub fn cursor(mut self, value: impl Into<String>) -> Self {
13262        self.cursor = Some(value.into());
13263        self
13264    }
13265
13266    /// Sets the retry attempts after the first request.
13267    pub fn max_retries(mut self, value: u32) -> Self {
13268        self.request_options.max_retries = Some(value);
13269        self
13270    }
13271
13272    /// Sets the timeout for each attempt.
13273    pub fn timeout(mut self, value: Duration) -> Self {
13274        self.request_options.timeout = Some(value);
13275        self
13276    }
13277
13278    pub(crate) fn query(&self) -> Result<Query, Error> {
13279        let mut query = Query::default();
13280        query.require("q", &self.q)?;
13281        query.push("sort", &self.sort);
13282        query.push("freshness", &self.freshness);
13283        query.push("cursor", &self.cursor);
13284        Ok(query)
13285    }
13286}
13287
13288/// One page returned by `twitter.search.posts.list`.
13289pub type TwitterSearchPostsPage = Page<TwitterPost>;
13290
13291/// Options for `twitter.search.suggestions.list`.
13292#[derive(Clone, Debug, PartialEq)]
13293#[non_exhaustive]
13294pub struct TwitterSearchSuggestionsOptions {
13295    /// Public search query.
13296    pub q: String,
13297    /// Maximum accepted data age. The default is 24h.
13298    pub freshness: Option<crate::options::Freshness>,
13299    /// Opaque cursor returned by the previous page.
13300    pub cursor: Option<String>,
13301    /// Retry and timeout controls for this request.
13302    pub request_options: RequestOptions,
13303}
13304
13305impl TwitterSearchSuggestionsOptions {
13306    /// Creates options with the required values.
13307    pub fn new(q: impl Into<String>) -> Self {
13308        Self {
13309            q: q.into(),
13310            freshness: None,
13311            cursor: None,
13312            request_options: RequestOptions::default(),
13313        }
13314    }
13315
13316    /// Maximum accepted data age. The default is 24h.
13317    pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
13318        self.freshness = Some(value);
13319        self
13320    }
13321
13322    /// Opaque cursor returned by the previous page.
13323    pub fn cursor(mut self, value: impl Into<String>) -> Self {
13324        self.cursor = Some(value.into());
13325        self
13326    }
13327
13328    /// Sets the retry attempts after the first request.
13329    pub fn max_retries(mut self, value: u32) -> Self {
13330        self.request_options.max_retries = Some(value);
13331        self
13332    }
13333
13334    /// Sets the timeout for each attempt.
13335    pub fn timeout(mut self, value: Duration) -> Self {
13336        self.request_options.timeout = Some(value);
13337        self
13338    }
13339
13340    pub(crate) fn query(&self) -> Result<Query, Error> {
13341        let mut query = Query::default();
13342        query.require("q", &self.q)?;
13343        query.push("freshness", &self.freshness);
13344        query.push("cursor", &self.cursor);
13345        Ok(query)
13346    }
13347}
13348
13349/// One page returned by `twitter.search.suggestions.list`.
13350pub type TwitterSearchSuggestionsPage = Page<TwitterProfile>;
13351
13352/// Options for `twitter.search.users.list`.
13353#[derive(Clone, Debug, PartialEq)]
13354#[non_exhaustive]
13355pub struct TwitterSearchUsersOptions {
13356    /// Public search query.
13357    pub q: String,
13358    /// Maximum accepted data age. The default is 24h.
13359    pub freshness: Option<crate::options::Freshness>,
13360    /// Opaque cursor returned by the previous page.
13361    pub cursor: Option<String>,
13362    /// Retry and timeout controls for this request.
13363    pub request_options: RequestOptions,
13364}
13365
13366impl TwitterSearchUsersOptions {
13367    /// Creates options with the required values.
13368    pub fn new(q: impl Into<String>) -> Self {
13369        Self {
13370            q: q.into(),
13371            freshness: None,
13372            cursor: None,
13373            request_options: RequestOptions::default(),
13374        }
13375    }
13376
13377    /// Maximum accepted data age. The default is 24h.
13378    pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
13379        self.freshness = Some(value);
13380        self
13381    }
13382
13383    /// Opaque cursor returned by the previous page.
13384    pub fn cursor(mut self, value: impl Into<String>) -> Self {
13385        self.cursor = Some(value.into());
13386        self
13387    }
13388
13389    /// Sets the retry attempts after the first request.
13390    pub fn max_retries(mut self, value: u32) -> Self {
13391        self.request_options.max_retries = Some(value);
13392        self
13393    }
13394
13395    /// Sets the timeout for each attempt.
13396    pub fn timeout(mut self, value: Duration) -> Self {
13397        self.request_options.timeout = Some(value);
13398        self
13399    }
13400
13401    pub(crate) fn query(&self) -> Result<Query, Error> {
13402        let mut query = Query::default();
13403        query.require("q", &self.q)?;
13404        query.push("freshness", &self.freshness);
13405        query.push("cursor", &self.cursor);
13406        Ok(query)
13407    }
13408}
13409
13410/// One page returned by `twitter.search.users.list`.
13411pub type TwitterSearchUsersPage = Page<TwitterProfile>;
13412
13413/// Options for `youtube.charts.artists.list`.
13414#[derive(Clone, Debug, Default, PartialEq)]
13415#[non_exhaustive]
13416pub struct YouTubeChartsArtistsOptions {
13417    /// Two-letter ISO 3166 country code. The default is US.
13418    pub country: Option<String>,
13419    /// Maximum accepted data age. The default is 24h.
13420    pub freshness: Option<crate::options::Freshness>,
13421    /// Retry and timeout controls for this request.
13422    pub request_options: RequestOptions,
13423}
13424
13425impl YouTubeChartsArtistsOptions {
13426    /// Creates options that use the API and client defaults.
13427    pub fn new() -> Self {
13428        Self::default()
13429    }
13430
13431    /// Two-letter ISO 3166 country code. The default is US.
13432    pub fn country(mut self, value: impl Into<String>) -> Self {
13433        self.country = Some(value.into());
13434        self
13435    }
13436
13437    /// Maximum accepted data age. The default is 24h.
13438    pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
13439        self.freshness = Some(value);
13440        self
13441    }
13442
13443    /// Sets the retry attempts after the first request.
13444    pub fn max_retries(mut self, value: u32) -> Self {
13445        self.request_options.max_retries = Some(value);
13446        self
13447    }
13448
13449    /// Sets the timeout for each attempt.
13450    pub fn timeout(mut self, value: Duration) -> Self {
13451        self.request_options.timeout = Some(value);
13452        self
13453    }
13454
13455    pub(crate) fn query(&self) -> Result<Query, Error> {
13456        let mut query = Query::default();
13457        query.push("country", &self.country);
13458        query.push("freshness", &self.freshness);
13459        Ok(query)
13460    }
13461}
13462
13463/// Typed result of `youtube.charts.artists.list`.
13464pub type YouTubeChartsArtistsResponse = Response<Vec<YouTubeChartEntry>>;
13465
13466/// Options for `youtube.charts.tracks.list`.
13467#[derive(Clone, Debug, Default, PartialEq)]
13468#[non_exhaustive]
13469pub struct YouTubeChartsTracksOptions {
13470    /// Two-letter ISO 3166 country code. The default is US.
13471    pub country: Option<String>,
13472    /// Maximum accepted data age. The default is 24h.
13473    pub freshness: Option<crate::options::Freshness>,
13474    /// Retry and timeout controls for this request.
13475    pub request_options: RequestOptions,
13476}
13477
13478impl YouTubeChartsTracksOptions {
13479    /// Creates options that use the API and client defaults.
13480    pub fn new() -> Self {
13481        Self::default()
13482    }
13483
13484    /// Two-letter ISO 3166 country code. The default is US.
13485    pub fn country(mut self, value: impl Into<String>) -> Self {
13486        self.country = Some(value.into());
13487        self
13488    }
13489
13490    /// Maximum accepted data age. The default is 24h.
13491    pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
13492        self.freshness = Some(value);
13493        self
13494    }
13495
13496    /// Sets the retry attempts after the first request.
13497    pub fn max_retries(mut self, value: u32) -> Self {
13498        self.request_options.max_retries = Some(value);
13499        self
13500    }
13501
13502    /// Sets the timeout for each attempt.
13503    pub fn timeout(mut self, value: Duration) -> Self {
13504        self.request_options.timeout = Some(value);
13505        self
13506    }
13507
13508    pub(crate) fn query(&self) -> Result<Query, Error> {
13509        let mut query = Query::default();
13510        query.push("country", &self.country);
13511        query.push("freshness", &self.freshness);
13512        Ok(query)
13513    }
13514}
13515
13516/// Typed result of `youtube.charts.tracks.list`.
13517pub type YouTubeChartsTracksResponse = Response<Vec<YouTubeChartEntry>>;
13518
13519/// Options for `youtube.charts.videos.list`.
13520#[derive(Clone, Debug, Default, PartialEq)]
13521#[non_exhaustive]
13522pub struct YouTubeChartsVideosOptions {
13523    /// Two-letter ISO 3166 country code. The default is US.
13524    pub country: Option<String>,
13525    /// Maximum accepted data age. The default is 24h.
13526    pub freshness: Option<crate::options::Freshness>,
13527    /// Retry and timeout controls for this request.
13528    pub request_options: RequestOptions,
13529}
13530
13531impl YouTubeChartsVideosOptions {
13532    /// Creates options that use the API and client defaults.
13533    pub fn new() -> Self {
13534        Self::default()
13535    }
13536
13537    /// Two-letter ISO 3166 country code. The default is US.
13538    pub fn country(mut self, value: impl Into<String>) -> Self {
13539        self.country = Some(value.into());
13540        self
13541    }
13542
13543    /// Maximum accepted data age. The default is 24h.
13544    pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
13545        self.freshness = Some(value);
13546        self
13547    }
13548
13549    /// Sets the retry attempts after the first request.
13550    pub fn max_retries(mut self, value: u32) -> Self {
13551        self.request_options.max_retries = Some(value);
13552        self
13553    }
13554
13555    /// Sets the timeout for each attempt.
13556    pub fn timeout(mut self, value: Duration) -> Self {
13557        self.request_options.timeout = Some(value);
13558        self
13559    }
13560
13561    pub(crate) fn query(&self) -> Result<Query, Error> {
13562        let mut query = Query::default();
13563        query.push("country", &self.country);
13564        query.push("freshness", &self.freshness);
13565        Ok(query)
13566    }
13567}
13568
13569/// Typed result of `youtube.charts.videos.list`.
13570pub type YouTubeChartsVideosResponse = Response<Vec<YouTubeChartEntry>>;
13571
13572/// Options for `youtube.communityPost.get`.
13573#[derive(Clone, Debug, Default, PartialEq)]
13574#[non_exhaustive]
13575pub struct YouTubeCommunityPostOptions {
13576    /// Maximum accepted data age. The default is 24h.
13577    pub freshness: Option<crate::options::Freshness>,
13578    /// Retry and timeout controls for this request.
13579    pub request_options: RequestOptions,
13580}
13581
13582impl YouTubeCommunityPostOptions {
13583    /// Creates options that use the API and client defaults.
13584    pub fn new() -> Self {
13585        Self::default()
13586    }
13587
13588    /// Maximum accepted data age. The default is 24h.
13589    pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
13590        self.freshness = Some(value);
13591        self
13592    }
13593
13594    /// Sets the retry attempts after the first request.
13595    pub fn max_retries(mut self, value: u32) -> Self {
13596        self.request_options.max_retries = Some(value);
13597        self
13598    }
13599
13600    /// Sets the timeout for each attempt.
13601    pub fn timeout(mut self, value: Duration) -> Self {
13602        self.request_options.timeout = Some(value);
13603        self
13604    }
13605
13606    pub(crate) fn query(&self) -> Result<Query, Error> {
13607        let mut query = Query::default();
13608        query.push("freshness", &self.freshness);
13609        Ok(query)
13610    }
13611}
13612
13613/// Typed result of `youtube.communityPost.get`.
13614pub type YouTubeCommunityPostResponse = Response<YouTubeCommunityPost>;
13615
13616/// Options for `youtube.communityPost.comments.list`.
13617#[derive(Clone, Debug, Default, PartialEq)]
13618#[non_exhaustive]
13619pub struct YouTubeCommunityPostCommentsOptions {
13620    /// Result ordering for this operation. One of `top`, or `newest`. The API default
13621    /// is `top`.
13622    pub sort: Option<String>,
13623    /// Maximum accepted data age. The default is 24h.
13624    pub freshness: Option<crate::options::Freshness>,
13625    /// Opaque cursor returned by the previous page.
13626    pub cursor: Option<String>,
13627    /// Retry and timeout controls for this request.
13628    pub request_options: RequestOptions,
13629}
13630
13631impl YouTubeCommunityPostCommentsOptions {
13632    /// Creates options that use the API and client defaults.
13633    pub fn new() -> Self {
13634        Self::default()
13635    }
13636
13637    /// Result ordering for this operation. One of `top`, or `newest`. The API default
13638    /// is `top`.
13639    pub fn sort(mut self, value: impl Into<String>) -> Self {
13640        self.sort = Some(value.into());
13641        self
13642    }
13643
13644    /// Maximum accepted data age. The default is 24h.
13645    pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
13646        self.freshness = Some(value);
13647        self
13648    }
13649
13650    /// Opaque cursor returned by the previous page.
13651    pub fn cursor(mut self, value: impl Into<String>) -> Self {
13652        self.cursor = Some(value.into());
13653        self
13654    }
13655
13656    /// Sets the retry attempts after the first request.
13657    pub fn max_retries(mut self, value: u32) -> Self {
13658        self.request_options.max_retries = Some(value);
13659        self
13660    }
13661
13662    /// Sets the timeout for each attempt.
13663    pub fn timeout(mut self, value: Duration) -> Self {
13664        self.request_options.timeout = Some(value);
13665        self
13666    }
13667
13668    pub(crate) fn query(&self) -> Result<Query, Error> {
13669        let mut query = Query::default();
13670        query.push("sort", &self.sort);
13671        query.push("freshness", &self.freshness);
13672        query.push("cursor", &self.cursor);
13673        Ok(query)
13674    }
13675}
13676
13677/// One page returned by `youtube.communityPost.comments.list`.
13678pub type YouTubeCommunityPostCommentsPage = Page<YouTubeComment>;
13679
13680/// Options for `youtube.hashtag.posts.list`.
13681#[derive(Clone, Debug, Default, PartialEq)]
13682#[non_exhaustive]
13683pub struct YouTubeHashtagPostsOptions {
13684    /// Maximum accepted data age. The default is 24h.
13685    pub freshness: Option<crate::options::Freshness>,
13686    /// Opaque cursor returned by the previous page.
13687    pub cursor: Option<String>,
13688    /// Retry and timeout controls for this request.
13689    pub request_options: RequestOptions,
13690}
13691
13692impl YouTubeHashtagPostsOptions {
13693    /// Creates options that use the API and client defaults.
13694    pub fn new() -> Self {
13695        Self::default()
13696    }
13697
13698    /// Maximum accepted data age. The default is 24h.
13699    pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
13700        self.freshness = Some(value);
13701        self
13702    }
13703
13704    /// Opaque cursor returned by the previous page.
13705    pub fn cursor(mut self, value: impl Into<String>) -> Self {
13706        self.cursor = Some(value.into());
13707        self
13708    }
13709
13710    /// Sets the retry attempts after the first request.
13711    pub fn max_retries(mut self, value: u32) -> Self {
13712        self.request_options.max_retries = Some(value);
13713        self
13714    }
13715
13716    /// Sets the timeout for each attempt.
13717    pub fn timeout(mut self, value: Duration) -> Self {
13718        self.request_options.timeout = Some(value);
13719        self
13720    }
13721
13722    pub(crate) fn query(&self) -> Result<Query, Error> {
13723        let mut query = Query::default();
13724        query.push("freshness", &self.freshness);
13725        query.push("cursor", &self.cursor);
13726        Ok(query)
13727    }
13728}
13729
13730/// One page returned by `youtube.hashtag.posts.list`.
13731pub type YouTubeHashtagPostsPage = Page<YouTubePost>;
13732
13733/// Options for `youtube.playlist.posts.list`.
13734#[derive(Clone, Debug, Default, PartialEq)]
13735#[non_exhaustive]
13736pub struct YouTubePlaylistPostsOptions {
13737    /// Maximum accepted data age. The default is 24h.
13738    pub freshness: Option<crate::options::Freshness>,
13739    /// Opaque cursor returned by the previous page.
13740    pub cursor: Option<String>,
13741    /// Retry and timeout controls for this request.
13742    pub request_options: RequestOptions,
13743}
13744
13745impl YouTubePlaylistPostsOptions {
13746    /// Creates options that use the API and client defaults.
13747    pub fn new() -> Self {
13748        Self::default()
13749    }
13750
13751    /// Maximum accepted data age. The default is 24h.
13752    pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
13753        self.freshness = Some(value);
13754        self
13755    }
13756
13757    /// Opaque cursor returned by the previous page.
13758    pub fn cursor(mut self, value: impl Into<String>) -> Self {
13759        self.cursor = Some(value.into());
13760        self
13761    }
13762
13763    /// Sets the retry attempts after the first request.
13764    pub fn max_retries(mut self, value: u32) -> Self {
13765        self.request_options.max_retries = Some(value);
13766        self
13767    }
13768
13769    /// Sets the timeout for each attempt.
13770    pub fn timeout(mut self, value: Duration) -> Self {
13771        self.request_options.timeout = Some(value);
13772        self
13773    }
13774
13775    pub(crate) fn query(&self) -> Result<Query, Error> {
13776        let mut query = Query::default();
13777        query.push("freshness", &self.freshness);
13778        query.push("cursor", &self.cursor);
13779        Ok(query)
13780    }
13781}
13782
13783/// One page returned by `youtube.playlist.posts.list`.
13784pub type YouTubePlaylistPostsPage = Page<YouTubePost>;
13785
13786/// Options for `youtube.post.get`.
13787#[derive(Clone, Debug, Default, PartialEq)]
13788#[non_exhaustive]
13789pub struct YouTubePostOptions {
13790    /// Maximum accepted data age. The default is 24h.
13791    pub freshness: Option<crate::options::Freshness>,
13792    /// Retry and timeout controls for this request.
13793    pub request_options: RequestOptions,
13794}
13795
13796impl YouTubePostOptions {
13797    /// Creates options that use the API and client defaults.
13798    pub fn new() -> Self {
13799        Self::default()
13800    }
13801
13802    /// Maximum accepted data age. The default is 24h.
13803    pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
13804        self.freshness = Some(value);
13805        self
13806    }
13807
13808    /// Sets the retry attempts after the first request.
13809    pub fn max_retries(mut self, value: u32) -> Self {
13810        self.request_options.max_retries = Some(value);
13811        self
13812    }
13813
13814    /// Sets the timeout for each attempt.
13815    pub fn timeout(mut self, value: Duration) -> Self {
13816        self.request_options.timeout = Some(value);
13817        self
13818    }
13819
13820    pub(crate) fn query(&self) -> Result<Query, Error> {
13821        let mut query = Query::default();
13822        query.push("freshness", &self.freshness);
13823        Ok(query)
13824    }
13825}
13826
13827/// Typed result of `youtube.post.get`.
13828pub type YouTubePostResponse = Response<YouTubePost>;
13829
13830/// Options for `youtube.post.comment.replies.list`.
13831#[derive(Clone, Debug, PartialEq)]
13832#[non_exhaustive]
13833pub struct YouTubePostCommentRepliesOptions {
13834    /// The repliesToken of the comment whose replies to read.
13835    pub token: String,
13836    /// Maximum accepted data age. The default is 24h.
13837    pub freshness: Option<crate::options::Freshness>,
13838    /// Opaque cursor returned by the previous page.
13839    pub cursor: Option<String>,
13840    /// Retry and timeout controls for this request.
13841    pub request_options: RequestOptions,
13842}
13843
13844impl YouTubePostCommentRepliesOptions {
13845    /// Creates options with the required values.
13846    pub fn new(token: impl Into<String>) -> Self {
13847        Self {
13848            token: token.into(),
13849            freshness: None,
13850            cursor: None,
13851            request_options: RequestOptions::default(),
13852        }
13853    }
13854
13855    /// Maximum accepted data age. The default is 24h.
13856    pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
13857        self.freshness = Some(value);
13858        self
13859    }
13860
13861    /// Opaque cursor returned by the previous page.
13862    pub fn cursor(mut self, value: impl Into<String>) -> Self {
13863        self.cursor = Some(value.into());
13864        self
13865    }
13866
13867    /// Sets the retry attempts after the first request.
13868    pub fn max_retries(mut self, value: u32) -> Self {
13869        self.request_options.max_retries = Some(value);
13870        self
13871    }
13872
13873    /// Sets the timeout for each attempt.
13874    pub fn timeout(mut self, value: Duration) -> Self {
13875        self.request_options.timeout = Some(value);
13876        self
13877    }
13878
13879    pub(crate) fn query(&self) -> Result<Query, Error> {
13880        let mut query = Query::default();
13881        query.require("token", &self.token)?;
13882        query.push("freshness", &self.freshness);
13883        query.push("cursor", &self.cursor);
13884        Ok(query)
13885    }
13886}
13887
13888/// One page returned by `youtube.post.comment.replies.list`.
13889pub type YouTubePostCommentRepliesPage = Page<YouTubeComment>;
13890
13891/// Options for `youtube.post.comments.list`.
13892#[derive(Clone, Debug, Default, PartialEq)]
13893#[non_exhaustive]
13894pub struct YouTubePostCommentsOptions {
13895    /// Result ordering for this operation. One of `top`, or `newest`. The API default
13896    /// is `top`.
13897    pub sort: Option<String>,
13898    /// Maximum accepted data age. The default is 24h.
13899    pub freshness: Option<crate::options::Freshness>,
13900    /// Opaque cursor returned by the previous page.
13901    pub cursor: Option<String>,
13902    /// Retry and timeout controls for this request.
13903    pub request_options: RequestOptions,
13904}
13905
13906impl YouTubePostCommentsOptions {
13907    /// Creates options that use the API and client defaults.
13908    pub fn new() -> Self {
13909        Self::default()
13910    }
13911
13912    /// Result ordering for this operation. One of `top`, or `newest`. The API default
13913    /// is `top`.
13914    pub fn sort(mut self, value: impl Into<String>) -> Self {
13915        self.sort = Some(value.into());
13916        self
13917    }
13918
13919    /// Maximum accepted data age. The default is 24h.
13920    pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
13921        self.freshness = Some(value);
13922        self
13923    }
13924
13925    /// Opaque cursor returned by the previous page.
13926    pub fn cursor(mut self, value: impl Into<String>) -> Self {
13927        self.cursor = Some(value.into());
13928        self
13929    }
13930
13931    /// Sets the retry attempts after the first request.
13932    pub fn max_retries(mut self, value: u32) -> Self {
13933        self.request_options.max_retries = Some(value);
13934        self
13935    }
13936
13937    /// Sets the timeout for each attempt.
13938    pub fn timeout(mut self, value: Duration) -> Self {
13939        self.request_options.timeout = Some(value);
13940        self
13941    }
13942
13943    pub(crate) fn query(&self) -> Result<Query, Error> {
13944        let mut query = Query::default();
13945        query.push("sort", &self.sort);
13946        query.push("freshness", &self.freshness);
13947        query.push("cursor", &self.cursor);
13948        Ok(query)
13949    }
13950}
13951
13952/// One page returned by `youtube.post.comments.list`.
13953pub type YouTubePostCommentsPage = Page<YouTubeComment>;
13954
13955/// Options for `youtube.post.files.get`.
13956#[derive(Clone, Debug, Default, PartialEq)]
13957#[non_exhaustive]
13958pub struct YouTubePostFilesOptions {
13959    /// Maximum accepted data age. The default is 24h.
13960    pub freshness: Option<crate::options::Freshness>,
13961    /// Retry and timeout controls for this request.
13962    pub request_options: RequestOptions,
13963}
13964
13965impl YouTubePostFilesOptions {
13966    /// Creates options that use the API and client defaults.
13967    pub fn new() -> Self {
13968        Self::default()
13969    }
13970
13971    /// Maximum accepted data age. The default is 24h.
13972    pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
13973        self.freshness = Some(value);
13974        self
13975    }
13976
13977    /// Sets the retry attempts after the first request.
13978    pub fn max_retries(mut self, value: u32) -> Self {
13979        self.request_options.max_retries = Some(value);
13980        self
13981    }
13982
13983    /// Sets the timeout for each attempt.
13984    pub fn timeout(mut self, value: Duration) -> Self {
13985        self.request_options.timeout = Some(value);
13986        self
13987    }
13988
13989    pub(crate) fn query(&self) -> Result<Query, Error> {
13990        let mut query = Query::default();
13991        query.push("freshness", &self.freshness);
13992        Ok(query)
13993    }
13994}
13995
13996/// Typed result of `youtube.post.files.get`.
13997pub type YouTubePostFilesResponse = Response<YouTubeFiles>;
13998
13999/// Options for `youtube.post.frame.get`.
14000#[derive(Clone, Debug, PartialEq)]
14001#[non_exhaustive]
14002pub struct YouTubePostFrameOptions {
14003    /// Time of the frame in whole seconds from the start of the video. Accepts 0 to
14004    /// 359999.
14005    pub at: i64,
14006    /// Maximum accepted data age. The default is 24h.
14007    pub freshness: Option<crate::options::Freshness>,
14008    /// Retry and timeout controls for this request.
14009    pub request_options: RequestOptions,
14010}
14011
14012impl YouTubePostFrameOptions {
14013    /// Creates options with the required values.
14014    pub fn new(at: i64) -> Self {
14015        Self {
14016            at,
14017            freshness: None,
14018            request_options: RequestOptions::default(),
14019        }
14020    }
14021
14022    /// Maximum accepted data age. The default is 24h.
14023    pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
14024        self.freshness = Some(value);
14025        self
14026    }
14027
14028    /// Sets the retry attempts after the first request.
14029    pub fn max_retries(mut self, value: u32) -> Self {
14030        self.request_options.max_retries = Some(value);
14031        self
14032    }
14033
14034    /// Sets the timeout for each attempt.
14035    pub fn timeout(mut self, value: Duration) -> Self {
14036        self.request_options.timeout = Some(value);
14037        self
14038    }
14039
14040    pub(crate) fn query(&self) -> Result<Query, Error> {
14041        let mut query = Query::default();
14042        query.require("at", &self.at)?;
14043        query.push("freshness", &self.freshness);
14044        Ok(query)
14045    }
14046}
14047
14048/// Typed result of `youtube.post.frame.get`.
14049pub type YouTubePostFrameResponse = Response<YouTubeFrame>;
14050
14051/// Options for `youtube.post.related.list`.
14052#[derive(Clone, Debug, Default, PartialEq)]
14053#[non_exhaustive]
14054pub struct YouTubePostRelatedOptions {
14055    /// Maximum accepted data age. The default is 24h.
14056    pub freshness: Option<crate::options::Freshness>,
14057    /// Opaque cursor returned by the previous page.
14058    pub cursor: Option<String>,
14059    /// Retry and timeout controls for this request.
14060    pub request_options: RequestOptions,
14061}
14062
14063impl YouTubePostRelatedOptions {
14064    /// Creates options that use the API and client defaults.
14065    pub fn new() -> Self {
14066        Self::default()
14067    }
14068
14069    /// Maximum accepted data age. The default is 24h.
14070    pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
14071        self.freshness = Some(value);
14072        self
14073    }
14074
14075    /// Opaque cursor returned by the previous page.
14076    pub fn cursor(mut self, value: impl Into<String>) -> Self {
14077        self.cursor = Some(value.into());
14078        self
14079    }
14080
14081    /// Sets the retry attempts after the first request.
14082    pub fn max_retries(mut self, value: u32) -> Self {
14083        self.request_options.max_retries = Some(value);
14084        self
14085    }
14086
14087    /// Sets the timeout for each attempt.
14088    pub fn timeout(mut self, value: Duration) -> Self {
14089        self.request_options.timeout = Some(value);
14090        self
14091    }
14092
14093    pub(crate) fn query(&self) -> Result<Query, Error> {
14094        let mut query = Query::default();
14095        query.push("freshness", &self.freshness);
14096        query.push("cursor", &self.cursor);
14097        Ok(query)
14098    }
14099}
14100
14101/// One page returned by `youtube.post.related.list`.
14102pub type YouTubePostRelatedPage = Page<YouTubePost>;
14103
14104/// Options for `youtube.post.soundPosts.list`.
14105#[derive(Clone, Debug, Default, PartialEq)]
14106#[non_exhaustive]
14107pub struct YouTubePostSoundPostsOptions {
14108    /// Maximum accepted data age. The default is 24h.
14109    pub freshness: Option<crate::options::Freshness>,
14110    /// Opaque cursor returned by the previous page.
14111    pub cursor: Option<String>,
14112    /// Retry and timeout controls for this request.
14113    pub request_options: RequestOptions,
14114}
14115
14116impl YouTubePostSoundPostsOptions {
14117    /// Creates options that use the API and client defaults.
14118    pub fn new() -> Self {
14119        Self::default()
14120    }
14121
14122    /// Maximum accepted data age. The default is 24h.
14123    pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
14124        self.freshness = Some(value);
14125        self
14126    }
14127
14128    /// Opaque cursor returned by the previous page.
14129    pub fn cursor(mut self, value: impl Into<String>) -> Self {
14130        self.cursor = Some(value.into());
14131        self
14132    }
14133
14134    /// Sets the retry attempts after the first request.
14135    pub fn max_retries(mut self, value: u32) -> Self {
14136        self.request_options.max_retries = Some(value);
14137        self
14138    }
14139
14140    /// Sets the timeout for each attempt.
14141    pub fn timeout(mut self, value: Duration) -> Self {
14142        self.request_options.timeout = Some(value);
14143        self
14144    }
14145
14146    pub(crate) fn query(&self) -> Result<Query, Error> {
14147        let mut query = Query::default();
14148        query.push("freshness", &self.freshness);
14149        query.push("cursor", &self.cursor);
14150        Ok(query)
14151    }
14152}
14153
14154/// One page returned by `youtube.post.soundPosts.list`.
14155pub type YouTubePostSoundPostsPage = Page<YouTubePost>;
14156
14157/// Options for `youtube.post.storyboard.get`.
14158#[derive(Clone, Debug, Default, PartialEq)]
14159#[non_exhaustive]
14160pub struct YouTubePostStoryboardOptions {
14161    /// Maximum accepted data age. The default is 24h.
14162    pub freshness: Option<crate::options::Freshness>,
14163    /// Retry and timeout controls for this request.
14164    pub request_options: RequestOptions,
14165}
14166
14167impl YouTubePostStoryboardOptions {
14168    /// Creates options that use the API and client defaults.
14169    pub fn new() -> Self {
14170        Self::default()
14171    }
14172
14173    /// Maximum accepted data age. The default is 24h.
14174    pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
14175        self.freshness = Some(value);
14176        self
14177    }
14178
14179    /// Sets the retry attempts after the first request.
14180    pub fn max_retries(mut self, value: u32) -> Self {
14181        self.request_options.max_retries = Some(value);
14182        self
14183    }
14184
14185    /// Sets the timeout for each attempt.
14186    pub fn timeout(mut self, value: Duration) -> Self {
14187        self.request_options.timeout = Some(value);
14188        self
14189    }
14190
14191    pub(crate) fn query(&self) -> Result<Query, Error> {
14192        let mut query = Query::default();
14193        query.push("freshness", &self.freshness);
14194        Ok(query)
14195    }
14196}
14197
14198/// Typed result of `youtube.post.storyboard.get`.
14199pub type YouTubePostStoryboardResponse = Response<YouTubeStoryboard>;
14200
14201/// Options for `youtube.post.transcript.get`.
14202#[derive(Clone, Debug, Default, PartialEq)]
14203#[non_exhaustive]
14204pub struct YouTubePostTranscriptOptions {
14205    /// Caption language code, such as en or es-419. The default is the spoken language.
14206    pub language: Option<String>,
14207    /// Maximum accepted data age. The default is 24h.
14208    pub freshness: Option<crate::options::Freshness>,
14209    /// Retry and timeout controls for this request.
14210    pub request_options: RequestOptions,
14211}
14212
14213impl YouTubePostTranscriptOptions {
14214    /// Creates options that use the API and client defaults.
14215    pub fn new() -> Self {
14216        Self::default()
14217    }
14218
14219    /// Caption language code, such as en or es-419. The default is the spoken language.
14220    pub fn language(mut self, value: impl Into<String>) -> Self {
14221        self.language = Some(value.into());
14222        self
14223    }
14224
14225    /// Maximum accepted data age. The default is 24h.
14226    pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
14227        self.freshness = Some(value);
14228        self
14229    }
14230
14231    /// Sets the retry attempts after the first request.
14232    pub fn max_retries(mut self, value: u32) -> Self {
14233        self.request_options.max_retries = Some(value);
14234        self
14235    }
14236
14237    /// Sets the timeout for each attempt.
14238    pub fn timeout(mut self, value: Duration) -> Self {
14239        self.request_options.timeout = Some(value);
14240        self
14241    }
14242
14243    pub(crate) fn query(&self) -> Result<Query, Error> {
14244        let mut query = Query::default();
14245        query.push("language", &self.language);
14246        query.push("freshness", &self.freshness);
14247        Ok(query)
14248    }
14249}
14250
14251/// Typed result of `youtube.post.transcript.get`.
14252pub type YouTubePostTranscriptResponse = Response<YouTubeTranscript>;
14253
14254/// Options for `youtube.profile.get`.
14255#[derive(Clone, Debug, Default, PartialEq)]
14256#[non_exhaustive]
14257pub struct YouTubeProfileOptions {
14258    /// Maximum accepted data age. The default is 24h.
14259    pub freshness: Option<crate::options::Freshness>,
14260    /// Retry and timeout controls for this request.
14261    pub request_options: RequestOptions,
14262}
14263
14264impl YouTubeProfileOptions {
14265    /// Creates options that use the API and client defaults.
14266    pub fn new() -> Self {
14267        Self::default()
14268    }
14269
14270    /// Maximum accepted data age. The default is 24h.
14271    pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
14272        self.freshness = Some(value);
14273        self
14274    }
14275
14276    /// Sets the retry attempts after the first request.
14277    pub fn max_retries(mut self, value: u32) -> Self {
14278        self.request_options.max_retries = Some(value);
14279        self
14280    }
14281
14282    /// Sets the timeout for each attempt.
14283    pub fn timeout(mut self, value: Duration) -> Self {
14284        self.request_options.timeout = Some(value);
14285        self
14286    }
14287
14288    pub(crate) fn query(&self) -> Result<Query, Error> {
14289        let mut query = Query::default();
14290        query.push("freshness", &self.freshness);
14291        Ok(query)
14292    }
14293}
14294
14295/// Typed result of `youtube.profile.get`.
14296pub type YouTubeProfileResponse = Response<YouTubeProfile>;
14297
14298/// Options for `youtube.profile.communityPosts.list`.
14299#[derive(Clone, Debug, Default, PartialEq)]
14300#[non_exhaustive]
14301pub struct YouTubeProfileCommunityPostsOptions {
14302    /// Maximum accepted data age. The default is 24h.
14303    pub freshness: Option<crate::options::Freshness>,
14304    /// Opaque cursor returned by the previous page.
14305    pub cursor: Option<String>,
14306    /// Retry and timeout controls for this request.
14307    pub request_options: RequestOptions,
14308}
14309
14310impl YouTubeProfileCommunityPostsOptions {
14311    /// Creates options that use the API and client defaults.
14312    pub fn new() -> Self {
14313        Self::default()
14314    }
14315
14316    /// Maximum accepted data age. The default is 24h.
14317    pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
14318        self.freshness = Some(value);
14319        self
14320    }
14321
14322    /// Opaque cursor returned by the previous page.
14323    pub fn cursor(mut self, value: impl Into<String>) -> Self {
14324        self.cursor = Some(value.into());
14325        self
14326    }
14327
14328    /// Sets the retry attempts after the first request.
14329    pub fn max_retries(mut self, value: u32) -> Self {
14330        self.request_options.max_retries = Some(value);
14331        self
14332    }
14333
14334    /// Sets the timeout for each attempt.
14335    pub fn timeout(mut self, value: Duration) -> Self {
14336        self.request_options.timeout = Some(value);
14337        self
14338    }
14339
14340    pub(crate) fn query(&self) -> Result<Query, Error> {
14341        let mut query = Query::default();
14342        query.push("freshness", &self.freshness);
14343        query.push("cursor", &self.cursor);
14344        Ok(query)
14345    }
14346}
14347
14348/// One page returned by `youtube.profile.communityPosts.list`.
14349pub type YouTubeProfileCommunityPostsPage = Page<YouTubeCommunityPost>;
14350
14351/// Options for `youtube.profile.livestreams.list`.
14352#[derive(Clone, Debug, Default, PartialEq)]
14353#[non_exhaustive]
14354pub struct YouTubeProfileLivestreamsOptions {
14355    /// Result ordering for this operation. One of `newest`, `popular`, or `oldest`. The
14356    /// API default is `newest`.
14357    pub sort: Option<String>,
14358    /// Maximum accepted data age. The default is 24h.
14359    pub freshness: Option<crate::options::Freshness>,
14360    /// Opaque cursor returned by the previous page.
14361    pub cursor: Option<String>,
14362    /// Retry and timeout controls for this request.
14363    pub request_options: RequestOptions,
14364}
14365
14366impl YouTubeProfileLivestreamsOptions {
14367    /// Creates options that use the API and client defaults.
14368    pub fn new() -> Self {
14369        Self::default()
14370    }
14371
14372    /// Result ordering for this operation. One of `newest`, `popular`, or `oldest`. The
14373    /// API default is `newest`.
14374    pub fn sort(mut self, value: impl Into<String>) -> Self {
14375        self.sort = Some(value.into());
14376        self
14377    }
14378
14379    /// Maximum accepted data age. The default is 24h.
14380    pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
14381        self.freshness = Some(value);
14382        self
14383    }
14384
14385    /// Opaque cursor returned by the previous page.
14386    pub fn cursor(mut self, value: impl Into<String>) -> Self {
14387        self.cursor = Some(value.into());
14388        self
14389    }
14390
14391    /// Sets the retry attempts after the first request.
14392    pub fn max_retries(mut self, value: u32) -> Self {
14393        self.request_options.max_retries = Some(value);
14394        self
14395    }
14396
14397    /// Sets the timeout for each attempt.
14398    pub fn timeout(mut self, value: Duration) -> Self {
14399        self.request_options.timeout = Some(value);
14400        self
14401    }
14402
14403    pub(crate) fn query(&self) -> Result<Query, Error> {
14404        let mut query = Query::default();
14405        query.push("sort", &self.sort);
14406        query.push("freshness", &self.freshness);
14407        query.push("cursor", &self.cursor);
14408        Ok(query)
14409    }
14410}
14411
14412/// One page returned by `youtube.profile.livestreams.list`.
14413pub type YouTubeProfileLivestreamsPage = Page<YouTubePost>;
14414
14415/// Options for `youtube.profile.playlists.list`.
14416#[derive(Clone, Debug, Default, PartialEq)]
14417#[non_exhaustive]
14418pub struct YouTubeProfilePlaylistsOptions {
14419    /// Maximum accepted data age. The default is 24h.
14420    pub freshness: Option<crate::options::Freshness>,
14421    /// Opaque cursor returned by the previous page.
14422    pub cursor: Option<String>,
14423    /// Retry and timeout controls for this request.
14424    pub request_options: RequestOptions,
14425}
14426
14427impl YouTubeProfilePlaylistsOptions {
14428    /// Creates options that use the API and client defaults.
14429    pub fn new() -> Self {
14430        Self::default()
14431    }
14432
14433    /// Maximum accepted data age. The default is 24h.
14434    pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
14435        self.freshness = Some(value);
14436        self
14437    }
14438
14439    /// Opaque cursor returned by the previous page.
14440    pub fn cursor(mut self, value: impl Into<String>) -> Self {
14441        self.cursor = Some(value.into());
14442        self
14443    }
14444
14445    /// Sets the retry attempts after the first request.
14446    pub fn max_retries(mut self, value: u32) -> Self {
14447        self.request_options.max_retries = Some(value);
14448        self
14449    }
14450
14451    /// Sets the timeout for each attempt.
14452    pub fn timeout(mut self, value: Duration) -> Self {
14453        self.request_options.timeout = Some(value);
14454        self
14455    }
14456
14457    pub(crate) fn query(&self) -> Result<Query, Error> {
14458        let mut query = Query::default();
14459        query.push("freshness", &self.freshness);
14460        query.push("cursor", &self.cursor);
14461        Ok(query)
14462    }
14463}
14464
14465/// One page returned by `youtube.profile.playlists.list`.
14466pub type YouTubeProfilePlaylistsPage = Page<YouTubePlaylist>;
14467
14468/// Options for `youtube.profile.products.list`.
14469#[derive(Clone, Debug, Default, PartialEq)]
14470#[non_exhaustive]
14471pub struct YouTubeProfileProductsOptions {
14472    /// Maximum accepted data age. The default is 24h.
14473    pub freshness: Option<crate::options::Freshness>,
14474    /// Opaque cursor returned by the previous page.
14475    pub cursor: Option<String>,
14476    /// Retry and timeout controls for this request.
14477    pub request_options: RequestOptions,
14478}
14479
14480impl YouTubeProfileProductsOptions {
14481    /// Creates options that use the API and client defaults.
14482    pub fn new() -> Self {
14483        Self::default()
14484    }
14485
14486    /// Maximum accepted data age. The default is 24h.
14487    pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
14488        self.freshness = Some(value);
14489        self
14490    }
14491
14492    /// Opaque cursor returned by the previous page.
14493    pub fn cursor(mut self, value: impl Into<String>) -> Self {
14494        self.cursor = Some(value.into());
14495        self
14496    }
14497
14498    /// Sets the retry attempts after the first request.
14499    pub fn max_retries(mut self, value: u32) -> Self {
14500        self.request_options.max_retries = Some(value);
14501        self
14502    }
14503
14504    /// Sets the timeout for each attempt.
14505    pub fn timeout(mut self, value: Duration) -> Self {
14506        self.request_options.timeout = Some(value);
14507        self
14508    }
14509
14510    pub(crate) fn query(&self) -> Result<Query, Error> {
14511        let mut query = Query::default();
14512        query.push("freshness", &self.freshness);
14513        query.push("cursor", &self.cursor);
14514        Ok(query)
14515    }
14516}
14517
14518/// One page returned by `youtube.profile.products.list`.
14519pub type YouTubeProfileProductsPage = Page<YouTubeProduct>;
14520
14521/// Options for `youtube.profile.search.list`.
14522#[derive(Clone, Debug, PartialEq)]
14523#[non_exhaustive]
14524pub struct YouTubeProfileSearchOptions {
14525    /// Public search query.
14526    pub q: String,
14527    /// Maximum accepted data age. The default is 24h.
14528    pub freshness: Option<crate::options::Freshness>,
14529    /// Opaque cursor returned by the previous page.
14530    pub cursor: Option<String>,
14531    /// Retry and timeout controls for this request.
14532    pub request_options: RequestOptions,
14533}
14534
14535impl YouTubeProfileSearchOptions {
14536    /// Creates options with the required values.
14537    pub fn new(q: impl Into<String>) -> Self {
14538        Self {
14539            q: q.into(),
14540            freshness: None,
14541            cursor: None,
14542            request_options: RequestOptions::default(),
14543        }
14544    }
14545
14546    /// Maximum accepted data age. The default is 24h.
14547    pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
14548        self.freshness = Some(value);
14549        self
14550    }
14551
14552    /// Opaque cursor returned by the previous page.
14553    pub fn cursor(mut self, value: impl Into<String>) -> Self {
14554        self.cursor = Some(value.into());
14555        self
14556    }
14557
14558    /// Sets the retry attempts after the first request.
14559    pub fn max_retries(mut self, value: u32) -> Self {
14560        self.request_options.max_retries = Some(value);
14561        self
14562    }
14563
14564    /// Sets the timeout for each attempt.
14565    pub fn timeout(mut self, value: Duration) -> Self {
14566        self.request_options.timeout = Some(value);
14567        self
14568    }
14569
14570    pub(crate) fn query(&self) -> Result<Query, Error> {
14571        let mut query = Query::default();
14572        query.require("q", &self.q)?;
14573        query.push("freshness", &self.freshness);
14574        query.push("cursor", &self.cursor);
14575        Ok(query)
14576    }
14577}
14578
14579/// One page returned by `youtube.profile.search.list`.
14580pub type YouTubeProfileSearchPage = Page<YouTubePost>;
14581
14582/// Options for `youtube.profile.shorts.list`.
14583#[derive(Clone, Debug, Default, PartialEq)]
14584#[non_exhaustive]
14585pub struct YouTubeProfileShortsOptions {
14586    /// Result ordering for this operation. One of `newest`, `popular`, or `oldest`. The
14587    /// API default is `newest`.
14588    pub sort: Option<String>,
14589    /// Maximum accepted data age. The default is 24h.
14590    pub freshness: Option<crate::options::Freshness>,
14591    /// Opaque cursor returned by the previous page.
14592    pub cursor: Option<String>,
14593    /// Retry and timeout controls for this request.
14594    pub request_options: RequestOptions,
14595}
14596
14597impl YouTubeProfileShortsOptions {
14598    /// Creates options that use the API and client defaults.
14599    pub fn new() -> Self {
14600        Self::default()
14601    }
14602
14603    /// Result ordering for this operation. One of `newest`, `popular`, or `oldest`. The
14604    /// API default is `newest`.
14605    pub fn sort(mut self, value: impl Into<String>) -> Self {
14606        self.sort = Some(value.into());
14607        self
14608    }
14609
14610    /// Maximum accepted data age. The default is 24h.
14611    pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
14612        self.freshness = Some(value);
14613        self
14614    }
14615
14616    /// Opaque cursor returned by the previous page.
14617    pub fn cursor(mut self, value: impl Into<String>) -> Self {
14618        self.cursor = Some(value.into());
14619        self
14620    }
14621
14622    /// Sets the retry attempts after the first request.
14623    pub fn max_retries(mut self, value: u32) -> Self {
14624        self.request_options.max_retries = Some(value);
14625        self
14626    }
14627
14628    /// Sets the timeout for each attempt.
14629    pub fn timeout(mut self, value: Duration) -> Self {
14630        self.request_options.timeout = Some(value);
14631        self
14632    }
14633
14634    pub(crate) fn query(&self) -> Result<Query, Error> {
14635        let mut query = Query::default();
14636        query.push("sort", &self.sort);
14637        query.push("freshness", &self.freshness);
14638        query.push("cursor", &self.cursor);
14639        Ok(query)
14640    }
14641}
14642
14643/// One page returned by `youtube.profile.shorts.list`.
14644pub type YouTubeProfileShortsPage = Page<YouTubePost>;
14645
14646/// Options for `youtube.profile.videos.list`.
14647#[derive(Clone, Debug, Default, PartialEq)]
14648#[non_exhaustive]
14649pub struct YouTubeProfileVideosOptions {
14650    /// Result ordering for this operation. One of `newest`, `popular`, or `oldest`. The
14651    /// API default is `newest`.
14652    pub sort: Option<String>,
14653    /// Return posts captured at or after this RFC 3339 timestamp.
14654    pub since: Option<chrono::DateTime<chrono::Utc>>,
14655    /// Maximum accepted data age. The default is 24h.
14656    pub freshness: Option<crate::options::Freshness>,
14657    /// Opaque cursor returned by the previous page.
14658    pub cursor: Option<String>,
14659    /// Retry and timeout controls for this request.
14660    pub request_options: RequestOptions,
14661}
14662
14663impl YouTubeProfileVideosOptions {
14664    /// Creates options that use the API and client defaults.
14665    pub fn new() -> Self {
14666        Self::default()
14667    }
14668
14669    /// Result ordering for this operation. One of `newest`, `popular`, or `oldest`. The
14670    /// API default is `newest`.
14671    pub fn sort(mut self, value: impl Into<String>) -> Self {
14672        self.sort = Some(value.into());
14673        self
14674    }
14675
14676    /// Return posts captured at or after this RFC 3339 timestamp.
14677    pub fn since(mut self, value: chrono::DateTime<chrono::Utc>) -> Self {
14678        self.since = Some(value);
14679        self
14680    }
14681
14682    /// Maximum accepted data age. The default is 24h.
14683    pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
14684        self.freshness = Some(value);
14685        self
14686    }
14687
14688    /// Opaque cursor returned by the previous page.
14689    pub fn cursor(mut self, value: impl Into<String>) -> Self {
14690        self.cursor = Some(value.into());
14691        self
14692    }
14693
14694    /// Sets the retry attempts after the first request.
14695    pub fn max_retries(mut self, value: u32) -> Self {
14696        self.request_options.max_retries = Some(value);
14697        self
14698    }
14699
14700    /// Sets the timeout for each attempt.
14701    pub fn timeout(mut self, value: Duration) -> Self {
14702        self.request_options.timeout = Some(value);
14703        self
14704    }
14705
14706    pub(crate) fn query(&self) -> Result<Query, Error> {
14707        let mut query = Query::default();
14708        query.push("sort", &self.sort);
14709        query.push("since", &self.since);
14710        query.push("freshness", &self.freshness);
14711        query.push("cursor", &self.cursor);
14712        Ok(query)
14713    }
14714}
14715
14716/// One page returned by `youtube.profile.videos.list`.
14717pub type YouTubeProfileVideosPage = Page<YouTubePost>;
14718
14719/// Options for `youtube.search.playlists.list`.
14720#[derive(Clone, Debug, PartialEq)]
14721#[non_exhaustive]
14722pub struct YouTubeSearchPlaylistsOptions {
14723    /// Public search query.
14724    pub q: String,
14725    /// Maximum accepted data age. The default is 24h.
14726    pub freshness: Option<crate::options::Freshness>,
14727    /// Opaque cursor returned by the previous page.
14728    pub cursor: Option<String>,
14729    /// Retry and timeout controls for this request.
14730    pub request_options: RequestOptions,
14731}
14732
14733impl YouTubeSearchPlaylistsOptions {
14734    /// Creates options with the required values.
14735    pub fn new(q: impl Into<String>) -> Self {
14736        Self {
14737            q: q.into(),
14738            freshness: None,
14739            cursor: None,
14740            request_options: RequestOptions::default(),
14741        }
14742    }
14743
14744    /// Maximum accepted data age. The default is 24h.
14745    pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
14746        self.freshness = Some(value);
14747        self
14748    }
14749
14750    /// Opaque cursor returned by the previous page.
14751    pub fn cursor(mut self, value: impl Into<String>) -> Self {
14752        self.cursor = Some(value.into());
14753        self
14754    }
14755
14756    /// Sets the retry attempts after the first request.
14757    pub fn max_retries(mut self, value: u32) -> Self {
14758        self.request_options.max_retries = Some(value);
14759        self
14760    }
14761
14762    /// Sets the timeout for each attempt.
14763    pub fn timeout(mut self, value: Duration) -> Self {
14764        self.request_options.timeout = Some(value);
14765        self
14766    }
14767
14768    pub(crate) fn query(&self) -> Result<Query, Error> {
14769        let mut query = Query::default();
14770        query.require("q", &self.q)?;
14771        query.push("freshness", &self.freshness);
14772        query.push("cursor", &self.cursor);
14773        Ok(query)
14774    }
14775}
14776
14777/// One page returned by `youtube.search.playlists.list`.
14778pub type YouTubeSearchPlaylistsPage = Page<YouTubePlaylist>;
14779
14780/// Options for `youtube.search.posts.list`.
14781#[derive(Clone, Debug, PartialEq)]
14782#[non_exhaustive]
14783pub struct YouTubeSearchPostsOptions {
14784    /// Public search query.
14785    pub q: String,
14786    /// Result ordering for this operation. One of `relevance`, `rating`, `date`, or
14787    /// `views`. The API default is `relevance`.
14788    pub sort: Option<String>,
14789    /// Media type filter. One of `video`, or `short`.
14790    pub r#type: Option<String>,
14791    /// Video length: short is under 4 minutes, medium 4 to 20, long over 20. One of
14792    /// `short`, `medium`, or `long`.
14793    pub duration: Option<String>,
14794    /// Upload time window. One of `hour`, `today`, `week`, `month`, or `year`.
14795    pub uploaded: Option<String>,
14796    /// Maximum accepted data age. The default is 24h.
14797    pub freshness: Option<crate::options::Freshness>,
14798    /// Opaque cursor returned by the previous page.
14799    pub cursor: Option<String>,
14800    /// Retry and timeout controls for this request.
14801    pub request_options: RequestOptions,
14802}
14803
14804impl YouTubeSearchPostsOptions {
14805    /// Creates options with the required values.
14806    pub fn new(q: impl Into<String>) -> Self {
14807        Self {
14808            q: q.into(),
14809            sort: None,
14810            r#type: None,
14811            duration: None,
14812            uploaded: None,
14813            freshness: None,
14814            cursor: None,
14815            request_options: RequestOptions::default(),
14816        }
14817    }
14818
14819    /// Result ordering for this operation. One of `relevance`, `rating`, `date`, or
14820    /// `views`. The API default is `relevance`.
14821    pub fn sort(mut self, value: impl Into<String>) -> Self {
14822        self.sort = Some(value.into());
14823        self
14824    }
14825
14826    /// Media type filter. One of `video`, or `short`.
14827    pub fn r#type(mut self, value: impl Into<String>) -> Self {
14828        self.r#type = Some(value.into());
14829        self
14830    }
14831
14832    /// Video length: short is under 4 minutes, medium 4 to 20, long over 20. One of
14833    /// `short`, `medium`, or `long`.
14834    pub fn duration(mut self, value: impl Into<String>) -> Self {
14835        self.duration = Some(value.into());
14836        self
14837    }
14838
14839    /// Upload time window. One of `hour`, `today`, `week`, `month`, or `year`.
14840    pub fn uploaded(mut self, value: impl Into<String>) -> Self {
14841        self.uploaded = Some(value.into());
14842        self
14843    }
14844
14845    /// Maximum accepted data age. The default is 24h.
14846    pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
14847        self.freshness = Some(value);
14848        self
14849    }
14850
14851    /// Opaque cursor returned by the previous page.
14852    pub fn cursor(mut self, value: impl Into<String>) -> Self {
14853        self.cursor = Some(value.into());
14854        self
14855    }
14856
14857    /// Sets the retry attempts after the first request.
14858    pub fn max_retries(mut self, value: u32) -> Self {
14859        self.request_options.max_retries = Some(value);
14860        self
14861    }
14862
14863    /// Sets the timeout for each attempt.
14864    pub fn timeout(mut self, value: Duration) -> Self {
14865        self.request_options.timeout = Some(value);
14866        self
14867    }
14868
14869    pub(crate) fn query(&self) -> Result<Query, Error> {
14870        let mut query = Query::default();
14871        query.require("q", &self.q)?;
14872        query.push("sort", &self.sort);
14873        query.push("type", &self.r#type);
14874        query.push("duration", &self.duration);
14875        query.push("uploaded", &self.uploaded);
14876        query.push("freshness", &self.freshness);
14877        query.push("cursor", &self.cursor);
14878        Ok(query)
14879    }
14880}
14881
14882/// One page returned by `youtube.search.posts.list`.
14883pub type YouTubeSearchPostsPage = Page<YouTubePost>;
14884
14885/// Options for `youtube.search.profiles.list`.
14886#[derive(Clone, Debug, PartialEq)]
14887#[non_exhaustive]
14888pub struct YouTubeSearchProfilesOptions {
14889    /// Public search query.
14890    pub q: String,
14891    /// Maximum accepted data age. The default is 24h.
14892    pub freshness: Option<crate::options::Freshness>,
14893    /// Opaque cursor returned by the previous page.
14894    pub cursor: Option<String>,
14895    /// Retry and timeout controls for this request.
14896    pub request_options: RequestOptions,
14897}
14898
14899impl YouTubeSearchProfilesOptions {
14900    /// Creates options with the required values.
14901    pub fn new(q: impl Into<String>) -> Self {
14902        Self {
14903            q: q.into(),
14904            freshness: None,
14905            cursor: None,
14906            request_options: RequestOptions::default(),
14907        }
14908    }
14909
14910    /// Maximum accepted data age. The default is 24h.
14911    pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
14912        self.freshness = Some(value);
14913        self
14914    }
14915
14916    /// Opaque cursor returned by the previous page.
14917    pub fn cursor(mut self, value: impl Into<String>) -> Self {
14918        self.cursor = Some(value.into());
14919        self
14920    }
14921
14922    /// Sets the retry attempts after the first request.
14923    pub fn max_retries(mut self, value: u32) -> Self {
14924        self.request_options.max_retries = Some(value);
14925        self
14926    }
14927
14928    /// Sets the timeout for each attempt.
14929    pub fn timeout(mut self, value: Duration) -> Self {
14930        self.request_options.timeout = Some(value);
14931        self
14932    }
14933
14934    pub(crate) fn query(&self) -> Result<Query, Error> {
14935        let mut query = Query::default();
14936        query.require("q", &self.q)?;
14937        query.push("freshness", &self.freshness);
14938        query.push("cursor", &self.cursor);
14939        Ok(query)
14940    }
14941}
14942
14943/// One page returned by `youtube.search.profiles.list`.
14944pub type YouTubeSearchProfilesPage = Page<YouTubeProfile>;
14945
14946/// Options for `youtube.search.suggestions.list`.
14947#[derive(Clone, Debug, PartialEq)]
14948#[non_exhaustive]
14949pub struct YouTubeSearchSuggestionsOptions {
14950    /// Public search query.
14951    pub q: String,
14952    /// Maximum accepted data age. The default is 24h.
14953    pub freshness: Option<crate::options::Freshness>,
14954    /// Retry and timeout controls for this request.
14955    pub request_options: RequestOptions,
14956}
14957
14958impl YouTubeSearchSuggestionsOptions {
14959    /// Creates options with the required values.
14960    pub fn new(q: impl Into<String>) -> Self {
14961        Self {
14962            q: q.into(),
14963            freshness: None,
14964            request_options: RequestOptions::default(),
14965        }
14966    }
14967
14968    /// Maximum accepted data age. The default is 24h.
14969    pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
14970        self.freshness = Some(value);
14971        self
14972    }
14973
14974    /// Sets the retry attempts after the first request.
14975    pub fn max_retries(mut self, value: u32) -> Self {
14976        self.request_options.max_retries = Some(value);
14977        self
14978    }
14979
14980    /// Sets the timeout for each attempt.
14981    pub fn timeout(mut self, value: Duration) -> Self {
14982        self.request_options.timeout = Some(value);
14983        self
14984    }
14985
14986    pub(crate) fn query(&self) -> Result<Query, Error> {
14987        let mut query = Query::default();
14988        query.require("q", &self.q)?;
14989        query.push("freshness", &self.freshness);
14990        Ok(query)
14991    }
14992}
14993
14994/// Typed result of `youtube.search.suggestions.list`.
14995pub type YouTubeSearchSuggestionsResponse = Response<Vec<YouTubeSuggestion>>;
14996
14997/// Options for `youtube.trending.posts.list`.
14998#[derive(Clone, Debug, Default, PartialEq)]
14999#[non_exhaustive]
15000pub struct YouTubeTrendingPostsOptions {
15001    /// Two-letter ISO 3166 country code. The default is US.
15002    pub country: Option<String>,
15003    /// Trending category. One of `now`, `music`, `games`, or `movies`.
15004    pub category: Option<String>,
15005    /// Maximum accepted data age. The default is 24h.
15006    pub freshness: Option<crate::options::Freshness>,
15007    /// Retry and timeout controls for this request.
15008    pub request_options: RequestOptions,
15009}
15010
15011impl YouTubeTrendingPostsOptions {
15012    /// Creates options that use the API and client defaults.
15013    pub fn new() -> Self {
15014        Self::default()
15015    }
15016
15017    /// Two-letter ISO 3166 country code. The default is US.
15018    pub fn country(mut self, value: impl Into<String>) -> Self {
15019        self.country = Some(value.into());
15020        self
15021    }
15022
15023    /// Trending category. One of `now`, `music`, `games`, or `movies`.
15024    pub fn category(mut self, value: impl Into<String>) -> Self {
15025        self.category = Some(value.into());
15026        self
15027    }
15028
15029    /// Maximum accepted data age. The default is 24h.
15030    pub fn freshness(mut self, value: crate::options::Freshness) -> Self {
15031        self.freshness = Some(value);
15032        self
15033    }
15034
15035    /// Sets the retry attempts after the first request.
15036    pub fn max_retries(mut self, value: u32) -> Self {
15037        self.request_options.max_retries = Some(value);
15038        self
15039    }
15040
15041    /// Sets the timeout for each attempt.
15042    pub fn timeout(mut self, value: Duration) -> Self {
15043        self.request_options.timeout = Some(value);
15044        self
15045    }
15046
15047    pub(crate) fn query(&self) -> Result<Query, Error> {
15048        let mut query = Query::default();
15049        query.push("country", &self.country);
15050        query.push("category", &self.category);
15051        query.push("freshness", &self.freshness);
15052        Ok(query)
15053    }
15054}
15055
15056/// Typed result of `youtube.trending.posts.list`.
15057pub type YouTubeTrendingPostsResponse = Response<Vec<YouTubePost>>;