ficsit-cli-flake/ficsit/types.go
Rob B e313efdfec
feat: compatibility info display in View Mod screen. log to ficsit-cli.log by default (#33)
* fix: log by default (ficsit-cli.log in CWD)

* chore: update readme with info on code generation

* chore: regenerate docs for default log file location

* feat: compatibility info state and note display. wip: keybind to switch view modes not working

* fix: move render code out to a function, but it still isn't quite working yet

* feat: display mod reference below mod name

* Fix compat toggle with

* Show scroll up/down on quick help

* chore: fix merge conflict

* chore: run go install mvdan.cc/gofumpt@latest; gofumpt -l -w .

* chore: run gci.exe write --skip-generated -s standard -s default -s 'prefix(github.com/satisfactorymodding/ficsit-cli)' -s blank -s dot .

* chore: update readme linting info and run golangci-lint --version

* fix: log file is defaulted to empty again

* fix(#33): update render to return just string

* fix(#33): renderModInfo returns only string

* fix(#33): reollback func namechange

* refactor(#33): remove redundant viewport refresh

* refactor(#33): update is not required after setting content

* refactor(#33): remove unrequired log

* docs(#33): update documentation to latest generated

* docs(#33): update cache reference to not contain username

* docs(#33): fix local dir references too

* refactor(#33): replace vague variable with more helpful

* Add directions about using dev schema when generate command fails

* Fix issues from earlier merge conflict

---------

Co-authored-by: Jack Stupple <jack.stupple@protonmail.com>
2023-12-28 04:32:56 +02:00

1351 lines
45 KiB
Go

// Code generated by github.com/Khan/genqlient, DO NOT EDIT.
package ficsit
import (
"context"
"encoding/json"
"fmt"
"time"
"github.com/Khan/genqlient/graphql"
"github.com/satisfactorymodding/ficsit-cli/ficsit/utils"
)
// CheckVersionUploadStateResponse is returned by CheckVersionUploadState on success.
type CheckVersionUploadStateResponse struct {
State CheckVersionUploadStateStateCreateVersionResponse `json:"state"`
}
// GetState returns CheckVersionUploadStateResponse.State, and is useful for accessing the field via an interface.
func (v *CheckVersionUploadStateResponse) GetState() CheckVersionUploadStateStateCreateVersionResponse {
return v.State
}
// CheckVersionUploadStateStateCreateVersionResponse includes the requested fields of the GraphQL type CreateVersionResponse.
type CheckVersionUploadStateStateCreateVersionResponse struct {
Auto_approved bool `json:"auto_approved"`
Version CheckVersionUploadStateStateCreateVersionResponseVersion `json:"version"`
}
// GetAuto_approved returns CheckVersionUploadStateStateCreateVersionResponse.Auto_approved, and is useful for accessing the field via an interface.
func (v *CheckVersionUploadStateStateCreateVersionResponse) GetAuto_approved() bool {
return v.Auto_approved
}
// GetVersion returns CheckVersionUploadStateStateCreateVersionResponse.Version, and is useful for accessing the field via an interface.
func (v *CheckVersionUploadStateStateCreateVersionResponse) GetVersion() CheckVersionUploadStateStateCreateVersionResponseVersion {
return v.Version
}
// CheckVersionUploadStateStateCreateVersionResponseVersion includes the requested fields of the GraphQL type Version.
type CheckVersionUploadStateStateCreateVersionResponseVersion struct {
Id string `json:"id"`
}
// GetId returns CheckVersionUploadStateStateCreateVersionResponseVersion.Id, and is useful for accessing the field via an interface.
func (v *CheckVersionUploadStateStateCreateVersionResponseVersion) GetId() string { return v.Id }
type CompatibilityState string
const (
CompatibilityStateWorks CompatibilityState = "Works"
CompatibilityStateDamaged CompatibilityState = "Damaged"
CompatibilityStateBroken CompatibilityState = "Broken"
)
// CreateVersionResponse is returned by CreateVersion on success.
type CreateVersionResponse struct {
VersionID string `json:"versionID"`
}
// GetVersionID returns CreateVersionResponse.VersionID, and is useful for accessing the field via an interface.
func (v *CreateVersionResponse) GetVersionID() string { return v.VersionID }
// FinalizeCreateVersionResponse is returned by FinalizeCreateVersion on success.
type FinalizeCreateVersionResponse struct {
Success bool `json:"success"`
}
// GetSuccess returns FinalizeCreateVersionResponse.Success, and is useful for accessing the field via an interface.
func (v *FinalizeCreateVersionResponse) GetSuccess() bool { return v.Success }
// GetModMod includes the requested fields of the GraphQL type Mod.
type GetModMod struct {
Id string `json:"id"`
Mod_reference string `json:"mod_reference"`
Name string `json:"name"`
Views int `json:"views"`
Downloads int `json:"downloads"`
Authors []GetModModAuthorsUserMod `json:"authors"`
Compatibility GetModModCompatibilityCompatibilityInfo `json:"compatibility"`
Full_description string `json:"full_description"`
Source_url string `json:"source_url"`
Created_at time.Time `json:"-"`
}
// GetId returns GetModMod.Id, and is useful for accessing the field via an interface.
func (v *GetModMod) GetId() string { return v.Id }
// GetMod_reference returns GetModMod.Mod_reference, and is useful for accessing the field via an interface.
func (v *GetModMod) GetMod_reference() string { return v.Mod_reference }
// GetName returns GetModMod.Name, and is useful for accessing the field via an interface.
func (v *GetModMod) GetName() string { return v.Name }
// GetViews returns GetModMod.Views, and is useful for accessing the field via an interface.
func (v *GetModMod) GetViews() int { return v.Views }
// GetDownloads returns GetModMod.Downloads, and is useful for accessing the field via an interface.
func (v *GetModMod) GetDownloads() int { return v.Downloads }
// GetAuthors returns GetModMod.Authors, and is useful for accessing the field via an interface.
func (v *GetModMod) GetAuthors() []GetModModAuthorsUserMod { return v.Authors }
// GetCompatibility returns GetModMod.Compatibility, and is useful for accessing the field via an interface.
func (v *GetModMod) GetCompatibility() GetModModCompatibilityCompatibilityInfo {
return v.Compatibility
}
// GetFull_description returns GetModMod.Full_description, and is useful for accessing the field via an interface.
func (v *GetModMod) GetFull_description() string { return v.Full_description }
// GetSource_url returns GetModMod.Source_url, and is useful for accessing the field via an interface.
func (v *GetModMod) GetSource_url() string { return v.Source_url }
// GetCreated_at returns GetModMod.Created_at, and is useful for accessing the field via an interface.
func (v *GetModMod) GetCreated_at() time.Time { return v.Created_at }
func (v *GetModMod) UnmarshalJSON(b []byte) error {
if string(b) == "null" {
return nil
}
var firstPass struct {
*GetModMod
Created_at json.RawMessage `json:"created_at"`
graphql.NoUnmarshalJSON
}
firstPass.GetModMod = v
err := json.Unmarshal(b, &firstPass)
if err != nil {
return err
}
{
dst := &v.Created_at
src := firstPass.Created_at
if len(src) != 0 && string(src) != "null" {
err = utils.UnmarshalDateTime(
src, dst)
if err != nil {
return fmt.Errorf(
"unable to unmarshal GetModMod.Created_at: %w", err)
}
}
}
return nil
}
type __premarshalGetModMod struct {
Id string `json:"id"`
Mod_reference string `json:"mod_reference"`
Name string `json:"name"`
Views int `json:"views"`
Downloads int `json:"downloads"`
Authors []GetModModAuthorsUserMod `json:"authors"`
Compatibility GetModModCompatibilityCompatibilityInfo `json:"compatibility"`
Full_description string `json:"full_description"`
Source_url string `json:"source_url"`
Created_at json.RawMessage `json:"created_at"`
}
func (v *GetModMod) MarshalJSON() ([]byte, error) {
premarshaled, err := v.__premarshalJSON()
if err != nil {
return nil, err
}
return json.Marshal(premarshaled)
}
func (v *GetModMod) __premarshalJSON() (*__premarshalGetModMod, error) {
var retval __premarshalGetModMod
retval.Id = v.Id
retval.Mod_reference = v.Mod_reference
retval.Name = v.Name
retval.Views = v.Views
retval.Downloads = v.Downloads
retval.Authors = v.Authors
retval.Compatibility = v.Compatibility
retval.Full_description = v.Full_description
retval.Source_url = v.Source_url
{
dst := &retval.Created_at
src := v.Created_at
var err error
*dst, err = json.Marshal(
&src)
if err != nil {
return nil, fmt.Errorf(
"unable to marshal GetModMod.Created_at: %w", err)
}
}
return &retval, nil
}
// GetModModAuthorsUserMod includes the requested fields of the GraphQL type UserMod.
type GetModModAuthorsUserMod struct {
Role string `json:"role"`
User GetModModAuthorsUserModUser `json:"user"`
}
// GetRole returns GetModModAuthorsUserMod.Role, and is useful for accessing the field via an interface.
func (v *GetModModAuthorsUserMod) GetRole() string { return v.Role }
// GetUser returns GetModModAuthorsUserMod.User, and is useful for accessing the field via an interface.
func (v *GetModModAuthorsUserMod) GetUser() GetModModAuthorsUserModUser { return v.User }
// GetModModAuthorsUserModUser includes the requested fields of the GraphQL type User.
type GetModModAuthorsUserModUser struct {
Username string `json:"username"`
}
// GetUsername returns GetModModAuthorsUserModUser.Username, and is useful for accessing the field via an interface.
func (v *GetModModAuthorsUserModUser) GetUsername() string { return v.Username }
// GetModModCompatibilityCompatibilityInfo includes the requested fields of the GraphQL type CompatibilityInfo.
type GetModModCompatibilityCompatibilityInfo struct {
EA GetModModCompatibilityCompatibilityInfoEACompatibility `json:"EA"`
EXP GetModModCompatibilityCompatibilityInfoEXPCompatibility `json:"EXP"`
}
// GetEA returns GetModModCompatibilityCompatibilityInfo.EA, and is useful for accessing the field via an interface.
func (v *GetModModCompatibilityCompatibilityInfo) GetEA() GetModModCompatibilityCompatibilityInfoEACompatibility {
return v.EA
}
// GetEXP returns GetModModCompatibilityCompatibilityInfo.EXP, and is useful for accessing the field via an interface.
func (v *GetModModCompatibilityCompatibilityInfo) GetEXP() GetModModCompatibilityCompatibilityInfoEXPCompatibility {
return v.EXP
}
// GetModModCompatibilityCompatibilityInfoEACompatibility includes the requested fields of the GraphQL type Compatibility.
type GetModModCompatibilityCompatibilityInfoEACompatibility struct {
Note string `json:"note"`
State CompatibilityState `json:"state"`
}
// GetNote returns GetModModCompatibilityCompatibilityInfoEACompatibility.Note, and is useful for accessing the field via an interface.
func (v *GetModModCompatibilityCompatibilityInfoEACompatibility) GetNote() string { return v.Note }
// GetState returns GetModModCompatibilityCompatibilityInfoEACompatibility.State, and is useful for accessing the field via an interface.
func (v *GetModModCompatibilityCompatibilityInfoEACompatibility) GetState() CompatibilityState {
return v.State
}
// GetModModCompatibilityCompatibilityInfoEXPCompatibility includes the requested fields of the GraphQL type Compatibility.
type GetModModCompatibilityCompatibilityInfoEXPCompatibility struct {
Note string `json:"note"`
State CompatibilityState `json:"state"`
}
// GetNote returns GetModModCompatibilityCompatibilityInfoEXPCompatibility.Note, and is useful for accessing the field via an interface.
func (v *GetModModCompatibilityCompatibilityInfoEXPCompatibility) GetNote() string { return v.Note }
// GetState returns GetModModCompatibilityCompatibilityInfoEXPCompatibility.State, and is useful for accessing the field via an interface.
func (v *GetModModCompatibilityCompatibilityInfoEXPCompatibility) GetState() CompatibilityState {
return v.State
}
// GetModNameMod includes the requested fields of the GraphQL type Mod.
type GetModNameMod struct {
Id string `json:"id"`
Mod_reference string `json:"mod_reference"`
Name string `json:"name"`
}
// GetId returns GetModNameMod.Id, and is useful for accessing the field via an interface.
func (v *GetModNameMod) GetId() string { return v.Id }
// GetMod_reference returns GetModNameMod.Mod_reference, and is useful for accessing the field via an interface.
func (v *GetModNameMod) GetMod_reference() string { return v.Mod_reference }
// GetName returns GetModNameMod.Name, and is useful for accessing the field via an interface.
func (v *GetModNameMod) GetName() string { return v.Name }
// GetModNameResponse is returned by GetModName on success.
type GetModNameResponse struct {
Mod GetModNameMod `json:"mod"`
}
// GetMod returns GetModNameResponse.Mod, and is useful for accessing the field via an interface.
func (v *GetModNameResponse) GetMod() GetModNameMod { return v.Mod }
// GetModResponse is returned by GetMod on success.
type GetModResponse struct {
Mod GetModMod `json:"mod"`
}
// GetMod returns GetModResponse.Mod, and is useful for accessing the field via an interface.
func (v *GetModResponse) GetMod() GetModMod { return v.Mod }
type ModFields string
const (
ModFieldsCreatedAt ModFields = "created_at"
ModFieldsUpdatedAt ModFields = "updated_at"
ModFieldsName ModFields = "name"
ModFieldsViews ModFields = "views"
ModFieldsDownloads ModFields = "downloads"
ModFieldsHotness ModFields = "hotness"
ModFieldsPopularity ModFields = "popularity"
ModFieldsLastVersionDate ModFields = "last_version_date"
ModFieldsSearch ModFields = "search"
)
type ModFilter struct {
Limit int `json:"limit,omitempty"`
Offset int `json:"offset,omitempty"`
Order_by ModFields `json:"order_by,omitempty"`
Order Order `json:"order,omitempty"`
Search string `json:"search,omitempty"`
Ids []string `json:"ids,omitempty"`
References []string `json:"references,omitempty"`
Hidden bool `json:"hidden,omitempty"`
TagIDs []string `json:"tagIDs,omitempty"`
}
// GetLimit returns ModFilter.Limit, and is useful for accessing the field via an interface.
func (v *ModFilter) GetLimit() int { return v.Limit }
// GetOffset returns ModFilter.Offset, and is useful for accessing the field via an interface.
func (v *ModFilter) GetOffset() int { return v.Offset }
// GetOrder_by returns ModFilter.Order_by, and is useful for accessing the field via an interface.
func (v *ModFilter) GetOrder_by() ModFields { return v.Order_by }
// GetOrder returns ModFilter.Order, and is useful for accessing the field via an interface.
func (v *ModFilter) GetOrder() Order { return v.Order }
// GetSearch returns ModFilter.Search, and is useful for accessing the field via an interface.
func (v *ModFilter) GetSearch() string { return v.Search }
// GetIds returns ModFilter.Ids, and is useful for accessing the field via an interface.
func (v *ModFilter) GetIds() []string { return v.Ids }
// GetReferences returns ModFilter.References, and is useful for accessing the field via an interface.
func (v *ModFilter) GetReferences() []string { return v.References }
// GetHidden returns ModFilter.Hidden, and is useful for accessing the field via an interface.
func (v *ModFilter) GetHidden() bool { return v.Hidden }
// GetTagIDs returns ModFilter.TagIDs, and is useful for accessing the field via an interface.
func (v *ModFilter) GetTagIDs() []string { return v.TagIDs }
// ModVersionsMod includes the requested fields of the GraphQL type Mod.
type ModVersionsMod struct {
Id string `json:"id"`
Versions []ModVersionsModVersionsVersion `json:"versions"`
}
// GetId returns ModVersionsMod.Id, and is useful for accessing the field via an interface.
func (v *ModVersionsMod) GetId() string { return v.Id }
// GetVersions returns ModVersionsMod.Versions, and is useful for accessing the field via an interface.
func (v *ModVersionsMod) GetVersions() []ModVersionsModVersionsVersion { return v.Versions }
// ModVersionsModVersionsVersion includes the requested fields of the GraphQL type Version.
type ModVersionsModVersionsVersion struct {
Id string `json:"id"`
Version string `json:"version"`
}
// GetId returns ModVersionsModVersionsVersion.Id, and is useful for accessing the field via an interface.
func (v *ModVersionsModVersionsVersion) GetId() string { return v.Id }
// GetVersion returns ModVersionsModVersionsVersion.Version, and is useful for accessing the field via an interface.
func (v *ModVersionsModVersionsVersion) GetVersion() string { return v.Version }
// ModVersionsResponse is returned by ModVersions on success.
type ModVersionsResponse struct {
Mod ModVersionsMod `json:"mod"`
}
// GetMod returns ModVersionsResponse.Mod, and is useful for accessing the field via an interface.
func (v *ModVersionsResponse) GetMod() ModVersionsMod { return v.Mod }
// ModVersionsWithDependenciesMod includes the requested fields of the GraphQL type Mod.
type ModVersionsWithDependenciesMod struct {
Id string `json:"id"`
Versions []ModVersionsWithDependenciesModVersionsVersion `json:"versions"`
}
// GetId returns ModVersionsWithDependenciesMod.Id, and is useful for accessing the field via an interface.
func (v *ModVersionsWithDependenciesMod) GetId() string { return v.Id }
// GetVersions returns ModVersionsWithDependenciesMod.Versions, and is useful for accessing the field via an interface.
func (v *ModVersionsWithDependenciesMod) GetVersions() []ModVersionsWithDependenciesModVersionsVersion {
return v.Versions
}
// ModVersionsWithDependenciesModVersionsVersion includes the requested fields of the GraphQL type Version.
type ModVersionsWithDependenciesModVersionsVersion struct {
Id string `json:"id"`
Version string `json:"version"`
Link string `json:"link"`
Hash string `json:"hash"`
Dependencies []ModVersionsWithDependenciesModVersionsVersionDependenciesVersionDependency `json:"dependencies"`
Targets []ModVersionsWithDependenciesModVersionsVersionTargetsVersionTarget `json:"targets"`
}
// GetId returns ModVersionsWithDependenciesModVersionsVersion.Id, and is useful for accessing the field via an interface.
func (v *ModVersionsWithDependenciesModVersionsVersion) GetId() string { return v.Id }
// GetVersion returns ModVersionsWithDependenciesModVersionsVersion.Version, and is useful for accessing the field via an interface.
func (v *ModVersionsWithDependenciesModVersionsVersion) GetVersion() string { return v.Version }
// GetLink returns ModVersionsWithDependenciesModVersionsVersion.Link, and is useful for accessing the field via an interface.
func (v *ModVersionsWithDependenciesModVersionsVersion) GetLink() string { return v.Link }
// GetHash returns ModVersionsWithDependenciesModVersionsVersion.Hash, and is useful for accessing the field via an interface.
func (v *ModVersionsWithDependenciesModVersionsVersion) GetHash() string { return v.Hash }
// GetDependencies returns ModVersionsWithDependenciesModVersionsVersion.Dependencies, and is useful for accessing the field via an interface.
func (v *ModVersionsWithDependenciesModVersionsVersion) GetDependencies() []ModVersionsWithDependenciesModVersionsVersionDependenciesVersionDependency {
return v.Dependencies
}
// GetTargets returns ModVersionsWithDependenciesModVersionsVersion.Targets, and is useful for accessing the field via an interface.
func (v *ModVersionsWithDependenciesModVersionsVersion) GetTargets() []ModVersionsWithDependenciesModVersionsVersionTargetsVersionTarget {
return v.Targets
}
// ModVersionsWithDependenciesModVersionsVersionDependenciesVersionDependency includes the requested fields of the GraphQL type VersionDependency.
type ModVersionsWithDependenciesModVersionsVersionDependenciesVersionDependency struct {
Mod_id string `json:"mod_id"`
Condition string `json:"condition"`
Optional bool `json:"optional"`
}
// GetMod_id returns ModVersionsWithDependenciesModVersionsVersionDependenciesVersionDependency.Mod_id, and is useful for accessing the field via an interface.
func (v *ModVersionsWithDependenciesModVersionsVersionDependenciesVersionDependency) GetMod_id() string {
return v.Mod_id
}
// GetCondition returns ModVersionsWithDependenciesModVersionsVersionDependenciesVersionDependency.Condition, and is useful for accessing the field via an interface.
func (v *ModVersionsWithDependenciesModVersionsVersionDependenciesVersionDependency) GetCondition() string {
return v.Condition
}
// GetOptional returns ModVersionsWithDependenciesModVersionsVersionDependenciesVersionDependency.Optional, and is useful for accessing the field via an interface.
func (v *ModVersionsWithDependenciesModVersionsVersionDependenciesVersionDependency) GetOptional() bool {
return v.Optional
}
// ModVersionsWithDependenciesModVersionsVersionTargetsVersionTarget includes the requested fields of the GraphQL type VersionTarget.
type ModVersionsWithDependenciesModVersionsVersionTargetsVersionTarget struct {
TargetName TargetName `json:"targetName"`
Link string `json:"link"`
Hash string `json:"hash"`
}
// GetTargetName returns ModVersionsWithDependenciesModVersionsVersionTargetsVersionTarget.TargetName, and is useful for accessing the field via an interface.
func (v *ModVersionsWithDependenciesModVersionsVersionTargetsVersionTarget) GetTargetName() TargetName {
return v.TargetName
}
// GetLink returns ModVersionsWithDependenciesModVersionsVersionTargetsVersionTarget.Link, and is useful for accessing the field via an interface.
func (v *ModVersionsWithDependenciesModVersionsVersionTargetsVersionTarget) GetLink() string {
return v.Link
}
// GetHash returns ModVersionsWithDependenciesModVersionsVersionTargetsVersionTarget.Hash, and is useful for accessing the field via an interface.
func (v *ModVersionsWithDependenciesModVersionsVersionTargetsVersionTarget) GetHash() string {
return v.Hash
}
// ModVersionsWithDependenciesResponse is returned by ModVersionsWithDependencies on success.
type ModVersionsWithDependenciesResponse struct {
Mod ModVersionsWithDependenciesMod `json:"mod"`
}
// GetMod returns ModVersionsWithDependenciesResponse.Mod, and is useful for accessing the field via an interface.
func (v *ModVersionsWithDependenciesResponse) GetMod() ModVersionsWithDependenciesMod { return v.Mod }
// ModsModsGetMods includes the requested fields of the GraphQL type GetMods.
type ModsModsGetMods struct {
Count int `json:"count"`
Mods []ModsModsGetModsModsMod `json:"mods"`
}
// GetCount returns ModsModsGetMods.Count, and is useful for accessing the field via an interface.
func (v *ModsModsGetMods) GetCount() int { return v.Count }
// GetMods returns ModsModsGetMods.Mods, and is useful for accessing the field via an interface.
func (v *ModsModsGetMods) GetMods() []ModsModsGetModsModsMod { return v.Mods }
// ModsModsGetModsModsMod includes the requested fields of the GraphQL type Mod.
type ModsModsGetModsModsMod struct {
Id string `json:"id"`
Name string `json:"name"`
Mod_reference string `json:"mod_reference"`
Last_version_date time.Time `json:"-"`
Created_at time.Time `json:"-"`
Views int `json:"views"`
Downloads int `json:"downloads"`
Popularity int `json:"popularity"`
Hotness int `json:"hotness"`
}
// GetId returns ModsModsGetModsModsMod.Id, and is useful for accessing the field via an interface.
func (v *ModsModsGetModsModsMod) GetId() string { return v.Id }
// GetName returns ModsModsGetModsModsMod.Name, and is useful for accessing the field via an interface.
func (v *ModsModsGetModsModsMod) GetName() string { return v.Name }
// GetMod_reference returns ModsModsGetModsModsMod.Mod_reference, and is useful for accessing the field via an interface.
func (v *ModsModsGetModsModsMod) GetMod_reference() string { return v.Mod_reference }
// GetLast_version_date returns ModsModsGetModsModsMod.Last_version_date, and is useful for accessing the field via an interface.
func (v *ModsModsGetModsModsMod) GetLast_version_date() time.Time { return v.Last_version_date }
// GetCreated_at returns ModsModsGetModsModsMod.Created_at, and is useful for accessing the field via an interface.
func (v *ModsModsGetModsModsMod) GetCreated_at() time.Time { return v.Created_at }
// GetViews returns ModsModsGetModsModsMod.Views, and is useful for accessing the field via an interface.
func (v *ModsModsGetModsModsMod) GetViews() int { return v.Views }
// GetDownloads returns ModsModsGetModsModsMod.Downloads, and is useful for accessing the field via an interface.
func (v *ModsModsGetModsModsMod) GetDownloads() int { return v.Downloads }
// GetPopularity returns ModsModsGetModsModsMod.Popularity, and is useful for accessing the field via an interface.
func (v *ModsModsGetModsModsMod) GetPopularity() int { return v.Popularity }
// GetHotness returns ModsModsGetModsModsMod.Hotness, and is useful for accessing the field via an interface.
func (v *ModsModsGetModsModsMod) GetHotness() int { return v.Hotness }
func (v *ModsModsGetModsModsMod) UnmarshalJSON(b []byte) error {
if string(b) == "null" {
return nil
}
var firstPass struct {
*ModsModsGetModsModsMod
Last_version_date json.RawMessage `json:"last_version_date"`
Created_at json.RawMessage `json:"created_at"`
graphql.NoUnmarshalJSON
}
firstPass.ModsModsGetModsModsMod = v
err := json.Unmarshal(b, &firstPass)
if err != nil {
return err
}
{
dst := &v.Last_version_date
src := firstPass.Last_version_date
if len(src) != 0 && string(src) != "null" {
err = utils.UnmarshalDateTime(
src, dst)
if err != nil {
return fmt.Errorf(
"unable to unmarshal ModsModsGetModsModsMod.Last_version_date: %w", err)
}
}
}
{
dst := &v.Created_at
src := firstPass.Created_at
if len(src) != 0 && string(src) != "null" {
err = utils.UnmarshalDateTime(
src, dst)
if err != nil {
return fmt.Errorf(
"unable to unmarshal ModsModsGetModsModsMod.Created_at: %w", err)
}
}
}
return nil
}
type __premarshalModsModsGetModsModsMod struct {
Id string `json:"id"`
Name string `json:"name"`
Mod_reference string `json:"mod_reference"`
Last_version_date json.RawMessage `json:"last_version_date"`
Created_at json.RawMessage `json:"created_at"`
Views int `json:"views"`
Downloads int `json:"downloads"`
Popularity int `json:"popularity"`
Hotness int `json:"hotness"`
}
func (v *ModsModsGetModsModsMod) MarshalJSON() ([]byte, error) {
premarshaled, err := v.__premarshalJSON()
if err != nil {
return nil, err
}
return json.Marshal(premarshaled)
}
func (v *ModsModsGetModsModsMod) __premarshalJSON() (*__premarshalModsModsGetModsModsMod, error) {
var retval __premarshalModsModsGetModsModsMod
retval.Id = v.Id
retval.Name = v.Name
retval.Mod_reference = v.Mod_reference
{
dst := &retval.Last_version_date
src := v.Last_version_date
var err error
*dst, err = json.Marshal(
&src)
if err != nil {
return nil, fmt.Errorf(
"unable to marshal ModsModsGetModsModsMod.Last_version_date: %w", err)
}
}
{
dst := &retval.Created_at
src := v.Created_at
var err error
*dst, err = json.Marshal(
&src)
if err != nil {
return nil, fmt.Errorf(
"unable to marshal ModsModsGetModsModsMod.Created_at: %w", err)
}
}
retval.Views = v.Views
retval.Downloads = v.Downloads
retval.Popularity = v.Popularity
retval.Hotness = v.Hotness
return &retval, nil
}
// ModsResponse is returned by Mods on success.
type ModsResponse struct {
Mods ModsModsGetMods `json:"mods"`
}
// GetMods returns ModsResponse.Mods, and is useful for accessing the field via an interface.
func (v *ModsResponse) GetMods() ModsModsGetMods { return v.Mods }
type NewVersion struct {
Changelog string `json:"changelog"`
Stability VersionStabilities `json:"stability"`
}
// GetChangelog returns NewVersion.Changelog, and is useful for accessing the field via an interface.
func (v *NewVersion) GetChangelog() string { return v.Changelog }
// GetStability returns NewVersion.Stability, and is useful for accessing the field via an interface.
func (v *NewVersion) GetStability() VersionStabilities { return v.Stability }
type Order string
const (
OrderAsc Order = "asc"
OrderDesc Order = "desc"
)
// SMLVersionsResponse is returned by SMLVersions on success.
type SMLVersionsResponse struct {
SmlVersions SMLVersionsSmlVersionsGetSMLVersions `json:"smlVersions"`
}
// GetSmlVersions returns SMLVersionsResponse.SmlVersions, and is useful for accessing the field via an interface.
func (v *SMLVersionsResponse) GetSmlVersions() SMLVersionsSmlVersionsGetSMLVersions {
return v.SmlVersions
}
// SMLVersionsSmlVersionsGetSMLVersions includes the requested fields of the GraphQL type GetSMLVersions.
type SMLVersionsSmlVersionsGetSMLVersions struct {
Count int `json:"count"`
Sml_versions []SMLVersionsSmlVersionsGetSMLVersionsSml_versionsSMLVersion `json:"sml_versions"`
}
// GetCount returns SMLVersionsSmlVersionsGetSMLVersions.Count, and is useful for accessing the field via an interface.
func (v *SMLVersionsSmlVersionsGetSMLVersions) GetCount() int { return v.Count }
// GetSml_versions returns SMLVersionsSmlVersionsGetSMLVersions.Sml_versions, and is useful for accessing the field via an interface.
func (v *SMLVersionsSmlVersionsGetSMLVersions) GetSml_versions() []SMLVersionsSmlVersionsGetSMLVersionsSml_versionsSMLVersion {
return v.Sml_versions
}
// SMLVersionsSmlVersionsGetSMLVersionsSml_versionsSMLVersion includes the requested fields of the GraphQL type SMLVersion.
type SMLVersionsSmlVersionsGetSMLVersionsSml_versionsSMLVersion struct {
Id string `json:"id"`
Version string `json:"version"`
Satisfactory_version int `json:"satisfactory_version"`
Targets []SMLVersionsSmlVersionsGetSMLVersionsSml_versionsSMLVersionTargetsSMLVersionTarget `json:"targets"`
}
// GetId returns SMLVersionsSmlVersionsGetSMLVersionsSml_versionsSMLVersion.Id, and is useful for accessing the field via an interface.
func (v *SMLVersionsSmlVersionsGetSMLVersionsSml_versionsSMLVersion) GetId() string { return v.Id }
// GetVersion returns SMLVersionsSmlVersionsGetSMLVersionsSml_versionsSMLVersion.Version, and is useful for accessing the field via an interface.
func (v *SMLVersionsSmlVersionsGetSMLVersionsSml_versionsSMLVersion) GetVersion() string {
return v.Version
}
// GetSatisfactory_version returns SMLVersionsSmlVersionsGetSMLVersionsSml_versionsSMLVersion.Satisfactory_version, and is useful for accessing the field via an interface.
func (v *SMLVersionsSmlVersionsGetSMLVersionsSml_versionsSMLVersion) GetSatisfactory_version() int {
return v.Satisfactory_version
}
// GetTargets returns SMLVersionsSmlVersionsGetSMLVersionsSml_versionsSMLVersion.Targets, and is useful for accessing the field via an interface.
func (v *SMLVersionsSmlVersionsGetSMLVersionsSml_versionsSMLVersion) GetTargets() []SMLVersionsSmlVersionsGetSMLVersionsSml_versionsSMLVersionTargetsSMLVersionTarget {
return v.Targets
}
// SMLVersionsSmlVersionsGetSMLVersionsSml_versionsSMLVersionTargetsSMLVersionTarget includes the requested fields of the GraphQL type SMLVersionTarget.
type SMLVersionsSmlVersionsGetSMLVersionsSml_versionsSMLVersionTargetsSMLVersionTarget struct {
TargetName TargetName `json:"targetName"`
Link string `json:"link"`
}
// GetTargetName returns SMLVersionsSmlVersionsGetSMLVersionsSml_versionsSMLVersionTargetsSMLVersionTarget.TargetName, and is useful for accessing the field via an interface.
func (v *SMLVersionsSmlVersionsGetSMLVersionsSml_versionsSMLVersionTargetsSMLVersionTarget) GetTargetName() TargetName {
return v.TargetName
}
// GetLink returns SMLVersionsSmlVersionsGetSMLVersionsSml_versionsSMLVersionTargetsSMLVersionTarget.Link, and is useful for accessing the field via an interface.
func (v *SMLVersionsSmlVersionsGetSMLVersionsSml_versionsSMLVersionTargetsSMLVersionTarget) GetLink() string {
return v.Link
}
type TargetName string
const (
TargetNameWindows TargetName = "Windows"
TargetNameWindowsserver TargetName = "WindowsServer"
TargetNameLinuxserver TargetName = "LinuxServer"
)
type VersionFields string
const (
VersionFieldsCreatedAt VersionFields = "created_at"
VersionFieldsUpdatedAt VersionFields = "updated_at"
VersionFieldsDownloads VersionFields = "downloads"
)
type VersionFilter struct {
Limit int `json:"limit,omitempty"`
Offset int `json:"offset,omitempty"`
Order_by VersionFields `json:"order_by,omitempty"`
Order Order `json:"order,omitempty"`
Search string `json:"search,omitempty"`
Ids []string `json:"ids,omitempty"`
}
// GetLimit returns VersionFilter.Limit, and is useful for accessing the field via an interface.
func (v *VersionFilter) GetLimit() int { return v.Limit }
// GetOffset returns VersionFilter.Offset, and is useful for accessing the field via an interface.
func (v *VersionFilter) GetOffset() int { return v.Offset }
// GetOrder_by returns VersionFilter.Order_by, and is useful for accessing the field via an interface.
func (v *VersionFilter) GetOrder_by() VersionFields { return v.Order_by }
// GetOrder returns VersionFilter.Order, and is useful for accessing the field via an interface.
func (v *VersionFilter) GetOrder() Order { return v.Order }
// GetSearch returns VersionFilter.Search, and is useful for accessing the field via an interface.
func (v *VersionFilter) GetSearch() string { return v.Search }
// GetIds returns VersionFilter.Ids, and is useful for accessing the field via an interface.
func (v *VersionFilter) GetIds() []string { return v.Ids }
// VersionMod includes the requested fields of the GraphQL type Mod.
type VersionMod struct {
Id string `json:"id"`
Version VersionModVersion `json:"version"`
}
// GetId returns VersionMod.Id, and is useful for accessing the field via an interface.
func (v *VersionMod) GetId() string { return v.Id }
// GetVersion returns VersionMod.Version, and is useful for accessing the field via an interface.
func (v *VersionMod) GetVersion() VersionModVersion { return v.Version }
// VersionModVersion includes the requested fields of the GraphQL type Version.
type VersionModVersion struct {
Id string `json:"id"`
Version string `json:"version"`
Link string `json:"link"`
Hash string `json:"hash"`
}
// GetId returns VersionModVersion.Id, and is useful for accessing the field via an interface.
func (v *VersionModVersion) GetId() string { return v.Id }
// GetVersion returns VersionModVersion.Version, and is useful for accessing the field via an interface.
func (v *VersionModVersion) GetVersion() string { return v.Version }
// GetLink returns VersionModVersion.Link, and is useful for accessing the field via an interface.
func (v *VersionModVersion) GetLink() string { return v.Link }
// GetHash returns VersionModVersion.Hash, and is useful for accessing the field via an interface.
func (v *VersionModVersion) GetHash() string { return v.Hash }
// VersionResponse is returned by Version on success.
type VersionResponse struct {
Mod VersionMod `json:"mod"`
}
// GetMod returns VersionResponse.Mod, and is useful for accessing the field via an interface.
func (v *VersionResponse) GetMod() VersionMod { return v.Mod }
type VersionStabilities string
const (
VersionStabilitiesAlpha VersionStabilities = "alpha"
VersionStabilitiesBeta VersionStabilities = "beta"
VersionStabilitiesRelease VersionStabilities = "release"
)
// __CheckVersionUploadStateInput is used internally by genqlient
type __CheckVersionUploadStateInput struct {
ModId string `json:"modId"`
VersionId string `json:"versionId"`
}
// GetModId returns __CheckVersionUploadStateInput.ModId, and is useful for accessing the field via an interface.
func (v *__CheckVersionUploadStateInput) GetModId() string { return v.ModId }
// GetVersionId returns __CheckVersionUploadStateInput.VersionId, and is useful for accessing the field via an interface.
func (v *__CheckVersionUploadStateInput) GetVersionId() string { return v.VersionId }
// __CreateVersionInput is used internally by genqlient
type __CreateVersionInput struct {
ModId string `json:"modId"`
}
// GetModId returns __CreateVersionInput.ModId, and is useful for accessing the field via an interface.
func (v *__CreateVersionInput) GetModId() string { return v.ModId }
// __FinalizeCreateVersionInput is used internally by genqlient
type __FinalizeCreateVersionInput struct {
ModId string `json:"modId"`
VersionId string `json:"versionId"`
Version NewVersion `json:"version"`
}
// GetModId returns __FinalizeCreateVersionInput.ModId, and is useful for accessing the field via an interface.
func (v *__FinalizeCreateVersionInput) GetModId() string { return v.ModId }
// GetVersionId returns __FinalizeCreateVersionInput.VersionId, and is useful for accessing the field via an interface.
func (v *__FinalizeCreateVersionInput) GetVersionId() string { return v.VersionId }
// GetVersion returns __FinalizeCreateVersionInput.Version, and is useful for accessing the field via an interface.
func (v *__FinalizeCreateVersionInput) GetVersion() NewVersion { return v.Version }
// __GetModInput is used internally by genqlient
type __GetModInput struct {
ModId string `json:"modId"`
}
// GetModId returns __GetModInput.ModId, and is useful for accessing the field via an interface.
func (v *__GetModInput) GetModId() string { return v.ModId }
// __GetModNameInput is used internally by genqlient
type __GetModNameInput struct {
ModId string `json:"modId"`
}
// GetModId returns __GetModNameInput.ModId, and is useful for accessing the field via an interface.
func (v *__GetModNameInput) GetModId() string { return v.ModId }
// __ModVersionsInput is used internally by genqlient
type __ModVersionsInput struct {
ModId string `json:"modId,omitempty"`
Filter VersionFilter `json:"filter,omitempty"`
}
// GetModId returns __ModVersionsInput.ModId, and is useful for accessing the field via an interface.
func (v *__ModVersionsInput) GetModId() string { return v.ModId }
// GetFilter returns __ModVersionsInput.Filter, and is useful for accessing the field via an interface.
func (v *__ModVersionsInput) GetFilter() VersionFilter { return v.Filter }
// __ModVersionsWithDependenciesInput is used internally by genqlient
type __ModVersionsWithDependenciesInput struct {
ModId string `json:"modId,omitempty"`
}
// GetModId returns __ModVersionsWithDependenciesInput.ModId, and is useful for accessing the field via an interface.
func (v *__ModVersionsWithDependenciesInput) GetModId() string { return v.ModId }
// __ModsInput is used internally by genqlient
type __ModsInput struct {
Filter ModFilter `json:"filter,omitempty"`
}
// GetFilter returns __ModsInput.Filter, and is useful for accessing the field via an interface.
func (v *__ModsInput) GetFilter() ModFilter { return v.Filter }
// __VersionInput is used internally by genqlient
type __VersionInput struct {
ModId string `json:"modId,omitempty"`
Version string `json:"version,omitempty"`
}
// GetModId returns __VersionInput.ModId, and is useful for accessing the field via an interface.
func (v *__VersionInput) GetModId() string { return v.ModId }
// GetVersion returns __VersionInput.Version, and is useful for accessing the field via an interface.
func (v *__VersionInput) GetVersion() string { return v.Version }
// The query or mutation executed by CheckVersionUploadState.
const CheckVersionUploadState_Operation = `
query CheckVersionUploadState ($modId: ModID!, $versionId: VersionID!) {
state: checkVersionUploadState(modId: $modId, versionId: $versionId) {
auto_approved
version {
id
}
}
}
`
func CheckVersionUploadState(
ctx context.Context,
client graphql.Client,
modId string,
versionId string,
) (*CheckVersionUploadStateResponse, error) {
req := &graphql.Request{
OpName: "CheckVersionUploadState",
Query: CheckVersionUploadState_Operation,
Variables: &__CheckVersionUploadStateInput{
ModId: modId,
VersionId: versionId,
},
}
var err error
var data CheckVersionUploadStateResponse
resp := &graphql.Response{Data: &data}
err = client.MakeRequest(
ctx,
req,
resp,
)
return &data, err
}
// The query or mutation executed by CreateVersion.
const CreateVersion_Operation = `
mutation CreateVersion ($modId: ModID!) {
versionID: createVersion(modId: $modId)
}
`
func CreateVersion(
ctx context.Context,
client graphql.Client,
modId string,
) (*CreateVersionResponse, error) {
req := &graphql.Request{
OpName: "CreateVersion",
Query: CreateVersion_Operation,
Variables: &__CreateVersionInput{
ModId: modId,
},
}
var err error
var data CreateVersionResponse
resp := &graphql.Response{Data: &data}
err = client.MakeRequest(
ctx,
req,
resp,
)
return &data, err
}
// The query or mutation executed by FinalizeCreateVersion.
const FinalizeCreateVersion_Operation = `
mutation FinalizeCreateVersion ($modId: ModID!, $versionId: VersionID!, $version: NewVersion!) {
success: finalizeCreateVersion(modId: $modId, versionId: $versionId, version: $version)
}
`
func FinalizeCreateVersion(
ctx context.Context,
client graphql.Client,
modId string,
versionId string,
version NewVersion,
) (*FinalizeCreateVersionResponse, error) {
req := &graphql.Request{
OpName: "FinalizeCreateVersion",
Query: FinalizeCreateVersion_Operation,
Variables: &__FinalizeCreateVersionInput{
ModId: modId,
VersionId: versionId,
Version: version,
},
}
var err error
var data FinalizeCreateVersionResponse
resp := &graphql.Response{Data: &data}
err = client.MakeRequest(
ctx,
req,
resp,
)
return &data, err
}
// The query or mutation executed by GetMod.
const GetMod_Operation = `
query GetMod ($modId: String!) {
mod: getModByIdOrReference(modIdOrReference: $modId) {
id
mod_reference
name
views
downloads
authors {
role
user {
username
}
}
compatibility {
EA {
note
state
}
EXP {
note
state
}
}
full_description
source_url
created_at
}
}
`
func GetMod(
ctx context.Context,
client graphql.Client,
modId string,
) (*GetModResponse, error) {
req := &graphql.Request{
OpName: "GetMod",
Query: GetMod_Operation,
Variables: &__GetModInput{
ModId: modId,
},
}
var err error
var data GetModResponse
resp := &graphql.Response{Data: &data}
err = client.MakeRequest(
ctx,
req,
resp,
)
return &data, err
}
// The query or mutation executed by GetModName.
const GetModName_Operation = `
query GetModName ($modId: String!) {
mod: getModByIdOrReference(modIdOrReference: $modId) {
id
mod_reference
name
}
}
`
func GetModName(
ctx context.Context,
client graphql.Client,
modId string,
) (*GetModNameResponse, error) {
req := &graphql.Request{
OpName: "GetModName",
Query: GetModName_Operation,
Variables: &__GetModNameInput{
ModId: modId,
},
}
var err error
var data GetModNameResponse
resp := &graphql.Response{Data: &data}
err = client.MakeRequest(
ctx,
req,
resp,
)
return &data, err
}
// The query or mutation executed by ModVersions.
const ModVersions_Operation = `
query ModVersions ($modId: String!, $filter: VersionFilter) {
mod: getModByIdOrReference(modIdOrReference: $modId) {
id
versions(filter: $filter) {
id
version
}
}
}
`
func ModVersions(
ctx context.Context,
client graphql.Client,
modId string,
filter VersionFilter,
) (*ModVersionsResponse, error) {
req := &graphql.Request{
OpName: "ModVersions",
Query: ModVersions_Operation,
Variables: &__ModVersionsInput{
ModId: modId,
Filter: filter,
},
}
var err error
var data ModVersionsResponse
resp := &graphql.Response{Data: &data}
err = client.MakeRequest(
ctx,
req,
resp,
)
return &data, err
}
// The query or mutation executed by ModVersionsWithDependencies.
const ModVersionsWithDependencies_Operation = `
query ModVersionsWithDependencies ($modId: String!) {
mod: getModByIdOrReference(modIdOrReference: $modId) {
id
versions(filter: {limit:100}) {
id
version
link
hash
dependencies {
mod_id
condition
optional
}
targets {
targetName
link
hash
}
}
}
}
`
func ModVersionsWithDependencies(
ctx context.Context,
client graphql.Client,
modId string,
) (*ModVersionsWithDependenciesResponse, error) {
req := &graphql.Request{
OpName: "ModVersionsWithDependencies",
Query: ModVersionsWithDependencies_Operation,
Variables: &__ModVersionsWithDependenciesInput{
ModId: modId,
},
}
var err error
var data ModVersionsWithDependenciesResponse
resp := &graphql.Response{Data: &data}
err = client.MakeRequest(
ctx,
req,
resp,
)
return &data, err
}
// The query or mutation executed by Mods.
const Mods_Operation = `
query Mods ($filter: ModFilter) {
mods: getMods(filter: $filter) {
count
mods {
id
name
mod_reference
last_version_date
created_at
views
downloads
popularity
hotness
}
}
}
`
func Mods(
ctx context.Context,
client graphql.Client,
filter ModFilter,
) (*ModsResponse, error) {
req := &graphql.Request{
OpName: "Mods",
Query: Mods_Operation,
Variables: &__ModsInput{
Filter: filter,
},
}
var err error
var data ModsResponse
resp := &graphql.Response{Data: &data}
err = client.MakeRequest(
ctx,
req,
resp,
)
return &data, err
}
// The query or mutation executed by SMLVersions.
const SMLVersions_Operation = `
query SMLVersions {
smlVersions: getSMLVersions(filter: {limit:100}) {
count
sml_versions {
id
version
satisfactory_version
targets {
targetName
link
}
}
}
}
`
func SMLVersions(
ctx context.Context,
client graphql.Client,
) (*SMLVersionsResponse, error) {
req := &graphql.Request{
OpName: "SMLVersions",
Query: SMLVersions_Operation,
}
var err error
var data SMLVersionsResponse
resp := &graphql.Response{Data: &data}
err = client.MakeRequest(
ctx,
req,
resp,
)
return &data, err
}
// The query or mutation executed by Version.
const Version_Operation = `
query Version ($modId: String!, $version: String!) {
mod: getModByIdOrReference(modIdOrReference: $modId) {
id
version(version: $version) {
id
version
link
hash
}
}
}
`
func Version(
ctx context.Context,
client graphql.Client,
modId string,
version string,
) (*VersionResponse, error) {
req := &graphql.Request{
OpName: "Version",
Query: Version_Operation,
Variables: &__VersionInput{
ModId: modId,
Version: version,
},
}
var err error
var data VersionResponse
resp := &graphql.Response{Data: &data}
err = client.MakeRequest(
ctx,
req,
resp,
)
return &data, err
}