videolibrary_update.go raw
1 package bunny
2
3 import (
4 "context"
5 "fmt"
6 )
7
8 // VideoLibraryUpdateOptions represents the request parameters for the Update Storage
9 // Zone API endpoint.
10 //
11 // Bunny.net API docs: https://docs.bunny.net/reference/pullzonepublic_updatepullzone
12 type VideoLibraryUpdateOptions struct {
13 Name *string `json:"Name,omitempty"`
14 CustomHTML *string `json:"CustomHTML,omitempty"`
15 PlayerKeyColor *string `json:"PlayerKeyColor,omitempty"`
16 EnableTokenAuthentication *bool `json:"EnableTokenAuthentication,omitempty"`
17 EnableTokenIPVerification *bool `json:"EnableTokenIPVerification,omitempty"`
18 ResetToken *bool `json:"ResetToken,omitempty"`
19 WatermarkPositionLeft *int32 `json:"WatermarkPositionLeft,omitempty"`
20 WatermarkPositionTop *int32 `json:"WatermarkPositionTop,omitempty"`
21 WatermarkWidth *int32 `json:"WatermarkWidth,omitempty"`
22 WatermarkHeight *int32 `json:"WatermarkHeight,omitempty"`
23 EnabledResolutions *string `json:"EnabledResolutions,omitempty"`
24 ViAiPublisherID *string `json:"ViAiPublisherId,omitempty"`
25 VastTagURL *string `json:"VastTagUrl,omitempty"`
26 WebhookURL *string `json:"WebhookUrl,omitempty"`
27 CaptionsFontSize *int32 `json:"CaptionsFontSize,omitempty"`
28 CaptionsFontColor *string `json:"CaptionsFontColor,omitempty"`
29 CaptionsBackground *string `json:"CaptionsBackground,omitempty"`
30 UILanguage *string `json:"UILanguage,omitempty"`
31 AllowEarlyPlay *bool `json:"AllowEarlyPlay,omitempty"`
32 PlayerTokenAuthenticationEnabled *bool `json:"PlayerTokenAuthenticationEnabled,omitempty"`
33 BlockNoneReferrer *bool `json:"BlockNoneReferrer,omitempty"`
34 EnableMP4Fallback *bool `json:"EnableMP4Fallback,omitempty"`
35 KeepOriginalFiles *bool `json:"KeepOriginalFiles,omitempty"`
36 AllowDirectPlay *bool `json:"AllowDirectPlay,omitempty"`
37 EnableDRM *bool `json:"EnableDRM,omitempty"`
38 Controls *string `json:"Controls,omitempty"`
39 Bitrate240p *int32 `json:"Bitrate240p,omitempty"`
40 Bitrate360p *int32 `json:"Bitrate360p,omitempty"`
41 Bitrate480p *int32 `json:"Bitrate480p,omitempty"`
42 Bitrate720p *int32 `json:"Bitrate720p,omitempty"`
43 Bitrate1080p *int32 `json:"Bitrate1080p,omitempty"`
44 Bitrate1440p *int32 `json:"Bitrate1440p,omitempty"`
45 Bitrate2160p *int32 `json:"Bitrate2160p,omitempty"`
46 ShowHeatmap *bool `json:"ShowHeatmap,omitempty"`
47 EnableContentTagging *bool `json:"EnableContentTagging,omitempty"`
48 FontFamily *string `json:"FontFamily,omitempty"`
49 }
50
51 // Update changes the configuration the Video Library with the given ID.
52 // Bunny.net API docs: https://docs.bunny.net/reference/pullzonepublic_updatepullzone
53 func (s *VideoLibraryService) Update(ctx context.Context, id int64, opts *VideoLibraryUpdateOptions) (*VideoLibrary, error) {
54 path := fmt.Sprintf("videolibrary/%d", id)
55 return resourcePostWithResponse[VideoLibrary](ctx, s.client, path, opts)
56 }
57