Small openapi router generation experiment

This commit is contained in:
Gabe Kangas 2024-03-24 22:38:41 -07:00
parent 14277c15dd
commit 0d24f8522f
No known key found for this signature in database
GPG Key ID: 4345B2060657F330
7 changed files with 14908 additions and 0 deletions

5
experiment/generate-apis.sh Executable file
View File

@ -0,0 +1,5 @@
#!/bin/sh
mkdir -p webserver/handlers
oapi-codegen -generate "types" -o webserver/handlers/openapi_server-types.gen.go -package handlers -response-type-suffix responses openapi.yaml
oapi-codegen -generate "chi-server" -o webserver/handlers/openapi_server.gen.go -package handlers -response-type-suffix responses openapi.yaml

21
experiment/go.mod Normal file
View File

@ -0,0 +1,21 @@
module oapi-test
go 1.20
require github.com/go-chi/chi v1.5.5
require (
github.com/getkin/kin-openapi v0.120.0
github.com/go-chi/chi/v5 v5.0.10
)
require (
github.com/go-openapi/jsonpointer v0.19.6 // indirect
github.com/go-openapi/swag v0.22.4 // indirect
github.com/invopop/yaml v0.2.0 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 // indirect
github.com/perimeterx/marshmallow v1.1.5 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)

41
experiment/go.sum Normal file
View File

@ -0,0 +1,41 @@
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/getkin/kin-openapi v0.120.0 h1:MqJcNJFrMDFNc07iwE8iFC5eT2k/NPUFDIpNeiZv8Jg=
github.com/getkin/kin-openapi v0.120.0/go.mod h1:PCWw/lfBrJY4HcdqE3jj+QFkaFK8ABoqo7PvqVhXXqw=
github.com/go-chi/chi v1.5.5 h1:vOB/HbEMt9QqBqErz07QehcOKHaWFtuj87tTDVz2qXE=
github.com/go-chi/chi v1.5.5/go.mod h1:C9JqLr3tIYjDOZpzn+BCuxY8z8vmca43EeMgyZt7irw=
github.com/go-chi/chi/v5 v5.0.10 h1:rLz5avzKpjqxrYwXNfmjkrYYXOyLJd37pz53UFHC6vk=
github.com/go-chi/chi/v5 v5.0.10/go.mod h1:DslCQbL2OYiznFReuXYUmQ2hGd1aDpCnlMNITLSKoi8=
github.com/go-openapi/jsonpointer v0.19.6 h1:eCs3fxoIi3Wh6vtgmLTOjdhSpiqphQ+DaPn38N2ZdrE=
github.com/go-openapi/jsonpointer v0.19.6/go.mod h1:osyAmYz/mB/C3I+WsTTSgw1ONzaLJoLCyoi6/zppojs=
github.com/go-openapi/swag v0.22.3/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14=
github.com/go-openapi/swag v0.22.4 h1:QLMzNJnMGPRNDCbySlcj1x01tzU8/9LTTL9hZZZogBU=
github.com/go-openapi/swag v0.22.4/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14=
github.com/invopop/yaml v0.2.0 h1:7zky/qH+O0DwAyoobXUqvVBwgBFRxKoQ/3FjcVpjTMY=
github.com/invopop/yaml v0.2.0/go.mod h1:2XuRLgs/ouIrW3XNzuNj7J3Nvu/Dig5MXvbCEdiBN3Q=
github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY=
github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y=
github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0=
github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc=
github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 h1:RWengNIwukTxcDr9M+97sNutRR1RKhG96O6jWumTTnw=
github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826/go.mod h1:TaXosZuwdSHYgviHp1DAtfrULt5eUgsSMsZf+YrPgl8=
github.com/perimeterx/marshmallow v1.1.5 h1:a2LALqQ1BlHM8PZblsDdidgv1mWi1DgC2UmX50IvK2s=
github.com/perimeterx/marshmallow v1.1.5/go.mod h1:dsXbUu8CRzfYP5a87xpp0xq9S3u0Vchtcl8we9tYaXw=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.0/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=

18
experiment/main.go Normal file
View File

@ -0,0 +1,18 @@
package main
import (
"net/http"
)
func main() {
s := Handlers{}
h := Handler(s)
// r := chi.NewRouter()
// r.Use(middleware.Logger)
// r.Get("/welcome", func(w http.ResponseWriter, r *http.Request) {
// w.Write([]byte("welcome"))
// })
// r.Mount("/", Handler(&handlers))
http.ListenAndServe(":3000", h)
}

