From fc563a3d2fa56487ab0ab4257a0f9cfd2281179e Mon Sep 17 00:00:00 2001 From: David Barroso Date: Mon, 9 Sep 2024 15:49:35 +0200 Subject: [PATCH] hotfix: fix generated models --- nhostclient/graphql/models_gen.go | 89 +++++++++++++++++++++++++++++++ 1 file changed, 89 insertions(+) diff --git a/nhostclient/graphql/models_gen.go b/nhostclient/graphql/models_gen.go index a689f728..2664feb6 100644 --- a/nhostclient/graphql/models_gen.go +++ b/nhostclient/graphql/models_gen.go @@ -9,6 +9,11 @@ import ( "time" ) +type BackupPresignedURL struct { + ExpiresAt string `json:"expires_at"` + URL string `json:"url"` +} + // Boolean expression to compare columns of type "Boolean". All fields are combined with logical 'AND'. type BooleanComparisonExp struct { Eq *bool `json:"_eq,omitempty"` @@ -1117,6 +1122,11 @@ type ConfigSystemConfigPostgresDisk struct { Tput *uint32 `json:"tput,omitempty"` } +type ContainerError struct { + LastError *LastError `json:"lastError"` + Name string `json:"name"` +} + // Boolean expression to compare columns of type "Int". All fields are combined with logical 'AND'. type IntComparisonExp struct { Eq *int64 `json:"_eq,omitempty"` @@ -1141,6 +1151,38 @@ type InvoiceSummary struct { Items []*InvoiceItem `json:"items"` } +type LastError struct { + ExitCode int64 `json:"exitCode"` + Message string `json:"message"` + Reason string `json:"reason"` +} + +type Log struct { + Log string `json:"log"` + Service string `json:"service"` + Timestamp string `json:"timestamp"` +} + +type Metrics struct { + Value string `json:"value"` +} + +type ProjectStatusResponse struct { + Services []*ServiceStatus `json:"services"` +} + +type ReplicaStatus struct { + Date string `json:"date"` + Errors []*ContainerError `json:"errors"` + Ready bool `json:"ready"` +} + +type ServiceStatus struct { + Name string `json:"name"` + Replicas []*ReplicaStatus `json:"replicas"` + State ServiceState `json:"state"` +} + // Boolean expression to compare columns of type "String". All fields are combined with logical 'AND'. type StringComparisonExp struct { Eq *string `json:"_eq,omitempty"` @@ -4430,6 +4472,53 @@ type WorkspacesUpdates struct { Where *WorkspacesBoolExp `json:"where"` } +type ServiceState string + +const ( + ServiceStateError ServiceState = "Error" + ServiceStateNone ServiceState = "None" + ServiceStateRunning ServiceState = "Running" + ServiceStateUpdateError ServiceState = "UpdateError" + ServiceStateUpdating ServiceState = "Updating" +) + +var AllServiceState = []ServiceState{ + ServiceStateError, + ServiceStateNone, + ServiceStateRunning, + ServiceStateUpdateError, + ServiceStateUpdating, +} + +func (e ServiceState) IsValid() bool { + switch e { + case ServiceStateError, ServiceStateNone, ServiceStateRunning, ServiceStateUpdateError, ServiceStateUpdating: + return true + } + return false +} + +func (e ServiceState) String() string { + return string(e) +} + +func (e *ServiceState) UnmarshalGQL(v interface{}) error { + str, ok := v.(string) + if !ok { + return fmt.Errorf("enums must be strings") + } + + *e = ServiceState(str) + if !e.IsValid() { + return fmt.Errorf("%s is not a valid ServiceState", str) + } + return nil +} + +func (e ServiceState) MarshalGQL(w io.Writer) { + fmt.Fprint(w, strconv.Quote(e.String())) +} + // select columns of table "announcements" type AnnouncementsSelectColumn string