Module twitch_api2::helix::points::update_custom_reward
source · [−]Available on crate feature
helix
only.Expand description
Updates a Custom Reward created on a channel.
Only rewards created programmatically by the same client_id can be updated.
update-custom-reward
Accessing the endpoint
Request: UpdateCustomRewardRequest
To use this endpoint, construct an UpdateCustomRewardRequest
with the UpdateCustomRewardRequest::builder()
method.
use twitch_api2::helix::points::update_custom_reward;
let request = update_custom_reward::UpdateCustomRewardRequest::builder()
.broadcaster_id("274637212")
.id("reward-id")
.build();
Body: UpdateCustomRewardBody
We also need to provide a body to the request containing what we want to change.
let body = update_custom_reward::UpdateCustomRewardBody::builder()
.cost(501)
.title("hydrate but differently now!".to_string())
.build();
Response: UpdateCustomReward
Send the request to receive the response with HelixClient::req_patch()
.
use twitch_api2::helix::{self, points::update_custom_reward};
let request = update_custom_reward::UpdateCustomRewardRequest::builder()
.broadcaster_id("274637212")
.id("reward-id")
.build();
let body = update_custom_reward::UpdateCustomRewardBody::builder()
.cost(501)
.title("hydrate but differently now!".to_string())
.build();
let response: update_custom_reward::UpdateCustomReward = client.req_patch(request, body, &token).await?.data;
You can also get the http::Request
with request.create_request(&token, &client_id)
and parse the http::Response
with UpdateCustomRewardRequest::parse_response(None, &request.get_uri(), response)
Structs
Body Parameters for Update Custom Rewards
Query Parameters for Update Custom Rewards
Enums
Return Values for Update CustomReward