Skip to content

Commit dcf8418

Browse files
committed
fix docs
1 parent fcfbd48 commit dcf8418

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+292
-540
lines changed

src/helix/endpoints/channels/modify_channel_information.rs

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,12 @@
55
//!
66
//! ## Request: [ModifyChannelInformationRequest]
77
//!
8-
//! To use this endpoint, construct a [`ModifyChannelInformationRequest`] with the [`ModifyChannelInformationRequest::builder()`] method.
8+
//! To use this endpoint, construct a [`ModifyChannelInformationRequest`] with the [`ModifyChannelInformationRequest::broadcaster_id()`] method.
99
//!
1010
//! ```rust
1111
//! use twitch_api::helix::channels::modify_channel_information;
12-
//! let request = modify_channel_information::ModifyChannelInformationRequest::builder()
13-
//! .broadcaster_id("1234")
14-
//! .build();
12+
//! let request =
13+
//! modify_channel_information::ModifyChannelInformationRequest::broadcaster_id("1234");
1514
//! ```
1615
//!
1716
//! ## Body: [ModifyChannelInformationBody]
@@ -20,9 +19,8 @@
2019
//!
2120
//! ```
2221
//! # use twitch_api::helix::channels::modify_channel_information;
23-
//! let body = modify_channel_information::ModifyChannelInformationBody::builder()
24-
//! .title("Hello World!")
25-
//! .build();
22+
//! let mut body = modify_channel_information::ModifyChannelInformationBody::new();
23+
//! body.title("Hello World!");
2624
//! ```
2725
//!
2826
//! ## Response: [ModifyChannelInformation]
@@ -39,12 +37,9 @@
3937
//! # let client: helix::HelixClient<'static, client::DummyHttpClient> = helix::HelixClient::default();
4038
//! # let token = twitch_oauth2::AccessToken::new("validtoken".to_string());
4139
//! # let token = twitch_oauth2::UserToken::from_existing(&client, token, None, None).await?;
42-
//! let request = modify_channel_information::ModifyChannelInformationRequest::builder()
43-
//! .broadcaster_id("1234")
44-
//! .build();
45-
//! let body = modify_channel_information::ModifyChannelInformationBody::builder()
46-
//! .title("Hello World!")
47-
//! .build();
40+
//! let request = modify_channel_information::ModifyChannelInformationRequest::broadcaster_id("1234");
41+
//! let mut body = modify_channel_information::ModifyChannelInformationBody::new();
42+
//! body.title("Hello World!");
4843
//! let response: modify_channel_information::ModifyChannelInformation = client.req_patch(request, body, &token).await?.data;
4944
//! # Ok(())
5045
//! # }

src/helix/endpoints/channels/remove_channel_vip.rs

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,11 @@
55
//!
66
//! ## Request: [RemoveChannelVipRequest]
77
//!
8-
//! To use this endpoint, construct a [`RemoveChannelVipRequest`] with the [`RemoveChannelVipRequest::builder()`] method.
8+
//! To use this endpoint, construct a [`RemoveChannelVipRequest`] with the [`RemoveChannelVipRequest::new()`] method.
99
//!
1010
//! ```rust
1111
//! use twitch_api::helix::channels::remove_channel_vip;
12-
//! let request = remove_channel_vip::RemoveChannelVipRequest::builder()
13-
//! .broadcaster_id("1234")
14-
//! .user_id("1337")
15-
//! .build();
12+
//! let request = remove_channel_vip::RemoveChannelVipRequest::new("1234", "1337");
1613
//! ```
1714
//!
1815
//! ## Response: [RemoveChannelVipResponse]
@@ -27,10 +24,7 @@
2724
//! # let client: helix::HelixClient<'static, client::DummyHttpClient> = helix::HelixClient::default();
2825
//! # let token = twitch_oauth2::AccessToken::new("validtoken".to_string());
2926
//! # let token = twitch_oauth2::UserToken::from_existing(&client, token, None, None).await?;
30-
//! let request = remove_channel_vip::RemoveChannelVipRequest::builder()
31-
//! .broadcaster_id("1234")
32-
//! .user_id("1337")
33-
//! .build();
27+
//! let request = remove_channel_vip::RemoveChannelVipRequest::new("1234", "1337");
3428
//! let response: remove_channel_vip::RemoveChannelVipResponse = client.req_delete(request, &token).await?.data;
3529
//! # Ok(())
3630
//! # }

