From 4f35021138b17f3f70e535e58660a61d5be1a2d5 Mon Sep 17 00:00:00 2001 From: Kim Date: Thu, 13 Nov 2025 10:58:07 +0200 Subject: [PATCH 1/2] fix: update promotion orch golang types to support new promotions list query on cli v2 --- .../promotion-orchestrator/models_gen.go | 1813 ++++++++++++++++- 1 file changed, 1718 insertions(+), 95 deletions(-) diff --git a/pkg/model/promotion-orchestrator/models_gen.go b/pkg/model/promotion-orchestrator/models_gen.go index e1861f5..8ef3ee1 100644 --- a/pkg/model/promotion-orchestrator/models_gen.go +++ b/pkg/model/promotion-orchestrator/models_gen.go @@ -3,6 +3,7 @@ package model import ( + "bytes" "fmt" "io" "strconv" @@ -142,6 +143,10 @@ type ProjectBasedEntity interface { IsProjectBasedEntity() } +type PromotionOrReleaseNode interface { + IsPromotionOrReleaseNode() +} + // PromotionTemplateFields type PromotionTemplateFields interface { IsPromotionTemplateFields() @@ -341,8 +346,6 @@ type AccountFeatures struct { Abac *bool `json:"abac,omitempty"` // New ABAC permissions page AbacV2 *bool `json:"abacV2,omitempty"` - // Shows user git personal token settings menu in project one - UnifiedUserGitTokens *bool `json:"unifiedUserGitTokens,omitempty"` // Adds ability to rollback rollout from rollout drawer in app timeline GitOpsRolloutRollback *bool `json:"gitOpsRolloutRollback,omitempty"` // Shows Beamer widget for all platforms (What's new) @@ -421,6 +424,8 @@ type AccountFeatures struct { HeaderLiveState *bool `json:"headerLiveState,omitempty"` // Enables promotion orchestration for products including product's releases API and promotion flow API PromotionOrchestration *bool `json:"promotionOrchestration,omitempty"` + // Enables the main releases page, allowing users to view releases from all products + MainReleasesPage *bool `json:"mainReleasesPage,omitempty"` // Enables promotion policies view PromotionPolicies *bool `json:"promotionPolicies,omitempty"` // Enables git commit statuses for product release promotions @@ -501,6 +506,14 @@ type AccountFeatures struct { GitlabSupportInRuntimeWizard *bool `json:"gitlabSupportInRuntimeWizard,omitempty"` // Adds ability to connect Bitbucket as git provider in runtime installation wizard BitbucketSupportInRuntimeWizard *bool `json:"bitbucketSupportInRuntimeWizard,omitempty"` + // Shows warning message that promotions are in early access + PromotionsEarlyAccessWarning *bool `json:"promotionsEarlyAccessWarning,omitempty"` + // Enables new user settings page based on Gitops UI under /2.0 path + NewUserSettingsPage *bool `json:"newUserSettingsPage,omitempty"` + // Hides classic-only related sections from new user settings page + HideClassicRelatedSectionsFromNewUserSettingsPage *bool `json:"hideClassicRelatedSectionsFromNewUserSettingsPage,omitempty"` + // Uses new endpoints for retrieval of product promotions(releases) across all corresponding views. + NewPromotionEndpoints *bool `json:"newPromotionEndpoints,omitempty"` } // Account Gitops Usage @@ -3225,10 +3238,12 @@ type EnvironmentCluster struct { RuntimeName string `json:"runtimeName"` // Cluster name Name string `json:"name"` - // Cluster address - Server string `json:"server"` + // Cluster address - resolved dynamically, null if cluster doesn't exist + Server *string `json:"server,omitempty"` // Cluster namespaces Namespaces []string `json:"namespaces"` + // Indicate if the cluster still exists + Exists bool `json:"exists"` } // Environment Cluster @@ -3238,7 +3253,7 @@ type EnvironmentClusterInput struct { // Cluster name Name string `json:"name"` // Cluster address - Server string `json:"server"` + Server *string `json:"server,omitempty"` // Cluster namespaces Namespaces []string `json:"namespaces"` } @@ -6374,6 +6389,8 @@ type ProductComponentFilterArgs struct { HealthStatuses []HealthStatus `json:"healthStatuses,omitempty"` // If 'true' returns components that have at least 1 pending PR HasPendingPullRequests *bool `json:"hasPendingPullRequests,omitempty"` + // Assignment type + ProductAssignment *AssignmentType `json:"productAssignment,omitempty"` } // Info about the workflow that promoted component @@ -6466,6 +6483,8 @@ type ProductFilterArgs struct { AppNames []*string `json:"appNames,omitempty"` // Environments names Environments []*string `json:"environments,omitempty"` + // Promotion flow names + PromotionFlowNames []*string `json:"promotionFlowNames,omitempty"` // Filter by user favorite Favorite *bool `json:"favorite,omitempty"` } @@ -6496,12 +6515,22 @@ type ProductGroupForEnvs struct { ProductComponents []*ProductComponent `json:"productComponents"` } +// Args to filter Product names +type ProductNamesFilterArgs struct { + // Partial name (case insensitive) + PartialName *string `json:"partialName,omitempty"` + // Promotion flow names + PromotionFlowNames []*string `json:"promotionFlowNames,omitempty"` +} + // Product Promotion Flow Selectors type ProductPromotionFlowSelectors struct { // Entity db id Name string `json:"name"` // Group name GitTriggerSelectors []*ProductGitTriggerSelector `json:"gitTriggerSelectors"` + // Indicates whether the specified promotion flow still exists + Exists bool `json:"exists"` } // Product Release @@ -6540,6 +6569,8 @@ type ProductRelease struct { Hooks *ProductReleaseHooks `json:"hooks,omitempty"` } +func (ProductRelease) IsPromotionOrReleaseNode() {} + // Product Release App Step Status Entry type ProductReleaseAppStepStatusEntry struct { // Application step status @@ -6618,6 +6649,8 @@ type ProductReleaseError struct { // Product release filters args type ProductReleaseFiltersArgs struct { + // Product name + ProductNames []string `json:"productNames,omitempty"` // Promotion Flow ids PromotionFlows []string `json:"promotionFlows,omitempty"` // Product release status @@ -6804,6 +6837,34 @@ type ProjectSlice struct { func (ProjectSlice) IsSlice() {} +// Promotion entity +type Promotion struct { + // Promotion ID + ID string `json:"id"` + // Account ID + AccountID string `json:"accountId"` + // Product name + ProductName string `json:"productName"` + // Promotion flow name + PromotionFlowName *string `json:"promotionFlowName,omitempty"` + // Trigger environment + TriggerEnvironment string `json:"triggerEnvironment"` + // Environments array + Environments []*PromotionEnvironment `json:"environments"` + // Trigger commit information + TriggerCommitInfo *PromotionCommitInfo `json:"triggerCommitInfo"` + // Promotion status + Status ProductReleasePublicStatus `json:"status"` + // Created at timestamp + CreatedAt string `json:"createdAt"` + // Updated at timestamp + UpdatedAt *string `json:"updatedAt,omitempty"` + // Promotion app version + PromotionAppVersion *string `json:"promotionAppVersion,omitempty"` +} + +func (Promotion) IsPromotionOrReleaseNode() {} + // Promotion Code type PromotionCode struct { // Id @@ -6834,6 +6895,32 @@ type PromotionCode struct { TimesRedeemed int `json:"timesRedeemed"` } +// Commit information +type PromotionCommitInfo struct { + // Commit SHA + CommitSha string `json:"commitSha"` + // Commit message + CommitMessage string `json:"commitMessage"` + // Commit author + CommitAuthor string `json:"commitAuthor"` + // Commit date + CommitDate string `json:"commitDate"` +} + +// Environment information +type PromotionEnvironment struct { + // Environment name + Name string `json:"name"` + // Dependencies array + DependsOn []string `json:"dependsOn"` + // Environment status + Status EnvironmentStatus `json:"status"` + // Created at timestamp + CreatedAt string `json:"createdAt"` + // Updated at timestamp + UpdatedAt *string `json:"updatedAt,omitempty"` +} + // PromotionFlow entity type PromotionFlow struct { // Object metadata @@ -6920,6 +7007,21 @@ type PromotionHooksDefinitionInput struct { OnFail *string `json:"onFail,omitempty"` } +type PromotionOrReleaseEdge struct { + // Node contains the actual promotion or release data + Node PromotionOrReleaseNode `json:"node"` + // Cursor + Cursor string `json:"cursor"` +} + +// Promotion Slice +type PromotionOrReleaseSlice struct { + // Promotion edges + Edges []*PromotionOrReleaseEdge `json:"edges"` + // Slice information + PageInfo *SliceInfo `json:"pageInfo"` +} + // PromotionPolicy entity type PromotionPolicy struct { // Object metadata @@ -8040,6 +8142,8 @@ type Runtime struct { RuntimeApplicationName *string `json:"runtimeApplicationName,omitempty"` // Is using an external ArgoCD instance instead of the bundled one IsExternalArgoCd *bool `json:"isExternalArgoCd,omitempty"` + // True if the runtime is installed in single namespace mode + IsNamespacedRuntime *bool `json:"isNamespacedRuntime,omitempty"` } func (Runtime) IsBaseEntity() {} @@ -9711,7 +9815,7 @@ func (e AbacActionNames) String() string { return string(e) } -func (e *AbacActionNames) UnmarshalGQL(v interface{}) error { +func (e *AbacActionNames) UnmarshalGQL(v any) error { str, ok := v.(string) if !ok { return fmt.Errorf("enums must be strings") @@ -9728,6 +9832,20 @@ func (e AbacActionNames) MarshalGQL(w io.Writer) { fmt.Fprint(w, strconv.Quote(e.String())) } +func (e *AbacActionNames) UnmarshalJSON(b []byte) error { + s, err := strconv.Unquote(string(b)) + if err != nil { + return err + } + return e.UnmarshalGQL(s) +} + +func (e AbacActionNames) MarshalJSON() ([]byte, error) { + var buf bytes.Buffer + e.MarshalGQL(&buf) + return buf.Bytes(), nil +} + // AbacAttributeNames type AbacAttributeNames string @@ -9765,7 +9883,7 @@ func (e AbacAttributeNames) String() string { return string(e) } -func (e *AbacAttributeNames) UnmarshalGQL(v interface{}) error { +func (e *AbacAttributeNames) UnmarshalGQL(v any) error { str, ok := v.(string) if !ok { return fmt.Errorf("enums must be strings") @@ -9782,6 +9900,20 @@ func (e AbacAttributeNames) MarshalGQL(w io.Writer) { fmt.Fprint(w, strconv.Quote(e.String())) } +func (e *AbacAttributeNames) UnmarshalJSON(b []byte) error { + s, err := strconv.Unquote(string(b)) + if err != nil { + return err + } + return e.UnmarshalGQL(s) +} + +func (e AbacAttributeNames) MarshalJSON() ([]byte, error) { + var buf bytes.Buffer + e.MarshalGQL(&buf) + return buf.Bytes(), nil +} + // Values from AbacEntityValues enum type AbacEntityValues string @@ -9829,7 +9961,7 @@ func (e AbacEntityValues) String() string { return string(e) } -func (e *AbacEntityValues) UnmarshalGQL(v interface{}) error { +func (e *AbacEntityValues) UnmarshalGQL(v any) error { str, ok := v.(string) if !ok { return fmt.Errorf("enums must be strings") @@ -9846,6 +9978,20 @@ func (e AbacEntityValues) MarshalGQL(w io.Writer) { fmt.Fprint(w, strconv.Quote(e.String())) } +func (e *AbacEntityValues) UnmarshalJSON(b []byte) error { + s, err := strconv.Unquote(string(b)) + if err != nil { + return err + } + return e.UnmarshalGQL(s) +} + +func (e AbacEntityValues) MarshalJSON() ([]byte, error) { + var buf bytes.Buffer + e.MarshalGQL(&buf) + return buf.Bytes(), nil +} + // Access Mode type AccessMode string @@ -9873,7 +10019,7 @@ func (e AccessMode) String() string { return string(e) } -func (e *AccessMode) UnmarshalGQL(v interface{}) error { +func (e *AccessMode) UnmarshalGQL(v any) error { str, ok := v.(string) if !ok { return fmt.Errorf("enums must be strings") @@ -9890,6 +10036,20 @@ func (e AccessMode) MarshalGQL(w io.Writer) { fmt.Fprint(w, strconv.Quote(e.String())) } +func (e *AccessMode) UnmarshalJSON(b []byte) error { + s, err := strconv.Unquote(string(b)) + if err != nil { + return err + } + return e.UnmarshalGQL(s) +} + +func (e AccessMode) MarshalJSON() ([]byte, error) { + var buf bytes.Buffer + e.MarshalGQL(&buf) + return buf.Bytes(), nil +} + // Analysis Metric Provider Types type AnalysisMetricProviderTypes string @@ -9938,7 +10098,7 @@ func (e AnalysisMetricProviderTypes) String() string { return string(e) } -func (e *AnalysisMetricProviderTypes) UnmarshalGQL(v interface{}) error { +func (e *AnalysisMetricProviderTypes) UnmarshalGQL(v any) error { str, ok := v.(string) if !ok { return fmt.Errorf("enums must be strings") @@ -9955,6 +10115,20 @@ func (e AnalysisMetricProviderTypes) MarshalGQL(w io.Writer) { fmt.Fprint(w, strconv.Quote(e.String())) } +func (e *AnalysisMetricProviderTypes) UnmarshalJSON(b []byte) error { + s, err := strconv.Unquote(string(b)) + if err != nil { + return err + } + return e.UnmarshalGQL(s) +} + +func (e AnalysisMetricProviderTypes) MarshalJSON() ([]byte, error) { + var buf bytes.Buffer + e.MarshalGQL(&buf) + return buf.Bytes(), nil +} + // AnalysisPhases type AnalysisPhases string @@ -9994,7 +10168,7 @@ func (e AnalysisPhases) String() string { return string(e) } -func (e *AnalysisPhases) UnmarshalGQL(v interface{}) error { +func (e *AnalysisPhases) UnmarshalGQL(v any) error { str, ok := v.(string) if !ok { return fmt.Errorf("enums must be strings") @@ -10011,6 +10185,20 @@ func (e AnalysisPhases) MarshalGQL(w io.Writer) { fmt.Fprint(w, strconv.Quote(e.String())) } +func (e *AnalysisPhases) UnmarshalJSON(b []byte) error { + s, err := strconv.Unquote(string(b)) + if err != nil { + return err + } + return e.UnmarshalGQL(s) +} + +func (e AnalysisPhases) MarshalJSON() ([]byte, error) { + var buf bytes.Buffer + e.MarshalGQL(&buf) + return buf.Bytes(), nil +} + // SyncOperationPhase type AppOperationType string @@ -10041,7 +10229,7 @@ func (e AppOperationType) String() string { return string(e) } -func (e *AppOperationType) UnmarshalGQL(v interface{}) error { +func (e *AppOperationType) UnmarshalGQL(v any) error { str, ok := v.(string) if !ok { return fmt.Errorf("enums must be strings") @@ -10058,6 +10246,20 @@ func (e AppOperationType) MarshalGQL(w io.Writer) { fmt.Fprint(w, strconv.Quote(e.String())) } +func (e *AppOperationType) UnmarshalJSON(b []byte) error { + s, err := strconv.Unquote(string(b)) + if err != nil { + return err + } + return e.UnmarshalGQL(s) +} + +func (e AppOperationType) MarshalJSON() ([]byte, error) { + var buf bytes.Buffer + e.MarshalGQL(&buf) + return buf.Bytes(), nil +} + // App-Proxy Status type AppProxyStatus string @@ -10088,7 +10290,7 @@ func (e AppProxyStatus) String() string { return string(e) } -func (e *AppProxyStatus) UnmarshalGQL(v interface{}) error { +func (e *AppProxyStatus) UnmarshalGQL(v any) error { str, ok := v.(string) if !ok { return fmt.Errorf("enums must be strings") @@ -10105,6 +10307,20 @@ func (e AppProxyStatus) MarshalGQL(w io.Writer) { fmt.Fprint(w, strconv.Quote(e.String())) } +func (e *AppProxyStatus) UnmarshalJSON(b []byte) error { + s, err := strconv.Unquote(string(b)) + if err != nil { + return err + } + return e.UnmarshalGQL(s) +} + +func (e AppProxyStatus) MarshalJSON() ([]byte, error) { + var buf bytes.Buffer + e.MarshalGQL(&buf) + return buf.Bytes(), nil +} + // App Sync Policies type AppSyncPolicies string @@ -10135,7 +10351,7 @@ func (e AppSyncPolicies) String() string { return string(e) } -func (e *AppSyncPolicies) UnmarshalGQL(v interface{}) error { +func (e *AppSyncPolicies) UnmarshalGQL(v any) error { str, ok := v.(string) if !ok { return fmt.Errorf("enums must be strings") @@ -10152,6 +10368,20 @@ func (e AppSyncPolicies) MarshalGQL(w io.Writer) { fmt.Fprint(w, strconv.Quote(e.String())) } +func (e *AppSyncPolicies) UnmarshalJSON(b []byte) error { + s, err := strconv.Unquote(string(b)) + if err != nil { + return err + } + return e.UnmarshalGQL(s) +} + +func (e AppSyncPolicies) MarshalJSON() ([]byte, error) { + var buf bytes.Buffer + e.MarshalGQL(&buf) + return buf.Bytes(), nil +} + // Application Groups Sorting field type ApplicationGroupsSortingField string @@ -10179,7 +10409,7 @@ func (e ApplicationGroupsSortingField) String() string { return string(e) } -func (e *ApplicationGroupsSortingField) UnmarshalGQL(v interface{}) error { +func (e *ApplicationGroupsSortingField) UnmarshalGQL(v any) error { str, ok := v.(string) if !ok { return fmt.Errorf("enums must be strings") @@ -10196,6 +10426,20 @@ func (e ApplicationGroupsSortingField) MarshalGQL(w io.Writer) { fmt.Fprint(w, strconv.Quote(e.String())) } +func (e *ApplicationGroupsSortingField) UnmarshalJSON(b []byte) error { + s, err := strconv.Unquote(string(b)) + if err != nil { + return err + } + return e.UnmarshalGQL(s) +} + +func (e ApplicationGroupsSortingField) MarshalJSON() ([]byte, error) { + var buf bytes.Buffer + e.MarshalGQL(&buf) + return buf.Bytes(), nil +} + // Application Tree Sorting field type ApplicationTreeSortingField string @@ -10235,7 +10479,7 @@ func (e ApplicationTreeSortingField) String() string { return string(e) } -func (e *ApplicationTreeSortingField) UnmarshalGQL(v interface{}) error { +func (e *ApplicationTreeSortingField) UnmarshalGQL(v any) error { str, ok := v.(string) if !ok { return fmt.Errorf("enums must be strings") @@ -10252,6 +10496,20 @@ func (e ApplicationTreeSortingField) MarshalGQL(w io.Writer) { fmt.Fprint(w, strconv.Quote(e.String())) } +func (e *ApplicationTreeSortingField) UnmarshalJSON(b []byte) error { + s, err := strconv.Unquote(string(b)) + if err != nil { + return err + } + return e.UnmarshalGQL(s) +} + +func (e ApplicationTreeSortingField) MarshalJSON() ([]byte, error) { + var buf bytes.Buffer + e.MarshalGQL(&buf) + return buf.Bytes(), nil +} + // ArgoCD State type ArgoCdState string @@ -10285,7 +10543,7 @@ func (e ArgoCdState) String() string { return string(e) } -func (e *ArgoCdState) UnmarshalGQL(v interface{}) error { +func (e *ArgoCdState) UnmarshalGQL(v any) error { str, ok := v.(string) if !ok { return fmt.Errorf("enums must be strings") @@ -10302,6 +10560,78 @@ func (e ArgoCdState) MarshalGQL(w io.Writer) { fmt.Fprint(w, strconv.Quote(e.String())) } +func (e *ArgoCdState) UnmarshalJSON(b []byte) error { + s, err := strconv.Unquote(string(b)) + if err != nil { + return err + } + return e.UnmarshalGQL(s) +} + +func (e ArgoCdState) MarshalJSON() ([]byte, error) { + var buf bytes.Buffer + e.MarshalGQL(&buf) + return buf.Bytes(), nil +} + +// Assignment type +type AssignmentType string + +const ( + // Linked applications + AssignmentTypeAnnotation AssignmentType = "ANNOTATION" + // Manually attached + AssignmentTypeManually AssignmentType = "MANUALLY" +) + +var AllAssignmentType = []AssignmentType{ + AssignmentTypeAnnotation, + AssignmentTypeManually, +} + +func (e AssignmentType) IsValid() bool { + switch e { + case AssignmentTypeAnnotation, AssignmentTypeManually: + return true + } + return false +} + +func (e AssignmentType) String() string { + return string(e) +} + +func (e *AssignmentType) UnmarshalGQL(v any) error { + str, ok := v.(string) + if !ok { + return fmt.Errorf("enums must be strings") + } + + *e = AssignmentType(str) + if !e.IsValid() { + return fmt.Errorf("%s is not a valid AssignmentType", str) + } + return nil +} + +func (e AssignmentType) MarshalGQL(w io.Writer) { + fmt.Fprint(w, strconv.Quote(e.String())) +} + +func (e *AssignmentType) UnmarshalJSON(b []byte) error { + s, err := strconv.Unquote(string(b)) + if err != nil { + return err + } + return e.UnmarshalGQL(s) +} + +func (e AssignmentType) MarshalJSON() ([]byte, error) { + var buf bytes.Buffer + e.MarshalGQL(&buf) + return buf.Bytes(), nil +} + // ConnectionState contains information about remote resource connection state, currently used for clusters and repositories type ClusterConnectionStatus string @@ -10332,7 +10662,7 @@ func (e ClusterConnectionStatus) String() string { return string(e) } -func (e *ClusterConnectionStatus) UnmarshalGQL(v interface{}) error { +func (e *ClusterConnectionStatus) UnmarshalGQL(v any) error { str, ok := v.(string) if !ok { return fmt.Errorf("enums must be strings") @@ -10349,6 +10679,20 @@ func (e ClusterConnectionStatus) MarshalGQL(w io.Writer) { fmt.Fprint(w, strconv.Quote(e.String())) } +func (e *ClusterConnectionStatus) UnmarshalJSON(b []byte) error { + s, err := strconv.Unquote(string(b)) + if err != nil { + return err + } + return e.UnmarshalGQL(s) +} + +func (e ClusterConnectionStatus) MarshalJSON() ([]byte, error) { + var buf bytes.Buffer + e.MarshalGQL(&buf) + return buf.Bytes(), nil +} + // Commit Status type CommitStatus string @@ -10380,7 +10724,7 @@ func (e CommitStatus) String() string { return string(e) } -func (e *CommitStatus) UnmarshalGQL(v interface{}) error { +func (e *CommitStatus) UnmarshalGQL(v any) error { str, ok := v.(string) if !ok { return fmt.Errorf("enums must be strings") @@ -10397,6 +10741,20 @@ func (e CommitStatus) MarshalGQL(w io.Writer) { fmt.Fprint(w, strconv.Quote(e.String())) } +func (e *CommitStatus) UnmarshalJSON(b []byte) error { + s, err := strconv.Unquote(string(b)) + if err != nil { + return err + } + return e.UnmarshalGQL(s) +} + +func (e CommitStatus) MarshalJSON() ([]byte, error) { + var buf bytes.Buffer + e.MarshalGQL(&buf) + return buf.Bytes(), nil +} + // Coupon Duration type CouponDuration string @@ -10424,7 +10782,7 @@ func (e CouponDuration) String() string { return string(e) } -func (e *CouponDuration) UnmarshalGQL(v interface{}) error { +func (e *CouponDuration) UnmarshalGQL(v any) error { str, ok := v.(string) if !ok { return fmt.Errorf("enums must be strings") @@ -10441,6 +10799,20 @@ func (e CouponDuration) MarshalGQL(w io.Writer) { fmt.Fprint(w, strconv.Quote(e.String())) } +func (e *CouponDuration) UnmarshalJSON(b []byte) error { + s, err := strconv.Unquote(string(b)) + if err != nil { + return err + } + return e.UnmarshalGQL(s) +} + +func (e CouponDuration) MarshalJSON() ([]byte, error) { + var buf bytes.Buffer + e.MarshalGQL(&buf) + return buf.Bytes(), nil +} + // Deployment Statistics Status type DeploymentStatisticsStatus string @@ -10472,7 +10844,7 @@ func (e DeploymentStatisticsStatus) String() string { return string(e) } -func (e *DeploymentStatisticsStatus) UnmarshalGQL(v interface{}) error { +func (e *DeploymentStatisticsStatus) UnmarshalGQL(v any) error { str, ok := v.(string) if !ok { return fmt.Errorf("enums must be strings") @@ -10489,6 +10861,20 @@ func (e DeploymentStatisticsStatus) MarshalGQL(w io.Writer) { fmt.Fprint(w, strconv.Quote(e.String())) } +func (e *DeploymentStatisticsStatus) UnmarshalJSON(b []byte) error { + s, err := strconv.Unquote(string(b)) + if err != nil { + return err + } + return e.UnmarshalGQL(s) +} + +func (e DeploymentStatisticsStatus) MarshalJSON() ([]byte, error) { + var buf bytes.Buffer + e.MarshalGQL(&buf) + return buf.Bytes(), nil +} + // Duration Name type DurationName string @@ -10522,7 +10908,7 @@ func (e DurationName) String() string { return string(e) } -func (e *DurationName) UnmarshalGQL(v interface{}) error { +func (e *DurationName) UnmarshalGQL(v any) error { str, ok := v.(string) if !ok { return fmt.Errorf("enums must be strings") @@ -10539,6 +10925,20 @@ func (e DurationName) MarshalGQL(w io.Writer) { fmt.Fprint(w, strconv.Quote(e.String())) } +func (e *DurationName) UnmarshalJSON(b []byte) error { + s, err := strconv.Unquote(string(b)) + if err != nil { + return err + } + return e.UnmarshalGQL(s) +} + +func (e DurationName) MarshalJSON() ([]byte, error) { + var buf bytes.Buffer + e.MarshalGQL(&buf) + return buf.Bytes(), nil +} + // Kind of environment type EnvironmentKind string @@ -10564,7 +10964,7 @@ func (e EnvironmentKind) String() string { return string(e) } -func (e *EnvironmentKind) UnmarshalGQL(v interface{}) error { +func (e *EnvironmentKind) UnmarshalGQL(v any) error { str, ok := v.(string) if !ok { return fmt.Errorf("enums must be strings") @@ -10581,6 +10981,20 @@ func (e EnvironmentKind) MarshalGQL(w io.Writer) { fmt.Fprint(w, strconv.Quote(e.String())) } +func (e *EnvironmentKind) UnmarshalJSON(b []byte) error { + s, err := strconv.Unquote(string(b)) + if err != nil { + return err + } + return e.UnmarshalGQL(s) +} + +func (e EnvironmentKind) MarshalJSON() ([]byte, error) { + var buf bytes.Buffer + e.MarshalGQL(&buf) + return buf.Bytes(), nil +} + // "Relative position of the moved environment in relation to the target environment" type EnvironmentRelativePos string @@ -10606,7 +11020,7 @@ func (e EnvironmentRelativePos) String() string { return string(e) } -func (e *EnvironmentRelativePos) UnmarshalGQL(v interface{}) error { +func (e *EnvironmentRelativePos) UnmarshalGQL(v any) error { str, ok := v.(string) if !ok { return fmt.Errorf("enums must be strings") @@ -10623,6 +11037,88 @@ func (e EnvironmentRelativePos) MarshalGQL(w io.Writer) { fmt.Fprint(w, strconv.Quote(e.String())) } +func (e *EnvironmentRelativePos) UnmarshalJSON(b []byte) error { + s, err := strconv.Unquote(string(b)) + if err != nil { + return err + } + return e.UnmarshalGQL(s) +} + +func (e EnvironmentRelativePos) MarshalJSON() ([]byte, error) { + var buf bytes.Buffer + e.MarshalGQL(&buf) + return buf.Bytes(), nil +} + +// Environment status enum +type EnvironmentStatus string + +const ( + EnvironmentStatusFailed EnvironmentStatus = "FAILED" + EnvironmentStatusPending EnvironmentStatus = "PENDING" + EnvironmentStatusRunning EnvironmentStatus = "RUNNING" + EnvironmentStatusSkipped EnvironmentStatus = "SKIPPED" + EnvironmentStatusSucceeded EnvironmentStatus = "SUCCEEDED" + EnvironmentStatusSuspended EnvironmentStatus = "SUSPENDED" + EnvironmentStatusTerminated EnvironmentStatus = "TERMINATED" + EnvironmentStatusTerminating EnvironmentStatus = "TERMINATING" +) + +var AllEnvironmentStatus = []EnvironmentStatus{ + EnvironmentStatusFailed, + EnvironmentStatusPending, + EnvironmentStatusRunning, + EnvironmentStatusSkipped, + EnvironmentStatusSucceeded, + EnvironmentStatusSuspended, + EnvironmentStatusTerminated, + EnvironmentStatusTerminating, +} + +func (e EnvironmentStatus) IsValid() bool { + switch e { + case EnvironmentStatusFailed, EnvironmentStatusPending, EnvironmentStatusRunning, EnvironmentStatusSkipped, EnvironmentStatusSucceeded, EnvironmentStatusSuspended, EnvironmentStatusTerminated, EnvironmentStatusTerminating: + return true + } + return false +} + +func (e EnvironmentStatus) String() string { + return string(e) +} + +func (e *EnvironmentStatus) UnmarshalGQL(v any) error { + str, ok := v.(string) + if !ok { + return fmt.Errorf("enums must be strings") + } + + *e = EnvironmentStatus(str) + if !e.IsValid() { + return fmt.Errorf("%s is not a valid EnvironmentStatus", str) + } + return nil +} + +func (e EnvironmentStatus) MarshalGQL(w io.Writer) { + fmt.Fprint(w, strconv.Quote(e.String())) +} + +func (e *EnvironmentStatus) UnmarshalJSON(b []byte) error { + s, err := strconv.Unquote(string(b)) + if err != nil { + return err + } + return e.UnmarshalGQL(s) +} + +func (e EnvironmentStatus) MarshalJSON() ([]byte, error) { + var buf bytes.Buffer + e.MarshalGQL(&buf) + return buf.Bytes(), nil +} + // Error severity levels type ErrorLevels string @@ -10650,7 +11146,7 @@ func (e ErrorLevels) String() string { return string(e) } -func (e *ErrorLevels) UnmarshalGQL(v interface{}) error { +func (e *ErrorLevels) UnmarshalGQL(v any) error { str, ok := v.(string) if !ok { return fmt.Errorf("enums must be strings") @@ -10667,6 +11163,20 @@ func (e ErrorLevels) MarshalGQL(w io.Writer) { fmt.Fprint(w, strconv.Quote(e.String())) } +func (e *ErrorLevels) UnmarshalJSON(b []byte) error { + s, err := strconv.Unquote(string(b)) + if err != nil { + return err + } + return e.UnmarshalGQL(s) +} + +func (e ErrorLevels) MarshalJSON() ([]byte, error) { + var buf bytes.Buffer + e.MarshalGQL(&buf) + return buf.Bytes(), nil +} + // Extended Workflow Phases type ExtendedWorkflowPhases string @@ -10710,7 +11220,7 @@ func (e ExtendedWorkflowPhases) String() string { return string(e) } -func (e *ExtendedWorkflowPhases) UnmarshalGQL(v interface{}) error { +func (e *ExtendedWorkflowPhases) UnmarshalGQL(v any) error { str, ok := v.(string) if !ok { return fmt.Errorf("enums must be strings") @@ -10727,6 +11237,20 @@ func (e ExtendedWorkflowPhases) MarshalGQL(w io.Writer) { fmt.Fprint(w, strconv.Quote(e.String())) } +func (e *ExtendedWorkflowPhases) UnmarshalJSON(b []byte) error { + s, err := strconv.Unquote(string(b)) + if err != nil { + return err + } + return e.UnmarshalGQL(s) +} + +func (e ExtendedWorkflowPhases) MarshalJSON() ([]byte, error) { + var buf bytes.Buffer + e.MarshalGQL(&buf) + return buf.Bytes(), nil +} + // GitAuthMode type GitAuthMode string @@ -10757,7 +11281,7 @@ func (e GitAuthMode) String() string { return string(e) } -func (e *GitAuthMode) UnmarshalGQL(v interface{}) error { +func (e *GitAuthMode) UnmarshalGQL(v any) error { str, ok := v.(string) if !ok { return fmt.Errorf("enums must be strings") @@ -10774,6 +11298,20 @@ func (e GitAuthMode) MarshalGQL(w io.Writer) { fmt.Fprint(w, strconv.Quote(e.String())) } +func (e *GitAuthMode) UnmarshalJSON(b []byte) error { + s, err := strconv.Unquote(string(b)) + if err != nil { + return err + } + return e.UnmarshalGQL(s) +} + +func (e GitAuthMode) MarshalJSON() ([]byte, error) { + var buf bytes.Buffer + e.MarshalGQL(&buf) + return buf.Bytes(), nil +} + // Git providers type GitProviders string @@ -10810,7 +11348,7 @@ func (e GitProviders) String() string { return string(e) } -func (e *GitProviders) UnmarshalGQL(v interface{}) error { +func (e *GitProviders) UnmarshalGQL(v any) error { str, ok := v.(string) if !ok { return fmt.Errorf("enums must be strings") @@ -10827,6 +11365,20 @@ func (e GitProviders) MarshalGQL(w io.Writer) { fmt.Fprint(w, strconv.Quote(e.String())) } +func (e *GitProviders) UnmarshalJSON(b []byte) error { + s, err := strconv.Unquote(string(b)) + if err != nil { + return err + } + return e.UnmarshalGQL(s) +} + +func (e GitProviders) MarshalJSON() ([]byte, error) { + var buf bytes.Buffer + e.MarshalGQL(&buf) + return buf.Bytes(), nil +} + // Types of push event type GitPushPayloadDataTypes string @@ -10852,7 +11404,7 @@ func (e GitPushPayloadDataTypes) String() string { return string(e) } -func (e *GitPushPayloadDataTypes) UnmarshalGQL(v interface{}) error { +func (e *GitPushPayloadDataTypes) UnmarshalGQL(v any) error { str, ok := v.(string) if !ok { return fmt.Errorf("enums must be strings") @@ -10869,6 +11421,20 @@ func (e GitPushPayloadDataTypes) MarshalGQL(w io.Writer) { fmt.Fprint(w, strconv.Quote(e.String())) } +func (e *GitPushPayloadDataTypes) UnmarshalJSON(b []byte) error { + s, err := strconv.Unquote(string(b)) + if err != nil { + return err + } + return e.UnmarshalGQL(s) +} + +func (e GitPushPayloadDataTypes) MarshalJSON() ([]byte, error) { + var buf bytes.Buffer + e.MarshalGQL(&buf) + return buf.Bytes(), nil +} + // Gitops Releases Sorting field type GitopsReleasesSortingField string @@ -10902,7 +11468,7 @@ func (e GitopsReleasesSortingField) String() string { return string(e) } -func (e *GitopsReleasesSortingField) UnmarshalGQL(v interface{}) error { +func (e *GitopsReleasesSortingField) UnmarshalGQL(v any) error { str, ok := v.(string) if !ok { return fmt.Errorf("enums must be strings") @@ -10919,6 +11485,20 @@ func (e GitopsReleasesSortingField) MarshalGQL(w io.Writer) { fmt.Fprint(w, strconv.Quote(e.String())) } +func (e *GitopsReleasesSortingField) UnmarshalJSON(b []byte) error { + s, err := strconv.Unquote(string(b)) + if err != nil { + return err + } + return e.UnmarshalGQL(s) +} + +func (e GitopsReleasesSortingField) MarshalJSON() ([]byte, error) { + var buf bytes.Buffer + e.MarshalGQL(&buf) + return buf.Bytes(), nil +} + // Health Error codes type HealthErrorCodes string @@ -10958,7 +11538,7 @@ func (e HealthErrorCodes) String() string { return string(e) } -func (e *HealthErrorCodes) UnmarshalGQL(v interface{}) error { +func (e *HealthErrorCodes) UnmarshalGQL(v any) error { str, ok := v.(string) if !ok { return fmt.Errorf("enums must be strings") @@ -10975,6 +11555,20 @@ func (e HealthErrorCodes) MarshalGQL(w io.Writer) { fmt.Fprint(w, strconv.Quote(e.String())) } +func (e *HealthErrorCodes) UnmarshalJSON(b []byte) error { + s, err := strconv.Unquote(string(b)) + if err != nil { + return err + } + return e.UnmarshalGQL(s) +} + +func (e HealthErrorCodes) MarshalJSON() ([]byte, error) { + var buf bytes.Buffer + e.MarshalGQL(&buf) + return buf.Bytes(), nil +} + // Health Status type HealthStatus string @@ -11017,7 +11611,7 @@ func (e HealthStatus) String() string { return string(e) } -func (e *HealthStatus) UnmarshalGQL(v interface{}) error { +func (e *HealthStatus) UnmarshalGQL(v any) error { str, ok := v.(string) if !ok { return fmt.Errorf("enums must be strings") @@ -11034,6 +11628,20 @@ func (e HealthStatus) MarshalGQL(w io.Writer) { fmt.Fprint(w, strconv.Quote(e.String())) } +func (e *HealthStatus) UnmarshalJSON(b []byte) error { + s, err := strconv.Unquote(string(b)) + if err != nil { + return err + } + return e.UnmarshalGQL(s) +} + +func (e HealthStatus) MarshalJSON() ([]byte, error) { + var buf bytes.Buffer + e.MarshalGQL(&buf) + return buf.Bytes(), nil +} + // Image pull policy // Defaults to Always if :latest tag is specified, or IfNotPresent otherwise. Cannot be updated type ImagePullPolicy string @@ -11062,7 +11670,7 @@ func (e ImagePullPolicy) String() string { return string(e) } -func (e *ImagePullPolicy) UnmarshalGQL(v interface{}) error { +func (e *ImagePullPolicy) UnmarshalGQL(v any) error { str, ok := v.(string) if !ok { return fmt.Errorf("enums must be strings") @@ -11079,6 +11687,20 @@ func (e ImagePullPolicy) MarshalGQL(w io.Writer) { fmt.Fprint(w, strconv.Quote(e.String())) } +func (e *ImagePullPolicy) UnmarshalJSON(b []byte) error { + s, err := strconv.Unquote(string(b)) + if err != nil { + return err + } + return e.UnmarshalGQL(s) +} + +func (e ImagePullPolicy) MarshalJSON() ([]byte, error) { + var buf bytes.Buffer + e.MarshalGQL(&buf) + return buf.Bytes(), nil +} + // Image registry domain types type ImageRegistryType string @@ -11121,7 +11743,7 @@ func (e ImageRegistryType) String() string { return string(e) } -func (e *ImageRegistryType) UnmarshalGQL(v interface{}) error { +func (e *ImageRegistryType) UnmarshalGQL(v any) error { str, ok := v.(string) if !ok { return fmt.Errorf("enums must be strings") @@ -11138,9 +11760,23 @@ func (e ImageRegistryType) MarshalGQL(w io.Writer) { fmt.Fprint(w, strconv.Quote(e.String())) } -// Image Repo Tag Sorting field -type ImageRepoTagSortingField string - +func (e *ImageRegistryType) UnmarshalJSON(b []byte) error { + s, err := strconv.Unquote(string(b)) + if err != nil { + return err + } + return e.UnmarshalGQL(s) +} + +func (e ImageRegistryType) MarshalJSON() ([]byte, error) { + var buf bytes.Buffer + e.MarshalGQL(&buf) + return buf.Bytes(), nil +} + +// Image Repo Tag Sorting field +type ImageRepoTagSortingField string + const ( // Tag name ImageRepoTagSortingFieldTag ImageRepoTagSortingField = "tag" @@ -11162,7 +11798,7 @@ func (e ImageRepoTagSortingField) String() string { return string(e) } -func (e *ImageRepoTagSortingField) UnmarshalGQL(v interface{}) error { +func (e *ImageRepoTagSortingField) UnmarshalGQL(v any) error { str, ok := v.(string) if !ok { return fmt.Errorf("enums must be strings") @@ -11179,6 +11815,20 @@ func (e ImageRepoTagSortingField) MarshalGQL(w io.Writer) { fmt.Fprint(w, strconv.Quote(e.String())) } +func (e *ImageRepoTagSortingField) UnmarshalJSON(b []byte) error { + s, err := strconv.Unquote(string(b)) + if err != nil { + return err + } + return e.UnmarshalGQL(s) +} + +func (e ImageRepoTagSortingField) MarshalJSON() ([]byte, error) { + var buf bytes.Buffer + e.MarshalGQL(&buf) + return buf.Bytes(), nil +} + // Image Repository Sorting field type ImageRepositorySortingField string @@ -11206,7 +11856,7 @@ func (e ImageRepositorySortingField) String() string { return string(e) } -func (e *ImageRepositorySortingField) UnmarshalGQL(v interface{}) error { +func (e *ImageRepositorySortingField) UnmarshalGQL(v any) error { str, ok := v.(string) if !ok { return fmt.Errorf("enums must be strings") @@ -11223,6 +11873,20 @@ func (e ImageRepositorySortingField) MarshalGQL(w io.Writer) { fmt.Fprint(w, strconv.Quote(e.String())) } +func (e *ImageRepositorySortingField) UnmarshalJSON(b []byte) error { + s, err := strconv.Unquote(string(b)) + if err != nil { + return err + } + return e.UnmarshalGQL(s) +} + +func (e ImageRepositorySortingField) MarshalJSON() ([]byte, error) { + var buf bytes.Buffer + e.MarshalGQL(&buf) + return buf.Bytes(), nil +} + // Installation Status type InstallationStatus string @@ -11253,7 +11917,7 @@ func (e InstallationStatus) String() string { return string(e) } -func (e *InstallationStatus) UnmarshalGQL(v interface{}) error { +func (e *InstallationStatus) UnmarshalGQL(v any) error { str, ok := v.(string) if !ok { return fmt.Errorf("enums must be strings") @@ -11270,6 +11934,20 @@ func (e InstallationStatus) MarshalGQL(w io.Writer) { fmt.Fprint(w, strconv.Quote(e.String())) } +func (e *InstallationStatus) UnmarshalJSON(b []byte) error { + s, err := strconv.Unquote(string(b)) + if err != nil { + return err + } + return e.UnmarshalGQL(s) +} + +func (e InstallationStatus) MarshalJSON() ([]byte, error) { + var buf bytes.Buffer + e.MarshalGQL(&buf) + return buf.Bytes(), nil +} + // Installation type type InstallationType string @@ -11297,7 +11975,7 @@ func (e InstallationType) String() string { return string(e) } -func (e *InstallationType) UnmarshalGQL(v interface{}) error { +func (e *InstallationType) UnmarshalGQL(v any) error { str, ok := v.(string) if !ok { return fmt.Errorf("enums must be strings") @@ -11314,6 +11992,20 @@ func (e InstallationType) MarshalGQL(w io.Writer) { fmt.Fprint(w, strconv.Quote(e.String())) } +func (e *InstallationType) UnmarshalJSON(b []byte) error { + s, err := strconv.Unquote(string(b)) + if err != nil { + return err + } + return e.UnmarshalGQL(s) +} + +func (e InstallationType) MarshalJSON() ([]byte, error) { + var buf bytes.Buffer + e.MarshalGQL(&buf) + return buf.Bytes(), nil +} + // Integration Consumer type IntegrationConsumer string @@ -11338,7 +12030,7 @@ func (e IntegrationConsumer) String() string { return string(e) } -func (e *IntegrationConsumer) UnmarshalGQL(v interface{}) error { +func (e *IntegrationConsumer) UnmarshalGQL(v any) error { str, ok := v.(string) if !ok { return fmt.Errorf("enums must be strings") @@ -11355,6 +12047,20 @@ func (e IntegrationConsumer) MarshalGQL(w io.Writer) { fmt.Fprint(w, strconv.Quote(e.String())) } +func (e *IntegrationConsumer) UnmarshalJSON(b []byte) error { + s, err := strconv.Unquote(string(b)) + if err != nil { + return err + } + return e.UnmarshalGQL(s) +} + +func (e IntegrationConsumer) MarshalJSON() ([]byte, error) { + var buf bytes.Buffer + e.MarshalGQL(&buf) + return buf.Bytes(), nil +} + // InvoiceStatus type InvoiceStatus string @@ -11386,7 +12092,7 @@ func (e InvoiceStatus) String() string { return string(e) } -func (e *InvoiceStatus) UnmarshalGQL(v interface{}) error { +func (e *InvoiceStatus) UnmarshalGQL(v any) error { str, ok := v.(string) if !ok { return fmt.Errorf("enums must be strings") @@ -11403,6 +12109,20 @@ func (e InvoiceStatus) MarshalGQL(w io.Writer) { fmt.Fprint(w, strconv.Quote(e.String())) } +func (e *InvoiceStatus) UnmarshalJSON(b []byte) error { + s, err := strconv.Unquote(string(b)) + if err != nil { + return err + } + return e.UnmarshalGQL(s) +} + +func (e InvoiceStatus) MarshalJSON() ([]byte, error) { + var buf bytes.Buffer + e.MarshalGQL(&buf) + return buf.Bytes(), nil +} + // Issue Type type IssueType string @@ -11433,7 +12153,7 @@ func (e IssueType) String() string { return string(e) } -func (e *IssueType) UnmarshalGQL(v interface{}) error { +func (e *IssueType) UnmarshalGQL(v any) error { str, ok := v.(string) if !ok { return fmt.Errorf("enums must be strings") @@ -11450,6 +12170,20 @@ func (e IssueType) MarshalGQL(w io.Writer) { fmt.Fprint(w, strconv.Quote(e.String())) } +func (e *IssueType) UnmarshalJSON(b []byte) error { + s, err := strconv.Unquote(string(b)) + if err != nil { + return err + } + return e.UnmarshalGQL(s) +} + +func (e IssueType) MarshalJSON() ([]byte, error) { + var buf bytes.Buffer + e.MarshalGQL(&buf) + return buf.Bytes(), nil +} + // MatchExpressionOperator type MatchExpressionOperator string @@ -11483,7 +12217,7 @@ func (e MatchExpressionOperator) String() string { return string(e) } -func (e *MatchExpressionOperator) UnmarshalGQL(v interface{}) error { +func (e *MatchExpressionOperator) UnmarshalGQL(v any) error { str, ok := v.(string) if !ok { return fmt.Errorf("enums must be strings") @@ -11500,6 +12234,20 @@ func (e MatchExpressionOperator) MarshalGQL(w io.Writer) { fmt.Fprint(w, strconv.Quote(e.String())) } +func (e *MatchExpressionOperator) UnmarshalJSON(b []byte) error { + s, err := strconv.Unquote(string(b)) + if err != nil { + return err + } + return e.UnmarshalGQL(s) +} + +func (e MatchExpressionOperator) MarshalJSON() ([]byte, error) { + var buf bytes.Buffer + e.MarshalGQL(&buf) + return buf.Bytes(), nil +} + // Notification action type type NotificationActionType string @@ -11530,7 +12278,7 @@ func (e NotificationActionType) String() string { return string(e) } -func (e *NotificationActionType) UnmarshalGQL(v interface{}) error { +func (e *NotificationActionType) UnmarshalGQL(v any) error { str, ok := v.(string) if !ok { return fmt.Errorf("enums must be strings") @@ -11547,6 +12295,20 @@ func (e NotificationActionType) MarshalGQL(w io.Writer) { fmt.Fprint(w, strconv.Quote(e.String())) } +func (e *NotificationActionType) UnmarshalJSON(b []byte) error { + s, err := strconv.Unquote(string(b)) + if err != nil { + return err + } + return e.UnmarshalGQL(s) +} + +func (e NotificationActionType) MarshalJSON() ([]byte, error) { + var buf bytes.Buffer + e.MarshalGQL(&buf) + return buf.Bytes(), nil +} + // Notification State type NotificationState string @@ -11577,7 +12339,7 @@ func (e NotificationState) String() string { return string(e) } -func (e *NotificationState) UnmarshalGQL(v interface{}) error { +func (e *NotificationState) UnmarshalGQL(v any) error { str, ok := v.(string) if !ok { return fmt.Errorf("enums must be strings") @@ -11594,6 +12356,20 @@ func (e NotificationState) MarshalGQL(w io.Writer) { fmt.Fprint(w, strconv.Quote(e.String())) } +func (e *NotificationState) UnmarshalJSON(b []byte) error { + s, err := strconv.Unquote(string(b)) + if err != nil { + return err + } + return e.UnmarshalGQL(s) +} + +func (e NotificationState) MarshalJSON() ([]byte, error) { + var buf bytes.Buffer + e.MarshalGQL(&buf) + return buf.Bytes(), nil +} + // Notification Type type NotificationType string @@ -11624,7 +12400,7 @@ func (e NotificationType) String() string { return string(e) } -func (e *NotificationType) UnmarshalGQL(v interface{}) error { +func (e *NotificationType) UnmarshalGQL(v any) error { str, ok := v.(string) if !ok { return fmt.Errorf("enums must be strings") @@ -11641,6 +12417,20 @@ func (e NotificationType) MarshalGQL(w io.Writer) { fmt.Fprint(w, strconv.Quote(e.String())) } +func (e *NotificationType) UnmarshalJSON(b []byte) error { + s, err := strconv.Unquote(string(b)) + if err != nil { + return err + } + return e.UnmarshalGQL(s) +} + +func (e NotificationType) MarshalJSON() ([]byte, error) { + var buf bytes.Buffer + e.MarshalGQL(&buf) + return buf.Bytes(), nil +} + // Types of event payload type PayloadDataTypes string @@ -11668,7 +12458,7 @@ func (e PayloadDataTypes) String() string { return string(e) } -func (e *PayloadDataTypes) UnmarshalGQL(v interface{}) error { +func (e *PayloadDataTypes) UnmarshalGQL(v any) error { str, ok := v.(string) if !ok { return fmt.Errorf("enums must be strings") @@ -11685,6 +12475,20 @@ func (e PayloadDataTypes) MarshalGQL(w io.Writer) { fmt.Fprint(w, strconv.Quote(e.String())) } +func (e *PayloadDataTypes) UnmarshalJSON(b []byte) error { + s, err := strconv.Unquote(string(b)) + if err != nil { + return err + } + return e.UnmarshalGQL(s) +} + +func (e PayloadDataTypes) MarshalJSON() ([]byte, error) { + var buf bytes.Buffer + e.MarshalGQL(&buf) + return buf.Bytes(), nil +} + // Payment Intervals type PaymentInterval string @@ -11710,7 +12514,7 @@ func (e PaymentInterval) String() string { return string(e) } -func (e *PaymentInterval) UnmarshalGQL(v interface{}) error { +func (e *PaymentInterval) UnmarshalGQL(v any) error { str, ok := v.(string) if !ok { return fmt.Errorf("enums must be strings") @@ -11727,6 +12531,20 @@ func (e PaymentInterval) MarshalGQL(w io.Writer) { fmt.Fprint(w, strconv.Quote(e.String())) } +func (e *PaymentInterval) UnmarshalJSON(b []byte) error { + s, err := strconv.Unquote(string(b)) + if err != nil { + return err + } + return e.UnmarshalGQL(s) +} + +func (e PaymentInterval) MarshalJSON() ([]byte, error) { + var buf bytes.Buffer + e.MarshalGQL(&buf) + return buf.Bytes(), nil +} + // Payment Type type PaymentType string @@ -11758,7 +12576,7 @@ func (e PaymentType) String() string { return string(e) } -func (e *PaymentType) UnmarshalGQL(v interface{}) error { +func (e *PaymentType) UnmarshalGQL(v any) error { str, ok := v.(string) if !ok { return fmt.Errorf("enums must be strings") @@ -11775,6 +12593,20 @@ func (e PaymentType) MarshalGQL(w io.Writer) { fmt.Fprint(w, strconv.Quote(e.String())) } +func (e *PaymentType) UnmarshalJSON(b []byte) error { + s, err := strconv.Unquote(string(b)) + if err != nil { + return err + } + return e.UnmarshalGQL(s) +} + +func (e PaymentType) MarshalJSON() ([]byte, error) { + var buf bytes.Buffer + e.MarshalGQL(&buf) + return buf.Bytes(), nil +} + // Pipeline statistics sort by duration type type PipelineClassicStatisticDurationMetricType string @@ -11802,7 +12634,7 @@ func (e PipelineClassicStatisticDurationMetricType) String() string { return string(e) } -func (e *PipelineClassicStatisticDurationMetricType) UnmarshalGQL(v interface{}) error { +func (e *PipelineClassicStatisticDurationMetricType) UnmarshalGQL(v any) error { str, ok := v.(string) if !ok { return fmt.Errorf("enums must be strings") @@ -11819,6 +12651,20 @@ func (e PipelineClassicStatisticDurationMetricType) MarshalGQL(w io.Writer) { fmt.Fprint(w, strconv.Quote(e.String())) } +func (e *PipelineClassicStatisticDurationMetricType) UnmarshalJSON(b []byte) error { + s, err := strconv.Unquote(string(b)) + if err != nil { + return err + } + return e.UnmarshalGQL(s) +} + +func (e PipelineClassicStatisticDurationMetricType) MarshalJSON() ([]byte, error) { + var buf bytes.Buffer + e.MarshalGQL(&buf) + return buf.Bytes(), nil +} + // PlanTypes type PlanTypes string @@ -11844,7 +12690,7 @@ func (e PlanTypes) String() string { return string(e) } -func (e *PlanTypes) UnmarshalGQL(v interface{}) error { +func (e *PlanTypes) UnmarshalGQL(v any) error { str, ok := v.(string) if !ok { return fmt.Errorf("enums must be strings") @@ -11861,6 +12707,20 @@ func (e PlanTypes) MarshalGQL(w io.Writer) { fmt.Fprint(w, strconv.Quote(e.String())) } +func (e *PlanTypes) UnmarshalJSON(b []byte) error { + s, err := strconv.Unquote(string(b)) + if err != nil { + return err + } + return e.UnmarshalGQL(s) +} + +func (e PlanTypes) MarshalJSON() ([]byte, error) { + var buf bytes.Buffer + e.MarshalGQL(&buf) + return buf.Bytes(), nil +} + // Product Components Sorting field type ProductComponentSortingField string @@ -11888,7 +12748,7 @@ func (e ProductComponentSortingField) String() string { return string(e) } -func (e *ProductComponentSortingField) UnmarshalGQL(v interface{}) error { +func (e *ProductComponentSortingField) UnmarshalGQL(v any) error { str, ok := v.(string) if !ok { return fmt.Errorf("enums must be strings") @@ -11905,6 +12765,20 @@ func (e ProductComponentSortingField) MarshalGQL(w io.Writer) { fmt.Fprint(w, strconv.Quote(e.String())) } +func (e *ProductComponentSortingField) UnmarshalJSON(b []byte) error { + s, err := strconv.Unquote(string(b)) + if err != nil { + return err + } + return e.UnmarshalGQL(s) +} + +func (e ProductComponentSortingField) MarshalJSON() ([]byte, error) { + var buf bytes.Buffer + e.MarshalGQL(&buf) + return buf.Bytes(), nil +} + // Product Component types type ProductComponentType string @@ -11932,7 +12806,7 @@ func (e ProductComponentType) String() string { return string(e) } -func (e *ProductComponentType) UnmarshalGQL(v interface{}) error { +func (e *ProductComponentType) UnmarshalGQL(v any) error { str, ok := v.(string) if !ok { return fmt.Errorf("enums must be strings") @@ -11949,6 +12823,20 @@ func (e ProductComponentType) MarshalGQL(w io.Writer) { fmt.Fprint(w, strconv.Quote(e.String())) } +func (e *ProductComponentType) UnmarshalJSON(b []byte) error { + s, err := strconv.Unquote(string(b)) + if err != nil { + return err + } + return e.UnmarshalGQL(s) +} + +func (e ProductComponentType) MarshalJSON() ([]byte, error) { + var buf bytes.Buffer + e.MarshalGQL(&buf) + return buf.Bytes(), nil +} + // ProductConcurrency type ProductConcurrency string @@ -11976,7 +12864,7 @@ func (e ProductConcurrency) String() string { return string(e) } -func (e *ProductConcurrency) UnmarshalGQL(v interface{}) error { +func (e *ProductConcurrency) UnmarshalGQL(v any) error { str, ok := v.(string) if !ok { return fmt.Errorf("enums must be strings") @@ -11993,6 +12881,20 @@ func (e ProductConcurrency) MarshalGQL(w io.Writer) { fmt.Fprint(w, strconv.Quote(e.String())) } +func (e *ProductConcurrency) UnmarshalJSON(b []byte) error { + s, err := strconv.Unquote(string(b)) + if err != nil { + return err + } + return e.UnmarshalGQL(s) +} + +func (e ProductConcurrency) MarshalJSON() ([]byte, error) { + var buf bytes.Buffer + e.MarshalGQL(&buf) + return buf.Bytes(), nil +} + // ProductGitTrigger type ProductGitTrigger string @@ -12020,7 +12922,7 @@ func (e ProductGitTrigger) String() string { return string(e) } -func (e *ProductGitTrigger) UnmarshalGQL(v interface{}) error { +func (e *ProductGitTrigger) UnmarshalGQL(v any) error { str, ok := v.(string) if !ok { return fmt.Errorf("enums must be strings") @@ -12037,6 +12939,20 @@ func (e ProductGitTrigger) MarshalGQL(w io.Writer) { fmt.Fprint(w, strconv.Quote(e.String())) } +func (e *ProductGitTrigger) UnmarshalJSON(b []byte) error { + s, err := strconv.Unquote(string(b)) + if err != nil { + return err + } + return e.UnmarshalGQL(s) +} + +func (e ProductGitTrigger) MarshalJSON() ([]byte, error) { + var buf bytes.Buffer + e.MarshalGQL(&buf) + return buf.Bytes(), nil +} + // Product release error code type ProductReleaseErrorCode string @@ -12079,7 +12995,7 @@ func (e ProductReleaseErrorCode) String() string { return string(e) } -func (e *ProductReleaseErrorCode) UnmarshalGQL(v interface{}) error { +func (e *ProductReleaseErrorCode) UnmarshalGQL(v any) error { str, ok := v.(string) if !ok { return fmt.Errorf("enums must be strings") @@ -12096,6 +13012,20 @@ func (e ProductReleaseErrorCode) MarshalGQL(w io.Writer) { fmt.Fprint(w, strconv.Quote(e.String())) } +func (e *ProductReleaseErrorCode) UnmarshalJSON(b []byte) error { + s, err := strconv.Unquote(string(b)) + if err != nil { + return err + } + return e.UnmarshalGQL(s) +} + +func (e ProductReleaseErrorCode) MarshalJSON() ([]byte, error) { + var buf bytes.Buffer + e.MarshalGQL(&buf) + return buf.Bytes(), nil +} + // Product Release Public Status type ProductReleasePublicStatus string @@ -12138,7 +13068,7 @@ func (e ProductReleasePublicStatus) String() string { return string(e) } -func (e *ProductReleasePublicStatus) UnmarshalGQL(v interface{}) error { +func (e *ProductReleasePublicStatus) UnmarshalGQL(v any) error { str, ok := v.(string) if !ok { return fmt.Errorf("enums must be strings") @@ -12155,6 +13085,20 @@ func (e ProductReleasePublicStatus) MarshalGQL(w io.Writer) { fmt.Fprint(w, strconv.Quote(e.String())) } +func (e *ProductReleasePublicStatus) UnmarshalJSON(b []byte) error { + s, err := strconv.Unquote(string(b)) + if err != nil { + return err + } + return e.UnmarshalGQL(s) +} + +func (e ProductReleasePublicStatus) MarshalJSON() ([]byte, error) { + var buf bytes.Buffer + e.MarshalGQL(&buf) + return buf.Bytes(), nil +} + // Product Release Status, including internal statuses type ProductReleaseStatus string @@ -12209,7 +13153,7 @@ func (e ProductReleaseStatus) String() string { return string(e) } -func (e *ProductReleaseStatus) UnmarshalGQL(v interface{}) error { +func (e *ProductReleaseStatus) UnmarshalGQL(v any) error { str, ok := v.(string) if !ok { return fmt.Errorf("enums must be strings") @@ -12226,6 +13170,20 @@ func (e ProductReleaseStatus) MarshalGQL(w io.Writer) { fmt.Fprint(w, strconv.Quote(e.String())) } +func (e *ProductReleaseStatus) UnmarshalJSON(b []byte) error { + s, err := strconv.Unquote(string(b)) + if err != nil { + return err + } + return e.UnmarshalGQL(s) +} + +func (e ProductReleaseStatus) MarshalJSON() ([]byte, error) { + var buf bytes.Buffer + e.MarshalGQL(&buf) + return buf.Bytes(), nil +} + // Product Release step status type ProductReleaseStepStatus string @@ -12280,7 +13238,7 @@ func (e ProductReleaseStepStatus) String() string { return string(e) } -func (e *ProductReleaseStepStatus) UnmarshalGQL(v interface{}) error { +func (e *ProductReleaseStepStatus) UnmarshalGQL(v any) error { str, ok := v.(string) if !ok { return fmt.Errorf("enums must be strings") @@ -12297,6 +13255,20 @@ func (e ProductReleaseStepStatus) MarshalGQL(w io.Writer) { fmt.Fprint(w, strconv.Quote(e.String())) } +func (e *ProductReleaseStepStatus) UnmarshalJSON(b []byte) error { + s, err := strconv.Unquote(string(b)) + if err != nil { + return err + } + return e.UnmarshalGQL(s) +} + +func (e ProductReleaseStepStatus) MarshalJSON() ([]byte, error) { + var buf bytes.Buffer + e.MarshalGQL(&buf) + return buf.Bytes(), nil +} + // Product Release task type type ProductReleaseTaskType string @@ -12333,7 +13305,7 @@ func (e ProductReleaseTaskType) String() string { return string(e) } -func (e *ProductReleaseTaskType) UnmarshalGQL(v interface{}) error { +func (e *ProductReleaseTaskType) UnmarshalGQL(v any) error { str, ok := v.(string) if !ok { return fmt.Errorf("enums must be strings") @@ -12350,10 +13322,26 @@ func (e ProductReleaseTaskType) MarshalGQL(w io.Writer) { fmt.Fprint(w, strconv.Quote(e.String())) } +func (e *ProductReleaseTaskType) UnmarshalJSON(b []byte) error { + s, err := strconv.Unquote(string(b)) + if err != nil { + return err + } + return e.UnmarshalGQL(s) +} + +func (e ProductReleaseTaskType) MarshalJSON() ([]byte, error) { + var buf bytes.Buffer + e.MarshalGQL(&buf) + return buf.Bytes(), nil +} + // Product Sorting field type ProductSortingField string const ( + // By id + ProductSortingFieldID ProductSortingField = "id" // By name ProductSortingFieldName ProductSortingField = "name" // By updated at @@ -12361,13 +13349,14 @@ const ( ) var AllProductSortingField = []ProductSortingField{ + ProductSortingFieldID, ProductSortingFieldName, ProductSortingFieldUpdatedAt, } func (e ProductSortingField) IsValid() bool { switch e { - case ProductSortingFieldName, ProductSortingFieldUpdatedAt: + case ProductSortingFieldID, ProductSortingFieldName, ProductSortingFieldUpdatedAt: return true } return false @@ -12377,7 +13366,7 @@ func (e ProductSortingField) String() string { return string(e) } -func (e *ProductSortingField) UnmarshalGQL(v interface{}) error { +func (e *ProductSortingField) UnmarshalGQL(v any) error { str, ok := v.(string) if !ok { return fmt.Errorf("enums must be strings") @@ -12394,6 +13383,20 @@ func (e ProductSortingField) MarshalGQL(w io.Writer) { fmt.Fprint(w, strconv.Quote(e.String())) } +func (e *ProductSortingField) UnmarshalJSON(b []byte) error { + s, err := strconv.Unquote(string(b)) + if err != nil { + return err + } + return e.UnmarshalGQL(s) +} + +func (e ProductSortingField) MarshalJSON() ([]byte, error) { + var buf bytes.Buffer + e.MarshalGQL(&buf) + return buf.Bytes(), nil +} + // Promotion policy possible actions type PromotionPolicyAction string @@ -12424,7 +13427,7 @@ func (e PromotionPolicyAction) String() string { return string(e) } -func (e *PromotionPolicyAction) UnmarshalGQL(v interface{}) error { +func (e *PromotionPolicyAction) UnmarshalGQL(v any) error { str, ok := v.(string) if !ok { return fmt.Errorf("enums must be strings") @@ -12441,6 +13444,20 @@ func (e PromotionPolicyAction) MarshalGQL(w io.Writer) { fmt.Fprint(w, strconv.Quote(e.String())) } +func (e *PromotionPolicyAction) UnmarshalJSON(b []byte) error { + s, err := strconv.Unquote(string(b)) + if err != nil { + return err + } + return e.UnmarshalGQL(s) +} + +func (e PromotionPolicyAction) MarshalJSON() ([]byte, error) { + var buf bytes.Buffer + e.MarshalGQL(&buf) + return buf.Bytes(), nil +} + // Product Policy sorting field type PromotionPolicySortingField string @@ -12471,7 +13488,7 @@ func (e PromotionPolicySortingField) String() string { return string(e) } -func (e *PromotionPolicySortingField) UnmarshalGQL(v interface{}) error { +func (e *PromotionPolicySortingField) UnmarshalGQL(v any) error { str, ok := v.(string) if !ok { return fmt.Errorf("enums must be strings") @@ -12488,6 +13505,206 @@ func (e PromotionPolicySortingField) MarshalGQL(w io.Writer) { fmt.Fprint(w, strconv.Quote(e.String())) } +func (e *PromotionPolicySortingField) UnmarshalJSON(b []byte) error { + s, err := strconv.Unquote(string(b)) + if err != nil { + return err + } + return e.UnmarshalGQL(s) +} + +func (e PromotionPolicySortingField) MarshalJSON() ([]byte, error) { + var buf bytes.Buffer + e.MarshalGQL(&buf) + return buf.Bytes(), nil +} + +// Promotion triggers enum +type PromotionTriggers string + +const ( + PromotionTriggersRestart PromotionTriggers = "RESTART" + PromotionTriggersGitCommit PromotionTriggers = "GIT_COMMIT" + PromotionTriggersDragAndDrop PromotionTriggers = "DRAG_AND_DROP" + PromotionTriggersManual PromotionTriggers = "MANUAL" +) + +var AllPromotionTriggers = []PromotionTriggers{ + PromotionTriggersRestart, + PromotionTriggersGitCommit, + PromotionTriggersDragAndDrop, + PromotionTriggersManual, +} + +func (e PromotionTriggers) IsValid() bool { + switch e { + case PromotionTriggersRestart, PromotionTriggersGitCommit, PromotionTriggersDragAndDrop, PromotionTriggersManual: + return true + } + return false +} + +func (e PromotionTriggers) String() string { + return string(e) +} + +func (e *PromotionTriggers) UnmarshalGQL(v any) error { + str, ok := v.(string) + if !ok { + return fmt.Errorf("enums must be strings") + } + + *e = PromotionTriggers(str) + if !e.IsValid() { + return fmt.Errorf("%s is not a valid PromotionTriggers", str) + } + return nil +} + +func (e PromotionTriggers) MarshalGQL(w io.Writer) { + fmt.Fprint(w, strconv.Quote(e.String())) +} + +func (e *PromotionTriggers) UnmarshalJSON(b []byte) error { + s, err := strconv.Unquote(string(b)) + if err != nil { + return err + } + return e.UnmarshalGQL(s) +} + +func (e PromotionTriggers) MarshalJSON() ([]byte, error) { + var buf bytes.Buffer + e.MarshalGQL(&buf) + return buf.Bytes(), nil +} + +// Promotion status enum +type PromotionsStatus string + +const ( + PromotionsStatusFailed PromotionsStatus = "FAILED" + PromotionsStatusQueued PromotionsStatus = "QUEUED" + PromotionsStatusRunning PromotionsStatus = "RUNNING" + PromotionsStatusSucceeded PromotionsStatus = "SUCCEEDED" + PromotionsStatusSuspended PromotionsStatus = "SUSPENDED" + PromotionsStatusTerminated PromotionsStatus = "TERMINATED" + PromotionsStatusTerminating PromotionsStatus = "TERMINATING" +) + +var AllPromotionsStatus = []PromotionsStatus{ + PromotionsStatusFailed, + PromotionsStatusQueued, + PromotionsStatusRunning, + PromotionsStatusSucceeded, + PromotionsStatusSuspended, + PromotionsStatusTerminated, + PromotionsStatusTerminating, +} + +func (e PromotionsStatus) IsValid() bool { + switch e { + case PromotionsStatusFailed, PromotionsStatusQueued, PromotionsStatusRunning, PromotionsStatusSucceeded, PromotionsStatusSuspended, PromotionsStatusTerminated, PromotionsStatusTerminating: + return true + } + return false +} + +func (e PromotionsStatus) String() string { + return string(e) +} + +func (e *PromotionsStatus) UnmarshalGQL(v any) error { + str, ok := v.(string) + if !ok { + return fmt.Errorf("enums must be strings") + } + + *e = PromotionsStatus(str) + if !e.IsValid() { + return fmt.Errorf("%s is not a valid PromotionsStatus", str) + } + return nil +} + +func (e PromotionsStatus) MarshalGQL(w io.Writer) { + fmt.Fprint(w, strconv.Quote(e.String())) +} + +func (e *PromotionsStatus) UnmarshalJSON(b []byte) error { + s, err := strconv.Unquote(string(b)) + if err != nil { + return err + } + return e.UnmarshalGQL(s) +} + +func (e PromotionsStatus) MarshalJSON() ([]byte, error) { + var buf bytes.Buffer + e.MarshalGQL(&buf) + return buf.Bytes(), nil +} + +// Promotion triggers enum +type PromotionsTriggers string + +const ( + PromotionsTriggersRestart PromotionsTriggers = "RESTART" + PromotionsTriggersGitCommit PromotionsTriggers = "GIT_COMMIT" + PromotionsTriggersDragAndDrop PromotionsTriggers = "DRAG_AND_DROP" + PromotionsTriggersManual PromotionsTriggers = "MANUAL" +) + +var AllPromotionsTriggers = []PromotionsTriggers{ + PromotionsTriggersRestart, + PromotionsTriggersGitCommit, + PromotionsTriggersDragAndDrop, + PromotionsTriggersManual, +} + +func (e PromotionsTriggers) IsValid() bool { + switch e { + case PromotionsTriggersRestart, PromotionsTriggersGitCommit, PromotionsTriggersDragAndDrop, PromotionsTriggersManual: + return true + } + return false +} + +func (e PromotionsTriggers) String() string { + return string(e) +} + +func (e *PromotionsTriggers) UnmarshalGQL(v any) error { + str, ok := v.(string) + if !ok { + return fmt.Errorf("enums must be strings") + } + + *e = PromotionsTriggers(str) + if !e.IsValid() { + return fmt.Errorf("%s is not a valid PromotionsTriggers", str) + } + return nil +} + +func (e PromotionsTriggers) MarshalGQL(w io.Writer) { + fmt.Fprint(w, strconv.Quote(e.String())) +} + +func (e *PromotionsTriggers) UnmarshalJSON(b []byte) error { + s, err := strconv.Unquote(string(b)) + if err != nil { + return err + } + return e.UnmarshalGQL(s) +} + +func (e PromotionsTriggers) MarshalJSON() ([]byte, error) { + var buf bytes.Buffer + e.MarshalGQL(&buf) + return buf.Bytes(), nil +} + // Pull request state type PullRequestState string @@ -12515,7 +13732,7 @@ func (e PullRequestState) String() string { return string(e) } -func (e *PullRequestState) UnmarshalGQL(v interface{}) error { +func (e *PullRequestState) UnmarshalGQL(v any) error { str, ok := v.(string) if !ok { return fmt.Errorf("enums must be strings") @@ -12532,6 +13749,20 @@ func (e PullRequestState) MarshalGQL(w io.Writer) { fmt.Fprint(w, strconv.Quote(e.String())) } +func (e *PullRequestState) UnmarshalJSON(b []byte) error { + s, err := strconv.Unquote(string(b)) + if err != nil { + return err + } + return e.UnmarshalGQL(s) +} + +func (e PullRequestState) MarshalJSON() ([]byte, error) { + var buf bytes.Buffer + e.MarshalGQL(&buf) + return buf.Bytes(), nil +} + // Release Rollout Disabled Reasons type ReleaseRolloutDisabledReasons string @@ -12556,7 +13787,7 @@ func (e ReleaseRolloutDisabledReasons) String() string { return string(e) } -func (e *ReleaseRolloutDisabledReasons) UnmarshalGQL(v interface{}) error { +func (e *ReleaseRolloutDisabledReasons) UnmarshalGQL(v any) error { str, ok := v.(string) if !ok { return fmt.Errorf("enums must be strings") @@ -12573,6 +13804,20 @@ func (e ReleaseRolloutDisabledReasons) MarshalGQL(w io.Writer) { fmt.Fprint(w, strconv.Quote(e.String())) } +func (e *ReleaseRolloutDisabledReasons) UnmarshalJSON(b []byte) error { + s, err := strconv.Unquote(string(b)) + if err != nil { + return err + } + return e.UnmarshalGQL(s) +} + +func (e ReleaseRolloutDisabledReasons) MarshalJSON() ([]byte, error) { + var buf bytes.Buffer + e.MarshalGQL(&buf) + return buf.Bytes(), nil +} + // Resource action type ResourceAction string @@ -12603,7 +13848,7 @@ func (e ResourceAction) String() string { return string(e) } -func (e *ResourceAction) UnmarshalGQL(v interface{}) error { +func (e *ResourceAction) UnmarshalGQL(v any) error { str, ok := v.(string) if !ok { return fmt.Errorf("enums must be strings") @@ -12620,6 +13865,20 @@ func (e ResourceAction) MarshalGQL(w io.Writer) { fmt.Fprint(w, strconv.Quote(e.String())) } +func (e *ResourceAction) UnmarshalJSON(b []byte) error { + s, err := strconv.Unquote(string(b)) + if err != nil { + return err + } + return e.UnmarshalGQL(s) +} + +func (e ResourceAction) MarshalJSON() ([]byte, error) { + var buf bytes.Buffer + e.MarshalGQL(&buf) + return buf.Bytes(), nil +} + // ResourceOperation type ResourceOperation string @@ -12650,7 +13909,7 @@ func (e ResourceOperation) String() string { return string(e) } -func (e *ResourceOperation) UnmarshalGQL(v interface{}) error { +func (e *ResourceOperation) UnmarshalGQL(v any) error { str, ok := v.(string) if !ok { return fmt.Errorf("enums must be strings") @@ -12667,6 +13926,20 @@ func (e ResourceOperation) MarshalGQL(w io.Writer) { fmt.Fprint(w, strconv.Quote(e.String())) } +func (e *ResourceOperation) UnmarshalJSON(b []byte) error { + s, err := strconv.Unquote(string(b)) + if err != nil { + return err + } + return e.UnmarshalGQL(s) +} + +func (e ResourceOperation) MarshalJSON() ([]byte, error) { + var buf bytes.Buffer + e.MarshalGQL(&buf) + return buf.Bytes(), nil +} + // Rollout Phases type RolloutPhases string @@ -12706,7 +13979,7 @@ func (e RolloutPhases) String() string { return string(e) } -func (e *RolloutPhases) UnmarshalGQL(v interface{}) error { +func (e *RolloutPhases) UnmarshalGQL(v any) error { str, ok := v.(string) if !ok { return fmt.Errorf("enums must be strings") @@ -12723,6 +13996,20 @@ func (e RolloutPhases) MarshalGQL(w io.Writer) { fmt.Fprint(w, strconv.Quote(e.String())) } +func (e *RolloutPhases) UnmarshalJSON(b []byte) error { + s, err := strconv.Unquote(string(b)) + if err != nil { + return err + } + return e.UnmarshalGQL(s) +} + +func (e RolloutPhases) MarshalJSON() ([]byte, error) { + var buf bytes.Buffer + e.MarshalGQL(&buf) + return buf.Bytes(), nil +} + // Rollout Step Status type RolloutStepStatus string @@ -12765,7 +14052,7 @@ func (e RolloutStepStatus) String() string { return string(e) } -func (e *RolloutStepStatus) UnmarshalGQL(v interface{}) error { +func (e *RolloutStepStatus) UnmarshalGQL(v any) error { str, ok := v.(string) if !ok { return fmt.Errorf("enums must be strings") @@ -12782,6 +14069,20 @@ func (e RolloutStepStatus) MarshalGQL(w io.Writer) { fmt.Fprint(w, strconv.Quote(e.String())) } +func (e *RolloutStepStatus) UnmarshalJSON(b []byte) error { + s, err := strconv.Unquote(string(b)) + if err != nil { + return err + } + return e.UnmarshalGQL(s) +} + +func (e RolloutStepStatus) MarshalJSON() ([]byte, error) { + var buf bytes.Buffer + e.MarshalGQL(&buf) + return buf.Bytes(), nil +} + // Rollout Strategy Names type RolloutStrategyNames string @@ -12809,7 +14110,7 @@ func (e RolloutStrategyNames) String() string { return string(e) } -func (e *RolloutStrategyNames) UnmarshalGQL(v interface{}) error { +func (e *RolloutStrategyNames) UnmarshalGQL(v any) error { str, ok := v.(string) if !ok { return fmt.Errorf("enums must be strings") @@ -12826,6 +14127,20 @@ func (e RolloutStrategyNames) MarshalGQL(w io.Writer) { fmt.Fprint(w, strconv.Quote(e.String())) } +func (e *RolloutStrategyNames) UnmarshalJSON(b []byte) error { + s, err := strconv.Unquote(string(b)) + if err != nil { + return err + } + return e.UnmarshalGQL(s) +} + +func (e RolloutStrategyNames) MarshalJSON() ([]byte, error) { + var buf bytes.Buffer + e.MarshalGQL(&buf) + return buf.Bytes(), nil +} + // RuntimeOperationAction type RuntimeOperationAction string @@ -12853,7 +14168,7 @@ func (e RuntimeOperationAction) String() string { return string(e) } -func (e *RuntimeOperationAction) UnmarshalGQL(v interface{}) error { +func (e *RuntimeOperationAction) UnmarshalGQL(v any) error { str, ok := v.(string) if !ok { return fmt.Errorf("enums must be strings") @@ -12870,6 +14185,20 @@ func (e RuntimeOperationAction) MarshalGQL(w io.Writer) { fmt.Fprint(w, strconv.Quote(e.String())) } +func (e *RuntimeOperationAction) UnmarshalJSON(b []byte) error { + s, err := strconv.Unquote(string(b)) + if err != nil { + return err + } + return e.UnmarshalGQL(s) +} + +func (e RuntimeOperationAction) MarshalJSON() ([]byte, error) { + var buf bytes.Buffer + e.MarshalGQL(&buf) + return buf.Bytes(), nil +} + // Runtime Sync Mode type RuntimeSyncMode string @@ -12900,7 +14229,7 @@ func (e RuntimeSyncMode) String() string { return string(e) } -func (e *RuntimeSyncMode) UnmarshalGQL(v interface{}) error { +func (e *RuntimeSyncMode) UnmarshalGQL(v any) error { str, ok := v.(string) if !ok { return fmt.Errorf("enums must be strings") @@ -12917,6 +14246,20 @@ func (e RuntimeSyncMode) MarshalGQL(w io.Writer) { fmt.Fprint(w, strconv.Quote(e.String())) } +func (e *RuntimeSyncMode) UnmarshalJSON(b []byte) error { + s, err := strconv.Unquote(string(b)) + if err != nil { + return err + } + return e.UnmarshalGQL(s) +} + +func (e RuntimeSyncMode) MarshalJSON() ([]byte, error) { + var buf bytes.Buffer + e.MarshalGQL(&buf) + return buf.Bytes(), nil +} + // Integration Entity Type type SecretType string @@ -12944,7 +14287,7 @@ func (e SecretType) String() string { return string(e) } -func (e *SecretType) UnmarshalGQL(v interface{}) error { +func (e *SecretType) UnmarshalGQL(v any) error { str, ok := v.(string) if !ok { return fmt.Errorf("enums must be strings") @@ -12961,6 +14304,20 @@ func (e SecretType) MarshalGQL(w io.Writer) { fmt.Fprint(w, strconv.Quote(e.String())) } +func (e *SecretType) UnmarshalJSON(b []byte) error { + s, err := strconv.Unquote(string(b)) + if err != nil { + return err + } + return e.UnmarshalGQL(s) +} + +func (e SecretType) MarshalJSON() ([]byte, error) { + var buf bytes.Buffer + e.MarshalGQL(&buf) + return buf.Bytes(), nil +} + // Service Sorting field type ServiceSortingField string @@ -12988,7 +14345,7 @@ func (e ServiceSortingField) String() string { return string(e) } -func (e *ServiceSortingField) UnmarshalGQL(v interface{}) error { +func (e *ServiceSortingField) UnmarshalGQL(v any) error { str, ok := v.(string) if !ok { return fmt.Errorf("enums must be strings") @@ -13005,6 +14362,20 @@ func (e ServiceSortingField) MarshalGQL(w io.Writer) { fmt.Fprint(w, strconv.Quote(e.String())) } +func (e *ServiceSortingField) UnmarshalJSON(b []byte) error { + s, err := strconv.Unquote(string(b)) + if err != nil { + return err + } + return e.UnmarshalGQL(s) +} + +func (e ServiceSortingField) MarshalJSON() ([]byte, error) { + var buf bytes.Buffer + e.MarshalGQL(&buf) + return buf.Bytes(), nil +} + // ServiceType type ServiceType string @@ -13034,7 +14405,7 @@ func (e ServiceType) String() string { return string(e) } -func (e *ServiceType) UnmarshalGQL(v interface{}) error { +func (e *ServiceType) UnmarshalGQL(v any) error { str, ok := v.(string) if !ok { return fmt.Errorf("enums must be strings") @@ -13051,6 +14422,20 @@ func (e ServiceType) MarshalGQL(w io.Writer) { fmt.Fprint(w, strconv.Quote(e.String())) } +func (e *ServiceType) UnmarshalJSON(b []byte) error { + s, err := strconv.Unquote(string(b)) + if err != nil { + return err + } + return e.UnmarshalGQL(s) +} + +func (e ServiceType) MarshalJSON() ([]byte, error) { + var buf bytes.Buffer + e.MarshalGQL(&buf) + return buf.Bytes(), nil +} + // Sorting order type SortingOrder string @@ -13078,7 +14463,7 @@ func (e SortingOrder) String() string { return string(e) } -func (e *SortingOrder) UnmarshalGQL(v interface{}) error { +func (e *SortingOrder) UnmarshalGQL(v any) error { str, ok := v.(string) if !ok { return fmt.Errorf("enums must be strings") @@ -13095,6 +14480,20 @@ func (e SortingOrder) MarshalGQL(w io.Writer) { fmt.Fprint(w, strconv.Quote(e.String())) } +func (e *SortingOrder) UnmarshalJSON(b []byte) error { + s, err := strconv.Unquote(string(b)) + if err != nil { + return err + } + return e.UnmarshalGQL(s) +} + +func (e SortingOrder) MarshalJSON() ([]byte, error) { + var buf bytes.Buffer + e.MarshalGQL(&buf) + return buf.Bytes(), nil +} + // Support Plan type SupportPlan string @@ -13124,7 +14523,7 @@ func (e SupportPlan) String() string { return string(e) } -func (e *SupportPlan) UnmarshalGQL(v interface{}) error { +func (e *SupportPlan) UnmarshalGQL(v any) error { str, ok := v.(string) if !ok { return fmt.Errorf("enums must be strings") @@ -13141,6 +14540,20 @@ func (e SupportPlan) MarshalGQL(w io.Writer) { fmt.Fprint(w, strconv.Quote(e.String())) } +func (e *SupportPlan) UnmarshalJSON(b []byte) error { + s, err := strconv.Unquote(string(b)) + if err != nil { + return err + } + return e.UnmarshalGQL(s) +} + +func (e SupportPlan) MarshalJSON() ([]byte, error) { + var buf bytes.Buffer + e.MarshalGQL(&buf) + return buf.Bytes(), nil +} + // Supported CI Tools type SupportedCITools string @@ -13171,7 +14584,7 @@ func (e SupportedCITools) String() string { return string(e) } -func (e *SupportedCITools) UnmarshalGQL(v interface{}) error { +func (e *SupportedCITools) UnmarshalGQL(v any) error { str, ok := v.(string) if !ok { return fmt.Errorf("enums must be strings") @@ -13188,6 +14601,20 @@ func (e SupportedCITools) MarshalGQL(w io.Writer) { fmt.Fprint(w, strconv.Quote(e.String())) } +func (e *SupportedCITools) UnmarshalJSON(b []byte) error { + s, err := strconv.Unquote(string(b)) + if err != nil { + return err + } + return e.UnmarshalGQL(s) +} + +func (e SupportedCITools) MarshalJSON() ([]byte, error) { + var buf bytes.Buffer + e.MarshalGQL(&buf) + return buf.Bytes(), nil +} + // SyncResourceAction type SyncActionOnResource string @@ -13230,7 +14657,7 @@ func (e SyncActionOnResource) String() string { return string(e) } -func (e *SyncActionOnResource) UnmarshalGQL(v interface{}) error { +func (e *SyncActionOnResource) UnmarshalGQL(v any) error { str, ok := v.(string) if !ok { return fmt.Errorf("enums must be strings") @@ -13247,6 +14674,20 @@ func (e SyncActionOnResource) MarshalGQL(w io.Writer) { fmt.Fprint(w, strconv.Quote(e.String())) } +func (e *SyncActionOnResource) UnmarshalJSON(b []byte) error { + s, err := strconv.Unquote(string(b)) + if err != nil { + return err + } + return e.UnmarshalGQL(s) +} + +func (e SyncActionOnResource) MarshalJSON() ([]byte, error) { + var buf bytes.Buffer + e.MarshalGQL(&buf) + return buf.Bytes(), nil +} + // Sync Error codes type SyncErrorCodes string @@ -13280,7 +14721,7 @@ func (e SyncErrorCodes) String() string { return string(e) } -func (e *SyncErrorCodes) UnmarshalGQL(v interface{}) error { +func (e *SyncErrorCodes) UnmarshalGQL(v any) error { str, ok := v.(string) if !ok { return fmt.Errorf("enums must be strings") @@ -13297,6 +14738,20 @@ func (e SyncErrorCodes) MarshalGQL(w io.Writer) { fmt.Fprint(w, strconv.Quote(e.String())) } +func (e *SyncErrorCodes) UnmarshalJSON(b []byte) error { + s, err := strconv.Unquote(string(b)) + if err != nil { + return err + } + return e.UnmarshalGQL(s) +} + +func (e SyncErrorCodes) MarshalJSON() ([]byte, error) { + var buf bytes.Buffer + e.MarshalGQL(&buf) + return buf.Bytes(), nil +} + // SyncHookType type SyncHookType string @@ -13333,7 +14788,7 @@ func (e SyncHookType) String() string { return string(e) } -func (e *SyncHookType) UnmarshalGQL(v interface{}) error { +func (e *SyncHookType) UnmarshalGQL(v any) error { str, ok := v.(string) if !ok { return fmt.Errorf("enums must be strings") @@ -13350,6 +14805,20 @@ func (e SyncHookType) MarshalGQL(w io.Writer) { fmt.Fprint(w, strconv.Quote(e.String())) } +func (e *SyncHookType) UnmarshalJSON(b []byte) error { + s, err := strconv.Unquote(string(b)) + if err != nil { + return err + } + return e.UnmarshalGQL(s) +} + +func (e SyncHookType) MarshalJSON() ([]byte, error) { + var buf bytes.Buffer + e.MarshalGQL(&buf) + return buf.Bytes(), nil +} + // SyncOperationPhase type SyncOperationPhase string @@ -13389,7 +14858,7 @@ func (e SyncOperationPhase) String() string { return string(e) } -func (e *SyncOperationPhase) UnmarshalGQL(v interface{}) error { +func (e *SyncOperationPhase) UnmarshalGQL(v any) error { str, ok := v.(string) if !ok { return fmt.Errorf("enums must be strings") @@ -13406,6 +14875,20 @@ func (e SyncOperationPhase) MarshalGQL(w io.Writer) { fmt.Fprint(w, strconv.Quote(e.String())) } +func (e *SyncOperationPhase) UnmarshalJSON(b []byte) error { + s, err := strconv.Unquote(string(b)) + if err != nil { + return err + } + return e.UnmarshalGQL(s) +} + +func (e SyncOperationPhase) MarshalJSON() ([]byte, error) { + var buf bytes.Buffer + e.MarshalGQL(&buf) + return buf.Bytes(), nil +} + // SyncPhase type SyncPhase string @@ -13439,7 +14922,7 @@ func (e SyncPhase) String() string { return string(e) } -func (e *SyncPhase) UnmarshalGQL(v interface{}) error { +func (e *SyncPhase) UnmarshalGQL(v any) error { str, ok := v.(string) if !ok { return fmt.Errorf("enums must be strings") @@ -13456,6 +14939,20 @@ func (e SyncPhase) MarshalGQL(w io.Writer) { fmt.Fprint(w, strconv.Quote(e.String())) } +func (e *SyncPhase) UnmarshalJSON(b []byte) error { + s, err := strconv.Unquote(string(b)) + if err != nil { + return err + } + return e.UnmarshalGQL(s) +} + +func (e SyncPhase) MarshalJSON() ([]byte, error) { + var buf bytes.Buffer + e.MarshalGQL(&buf) + return buf.Bytes(), nil +} + // SyncResultCode type SyncResultCode string @@ -13492,7 +14989,7 @@ func (e SyncResultCode) String() string { return string(e) } -func (e *SyncResultCode) UnmarshalGQL(v interface{}) error { +func (e *SyncResultCode) UnmarshalGQL(v any) error { str, ok := v.(string) if !ok { return fmt.Errorf("enums must be strings") @@ -13509,6 +15006,20 @@ func (e SyncResultCode) MarshalGQL(w io.Writer) { fmt.Fprint(w, strconv.Quote(e.String())) } +func (e *SyncResultCode) UnmarshalJSON(b []byte) error { + s, err := strconv.Unquote(string(b)) + if err != nil { + return err + } + return e.UnmarshalGQL(s) +} + +func (e SyncResultCode) MarshalJSON() ([]byte, error) { + var buf bytes.Buffer + e.MarshalGQL(&buf) + return buf.Bytes(), nil +} + // Sync status type SyncStatus string @@ -13542,7 +15053,7 @@ func (e SyncStatus) String() string { return string(e) } -func (e *SyncStatus) UnmarshalGQL(v interface{}) error { +func (e *SyncStatus) UnmarshalGQL(v any) error { str, ok := v.(string) if !ok { return fmt.Errorf("enums must be strings") @@ -13559,6 +15070,20 @@ func (e SyncStatus) MarshalGQL(w io.Writer) { fmt.Fprint(w, strconv.Quote(e.String())) } +func (e *SyncStatus) UnmarshalJSON(b []byte) error { + s, err := strconv.Unquote(string(b)) + if err != nil { + return err + } + return e.UnmarshalGQL(s) +} + +func (e SyncStatus) MarshalJSON() ([]byte, error) { + var buf bytes.Buffer + e.MarshalGQL(&buf) + return buf.Bytes(), nil +} + // Types of system type type SystemType string @@ -13588,7 +15113,7 @@ func (e SystemType) String() string { return string(e) } -func (e *SystemType) UnmarshalGQL(v interface{}) error { +func (e *SystemType) UnmarshalGQL(v any) error { str, ok := v.(string) if !ok { return fmt.Errorf("enums must be strings") @@ -13605,6 +15130,20 @@ func (e SystemType) MarshalGQL(w io.Writer) { fmt.Fprint(w, strconv.Quote(e.String())) } +func (e *SystemType) UnmarshalJSON(b []byte) error { + s, err := strconv.Unquote(string(b)) + if err != nil { + return err + } + return e.UnmarshalGQL(s) +} + +func (e SystemType) MarshalJSON() ([]byte, error) { + var buf bytes.Buffer + e.MarshalGQL(&buf) + return buf.Bytes(), nil +} + // Team sources type TeamSource string @@ -13650,7 +15189,7 @@ func (e TeamSource) String() string { return string(e) } -func (e *TeamSource) UnmarshalGQL(v interface{}) error { +func (e *TeamSource) UnmarshalGQL(v any) error { str, ok := v.(string) if !ok { return fmt.Errorf("enums must be strings") @@ -13667,6 +15206,20 @@ func (e TeamSource) MarshalGQL(w io.Writer) { fmt.Fprint(w, strconv.Quote(e.String())) } +func (e *TeamSource) UnmarshalJSON(b []byte) error { + s, err := strconv.Unquote(string(b)) + if err != nil { + return err + } + return e.UnmarshalGQL(s) +} + +func (e TeamSource) MarshalJSON() ([]byte, error) { + var buf bytes.Buffer + e.MarshalGQL(&buf) + return buf.Bytes(), nil +} + // Types of team type TeamType string @@ -13697,7 +15250,7 @@ func (e TeamType) String() string { return string(e) } -func (e *TeamType) UnmarshalGQL(v interface{}) error { +func (e *TeamType) UnmarshalGQL(v any) error { str, ok := v.(string) if !ok { return fmt.Errorf("enums must be strings") @@ -13714,6 +15267,20 @@ func (e TeamType) MarshalGQL(w io.Writer) { fmt.Fprint(w, strconv.Quote(e.String())) } +func (e *TeamType) UnmarshalJSON(b []byte) error { + s, err := strconv.Unquote(string(b)) + if err != nil { + return err + } + return e.UnmarshalGQL(s) +} + +func (e TeamType) MarshalJSON() ([]byte, error) { + var buf bytes.Buffer + e.MarshalGQL(&buf) + return buf.Bytes(), nil +} + // Product Release termination strategy type TerminationStrategy string @@ -13741,7 +15308,7 @@ func (e TerminationStrategy) String() string { return string(e) } -func (e *TerminationStrategy) UnmarshalGQL(v interface{}) error { +func (e *TerminationStrategy) UnmarshalGQL(v any) error { str, ok := v.(string) if !ok { return fmt.Errorf("enums must be strings") @@ -13758,6 +15325,20 @@ func (e TerminationStrategy) MarshalGQL(w io.Writer) { fmt.Fprint(w, strconv.Quote(e.String())) } +func (e *TerminationStrategy) UnmarshalJSON(b []byte) error { + s, err := strconv.Unquote(string(b)) + if err != nil { + return err + } + return e.UnmarshalGQL(s) +} + +func (e TerminationStrategy) MarshalJSON() ([]byte, error) { + var buf bytes.Buffer + e.MarshalGQL(&buf) + return buf.Bytes(), nil +} + // Workflow nodes WorkflowPhases type WorkflowNodePhases string @@ -13800,7 +15381,7 @@ func (e WorkflowNodePhases) String() string { return string(e) } -func (e *WorkflowNodePhases) UnmarshalGQL(v interface{}) error { +func (e *WorkflowNodePhases) UnmarshalGQL(v any) error { str, ok := v.(string) if !ok { return fmt.Errorf("enums must be strings") @@ -13817,6 +15398,20 @@ func (e WorkflowNodePhases) MarshalGQL(w io.Writer) { fmt.Fprint(w, strconv.Quote(e.String())) } +func (e *WorkflowNodePhases) UnmarshalJSON(b []byte) error { + s, err := strconv.Unquote(string(b)) + if err != nil { + return err + } + return e.UnmarshalGQL(s) +} + +func (e WorkflowNodePhases) MarshalJSON() ([]byte, error) { + var buf bytes.Buffer + e.MarshalGQL(&buf) + return buf.Bytes(), nil +} + // Name of the flows that can be the workflow origins type WorkflowOrigins string @@ -13856,7 +15451,7 @@ func (e WorkflowOrigins) String() string { return string(e) } -func (e *WorkflowOrigins) UnmarshalGQL(v interface{}) error { +func (e *WorkflowOrigins) UnmarshalGQL(v any) error { str, ok := v.(string) if !ok { return fmt.Errorf("enums must be strings") @@ -13873,6 +15468,20 @@ func (e WorkflowOrigins) MarshalGQL(w io.Writer) { fmt.Fprint(w, strconv.Quote(e.String())) } +func (e *WorkflowOrigins) UnmarshalJSON(b []byte) error { + s, err := strconv.Unquote(string(b)) + if err != nil { + return err + } + return e.UnmarshalGQL(s) +} + +func (e WorkflowOrigins) MarshalJSON() ([]byte, error) { + var buf bytes.Buffer + e.MarshalGQL(&buf) + return buf.Bytes(), nil +} + // Workflow WorkflowPhases type WorkflowPhases string @@ -13912,7 +15521,7 @@ func (e WorkflowPhases) String() string { return string(e) } -func (e *WorkflowPhases) UnmarshalGQL(v interface{}) error { +func (e *WorkflowPhases) UnmarshalGQL(v any) error { str, ok := v.(string) if !ok { return fmt.Errorf("enums must be strings") @@ -13928,3 +15537,17 @@ func (e *WorkflowPhases) UnmarshalGQL(v interface{}) error { func (e WorkflowPhases) MarshalGQL(w io.Writer) { fmt.Fprint(w, strconv.Quote(e.String())) } + +func (e *WorkflowPhases) UnmarshalJSON(b []byte) error { + s, err := strconv.Unquote(string(b)) + if err != nil { + return err + } + return e.UnmarshalGQL(s) +} + +func (e WorkflowPhases) MarshalJSON() ([]byte, error) { + var buf bytes.Buffer + e.MarshalGQL(&buf) + return buf.Bytes(), nil +} From 819361115bc27f64555811246d2ee61933667d0e Mon Sep 17 00:00:00 2001 From: Kim Date: Thu, 13 Nov 2025 10:58:34 +0200 Subject: [PATCH 2/2] bump --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 8f27adb..57d70ff 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -VERSION=v1.4.12 +VERSION=v1.4.13 ifndef GOBIN ifndef GOPATH