From c4b279a861093148870a130c59dc3a09d469442e Mon Sep 17 00:00:00 2001 From: test Date: Wed, 26 Oct 2022 20:48:31 +0200 Subject: [PATCH] update client --- client.go | 438 +++++++++++++++++++++++++------------------------- models_gen.go | 110 +++++++++++-- 2 files changed, 321 insertions(+), 227 deletions(-) diff --git a/client.go b/client.go index 6ecfc5a..4460d06 100644 --- a/client.go +++ b/client.go @@ -78,6 +78,7 @@ type RootQueryType struct { SearchRepositories *RepositoryConnection "json:\"searchRepositories\" graphql:\"searchRepositories\"" SearchUsers *UserConnection "json:\"searchUsers\" graphql:\"searchUsers\"" Shell *CloudShell "json:\"shell\" graphql:\"shell\"" + ShellConfiguration *ShellConfiguration "json:\"shellConfiguration\" graphql:\"shellConfiguration\"" Stack *Stack "json:\"stack\" graphql:\"stack\"" Stacks *StackConnection "json:\"stacks\" graphql:\"stacks\"" Subscriptions *RepositorySubscriptionConnection "json:\"subscriptions\" graphql:\"subscriptions\"" @@ -140,6 +141,7 @@ type RootMutationType struct { CreateZoom *ZoomMeeting "json:\"createZoom\" graphql:\"createZoom\"" DeleteCard *Account "json:\"deleteCard\" graphql:\"deleteCard\"" DeleteChartInstallation *ChartInstallation "json:\"deleteChartInstallation\" graphql:\"deleteChartInstallation\"" + DeleteDemoProject *DemoProject "json:\"deleteDemoProject\" graphql:\"deleteDemoProject\"" DeleteDNSRecord *DNSRecord "json:\"deleteDnsRecord\" graphql:\"deleteDnsRecord\"" DeleteDomain *DNSDomain "json:\"deleteDomain\" graphql:\"deleteDomain\"" DeleteEabKey *EabCredential "json:\"deleteEabKey\" graphql:\"deleteEabKey\"" @@ -165,6 +167,7 @@ type RootMutationType struct { ExternalToken *string "json:\"externalToken\" graphql:\"externalToken\"" FollowIncident *Follower "json:\"followIncident\" graphql:\"followIncident\"" ImpersonateServiceAccount *User "json:\"impersonateServiceAccount\" graphql:\"impersonateServiceAccount\"" + InstallBundle []*Installation "json:\"installBundle\" graphql:\"installBundle\"" InstallChart *ChartInstallation "json:\"installChart\" graphql:\"installChart\"" InstallRecipe []*Installation "json:\"installRecipe\" graphql:\"installRecipe\"" InstallTerraform *TerraformInstallation "json:\"installTerraform\" graphql:\"installTerraform\"" @@ -210,6 +213,7 @@ type RootMutationType struct { UpdateRepository *Repository "json:\"updateRepository\" graphql:\"updateRepository\"" UpdateRole *Role "json:\"updateRole\" graphql:\"updateRole\"" UpdateServiceAccount *User "json:\"updateServiceAccount\" graphql:\"updateServiceAccount\"" + UpdateShellConfiguration *bool "json:\"updateShellConfiguration\" graphql:\"updateShellConfiguration\"" UpdateStep *TestStep "json:\"updateStep\" graphql:\"updateStep\"" UpdateTerraform *Terraform "json:\"updateTerraform\" graphql:\"updateTerraform\"" UpdateTest *Test "json:\"updateTest\" graphql:\"updateTest\"" @@ -950,6 +954,30 @@ const GetChartInstallationsDocument = `query GetChartInstallations ($id: ID!) { } } } +fragment ChartFragment on Chart { + id + name + description + latestVersion +} +fragment DependenciesFragment on Dependencies { + dependencies { + type + name + repo + } + wait + application + providers + secrets + wirings { + terraform + helm + } + providerWirings + outputs + providerVsn +} fragment VersionFragment on Version { id readme @@ -980,30 +1008,6 @@ fragment ChartInstallationFragment on ChartInstallation { ... VersionFragment } } -fragment ChartFragment on Chart { - id - name - description - latestVersion -} -fragment DependenciesFragment on Dependencies { - dependencies { - type - name - repo - } - wait - application - providers - secrets - wirings { - terraform - helm - } - providerWirings - outputs - providerVsn -} ` func (c *Client) GetChartInstallations(ctx context.Context, id string, httpRequestOptions ...client.HTTPRequestOption) (*GetChartInstallations, error) { @@ -1035,11 +1039,6 @@ const GetPackageInstallationsDocument = `query GetPackageInstallations ($id: ID! } } } -fragment CrdFragment on Crd { - id - name - blob -} fragment TerraformInstallationFragment on TerraformInstallation { id terraform { @@ -1108,6 +1107,11 @@ fragment VersionFragment on Version { ... DependenciesFragment } } +fragment CrdFragment on Crd { + id + name + blob +} ` func (c *Client) GetPackageInstallations(ctx context.Context, id string, httpRequestOptions ...client.HTTPRequestOption) (*GetPackageInstallations, error) { @@ -1277,19 +1281,6 @@ const GetInstallationDocument = `query GetInstallation ($name: String) { ... InstallationFragment } } -fragment InstallationFragment on Installation { - id - context - licenseKey - acmeKeyId - acmeSecret - repository { - ... RepositoryFragment - } - oidcProvider { - ... OIDCProvider - } -} fragment RepositoryFragment on Repository { id name @@ -1327,6 +1318,19 @@ fragment OIDCProvider on OidcProvider { userinfoEndpoint } } +fragment InstallationFragment on Installation { + id + context + licenseKey + acmeKeyId + acmeSecret + repository { + ... RepositoryFragment + } + oidcProvider { + ... OIDCProvider + } +} ` func (c *Client) GetInstallation(ctx context.Context, name *string, httpRequestOptions ...client.HTTPRequestOption) (*GetInstallation, error) { @@ -1529,6 +1533,20 @@ const GetRecipeDocument = `query GetRecipe ($repo: String, $name: String) { } } } +fragment RepositoryFragment on Repository { + id + name + notes + icon + darkIcon + description + publisher { + name + } + recipes { + name + } +} fragment RecipeItemFragment on RecipeItem { id chart { @@ -1637,20 +1655,6 @@ fragment RecipeSectionFragment on RecipeSection { ... RecipeConfigurationFragment } } -fragment RepositoryFragment on Repository { - id - name - notes - icon - darkIcon - description - publisher { - name - } - recipes { - name - } -} ` func (c *Client) GetRecipe(ctx context.Context, repo *string, name *string, httpRequestOptions ...client.HTTPRequestOption) (*GetRecipe, error) { @@ -1676,6 +1680,50 @@ const ListRecipesDocument = `query ListRecipes ($repo: String, $provider: Provid } } } +fragment RecipeSectionFragment on RecipeSection { + index + repository { + ... RepositoryFragment + } + recipeItems { + ... RecipeItemFragment + } + configuration { + ... RecipeConfigurationFragment + } +} +fragment RepositoryFragment on Repository { + id + name + notes + icon + darkIcon + description + publisher { + name + } + recipes { + name + } +} +fragment RecipeItemFragment on RecipeItem { + id + chart { + ... ChartFragment + } + terraform { + ... TerraformFragment + } + configuration { + ... RecipeConfigurationFragment + } +} +fragment ChartFragment on Chart { + id + name + description + latestVersion +} fragment TerraformFragment on Terraform { id name @@ -1754,50 +1802,6 @@ fragment RecipeFragment on Recipe { ... RecipeSectionFragment } } -fragment RecipeSectionFragment on RecipeSection { - index - repository { - ... RepositoryFragment - } - recipeItems { - ... RecipeItemFragment - } - configuration { - ... RecipeConfigurationFragment - } -} -fragment RepositoryFragment on Repository { - id - name - notes - icon - darkIcon - description - publisher { - name - } - recipes { - name - } -} -fragment RecipeItemFragment on RecipeItem { - id - chart { - ... ChartFragment - } - terraform { - ... TerraformFragment - } - configuration { - ... RecipeConfigurationFragment - } -} -fragment ChartFragment on Chart { - id - name - description - latestVersion -} ` func (c *Client) ListRecipes(ctx context.Context, repo *string, provider *Provider, httpRequestOptions ...client.HTTPRequestOption) (*ListRecipes, error) { @@ -1880,47 +1884,38 @@ const GetStackDocument = `query GetStack ($name: String!, $provider: Provider!) ... StackFragment } } -fragment RecipeFragment on Recipe { +fragment ChartFragment on Chart { id name description - restricted - provider - tests { + latestVersion +} +fragment RecipeConfigurationFragment on RecipeConfiguration { + name + type + default + documentation + optional + placeholder + functionName + condition { + field + operation + value + } + validation { type - name + regex message - args { - name - repo - key - } - } - repository { - id - name - } - oidcSettings { - uriFormat - uriFormats - authMethod - domainKey - subdomain - } - recipeSections { - ... RecipeSectionFragment } } -fragment RecipeSectionFragment on RecipeSection { - index - repository { - ... RepositoryFragment - } - recipeItems { - ... RecipeItemFragment - } - configuration { - ... RecipeConfigurationFragment +fragment StackFragment on Stack { + id + name + featured + description + bundles { + ... RecipeFragment } } fragment RepositoryFragment on Repository { @@ -1949,12 +1944,6 @@ fragment RecipeItemFragment on RecipeItem { ... RecipeConfigurationFragment } } -fragment ChartFragment on Chart { - id - name - description - latestVersion -} fragment TerraformFragment on Terraform { id name @@ -1983,32 +1972,47 @@ fragment DependenciesFragment on Dependencies { outputs providerVsn } -fragment StackFragment on Stack { +fragment RecipeFragment on Recipe { id name - featured description - bundles { - ... RecipeFragment + restricted + provider + tests { + type + name + message + args { + name + repo + key + } + } + repository { + id + name + } + oidcSettings { + uriFormat + uriFormats + authMethod + domainKey + subdomain + } + recipeSections { + ... RecipeSectionFragment } } -fragment RecipeConfigurationFragment on RecipeConfiguration { - name - type - default - documentation - optional - placeholder - functionName - condition { - field - operation - value +fragment RecipeSectionFragment on RecipeSection { + index + repository { + ... RepositoryFragment } - validation { - type - regex - message + recipeItems { + ... RecipeItemFragment + } + configuration { + ... RecipeConfigurationFragment } } ` @@ -2036,22 +2040,6 @@ const ListStacksDocument = `query ListStacks ($featured: Boolean, $cursor: Strin } } } -fragment ChartFragment on Chart { - id - name - description - latestVersion -} -fragment TerraformFragment on Terraform { - id - name - package - description - dependencies { - ... DependenciesFragment - } - valuesTemplate -} fragment DependenciesFragment on Dependencies { dependencies { type @@ -2070,20 +2058,6 @@ fragment DependenciesFragment on Dependencies { outputs providerVsn } -fragment RepositoryFragment on Repository { - id - name - notes - icon - darkIcon - description - publisher { - name - } - recipes { - name - } -} fragment RecipeFragment on Recipe { id name @@ -2115,16 +2089,28 @@ fragment RecipeFragment on Recipe { ... RecipeSectionFragment } } -fragment RecipeSectionFragment on RecipeSection { - index - repository { - ... RepositoryFragment +fragment TerraformFragment on Terraform { + id + name + package + description + dependencies { + ... DependenciesFragment } - recipeItems { - ... RecipeItemFragment + valuesTemplate +} +fragment RepositoryFragment on Repository { + id + name + notes + icon + darkIcon + description + publisher { + name } - configuration { - ... RecipeConfigurationFragment + recipes { + name } } fragment RecipeItemFragment on RecipeItem { @@ -2139,6 +2125,12 @@ fragment RecipeItemFragment on RecipeItem { ... RecipeConfigurationFragment } } +fragment ChartFragment on Chart { + id + name + description + latestVersion +} fragment RecipeConfigurationFragment on RecipeConfiguration { name type @@ -2167,6 +2159,18 @@ fragment StackFragment on Stack { ... RecipeFragment } } +fragment RecipeSectionFragment on RecipeSection { + index + repository { + ... RepositoryFragment + } + recipeItems { + ... RecipeItemFragment + } + configuration { + ... RecipeConfigurationFragment + } +} ` func (c *Client) ListStacks(ctx context.Context, featured *bool, cursor *string, httpRequestOptions ...client.HTTPRequestOption) (*ListStacks, error) { @@ -2597,6 +2601,25 @@ const GetTerraformInstallationsDocument = `query GetTerraformInstallations ($id: } } } +fragment TerraformInstallationFragment on TerraformInstallation { + id + terraform { + ... TerraformFragment + } + version { + ... VersionFragment + } +} +fragment TerraformFragment on Terraform { + id + name + package + description + dependencies { + ... DependenciesFragment + } + valuesTemplate +} fragment DependenciesFragment on Dependencies { dependencies { type @@ -2633,25 +2656,6 @@ fragment CrdFragment on Crd { name blob } -fragment TerraformInstallationFragment on TerraformInstallation { - id - terraform { - ... TerraformFragment - } - version { - ... VersionFragment - } -} -fragment TerraformFragment on Terraform { - id - name - package - description - dependencies { - ... DependenciesFragment - } - valuesTemplate -} ` func (c *Client) GetTerraformInstallations(ctx context.Context, id string, httpRequestOptions ...client.HTTPRequestOption) (*GetTerraformInstallations, error) { diff --git a/models_gen.go b/models_gen.go index 2a96768..70383ec 100644 --- a/models_gen.go +++ b/models_gen.go @@ -127,6 +127,14 @@ type AwsShellCredentialsAttributes struct { SecretAccessKey string `json:"secretAccessKey"` } +type AzureShellCredentialsAttributes struct { + ClientID string `json:"clientId"` + ClientSecret string `json:"clientSecret"` + StorageAccount string `json:"storageAccount"` + SubscriptionID string `json:"subscriptionId"` + TenantID string `json:"tenantId"` +} + type BindingAttributes struct { GroupID *string `json:"groupId,omitempty"` ID *string `json:"id,omitempty"` @@ -571,6 +579,13 @@ type GeoMetric struct { Country *string `json:"country"` } +type GitConfiguration struct { + Branch *string `json:"branch"` + Name *string `json:"name"` + Root *string `json:"root"` + URL *string `json:"url"` +} + type Group struct { Description *string `json:"description"` Global *bool `json:"global"` @@ -1008,6 +1023,11 @@ type MetricValue struct { Value *int64 `json:"value"` } +type NetworkConfiguration struct { + PluralDNS *bool `json:"pluralDns"` + Subdomain *string `json:"subdomain"` +} + type Notification struct { Actor User `json:"actor"` ID string `json:"id"` @@ -1149,6 +1169,16 @@ type OidcStepResponse struct { Repository *Repository `json:"repository"` } +type OnboardingChecklist struct { + Dismissed *bool `json:"dismissed"` + Status *OnboardingChecklistState `json:"status"` +} + +type OnboardingChecklistAttributes struct { + Dismissed *bool `json:"dismissed,omitempty"` + Status *OnboardingChecklistState `json:"status,omitempty"` +} + type OuathConfiguration struct { AuthorizationEndpoint *string `json:"authorizationEndpoint"` Issuer *string `json:"issuer"` @@ -1759,9 +1789,16 @@ type ServiceLevelAttributes struct { ResponseTime *int64 `json:"responseTime,omitempty"` } +type ShellConfiguration struct { + ContextConfiguration map[string]interface{} `json:"contextConfiguration"` + Git *GitConfiguration `json:"git"` + Workspace *ShellWorkspace `json:"workspace"` +} + type ShellCredentialsAttributes struct { - Aws *AwsShellCredentialsAttributes `json:"aws,omitempty"` - Gcp *GcpShellCredentialsAttributes `json:"gcp,omitempty"` + Aws *AwsShellCredentialsAttributes `json:"aws,omitempty"` + Azure *AzureShellCredentialsAttributes `json:"azure,omitempty"` + Gcp *GcpShellCredentialsAttributes `json:"gcp,omitempty"` } type ShellStatus struct { @@ -1771,6 +1808,12 @@ type ShellStatus struct { Ready *bool `json:"ready"` } +type ShellWorkspace struct { + BucketPrefix *string `json:"bucketPrefix"` + Cluster *string `json:"cluster"` + Network *NetworkConfiguration `json:"network"` +} + type SlimSubscription struct { ID string `json:"id"` LineItems *SubscriptionLineItems `json:"lineItems"` @@ -2061,6 +2104,7 @@ type User struct { LoginMethod *LoginMethod `json:"loginMethod"` Name string `json:"name"` Onboarding *OnboardingState `json:"onboarding"` + OnboardingChecklist *OnboardingChecklist `json:"onboardingChecklist"` Phone *string `json:"phone"` Provider *Provider `json:"provider"` Publisher *Publisher `json:"publisher"` @@ -2070,14 +2114,15 @@ type User struct { } type UserAttributes struct { - Avatar *string `json:"avatar,omitempty"` - Confirm *string `json:"confirm,omitempty"` - Email *string `json:"email,omitempty"` - LoginMethod *LoginMethod `json:"loginMethod,omitempty"` - Name *string `json:"name,omitempty"` - Onboarding *OnboardingState `json:"onboarding,omitempty"` - Password *string `json:"password,omitempty"` - Roles *RolesAttributes `json:"roles,omitempty"` + Avatar *string `json:"avatar,omitempty"` + Confirm *string `json:"confirm,omitempty"` + Email *string `json:"email,omitempty"` + LoginMethod *LoginMethod `json:"loginMethod,omitempty"` + Name *string `json:"name,omitempty"` + Onboarding *OnboardingState `json:"onboarding,omitempty"` + OnboardingChecklist *OnboardingChecklistAttributes `json:"onboardingChecklist,omitempty"` + Password *string `json:"password,omitempty"` + Roles *RolesAttributes `json:"roles,omitempty"` } type UserConnection struct { @@ -3184,6 +3229,51 @@ func (e OidcAuthMethod) MarshalGQL(w io.Writer) { fmt.Fprint(w, strconv.Quote(e.String())) } +type OnboardingChecklistState string + +const ( + OnboardingChecklistStateConfigured OnboardingChecklistState = "CONFIGURED" + OnboardingChecklistStateConsoleInstalled OnboardingChecklistState = "CONSOLE_INSTALLED" + OnboardingChecklistStateFinished OnboardingChecklistState = "FINISHED" + OnboardingChecklistStateNew OnboardingChecklistState = "NEW" +) + +var AllOnboardingChecklistState = []OnboardingChecklistState{ + OnboardingChecklistStateConfigured, + OnboardingChecklistStateConsoleInstalled, + OnboardingChecklistStateFinished, + OnboardingChecklistStateNew, +} + +func (e OnboardingChecklistState) IsValid() bool { + switch e { + case OnboardingChecklistStateConfigured, OnboardingChecklistStateConsoleInstalled, OnboardingChecklistStateFinished, OnboardingChecklistStateNew: + return true + } + return false +} + +func (e OnboardingChecklistState) String() string { + return string(e) +} + +func (e *OnboardingChecklistState) UnmarshalGQL(v interface{}) error { + str, ok := v.(string) + if !ok { + return fmt.Errorf("enums must be strings") + } + + *e = OnboardingChecklistState(str) + if !e.IsValid() { + return fmt.Errorf("%s is not a valid OnboardingChecklistState", str) + } + return nil +} + +func (e OnboardingChecklistState) MarshalGQL(w io.Writer) { + fmt.Fprint(w, strconv.Quote(e.String())) +} + type OnboardingState string const (