src/helix/endpoints/channels/start_commercial.rs

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@
1818
//!
1919
//! ```
2020
//! # use twitch_api::helix::channels::start_commercial;
21-
//! let body = start_commercial::StartCommercialBody::builder()
22-
//! .broadcaster_id("1234")
23-
//! .length(twitch_api::types::CommercialLength::Length90)
24-
//! .build();
21+
//! let body = start_commercial::StartCommercialBody::new(
22+
//! "1234",
23+
//! twitch_api::types::CommercialLength::Length90,
24+
//! );
2525
//! ```
2626
//!
2727
//! ## Response: [StartCommercialRequest]
@@ -37,10 +37,7 @@
3737
//! # let token = twitch_oauth2::AccessToken::new("validtoken".to_string());
3838
//! # let token = twitch_oauth2::UserToken::from_existing(&client, token, None, None).await?;
3939
//! let request = start_commercial::StartCommercialRequest::new();
40-
//! let body = start_commercial::StartCommercialBody::builder()
41-
//! .broadcaster_id("1234")
42-
//! .length(twitch_api::types::CommercialLength::Length90)
43-
//! .build();
40+
//! let body = start_commercial::StartCommercialBody::new("1234", twitch_api::types::CommercialLength::Length90);
4441
//! let response: Vec<start_commercial::StartCommercial> = client.req_post(request, body, &token).await?.data;
4542
//! # Ok(())
4643
//! # }

src/helix/endpoints/chat/get_channel_chat_badges.rs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,11 @@
55
//!
66
//! ## Request: [GetChannelChatBadgesRequest]
77
//!
8-
//! To use this endpoint, construct a [`GetChannelChatBadgesRequest`] with the [`GetChannelChatBadgesRequest::builder()`] method.
8+
//! To use this endpoint, construct a [`GetChannelChatBadgesRequest`] with the [`GetChannelChatBadgesRequest::broadcaster_id()`] method.
99
//!
1010
//! ```rust
1111
//! use twitch_api::helix::chat::get_channel_chat_badges;
12-
//! let request = get_channel_chat_badges::GetChannelChatBadgesRequest::builder()
13-
//! .broadcaster_id("1234")
14-
//! .build();
12+
//! let request = get_channel_chat_badges::GetChannelChatBadgesRequest::broadcaster_id("1234");
1513
//! ```
1614
//!
1715
//! ## Response: [BadgeSet]
@@ -26,9 +24,7 @@
2624
//! # let client: helix::HelixClient<'static, client::DummyHttpClient> = helix::HelixClient::default();
2725
//! # let token = twitch_oauth2::AccessToken::new("validtoken".to_string());
2826
//! # let token = twitch_oauth2::UserToken::from_existing(&client, token, None, None).await?;
29-
//! let request = get_channel_chat_badges::GetChannelChatBadgesRequest::builder()
30-
//! .broadcaster_id("1234")
31-
//! .build();
27+
//! let request = get_channel_chat_badges::GetChannelChatBadgesRequest::broadcaster_id("1234");
3228
//! let response: Vec<helix::chat::BadgeSet> = client.req_get(request, &token).await?.data;
3329
//! # Ok(())
3430
//! # }

src/helix/endpoints/chat/get_channel_emotes.rs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,11 @@
55
//!
66
//! ## Request: [GetChannelEmotesRequest]
77
//!
8-
//! To use this endpoint, construct a [`GetChannelEmotesRequest`] with the [`GetChannelEmotesRequest::builder()`] method.
8+
//! To use this endpoint, construct a [`GetChannelEmotesRequest`] with the [`GetChannelEmotesRequest::broadcaster_id()`] method.
99
//!
1010
//! ```rust
1111
//! use twitch_api::helix::chat::get_channel_emotes;
12-
//! let request = get_channel_emotes::GetChannelEmotesRequest::builder()
13-
//! .broadcaster_id("1234")
14-
//! .build();
12+
//! let request = get_channel_emotes::GetChannelEmotesRequest::broadcaster_id("1234");
1513
//! ```
1614
//!
1715
//! ## Response: [ChannelEmote]
@@ -26,9 +24,7 @@
2624
//! # let client: helix::HelixClient<'static, client::DummyHttpClient> = helix::HelixClient::default();
2725
//! # let token = twitch_oauth2::AccessToken::new("validtoken".to_string());
2826
//! # let token = twitch_oauth2::UserToken::from_existing(&client, token, None, None).await?;
29-
//! let request = get_channel_emotes::GetChannelEmotesRequest::builder()
30-
//! .broadcaster_id("1234")
31-
//! .build();
27+
//! let request = get_channel_emotes::GetChannelEmotesRequest::broadcaster_id("1234");
3228
//! let response: Vec<helix::chat::ChannelEmote> = client.req_get(request, &token).await?.data;
3329
//! # Ok(())
3430
//! # }

