Add Guest Star endpoints to API

This commit is contained in:
Evan Fiordeliso 2024-03-03 14:09:31 -05:00
parent 10a15645b7
commit bfd18150ec
15 changed files with 735 additions and 0 deletions

View File

@ -18,6 +18,7 @@ import (
"go.fifitido.net/twitch/api/extensions"
"go.fifitido.net/twitch/api/games"
"go.fifitido.net/twitch/api/goals"
"go.fifitido.net/twitch/api/gueststar"
)
const HelixBaseUrl = "https://api.twitch.tv/helix"
@ -40,6 +41,7 @@ type API struct {
EventSub *eventsub.EventSub
Games *games.Games
Goals *goals.Goals
GuestStar *gueststar.GuestStar
}
func New() *API {
@ -64,5 +66,6 @@ func New() *API {
EventSub: eventsub.New(client, baseUrl),
Games: games.New(client, baseUrl),
Goals: goals.New(client, baseUrl),
GuestStar: gueststar.New(client, baseUrl),
}
}

View File

@ -0,0 +1,51 @@
package gueststar
import (
"context"
"net/http"
"net/url"
"github.com/google/go-querystring/query"
)
type AssignGuestStarSlot struct {
// The ID of the broadcaster running the Guest Star session.
BroadcasterID string `url:"broadcaster_id"`
// The ID of the broadcaster or a user that has permission to moderate the broadcasters chat room.
// This ID must match the user_id in the user access token.
ModeratorID string `url:"moderator_id"`
// The ID of the Guest Star session in which to assign the slot.
SessionID string `url:"session_id"`
// The Twitch User ID corresponding to the guest to assign a slot in the session.
// This user must already have an invite to this session, and have indicated that they are ready to join.
GuestID string `url:"guest_id"`
// The slot assignment to give to the user. Must be a numeric identifier between “1” and “N” where N is the max number of slots for the session.
// Max number of slots allowed for the session is reported by Get Channel Guest Star Settings.
SlotID int `url:"slot_id"`
}
// Allows a previously invited user to be assigned a slot within the active Guest Star session, once that guest has indicated they are ready to join.
//
// Query parameter moderator_id must match the user_id in the User-Access token
// Requires OAuth Scope: channel:manage:guest_star or moderator:manage:guest_star
func (g *GuestStar) AssignGuestStarSlot(ctx context.Context, params *AssignGuestStarSlot) error {
v, _ := query.Values(params)
endpoint := g.baseUrl.ResolveReference(&url.URL{Path: "guest_star/slot", RawQuery: v.Encode()})
req, err := http.NewRequestWithContext(ctx, http.MethodPost, endpoint.String(), nil)
if err != nil {
return err
}
res, err := g.client.Do(req)
if err != nil {
return err
}
defer res.Body.Close()
return nil
}

View File

@ -0,0 +1,39 @@
package gueststar
import (
"context"
"encoding/json"
"net/http"
"net/url"
)
type CreateGuestStarSessionResponse struct {
// Summary of the session details.
Data []Session `json:"data"`
}
// Programmatically creates a Guest Star session on behalf of the broadcaster. Requires the broadcaster to be present in the call interface, or the call will be ended automatically.
//
// Query parameter broadcaster_id must match the user_id in the User-Access token
// Requires OAuth Scope: channel:manage:guest_star
func (g *GuestStar) CreateGuestStarSession(ctx context.Context, broadcasterID string) (*CreateGuestStarSessionResponse, error) {
endpoint := g.baseUrl.ResolveReference(&url.URL{Path: "guest_star/session", RawQuery: url.Values{"broadcaster_id": {broadcasterID}}.Encode()})
req, err := http.NewRequestWithContext(ctx, http.MethodPost, endpoint.String(), nil)
if err != nil {
return nil, err
}
res, err := g.client.Do(req)
if err != nil {
return nil, err
}
defer res.Body.Close()
var data CreateGuestStarSessionResponse
if err := json.NewDecoder(res.Body).Decode(&data); err != nil {
return nil, err
}
return &data, nil
}

View File

