Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/anonymous structs #13

Merged
merged 11 commits into from
Jun 19, 2021
2 changes: 1 addition & 1 deletion api/events/xx_generated.general.heartbeat.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ type Heartbeat struct {
Recording bool `json:"recording"`

// OBS Stats
Stats []typedefs.OBSStats `json:"stats"`
Stats typedefs.OBSStats `json:"stats"`

// Current streaming state.
Streaming bool `json:"streaming"`
Expand Down
10 changes: 6 additions & 4 deletions api/events/xx_generated.profiles.profilelistchanged.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@ Since v4.0.0.
type ProfileListChanged struct {
EventBasic

Profiles []struct {
// Profile name.
Name string `json:"name"`
} `json:"profiles"`
Profiles []*Profile `json:"profiles"`
}

type Profile struct {
// Profile name.
Name string `json:"name"`
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@ type SceneItemTransformChanged struct {
SceneName string `json:"scene-name"`

// Scene item transform properties
Transform []typedefs.SceneItemTransform `json:"transform"`
Transform typedefs.SceneItemTransform `json:"transform"`
}
16 changes: 9 additions & 7 deletions api/events/xx_generated.scene_items.sourceorderchanged.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,16 @@ Since v4.0.0.
type SourceOrderChanged struct {
EventBasic

SceneItems []struct {
// Scene item unique ID
ItemId int `json:"item-id"`

// Item source name
SourceName string `json:"source-name"`
} `json:"scene-items"`
SceneItems []*SceneItem `json:"scene-items"`

// Name of the scene where items have been reordered.
SceneName string `json:"scene-name"`
}

type SceneItem struct {
// Scene item unique ID
ItemId int `json:"item-id"`

// Item source name
SourceName string `json:"source-name"`
}
10 changes: 6 additions & 4 deletions api/events/xx_generated.scenes.scenecollectionlistchanged.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@ Since v4.0.0.
type SceneCollectionListChanged struct {
EventBasic

SceneCollections []struct {
// Scene collection name.
Name string `json:"name"`
} `json:"sceneCollections"`
SceneCollections []*SceneCollection `json:"sceneCollections"`
}

type SceneCollection struct {
// Scene collection name.
Name string `json:"name"`
}
4 changes: 3 additions & 1 deletion api/events/xx_generated.scenes.sceneschanged.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

package events

import typedefs "github.com/andreykaipov/goobs/api/typedefs"

/*
ScenesChanged represents the event body for the "ScenesChanged" event.
Since v0.3.
Expand All @@ -10,5 +12,5 @@ type ScenesChanged struct {
EventBasic

// Scenes list.
Scenes []map[string]interface{} `json:"scenes"`
Scenes []typedefs.Scene `json:"scenes"`
}
16 changes: 9 additions & 7 deletions api/events/xx_generated.sources.sourceaudiomixerschanged.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,16 @@ type SourceAudioMixersChanged struct {
// Raw mixer flags (little-endian, one bit per mixer) as an hexadecimal value
HexMixersValue string `json:"hexMixersValue"`

Mixers []struct {
// Routing status
Enabled bool `json:"enabled"`

// Mixer number
Id int `json:"id"`
} `json:"mixers"`
Mixers []*Mixer `json:"mixers"`

// Source name
SourceName string `json:"sourceName"`
}

type Mixer struct {
// Routing status
Enabled bool `json:"enabled"`

// Mixer number
Id int `json:"id"`
}
14 changes: 4 additions & 10 deletions api/events/xx_generated.sources.sourcefiltersreordered.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,17 @@

package events

import typedefs "github.com/andreykaipov/goobs/api/typedefs"

/*
SourceFiltersReordered represents the event body for the "SourceFiltersReordered" event.
Since v4.6.0.
*/
type SourceFiltersReordered struct {
EventBasic

Filters []struct {
// Filter visibility status
Enabled bool `json:"enabled"`

// Filter name
Name string `json:"name"`

// Filter type
Type string `json:"type"`
} `json:"filters"`
// The filters for this object.
Filters []typedefs.Filter `json:"filters"`

// Source name
SourceName string `json:"sourceName"`
Expand Down
10 changes: 6 additions & 4 deletions api/events/xx_generated.transitions.transitionlistchanged.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@ Since v4.0.0.
type TransitionListChanged struct {
EventBasic

Transitions []struct {
// Transition name.
Name string `json:"name"`
} `json:"transitions"`
Transitions []*Transition `json:"transitions"`
}

type Transition struct {
// Transition name.
Name string `json:"name"`
}
36 changes: 20 additions & 16 deletions api/requests/general/xx_generated.executebatch.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,16 @@ type ExecuteBatchParams struct {
// Stop processing batch requests if one returns a failure.
AbortOnFail bool `json:"abortOnFail"`

Requests []struct {
// ID of the individual request. Can be any string and not required to be unique. Defaults to empty string if
// not specified.
MessageId string `json:"message-id"`

// Request type. Eg. `GetVersion`.
RequestType string `json:"request-type"`
} `json:"requests"`
Requests []*Request `json:"requests"`
}

type Request struct {
// ID of the individual request. Can be any string and not required to be unique. Defaults to empty string if not
// specified.
MessageId string `json:"message-id"`

// Request type. Eg. `GetVersion`.
RequestType string `json:"request-type"`
}

// GetSelfName just returns "ExecuteBatch".
Expand All @@ -38,16 +40,18 @@ Since v4.9.0.
type ExecuteBatchResponse struct {
requests.ResponseBasic

Results []struct {
// Error message accompanying an `error` status.
Error string `json:"error"`
Results []*Result `json:"results"`
}

type Result struct {
// Error message accompanying an `error` status.
Error string `json:"error"`

// ID of the individual request which was originally provided by the client.
MessageId string `json:"message-id"`
// ID of the individual request which was originally provided by the client.
MessageId string `json:"message-id"`

// Status response as string. Either `ok` or `error`.
Status string `json:"status"`
} `json:"results"`
// Status response as string. Either `ok` or `error`.
Status string `json:"status"`
}

// ExecuteBatch sends the corresponding request to the connected OBS WebSockets server.
Expand Down
2 changes: 1 addition & 1 deletion api/requests/general/xx_generated.getstats.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ type GetStatsResponse struct {
requests.ResponseBasic

// [OBS stats](#obsstats)
Stats []typedefs.OBSStats `json:"stats"`
Stats typedefs.OBSStats `json:"stats"`
}

// GetStats sends the corresponding request to the connected OBS WebSockets server. Note the variadic arguments as this
Expand Down
22 changes: 12 additions & 10 deletions api/requests/general/xx_generated.triggerhotkeybysequence.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,21 @@ type TriggerHotkeyBySequenceParams struct {
// [here](https://github.com/obsproject/obs-studio/blob/master/libobs/obs-hotkeys.h)
KeyId string `json:"keyId"`

KeyModifiers struct {
// Trigger Alt Key
Alt bool `json:"alt"`
KeyModifiers *KeyModifiers `json:"keyModifiers"`
}

type KeyModifiers struct {
// Trigger Alt Key
Alt bool `json:"alt"`

// Trigger Command Key (Mac)
Command bool `json:"command"`
// Trigger Command Key (Mac)
Command bool `json:"command"`

// Trigger Control (Ctrl) Key
Control bool `json:"control"`
// Trigger Control (Ctrl) Key
Control bool `json:"control"`

// Trigger Shift Key
Shift bool `json:"shift"`
} `json:"keyModifiers"`
// Trigger Shift Key
Shift bool `json:"shift"`
}

// GetSelfName just returns "TriggerHotkeyBySequence".
Expand Down
2 changes: 1 addition & 1 deletion api/requests/outputs/xx_generated.getoutputinfo.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ type GetOutputInfoResponse struct {
requests.ResponseBasic

// Output info
OutputInfo []typedefs.Output `json:"outputInfo"`
OutputInfo typedefs.Output `json:"outputInfo"`
}

// GetOutputInfo sends the corresponding request to the connected OBS WebSockets server.
Expand Down
10 changes: 6 additions & 4 deletions api/requests/profiles/xx_generated.listprofiles.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,12 @@ Since v4.0.0.
type ListProfilesResponse struct {
requests.ResponseBasic

Profiles []struct {
// Filter name
ProfileName string `json:"profile-name"`
} `json:"profiles"`
Profiles []*Profile `json:"profiles"`
}

type Profile struct {
// Filter name
ProfileName string `json:"profile-name"`
}

// ListProfiles sends the corresponding request to the connected OBS WebSockets server. Note the variadic arguments as
Expand Down
14 changes: 6 additions & 8 deletions api/requests/scene_items/xx_generated.deletesceneitem.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@

package sceneitems

import requests "github.com/andreykaipov/goobs/api/requests"
import (
requests "github.com/andreykaipov/goobs/api/requests"
typedefs "github.com/andreykaipov/goobs/api/typedefs"
)

/*
DeleteSceneItemParams represents the params body for the "DeleteSceneItem" request.
Expand All @@ -12,13 +15,8 @@ Since 4.5.0.
type DeleteSceneItemParams struct {
requests.ParamsBasic

Item struct {
// Scene Item ID.
Id int `json:"id"`

// Scene Item name (prefer `id`, including both is acceptable).
Name string `json:"name"`
} `json:"item"`
// The item specification for this object.
Item typedefs.Item `json:"item"`

// Name of the scene the scene item belongs to. Defaults to the current scene.
Scene string `json:"scene"`
Expand Down
23 changes: 8 additions & 15 deletions api/requests/scene_items/xx_generated.duplicatesceneitem.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@

package sceneitems

import requests "github.com/andreykaipov/goobs/api/requests"
import (
requests "github.com/andreykaipov/goobs/api/requests"
typedefs "github.com/andreykaipov/goobs/api/typedefs"
)

/*
DuplicateSceneItemParams represents the params body for the "DuplicateSceneItem" request.
Expand All @@ -15,13 +18,8 @@ type DuplicateSceneItemParams struct {
// Name of the scene to copy the item from. Defaults to the current scene.
FromScene string `json:"fromScene"`

Item struct {
// Scene Item ID.
Id int `json:"id"`

// Scene Item name (prefer `id`, including both is acceptable).
Name string `json:"name"`
} `json:"item"`
// The item specification for this object.
Item typedefs.Item `json:"item"`

// Name of the scene to create the item in. Defaults to the current scene.
ToScene string `json:"toScene"`
Expand All @@ -40,13 +38,8 @@ Since v4.5.0.
type DuplicateSceneItemResponse struct {
requests.ResponseBasic

Item struct {
// New item ID
Id int `json:"id"`

// New item name
Name string `json:"name"`
} `json:"item"`
// The item specification for this object.
Item typedefs.Item `json:"item"`

// Name of the scene where the new item was created
Scene string `json:"scene"`
Expand Down
26 changes: 14 additions & 12 deletions api/requests/scene_items/xx_generated.getsceneitemlist.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,22 +29,24 @@ Since v4.9.0.
type GetSceneItemListResponse struct {
requests.ResponseBasic

SceneItems []struct {
// Unique item id of the source item
ItemId int `json:"itemId"`
SceneItems []*SceneItem `json:"sceneItems"`

// ID if the scene item's source. For example `vlc_source` or `image_source`
SourceKind string `json:"sourceKind"`
// Name of the requested (or current) scene
SceneName string `json:"sceneName"`
}

// Name of the scene item's source
SourceName string `json:"sourceName"`
type SceneItem struct {
// Unique item id of the source item
ItemId int `json:"itemId"`

// Type of the scene item's source. Either `input`, `group`, or `scene`
SourceType string `json:"sourceType"`
} `json:"sceneItems"`
// ID if the scene item's source. For example `vlc_source` or `image_source`
SourceKind string `json:"sourceKind"`

// Name of the requested (or current) scene
SceneName string `json:"sceneName"`
// Name of the scene item's source
SourceName string `json:"sourceName"`

// Type of the scene item's source. Either `input`, `group`, or `scene`
SourceType string `json:"sourceType"`
}

// GetSceneItemList sends the corresponding request to the connected OBS WebSockets server.
Expand Down
Loading