src/helix/endpoints/chat/get_chat_settings.rs

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,16 @@
1313
//!
1414
//! ## Request: [GetChatSettingsRequest]
1515
//!
16-
//! To use this endpoint, construct a [`GetChatSettingsRequest`] with the [`GetChatSettingsRequest::builder()`] method.
16+
//! To use this endpoint, construct a [`GetChatSettingsRequest`] with the [`GetChatSettingsRequest::broadcaster_id()`] method.
1717
//!
1818
//! ```rust
1919
//! use twitch_api::{
2020
//! helix::{self, chat::get_chat_settings},
2121
//! types,
2222
//! };
23-
//! let request = get_chat_settings::GetChatSettingsRequest::builder()
24-
//! .broadcaster_id("1234567")
23+
//! let request = get_chat_settings::GetChatSettingsRequest::broadcaster_id("1234567")
2524
//! // optional
26-
//! .moderator_id(types::UserIdRef::from_str("9876543"))
27-
//! .build();
25+
//! .moderator_id("9876543");
2826
//! ```
2927
//!
3028
//! ## Response: [ChatSettings]
@@ -39,11 +37,9 @@
3937
//! # let client: helix::HelixClient<'static, client::DummyHttpClient> = helix::HelixClient::default();
4038
//! # let token = twitch_oauth2::AccessToken::new("validtoken".to_string());
4139
//! # let token = twitch_oauth2::UserToken::from_existing(&client, token, None, None).await?;
42-
//! let request = get_chat_settings::GetChatSettingsRequest::builder()
43-
//! .broadcaster_id("1234567")
40+
//! let request = get_chat_settings::GetChatSettingsRequest::broadcaster_id("1234567")
4441
//! // optional
45-
//! .moderator_id(types::UserIdRef::from_str("9876543"))
46-
//! .build();
42+
//! .moderator_id("9876543");
4743
//! let response: helix::chat::ChatSettings = client.req_get(request, &token).await?.data;
4844
//! # Ok(())
4945
//! # }

src/helix/endpoints/chat/get_chatters.rs

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,11 @@
99
//!
1010
//! ## Request: [GetChattersRequest]
1111
//!
12-
//! To use this endpoint, construct a [`GetChattersRequest`] with the [`GetChattersRequest::builder()`] method.
12+
//! To use this endpoint, construct a [`GetChattersRequest`] with the [`GetChattersRequest::new()`] method.
1313
//!
1414
//! ```rust
1515
//! use twitch_api::helix::chat::get_chatters;
16-
//! let request = get_chatters::GetChattersRequest::builder()
17-
//! .broadcaster_id("1234")
18-
//! .moderator_id("4321")
19-
//! .build();
16+
//! let request = get_chatters::GetChattersRequest::new("1234", "4321");
2017
//! ```
2118
//!
2219
//! ## Response: [Chatter]
@@ -31,10 +28,7 @@
3128
//! # let client: helix::HelixClient<'static, client::DummyHttpClient> = helix::HelixClient::default();
3229
//! # let token = twitch_oauth2::AccessToken::new("validtoken".to_string());
3330
//! # let token = twitch_oauth2::UserToken::from_existing(&client, token, None, None).await?;
34-
//! let request = get_chatters::GetChattersRequest::builder()
35-
//! .broadcaster_id("1234")
36-
//! .moderator_id("4321")
37-
//! .build();
31+
//! let request = get_chatters::GetChattersRequest::new("1234", "4321");
3832
//! let response: Vec<helix::chat::Chatter> = client.req_get(request, &token).await?.data;
3933
//! # Ok(())
4034
//! # }