@ -0,0 +1,46 @@
package gueststar
import (
"context"
"net/http"
"net/url"
"github.com/google/go-querystring/query"
)
type DeleteGuestStarInviteParams struct {
// The ID of the broadcaster you want to end a Guest Star session for. Provided broadcaster_id must match the user_id in the auth token.
BroadcasterID string `url:"broadcaster_id"`
// The ID of the broadcaster or a user that has permission to moderate the broadcasters chat room.
// This ID must match the user ID in the user access token.
ModeratorID string `url:"moderator_id"`
// The session ID for the invite to be revoked on behalf of the broadcaster.
SessionID string `url:"session_id"`
// Twitch User ID for the guest to revoke the Guest Star session invite from.
GuestID string `url:"guest_id"`
}
// Revokes a previously sent invite for a Guest Star session.
//
// Query parameter moderator_id must match the user_id in the User-Access token
// Requires OAuth Scope: channel:manage:guest_star or moderator:manage:guest_star
func (g *GuestStar) DeleteGuestStarInvite(ctx context.Context, params *DeleteGuestStarInviteParams) error {
v, _ := query.Values(params)
endpoint := g.baseUrl.ResolveReference(&url.URL{Path: "guest_star/invite", RawQuery: v.Encode()})
req, err := http.NewRequestWithContext(ctx, http.MethodDelete, endpoint.String(), nil)
if err != nil {
return err
}
res, err := g.client.Do(req)
if err != nil {
return err
}
defer res.Body.Close()
return nil
}

View File

@ -0,0 +1,53 @@
package gueststar
import (
"context"
"net/http"
"net/url"
"github.com/google/go-querystring/query"
)
type DeleteGuestStarSlotParams struct {
// The ID of the broadcaster running the Guest Star session.
BroadcasterID string `url:"broadcaster_id"`
// The ID of the broadcaster or a user that has permission to moderate the broadcasters chat room.
// This ID must match the user ID in the user access token.
ModeratorID string `url:"moderator_id"`
// The ID of the Guest Star session in which to remove the slot assignment.
SessionID string `url:"session_id"`
// The Twitch User ID corresponding to the guest to remove from the session.
// This user must already have an invite to this session, and have indicated that they are ready to join.
GuestID string `url:"guest_id"`
// The slot ID representing the slot assignment to remove from the session.
SlotID int `url:"slot_id"`
// Flag signaling that the guest should be reinvited to the session, sending them back to the invite queue.
ShouldReinviteGuest *bool `url:"should_reinvite_guest"`
}
// Allows a caller to remove a slot assignment from a user participating in an active Guest Star session. This revokes their access to the session immediately and disables their access to publish or subscribe to media within the session.
//
// Query parameter moderator_id must match the user_id in the User-Access token
// Requires OAuth Scope: channel:manage:guest_star or moderator:manage:guest_star
func (g *GuestStar) DeleteGuestStarSlot(ctx context.Context, params *DeleteGuestStarSlotParams) error {
v, _ := query.Values(params)
endpoint := g.baseUrl.ResolveReference(&url.URL{Path: "guest_star/slot", RawQuery: v.Encode()})
req, err := http.NewRequestWithContext(ctx, http.MethodDelete, endpoint.String(), nil)
if err != nil {
return err
}
res, err := g.client.Do(req)
if err != nil {
return err
}
defer res.Body.Close()
return nil
}

View File

@ -0,0 +1,51 @@
package gueststar
import (
"context"
"encoding/json"
"net/http"
"net/url"
"github.com/google/go-querystring/query"
)
type EndGuestStarSession struct {
// The ID of the broadcaster you want to end a Guest Star session for. Provided broadcaster_id must match the user_id in the auth token.
BroadcasterID string `url:"broadcaster_id"`
// ID for the session to end on behalf of the broadcaster.
SessionID string `url:"session_id"`
}
type EndGuestStarSessionResponse struct {
// Summary of the session details when the session was ended.
Data []Session `json:"data"`
}
// Programmatically ends a Guest Star session on behalf of the broadcaster.
// Performs the same action as if the host clicked the “End Call” button in the Guest Star UI.
//
// Query parameter broadcaster_id must match the user_id in the User-Access token
// Requires OAuth Scope: channel:manage:guest_star
func (g *GuestStar) EndGuestStarSession(ctx context.Context, params *EndGuestStarSession) (*EndGuestStarSessionResponse, error) {
v, _ := query.Values(params)
endpoint := g.baseUrl.ResolveReference(&url.URL{Path: "guest_star/session", RawQuery: v.Encode()})
req, err := http.NewRequestWithContext(ctx, http.MethodDelete, endpoint.String(), nil)
if err != nil {
return nil, err
}
res, err := g.client.Do(req)
if err != nil {
return nil, err
}
defer res.Body.Close()
var data EndGuestStarSessionResponse
if err := json.NewDecoder(res.Body).Decode(&data); err != nil {
return nil, err
}
return &data, nil
}

