Skip to main content

neptunium_http/endpoints/channel/
update_stream_region.rs

1use bon::Builder;
2use neptunium_model::channel::VoiceRegion;
3use reqwest::Method;
4use serde_json::json;
5
6use crate::{endpoints::Endpoint, request::Request};
7
8#[derive(Builder, Clone, Debug)]
9pub struct UpdateStreamRegion {
10    pub stream_key: String,
11    pub region: VoiceRegion,
12}
13
14impl Endpoint for UpdateStreamRegion {
15    type Response = ();
16
17    fn into_request(self) -> crate::request::Request {
18        Request::builder()
19            .method(Method::PATCH)
20            .body(
21                json!({
22                    "region": self.region,
23                })
24                .to_string(),
25            )
26            .path(format!("/streams/{}/stream", self.stream_key))
27            .build()
28    }
29}