src/helix/endpoints/chat/get_emote_sets.rs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,8 @@
99
//!
1010
//! ```rust
1111
//! use twitch_api::helix::chat::get_emote_sets;
12-
//! let request = get_emote_sets::GetEmoteSetsRequest::builder()
13-
//! .emote_set_id(&["1234".into()][..])
14-
//! .build();
12+
//! let ids: &[&twitch_types::EmoteSetIdRef] = &["1234".into()];
13+
//! let request = get_emote_sets::GetEmoteSetsRequest::emote_set_ids(ids);
1514
//! ```
1615
//!
1716
//! ## Response: [Emote]
@@ -26,10 +25,8 @@
2625
//! # let client: helix::HelixClient<'static, client::DummyHttpClient> = helix::HelixClient::default();
2726
//! # let token = twitch_oauth2::AccessToken::new("validtoken".to_string());
2827
//! # let token = twitch_oauth2::UserToken::from_existing(&client, token, None, None).await?;
29-
//! let ids: &[&types::EmoteSetIdRef] = &["1234".into()];
30-
//! let request = get_emote_sets::GetEmoteSetsRequest::builder()
31-
//! .emote_set_id(ids)
32-
//! .build();
28+
//! let ids: &[&twitch_types::EmoteSetIdRef] = &["1234".into()];
29+
//! let request = get_emote_sets::GetEmoteSetsRequest::emote_set_ids(ids);
3330
//! let response: Vec<helix::chat::get_emote_sets::Emote> = client.req_get(request, &token).await?.data;
3431
//! # Ok(())
3532
//! # }

src/helix/endpoints/chat/send_chat_announcement.rs

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,11 @@
55
//!
66
//! ## Request: [SendChatAnnouncementRequest]
77
//!
8-
//! To use this endpoint, construct a [`SendChatAnnouncementRequest`] with the [`SendChatAnnouncementRequest::builder()`] method.
8+
//! To use this endpoint, construct a [`SendChatAnnouncementRequest`] with the [`SendChatAnnouncementRequest::new()`] method.
99
//!
1010
//! ```rust
1111
//! use twitch_api::helix::chat::send_chat_announcement;
12-
//! let request = send_chat_announcement::SendChatAnnouncementRequest::builder()
13-
//! .broadcaster_id("1234")
14-
//! .moderator_id("5678")
15-
//! .build();
12+
//! let request = send_chat_announcement::SendChatAnnouncementRequest::new("1234", "5678");
1613
//! ```
1714
//!
1815
//! ## Body: [SendChatAnnouncementBody]
@@ -38,10 +35,7 @@
3835
//! # let client: helix::HelixClient<'static, client::DummyHttpClient> = helix::HelixClient::default();
3936
//! # let token = twitch_oauth2::AccessToken::new("validtoken".to_string());
4037
//! # let token = twitch_oauth2::UserToken::from_existing(&client, token, None, None).await?;
41-
//! let request = send_chat_announcement::SendChatAnnouncementRequest::builder()
42-
//! .broadcaster_id("1234")
43-
//! .moderator_id("5678")
44-
//! .build();
38+
//! let request = send_chat_announcement::SendChatAnnouncementRequest::new("1234", "5678");
4539
//! let body = send_chat_announcement::SendChatAnnouncementBody::new(
4640
//! "Hello chat!",
4741
//! "purple",

src/helix/endpoints/chat/update_chat_settings.rs

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,11 @@
55
//!
66
//! ## Request: [UpdateChatSettingsRequest]
77
//!
8-
//! To use this endpoint, construct an [`UpdateChatSettingsRequest`] with the [`UpdateChatSettingsRequest::builder()`] method.
8+
//! To use this endpoint, construct an [`UpdateChatSettingsRequest`] with the [`UpdateChatSettingsRequest::new()`] method.
99
//!
1010
//! ```rust
1111
//! use twitch_api::helix::chat::update_chat_settings;
12-
//! let request = update_chat_settings::UpdateChatSettingsRequest::builder()
13-
//! .broadcaster_id("1234")
14-
//! .moderator_id("5678")
15-
//! .build();
12+
//! let request = update_chat_settings::UpdateChatSettingsRequest::new("1234", "5678");
1613
//! ```
1714
//!
1815
//! ## Body: [UpdateChatSettingsBody]
@@ -41,10 +38,7 @@
4138
//! # let client: helix::HelixClient<'static, client::DummyHttpClient> = helix::HelixClient::default();
4239
//! # let token = twitch_oauth2::AccessToken::new("validtoken".to_string());
4340
//! # let token = twitch_oauth2::UserToken::from_existing(&client, token, None, None).await?;
44-
//! let request = update_chat_settings::UpdateChatSettingsRequest::builder()
45-
//! .broadcaster_id("1234")
46-
//! .moderator_id("5678")
47-
//! .build();
41+
//! let request = update_chat_settings::UpdateChatSettingsRequest::new("1234", "5678");
4842
//! let body = update_chat_settings::UpdateChatSettingsBody::builder()
4943
//! .slow_mode(true)
5044
//! .slow_mode_wait_time(10)

0 commit comments

Comments
 (0)