View File

@ -0,0 +1,50 @@
package gueststar
import (
"context"
"encoding/json"
"net/http"
"net/url"
"github.com/google/go-querystring/query"
)
type GetChannelGuestStarSettingsParams struct {
// The ID of the broadcaster you want to get guest star settings for.
BroadcasterID string `url:"broadcaster_id"`
// The ID of the broadcaster or a user that has permission to moderate the broadcasters chat room.
// This ID must match the user ID in the user access token.
ModeratorID string `url:"moderator_id"`
}
type GetChannelGuestStarSettingsResponse struct {
Data []ChannelSettings `json:"data"`
}
// Gets the channel settings for configuration of the Guest Star feature for a particular host.
//
// Query parameter moderator_id must match the user_id in the User-Access token
// Requires OAuth Scope: channel:read:guest_star, channel:manage:guest_star, moderator:read:guest_star or moderator:manage:guest_star
func (g *GuestStar) GetChannelGuestStarSettings(ctx context.Context, params *GetChannelGuestStarSettingsParams) (*GetChannelGuestStarSettingsResponse, error) {
v, _ := query.Values(params)
endpoint := g.baseUrl.ResolveReference(&url.URL{Path: "guest_star/channel_settings", RawQuery: v.Encode()})
req, err := http.NewRequestWithContext(ctx, http.MethodGet, endpoint.String(), nil)
if err != nil {
return nil, err
}
res, err := g.client.Do(req)
if err != nil {
return nil, err
}
defer res.Body.Close()
var data GetChannelGuestStarSettingsResponse
if err := json.NewDecoder(res.Body).Decode(&data); err != nil {
return nil, err
}
return &data, nil
}

View File

@ -0,0 +1,54 @@
package gueststar
import (
"context"
"encoding/json"
"net/http"
"net/url"
"github.com/google/go-querystring/query"
)
type GetGuestStarInvitesParams struct {
// The ID of the broadcaster you want to get guest star settings for.
BroadcasterID string `url:"broadcaster_id"`
// The ID of the broadcaster or a user that has permission to moderate the broadcasters chat room.
// This ID must match the user ID in the user access token.
ModeratorID string `url:"moderator_id"`
// The session ID to query for invite status.
SessionID string `url:"session_id"`
}
type GetGuestStarInvitesResponse struct {
// A list of invite objects describing the invited user as well as their ready status.
Data []Invite `json:"data"`
}
// Provides the caller with a list of pending invites to a Guest Star session, including the invitees ready status while joining the waiting room.
//
// Query parameter broadcaster_id must match the user_id in the User-Access token
// Requires OAuth Scope: channel:read:guest_star, channel:manage:guest_star, moderator:read:guest_star or moderator:manage:guest_star
func (g *GuestStar) GetGuestStarInvites(ctx context.Context, params *GetGuestStarInvitesParams) (*GetGuestStarInvitesResponse, error) {
v, _ := query.Values(params)
endpoint := g.baseUrl.ResolveReference(&url.URL{Path: "guest_star/invites", RawQuery: v.Encode()})
req, err := http.NewRequestWithContext(ctx, http.MethodGet, endpoint.String(), nil)
if err != nil {
return nil, err
}
res, err := g.client.Do(req)
if err != nil {
return nil, err
}
defer res.Body.Close()
var data GetGuestStarInvitesResponse
if err := json.NewDecoder(res.Body).Decode(&data); err != nil {
return nil, err
}
return &data, nil
}

View File