12484
experiment/openapi.yaml Normal file

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,541 @@
// Package handlers provides primitives to interact with the openapi HTTP API.
//
// Code generated by github.com/deepmap/oapi-codegen version v1.15.0 DO NOT EDIT.
package handlers
import (
"encoding/json"
"time"
"github.com/oapi-codegen/runtime"
)
const (
AdminScopes = "Admin.Scopes"
)
// ChatMessage A single chat message.
type ChatMessage struct {
// Body The text content of the chat message.
Body *string `json:"body,omitempty"`
Id *string `json:"id,omitempty"`
Timestamp *time.Time `json:"timestamp,omitempty"`
Type *string `json:"type,omitempty"`
User *User `json:"user,omitempty"`
}
// ConfigResponse A response returned for many admin-based configuration changes
type ConfigResponse struct {
Message *string `json:"message,omitempty"`
Success *bool `json:"success,omitempty"`
}
// ConfigValue This request is used for many of the admin APIs for setting a new value.
type ConfigValue struct {
Value ConfigValue_Value `json:"value"`
}
// ConfigValueValue0 defines model for .
type ConfigValueValue0 = map[string]interface{}
// ConfigValueValue1 defines model for .
type ConfigValueValue1 = []interface{}
// ConfigValueValue2 defines model for .
type ConfigValueValue2 = int
// ConfigValueValue3 defines model for .
type ConfigValueValue3 = string
// ConfigValueValue4 defines model for .
type ConfigValueValue4 = bool
// ConfigValue_Value defines model for ConfigValue.Value.
type ConfigValue_Value struct {
union json.RawMessage
}
// FediverseFollower Single follower of this server on the Fediverse.
type FediverseFollower struct {
// Image Profile image for this follower
Image *string `json:"image,omitempty"`
// Link URL for this follower on the Fediverse
Link *string `json:"link,omitempty"`
// Name The follower's display name
Name *string `json:"name,omitempty"`
// Timestamp The time this user followed this Owncast server
Timestamp *time.Time `json:"timestamp,omitempty"`
// Username The Fediverse account name (user@server)
Username *string `json:"username,omitempty"`
}
// SocialHandleLink defines model for SocialHandleLink.
type SocialHandleLink struct {
// Icon Location of an icon image for this social platform.
Icon *string `json:"icon,omitempty"`
// Platform Name of the social platform
Platform string `json:"platform"`
// Url The URL where this link should be pointed to.
Url string `json:"url"`
}
// User defines model for User.
type User struct {
Authenticated *bool `json:"authenticated,omitempty"`
CreatedAt *time.Time `json:"createdAt,omitempty"`
DisplayColor *int `json:"displayColor,omitempty"`
DisplayName *string `json:"displayName,omitempty"`
Id *string `json:"id,omitempty"`
IsBot *bool `json:"isBot,omitempty"`
NameChangedAt *time.Time `json:"nameChangedAt,omitempty"`
PreviousNames *[]string `json:"previousNames,omitempty"`
}
// UserGeoLocation defines model for User-Geo-Location.
type UserGeoLocation struct {
CountryCode *string `json:"countryCode,omitempty"`
RegionName *string `json:"regionName,omitempty"`
TimeZone *string `json:"timeZone,omitempty"`
}
// UserScope defines model for UserScope.
type UserScope = interface{}
// VideoVariant A single video output configuration that details the specifics of quality, performance, etc.
type VideoVariant struct {
CpuUsageLevel *int `json:"cpuUsageLevel,omitempty"`
Framerate *int `json:"framerate,omitempty"`
// Name A user-displayed name to call this output quality.
Name *string `json:"name,omitempty"`
ScaledHeight *int `json:"scaledHeight,omitempty"`
ScaledWidth *int `json:"scaledWidth,omitempty"`
VideoBitrate *int `json:"videoBitrate,omitempty"`
// VideoPassthrough Should encoding be disabled and video be sent out the same as it was recieved?
VideoPassthrough *bool `json:"videoPassthrough,omitempty"`
}
// WebhookEventType The event types available to alert external services
type WebhookEventType = interface{}
// GetApiAdminAccesstokensJSONBody defines parameters for GetApiAdminAccesstokens.
type GetApiAdminAccesstokensJSONBody = []struct {
Authenticated *bool `json:"authenticated,omitempty"`
CreatedAt *time.Time `json:"createdAt,omitempty"`
DisplayColor *int `json:"displayColor,omitempty"`
DisplayName *string `json:"displayName,omitempty"`
Id *string `json:"id,omitempty"`
IsBot *bool `json:"isBot,omitempty"`
NameChangedAt *time.Time `json:"nameChangedAt,omitempty"`
PreviousNames *[]string `json:"previousNames,omitempty"`
}
// PostApiAdminAccesstokensCreateJSONBody defines parameters for PostApiAdminAccesstokensCreate.
type PostApiAdminAccesstokensCreateJSONBody struct {
// Empty An array of user access scopes to specify what this access token is allowed to do.
Empty *[]UserScope `json:",omitempty"`
// Name The access token name, used as the display name for this user in chat.
Name string `json:"name"`
}
// PostApiAdminAccesstokensDeleteJSONBody defines parameters for PostApiAdminAccesstokensDelete.
type PostApiAdminAccesstokensDeleteJSONBody struct {
// Token Single access token
Token string `json:"token"`
}
// GetApiAdminChatClientsJSONBody defines parameters for GetApiAdminChatClients.
type GetApiAdminChatClientsJSONBody = []struct {
ConnectedAt *time.Time `json:"connectedAt,omitempty"`
Geo *UserGeoLocation `json:"geo,omitempty"`
MessageCount *int `json:"messageCount,omitempty"`
User *User `json:"user,omitempty"`
UserAgent *string `json:"userAgent,omitempty"`
}
// PostApiAdminChatMessagevisibilityJSONBody defines parameters for PostApiAdminChatMessagevisibility.
type PostApiAdminChatMessagevisibilityJSONBody struct {
Empty *struct {
// IdArray Chat message IDs you want to show or hide.
IdArray []string `json:"idArray"`
// Visible Set to true if you want these messages to be visible, false if not.
Visible bool `json:"visible"`
} `json:",omitempty"`
}
// PostApiAdminChatUsersSetenabledJSONBody defines parameters for PostApiAdminChatUsersSetenabled.
type PostApiAdminChatUsersSetenabledJSONBody struct {
Enabled bool `json:"enabled"`
UserId string `json:"userId"`
}
// PostApiAdminChatUsersSetmoderatorJSONBody defines parameters for PostApiAdminChatUsersSetmoderator.
type PostApiAdminChatUsersSetmoderatorJSONBody struct {
IsModerator bool `json:"isModerator"`
UserId string `json:"userId"`
}
// PostApiAdminConfigSocialhandlesJSONBody defines parameters for PostApiAdminConfigSocialhandles.
type PostApiAdminConfigSocialhandlesJSONBody = []SocialHandleLink
// PostApiAdminConfigStreamkeysJSONBody defines parameters for PostApiAdminConfigStreamkeys.
type PostApiAdminConfigStreamkeysJSONBody struct {
Value *[]struct {
// Comment Optional comment to describe this key or who it's used by.
Comment *string `json:"comment,omitempty"`
// Key Streaming key
Key string `json:"key"`
} `json:"value,omitempty"`
}
// PostApiAdminConfigTagsJSONBody defines parameters for PostApiAdminConfigTags.
type PostApiAdminConfigTagsJSONBody = []string
// PostApiAdminConfigVideoStreamoutputvariantsJSONBody defines parameters for PostApiAdminConfigVideoStreamoutputvariants.
type PostApiAdminConfigVideoStreamoutputvariantsJSONBody struct {
// Value Array of video configurations.
Value []VideoVariant `json:"value"`
}
// PostApiAdminEmojiDeleteJSONBody defines parameters for PostApiAdminEmojiDelete.
type PostApiAdminEmojiDeleteJSONBody struct {
// Name Name of the custom chat emoji you wish to remove.
Name string `json:"name"`
}
// PostApiAdminEmojiUploadJSONBody defines parameters for PostApiAdminEmojiUpload.
type PostApiAdminEmojiUploadJSONBody struct {
Data []byte `json:"data"`
// Name Name of emoji
Name string `json:"name"`
}
// PostApiAdminFollowersApproveJSONBody defines parameters for PostApiAdminFollowersApprove.
type PostApiAdminFollowersApproveJSONBody struct {
// ActorIRI The IRI of this follower on the Fediverse
ActorIRI string `json:"actorIRI"`
// Approved Is this follow request approved? False to deny.
Approved bool `json:"approved"`
}
// GetApiAdminHardwarestatsJSONBody defines parameters for GetApiAdminHardwarestats.
type GetApiAdminHardwarestatsJSONBody struct {
Cpu *[]struct {
Time *time.Time `json:"time,omitempty"`
Value *float32 `json:"value,omitempty"`
} `json:"cpu,omitempty"`
Disk *[]struct {
Time *time.Time `json:"time,omitempty"`
Value *float32 `json:"value,omitempty"`
} `json:"disk,omitempty"`
Memory *[]struct {
Time *time.Time `json:"time,omitempty"`
Value *float32 `json:"value,omitempty"`
} `json:"memory,omitempty"`
}
// GetApiAdminLogsJSONBody defines parameters for GetApiAdminLogs.
type GetApiAdminLogsJSONBody = []struct {
// Level Error or warning
Level *string `json:"level,omitempty"`
Message *string `json:"message,omitempty"`
Time *time.Time `json:"time,omitempty"`
}
// PostApiAdminWebhooksCreateJSONBody defines parameters for PostApiAdminWebhooksCreate.
type PostApiAdminWebhooksCreateJSONBody struct {
// Events An array of events that should be sent to the external webhook.
Events []WebhookEventType `json:"events"`
// Url The URL to inform when the events take place.
Url string `json:"url"`
}
// PostApiAdminWebhooksDeleteJSONBody defines parameters for PostApiAdminWebhooksDelete.
type PostApiAdminWebhooksDeleteJSONBody struct {
Id *string `json:"id,omitempty"`
}
// GetApiAdminAccesstokensJSONRequestBody defines body for GetApiAdminAccesstokens for application/json ContentType.
type GetApiAdminAccesstokensJSONRequestBody = GetApiAdminAccesstokensJSONBody
// PostApiAdminAccesstokensCreateJSONRequestBody defines body for PostApiAdminAccesstokensCreate for application/json ContentType.
type PostApiAdminAccesstokensCreateJSONRequestBody PostApiAdminAccesstokensCreateJSONBody
// PostApiAdminAccesstokensDeleteJSONRequestBody defines body for PostApiAdminAccesstokensDelete for application/json ContentType.
type PostApiAdminAccesstokensDeleteJSONRequestBody PostApiAdminAccesstokensDeleteJSONBody
// GetApiAdminChatClientsJSONRequestBody defines body for GetApiAdminChatClients for application/json ContentType.
type GetApiAdminChatClientsJSONRequestBody = GetApiAdminChatClientsJSONBody
// PostApiAdminChatMessagevisibilityJSONRequestBody defines body for PostApiAdminChatMessagevisibility for application/json ContentType.
type PostApiAdminChatMessagevisibilityJSONRequestBody PostApiAdminChatMessagevisibilityJSONBody
// PostApiAdminChatUsersIpbansCreateJSONRequestBody defines body for PostApiAdminChatUsersIpbansCreate for application/json ContentType.
type PostApiAdminChatUsersIpbansCreateJSONRequestBody = ConfigValue
// PostApiAdminChatUsersIpbansRemoveJSONRequestBody defines body for PostApiAdminChatUsersIpbansRemove for application/json ContentType.
type PostApiAdminChatUsersIpbansRemoveJSONRequestBody = ConfigValue
// PostApiAdminChatUsersSetenabledJSONRequestBody defines body for PostApiAdminChatUsersSetenabled for application/json ContentType.
type PostApiAdminChatUsersSetenabledJSONRequestBody PostApiAdminChatUsersSetenabledJSONBody
// PostApiAdminChatUsersSetmoderatorJSONRequestBody defines body for PostApiAdminChatUsersSetmoderator for application/json ContentType.
type PostApiAdminChatUsersSetmoderatorJSONRequestBody PostApiAdminChatUsersSetmoderatorJSONBody
// PostApiAdminConfigAdminpassJSONRequestBody defines body for PostApiAdminConfigAdminpass for application/json ContentType.
type PostApiAdminConfigAdminpassJSONRequestBody = ConfigValue
// PostApiAdminConfigAppearanceJSONRequestBody defines body for PostApiAdminConfigAppearance for application/json ContentType.
type PostApiAdminConfigAppearanceJSONRequestBody = ConfigValue
// PostApiAdminConfigChatDisableJSONRequestBody defines body for PostApiAdminConfigChatDisable for application/json ContentType.
type PostApiAdminConfigChatDisableJSONRequestBody = ConfigValue
// PostApiAdminConfigChatEstablishedusermodeJSONRequestBody defines body for PostApiAdminConfigChatEstablishedusermode for application/json ContentType.
type PostApiAdminConfigChatEstablishedusermodeJSONRequestBody = ConfigValue
// PostApiAdminConfigChatForbiddenusernamesJSONRequestBody defines body for PostApiAdminConfigChatForbiddenusernames for application/json ContentType.
type PostApiAdminConfigChatForbiddenusernamesJSONRequestBody = ConfigValue
// PostApiAdminConfigChatJoinmessagesenabledJSONRequestBody defines body for PostApiAdminConfigChatJoinmessagesenabled for application/json ContentType.
type PostApiAdminConfigChatJoinmessagesenabledJSONRequestBody = ConfigValue
// PostApiAdminConfigChatSuggestedusernamesJSONRequestBody defines body for PostApiAdminConfigChatSuggestedusernames for application/json ContentType.
type PostApiAdminConfigChatSuggestedusernamesJSONRequestBody = ConfigValue
// PostApiAdminConfigDirectoryenabledJSONRequestBody defines body for PostApiAdminConfigDirectoryenabled for application/json ContentType.
type PostApiAdminConfigDirectoryenabledJSONRequestBody = ConfigValue
// PostApiAdminConfigFfmpegpathJSONRequestBody defines body for PostApiAdminConfigFfmpegpath for application/json ContentType.
type PostApiAdminConfigFfmpegpathJSONRequestBody = ConfigValue
// PostApiAdminConfigLogoJSONRequestBody defines body for PostApiAdminConfigLogo for application/json ContentType.
type PostApiAdminConfigLogoJSONRequestBody = ConfigValue
// PostApiAdminConfigNameJSONRequestBody defines body for PostApiAdminConfigName for application/json ContentType.
type PostApiAdminConfigNameJSONRequestBody = ConfigValue
// PostApiAdminConfigNsfwJSONRequestBody defines body for PostApiAdminConfigNsfw for application/json ContentType.
type PostApiAdminConfigNsfwJSONRequestBody = ConfigValue
// PostApiAdminConfigOfflinemessageJSONRequestBody defines body for PostApiAdminConfigOfflinemessage for application/json ContentType.
type PostApiAdminConfigOfflinemessageJSONRequestBody = ConfigValue
// PostApiAdminConfigPagecontentJSONRequestBody defines body for PostApiAdminConfigPagecontent for application/json ContentType.
type PostApiAdminConfigPagecontentJSONRequestBody = ConfigValue
// PostApiAdminConfigRtmpserverportJSONRequestBody defines body for PostApiAdminConfigRtmpserverport for application/json ContentType.
type PostApiAdminConfigRtmpserverportJSONRequestBody = ConfigValue
// PostApiAdminConfigServersummaryJSONRequestBody defines body for PostApiAdminConfigServersummary for application/json ContentType.
type PostApiAdminConfigServersummaryJSONRequestBody = ConfigValue
// PostApiAdminConfigSocialhandlesJSONRequestBody defines body for PostApiAdminConfigSocialhandles for application/json ContentType.
type PostApiAdminConfigSocialhandlesJSONRequestBody = PostApiAdminConfigSocialhandlesJSONBody
// PostApiAdminConfigSockethostoverrideJSONRequestBody defines body for PostApiAdminConfigSockethostoverride for application/json ContentType.
type PostApiAdminConfigSockethostoverrideJSONRequestBody = ConfigValue
// PostApiAdminConfigStreamkeysJSONRequestBody defines body for PostApiAdminConfigStreamkeys for application/json ContentType.
type PostApiAdminConfigStreamkeysJSONRequestBody PostApiAdminConfigStreamkeysJSONBody
// PostApiAdminConfigStreamtitleJSONRequestBody defines body for PostApiAdminConfigStreamtitle for application/json ContentType.
type PostApiAdminConfigStreamtitleJSONRequestBody = ConfigValue
// PostApiAdminConfigTagsJSONRequestBody defines body for PostApiAdminConfigTags for application/json ContentType.
type PostApiAdminConfigTagsJSONRequestBody = PostApiAdminConfigTagsJSONBody
// PostApiAdminConfigVideoCodecJSONRequestBody defines body for PostApiAdminConfigVideoCodec for application/json ContentType.
type PostApiAdminConfigVideoCodecJSONRequestBody = ConfigValue
// PostApiAdminConfigVideoStreamlatencylevelJSONRequestBody defines body for PostApiAdminConfigVideoStreamlatencylevel for application/json ContentType.
type PostApiAdminConfigVideoStreamlatencylevelJSONRequestBody = ConfigValue
// PostApiAdminConfigVideoStreamoutputvariantsJSONRequestBody defines body for PostApiAdminConfigVideoStreamoutputvariants for application/json ContentType.
type PostApiAdminConfigVideoStreamoutputvariantsJSONRequestBody PostApiAdminConfigVideoStreamoutputvariantsJSONBody
// PostApiAdminConfigVideoservingendpointJSONRequestBody defines body for PostApiAdminConfigVideoservingendpoint for application/json ContentType.
type PostApiAdminConfigVideoservingendpointJSONRequestBody = ConfigValue
// PostApiAdminConfigWebserveripJSONRequestBody defines body for PostApiAdminConfigWebserverip for application/json ContentType.
type PostApiAdminConfigWebserveripJSONRequestBody = ConfigValue
// PostApiAdminConfigWebserverportJSONRequestBody defines body for PostApiAdminConfigWebserverport for application/json ContentType.
type PostApiAdminConfigWebserverportJSONRequestBody = ConfigValue
// PostApiAdminConfigWelcomemessageJSONRequestBody defines body for PostApiAdminConfigWelcomemessage for application/json ContentType.
type PostApiAdminConfigWelcomemessageJSONRequestBody = ConfigValue
// PostApiAdminEmojiDeleteJSONRequestBody defines body for PostApiAdminEmojiDelete for application/json ContentType.
type PostApiAdminEmojiDeleteJSONRequestBody PostApiAdminEmojiDeleteJSONBody
// PostApiAdminEmojiUploadJSONRequestBody defines body for PostApiAdminEmojiUpload for application/json ContentType.
type PostApiAdminEmojiUploadJSONRequestBody PostApiAdminEmojiUploadJSONBody
// PostApiAdminFollowersApproveJSONRequestBody defines body for PostApiAdminFollowersApprove for application/json ContentType.
type PostApiAdminFollowersApproveJSONRequestBody PostApiAdminFollowersApproveJSONBody
// GetApiAdminHardwarestatsJSONRequestBody defines body for GetApiAdminHardwarestats for application/json ContentType.
type GetApiAdminHardwarestatsJSONRequestBody GetApiAdminHardwarestatsJSONBody
// GetApiAdminLogsJSONRequestBody defines body for GetApiAdminLogs for application/json ContentType.
type GetApiAdminLogsJSONRequestBody = GetApiAdminLogsJSONBody
// PostApiAdminWebhooksCreateJSONRequestBody defines body for PostApiAdminWebhooksCreate for application/json ContentType.
type PostApiAdminWebhooksCreateJSONRequestBody PostApiAdminWebhooksCreateJSONBody
// PostApiAdminWebhooksDeleteJSONRequestBody defines body for PostApiAdminWebhooksDelete for application/json ContentType.
type PostApiAdminWebhooksDeleteJSONRequestBody PostApiAdminWebhooksDeleteJSONBody
// AsConfigValueValue0 returns the union data inside the ConfigValue_Value as a ConfigValueValue0
func (t ConfigValue_Value) AsConfigValueValue0() (ConfigValueValue0, error) {
var body ConfigValueValue0
err := json.Unmarshal(t.union, &body)
return body, err
}
// FromConfigValueValue0 overwrites any union data inside the ConfigValue_Value as the provided ConfigValueValue0
func (t *ConfigValue_Value) FromConfigValueValue0(v ConfigValueValue0) error {
b, err := json.Marshal(v)
t.union = b
return err
}
// MergeConfigValueValue0 performs a merge with any union data inside the ConfigValue_Value, using the provided ConfigValueValue0
func (t *ConfigValue_Value) MergeConfigValueValue0(v ConfigValueValue0) error {
b, err := json.Marshal(v)
if err != nil {
return err
}
merged, err := runtime.JsonMerge(t.union, b)
t.union = merged
return err
}
// AsConfigValueValue1 returns the union data inside the ConfigValue_Value as a ConfigValueValue1
func (t ConfigValue_Value) AsConfigValueValue1() (ConfigValueValue1, error) {
var body ConfigValueValue1
err := json.Unmarshal(t.union, &body)
return body, err
}
// FromConfigValueValue1 overwrites any union data inside the ConfigValue_Value as the provided ConfigValueValue1
func (t *ConfigValue_Value) FromConfigValueValue1(v ConfigValueValue1) error {
b, err := json.Marshal(v)
t.union = b
return err
}
// MergeConfigValueValue1 performs a merge with any union data inside the ConfigValue_Value, using the provided ConfigValueValue1
func (t *ConfigValue_Value) MergeConfigValueValue1(v ConfigValueValue1) error {
b, err := json.Marshal(v)
if err != nil {
return err
}
merged, err := runtime.JsonMerge(t.union, b)
t.union = merged
return err
}
// AsConfigValueValue2 returns the union data inside the ConfigValue_Value as a ConfigValueValue2
func (t ConfigValue_Value) AsConfigValueValue2() (ConfigValueValue2, error) {
var body ConfigValueValue2
err := json.Unmarshal(t.union, &body)
return body, err
}
// FromConfigValueValue2 overwrites any union data inside the ConfigValue_Value as the provided ConfigValueValue2
func (t *ConfigValue_Value) FromConfigValueValue2(v ConfigValueValue2) error {
b, err := json.Marshal(v)
t.union = b
return err
}
// MergeConfigValueValue2 performs a merge with any union data inside the ConfigValue_Value, using the provided ConfigValueValue2
func (t *ConfigValue_Value) MergeConfigValueValue2(v ConfigValueValue2) error {
b, err := json.Marshal(v)
if err != nil {
return err
}
merged, err := runtime.JsonMerge(t.union, b)
t.union = merged
return err
}
// AsConfigValueValue3 returns the union data inside the ConfigValue_Value as a ConfigValueValue3
func (t ConfigValue_Value) AsConfigValueValue3() (ConfigValueValue3, error) {
var body ConfigValueValue3
err := json.Unmarshal(t.union, &body)
return body, err
}
// FromConfigValueValue3 overwrites any union data inside the ConfigValue_Value as the provided ConfigValueValue3
func (t *ConfigValue_Value) FromConfigValueValue3(v ConfigValueValue3) error {
b, err := json.Marshal(v)
t.union = b
return err
}
// MergeConfigValueValue3 performs a merge with any union data inside the ConfigValue_Value, using the provided ConfigValueValue3
func (t *ConfigValue_Value) MergeConfigValueValue3(v ConfigValueValue3) error {
b, err := json.Marshal(v)
if err != nil {
return err
}
merged, err := runtime.JsonMerge(t.union, b)
t.union = merged
return err
}
// AsConfigValueValue4 returns the union data inside the ConfigValue_Value as a ConfigValueValue4
func (t ConfigValue_Value) AsConfigValueValue4() (ConfigValueValue4, error) {
var body ConfigValueValue4
err := json.Unmarshal(t.union, &body)
return body, err
}
// FromConfigValueValue4 overwrites any union data inside the ConfigValue_Value as the provided ConfigValueValue4
func (t *ConfigValue_Value) FromConfigValueValue4(v ConfigValueValue4) error {
b, err := json.Marshal(v)
t.union = b
return err
}
// MergeConfigValueValue4 performs a merge with any union data inside the ConfigValue_Value, using the provided ConfigValueValue4
func (t *ConfigValue_Value) MergeConfigValueValue4(v ConfigValueValue4) error {
b, err := json.Marshal(v)
if err != nil {
return err
}
merged, err := runtime.JsonMerge(t.union, b)
t.union = merged
return err
}
func (t ConfigValue_Value) MarshalJSON() ([]byte, error) {
b, err := t.union.MarshalJSON()
return b, err
}
func (t *ConfigValue_Value) UnmarshalJSON(b []byte) error {
err := t.union.UnmarshalJSON(b)
return err
}

File diff suppressed because it is too large Load Diff