@ -0,0 +1,51 @@
package gueststar
import (
"context"
"encoding/json"
"net/http"
"net/url"
"github.com/google/go-querystring/query"
)
type GetGuestStarSessionParams struct {
// The ID of the broadcaster you want to get guest star settings for.
BroadcasterID string `url:"broadcaster_id"`
// The ID of the broadcaster or a user that has permission to moderate the broadcasters chat room.
// This ID must match the user ID in the user access token.
ModeratorID string `url:"moderator_id"`
}
type GetGuestStarSessionResponse struct {
// Summary of the session details
Data []Session `json:"data"`
}
// Gets information about an ongoing Guest Star session for a particular channel.
//
// Requires OAuth Scope: channel:read:guest_star, channel:manage:guest_star, moderator:read:guest_star or moderator:manage:guest_star
// Guests must be either invited or assigned a slot within the session
func (g *GuestStar) GetGuestStarSession(ctx context.Context, params *GetGuestStarSessionParams) (*GetGuestStarSessionResponse, error) {
v, _ := query.Values(params)
endpoint := g.baseUrl.ResolveReference(&url.URL{Path: "guest_star/session", RawQuery: v.Encode()})
req, err := http.NewRequestWithContext(ctx, http.MethodGet, endpoint.String(), nil)
if err != nil {
return nil, err
}
res, err := g.client.Do(req)
if err != nil {
return nil, err
}
defer res.Body.Close()
var data GetGuestStarSessionResponse
if err := json.NewDecoder(res.Body).Decode(&data); err != nil {
return nil, err
}
return &data, nil
}

View File

@ -0,0 +1,18 @@
package gueststar
import (
"net/http"
"net/url"
)
type GuestStar struct {
client *http.Client
baseUrl *url.URL
}
func New(client *http.Client, baseUrl *url.URL) *GuestStar {
return &GuestStar{
client: client,
baseUrl: baseUrl,
}
}

108
api/gueststar/models.go Normal file
View File

@ -0,0 +1,108 @@
package gueststar
import "time"
type ChannelSettings struct {
// Flag determining if Guest Star moderators have access to control whether a guest is live once assigned to a slot.
IsModeratorSendLiveEnabled bool `json:"is_moderator_send_live_enabled"`
// Number of slots the Guest Star call interface will allow the host to add to a call. Required to be between 1 and 6.
SlotCount int `json:"slot_count"`
// Flag determining if Browser Sources subscribed to sessions on this channel should output audio
IsBrowserSourceAudioEnabled bool `json:"is_browser_source_audio_enabled"`
// This setting determines how the guests within a session should be laid out within the browser source. Can be one of the following values:
//
// TILED_LAYOUT: All live guests are tiled within the browser source with the same size.
//
// SCREENSHARE_LAYOUT: All live guests are tiled within the browser source with the same size.
// If there is an active screen share, it is sized larger than the other guests.
GroupLayout string `json:"group_layout"`
// View only token to generate browser source URLs
BrowserSourceToken string `json:"browser_source_token"`
}
type Session struct {
// ID uniquely representing the Guest Star session.
ID string `json:"id"`
// List of guests currently interacting with the Guest Star session.
Guests []Guest `json:"guests"`
}
type Guest struct {
// ID representing this guests slot assignment.
//
// Host is always in slot "0"
// Guests are assigned the following consecutive IDs (e.g, "1", "2", "3", etc)
// Screen Share is represented as a special guest with the ID "SCREENSHARE"
// The identifier here matches the ID referenced in browser source links used in broadcasting software.
SlotID string `json:"slot_id"`
// Flag determining whether or not the guest is visible in the browser source in the hosts streaming software.
IsLive bool `json:"is_live"`
// User ID of the guest assigned to this slot.
UserID string `json:"user_id"`
// Display name of the guest assigned to this slot.
UserDisplayName string `json:"user_display_name"`
// Login of the guest assigned to this slot.
UserLogin string `json:"user_login"`
// Value from 0 to 100 representing the hosts volume setting for this guest.
Volume int `json:"volume"`
// Timestamp when this guest was assigned a slot in the session.
AssignedAt time.Time `json:"assigned_at"`
// Information about the guests audio settings
AudioSettings MediaSettings `json:"audio_settings"`
// Information about the guests video settings
VideoSettings MediaSettings `json:"video_settings"`
}
type MediaSettings struct {
// Flag determining whether the host is allowing the guests audio to be seen or heard within the session.
IsHostEnabled bool `json:"is_host_enabled"`
// Flag determining whether the guest is allowing their audio to be transmitted to the session.
IsGuestEnabled bool `json:"is_guest_enabled"`
// Flag determining whether the guest has an appropriate audio device available to be transmitted to the session.
IsAvailable bool `json:"is_available"`
}
type Invite struct {
// Twitch User ID corresponding to the invited guest
UserID string `json:"user_id"`
// Timestamp when this user was invited to the session.
InvitedAt time.Time `json:"invited_at"`
// Status representing the invited users join state. Can be one of the following:
//
// INVITED: The user has been invited to the session but has not acknowledged it.
//
// ACCEPTED: The invited user has acknowledged the invite and joined the waiting room,
// but may still be setting up their media devices or otherwise preparing to join the call.
//
// READY: The invited user has signaled they are ready to join the call from the waiting room.
Status string `json:"status"`
// Flag signaling that the invited user has chosen to disable their local video device. The user has hidden themselves, but they may choose to reveal their video feed upon joining the session.
IsVideoEnabled bool `json:"is_video_enabled"`
// Flag signaling that the invited user has chosen to disable their local audio device. The user has muted themselves, but they may choose to unmute their audio feed upon joining the session.
IsAudioEnabled bool `json:"is_audio_enabled"`
// Flag signaling that the invited user has a video device available for sharing.
IsVideoAvailable bool `json:"is_video_available"`
// Flag signaling that the invited user has an audio device available for sharing.
IsAudioAvailable bool `json:"is_audio_available"`
}

View File

@ -0,0 +1,46 @@
package gueststar
import (
"context"
"net/http"
"net/url"
"github.com/google/go-querystring/query"
)
type SendGuestStarInviteParams struct {
// The ID of the broadcaster you want to end a Guest Star session for. Provided broadcaster_id must match the user_id in the auth token.
BroadcasterID string `url:"broadcaster_id"`
// The ID of the broadcaster or a user that has permission to moderate the broadcasters chat room.
// This ID must match the user ID in the user access token.
ModeratorID string `url:"moderator_id"`
// The session ID for the invite to be sent on behalf of the broadcaster.
SessionID string `url:"session_id"`
// Twitch User ID for the guest to invite to the Guest Star session.
GuestID string `url:"guest_id"`
}
// Sends an invite to a specified guest on behalf of the broadcaster for a Guest Star session in progress.
//
// Query parameter moderator_id must match the user_id in the User-Access token
// Requires OAuth Scope: channel:manage:guest_star or moderator:manage:guest_star
func (g *GuestStar) SendGuestStarInvite(ctx context.Context, params *SendGuestStarInviteParams) error {
v, _ := query.Values(params)
endpoint := g.baseUrl.ResolveReference(&url.URL{Path: "guest_star/invite", RawQuery: v.Encode()})
req, err := http.NewRequestWithContext(ctx, http.MethodPost, endpoint.String(), nil)
if err != nil {
return err
}
res, err := g.client.Do(req)
if err != nil {
return err
}
defer res.Body.Close()
return nil
}

View File

@ -0,0 +1,55 @@
package gueststar
import (
"context"
"net/http"
"net/url"
)
type UpdateChannelGuestStarSettingsRequest struct {
// Flag determining if Guest Star moderators have access to control whether a guest is live once assigned to a slot.
IsModeratorSendLiveEnabled *bool `json:"is_moderator_send_live_enabled,omitempty"`
// Number of slots the Guest Star call interface will allow the host to add to a call. Required to be between 1 and 6.
SlotCount *int `json:"slot_count,omitempty"`
// Flag determining if Browser Sources subscribed to sessions on this channel should output audio
IsBrowserSourceAudioEnabled *bool `json:"is_browser_source_audio_enabled,omitempty"`
// This setting determines how the guests within a session should be laid out within the browser source. Can be one of the following values:
//
// TILED_LAYOUT: All live guests are tiled within the browser source with the same size.
//
// SCREENSHARE_LAYOUT: All live guests are tiled within the browser source with the same size.
// If there is an active screen share, it is sized larger than the other guests.
//
// HORIZONTAL_LAYOUT: All live guests are arranged in a horizontal bar within the browser source
//
// VERTICAL_LAYOUT: All live guests are arranged in a vertical bar within the browser source
GroupLayout *string `json:"group_layout,omitempty"`
// Flag determining if Guest Star should regenerate the auth token associated with the channels browser sources.
// Providing a true value for this will immediately invalidate all browser sources previously configured in your streaming software.
RegenerateBrowserSources *bool `json:"regenerate_browser_sources,omitempty"`
}
// Mutates the channel settings for configuration of the Guest Star feature for a particular host.
//
// Query parameter broadcaster_id must match the user_id in the User-Access token
// Requires OAuth Scope: channel:manage:guest_star
func (g *GuestStar) UpdateChannelGuestStarSettings(ctx context.Context, BroadcasterID string, body *UpdateChannelGuestStarSettingsRequest) error {
endpoint := g.baseUrl.ResolveReference(&url.URL{Path: "guest_star/channel_settings", RawQuery: url.Values{"broadcaster_id": {BroadcasterID}}.Encode()})
req, err := http.NewRequestWithContext(ctx, http.MethodPut, endpoint.String(), nil)
if err != nil {
return err
}
res, err := g.client.Do(req)
if err != nil {
return err
}
defer res.Body.Close()
return nil
}

View File

@ -0,0 +1,49 @@
package gueststar
import (
"context"
"net/http"
"net/url"
"github.com/google/go-querystring/query"
)
type UpdateGuestStarSlot struct {
// The ID of the broadcaster running the Guest Star session.
BroadcasterID string `url:"broadcaster_id"`
// The ID of the broadcaster or a user that has permission to moderate the broadcasters chat room.
// This ID must match the user_id in the user access token.
ModeratorID string `url:"moderator_id"`
// The ID of the Guest Star session in which to update slot settings.
SessionID string `url:"session_id"`
// The slot assignment previously assigned to a user.
SourceSlotID int `url:"source_slot_id"`
// The slot to move this user assignment to. If the destination slot is occupied, the user assigned will be swapped into source_slot_id.
DestinationSlotID int `url:"destination_slot_id"`
}
// Allows a user to update the assigned slot for a particular user within the active Guest Star session.
//
// Query parameter moderator_id must match the user_id in the User-Access token
// Requires OAuth Scope: channel:manage:guest_star or moderator:manage:guest_star
func (g *GuestStar) UpdateGuestStarSlot(ctx context.Context, params *UpdateGuestStarSlot) error {
v, _ := query.Values(params)
endpoint := g.baseUrl.ResolveReference(&url.URL{Path: "guest_star/slot", RawQuery: v.Encode()})
req, err := http.NewRequestWithContext(ctx, http.MethodPost, endpoint.String(), nil)
if err != nil {
return err
}
res, err := g.client.Do(req)
if err != nil {
return err
}
defer res.Body.Close()
return nil
}

View File

@ -0,0 +1,61 @@
package gueststar
import (
"context"
"net/http"
"net/url"
"github.com/google/go-querystring/query"
)
type UpdateGuestStarSlotSettingsParams struct {
// The ID of the broadcaster running the Guest Star session.
BroadcasterID string `url:"broadcaster_id"`
// The ID of the broadcaster or a user that has permission to moderate the broadcasters chat room.
// This ID must match the user ID in the user access token.
ModeratorID string `url:"moderator_id"`
// The ID of the Guest Star session in which to update a slots settings.
SessionID string `url:"session_id"`
// The slot assignment that has previously been assigned to a user.
SlotID int `url:"slot_id"`
// Flag indicating whether the slot is allowed to share their audio with the rest of the session.
// If false, the slot will be muted in any views containing the slot.
IsAudioEnabled *bool `url:"is_audio_enabled"`
// Flag indicating whether the slot is allowed to share their video with the rest of the session.
// If false, the slot will have no video shared in any views containing the slot.
IsVideoEnabled *bool `url:"is_video_enabled"`
// Flag indicating whether the user assigned to this slot is visible/can be heard from any public subscriptions.
// Generally, this determines whether or not the slot is enabled in any broadcasting software integrations.
IsLive *bool `url:"is_live"`
// Value from 0-100 that controls the audio volume for shared views containing the slot.
Volume *int `url:"volume"`
}
// Allows a user to update slot settings for a particular guest within a Guest Star session, such as allowing the user to share audio or video within the call as a host. These settings will be broadcasted to all subscribers which control their view of the guest in that slot. One or more of the optional parameters to this API can be specified at any time.
//
// Query parameter moderator_id must match the user_id in the User-Access token
// Requires OAuth Scope: channel:manage:guest_star or moderator:manage:guest_star
func (g *GuestStar) UpdateGuestStarSlotSettings(ctx context.Context, params *UpdateGuestStarSlotSettingsParams) error {
v, _ := query.Values(params)
endpoint := g.baseUrl.ResolveReference(&url.URL{Path: "guest_star/slot_settings", RawQuery: v.Encode()})
req, err := http.NewRequestWithContext(ctx, http.MethodPost, endpoint.String(), nil)
if err != nil {
return err
}
res, err := g.client.Do(req)
if err != nil {
return err
}
defer res.Body.Close()
return nil
}