diff --git a/Makefile b/Makefile index 7a21c61e4..8bc153798 100644 --- a/Makefile +++ b/Makefile @@ -24,7 +24,7 @@ core_api_gen: ifeq (, $(shell which oapi-codegen)) go install github.com/deepmap/oapi-codegen/cmd/oapi-codegen@latest endif - oapi-codegen -include-tags=User,Organization,Invite,Workspace,Cluster,Options,Team -generate=types,client -package=astrocore "${CORE_OPENAPI_SPEC}" > ./astro-client-core/api.gen.go + oapi-codegen -include-tags=User,Organization,Invite,Workspace,Cluster,Options,Team,ApiToken -generate=types,client -package=astrocore "${CORE_OPENAPI_SPEC}" > ./astro-client-core/api.gen.go make mock_astro_core test: diff --git a/astro-client-core/api.gen.go b/astro-client-core/api.gen.go index 76cdb7d30..3bf660274 100644 --- a/astro-client-core/api.gen.go +++ b/astro-client-core/api.gen.go @@ -21,6 +21,18 @@ const ( JWTScopes = "JWT.Scopes" ) +// Defines values for ApiTokenType. +const ( + ApiTokenTypeORGANIZATION ApiTokenType = "ORGANIZATION" + ApiTokenTypeWORKSPACE ApiTokenType = "WORKSPACE" +) + +// Defines values for ApiTokenRoleEntityType. +const ( + ApiTokenRoleEntityTypeORGANIZATION ApiTokenRoleEntityType = "ORGANIZATION" + ApiTokenRoleEntityTypeWORKSPACE ApiTokenRoleEntityType = "WORKSPACE" +) + // Defines values for BasicSubjectProfileSubjectType. const ( SERVICEKEY BasicSubjectProfileSubjectType = "SERVICEKEY" @@ -148,6 +160,8 @@ const ( const ( OrganizationProductTierBASIC OrganizationProductTier = "BASIC" OrganizationProductTierBUSINESSCRITICAL OrganizationProductTier = "BUSINESS_CRITICAL" + OrganizationProductTierINTERNAL OrganizationProductTier = "INTERNAL" + OrganizationProductTierPOV OrganizationProductTier = "POV" OrganizationProductTierPREMIUM OrganizationProductTier = "PREMIUM" OrganizationProductTierSTANDARD OrganizationProductTier = "STANDARD" OrganizationProductTierTRIAL OrganizationProductTier = "TRIAL" @@ -317,8 +331,11 @@ const ( const ( BASIC ListOrganizationsParamsProductTier = "BASIC" BUSINESSCRITICAL ListOrganizationsParamsProductTier = "BUSINESS_CRITICAL" + INTERNAL ListOrganizationsParamsProductTier = "INTERNAL" + POV ListOrganizationsParamsProductTier = "POV" PREMIUM ListOrganizationsParamsProductTier = "PREMIUM" STANDARD ListOrganizationsParamsProductTier = "STANDARD" + TRIAL ListOrganizationsParamsProductTier = "TRIAL" ) // Defines values for ListOrganizationsParamsProduct. @@ -348,6 +365,28 @@ const ( ListOrganizationsParamsSortsUpdatedAtDesc ListOrganizationsParamsSorts = "updatedAt:desc" ) +// Defines values for ListOrganizationApiTokensParamsSorts. +const ( + ListOrganizationApiTokensParamsSortsCreatedAtAsc ListOrganizationApiTokensParamsSorts = "createdAt:asc" + ListOrganizationApiTokensParamsSortsCreatedAtDesc ListOrganizationApiTokensParamsSorts = "createdAt:desc" + ListOrganizationApiTokensParamsSortsCreatedByIdAsc ListOrganizationApiTokensParamsSorts = "createdById:asc" + ListOrganizationApiTokensParamsSortsCreatedByIdDesc ListOrganizationApiTokensParamsSorts = "createdById:desc" + ListOrganizationApiTokensParamsSortsDescriptionAsc ListOrganizationApiTokensParamsSorts = "description:asc" + ListOrganizationApiTokensParamsSortsDescriptionDesc ListOrganizationApiTokensParamsSorts = "description:desc" + ListOrganizationApiTokensParamsSortsIdAsc ListOrganizationApiTokensParamsSorts = "id:asc" + ListOrganizationApiTokensParamsSortsIdDesc ListOrganizationApiTokensParamsSorts = "id:desc" + ListOrganizationApiTokensParamsSortsNameAsc ListOrganizationApiTokensParamsSorts = "name:asc" + ListOrganizationApiTokensParamsSortsNameDesc ListOrganizationApiTokensParamsSorts = "name:desc" + ListOrganizationApiTokensParamsSortsShortTokenAsc ListOrganizationApiTokensParamsSorts = "shortToken:asc" + ListOrganizationApiTokensParamsSortsShortTokenDesc ListOrganizationApiTokensParamsSorts = "shortToken:desc" + ListOrganizationApiTokensParamsSortsTokenStartAtAsc ListOrganizationApiTokensParamsSorts = "tokenStartAt:asc" + ListOrganizationApiTokensParamsSortsTokenStartAtDesc ListOrganizationApiTokensParamsSorts = "tokenStartAt:desc" + ListOrganizationApiTokensParamsSortsUpdatedAtAsc ListOrganizationApiTokensParamsSorts = "updatedAt:asc" + ListOrganizationApiTokensParamsSortsUpdatedAtDesc ListOrganizationApiTokensParamsSorts = "updatedAt:desc" + ListOrganizationApiTokensParamsSortsUpdatedByIdAsc ListOrganizationApiTokensParamsSorts = "updatedById:asc" + ListOrganizationApiTokensParamsSortsUpdatedByIdDesc ListOrganizationApiTokensParamsSorts = "updatedById:desc" +) + // Defines values for ListClustersParamsProvider. const ( ListClustersParamsProviderAws ListClustersParamsProvider = "aws" @@ -407,6 +446,12 @@ const ( ListClustersParamsSortsVpcSubnetRangeDesc ListClustersParamsSorts = "vpcSubnetRange:desc" ) +// Defines values for GetMetronomeDashboardParamsType. +const ( + Invoices GetMetronomeDashboardParamsType = "invoices" + Usage GetMetronomeDashboardParamsType = "usage" +) + // Defines values for GetStripeClientSecretParamsType. const ( SetupIntent GetStripeClientSecretParamsType = "setup-intent" @@ -464,6 +509,28 @@ const ( ListWorkspacesParamsSortsUpdatedAtDesc ListWorkspacesParamsSorts = "updatedAt:desc" ) +// Defines values for ListWorkspaceApiTokensParamsSorts. +const ( + ListWorkspaceApiTokensParamsSortsCreatedAtAsc ListWorkspaceApiTokensParamsSorts = "createdAt:asc" + ListWorkspaceApiTokensParamsSortsCreatedAtDesc ListWorkspaceApiTokensParamsSorts = "createdAt:desc" + ListWorkspaceApiTokensParamsSortsCreatedByIdAsc ListWorkspaceApiTokensParamsSorts = "createdById:asc" + ListWorkspaceApiTokensParamsSortsCreatedByIdDesc ListWorkspaceApiTokensParamsSorts = "createdById:desc" + ListWorkspaceApiTokensParamsSortsDescriptionAsc ListWorkspaceApiTokensParamsSorts = "description:asc" + ListWorkspaceApiTokensParamsSortsDescriptionDesc ListWorkspaceApiTokensParamsSorts = "description:desc" + ListWorkspaceApiTokensParamsSortsIdAsc ListWorkspaceApiTokensParamsSorts = "id:asc" + ListWorkspaceApiTokensParamsSortsIdDesc ListWorkspaceApiTokensParamsSorts = "id:desc" + ListWorkspaceApiTokensParamsSortsNameAsc ListWorkspaceApiTokensParamsSorts = "name:asc" + ListWorkspaceApiTokensParamsSortsNameDesc ListWorkspaceApiTokensParamsSorts = "name:desc" + ListWorkspaceApiTokensParamsSortsShortTokenAsc ListWorkspaceApiTokensParamsSorts = "shortToken:asc" + ListWorkspaceApiTokensParamsSortsShortTokenDesc ListWorkspaceApiTokensParamsSorts = "shortToken:desc" + ListWorkspaceApiTokensParamsSortsTokenStartAtAsc ListWorkspaceApiTokensParamsSorts = "tokenStartAt:asc" + ListWorkspaceApiTokensParamsSortsTokenStartAtDesc ListWorkspaceApiTokensParamsSorts = "tokenStartAt:desc" + ListWorkspaceApiTokensParamsSortsUpdatedAtAsc ListWorkspaceApiTokensParamsSorts = "updatedAt:asc" + ListWorkspaceApiTokensParamsSortsUpdatedAtDesc ListWorkspaceApiTokensParamsSorts = "updatedAt:desc" + ListWorkspaceApiTokensParamsSortsUpdatedByIdAsc ListWorkspaceApiTokensParamsSorts = "updatedById:asc" + ListWorkspaceApiTokensParamsSortsUpdatedByIdDesc ListWorkspaceApiTokensParamsSorts = "updatedById:desc" +) + // Defines values for ListWorkspaceTeamsParamsSorts. const ( ListWorkspaceTeamsParamsSortsCreatedAtAsc ListWorkspaceTeamsParamsSorts = "createdAt:asc" @@ -513,6 +580,47 @@ type Address struct { State string `json:"state"` } +// ApiToken defines model for ApiToken. +type ApiToken struct { + CreatedAt time.Time `json:"createdAt"` + CreatedBy *BasicSubjectProfile `json:"createdBy,omitempty"` + CreatedById string `json:"createdById"` + DeletedAt *time.Time `json:"deletedAt,omitempty"` + Description string `json:"description"` + EndAt *time.Time `json:"endAt,omitempty"` + ExpiryPeriodInDays int `json:"expiryPeriodInDays"` + Id string `json:"id"` + LastUsedAt *time.Time `json:"lastUsedAt,omitempty"` + Name string `json:"name"` + Roles []ApiTokenRole `json:"roles"` + ShortToken string `json:"shortToken"` + StartAt time.Time `json:"startAt"` + Token *string `json:"token,omitempty"` + Type ApiTokenType `json:"type"` + UpdatedAt time.Time `json:"updatedAt"` + UpdatedBy *BasicSubjectProfile `json:"updatedBy,omitempty"` + UpdatedById string `json:"updatedById"` +} + +// ApiTokenType defines model for ApiToken.Type. +type ApiTokenType string + +// ApiTokenRole defines model for ApiTokenRole. +type ApiTokenRole struct { + EntityId string `json:"entityId"` + EntityType ApiTokenRoleEntityType `json:"entityType"` + Role string `json:"role"` +} + +// ApiTokenRoleEntityType defines model for ApiTokenRole.EntityType. +type ApiTokenRoleEntityType string + +// ApiTokenWorkspaceRole defines model for ApiTokenWorkspaceRole. +type ApiTokenWorkspaceRole struct { + EntityId string `json:"entityId"` + Role string `json:"role"` +} + // AstroBaseUnit defines model for AstroBaseUnit. type AstroBaseUnit struct { Cpu int `json:"cpu"` @@ -528,11 +636,12 @@ type AuConfigs struct { // BasicSubjectProfile defines model for BasicSubjectProfile. type BasicSubjectProfile struct { - AvatarUrl *string `json:"avatarUrl,omitempty"` - FullName *string `json:"fullName,omitempty"` - Id string `json:"id"` - SubjectType *BasicSubjectProfileSubjectType `json:"subjectType,omitempty"` - Username *string `json:"username,omitempty"` + ApiTokenName *string `json:"apiTokenName,omitempty"` + AvatarUrl *string `json:"avatarUrl,omitempty"` + FullName *string `json:"fullName,omitempty"` + Id string `json:"id"` + SubjectType *BasicSubjectProfileSubjectType `json:"subjectType,omitempty"` + Username *string `json:"username,omitempty"` } // BasicSubjectProfileSubjectType defines model for BasicSubjectProfile.SubjectType. @@ -745,6 +854,14 @@ type CreateNodePoolRequest struct { NodeInstanceType string `json:"nodeInstanceType"` } +// CreateOrganizationApiTokenRequest defines model for CreateOrganizationApiTokenRequest. +type CreateOrganizationApiTokenRequest struct { + Description *string `json:"description,omitempty"` + Name string `json:"name"` + Role string `json:"role"` + TokenExpiryPeriodInDays *int `json:"tokenExpiryPeriodInDays,omitempty"` +} + // CreateOrganizationRequest defines model for CreateOrganizationRequest. type CreateOrganizationRequest struct { Metadata *map[string]interface{} `json:"metadata,omitempty"` @@ -773,6 +890,20 @@ type CreateUserInviteRequest struct { Role string `json:"role"` } +// CreateWorkspaceApiTokenRequest defines model for CreateWorkspaceApiTokenRequest. +type CreateWorkspaceApiTokenRequest struct { + Description *string `json:"description,omitempty"` + Name string `json:"name"` + Role string `json:"role"` + TokenExpiryPeriodInDays *int `json:"tokenExpiryPeriodInDays,omitempty"` +} + +// CreditSummary defines model for CreditSummary. +type CreditSummary struct { + TotalCreditsGrantedUSD float32 `json:"totalCreditsGrantedUSD"` + TotalCreditsRemainingUSD float32 `json:"totalCreditsRemainingUSD"` +} + // CreditType defines model for CreditType. type CreditType struct { Id string `json:"id"` @@ -955,6 +1086,14 @@ type JitPolicy struct { DefaultWorkspaceRoles *[]WorkspaceRole `json:"defaultWorkspaceRoles,omitempty"` } +// ListApiTokensPaginated defines model for ListApiTokensPaginated. +type ListApiTokensPaginated struct { + ApiTokens []ApiToken `json:"apiTokens"` + Limit int `json:"limit"` + Offset int `json:"offset"` + TotalCount int `json:"totalCount"` +} + // ListWorkspaceDags defines model for ListWorkspaceDags. type ListWorkspaceDags struct { Items []WorkspaceDag `json:"items"` @@ -978,6 +1117,11 @@ type ManagedDomain struct { // ManagedDomainStatus defines model for ManagedDomain.Status. type ManagedDomainStatus string +// MetronomeDashboard defines model for MetronomeDashboard. +type MetronomeDashboard struct { + Url string `json:"url"` +} + // MutateOrgUserRoleRequest defines model for MutateOrgUserRoleRequest. type MutateOrgUserRoleRequest struct { Role string `json:"role"` @@ -1457,6 +1601,19 @@ type UpdateNodePoolRequest struct { NodeInstanceType string `json:"nodeInstanceType"` } +// UpdateOrganizationApiTokenRequest defines model for UpdateOrganizationApiTokenRequest. +type UpdateOrganizationApiTokenRequest struct { + Description string `json:"description"` + Name string `json:"name"` + Roles UpdateOrganizationApiTokenRoles `json:"roles"` +} + +// UpdateOrganizationApiTokenRoles defines model for UpdateOrganizationApiTokenRoles. +type UpdateOrganizationApiTokenRoles struct { + Organization string `json:"organization"` + Workspace *[]ApiTokenWorkspaceRole `json:"workspace,omitempty"` +} + // UpdateOrganizationRequest defines model for UpdateOrganizationRequest. type UpdateOrganizationRequest struct { BillingEmail *string `json:"billingEmail,omitempty"` @@ -1480,6 +1637,13 @@ type UpdateTeamRequest struct { Name string `json:"name"` } +// UpdateWorkspaceApiTokenRequest defines model for UpdateWorkspaceApiTokenRequest. +type UpdateWorkspaceApiTokenRequest struct { + Description string `json:"description"` + Name string `json:"name"` + Role string `json:"role"` +} + // User defines model for User. type User struct { AvatarUrl string `json:"avatarUrl"` @@ -1673,7 +1837,7 @@ type ListOrganizationsParams struct { // TrialStatus filter by trial status, null for all orgs TrialStatus *ListOrganizationsParamsTrialStatus `form:"trialStatus,omitempty" json:"trialStatus,omitempty"` - // ProductTier filter by product tier, null for all orgs + // ProductTier filter by product tier, should be one of INTERNAL, POV, TRIAL, BASIC, STANDARD, PREMIUM, BUSINESS_CRITICAL, or null for all orgs ProductTier *ListOrganizationsParamsProductTier `form:"productTier,omitempty" json:"productTier,omitempty"` // Product filter by product, null for all orgs @@ -1701,6 +1865,21 @@ type GetOrganizationParams struct { IsLookUpOnly *bool `form:"isLookUpOnly,omitempty" json:"isLookUpOnly,omitempty"` } +// ListOrganizationApiTokensParams defines parameters for ListOrganizationApiTokens. +type ListOrganizationApiTokensParams struct { + // Offset Offset for pagination + Offset *int `form:"offset,omitempty" json:"offset,omitempty"` + + // Limit Limit for pagination + Limit *int `form:"limit,omitempty" json:"limit,omitempty"` + + // Sorts Sorting criteria, each criterion should conform to format 'fieldName:asc' or 'fieldName:desc' + Sorts *[]ListOrganizationApiTokensParamsSorts `form:"sorts,omitempty" json:"sorts,omitempty"` +} + +// ListOrganizationApiTokensParamsSorts defines parameters for ListOrganizationApiTokens. +type ListOrganizationApiTokensParamsSorts string + // GetOrganizationAuditLogsParams defines parameters for GetOrganizationAuditLogs. type GetOrganizationAuditLogsParams struct { // Earliest starting point in days for audit logs @@ -1743,6 +1922,18 @@ type ListClustersParamsStatus string // ListClustersParamsSorts defines parameters for ListClusters. type ListClustersParamsSorts string +// GetMetronomeDashboardParams defines parameters for GetMetronomeDashboard. +type GetMetronomeDashboardParams struct { + // ShowZeroUsageLineItems optional flag to show zero usage line items for invoice dashboards + ShowZeroUsageLineItems *bool `form:"showZeroUsageLineItems,omitempty" json:"showZeroUsageLineItems,omitempty"` + + // ColorOverrides optional list of colors ('gray_dark', 'gray_medium', 'gray_light', 'gray_extralight', 'white', 'primary_medium', or 'primary_light') to override in the format 'color:#hex-color-value' Eg. 'gray_dark:#ff0000' + ColorOverrides *[]string `form:"colorOverrides,omitempty" json:"colorOverrides,omitempty"` +} + +// GetMetronomeDashboardParamsType defines parameters for GetMetronomeDashboard. +type GetMetronomeDashboardParamsType string + // GetStripeClientSecretParamsType defines parameters for GetStripeClientSecret. type GetStripeClientSecretParamsType string @@ -1806,6 +1997,21 @@ type ListWorkspacesParams struct { // ListWorkspacesParamsSorts defines parameters for ListWorkspaces. type ListWorkspacesParamsSorts string +// ListWorkspaceApiTokensParams defines parameters for ListWorkspaceApiTokens. +type ListWorkspaceApiTokensParams struct { + // Offset Offset for pagination + Offset *int `form:"offset,omitempty" json:"offset,omitempty"` + + // Limit Limit for pagination + Limit *int `form:"limit,omitempty" json:"limit,omitempty"` + + // Sorts Sorting criteria, each criterion should conform to format 'fieldName:asc' or 'fieldName:desc' + Sorts *[]ListWorkspaceApiTokensParamsSorts `form:"sorts,omitempty" json:"sorts,omitempty"` +} + +// ListWorkspaceApiTokensParamsSorts defines parameters for ListWorkspaceApiTokens. +type ListWorkspaceApiTokensParamsSorts string + // ListWorkspaceDagsParams defines parameters for ListWorkspaceDags. type ListWorkspaceDagsParams struct { // PageSize page size, default of 20 @@ -1902,6 +2108,12 @@ type CreateOrganizationJSONRequestBody = CreateOrganizationRequest // UpdateOrganizationJSONRequestBody defines body for UpdateOrganization for application/json ContentType. type UpdateOrganizationJSONRequestBody = UpdateOrganizationRequest +// CreateOrganizationApiTokenJSONRequestBody defines body for CreateOrganizationApiToken for application/json ContentType. +type CreateOrganizationApiTokenJSONRequestBody = CreateOrganizationApiTokenRequest + +// UpdateOrganizationApiTokenJSONRequestBody defines body for UpdateOrganizationApiToken for application/json ContentType. +type UpdateOrganizationApiTokenJSONRequestBody = UpdateOrganizationApiTokenRequest + // CreateAwsClusterJSONRequestBody defines body for CreateAwsCluster for application/json ContentType. type CreateAwsClusterJSONRequestBody = CreateAwsClusterRequest @@ -1956,6 +2168,12 @@ type CreateWorkspaceJSONRequestBody = MutateWorkspaceRequest // UpdateWorkspaceJSONRequestBody defines body for UpdateWorkspace for application/json ContentType. type UpdateWorkspaceJSONRequestBody = MutateWorkspaceRequest +// CreateWorkspaceApiTokenJSONRequestBody defines body for CreateWorkspaceApiToken for application/json ContentType. +type CreateWorkspaceApiTokenJSONRequestBody = CreateWorkspaceApiTokenRequest + +// UpdateWorkspaceApiTokenJSONRequestBody defines body for UpdateWorkspaceApiToken for application/json ContentType. +type UpdateWorkspaceApiTokenJSONRequestBody = UpdateWorkspaceApiTokenRequest + // MutateWorkspaceTeamRoleJSONRequestBody defines body for MutateWorkspaceTeamRole for application/json ContentType. type MutateWorkspaceTeamRoleJSONRequestBody = MutateWorkspaceTeamRoleRequest @@ -2074,6 +2292,28 @@ type ClientInterface interface { UpdateOrganization(ctx context.Context, orgShortNameId string, body UpdateOrganizationJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + // ListOrganizationApiTokens request + ListOrganizationApiTokens(ctx context.Context, orgShortNameId string, params *ListOrganizationApiTokensParams, reqEditors ...RequestEditorFn) (*http.Response, error) + + // CreateOrganizationApiToken request with any body + CreateOrganizationApiTokenWithBody(ctx context.Context, orgShortNameId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + CreateOrganizationApiToken(ctx context.Context, orgShortNameId string, body CreateOrganizationApiTokenJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // DeleteOrganizationApiToken request + DeleteOrganizationApiToken(ctx context.Context, orgShortNameId string, apiTokenId string, reqEditors ...RequestEditorFn) (*http.Response, error) + + // GetOrganizationApiToken request + GetOrganizationApiToken(ctx context.Context, orgShortNameId string, apiTokenId string, reqEditors ...RequestEditorFn) (*http.Response, error) + + // UpdateOrganizationApiToken request with any body + UpdateOrganizationApiTokenWithBody(ctx context.Context, orgShortNameId string, apiTokenId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + UpdateOrganizationApiToken(ctx context.Context, orgShortNameId string, apiTokenId string, body UpdateOrganizationApiTokenJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // RotateOrganizationApiToken request + RotateOrganizationApiToken(ctx context.Context, orgShortNameId string, apiTokenId string, reqEditors ...RequestEditorFn) (*http.Response, error) + // GetOrganizationAuditLogs request GetOrganizationAuditLogs(ctx context.Context, orgShortNameId string, params *GetOrganizationAuditLogsParams, reqEditors ...RequestEditorFn) (*http.Response, error) @@ -2149,6 +2389,12 @@ type ClientInterface interface { // DeleteUserInvite request DeleteUserInvite(ctx context.Context, orgShortNameId string, inviteId string, reqEditors ...RequestEditorFn) (*http.Response, error) + // GetCreditSummary request + GetCreditSummary(ctx context.Context, orgShortNameId string, reqEditors ...RequestEditorFn) (*http.Response, error) + + // GetMetronomeDashboard request + GetMetronomeDashboard(ctx context.Context, orgShortNameId string, pType GetMetronomeDashboardParamsType, params *GetMetronomeDashboardParams, reqEditors ...RequestEditorFn) (*http.Response, error) + // GetPaymentMethod request GetPaymentMethod(ctx context.Context, orgShortNameId string, reqEditors ...RequestEditorFn) (*http.Response, error) @@ -2248,6 +2494,28 @@ type ClientInterface interface { UpdateWorkspace(ctx context.Context, orgShortNameId string, workspaceId string, body UpdateWorkspaceJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + // ListWorkspaceApiTokens request + ListWorkspaceApiTokens(ctx context.Context, orgShortNameId string, workspaceId string, params *ListWorkspaceApiTokensParams, reqEditors ...RequestEditorFn) (*http.Response, error) + + // CreateWorkspaceApiToken request with any body + CreateWorkspaceApiTokenWithBody(ctx context.Context, orgShortNameId string, workspaceId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + CreateWorkspaceApiToken(ctx context.Context, orgShortNameId string, workspaceId string, body CreateWorkspaceApiTokenJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // DeleteWorkspaceApiToken request + DeleteWorkspaceApiToken(ctx context.Context, orgShortNameId string, workspaceId string, apiTokenId string, reqEditors ...RequestEditorFn) (*http.Response, error) + + // GetWorkspaceApiToken request + GetWorkspaceApiToken(ctx context.Context, orgShortNameId string, workspaceId string, apiTokenId string, reqEditors ...RequestEditorFn) (*http.Response, error) + + // UpdateWorkspaceApiToken request with any body + UpdateWorkspaceApiTokenWithBody(ctx context.Context, orgShortNameId string, workspaceId string, apiTokenId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + UpdateWorkspaceApiToken(ctx context.Context, orgShortNameId string, workspaceId string, apiTokenId string, body UpdateWorkspaceApiTokenJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // RotateWorkspaceApiToken request + RotateWorkspaceApiToken(ctx context.Context, orgShortNameId string, workspaceId string, apiTokenId string, reqEditors ...RequestEditorFn) (*http.Response, error) + // ListWorkspaceDagFilters request ListWorkspaceDagFilters(ctx context.Context, orgShortNameId string, workspaceId string, reqEditors ...RequestEditorFn) (*http.Response, error) @@ -2441,6 +2709,102 @@ func (c *Client) UpdateOrganization(ctx context.Context, orgShortNameId string, return c.Client.Do(req) } +func (c *Client) ListOrganizationApiTokens(ctx context.Context, orgShortNameId string, params *ListOrganizationApiTokensParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewListOrganizationApiTokensRequest(c.Server, orgShortNameId, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) CreateOrganizationApiTokenWithBody(ctx context.Context, orgShortNameId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewCreateOrganizationApiTokenRequestWithBody(c.Server, orgShortNameId, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) CreateOrganizationApiToken(ctx context.Context, orgShortNameId string, body CreateOrganizationApiTokenJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewCreateOrganizationApiTokenRequest(c.Server, orgShortNameId, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) DeleteOrganizationApiToken(ctx context.Context, orgShortNameId string, apiTokenId string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewDeleteOrganizationApiTokenRequest(c.Server, orgShortNameId, apiTokenId) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) GetOrganizationApiToken(ctx context.Context, orgShortNameId string, apiTokenId string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetOrganizationApiTokenRequest(c.Server, orgShortNameId, apiTokenId) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) UpdateOrganizationApiTokenWithBody(ctx context.Context, orgShortNameId string, apiTokenId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewUpdateOrganizationApiTokenRequestWithBody(c.Server, orgShortNameId, apiTokenId, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) UpdateOrganizationApiToken(ctx context.Context, orgShortNameId string, apiTokenId string, body UpdateOrganizationApiTokenJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewUpdateOrganizationApiTokenRequest(c.Server, orgShortNameId, apiTokenId, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) RotateOrganizationApiToken(ctx context.Context, orgShortNameId string, apiTokenId string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewRotateOrganizationApiTokenRequest(c.Server, orgShortNameId, apiTokenId) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + func (c *Client) GetOrganizationAuditLogs(ctx context.Context, orgShortNameId string, params *GetOrganizationAuditLogsParams, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewGetOrganizationAuditLogsRequest(c.Server, orgShortNameId, params) if err != nil { @@ -2777,6 +3141,30 @@ func (c *Client) DeleteUserInvite(ctx context.Context, orgShortNameId string, in return c.Client.Do(req) } +func (c *Client) GetCreditSummary(ctx context.Context, orgShortNameId string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetCreditSummaryRequest(c.Server, orgShortNameId) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) GetMetronomeDashboard(ctx context.Context, orgShortNameId string, pType GetMetronomeDashboardParamsType, params *GetMetronomeDashboardParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetMetronomeDashboardRequest(c.Server, orgShortNameId, pType, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + func (c *Client) GetPaymentMethod(ctx context.Context, orgShortNameId string, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewGetPaymentMethodRequest(c.Server, orgShortNameId) if err != nil { @@ -3209,6 +3597,102 @@ func (c *Client) UpdateWorkspace(ctx context.Context, orgShortNameId string, wor return c.Client.Do(req) } +func (c *Client) ListWorkspaceApiTokens(ctx context.Context, orgShortNameId string, workspaceId string, params *ListWorkspaceApiTokensParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewListWorkspaceApiTokensRequest(c.Server, orgShortNameId, workspaceId, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) CreateWorkspaceApiTokenWithBody(ctx context.Context, orgShortNameId string, workspaceId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewCreateWorkspaceApiTokenRequestWithBody(c.Server, orgShortNameId, workspaceId, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) CreateWorkspaceApiToken(ctx context.Context, orgShortNameId string, workspaceId string, body CreateWorkspaceApiTokenJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewCreateWorkspaceApiTokenRequest(c.Server, orgShortNameId, workspaceId, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) DeleteWorkspaceApiToken(ctx context.Context, orgShortNameId string, workspaceId string, apiTokenId string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewDeleteWorkspaceApiTokenRequest(c.Server, orgShortNameId, workspaceId, apiTokenId) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) GetWorkspaceApiToken(ctx context.Context, orgShortNameId string, workspaceId string, apiTokenId string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetWorkspaceApiTokenRequest(c.Server, orgShortNameId, workspaceId, apiTokenId) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) UpdateWorkspaceApiTokenWithBody(ctx context.Context, orgShortNameId string, workspaceId string, apiTokenId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewUpdateWorkspaceApiTokenRequestWithBody(c.Server, orgShortNameId, workspaceId, apiTokenId, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) UpdateWorkspaceApiToken(ctx context.Context, orgShortNameId string, workspaceId string, apiTokenId string, body UpdateWorkspaceApiTokenJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewUpdateWorkspaceApiTokenRequest(c.Server, orgShortNameId, workspaceId, apiTokenId, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) RotateWorkspaceApiToken(ctx context.Context, orgShortNameId string, workspaceId string, apiTokenId string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewRotateWorkspaceApiTokenRequest(c.Server, orgShortNameId, workspaceId, apiTokenId) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + func (c *Client) ListWorkspaceDagFilters(ctx context.Context, orgShortNameId string, workspaceId string, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewListWorkspaceDagFiltersRequest(c.Server, orgShortNameId, workspaceId) if err != nil { @@ -3875,62 +4359,8 @@ func NewUpdateOrganizationRequestWithBody(server string, orgShortNameId string, return req, nil } -// NewGetOrganizationAuditLogsRequest generates requests for GetOrganizationAuditLogs -func NewGetOrganizationAuditLogsRequest(server string, orgShortNameId string, params *GetOrganizationAuditLogsParams) (*http.Request, error) { - var err error - - var pathParam0 string - - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "orgShortNameId", runtime.ParamLocationPath, orgShortNameId) - if err != nil { - return nil, err - } - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/organizations/%s/audit-logs", pathParam0) - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - queryValues := queryURL.Query() - - if params.Earliest != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "earliest", runtime.ParamLocationQuery, *params.Earliest); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - - queryURL.RawQuery = queryValues.Encode() - - req, err := http.NewRequest("GET", queryURL.String(), nil) - if err != nil { - return nil, err - } - - return req, nil -} - -// NewListClustersRequest generates requests for ListClusters -func NewListClustersRequest(server string, orgShortNameId string, params *ListClustersParams) (*http.Request, error) { +// NewListOrganizationApiTokensRequest generates requests for ListOrganizationApiTokens +func NewListOrganizationApiTokensRequest(server string, orgShortNameId string, params *ListOrganizationApiTokensParams) (*http.Request, error) { var err error var pathParam0 string @@ -3945,7 +4375,7 @@ func NewListClustersRequest(server string, orgShortNameId string, params *ListCl return nil, err } - operationPath := fmt.Sprintf("/organizations/%s/clusters", pathParam0) + operationPath := fmt.Sprintf("/organizations/%s/api-tokens", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -3957,70 +4387,6 @@ func NewListClustersRequest(server string, orgShortNameId string, params *ListCl queryValues := queryURL.Query() - if params.Provider != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "provider", runtime.ParamLocationQuery, *params.Provider); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - - if params.Type != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "type", runtime.ParamLocationQuery, *params.Type); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - - if params.Status != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "status", runtime.ParamLocationQuery, *params.Status); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - - if params.Search != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "search", runtime.ParamLocationQuery, *params.Search); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - if params.Offset != nil { if queryFrag, err := runtime.StyleParamWithLocation("form", true, "offset", runtime.ParamLocationQuery, *params.Offset); err != nil { @@ -4079,19 +4445,19 @@ func NewListClustersRequest(server string, orgShortNameId string, params *ListCl return req, nil } -// NewCreateAwsClusterRequest calls the generic CreateAwsCluster builder with application/json body -func NewCreateAwsClusterRequest(server string, orgShortNameId string, body CreateAwsClusterJSONRequestBody) (*http.Request, error) { +// NewCreateOrganizationApiTokenRequest calls the generic CreateOrganizationApiToken builder with application/json body +func NewCreateOrganizationApiTokenRequest(server string, orgShortNameId string, body CreateOrganizationApiTokenJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) - return NewCreateAwsClusterRequestWithBody(server, orgShortNameId, "application/json", bodyReader) + return NewCreateOrganizationApiTokenRequestWithBody(server, orgShortNameId, "application/json", bodyReader) } -// NewCreateAwsClusterRequestWithBody generates requests for CreateAwsCluster with any type of body -func NewCreateAwsClusterRequestWithBody(server string, orgShortNameId string, contentType string, body io.Reader) (*http.Request, error) { +// NewCreateOrganizationApiTokenRequestWithBody generates requests for CreateOrganizationApiToken with any type of body +func NewCreateOrganizationApiTokenRequestWithBody(server string, orgShortNameId string, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string @@ -4106,7 +4472,7 @@ func NewCreateAwsClusterRequestWithBody(server string, orgShortNameId string, co return nil, err } - operationPath := fmt.Sprintf("/organizations/%s/clusters/aws", pathParam0) + operationPath := fmt.Sprintf("/organizations/%s/api-tokens", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -4126,19 +4492,8 @@ func NewCreateAwsClusterRequestWithBody(server string, orgShortNameId string, co return req, nil } -// NewUpdateAwsClusterRequest calls the generic UpdateAwsCluster builder with application/json body -func NewUpdateAwsClusterRequest(server string, orgShortNameId string, clusterId string, body UpdateAwsClusterJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) - if err != nil { - return nil, err - } - bodyReader = bytes.NewReader(buf) - return NewUpdateAwsClusterRequestWithBody(server, orgShortNameId, clusterId, "application/json", bodyReader) -} - -// NewUpdateAwsClusterRequestWithBody generates requests for UpdateAwsCluster with any type of body -func NewUpdateAwsClusterRequestWithBody(server string, orgShortNameId string, clusterId string, contentType string, body io.Reader) (*http.Request, error) { +// NewDeleteOrganizationApiTokenRequest generates requests for DeleteOrganizationApiToken +func NewDeleteOrganizationApiTokenRequest(server string, orgShortNameId string, apiTokenId string) (*http.Request, error) { var err error var pathParam0 string @@ -4150,7 +4505,7 @@ func NewUpdateAwsClusterRequestWithBody(server string, orgShortNameId string, cl var pathParam1 string - pathParam1, err = runtime.StyleParamWithLocation("simple", false, "clusterId", runtime.ParamLocationPath, clusterId) + pathParam1, err = runtime.StyleParamWithLocation("simple", false, "apiTokenId", runtime.ParamLocationPath, apiTokenId) if err != nil { return nil, err } @@ -4160,7 +4515,7 @@ func NewUpdateAwsClusterRequestWithBody(server string, orgShortNameId string, cl return nil, err } - operationPath := fmt.Sprintf("/organizations/%s/clusters/aws/%s", pathParam0, pathParam1) + operationPath := fmt.Sprintf("/organizations/%s/api-tokens/%s", pathParam0, pathParam1) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -4170,29 +4525,16 @@ func NewUpdateAwsClusterRequestWithBody(server string, orgShortNameId string, cl return nil, err } - req, err := http.NewRequest("POST", queryURL.String(), body) + req, err := http.NewRequest("DELETE", queryURL.String(), nil) if err != nil { return nil, err } - req.Header.Add("Content-Type", contentType) - return req, nil } -// NewCreateAzureClusterRequest calls the generic CreateAzureCluster builder with application/json body -func NewCreateAzureClusterRequest(server string, orgShortNameId string, body CreateAzureClusterJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) - if err != nil { - return nil, err - } - bodyReader = bytes.NewReader(buf) - return NewCreateAzureClusterRequestWithBody(server, orgShortNameId, "application/json", bodyReader) -} - -// NewCreateAzureClusterRequestWithBody generates requests for CreateAzureCluster with any type of body -func NewCreateAzureClusterRequestWithBody(server string, orgShortNameId string, contentType string, body io.Reader) (*http.Request, error) { +// NewGetOrganizationApiTokenRequest generates requests for GetOrganizationApiToken +func NewGetOrganizationApiTokenRequest(server string, orgShortNameId string, apiTokenId string) (*http.Request, error) { var err error var pathParam0 string @@ -4202,12 +4544,19 @@ func NewCreateAzureClusterRequestWithBody(server string, orgShortNameId string, return nil, err } + var pathParam1 string + + pathParam1, err = runtime.StyleParamWithLocation("simple", false, "apiTokenId", runtime.ParamLocationPath, apiTokenId) + if err != nil { + return nil, err + } + serverURL, err := url.Parse(server) if err != nil { return nil, err } - operationPath := fmt.Sprintf("/organizations/%s/clusters/azure", pathParam0) + operationPath := fmt.Sprintf("/organizations/%s/api-tokens/%s", pathParam0, pathParam1) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -4217,29 +4566,27 @@ func NewCreateAzureClusterRequestWithBody(server string, orgShortNameId string, return nil, err } - req, err := http.NewRequest("POST", queryURL.String(), body) + req, err := http.NewRequest("GET", queryURL.String(), nil) if err != nil { return nil, err } - req.Header.Add("Content-Type", contentType) - return req, nil } -// NewUpdateAzureClusterRequest calls the generic UpdateAzureCluster builder with application/json body -func NewUpdateAzureClusterRequest(server string, orgShortNameId string, clusterId string, body UpdateAzureClusterJSONRequestBody) (*http.Request, error) { +// NewUpdateOrganizationApiTokenRequest calls the generic UpdateOrganizationApiToken builder with application/json body +func NewUpdateOrganizationApiTokenRequest(server string, orgShortNameId string, apiTokenId string, body UpdateOrganizationApiTokenJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) - return NewUpdateAzureClusterRequestWithBody(server, orgShortNameId, clusterId, "application/json", bodyReader) + return NewUpdateOrganizationApiTokenRequestWithBody(server, orgShortNameId, apiTokenId, "application/json", bodyReader) } -// NewUpdateAzureClusterRequestWithBody generates requests for UpdateAzureCluster with any type of body -func NewUpdateAzureClusterRequestWithBody(server string, orgShortNameId string, clusterId string, contentType string, body io.Reader) (*http.Request, error) { +// NewUpdateOrganizationApiTokenRequestWithBody generates requests for UpdateOrganizationApiToken with any type of body +func NewUpdateOrganizationApiTokenRequestWithBody(server string, orgShortNameId string, apiTokenId string, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string @@ -4251,7 +4598,7 @@ func NewUpdateAzureClusterRequestWithBody(server string, orgShortNameId string, var pathParam1 string - pathParam1, err = runtime.StyleParamWithLocation("simple", false, "clusterId", runtime.ParamLocationPath, clusterId) + pathParam1, err = runtime.StyleParamWithLocation("simple", false, "apiTokenId", runtime.ParamLocationPath, apiTokenId) if err != nil { return nil, err } @@ -4261,7 +4608,7 @@ func NewUpdateAzureClusterRequestWithBody(server string, orgShortNameId string, return nil, err } - operationPath := fmt.Sprintf("/organizations/%s/clusters/azure/%s", pathParam0, pathParam1) + operationPath := fmt.Sprintf("/organizations/%s/api-tokens/%s", pathParam0, pathParam1) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -4281,19 +4628,8 @@ func NewUpdateAzureClusterRequestWithBody(server string, orgShortNameId string, return req, nil } -// NewCreateGcpClusterRequest calls the generic CreateGcpCluster builder with application/json body -func NewCreateGcpClusterRequest(server string, orgShortNameId string, body CreateGcpClusterJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) - if err != nil { - return nil, err - } - bodyReader = bytes.NewReader(buf) - return NewCreateGcpClusterRequestWithBody(server, orgShortNameId, "application/json", bodyReader) -} - -// NewCreateGcpClusterRequestWithBody generates requests for CreateGcpCluster with any type of body -func NewCreateGcpClusterRequestWithBody(server string, orgShortNameId string, contentType string, body io.Reader) (*http.Request, error) { +// NewRotateOrganizationApiTokenRequest generates requests for RotateOrganizationApiToken +func NewRotateOrganizationApiTokenRequest(server string, orgShortNameId string, apiTokenId string) (*http.Request, error) { var err error var pathParam0 string @@ -4303,12 +4639,19 @@ func NewCreateGcpClusterRequestWithBody(server string, orgShortNameId string, co return nil, err } + var pathParam1 string + + pathParam1, err = runtime.StyleParamWithLocation("simple", false, "apiTokenId", runtime.ParamLocationPath, apiTokenId) + if err != nil { + return nil, err + } + serverURL, err := url.Parse(server) if err != nil { return nil, err } - operationPath := fmt.Sprintf("/organizations/%s/clusters/gcp", pathParam0) + operationPath := fmt.Sprintf("/organizations/%s/api-tokens/%s/rotate", pathParam0, pathParam1) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -4318,29 +4661,16 @@ func NewCreateGcpClusterRequestWithBody(server string, orgShortNameId string, co return nil, err } - req, err := http.NewRequest("POST", queryURL.String(), body) + req, err := http.NewRequest("POST", queryURL.String(), nil) if err != nil { return nil, err } - req.Header.Add("Content-Type", contentType) - return req, nil } -// NewUpdateGcpClusterRequest calls the generic UpdateGcpCluster builder with application/json body -func NewUpdateGcpClusterRequest(server string, orgShortNameId string, clusterId string, body UpdateGcpClusterJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) - if err != nil { - return nil, err - } - bodyReader = bytes.NewReader(buf) - return NewUpdateGcpClusterRequestWithBody(server, orgShortNameId, clusterId, "application/json", bodyReader) -} - -// NewUpdateGcpClusterRequestWithBody generates requests for UpdateGcpCluster with any type of body -func NewUpdateGcpClusterRequestWithBody(server string, orgShortNameId string, clusterId string, contentType string, body io.Reader) (*http.Request, error) { +// NewGetOrganizationAuditLogsRequest generates requests for GetOrganizationAuditLogs +func NewGetOrganizationAuditLogsRequest(server string, orgShortNameId string, params *GetOrganizationAuditLogsParams) (*http.Request, error) { var err error var pathParam0 string @@ -4350,19 +4680,12 @@ func NewUpdateGcpClusterRequestWithBody(server string, orgShortNameId string, cl return nil, err } - var pathParam1 string - - pathParam1, err = runtime.StyleParamWithLocation("simple", false, "clusterId", runtime.ParamLocationPath, clusterId) - if err != nil { - return nil, err - } - serverURL, err := url.Parse(server) if err != nil { return nil, err } - operationPath := fmt.Sprintf("/organizations/%s/clusters/gcp/%s", pathParam0, pathParam1) + operationPath := fmt.Sprintf("/organizations/%s/audit-logs", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -4372,18 +4695,36 @@ func NewUpdateGcpClusterRequestWithBody(server string, orgShortNameId string, cl return nil, err } - req, err := http.NewRequest("POST", queryURL.String(), body) + queryValues := queryURL.Query() + + if params.Earliest != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "earliest", runtime.ParamLocationQuery, *params.Earliest); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + queryURL.RawQuery = queryValues.Encode() + + req, err := http.NewRequest("GET", queryURL.String(), nil) if err != nil { return nil, err } - req.Header.Add("Content-Type", contentType) - return req, nil } -// NewDeleteClusterRequest generates requests for DeleteCluster -func NewDeleteClusterRequest(server string, orgShortNameId string, clusterId string) (*http.Request, error) { +// NewListClustersRequest generates requests for ListClusters +func NewListClustersRequest(server string, orgShortNameId string, params *ListClustersParams) (*http.Request, error) { var err error var pathParam0 string @@ -4393,19 +4734,12 @@ func NewDeleteClusterRequest(server string, orgShortNameId string, clusterId str return nil, err } - var pathParam1 string - - pathParam1, err = runtime.StyleParamWithLocation("simple", false, "clusterId", runtime.ParamLocationPath, clusterId) - if err != nil { - return nil, err - } - serverURL, err := url.Parse(server) if err != nil { return nil, err } - operationPath := fmt.Sprintf("/organizations/%s/clusters/%s", pathParam0, pathParam1) + operationPath := fmt.Sprintf("/organizations/%s/clusters", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -4415,81 +4749,122 @@ func NewDeleteClusterRequest(server string, orgShortNameId string, clusterId str return nil, err } - req, err := http.NewRequest("DELETE", queryURL.String(), nil) - if err != nil { - return nil, err - } - - return req, nil -} + queryValues := queryURL.Query() -// NewGetClusterRequest generates requests for GetCluster -func NewGetClusterRequest(server string, orgShortNameId string, clusterId string) (*http.Request, error) { - var err error + if params.Provider != nil { - var pathParam0 string + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "provider", runtime.ParamLocationQuery, *params.Provider); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "orgShortNameId", runtime.ParamLocationPath, orgShortNameId) - if err != nil { - return nil, err } - var pathParam1 string + if params.Type != nil { - pathParam1, err = runtime.StyleParamWithLocation("simple", false, "clusterId", runtime.ParamLocationPath, clusterId) - if err != nil { - return nil, err - } + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "type", runtime.ParamLocationQuery, *params.Type); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } - serverURL, err := url.Parse(server) - if err != nil { - return nil, err } - operationPath := fmt.Sprintf("/organizations/%s/clusters/%s", pathParam0, pathParam1) - if operationPath[0] == '/' { - operationPath = "." + operationPath - } + if params.Status != nil { - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "status", runtime.ParamLocationQuery, *params.Status); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } - req, err := http.NewRequest("GET", queryURL.String(), nil) - if err != nil { - return nil, err } - return req, nil -} - -// NewListManagedDomainsRequest generates requests for ListManagedDomains -func NewListManagedDomainsRequest(server string, orgShortNameId string) (*http.Request, error) { - var err error + if params.Search != nil { - var pathParam0 string + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "search", runtime.ParamLocationQuery, *params.Search); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "orgShortNameId", runtime.ParamLocationPath, orgShortNameId) - if err != nil { - return nil, err } - serverURL, err := url.Parse(server) - if err != nil { - return nil, err + if params.Offset != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "offset", runtime.ParamLocationQuery, *params.Offset); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + } - operationPath := fmt.Sprintf("/organizations/%s/domains", pathParam0) - if operationPath[0] == '/' { - operationPath = "." + operationPath + if params.Limit != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "limit", runtime.ParamLocationQuery, *params.Limit); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + } - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err + if params.Sorts != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "sorts", runtime.ParamLocationQuery, *params.Sorts); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + } + queryURL.RawQuery = queryValues.Encode() + req, err := http.NewRequest("GET", queryURL.String(), nil) if err != nil { return nil, err @@ -4498,19 +4873,19 @@ func NewListManagedDomainsRequest(server string, orgShortNameId string) (*http.R return req, nil } -// NewCreateManagedDomainRequest calls the generic CreateManagedDomain builder with application/json body -func NewCreateManagedDomainRequest(server string, orgShortNameId string, body CreateManagedDomainJSONRequestBody) (*http.Request, error) { +// NewCreateAwsClusterRequest calls the generic CreateAwsCluster builder with application/json body +func NewCreateAwsClusterRequest(server string, orgShortNameId string, body CreateAwsClusterJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) - return NewCreateManagedDomainRequestWithBody(server, orgShortNameId, "application/json", bodyReader) + return NewCreateAwsClusterRequestWithBody(server, orgShortNameId, "application/json", bodyReader) } -// NewCreateManagedDomainRequestWithBody generates requests for CreateManagedDomain with any type of body -func NewCreateManagedDomainRequestWithBody(server string, orgShortNameId string, contentType string, body io.Reader) (*http.Request, error) { +// NewCreateAwsClusterRequestWithBody generates requests for CreateAwsCluster with any type of body +func NewCreateAwsClusterRequestWithBody(server string, orgShortNameId string, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string @@ -4525,7 +4900,7 @@ func NewCreateManagedDomainRequestWithBody(server string, orgShortNameId string, return nil, err } - operationPath := fmt.Sprintf("/organizations/%s/domains", pathParam0) + operationPath := fmt.Sprintf("/organizations/%s/clusters/aws", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -4545,8 +4920,19 @@ func NewCreateManagedDomainRequestWithBody(server string, orgShortNameId string, return req, nil } -// NewDeleteManagedDomainRequest generates requests for DeleteManagedDomain -func NewDeleteManagedDomainRequest(server string, orgShortNameId string, domainId string) (*http.Request, error) { +// NewUpdateAwsClusterRequest calls the generic UpdateAwsCluster builder with application/json body +func NewUpdateAwsClusterRequest(server string, orgShortNameId string, clusterId string, body UpdateAwsClusterJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewUpdateAwsClusterRequestWithBody(server, orgShortNameId, clusterId, "application/json", bodyReader) +} + +// NewUpdateAwsClusterRequestWithBody generates requests for UpdateAwsCluster with any type of body +func NewUpdateAwsClusterRequestWithBody(server string, orgShortNameId string, clusterId string, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string @@ -4558,7 +4944,7 @@ func NewDeleteManagedDomainRequest(server string, orgShortNameId string, domainI var pathParam1 string - pathParam1, err = runtime.StyleParamWithLocation("simple", false, "domainId", runtime.ParamLocationPath, domainId) + pathParam1, err = runtime.StyleParamWithLocation("simple", false, "clusterId", runtime.ParamLocationPath, clusterId) if err != nil { return nil, err } @@ -4568,7 +4954,7 @@ func NewDeleteManagedDomainRequest(server string, orgShortNameId string, domainI return nil, err } - operationPath := fmt.Sprintf("/organizations/%s/domains/%s", pathParam0, pathParam1) + operationPath := fmt.Sprintf("/organizations/%s/clusters/aws/%s", pathParam0, pathParam1) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -4578,28 +4964,34 @@ func NewDeleteManagedDomainRequest(server string, orgShortNameId string, domainI return nil, err } - req, err := http.NewRequest("DELETE", queryURL.String(), nil) + req, err := http.NewRequest("POST", queryURL.String(), body) if err != nil { return nil, err } + req.Header.Add("Content-Type", contentType) + return req, nil } -// NewGetManagedDomainRequest generates requests for GetManagedDomain -func NewGetManagedDomainRequest(server string, orgShortNameId string, domainId string) (*http.Request, error) { - var err error - - var pathParam0 string - - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "orgShortNameId", runtime.ParamLocationPath, orgShortNameId) +// NewCreateAzureClusterRequest calls the generic CreateAzureCluster builder with application/json body +func NewCreateAzureClusterRequest(server string, orgShortNameId string, body CreateAzureClusterJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) if err != nil { return nil, err } + bodyReader = bytes.NewReader(buf) + return NewCreateAzureClusterRequestWithBody(server, orgShortNameId, "application/json", bodyReader) +} - var pathParam1 string +// NewCreateAzureClusterRequestWithBody generates requests for CreateAzureCluster with any type of body +func NewCreateAzureClusterRequestWithBody(server string, orgShortNameId string, contentType string, body io.Reader) (*http.Request, error) { + var err error - pathParam1, err = runtime.StyleParamWithLocation("simple", false, "domainId", runtime.ParamLocationPath, domainId) + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "orgShortNameId", runtime.ParamLocationPath, orgShortNameId) if err != nil { return nil, err } @@ -4609,7 +5001,7 @@ func NewGetManagedDomainRequest(server string, orgShortNameId string, domainId s return nil, err } - operationPath := fmt.Sprintf("/organizations/%s/domains/%s", pathParam0, pathParam1) + operationPath := fmt.Sprintf("/organizations/%s/clusters/azure", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -4619,27 +5011,29 @@ func NewGetManagedDomainRequest(server string, orgShortNameId string, domainId s return nil, err } - req, err := http.NewRequest("GET", queryURL.String(), nil) + req, err := http.NewRequest("POST", queryURL.String(), body) if err != nil { return nil, err } + req.Header.Add("Content-Type", contentType) + return req, nil } -// NewUpdateManagedDomainRequest calls the generic UpdateManagedDomain builder with application/json body -func NewUpdateManagedDomainRequest(server string, orgShortNameId string, domainId string, body UpdateManagedDomainJSONRequestBody) (*http.Request, error) { +// NewUpdateAzureClusterRequest calls the generic UpdateAzureCluster builder with application/json body +func NewUpdateAzureClusterRequest(server string, orgShortNameId string, clusterId string, body UpdateAzureClusterJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) - return NewUpdateManagedDomainRequestWithBody(server, orgShortNameId, domainId, "application/json", bodyReader) + return NewUpdateAzureClusterRequestWithBody(server, orgShortNameId, clusterId, "application/json", bodyReader) } -// NewUpdateManagedDomainRequestWithBody generates requests for UpdateManagedDomain with any type of body -func NewUpdateManagedDomainRequestWithBody(server string, orgShortNameId string, domainId string, contentType string, body io.Reader) (*http.Request, error) { +// NewUpdateAzureClusterRequestWithBody generates requests for UpdateAzureCluster with any type of body +func NewUpdateAzureClusterRequestWithBody(server string, orgShortNameId string, clusterId string, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string @@ -4651,7 +5045,7 @@ func NewUpdateManagedDomainRequestWithBody(server string, orgShortNameId string, var pathParam1 string - pathParam1, err = runtime.StyleParamWithLocation("simple", false, "domainId", runtime.ParamLocationPath, domainId) + pathParam1, err = runtime.StyleParamWithLocation("simple", false, "clusterId", runtime.ParamLocationPath, clusterId) if err != nil { return nil, err } @@ -4661,7 +5055,7 @@ func NewUpdateManagedDomainRequestWithBody(server string, orgShortNameId string, return nil, err } - operationPath := fmt.Sprintf("/organizations/%s/domains/%s", pathParam0, pathParam1) + operationPath := fmt.Sprintf("/organizations/%s/clusters/azure/%s", pathParam0, pathParam1) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -4681,20 +5075,24 @@ func NewUpdateManagedDomainRequestWithBody(server string, orgShortNameId string, return req, nil } -// NewVerifyManagedDomainRequest generates requests for VerifyManagedDomain -func NewVerifyManagedDomainRequest(server string, orgShortNameId string, domainId string) (*http.Request, error) { - var err error - - var pathParam0 string - - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "orgShortNameId", runtime.ParamLocationPath, orgShortNameId) +// NewCreateGcpClusterRequest calls the generic CreateGcpCluster builder with application/json body +func NewCreateGcpClusterRequest(server string, orgShortNameId string, body CreateGcpClusterJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) if err != nil { return nil, err } + bodyReader = bytes.NewReader(buf) + return NewCreateGcpClusterRequestWithBody(server, orgShortNameId, "application/json", bodyReader) +} - var pathParam1 string +// NewCreateGcpClusterRequestWithBody generates requests for CreateGcpCluster with any type of body +func NewCreateGcpClusterRequestWithBody(server string, orgShortNameId string, contentType string, body io.Reader) (*http.Request, error) { + var err error - pathParam1, err = runtime.StyleParamWithLocation("simple", false, "domainId", runtime.ParamLocationPath, domainId) + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "orgShortNameId", runtime.ParamLocationPath, orgShortNameId) if err != nil { return nil, err } @@ -4704,7 +5102,7 @@ func NewVerifyManagedDomainRequest(server string, orgShortNameId string, domainI return nil, err } - operationPath := fmt.Sprintf("/organizations/%s/domains/%s/verify", pathParam0, pathParam1) + operationPath := fmt.Sprintf("/organizations/%s/clusters/gcp", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -4714,61 +5112,29 @@ func NewVerifyManagedDomainRequest(server string, orgShortNameId string, domainI return nil, err } - req, err := http.NewRequest("POST", queryURL.String(), nil) + req, err := http.NewRequest("POST", queryURL.String(), body) if err != nil { return nil, err } + req.Header.Add("Content-Type", contentType) + return req, nil } -// NewGetDraftInvoiceRequest generates requests for GetDraftInvoice -func NewGetDraftInvoiceRequest(server string, orgShortNameId string) (*http.Request, error) { - var err error - - var pathParam0 string - - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "orgShortNameId", runtime.ParamLocationPath, orgShortNameId) - if err != nil { - return nil, err - } - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/organizations/%s/draft-invoice", pathParam0) - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("GET", queryURL.String(), nil) - if err != nil { - return nil, err - } - - return req, nil -} - -// NewCreateUserInviteRequest calls the generic CreateUserInvite builder with application/json body -func NewCreateUserInviteRequest(server string, orgShortNameId string, body CreateUserInviteJSONRequestBody) (*http.Request, error) { +// NewUpdateGcpClusterRequest calls the generic UpdateGcpCluster builder with application/json body +func NewUpdateGcpClusterRequest(server string, orgShortNameId string, clusterId string, body UpdateGcpClusterJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) - return NewCreateUserInviteRequestWithBody(server, orgShortNameId, "application/json", bodyReader) + return NewUpdateGcpClusterRequestWithBody(server, orgShortNameId, clusterId, "application/json", bodyReader) } -// NewCreateUserInviteRequestWithBody generates requests for CreateUserInvite with any type of body -func NewCreateUserInviteRequestWithBody(server string, orgShortNameId string, contentType string, body io.Reader) (*http.Request, error) { +// NewUpdateGcpClusterRequestWithBody generates requests for UpdateGcpCluster with any type of body +func NewUpdateGcpClusterRequestWithBody(server string, orgShortNameId string, clusterId string, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string @@ -4778,12 +5144,19 @@ func NewCreateUserInviteRequestWithBody(server string, orgShortNameId string, co return nil, err } + var pathParam1 string + + pathParam1, err = runtime.StyleParamWithLocation("simple", false, "clusterId", runtime.ParamLocationPath, clusterId) + if err != nil { + return nil, err + } + serverURL, err := url.Parse(server) if err != nil { return nil, err } - operationPath := fmt.Sprintf("/organizations/%s/invites", pathParam0) + operationPath := fmt.Sprintf("/organizations/%s/clusters/gcp/%s", pathParam0, pathParam1) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -4803,8 +5176,8 @@ func NewCreateUserInviteRequestWithBody(server string, orgShortNameId string, co return req, nil } -// NewDeleteUserInviteRequest generates requests for DeleteUserInvite -func NewDeleteUserInviteRequest(server string, orgShortNameId string, inviteId string) (*http.Request, error) { +// NewDeleteClusterRequest generates requests for DeleteCluster +func NewDeleteClusterRequest(server string, orgShortNameId string, clusterId string) (*http.Request, error) { var err error var pathParam0 string @@ -4816,7 +5189,7 @@ func NewDeleteUserInviteRequest(server string, orgShortNameId string, inviteId s var pathParam1 string - pathParam1, err = runtime.StyleParamWithLocation("simple", false, "inviteId", runtime.ParamLocationPath, inviteId) + pathParam1, err = runtime.StyleParamWithLocation("simple", false, "clusterId", runtime.ParamLocationPath, clusterId) if err != nil { return nil, err } @@ -4826,7 +5199,7 @@ func NewDeleteUserInviteRequest(server string, orgShortNameId string, inviteId s return nil, err } - operationPath := fmt.Sprintf("/organizations/%s/invites/%s", pathParam0, pathParam1) + operationPath := fmt.Sprintf("/organizations/%s/clusters/%s", pathParam0, pathParam1) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -4844,8 +5217,8 @@ func NewDeleteUserInviteRequest(server string, orgShortNameId string, inviteId s return req, nil } -// NewGetPaymentMethodRequest generates requests for GetPaymentMethod -func NewGetPaymentMethodRequest(server string, orgShortNameId string) (*http.Request, error) { +// NewGetClusterRequest generates requests for GetCluster +func NewGetClusterRequest(server string, orgShortNameId string, clusterId string) (*http.Request, error) { var err error var pathParam0 string @@ -4855,12 +5228,19 @@ func NewGetPaymentMethodRequest(server string, orgShortNameId string) (*http.Req return nil, err } + var pathParam1 string + + pathParam1, err = runtime.StyleParamWithLocation("simple", false, "clusterId", runtime.ParamLocationPath, clusterId) + if err != nil { + return nil, err + } + serverURL, err := url.Parse(server) if err != nil { return nil, err } - operationPath := fmt.Sprintf("/organizations/%s/payment-method", pathParam0) + operationPath := fmt.Sprintf("/organizations/%s/clusters/%s", pathParam0, pathParam1) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -4878,8 +5258,8 @@ func NewGetPaymentMethodRequest(server string, orgShortNameId string) (*http.Req return req, nil } -// NewDeleteSsoBypassKeyRequest generates requests for DeleteSsoBypassKey -func NewDeleteSsoBypassKeyRequest(server string, orgShortNameId string) (*http.Request, error) { +// NewListManagedDomainsRequest generates requests for ListManagedDomains +func NewListManagedDomainsRequest(server string, orgShortNameId string) (*http.Request, error) { var err error var pathParam0 string @@ -4894,7 +5274,7 @@ func NewDeleteSsoBypassKeyRequest(server string, orgShortNameId string) (*http.R return nil, err } - operationPath := fmt.Sprintf("/organizations/%s/sso-bypass-key", pathParam0) + operationPath := fmt.Sprintf("/organizations/%s/domains", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -4904,7 +5284,7 @@ func NewDeleteSsoBypassKeyRequest(server string, orgShortNameId string) (*http.R return nil, err } - req, err := http.NewRequest("DELETE", queryURL.String(), nil) + req, err := http.NewRequest("GET", queryURL.String(), nil) if err != nil { return nil, err } @@ -4912,8 +5292,19 @@ func NewDeleteSsoBypassKeyRequest(server string, orgShortNameId string) (*http.R return req, nil } -// NewGetSsoBypassKeyRequest generates requests for GetSsoBypassKey -func NewGetSsoBypassKeyRequest(server string, orgShortNameId string) (*http.Request, error) { +// NewCreateManagedDomainRequest calls the generic CreateManagedDomain builder with application/json body +func NewCreateManagedDomainRequest(server string, orgShortNameId string, body CreateManagedDomainJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewCreateManagedDomainRequestWithBody(server, orgShortNameId, "application/json", bodyReader) +} + +// NewCreateManagedDomainRequestWithBody generates requests for CreateManagedDomain with any type of body +func NewCreateManagedDomainRequestWithBody(server string, orgShortNameId string, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string @@ -4928,7 +5319,7 @@ func NewGetSsoBypassKeyRequest(server string, orgShortNameId string) (*http.Requ return nil, err } - operationPath := fmt.Sprintf("/organizations/%s/sso-bypass-key", pathParam0) + operationPath := fmt.Sprintf("/organizations/%s/domains", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -4938,16 +5329,18 @@ func NewGetSsoBypassKeyRequest(server string, orgShortNameId string) (*http.Requ return nil, err } - req, err := http.NewRequest("GET", queryURL.String(), nil) + req, err := http.NewRequest("POST", queryURL.String(), body) if err != nil { return nil, err } + req.Header.Add("Content-Type", contentType) + return req, nil } -// NewUpsertSsoBypassKeyRequest generates requests for UpsertSsoBypassKey -func NewUpsertSsoBypassKeyRequest(server string, orgShortNameId string) (*http.Request, error) { +// NewDeleteManagedDomainRequest generates requests for DeleteManagedDomain +func NewDeleteManagedDomainRequest(server string, orgShortNameId string, domainId string) (*http.Request, error) { var err error var pathParam0 string @@ -4957,12 +5350,19 @@ func NewUpsertSsoBypassKeyRequest(server string, orgShortNameId string) (*http.R return nil, err } + var pathParam1 string + + pathParam1, err = runtime.StyleParamWithLocation("simple", false, "domainId", runtime.ParamLocationPath, domainId) + if err != nil { + return nil, err + } + serverURL, err := url.Parse(server) if err != nil { return nil, err } - operationPath := fmt.Sprintf("/organizations/%s/sso-bypass-key", pathParam0) + operationPath := fmt.Sprintf("/organizations/%s/domains/%s", pathParam0, pathParam1) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -4972,7 +5372,7 @@ func NewUpsertSsoBypassKeyRequest(server string, orgShortNameId string) (*http.R return nil, err } - req, err := http.NewRequest("POST", queryURL.String(), nil) + req, err := http.NewRequest("DELETE", queryURL.String(), nil) if err != nil { return nil, err } @@ -4980,8 +5380,8 @@ func NewUpsertSsoBypassKeyRequest(server string, orgShortNameId string) (*http.R return req, nil } -// NewListSsoConnectionsRequest generates requests for ListSsoConnections -func NewListSsoConnectionsRequest(server string, orgShortNameId string) (*http.Request, error) { +// NewGetManagedDomainRequest generates requests for GetManagedDomain +func NewGetManagedDomainRequest(server string, orgShortNameId string, domainId string) (*http.Request, error) { var err error var pathParam0 string @@ -4991,12 +5391,19 @@ func NewListSsoConnectionsRequest(server string, orgShortNameId string) (*http.R return nil, err } + var pathParam1 string + + pathParam1, err = runtime.StyleParamWithLocation("simple", false, "domainId", runtime.ParamLocationPath, domainId) + if err != nil { + return nil, err + } + serverURL, err := url.Parse(server) if err != nil { return nil, err } - operationPath := fmt.Sprintf("/organizations/%s/sso-connections", pathParam0) + operationPath := fmt.Sprintf("/organizations/%s/domains/%s", pathParam0, pathParam1) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -5014,19 +5421,19 @@ func NewListSsoConnectionsRequest(server string, orgShortNameId string) (*http.R return req, nil } -// NewCreateSsoConnectionRequest calls the generic CreateSsoConnection builder with application/json body -func NewCreateSsoConnectionRequest(server string, orgShortNameId string, body CreateSsoConnectionJSONRequestBody) (*http.Request, error) { +// NewUpdateManagedDomainRequest calls the generic UpdateManagedDomain builder with application/json body +func NewUpdateManagedDomainRequest(server string, orgShortNameId string, domainId string, body UpdateManagedDomainJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) - return NewCreateSsoConnectionRequestWithBody(server, orgShortNameId, "application/json", bodyReader) + return NewUpdateManagedDomainRequestWithBody(server, orgShortNameId, domainId, "application/json", bodyReader) } -// NewCreateSsoConnectionRequestWithBody generates requests for CreateSsoConnection with any type of body -func NewCreateSsoConnectionRequestWithBody(server string, orgShortNameId string, contentType string, body io.Reader) (*http.Request, error) { +// NewUpdateManagedDomainRequestWithBody generates requests for UpdateManagedDomain with any type of body +func NewUpdateManagedDomainRequestWithBody(server string, orgShortNameId string, domainId string, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string @@ -5036,12 +5443,19 @@ func NewCreateSsoConnectionRequestWithBody(server string, orgShortNameId string, return nil, err } + var pathParam1 string + + pathParam1, err = runtime.StyleParamWithLocation("simple", false, "domainId", runtime.ParamLocationPath, domainId) + if err != nil { + return nil, err + } + serverURL, err := url.Parse(server) if err != nil { return nil, err } - operationPath := fmt.Sprintf("/organizations/%s/sso-connections", pathParam0) + operationPath := fmt.Sprintf("/organizations/%s/domains/%s", pathParam0, pathParam1) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -5061,8 +5475,8 @@ func NewCreateSsoConnectionRequestWithBody(server string, orgShortNameId string, return req, nil } -// NewDeleteSsoConnectionRequest generates requests for DeleteSsoConnection -func NewDeleteSsoConnectionRequest(server string, orgShortNameId string, connectionId string) (*http.Request, error) { +// NewVerifyManagedDomainRequest generates requests for VerifyManagedDomain +func NewVerifyManagedDomainRequest(server string, orgShortNameId string, domainId string) (*http.Request, error) { var err error var pathParam0 string @@ -5074,7 +5488,7 @@ func NewDeleteSsoConnectionRequest(server string, orgShortNameId string, connect var pathParam1 string - pathParam1, err = runtime.StyleParamWithLocation("simple", false, "connectionId", runtime.ParamLocationPath, connectionId) + pathParam1, err = runtime.StyleParamWithLocation("simple", false, "domainId", runtime.ParamLocationPath, domainId) if err != nil { return nil, err } @@ -5084,7 +5498,7 @@ func NewDeleteSsoConnectionRequest(server string, orgShortNameId string, connect return nil, err } - operationPath := fmt.Sprintf("/organizations/%s/sso-connections/%s", pathParam0, pathParam1) + operationPath := fmt.Sprintf("/organizations/%s/domains/%s/verify", pathParam0, pathParam1) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -5094,7 +5508,7 @@ func NewDeleteSsoConnectionRequest(server string, orgShortNameId string, connect return nil, err } - req, err := http.NewRequest("DELETE", queryURL.String(), nil) + req, err := http.NewRequest("POST", queryURL.String(), nil) if err != nil { return nil, err } @@ -5102,8 +5516,8 @@ func NewDeleteSsoConnectionRequest(server string, orgShortNameId string, connect return req, nil } -// NewGetSsoConnectionRequest generates requests for GetSsoConnection -func NewGetSsoConnectionRequest(server string, orgShortNameId string, connectionId string) (*http.Request, error) { +// NewGetDraftInvoiceRequest generates requests for GetDraftInvoice +func NewGetDraftInvoiceRequest(server string, orgShortNameId string) (*http.Request, error) { var err error var pathParam0 string @@ -5113,19 +5527,12 @@ func NewGetSsoConnectionRequest(server string, orgShortNameId string, connection return nil, err } - var pathParam1 string - - pathParam1, err = runtime.StyleParamWithLocation("simple", false, "connectionId", runtime.ParamLocationPath, connectionId) - if err != nil { - return nil, err - } - serverURL, err := url.Parse(server) if err != nil { return nil, err } - operationPath := fmt.Sprintf("/organizations/%s/sso-connections/%s", pathParam0, pathParam1) + operationPath := fmt.Sprintf("/organizations/%s/draft-invoice", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -5143,19 +5550,19 @@ func NewGetSsoConnectionRequest(server string, orgShortNameId string, connection return req, nil } -// NewUpdateSsoConnectionRequest calls the generic UpdateSsoConnection builder with application/json body -func NewUpdateSsoConnectionRequest(server string, orgShortNameId string, connectionId string, body UpdateSsoConnectionJSONRequestBody) (*http.Request, error) { +// NewCreateUserInviteRequest calls the generic CreateUserInvite builder with application/json body +func NewCreateUserInviteRequest(server string, orgShortNameId string, body CreateUserInviteJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) - return NewUpdateSsoConnectionRequestWithBody(server, orgShortNameId, connectionId, "application/json", bodyReader) + return NewCreateUserInviteRequestWithBody(server, orgShortNameId, "application/json", bodyReader) } -// NewUpdateSsoConnectionRequestWithBody generates requests for UpdateSsoConnection with any type of body -func NewUpdateSsoConnectionRequestWithBody(server string, orgShortNameId string, connectionId string, contentType string, body io.Reader) (*http.Request, error) { +// NewCreateUserInviteRequestWithBody generates requests for CreateUserInvite with any type of body +func NewCreateUserInviteRequestWithBody(server string, orgShortNameId string, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string @@ -5165,19 +5572,12 @@ func NewUpdateSsoConnectionRequestWithBody(server string, orgShortNameId string, return nil, err } - var pathParam1 string - - pathParam1, err = runtime.StyleParamWithLocation("simple", false, "connectionId", runtime.ParamLocationPath, connectionId) - if err != nil { - return nil, err - } - serverURL, err := url.Parse(server) if err != nil { return nil, err } - operationPath := fmt.Sprintf("/organizations/%s/sso-connections/%s", pathParam0, pathParam1) + operationPath := fmt.Sprintf("/organizations/%s/invites", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -5197,8 +5597,8 @@ func NewUpdateSsoConnectionRequestWithBody(server string, orgShortNameId string, return req, nil } -// NewGetStripeClientSecretRequest generates requests for GetStripeClientSecret -func NewGetStripeClientSecretRequest(server string, orgShortNameId string, pType GetStripeClientSecretParamsType) (*http.Request, error) { +// NewDeleteUserInviteRequest generates requests for DeleteUserInvite +func NewDeleteUserInviteRequest(server string, orgShortNameId string, inviteId string) (*http.Request, error) { var err error var pathParam0 string @@ -5210,7 +5610,7 @@ func NewGetStripeClientSecretRequest(server string, orgShortNameId string, pType var pathParam1 string - pathParam1, err = runtime.StyleParamWithLocation("simple", false, "type", runtime.ParamLocationPath, pType) + pathParam1, err = runtime.StyleParamWithLocation("simple", false, "inviteId", runtime.ParamLocationPath, inviteId) if err != nil { return nil, err } @@ -5220,7 +5620,41 @@ func NewGetStripeClientSecretRequest(server string, orgShortNameId string, pType return nil, err } - operationPath := fmt.Sprintf("/organizations/%s/stripe/client-secret/%s", pathParam0, pathParam1) + operationPath := fmt.Sprintf("/organizations/%s/invites/%s", pathParam0, pathParam1) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("DELETE", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewGetCreditSummaryRequest generates requests for GetCreditSummary +func NewGetCreditSummaryRequest(server string, orgShortNameId string) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "orgShortNameId", runtime.ParamLocationPath, orgShortNameId) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/organizations/%s/metronome/credit-summary", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -5238,8 +5672,8 @@ func NewGetStripeClientSecretRequest(server string, orgShortNameId string, pType return req, nil } -// NewListOrganizationTeamsRequest generates requests for ListOrganizationTeams -func NewListOrganizationTeamsRequest(server string, orgShortNameId string, params *ListOrganizationTeamsParams) (*http.Request, error) { +// NewGetMetronomeDashboardRequest generates requests for GetMetronomeDashboard +func NewGetMetronomeDashboardRequest(server string, orgShortNameId string, pType GetMetronomeDashboardParamsType, params *GetMetronomeDashboardParams) (*http.Request, error) { var err error var pathParam0 string @@ -5249,12 +5683,19 @@ func NewListOrganizationTeamsRequest(server string, orgShortNameId string, param return nil, err } + var pathParam1 string + + pathParam1, err = runtime.StyleParamWithLocation("simple", false, "type", runtime.ParamLocationPath, pType) + if err != nil { + return nil, err + } + serverURL, err := url.Parse(server) if err != nil { return nil, err } - operationPath := fmt.Sprintf("/organizations/%s/teams", pathParam0) + operationPath := fmt.Sprintf("/organizations/%s/metronome/dashboard/%s", pathParam0, pathParam1) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -5266,9 +5707,9 @@ func NewListOrganizationTeamsRequest(server string, orgShortNameId string, param queryValues := queryURL.Query() - if params.Offset != nil { + if params.ShowZeroUsageLineItems != nil { - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "offset", runtime.ParamLocationQuery, *params.Offset); err != nil { + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "showZeroUsageLineItems", runtime.ParamLocationQuery, *params.ShowZeroUsageLineItems); err != nil { return nil, err } else if parsed, err := url.ParseQuery(queryFrag); err != nil { return nil, err @@ -5282,9 +5723,9 @@ func NewListOrganizationTeamsRequest(server string, orgShortNameId string, param } - if params.Limit != nil { + if params.ColorOverrides != nil { - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "limit", runtime.ParamLocationQuery, *params.Limit); err != nil { + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "colorOverrides", runtime.ParamLocationQuery, *params.ColorOverrides); err != nil { return nil, err } else if parsed, err := url.ParseQuery(queryFrag); err != nil { return nil, err @@ -5298,39 +5739,41 @@ func NewListOrganizationTeamsRequest(server string, orgShortNameId string, param } - if params.Sorts != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "sorts", runtime.ParamLocationQuery, *params.Sorts); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } + queryURL.RawQuery = queryValues.Encode() + req, err := http.NewRequest("GET", queryURL.String(), nil) + if err != nil { + return nil, err } - if params.Search != nil { + return req, nil +} - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "search", runtime.ParamLocationQuery, *params.Search); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } +// NewGetPaymentMethodRequest generates requests for GetPaymentMethod +func NewGetPaymentMethodRequest(server string, orgShortNameId string) (*http.Request, error) { + var err error + + var pathParam0 string + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "orgShortNameId", runtime.ParamLocationPath, orgShortNameId) + if err != nil { + return nil, err } - queryURL.RawQuery = queryValues.Encode() + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/organizations/%s/payment-method", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } req, err := http.NewRequest("GET", queryURL.String(), nil) if err != nil { @@ -5340,19 +5783,42 @@ func NewListOrganizationTeamsRequest(server string, orgShortNameId string, param return req, nil } -// NewCreateTeamRequest calls the generic CreateTeam builder with application/json body -func NewCreateTeamRequest(server string, orgShortNameId string, body CreateTeamJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) +// NewDeleteSsoBypassKeyRequest generates requests for DeleteSsoBypassKey +func NewDeleteSsoBypassKeyRequest(server string, orgShortNameId string) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "orgShortNameId", runtime.ParamLocationPath, orgShortNameId) if err != nil { return nil, err } - bodyReader = bytes.NewReader(buf) - return NewCreateTeamRequestWithBody(server, orgShortNameId, "application/json", bodyReader) + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/organizations/%s/sso-bypass-key", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("DELETE", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil } -// NewCreateTeamRequestWithBody generates requests for CreateTeam with any type of body -func NewCreateTeamRequestWithBody(server string, orgShortNameId string, contentType string, body io.Reader) (*http.Request, error) { +// NewGetSsoBypassKeyRequest generates requests for GetSsoBypassKey +func NewGetSsoBypassKeyRequest(server string, orgShortNameId string) (*http.Request, error) { var err error var pathParam0 string @@ -5367,7 +5833,7 @@ func NewCreateTeamRequestWithBody(server string, orgShortNameId string, contentT return nil, err } - operationPath := fmt.Sprintf("/organizations/%s/teams", pathParam0) + operationPath := fmt.Sprintf("/organizations/%s/sso-bypass-key", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -5377,18 +5843,50 @@ func NewCreateTeamRequestWithBody(server string, orgShortNameId string, contentT return nil, err } - req, err := http.NewRequest("POST", queryURL.String(), body) + req, err := http.NewRequest("GET", queryURL.String(), nil) if err != nil { return nil, err } - req.Header.Add("Content-Type", contentType) + return req, nil +} + +// NewUpsertSsoBypassKeyRequest generates requests for UpsertSsoBypassKey +func NewUpsertSsoBypassKeyRequest(server string, orgShortNameId string) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "orgShortNameId", runtime.ParamLocationPath, orgShortNameId) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/organizations/%s/sso-bypass-key", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("POST", queryURL.String(), nil) + if err != nil { + return nil, err + } return req, nil } -// NewDeleteTeamRequest generates requests for DeleteTeam -func NewDeleteTeamRequest(server string, orgShortNameId string, teamId string) (*http.Request, error) { +// NewListSsoConnectionsRequest generates requests for ListSsoConnections +func NewListSsoConnectionsRequest(server string, orgShortNameId string) (*http.Request, error) { var err error var pathParam0 string @@ -5398,9 +5896,47 @@ func NewDeleteTeamRequest(server string, orgShortNameId string, teamId string) ( return nil, err } - var pathParam1 string + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } - pathParam1, err = runtime.StyleParamWithLocation("simple", false, "teamId", runtime.ParamLocationPath, teamId) + operationPath := fmt.Sprintf("/organizations/%s/sso-connections", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("GET", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewCreateSsoConnectionRequest calls the generic CreateSsoConnection builder with application/json body +func NewCreateSsoConnectionRequest(server string, orgShortNameId string, body CreateSsoConnectionJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewCreateSsoConnectionRequestWithBody(server, orgShortNameId, "application/json", bodyReader) +} + +// NewCreateSsoConnectionRequestWithBody generates requests for CreateSsoConnection with any type of body +func NewCreateSsoConnectionRequestWithBody(server string, orgShortNameId string, contentType string, body io.Reader) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "orgShortNameId", runtime.ParamLocationPath, orgShortNameId) if err != nil { return nil, err } @@ -5410,7 +5946,7 @@ func NewDeleteTeamRequest(server string, orgShortNameId string, teamId string) ( return nil, err } - operationPath := fmt.Sprintf("/organizations/%s/teams/%s", pathParam0, pathParam1) + operationPath := fmt.Sprintf("/organizations/%s/sso-connections", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -5420,16 +5956,18 @@ func NewDeleteTeamRequest(server string, orgShortNameId string, teamId string) ( return nil, err } - req, err := http.NewRequest("DELETE", queryURL.String(), nil) + req, err := http.NewRequest("POST", queryURL.String(), body) if err != nil { return nil, err } + req.Header.Add("Content-Type", contentType) + return req, nil } -// NewGetTeamRequest generates requests for GetTeam -func NewGetTeamRequest(server string, orgShortNameId string, teamId string) (*http.Request, error) { +// NewDeleteSsoConnectionRequest generates requests for DeleteSsoConnection +func NewDeleteSsoConnectionRequest(server string, orgShortNameId string, connectionId string) (*http.Request, error) { var err error var pathParam0 string @@ -5441,7 +5979,7 @@ func NewGetTeamRequest(server string, orgShortNameId string, teamId string) (*ht var pathParam1 string - pathParam1, err = runtime.StyleParamWithLocation("simple", false, "teamId", runtime.ParamLocationPath, teamId) + pathParam1, err = runtime.StyleParamWithLocation("simple", false, "connectionId", runtime.ParamLocationPath, connectionId) if err != nil { return nil, err } @@ -5451,7 +5989,7 @@ func NewGetTeamRequest(server string, orgShortNameId string, teamId string) (*ht return nil, err } - operationPath := fmt.Sprintf("/organizations/%s/teams/%s", pathParam0, pathParam1) + operationPath := fmt.Sprintf("/organizations/%s/sso-connections/%s", pathParam0, pathParam1) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -5461,7 +5999,7 @@ func NewGetTeamRequest(server string, orgShortNameId string, teamId string) (*ht return nil, err } - req, err := http.NewRequest("GET", queryURL.String(), nil) + req, err := http.NewRequest("DELETE", queryURL.String(), nil) if err != nil { return nil, err } @@ -5469,19 +6007,8 @@ func NewGetTeamRequest(server string, orgShortNameId string, teamId string) (*ht return req, nil } -// NewUpdateTeamRequest calls the generic UpdateTeam builder with application/json body -func NewUpdateTeamRequest(server string, orgShortNameId string, teamId string, body UpdateTeamJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) - if err != nil { - return nil, err - } - bodyReader = bytes.NewReader(buf) - return NewUpdateTeamRequestWithBody(server, orgShortNameId, teamId, "application/json", bodyReader) -} - -// NewUpdateTeamRequestWithBody generates requests for UpdateTeam with any type of body -func NewUpdateTeamRequestWithBody(server string, orgShortNameId string, teamId string, contentType string, body io.Reader) (*http.Request, error) { +// NewGetSsoConnectionRequest generates requests for GetSsoConnection +func NewGetSsoConnectionRequest(server string, orgShortNameId string, connectionId string) (*http.Request, error) { var err error var pathParam0 string @@ -5493,7 +6020,7 @@ func NewUpdateTeamRequestWithBody(server string, orgShortNameId string, teamId s var pathParam1 string - pathParam1, err = runtime.StyleParamWithLocation("simple", false, "teamId", runtime.ParamLocationPath, teamId) + pathParam1, err = runtime.StyleParamWithLocation("simple", false, "connectionId", runtime.ParamLocationPath, connectionId) if err != nil { return nil, err } @@ -5503,7 +6030,7 @@ func NewUpdateTeamRequestWithBody(server string, orgShortNameId string, teamId s return nil, err } - operationPath := fmt.Sprintf("/organizations/%s/teams/%s", pathParam0, pathParam1) + operationPath := fmt.Sprintf("/organizations/%s/sso-connections/%s", pathParam0, pathParam1) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -5513,29 +6040,27 @@ func NewUpdateTeamRequestWithBody(server string, orgShortNameId string, teamId s return nil, err } - req, err := http.NewRequest("POST", queryURL.String(), body) + req, err := http.NewRequest("GET", queryURL.String(), nil) if err != nil { return nil, err } - req.Header.Add("Content-Type", contentType) - return req, nil } -// NewAddTeamMembersRequest calls the generic AddTeamMembers builder with application/json body -func NewAddTeamMembersRequest(server string, orgShortNameId string, teamId string, body AddTeamMembersJSONRequestBody) (*http.Request, error) { +// NewUpdateSsoConnectionRequest calls the generic UpdateSsoConnection builder with application/json body +func NewUpdateSsoConnectionRequest(server string, orgShortNameId string, connectionId string, body UpdateSsoConnectionJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) - return NewAddTeamMembersRequestWithBody(server, orgShortNameId, teamId, "application/json", bodyReader) + return NewUpdateSsoConnectionRequestWithBody(server, orgShortNameId, connectionId, "application/json", bodyReader) } -// NewAddTeamMembersRequestWithBody generates requests for AddTeamMembers with any type of body -func NewAddTeamMembersRequestWithBody(server string, orgShortNameId string, teamId string, contentType string, body io.Reader) (*http.Request, error) { +// NewUpdateSsoConnectionRequestWithBody generates requests for UpdateSsoConnection with any type of body +func NewUpdateSsoConnectionRequestWithBody(server string, orgShortNameId string, connectionId string, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string @@ -5547,7 +6072,7 @@ func NewAddTeamMembersRequestWithBody(server string, orgShortNameId string, team var pathParam1 string - pathParam1, err = runtime.StyleParamWithLocation("simple", false, "teamId", runtime.ParamLocationPath, teamId) + pathParam1, err = runtime.StyleParamWithLocation("simple", false, "connectionId", runtime.ParamLocationPath, connectionId) if err != nil { return nil, err } @@ -5557,7 +6082,7 @@ func NewAddTeamMembersRequestWithBody(server string, orgShortNameId string, team return nil, err } - operationPath := fmt.Sprintf("/organizations/%s/teams/%s/members", pathParam0, pathParam1) + operationPath := fmt.Sprintf("/organizations/%s/sso-connections/%s", pathParam0, pathParam1) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -5577,8 +6102,8 @@ func NewAddTeamMembersRequestWithBody(server string, orgShortNameId string, team return req, nil } -// NewRemoveTeamMemberRequest generates requests for RemoveTeamMember -func NewRemoveTeamMemberRequest(server string, orgShortNameId string, teamId string, memberId string) (*http.Request, error) { +// NewGetStripeClientSecretRequest generates requests for GetStripeClientSecret +func NewGetStripeClientSecretRequest(server string, orgShortNameId string, pType GetStripeClientSecretParamsType) (*http.Request, error) { var err error var pathParam0 string @@ -5590,14 +6115,7 @@ func NewRemoveTeamMemberRequest(server string, orgShortNameId string, teamId str var pathParam1 string - pathParam1, err = runtime.StyleParamWithLocation("simple", false, "teamId", runtime.ParamLocationPath, teamId) - if err != nil { - return nil, err - } - - var pathParam2 string - - pathParam2, err = runtime.StyleParamWithLocation("simple", false, "memberId", runtime.ParamLocationPath, memberId) + pathParam1, err = runtime.StyleParamWithLocation("simple", false, "type", runtime.ParamLocationPath, pType) if err != nil { return nil, err } @@ -5607,7 +6125,7 @@ func NewRemoveTeamMemberRequest(server string, orgShortNameId string, teamId str return nil, err } - operationPath := fmt.Sprintf("/organizations/%s/teams/%s/members/%s", pathParam0, pathParam1, pathParam2) + operationPath := fmt.Sprintf("/organizations/%s/stripe/client-secret/%s", pathParam0, pathParam1) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -5617,7 +6135,7 @@ func NewRemoveTeamMemberRequest(server string, orgShortNameId string, teamId str return nil, err } - req, err := http.NewRequest("DELETE", queryURL.String(), nil) + req, err := http.NewRequest("GET", queryURL.String(), nil) if err != nil { return nil, err } @@ -5625,8 +6143,8 @@ func NewRemoveTeamMemberRequest(server string, orgShortNameId string, teamId str return req, nil } -// NewListOrgUsersRequest generates requests for ListOrgUsers -func NewListOrgUsersRequest(server string, orgShortNameId string, params *ListOrgUsersParams) (*http.Request, error) { +// NewListOrganizationTeamsRequest generates requests for ListOrganizationTeams +func NewListOrganizationTeamsRequest(server string, orgShortNameId string, params *ListOrganizationTeamsParams) (*http.Request, error) { var err error var pathParam0 string @@ -5641,7 +6159,7 @@ func NewListOrgUsersRequest(server string, orgShortNameId string, params *ListOr return nil, err } - operationPath := fmt.Sprintf("/organizations/%s/users", pathParam0) + operationPath := fmt.Sprintf("/organizations/%s/teams", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -5717,34 +6235,65 @@ func NewListOrgUsersRequest(server string, orgShortNameId string, params *ListOr } - if params.HasInvites != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "hasInvites", runtime.ParamLocationQuery, *params.HasInvites); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } + queryURL.RawQuery = queryValues.Encode() + req, err := http.NewRequest("GET", queryURL.String(), nil) + if err != nil { + return nil, err } - queryURL.RawQuery = queryValues.Encode() + return req, nil +} - req, err := http.NewRequest("GET", queryURL.String(), nil) +// NewCreateTeamRequest calls the generic CreateTeam builder with application/json body +func NewCreateTeamRequest(server string, orgShortNameId string, body CreateTeamJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewCreateTeamRequestWithBody(server, orgShortNameId, "application/json", bodyReader) +} + +// NewCreateTeamRequestWithBody generates requests for CreateTeam with any type of body +func NewCreateTeamRequestWithBody(server string, orgShortNameId string, contentType string, body io.Reader) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "orgShortNameId", runtime.ParamLocationPath, orgShortNameId) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/organizations/%s/teams", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } + req, err := http.NewRequest("POST", queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + return req, nil } -// NewDeleteOrgUserRequest generates requests for DeleteOrgUser -func NewDeleteOrgUserRequest(server string, orgShortNameId string, userId string) (*http.Request, error) { +// NewDeleteTeamRequest generates requests for DeleteTeam +func NewDeleteTeamRequest(server string, orgShortNameId string, teamId string) (*http.Request, error) { var err error var pathParam0 string @@ -5756,7 +6305,7 @@ func NewDeleteOrgUserRequest(server string, orgShortNameId string, userId string var pathParam1 string - pathParam1, err = runtime.StyleParamWithLocation("simple", false, "userId", runtime.ParamLocationPath, userId) + pathParam1, err = runtime.StyleParamWithLocation("simple", false, "teamId", runtime.ParamLocationPath, teamId) if err != nil { return nil, err } @@ -5766,7 +6315,7 @@ func NewDeleteOrgUserRequest(server string, orgShortNameId string, userId string return nil, err } - operationPath := fmt.Sprintf("/organizations/%s/users/%s", pathParam0, pathParam1) + operationPath := fmt.Sprintf("/organizations/%s/teams/%s", pathParam0, pathParam1) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -5784,8 +6333,8 @@ func NewDeleteOrgUserRequest(server string, orgShortNameId string, userId string return req, nil } -// NewGetUserRequest generates requests for GetUser -func NewGetUserRequest(server string, orgShortNameId string, userId string) (*http.Request, error) { +// NewGetTeamRequest generates requests for GetTeam +func NewGetTeamRequest(server string, orgShortNameId string, teamId string) (*http.Request, error) { var err error var pathParam0 string @@ -5797,7 +6346,7 @@ func NewGetUserRequest(server string, orgShortNameId string, userId string) (*ht var pathParam1 string - pathParam1, err = runtime.StyleParamWithLocation("simple", false, "userId", runtime.ParamLocationPath, userId) + pathParam1, err = runtime.StyleParamWithLocation("simple", false, "teamId", runtime.ParamLocationPath, teamId) if err != nil { return nil, err } @@ -5807,7 +6356,7 @@ func NewGetUserRequest(server string, orgShortNameId string, userId string) (*ht return nil, err } - operationPath := fmt.Sprintf("/organizations/%s/users/%s", pathParam0, pathParam1) + operationPath := fmt.Sprintf("/organizations/%s/teams/%s", pathParam0, pathParam1) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -5825,19 +6374,19 @@ func NewGetUserRequest(server string, orgShortNameId string, userId string) (*ht return req, nil } -// NewMutateOrgUserRoleRequest calls the generic MutateOrgUserRole builder with application/json body -func NewMutateOrgUserRoleRequest(server string, orgShortNameId string, userId string, body MutateOrgUserRoleJSONRequestBody) (*http.Request, error) { +// NewUpdateTeamRequest calls the generic UpdateTeam builder with application/json body +func NewUpdateTeamRequest(server string, orgShortNameId string, teamId string, body UpdateTeamJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) - return NewMutateOrgUserRoleRequestWithBody(server, orgShortNameId, userId, "application/json", bodyReader) + return NewUpdateTeamRequestWithBody(server, orgShortNameId, teamId, "application/json", bodyReader) } -// NewMutateOrgUserRoleRequestWithBody generates requests for MutateOrgUserRole with any type of body -func NewMutateOrgUserRoleRequestWithBody(server string, orgShortNameId string, userId string, contentType string, body io.Reader) (*http.Request, error) { +// NewUpdateTeamRequestWithBody generates requests for UpdateTeam with any type of body +func NewUpdateTeamRequestWithBody(server string, orgShortNameId string, teamId string, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string @@ -5849,7 +6398,7 @@ func NewMutateOrgUserRoleRequestWithBody(server string, orgShortNameId string, u var pathParam1 string - pathParam1, err = runtime.StyleParamWithLocation("simple", false, "userId", runtime.ParamLocationPath, userId) + pathParam1, err = runtime.StyleParamWithLocation("simple", false, "teamId", runtime.ParamLocationPath, teamId) if err != nil { return nil, err } @@ -5859,7 +6408,7 @@ func NewMutateOrgUserRoleRequestWithBody(server string, orgShortNameId string, u return nil, err } - operationPath := fmt.Sprintf("/organizations/%s/users/%s/role", pathParam0, pathParam1) + operationPath := fmt.Sprintf("/organizations/%s/teams/%s", pathParam0, pathParam1) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -5879,19 +6428,19 @@ func NewMutateOrgUserRoleRequestWithBody(server string, orgShortNameId string, u return req, nil } -// NewValidateCreditCardPaymentRequest calls the generic ValidateCreditCardPayment builder with application/json body -func NewValidateCreditCardPaymentRequest(server string, orgShortNameId string, body ValidateCreditCardPaymentJSONRequestBody) (*http.Request, error) { +// NewAddTeamMembersRequest calls the generic AddTeamMembers builder with application/json body +func NewAddTeamMembersRequest(server string, orgShortNameId string, teamId string, body AddTeamMembersJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) - return NewValidateCreditCardPaymentRequestWithBody(server, orgShortNameId, "application/json", bodyReader) + return NewAddTeamMembersRequestWithBody(server, orgShortNameId, teamId, "application/json", bodyReader) } -// NewValidateCreditCardPaymentRequestWithBody generates requests for ValidateCreditCardPayment with any type of body -func NewValidateCreditCardPaymentRequestWithBody(server string, orgShortNameId string, contentType string, body io.Reader) (*http.Request, error) { +// NewAddTeamMembersRequestWithBody generates requests for AddTeamMembers with any type of body +func NewAddTeamMembersRequestWithBody(server string, orgShortNameId string, teamId string, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string @@ -5901,12 +6450,19 @@ func NewValidateCreditCardPaymentRequestWithBody(server string, orgShortNameId s return nil, err } + var pathParam1 string + + pathParam1, err = runtime.StyleParamWithLocation("simple", false, "teamId", runtime.ParamLocationPath, teamId) + if err != nil { + return nil, err + } + serverURL, err := url.Parse(server) if err != nil { return nil, err } - operationPath := fmt.Sprintf("/organizations/%s/validate-credit-card-payment", pathParam0) + operationPath := fmt.Sprintf("/organizations/%s/teams/%s/members", pathParam0, pathParam1) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -5926,8 +6482,8 @@ func NewValidateCreditCardPaymentRequestWithBody(server string, orgShortNameId s return req, nil } -// NewListWorkspacesRequest generates requests for ListWorkspaces -func NewListWorkspacesRequest(server string, orgShortNameId string, params *ListWorkspacesParams) (*http.Request, error) { +// NewRemoveTeamMemberRequest generates requests for RemoveTeamMember +func NewRemoveTeamMemberRequest(server string, orgShortNameId string, teamId string, memberId string) (*http.Request, error) { var err error var pathParam0 string @@ -5937,12 +6493,60 @@ func NewListWorkspacesRequest(server string, orgShortNameId string, params *List return nil, err } + var pathParam1 string + + pathParam1, err = runtime.StyleParamWithLocation("simple", false, "teamId", runtime.ParamLocationPath, teamId) + if err != nil { + return nil, err + } + + var pathParam2 string + + pathParam2, err = runtime.StyleParamWithLocation("simple", false, "memberId", runtime.ParamLocationPath, memberId) + if err != nil { + return nil, err + } + serverURL, err := url.Parse(server) if err != nil { return nil, err } - operationPath := fmt.Sprintf("/organizations/%s/workspaces", pathParam0) + operationPath := fmt.Sprintf("/organizations/%s/teams/%s/members/%s", pathParam0, pathParam1, pathParam2) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("DELETE", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewListOrgUsersRequest generates requests for ListOrgUsers +func NewListOrgUsersRequest(server string, orgShortNameId string, params *ListOrgUsersParams) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "orgShortNameId", runtime.ParamLocationPath, orgShortNameId) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/organizations/%s/users", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -5954,9 +6558,9 @@ func NewListWorkspacesRequest(server string, orgShortNameId string, params *List queryValues := queryURL.Query() - if params.WorkspaceIds != nil { + if params.Offset != nil { - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "workspaceIds", runtime.ParamLocationQuery, *params.WorkspaceIds); err != nil { + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "offset", runtime.ParamLocationQuery, *params.Offset); err != nil { return nil, err } else if parsed, err := url.ParseQuery(queryFrag); err != nil { return nil, err @@ -5970,9 +6574,9 @@ func NewListWorkspacesRequest(server string, orgShortNameId string, params *List } - if params.Offset != nil { + if params.Limit != nil { - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "offset", runtime.ParamLocationQuery, *params.Offset); err != nil { + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "limit", runtime.ParamLocationQuery, *params.Limit); err != nil { return nil, err } else if parsed, err := url.ParseQuery(queryFrag); err != nil { return nil, err @@ -5986,9 +6590,9 @@ func NewListWorkspacesRequest(server string, orgShortNameId string, params *List } - if params.Limit != nil { + if params.Sorts != nil { - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "limit", runtime.ParamLocationQuery, *params.Limit); err != nil { + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "sorts", runtime.ParamLocationQuery, *params.Sorts); err != nil { return nil, err } else if parsed, err := url.ParseQuery(queryFrag); err != nil { return nil, err @@ -6002,9 +6606,9 @@ func NewListWorkspacesRequest(server string, orgShortNameId string, params *List } - if params.Sorts != nil { + if params.Search != nil { - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "sorts", runtime.ParamLocationQuery, *params.Sorts); err != nil { + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "search", runtime.ParamLocationQuery, *params.Search); err != nil { return nil, err } else if parsed, err := url.ParseQuery(queryFrag); err != nil { return nil, err @@ -6018,9 +6622,9 @@ func NewListWorkspacesRequest(server string, orgShortNameId string, params *List } - if params.Search != nil { + if params.HasInvites != nil { - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "search", runtime.ParamLocationQuery, *params.Search); err != nil { + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "hasInvites", runtime.ParamLocationQuery, *params.HasInvites); err != nil { return nil, err } else if parsed, err := url.ParseQuery(queryFrag); err != nil { return nil, err @@ -6044,19 +6648,8 @@ func NewListWorkspacesRequest(server string, orgShortNameId string, params *List return req, nil } -// NewCreateWorkspaceRequest calls the generic CreateWorkspace builder with application/json body -func NewCreateWorkspaceRequest(server string, orgShortNameId string, body CreateWorkspaceJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) - if err != nil { - return nil, err - } - bodyReader = bytes.NewReader(buf) - return NewCreateWorkspaceRequestWithBody(server, orgShortNameId, "application/json", bodyReader) -} - -// NewCreateWorkspaceRequestWithBody generates requests for CreateWorkspace with any type of body -func NewCreateWorkspaceRequestWithBody(server string, orgShortNameId string, contentType string, body io.Reader) (*http.Request, error) { +// NewDeleteOrgUserRequest generates requests for DeleteOrgUser +func NewDeleteOrgUserRequest(server string, orgShortNameId string, userId string) (*http.Request, error) { var err error var pathParam0 string @@ -6066,12 +6659,19 @@ func NewCreateWorkspaceRequestWithBody(server string, orgShortNameId string, con return nil, err } + var pathParam1 string + + pathParam1, err = runtime.StyleParamWithLocation("simple", false, "userId", runtime.ParamLocationPath, userId) + if err != nil { + return nil, err + } + serverURL, err := url.Parse(server) if err != nil { return nil, err } - operationPath := fmt.Sprintf("/organizations/%s/workspaces", pathParam0) + operationPath := fmt.Sprintf("/organizations/%s/users/%s", pathParam0, pathParam1) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -6081,18 +6681,16 @@ func NewCreateWorkspaceRequestWithBody(server string, orgShortNameId string, con return nil, err } - req, err := http.NewRequest("POST", queryURL.String(), body) + req, err := http.NewRequest("DELETE", queryURL.String(), nil) if err != nil { return nil, err } - req.Header.Add("Content-Type", contentType) - return req, nil } -// NewDeleteWorkspaceRequest generates requests for DeleteWorkspace -func NewDeleteWorkspaceRequest(server string, orgShortNameId string, workspaceId string) (*http.Request, error) { +// NewGetUserRequest generates requests for GetUser +func NewGetUserRequest(server string, orgShortNameId string, userId string) (*http.Request, error) { var err error var pathParam0 string @@ -6104,7 +6702,7 @@ func NewDeleteWorkspaceRequest(server string, orgShortNameId string, workspaceId var pathParam1 string - pathParam1, err = runtime.StyleParamWithLocation("simple", false, "workspaceId", runtime.ParamLocationPath, workspaceId) + pathParam1, err = runtime.StyleParamWithLocation("simple", false, "userId", runtime.ParamLocationPath, userId) if err != nil { return nil, err } @@ -6114,7 +6712,7 @@ func NewDeleteWorkspaceRequest(server string, orgShortNameId string, workspaceId return nil, err } - operationPath := fmt.Sprintf("/organizations/%s/workspaces/%s", pathParam0, pathParam1) + operationPath := fmt.Sprintf("/organizations/%s/users/%s", pathParam0, pathParam1) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -6124,7 +6722,7 @@ func NewDeleteWorkspaceRequest(server string, orgShortNameId string, workspaceId return nil, err } - req, err := http.NewRequest("DELETE", queryURL.String(), nil) + req, err := http.NewRequest("GET", queryURL.String(), nil) if err != nil { return nil, err } @@ -6132,8 +6730,19 @@ func NewDeleteWorkspaceRequest(server string, orgShortNameId string, workspaceId return req, nil } -// NewGetWorkspaceRequest generates requests for GetWorkspace -func NewGetWorkspaceRequest(server string, orgShortNameId string, workspaceId string) (*http.Request, error) { +// NewMutateOrgUserRoleRequest calls the generic MutateOrgUserRole builder with application/json body +func NewMutateOrgUserRoleRequest(server string, orgShortNameId string, userId string, body MutateOrgUserRoleJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewMutateOrgUserRoleRequestWithBody(server, orgShortNameId, userId, "application/json", bodyReader) +} + +// NewMutateOrgUserRoleRequestWithBody generates requests for MutateOrgUserRole with any type of body +func NewMutateOrgUserRoleRequestWithBody(server string, orgShortNameId string, userId string, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string @@ -6145,7 +6754,7 @@ func NewGetWorkspaceRequest(server string, orgShortNameId string, workspaceId st var pathParam1 string - pathParam1, err = runtime.StyleParamWithLocation("simple", false, "workspaceId", runtime.ParamLocationPath, workspaceId) + pathParam1, err = runtime.StyleParamWithLocation("simple", false, "userId", runtime.ParamLocationPath, userId) if err != nil { return nil, err } @@ -6155,7 +6764,7 @@ func NewGetWorkspaceRequest(server string, orgShortNameId string, workspaceId st return nil, err } - operationPath := fmt.Sprintf("/organizations/%s/workspaces/%s", pathParam0, pathParam1) + operationPath := fmt.Sprintf("/organizations/%s/users/%s/role", pathParam0, pathParam1) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -6165,27 +6774,29 @@ func NewGetWorkspaceRequest(server string, orgShortNameId string, workspaceId st return nil, err } - req, err := http.NewRequest("GET", queryURL.String(), nil) + req, err := http.NewRequest("POST", queryURL.String(), body) if err != nil { return nil, err } + req.Header.Add("Content-Type", contentType) + return req, nil } -// NewUpdateWorkspaceRequest calls the generic UpdateWorkspace builder with application/json body -func NewUpdateWorkspaceRequest(server string, orgShortNameId string, workspaceId string, body UpdateWorkspaceJSONRequestBody) (*http.Request, error) { +// NewValidateCreditCardPaymentRequest calls the generic ValidateCreditCardPayment builder with application/json body +func NewValidateCreditCardPaymentRequest(server string, orgShortNameId string, body ValidateCreditCardPaymentJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) - return NewUpdateWorkspaceRequestWithBody(server, orgShortNameId, workspaceId, "application/json", bodyReader) + return NewValidateCreditCardPaymentRequestWithBody(server, orgShortNameId, "application/json", bodyReader) } -// NewUpdateWorkspaceRequestWithBody generates requests for UpdateWorkspace with any type of body -func NewUpdateWorkspaceRequestWithBody(server string, orgShortNameId string, workspaceId string, contentType string, body io.Reader) (*http.Request, error) { +// NewValidateCreditCardPaymentRequestWithBody generates requests for ValidateCreditCardPayment with any type of body +func NewValidateCreditCardPaymentRequestWithBody(server string, orgShortNameId string, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string @@ -6195,19 +6806,12 @@ func NewUpdateWorkspaceRequestWithBody(server string, orgShortNameId string, wor return nil, err } - var pathParam1 string - - pathParam1, err = runtime.StyleParamWithLocation("simple", false, "workspaceId", runtime.ParamLocationPath, workspaceId) - if err != nil { - return nil, err - } - serverURL, err := url.Parse(server) if err != nil { return nil, err } - operationPath := fmt.Sprintf("/organizations/%s/workspaces/%s", pathParam0, pathParam1) + operationPath := fmt.Sprintf("/organizations/%s/validate-credit-card-payment", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -6227,8 +6831,8 @@ func NewUpdateWorkspaceRequestWithBody(server string, orgShortNameId string, wor return req, nil } -// NewListWorkspaceDagFiltersRequest generates requests for ListWorkspaceDagFilters -func NewListWorkspaceDagFiltersRequest(server string, orgShortNameId string, workspaceId string) (*http.Request, error) { +// NewListWorkspacesRequest generates requests for ListWorkspaces +func NewListWorkspacesRequest(server string, orgShortNameId string, params *ListWorkspacesParams) (*http.Request, error) { var err error var pathParam0 string @@ -6238,60 +6842,12 @@ func NewListWorkspaceDagFiltersRequest(server string, orgShortNameId string, wor return nil, err } - var pathParam1 string - - pathParam1, err = runtime.StyleParamWithLocation("simple", false, "workspaceId", runtime.ParamLocationPath, workspaceId) - if err != nil { - return nil, err - } - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/organizations/%s/workspaces/%s/dag-filters", pathParam0, pathParam1) - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("GET", queryURL.String(), nil) - if err != nil { - return nil, err - } - - return req, nil -} - -// NewListWorkspaceDagsRequest generates requests for ListWorkspaceDags -func NewListWorkspaceDagsRequest(server string, orgShortNameId string, workspaceId string, params *ListWorkspaceDagsParams) (*http.Request, error) { - var err error - - var pathParam0 string - - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "orgShortNameId", runtime.ParamLocationPath, orgShortNameId) - if err != nil { - return nil, err - } - - var pathParam1 string - - pathParam1, err = runtime.StyleParamWithLocation("simple", false, "workspaceId", runtime.ParamLocationPath, workspaceId) - if err != nil { - return nil, err - } - serverURL, err := url.Parse(server) if err != nil { return nil, err } - operationPath := fmt.Sprintf("/organizations/%s/workspaces/%s/dags", pathParam0, pathParam1) + operationPath := fmt.Sprintf("/organizations/%s/workspaces", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -6303,9 +6859,9 @@ func NewListWorkspaceDagsRequest(server string, orgShortNameId string, workspace queryValues := queryURL.Query() - if params.PageSize != nil { + if params.WorkspaceIds != nil { - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "pageSize", runtime.ParamLocationQuery, *params.PageSize); err != nil { + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "workspaceIds", runtime.ParamLocationQuery, *params.WorkspaceIds); err != nil { return nil, err } else if parsed, err := url.ParseQuery(queryFrag); err != nil { return nil, err @@ -6319,9 +6875,9 @@ func NewListWorkspaceDagsRequest(server string, orgShortNameId string, workspace } - if params.OrderBy != nil { + if params.Offset != nil { - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "orderBy", runtime.ParamLocationQuery, *params.OrderBy); err != nil { + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "offset", runtime.ParamLocationQuery, *params.Offset); err != nil { return nil, err } else if parsed, err := url.ParseQuery(queryFrag); err != nil { return nil, err @@ -6335,9 +6891,9 @@ func NewListWorkspaceDagsRequest(server string, orgShortNameId string, workspace } - if params.Cursor != nil { + if params.Limit != nil { - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "cursor", runtime.ParamLocationQuery, *params.Cursor); err != nil { + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "limit", runtime.ParamLocationQuery, *params.Limit); err != nil { return nil, err } else if parsed, err := url.ParseQuery(queryFrag); err != nil { return nil, err @@ -6351,9 +6907,9 @@ func NewListWorkspaceDagsRequest(server string, orgShortNameId string, workspace } - if params.NumRuns != nil { + if params.Sorts != nil { - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "numRuns", runtime.ParamLocationQuery, *params.NumRuns); err != nil { + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "sorts", runtime.ParamLocationQuery, *params.Sorts); err != nil { return nil, err } else if parsed, err := url.ParseQuery(queryFrag); err != nil { return nil, err @@ -6367,9 +6923,9 @@ func NewListWorkspaceDagsRequest(server string, orgShortNameId string, workspace } - if params.Name != nil { + if params.Search != nil { - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "name", runtime.ParamLocationQuery, *params.Name); err != nil { + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "search", runtime.ParamLocationQuery, *params.Search); err != nil { return nil, err } else if parsed, err := url.ParseQuery(queryFrag); err != nil { return nil, err @@ -6383,153 +6939,97 @@ func NewListWorkspaceDagsRequest(server string, orgShortNameId string, workspace } - if params.NameLike != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "name__like", runtime.ParamLocationQuery, *params.NameLike); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } + queryURL.RawQuery = queryValues.Encode() + req, err := http.NewRequest("GET", queryURL.String(), nil) + if err != nil { + return nil, err } - if params.Owner != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "owner", runtime.ParamLocationQuery, *params.Owner); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } + return req, nil +} +// NewCreateWorkspaceRequest calls the generic CreateWorkspace builder with application/json body +func NewCreateWorkspaceRequest(server string, orgShortNameId string, body CreateWorkspaceJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err } + bodyReader = bytes.NewReader(buf) + return NewCreateWorkspaceRequestWithBody(server, orgShortNameId, "application/json", bodyReader) +} - if params.IsPaused != nil { +// NewCreateWorkspaceRequestWithBody generates requests for CreateWorkspace with any type of body +func NewCreateWorkspaceRequestWithBody(server string, orgShortNameId string, contentType string, body io.Reader) (*http.Request, error) { + var err error - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "isPaused", runtime.ParamLocationQuery, *params.IsPaused); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } + var pathParam0 string + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "orgShortNameId", runtime.ParamLocationPath, orgShortNameId) + if err != nil { + return nil, err } - if params.IsActive != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "isActive", runtime.ParamLocationQuery, *params.IsActive); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - + serverURL, err := url.Parse(server) + if err != nil { + return nil, err } - if params.LastRunStateIn != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "lastRunState__in", runtime.ParamLocationQuery, *params.LastRunStateIn); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } + operationPath := fmt.Sprintf("/organizations/%s/workspaces", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err } - if params.RunStateIn != nil { + req, err := http.NewRequest("POST", queryURL.String(), body) + if err != nil { + return nil, err + } - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "runState__in", runtime.ParamLocationQuery, *params.RunStateIn); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } + req.Header.Add("Content-Type", contentType) - } + return req, nil +} - if params.RunAfter != nil { +// NewDeleteWorkspaceRequest generates requests for DeleteWorkspace +func NewDeleteWorkspaceRequest(server string, orgShortNameId string, workspaceId string) (*http.Request, error) { + var err error - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "runAfter", runtime.ParamLocationQuery, *params.RunAfter); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } + var pathParam0 string + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "orgShortNameId", runtime.ParamLocationPath, orgShortNameId) + if err != nil { + return nil, err } - if params.TagIn != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "tag__in", runtime.ParamLocationQuery, *params.TagIn); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } + var pathParam1 string + pathParam1, err = runtime.StyleParamWithLocation("simple", false, "workspaceId", runtime.ParamLocationPath, workspaceId) + if err != nil { + return nil, err } - if params.DeploymentIdIn != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "deploymentId__in", runtime.ParamLocationQuery, *params.DeploymentIdIn); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + operationPath := fmt.Sprintf("/organizations/%s/workspaces/%s", pathParam0, pathParam1) + if operationPath[0] == '/' { + operationPath = "." + operationPath } - queryURL.RawQuery = queryValues.Encode() + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } - req, err := http.NewRequest("GET", queryURL.String(), nil) + req, err := http.NewRequest("DELETE", queryURL.String(), nil) if err != nil { return nil, err } @@ -6537,8 +7037,8 @@ func NewListWorkspaceDagsRequest(server string, orgShortNameId string, workspace return req, nil } -// NewListWorkspaceTeamsRequest generates requests for ListWorkspaceTeams -func NewListWorkspaceTeamsRequest(server string, orgShortNameId string, workspaceId string, params *ListWorkspaceTeamsParams) (*http.Request, error) { +// NewGetWorkspaceRequest generates requests for GetWorkspace +func NewGetWorkspaceRequest(server string, orgShortNameId string, workspaceId string) (*http.Request, error) { var err error var pathParam0 string @@ -6560,7 +7060,7 @@ func NewListWorkspaceTeamsRequest(server string, orgShortNameId string, workspac return nil, err } - operationPath := fmt.Sprintf("/organizations/%s/workspaces/%s/teams", pathParam0, pathParam1) + operationPath := fmt.Sprintf("/organizations/%s/workspaces/%s", pathParam0, pathParam1) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -6570,74 +7070,6 @@ func NewListWorkspaceTeamsRequest(server string, orgShortNameId string, workspac return nil, err } - queryValues := queryURL.Query() - - if params.Offset != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "offset", runtime.ParamLocationQuery, *params.Offset); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - - if params.Limit != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "limit", runtime.ParamLocationQuery, *params.Limit); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - - if params.Sorts != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "sorts", runtime.ParamLocationQuery, *params.Sorts); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - - if params.Search != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "search", runtime.ParamLocationQuery, *params.Search); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - - queryURL.RawQuery = queryValues.Encode() - req, err := http.NewRequest("GET", queryURL.String(), nil) if err != nil { return nil, err @@ -6646,67 +7078,19 @@ func NewListWorkspaceTeamsRequest(server string, orgShortNameId string, workspac return req, nil } -// NewDeleteWorkspaceTeamRequest generates requests for DeleteWorkspaceTeam -func NewDeleteWorkspaceTeamRequest(server string, orgShortNameId string, workspaceId string, teamId string) (*http.Request, error) { - var err error - - var pathParam0 string - - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "orgShortNameId", runtime.ParamLocationPath, orgShortNameId) - if err != nil { - return nil, err - } - - var pathParam1 string - - pathParam1, err = runtime.StyleParamWithLocation("simple", false, "workspaceId", runtime.ParamLocationPath, workspaceId) - if err != nil { - return nil, err - } - - var pathParam2 string - - pathParam2, err = runtime.StyleParamWithLocation("simple", false, "teamId", runtime.ParamLocationPath, teamId) - if err != nil { - return nil, err - } - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/organizations/%s/workspaces/%s/teams/%s", pathParam0, pathParam1, pathParam2) - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("DELETE", queryURL.String(), nil) - if err != nil { - return nil, err - } - - return req, nil -} - -// NewMutateWorkspaceTeamRoleRequest calls the generic MutateWorkspaceTeamRole builder with application/json body -func NewMutateWorkspaceTeamRoleRequest(server string, orgShortNameId string, workspaceId string, teamId string, body MutateWorkspaceTeamRoleJSONRequestBody) (*http.Request, error) { +// NewUpdateWorkspaceRequest calls the generic UpdateWorkspace builder with application/json body +func NewUpdateWorkspaceRequest(server string, orgShortNameId string, workspaceId string, body UpdateWorkspaceJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) - return NewMutateWorkspaceTeamRoleRequestWithBody(server, orgShortNameId, workspaceId, teamId, "application/json", bodyReader) + return NewUpdateWorkspaceRequestWithBody(server, orgShortNameId, workspaceId, "application/json", bodyReader) } -// NewMutateWorkspaceTeamRoleRequestWithBody generates requests for MutateWorkspaceTeamRole with any type of body -func NewMutateWorkspaceTeamRoleRequestWithBody(server string, orgShortNameId string, workspaceId string, teamId string, contentType string, body io.Reader) (*http.Request, error) { +// NewUpdateWorkspaceRequestWithBody generates requests for UpdateWorkspace with any type of body +func NewUpdateWorkspaceRequestWithBody(server string, orgShortNameId string, workspaceId string, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string @@ -6723,19 +7107,12 @@ func NewMutateWorkspaceTeamRoleRequestWithBody(server string, orgShortNameId str return nil, err } - var pathParam2 string - - pathParam2, err = runtime.StyleParamWithLocation("simple", false, "teamId", runtime.ParamLocationPath, teamId) - if err != nil { - return nil, err - } - serverURL, err := url.Parse(server) if err != nil { return nil, err } - operationPath := fmt.Sprintf("/organizations/%s/workspaces/%s/teams/%s/role", pathParam0, pathParam1, pathParam2) + operationPath := fmt.Sprintf("/organizations/%s/workspaces/%s", pathParam0, pathParam1) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -6755,8 +7132,8 @@ func NewMutateWorkspaceTeamRoleRequestWithBody(server string, orgShortNameId str return req, nil } -// NewListWorkspaceUsersRequest generates requests for ListWorkspaceUsers -func NewListWorkspaceUsersRequest(server string, orgShortNameId string, workspaceId string, params *ListWorkspaceUsersParams) (*http.Request, error) { +// NewListWorkspaceApiTokensRequest generates requests for ListWorkspaceApiTokens +func NewListWorkspaceApiTokensRequest(server string, orgShortNameId string, workspaceId string, params *ListWorkspaceApiTokensParams) (*http.Request, error) { var err error var pathParam0 string @@ -6778,7 +7155,7 @@ func NewListWorkspaceUsersRequest(server string, orgShortNameId string, workspac return nil, err } - operationPath := fmt.Sprintf("/organizations/%s/workspaces/%s/users", pathParam0, pathParam1) + operationPath := fmt.Sprintf("/organizations/%s/workspaces/%s/api-tokens", pathParam0, pathParam1) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -6838,22 +7215,6 @@ func NewListWorkspaceUsersRequest(server string, orgShortNameId string, workspac } - if params.Search != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "search", runtime.ParamLocationQuery, *params.Search); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - queryURL.RawQuery = queryValues.Encode() req, err := http.NewRequest("GET", queryURL.String(), nil) @@ -6864,8 +7225,19 @@ func NewListWorkspaceUsersRequest(server string, orgShortNameId string, workspac return req, nil } -// NewDeleteWorkspaceUserRequest generates requests for DeleteWorkspaceUser -func NewDeleteWorkspaceUserRequest(server string, orgShortNameId string, workspaceId string, userId string) (*http.Request, error) { +// NewCreateWorkspaceApiTokenRequest calls the generic CreateWorkspaceApiToken builder with application/json body +func NewCreateWorkspaceApiTokenRequest(server string, orgShortNameId string, workspaceId string, body CreateWorkspaceApiTokenJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewCreateWorkspaceApiTokenRequestWithBody(server, orgShortNameId, workspaceId, "application/json", bodyReader) +} + +// NewCreateWorkspaceApiTokenRequestWithBody generates requests for CreateWorkspaceApiToken with any type of body +func NewCreateWorkspaceApiTokenRequestWithBody(server string, orgShortNameId string, workspaceId string, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string @@ -6882,19 +7254,12 @@ func NewDeleteWorkspaceUserRequest(server string, orgShortNameId string, workspa return nil, err } - var pathParam2 string - - pathParam2, err = runtime.StyleParamWithLocation("simple", false, "userId", runtime.ParamLocationPath, userId) - if err != nil { - return nil, err - } - serverURL, err := url.Parse(server) if err != nil { return nil, err } - operationPath := fmt.Sprintf("/organizations/%s/workspaces/%s/users/%s", pathParam0, pathParam1, pathParam2) + operationPath := fmt.Sprintf("/organizations/%s/workspaces/%s/api-tokens", pathParam0, pathParam1) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -6904,27 +7269,18 @@ func NewDeleteWorkspaceUserRequest(server string, orgShortNameId string, workspa return nil, err } - req, err := http.NewRequest("DELETE", queryURL.String(), nil) + req, err := http.NewRequest("POST", queryURL.String(), body) if err != nil { return nil, err } - return req, nil -} + req.Header.Add("Content-Type", contentType) -// NewMutateWorkspaceUserRoleRequest calls the generic MutateWorkspaceUserRole builder with application/json body -func NewMutateWorkspaceUserRoleRequest(server string, orgShortNameId string, workspaceId string, userId string, body MutateWorkspaceUserRoleJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) - if err != nil { - return nil, err - } - bodyReader = bytes.NewReader(buf) - return NewMutateWorkspaceUserRoleRequestWithBody(server, orgShortNameId, workspaceId, userId, "application/json", bodyReader) + return req, nil } -// NewMutateWorkspaceUserRoleRequestWithBody generates requests for MutateWorkspaceUserRole with any type of body -func NewMutateWorkspaceUserRoleRequestWithBody(server string, orgShortNameId string, workspaceId string, userId string, contentType string, body io.Reader) (*http.Request, error) { +// NewDeleteWorkspaceApiTokenRequest generates requests for DeleteWorkspaceApiToken +func NewDeleteWorkspaceApiTokenRequest(server string, orgShortNameId string, workspaceId string, apiTokenId string) (*http.Request, error) { var err error var pathParam0 string @@ -6943,7 +7299,7 @@ func NewMutateWorkspaceUserRoleRequestWithBody(server string, orgShortNameId str var pathParam2 string - pathParam2, err = runtime.StyleParamWithLocation("simple", false, "userId", runtime.ParamLocationPath, userId) + pathParam2, err = runtime.StyleParamWithLocation("simple", false, "apiTokenId", runtime.ParamLocationPath, apiTokenId) if err != nil { return nil, err } @@ -6953,7 +7309,7 @@ func NewMutateWorkspaceUserRoleRequestWithBody(server string, orgShortNameId str return nil, err } - operationPath := fmt.Sprintf("/organizations/%s/workspaces/%s/users/%s/role", pathParam0, pathParam1, pathParam2) + operationPath := fmt.Sprintf("/organizations/%s/workspaces/%s/api-tokens/%s", pathParam0, pathParam1, pathParam2) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -6963,54 +7319,53 @@ func NewMutateWorkspaceUserRoleRequestWithBody(server string, orgShortNameId str return nil, err } - req, err := http.NewRequest("POST", queryURL.String(), body) + req, err := http.NewRequest("DELETE", queryURL.String(), nil) if err != nil { return nil, err } - req.Header.Add("Content-Type", contentType) - return req, nil } -// NewGetSelfUserRequest generates requests for GetSelfUser -func NewGetSelfUserRequest(server string, params *GetSelfUserParams) (*http.Request, error) { +// NewGetWorkspaceApiTokenRequest generates requests for GetWorkspaceApiToken +func NewGetWorkspaceApiTokenRequest(server string, orgShortNameId string, workspaceId string, apiTokenId string) (*http.Request, error) { var err error - serverURL, err := url.Parse(server) + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "orgShortNameId", runtime.ParamLocationPath, orgShortNameId) if err != nil { return nil, err } - operationPath := fmt.Sprintf("/users/self") - if operationPath[0] == '/' { - operationPath = "." + operationPath - } + var pathParam1 string - queryURL, err := serverURL.Parse(operationPath) + pathParam1, err = runtime.StyleParamWithLocation("simple", false, "workspaceId", runtime.ParamLocationPath, workspaceId) if err != nil { return nil, err } - queryValues := queryURL.Query() + var pathParam2 string - if params.CreateIfNotExist != nil { + pathParam2, err = runtime.StyleParamWithLocation("simple", false, "apiTokenId", runtime.ParamLocationPath, apiTokenId) + if err != nil { + return nil, err + } - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "createIfNotExist", runtime.ParamLocationQuery, *params.CreateIfNotExist); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + operationPath := fmt.Sprintf("/organizations/%s/workspaces/%s/api-tokens/%s", pathParam0, pathParam1, pathParam2) + if operationPath[0] == '/' { + operationPath = "." + operationPath } - queryURL.RawQuery = queryValues.Encode() + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } req, err := http.NewRequest("GET", queryURL.String(), nil) if err != nil { @@ -7020,24 +7375,38 @@ func NewGetSelfUserRequest(server string, params *GetSelfUserParams) (*http.Requ return req, nil } -// NewUpdateSelfUserInviteRequest calls the generic UpdateSelfUserInvite builder with application/json body -func NewUpdateSelfUserInviteRequest(server string, inviteId string, body UpdateSelfUserInviteJSONRequestBody) (*http.Request, error) { +// NewUpdateWorkspaceApiTokenRequest calls the generic UpdateWorkspaceApiToken builder with application/json body +func NewUpdateWorkspaceApiTokenRequest(server string, orgShortNameId string, workspaceId string, apiTokenId string, body UpdateWorkspaceApiTokenJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) - return NewUpdateSelfUserInviteRequestWithBody(server, inviteId, "application/json", bodyReader) + return NewUpdateWorkspaceApiTokenRequestWithBody(server, orgShortNameId, workspaceId, apiTokenId, "application/json", bodyReader) } -// NewUpdateSelfUserInviteRequestWithBody generates requests for UpdateSelfUserInvite with any type of body -func NewUpdateSelfUserInviteRequestWithBody(server string, inviteId string, contentType string, body io.Reader) (*http.Request, error) { +// NewUpdateWorkspaceApiTokenRequestWithBody generates requests for UpdateWorkspaceApiToken with any type of body +func NewUpdateWorkspaceApiTokenRequestWithBody(server string, orgShortNameId string, workspaceId string, apiTokenId string, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "inviteId", runtime.ParamLocationPath, inviteId) + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "orgShortNameId", runtime.ParamLocationPath, orgShortNameId) + if err != nil { + return nil, err + } + + var pathParam1 string + + pathParam1, err = runtime.StyleParamWithLocation("simple", false, "workspaceId", runtime.ParamLocationPath, workspaceId) + if err != nil { + return nil, err + } + + var pathParam2 string + + pathParam2, err = runtime.StyleParamWithLocation("simple", false, "apiTokenId", runtime.ParamLocationPath, apiTokenId) if err != nil { return nil, err } @@ -7047,7 +7416,7 @@ func NewUpdateSelfUserInviteRequestWithBody(server string, inviteId string, cont return nil, err } - operationPath := fmt.Sprintf("/users/self/invites/%s", pathParam0) + operationPath := fmt.Sprintf("/organizations/%s/workspaces/%s/api-tokens/%s", pathParam0, pathParam1, pathParam2) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -7067,485 +7436,1477 @@ func NewUpdateSelfUserInviteRequestWithBody(server string, inviteId string, cont return req, nil } -func (c *Client) applyEditors(ctx context.Context, req *http.Request, additionalEditors []RequestEditorFn) error { - for _, r := range c.RequestEditors { - if err := r(ctx, req); err != nil { - return err - } - } - for _, r := range additionalEditors { - if err := r(ctx, req); err != nil { - return err - } - } - return nil -} +// NewRotateWorkspaceApiTokenRequest generates requests for RotateWorkspaceApiToken +func NewRotateWorkspaceApiTokenRequest(server string, orgShortNameId string, workspaceId string, apiTokenId string) (*http.Request, error) { + var err error -// ClientWithResponses builds on ClientInterface to offer response payloads -type ClientWithResponses struct { - ClientInterface -} + var pathParam0 string -// NewClientWithResponses creates a new ClientWithResponses, which wraps -// Client with return type handling -func NewClientWithResponses(server string, opts ...ClientOption) (*ClientWithResponses, error) { - client, err := NewClient(server, opts...) + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "orgShortNameId", runtime.ParamLocationPath, orgShortNameId) if err != nil { return nil, err } - return &ClientWithResponses{client}, nil -} -// WithBaseURL overrides the baseURL. -func WithBaseURL(baseURL string) ClientOption { - return func(c *Client) error { - newBaseURL, err := url.Parse(baseURL) - if err != nil { - return err - } - c.Server = newBaseURL.String() - return nil + var pathParam1 string + + pathParam1, err = runtime.StyleParamWithLocation("simple", false, "workspaceId", runtime.ParamLocationPath, workspaceId) + if err != nil { + return nil, err } -} -// ClientWithResponsesInterface is the interface specification for the client with responses above. -type ClientWithResponsesInterface interface { - // GetUserInvite request - GetUserInviteWithResponse(ctx context.Context, inviteId string, reqEditors ...RequestEditorFn) (*GetUserInviteResponse, error) + var pathParam2 string - // ValidateSsoLogin request with any body - ValidateSsoLoginWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ValidateSsoLoginResponse, error) + pathParam2, err = runtime.StyleParamWithLocation("simple", false, "apiTokenId", runtime.ParamLocationPath, apiTokenId) + if err != nil { + return nil, err + } - ValidateSsoLoginWithResponse(ctx context.Context, body ValidateSsoLoginJSONRequestBody, reqEditors ...RequestEditorFn) (*ValidateSsoLoginResponse, error) + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } - // GetSharedCluster request - GetSharedClusterWithResponse(ctx context.Context, params *GetSharedClusterParams, reqEditors ...RequestEditorFn) (*GetSharedClusterResponse, error) + operationPath := fmt.Sprintf("/organizations/%s/workspaces/%s/api-tokens/%s/rotate", pathParam0, pathParam1, pathParam2) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } - // GetClusterOptions request - GetClusterOptionsWithResponse(ctx context.Context, params *GetClusterOptionsParams, reqEditors ...RequestEditorFn) (*GetClusterOptionsResponse, error) + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } - // GetDeploymentOptions request - GetDeploymentOptionsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetDeploymentOptionsResponse, error) + req, err := http.NewRequest("POST", queryURL.String(), nil) + if err != nil { + return nil, err + } - // ListOrganizationAuthIds request - ListOrganizationAuthIdsWithResponse(ctx context.Context, params *ListOrganizationAuthIdsParams, reqEditors ...RequestEditorFn) (*ListOrganizationAuthIdsResponse, error) + return req, nil +} - // ListOrganizations request - ListOrganizationsWithResponse(ctx context.Context, params *ListOrganizationsParams, reqEditors ...RequestEditorFn) (*ListOrganizationsResponse, error) +// NewListWorkspaceDagFiltersRequest generates requests for ListWorkspaceDagFilters +func NewListWorkspaceDagFiltersRequest(server string, orgShortNameId string, workspaceId string) (*http.Request, error) { + var err error - // CreateOrganization request with any body - CreateOrganizationWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateOrganizationResponse, error) + var pathParam0 string - CreateOrganizationWithResponse(ctx context.Context, body CreateOrganizationJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateOrganizationResponse, error) + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "orgShortNameId", runtime.ParamLocationPath, orgShortNameId) + if err != nil { + return nil, err + } - // GetOrganization request - GetOrganizationWithResponse(ctx context.Context, orgShortNameId string, params *GetOrganizationParams, reqEditors ...RequestEditorFn) (*GetOrganizationResponse, error) + var pathParam1 string - // UpdateOrganization request with any body - UpdateOrganizationWithBodyWithResponse(ctx context.Context, orgShortNameId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateOrganizationResponse, error) + pathParam1, err = runtime.StyleParamWithLocation("simple", false, "workspaceId", runtime.ParamLocationPath, workspaceId) + if err != nil { + return nil, err + } - UpdateOrganizationWithResponse(ctx context.Context, orgShortNameId string, body UpdateOrganizationJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateOrganizationResponse, error) + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } - // GetOrganizationAuditLogs request - GetOrganizationAuditLogsWithResponse(ctx context.Context, orgShortNameId string, params *GetOrganizationAuditLogsParams, reqEditors ...RequestEditorFn) (*GetOrganizationAuditLogsResponse, error) + operationPath := fmt.Sprintf("/organizations/%s/workspaces/%s/dag-filters", pathParam0, pathParam1) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } - // ListClusters request - ListClustersWithResponse(ctx context.Context, orgShortNameId string, params *ListClustersParams, reqEditors ...RequestEditorFn) (*ListClustersResponse, error) + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } - // CreateAwsCluster request with any body - CreateAwsClusterWithBodyWithResponse(ctx context.Context, orgShortNameId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateAwsClusterResponse, error) + req, err := http.NewRequest("GET", queryURL.String(), nil) + if err != nil { + return nil, err + } - CreateAwsClusterWithResponse(ctx context.Context, orgShortNameId string, body CreateAwsClusterJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateAwsClusterResponse, error) + return req, nil +} - // UpdateAwsCluster request with any body - UpdateAwsClusterWithBodyWithResponse(ctx context.Context, orgShortNameId string, clusterId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateAwsClusterResponse, error) +// NewListWorkspaceDagsRequest generates requests for ListWorkspaceDags +func NewListWorkspaceDagsRequest(server string, orgShortNameId string, workspaceId string, params *ListWorkspaceDagsParams) (*http.Request, error) { + var err error - UpdateAwsClusterWithResponse(ctx context.Context, orgShortNameId string, clusterId string, body UpdateAwsClusterJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateAwsClusterResponse, error) + var pathParam0 string - // CreateAzureCluster request with any body - CreateAzureClusterWithBodyWithResponse(ctx context.Context, orgShortNameId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateAzureClusterResponse, error) + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "orgShortNameId", runtime.ParamLocationPath, orgShortNameId) + if err != nil { + return nil, err + } - CreateAzureClusterWithResponse(ctx context.Context, orgShortNameId string, body CreateAzureClusterJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateAzureClusterResponse, error) + var pathParam1 string - // UpdateAzureCluster request with any body - UpdateAzureClusterWithBodyWithResponse(ctx context.Context, orgShortNameId string, clusterId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateAzureClusterResponse, error) + pathParam1, err = runtime.StyleParamWithLocation("simple", false, "workspaceId", runtime.ParamLocationPath, workspaceId) + if err != nil { + return nil, err + } - UpdateAzureClusterWithResponse(ctx context.Context, orgShortNameId string, clusterId string, body UpdateAzureClusterJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateAzureClusterResponse, error) + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } - // CreateGcpCluster request with any body - CreateGcpClusterWithBodyWithResponse(ctx context.Context, orgShortNameId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateGcpClusterResponse, error) + operationPath := fmt.Sprintf("/organizations/%s/workspaces/%s/dags", pathParam0, pathParam1) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } - CreateGcpClusterWithResponse(ctx context.Context, orgShortNameId string, body CreateGcpClusterJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateGcpClusterResponse, error) + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } - // UpdateGcpCluster request with any body - UpdateGcpClusterWithBodyWithResponse(ctx context.Context, orgShortNameId string, clusterId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateGcpClusterResponse, error) + queryValues := queryURL.Query() - UpdateGcpClusterWithResponse(ctx context.Context, orgShortNameId string, clusterId string, body UpdateGcpClusterJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateGcpClusterResponse, error) + if params.PageSize != nil { - // DeleteCluster request - DeleteClusterWithResponse(ctx context.Context, orgShortNameId string, clusterId string, reqEditors ...RequestEditorFn) (*DeleteClusterResponse, error) + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "pageSize", runtime.ParamLocationQuery, *params.PageSize); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } - // GetCluster request - GetClusterWithResponse(ctx context.Context, orgShortNameId string, clusterId string, reqEditors ...RequestEditorFn) (*GetClusterResponse, error) + } - // ListManagedDomains request - ListManagedDomainsWithResponse(ctx context.Context, orgShortNameId string, reqEditors ...RequestEditorFn) (*ListManagedDomainsResponse, error) + if params.OrderBy != nil { - // CreateManagedDomain request with any body - CreateManagedDomainWithBodyWithResponse(ctx context.Context, orgShortNameId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateManagedDomainResponse, error) + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "orderBy", runtime.ParamLocationQuery, *params.OrderBy); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } - CreateManagedDomainWithResponse(ctx context.Context, orgShortNameId string, body CreateManagedDomainJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateManagedDomainResponse, error) + } - // DeleteManagedDomain request - DeleteManagedDomainWithResponse(ctx context.Context, orgShortNameId string, domainId string, reqEditors ...RequestEditorFn) (*DeleteManagedDomainResponse, error) + if params.Cursor != nil { - // GetManagedDomain request - GetManagedDomainWithResponse(ctx context.Context, orgShortNameId string, domainId string, reqEditors ...RequestEditorFn) (*GetManagedDomainResponse, error) + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "cursor", runtime.ParamLocationQuery, *params.Cursor); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } - // UpdateManagedDomain request with any body - UpdateManagedDomainWithBodyWithResponse(ctx context.Context, orgShortNameId string, domainId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateManagedDomainResponse, error) + } - UpdateManagedDomainWithResponse(ctx context.Context, orgShortNameId string, domainId string, body UpdateManagedDomainJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateManagedDomainResponse, error) + if params.NumRuns != nil { - // VerifyManagedDomain request - VerifyManagedDomainWithResponse(ctx context.Context, orgShortNameId string, domainId string, reqEditors ...RequestEditorFn) (*VerifyManagedDomainResponse, error) + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "numRuns", runtime.ParamLocationQuery, *params.NumRuns); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } - // GetDraftInvoice request - GetDraftInvoiceWithResponse(ctx context.Context, orgShortNameId string, reqEditors ...RequestEditorFn) (*GetDraftInvoiceResponse, error) + } - // CreateUserInvite request with any body - CreateUserInviteWithBodyWithResponse(ctx context.Context, orgShortNameId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateUserInviteResponse, error) + if params.Name != nil { - CreateUserInviteWithResponse(ctx context.Context, orgShortNameId string, body CreateUserInviteJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateUserInviteResponse, error) + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "name", runtime.ParamLocationQuery, *params.Name); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } - // DeleteUserInvite request - DeleteUserInviteWithResponse(ctx context.Context, orgShortNameId string, inviteId string, reqEditors ...RequestEditorFn) (*DeleteUserInviteResponse, error) + } - // GetPaymentMethod request - GetPaymentMethodWithResponse(ctx context.Context, orgShortNameId string, reqEditors ...RequestEditorFn) (*GetPaymentMethodResponse, error) + if params.NameLike != nil { - // DeleteSsoBypassKey request - DeleteSsoBypassKeyWithResponse(ctx context.Context, orgShortNameId string, reqEditors ...RequestEditorFn) (*DeleteSsoBypassKeyResponse, error) + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "name__like", runtime.ParamLocationQuery, *params.NameLike); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } - // GetSsoBypassKey request - GetSsoBypassKeyWithResponse(ctx context.Context, orgShortNameId string, reqEditors ...RequestEditorFn) (*GetSsoBypassKeyResponse, error) + } - // UpsertSsoBypassKey request - UpsertSsoBypassKeyWithResponse(ctx context.Context, orgShortNameId string, reqEditors ...RequestEditorFn) (*UpsertSsoBypassKeyResponse, error) + if params.Owner != nil { - // ListSsoConnections request - ListSsoConnectionsWithResponse(ctx context.Context, orgShortNameId string, reqEditors ...RequestEditorFn) (*ListSsoConnectionsResponse, error) + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "owner", runtime.ParamLocationQuery, *params.Owner); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } - // CreateSsoConnection request with any body - CreateSsoConnectionWithBodyWithResponse(ctx context.Context, orgShortNameId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateSsoConnectionResponse, error) + } - CreateSsoConnectionWithResponse(ctx context.Context, orgShortNameId string, body CreateSsoConnectionJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateSsoConnectionResponse, error) + if params.IsPaused != nil { - // DeleteSsoConnection request - DeleteSsoConnectionWithResponse(ctx context.Context, orgShortNameId string, connectionId string, reqEditors ...RequestEditorFn) (*DeleteSsoConnectionResponse, error) + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "isPaused", runtime.ParamLocationQuery, *params.IsPaused); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } - // GetSsoConnection request - GetSsoConnectionWithResponse(ctx context.Context, orgShortNameId string, connectionId string, reqEditors ...RequestEditorFn) (*GetSsoConnectionResponse, error) + } - // UpdateSsoConnection request with any body - UpdateSsoConnectionWithBodyWithResponse(ctx context.Context, orgShortNameId string, connectionId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateSsoConnectionResponse, error) + if params.IsActive != nil { - UpdateSsoConnectionWithResponse(ctx context.Context, orgShortNameId string, connectionId string, body UpdateSsoConnectionJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateSsoConnectionResponse, error) + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "isActive", runtime.ParamLocationQuery, *params.IsActive); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } - // GetStripeClientSecret request - GetStripeClientSecretWithResponse(ctx context.Context, orgShortNameId string, pType GetStripeClientSecretParamsType, reqEditors ...RequestEditorFn) (*GetStripeClientSecretResponse, error) + } - // ListOrganizationTeams request - ListOrganizationTeamsWithResponse(ctx context.Context, orgShortNameId string, params *ListOrganizationTeamsParams, reqEditors ...RequestEditorFn) (*ListOrganizationTeamsResponse, error) + if params.LastRunStateIn != nil { - // CreateTeam request with any body - CreateTeamWithBodyWithResponse(ctx context.Context, orgShortNameId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateTeamResponse, error) + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "lastRunState__in", runtime.ParamLocationQuery, *params.LastRunStateIn); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } - CreateTeamWithResponse(ctx context.Context, orgShortNameId string, body CreateTeamJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateTeamResponse, error) + } - // DeleteTeam request - DeleteTeamWithResponse(ctx context.Context, orgShortNameId string, teamId string, reqEditors ...RequestEditorFn) (*DeleteTeamResponse, error) + if params.RunStateIn != nil { - // GetTeam request - GetTeamWithResponse(ctx context.Context, orgShortNameId string, teamId string, reqEditors ...RequestEditorFn) (*GetTeamResponse, error) + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "runState__in", runtime.ParamLocationQuery, *params.RunStateIn); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } - // UpdateTeam request with any body - UpdateTeamWithBodyWithResponse(ctx context.Context, orgShortNameId string, teamId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateTeamResponse, error) + } - UpdateTeamWithResponse(ctx context.Context, orgShortNameId string, teamId string, body UpdateTeamJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateTeamResponse, error) + if params.RunAfter != nil { - // AddTeamMembers request with any body - AddTeamMembersWithBodyWithResponse(ctx context.Context, orgShortNameId string, teamId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*AddTeamMembersResponse, error) + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "runAfter", runtime.ParamLocationQuery, *params.RunAfter); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } - AddTeamMembersWithResponse(ctx context.Context, orgShortNameId string, teamId string, body AddTeamMembersJSONRequestBody, reqEditors ...RequestEditorFn) (*AddTeamMembersResponse, error) + } - // RemoveTeamMember request - RemoveTeamMemberWithResponse(ctx context.Context, orgShortNameId string, teamId string, memberId string, reqEditors ...RequestEditorFn) (*RemoveTeamMemberResponse, error) + if params.TagIn != nil { - // ListOrgUsers request - ListOrgUsersWithResponse(ctx context.Context, orgShortNameId string, params *ListOrgUsersParams, reqEditors ...RequestEditorFn) (*ListOrgUsersResponse, error) + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "tag__in", runtime.ParamLocationQuery, *params.TagIn); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } - // DeleteOrgUser request - DeleteOrgUserWithResponse(ctx context.Context, orgShortNameId string, userId string, reqEditors ...RequestEditorFn) (*DeleteOrgUserResponse, error) + } - // GetUser request - GetUserWithResponse(ctx context.Context, orgShortNameId string, userId string, reqEditors ...RequestEditorFn) (*GetUserResponse, error) + if params.DeploymentIdIn != nil { - // MutateOrgUserRole request with any body - MutateOrgUserRoleWithBodyWithResponse(ctx context.Context, orgShortNameId string, userId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*MutateOrgUserRoleResponse, error) + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "deploymentId__in", runtime.ParamLocationQuery, *params.DeploymentIdIn); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } - MutateOrgUserRoleWithResponse(ctx context.Context, orgShortNameId string, userId string, body MutateOrgUserRoleJSONRequestBody, reqEditors ...RequestEditorFn) (*MutateOrgUserRoleResponse, error) + } - // ValidateCreditCardPayment request with any body - ValidateCreditCardPaymentWithBodyWithResponse(ctx context.Context, orgShortNameId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ValidateCreditCardPaymentResponse, error) + queryURL.RawQuery = queryValues.Encode() - ValidateCreditCardPaymentWithResponse(ctx context.Context, orgShortNameId string, body ValidateCreditCardPaymentJSONRequestBody, reqEditors ...RequestEditorFn) (*ValidateCreditCardPaymentResponse, error) + req, err := http.NewRequest("GET", queryURL.String(), nil) + if err != nil { + return nil, err + } - // ListWorkspaces request - ListWorkspacesWithResponse(ctx context.Context, orgShortNameId string, params *ListWorkspacesParams, reqEditors ...RequestEditorFn) (*ListWorkspacesResponse, error) + return req, nil +} - // CreateWorkspace request with any body - CreateWorkspaceWithBodyWithResponse(ctx context.Context, orgShortNameId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateWorkspaceResponse, error) +// NewListWorkspaceTeamsRequest generates requests for ListWorkspaceTeams +func NewListWorkspaceTeamsRequest(server string, orgShortNameId string, workspaceId string, params *ListWorkspaceTeamsParams) (*http.Request, error) { + var err error - CreateWorkspaceWithResponse(ctx context.Context, orgShortNameId string, body CreateWorkspaceJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateWorkspaceResponse, error) + var pathParam0 string - // DeleteWorkspace request - DeleteWorkspaceWithResponse(ctx context.Context, orgShortNameId string, workspaceId string, reqEditors ...RequestEditorFn) (*DeleteWorkspaceResponse, error) + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "orgShortNameId", runtime.ParamLocationPath, orgShortNameId) + if err != nil { + return nil, err + } - // GetWorkspace request - GetWorkspaceWithResponse(ctx context.Context, orgShortNameId string, workspaceId string, reqEditors ...RequestEditorFn) (*GetWorkspaceResponse, error) + var pathParam1 string - // UpdateWorkspace request with any body - UpdateWorkspaceWithBodyWithResponse(ctx context.Context, orgShortNameId string, workspaceId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateWorkspaceResponse, error) + pathParam1, err = runtime.StyleParamWithLocation("simple", false, "workspaceId", runtime.ParamLocationPath, workspaceId) + if err != nil { + return nil, err + } - UpdateWorkspaceWithResponse(ctx context.Context, orgShortNameId string, workspaceId string, body UpdateWorkspaceJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateWorkspaceResponse, error) + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } - // ListWorkspaceDagFilters request - ListWorkspaceDagFiltersWithResponse(ctx context.Context, orgShortNameId string, workspaceId string, reqEditors ...RequestEditorFn) (*ListWorkspaceDagFiltersResponse, error) + operationPath := fmt.Sprintf("/organizations/%s/workspaces/%s/teams", pathParam0, pathParam1) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } - // ListWorkspaceDags request - ListWorkspaceDagsWithResponse(ctx context.Context, orgShortNameId string, workspaceId string, params *ListWorkspaceDagsParams, reqEditors ...RequestEditorFn) (*ListWorkspaceDagsResponse, error) + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } - // ListWorkspaceTeams request - ListWorkspaceTeamsWithResponse(ctx context.Context, orgShortNameId string, workspaceId string, params *ListWorkspaceTeamsParams, reqEditors ...RequestEditorFn) (*ListWorkspaceTeamsResponse, error) + queryValues := queryURL.Query() - // DeleteWorkspaceTeam request - DeleteWorkspaceTeamWithResponse(ctx context.Context, orgShortNameId string, workspaceId string, teamId string, reqEditors ...RequestEditorFn) (*DeleteWorkspaceTeamResponse, error) + if params.Offset != nil { - // MutateWorkspaceTeamRole request with any body - MutateWorkspaceTeamRoleWithBodyWithResponse(ctx context.Context, orgShortNameId string, workspaceId string, teamId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*MutateWorkspaceTeamRoleResponse, error) + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "offset", runtime.ParamLocationQuery, *params.Offset); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } - MutateWorkspaceTeamRoleWithResponse(ctx context.Context, orgShortNameId string, workspaceId string, teamId string, body MutateWorkspaceTeamRoleJSONRequestBody, reqEditors ...RequestEditorFn) (*MutateWorkspaceTeamRoleResponse, error) + } - // ListWorkspaceUsers request - ListWorkspaceUsersWithResponse(ctx context.Context, orgShortNameId string, workspaceId string, params *ListWorkspaceUsersParams, reqEditors ...RequestEditorFn) (*ListWorkspaceUsersResponse, error) + if params.Limit != nil { - // DeleteWorkspaceUser request - DeleteWorkspaceUserWithResponse(ctx context.Context, orgShortNameId string, workspaceId string, userId string, reqEditors ...RequestEditorFn) (*DeleteWorkspaceUserResponse, error) + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "limit", runtime.ParamLocationQuery, *params.Limit); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } - // MutateWorkspaceUserRole request with any body - MutateWorkspaceUserRoleWithBodyWithResponse(ctx context.Context, orgShortNameId string, workspaceId string, userId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*MutateWorkspaceUserRoleResponse, error) + } - MutateWorkspaceUserRoleWithResponse(ctx context.Context, orgShortNameId string, workspaceId string, userId string, body MutateWorkspaceUserRoleJSONRequestBody, reqEditors ...RequestEditorFn) (*MutateWorkspaceUserRoleResponse, error) + if params.Sorts != nil { - // GetSelfUser request - GetSelfUserWithResponse(ctx context.Context, params *GetSelfUserParams, reqEditors ...RequestEditorFn) (*GetSelfUserResponse, error) + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "sorts", runtime.ParamLocationQuery, *params.Sorts); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } - // UpdateSelfUserInvite request with any body - UpdateSelfUserInviteWithBodyWithResponse(ctx context.Context, inviteId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateSelfUserInviteResponse, error) + } - UpdateSelfUserInviteWithResponse(ctx context.Context, inviteId string, body UpdateSelfUserInviteJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateSelfUserInviteResponse, error) -} + if params.Search != nil { -type GetUserInviteResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *Invite - JSON400 *Error - JSON401 *Error - JSON403 *Error - JSON404 *Error - JSON500 *Error -} + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "search", runtime.ParamLocationQuery, *params.Search); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } -// Status returns HTTPResponse.Status -func (r GetUserInviteResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status } - return http.StatusText(0) -} -// StatusCode returns HTTPResponse.StatusCode -func (r GetUserInviteResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode + queryURL.RawQuery = queryValues.Encode() + + req, err := http.NewRequest("GET", queryURL.String(), nil) + if err != nil { + return nil, err } - return 0 -} -type ValidateSsoLoginResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *SsoLoginCallback - JSON400 *Error - JSON401 *Error - JSON403 *Error - JSON404 *Error - JSON500 *Error + return req, nil } -// Status returns HTTPResponse.Status -func (r ValidateSsoLoginResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status +// NewDeleteWorkspaceTeamRequest generates requests for DeleteWorkspaceTeam +func NewDeleteWorkspaceTeamRequest(server string, orgShortNameId string, workspaceId string, teamId string) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "orgShortNameId", runtime.ParamLocationPath, orgShortNameId) + if err != nil { + return nil, err } - return http.StatusText(0) -} -// StatusCode returns HTTPResponse.StatusCode -func (r ValidateSsoLoginResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode + var pathParam1 string + + pathParam1, err = runtime.StyleParamWithLocation("simple", false, "workspaceId", runtime.ParamLocationPath, workspaceId) + if err != nil { + return nil, err } - return 0 -} -type GetSharedClusterResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *SharedCluster - JSON400 *Error - JSON401 *Error - JSON403 *Error - JSON404 *Error - JSON500 *Error -} + var pathParam2 string -// Status returns HTTPResponse.Status -func (r GetSharedClusterResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status + pathParam2, err = runtime.StyleParamWithLocation("simple", false, "teamId", runtime.ParamLocationPath, teamId) + if err != nil { + return nil, err } - return http.StatusText(0) -} -// StatusCode returns HTTPResponse.StatusCode -func (r GetSharedClusterResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode + serverURL, err := url.Parse(server) + if err != nil { + return nil, err } - return 0 -} -type GetClusterOptionsResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *[]ClusterOptions - JSON400 *Error - JSON401 *Error - JSON403 *Error - JSON404 *Error - JSON500 *Error -} + operationPath := fmt.Sprintf("/organizations/%s/workspaces/%s/teams/%s", pathParam0, pathParam1, pathParam2) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } -// Status returns HTTPResponse.Status -func (r GetClusterOptionsResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err } - return http.StatusText(0) -} -// StatusCode returns HTTPResponse.StatusCode -func (r GetClusterOptionsResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode + req, err := http.NewRequest("DELETE", queryURL.String(), nil) + if err != nil { + return nil, err } - return 0 -} -type GetDeploymentOptionsResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *DeploymentOptions - JSON400 *Error - JSON401 *Error - JSON403 *Error - JSON500 *Error + return req, nil } -// Status returns HTTPResponse.Status -func (r GetDeploymentOptionsResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status +// NewMutateWorkspaceTeamRoleRequest calls the generic MutateWorkspaceTeamRole builder with application/json body +func NewMutateWorkspaceTeamRoleRequest(server string, orgShortNameId string, workspaceId string, teamId string, body MutateWorkspaceTeamRoleJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err } - return http.StatusText(0) + bodyReader = bytes.NewReader(buf) + return NewMutateWorkspaceTeamRoleRequestWithBody(server, orgShortNameId, workspaceId, teamId, "application/json", bodyReader) } -// StatusCode returns HTTPResponse.StatusCode -func (r GetDeploymentOptionsResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode +// NewMutateWorkspaceTeamRoleRequestWithBody generates requests for MutateWorkspaceTeamRole with any type of body +func NewMutateWorkspaceTeamRoleRequestWithBody(server string, orgShortNameId string, workspaceId string, teamId string, contentType string, body io.Reader) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "orgShortNameId", runtime.ParamLocationPath, orgShortNameId) + if err != nil { + return nil, err } - return 0 -} -type ListOrganizationAuthIdsResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *[]string - JSON400 *Error - JSON401 *Error - JSON403 *Error - JSON500 *Error -} + var pathParam1 string -// Status returns HTTPResponse.Status -func (r ListOrganizationAuthIdsResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status + pathParam1, err = runtime.StyleParamWithLocation("simple", false, "workspaceId", runtime.ParamLocationPath, workspaceId) + if err != nil { + return nil, err } - return http.StatusText(0) -} -// StatusCode returns HTTPResponse.StatusCode -func (r ListOrganizationAuthIdsResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode + var pathParam2 string + + pathParam2, err = runtime.StyleParamWithLocation("simple", false, "teamId", runtime.ParamLocationPath, teamId) + if err != nil { + return nil, err } - return 0 -} -type ListOrganizationsResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *[]Organization - JSON400 *Error - JSON401 *Error - JSON403 *Error - JSON500 *Error -} + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } -// Status returns HTTPResponse.Status -func (r ListOrganizationsResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status + operationPath := fmt.Sprintf("/organizations/%s/workspaces/%s/teams/%s/role", pathParam0, pathParam1, pathParam2) + if operationPath[0] == '/' { + operationPath = "." + operationPath } - return http.StatusText(0) -} -// StatusCode returns HTTPResponse.StatusCode -func (r ListOrganizationsResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err } - return 0 -} -type CreateOrganizationResponse struct { - Body []byte - HTTPResponse *http.Response + req, err := http.NewRequest("POST", queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + return req, nil +} + +// NewListWorkspaceUsersRequest generates requests for ListWorkspaceUsers +func NewListWorkspaceUsersRequest(server string, orgShortNameId string, workspaceId string, params *ListWorkspaceUsersParams) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "orgShortNameId", runtime.ParamLocationPath, orgShortNameId) + if err != nil { + return nil, err + } + + var pathParam1 string + + pathParam1, err = runtime.StyleParamWithLocation("simple", false, "workspaceId", runtime.ParamLocationPath, workspaceId) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/organizations/%s/workspaces/%s/users", pathParam0, pathParam1) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + queryValues := queryURL.Query() + + if params.Offset != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "offset", runtime.ParamLocationQuery, *params.Offset); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.Limit != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "limit", runtime.ParamLocationQuery, *params.Limit); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.Sorts != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "sorts", runtime.ParamLocationQuery, *params.Sorts); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.Search != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "search", runtime.ParamLocationQuery, *params.Search); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + queryURL.RawQuery = queryValues.Encode() + + req, err := http.NewRequest("GET", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewDeleteWorkspaceUserRequest generates requests for DeleteWorkspaceUser +func NewDeleteWorkspaceUserRequest(server string, orgShortNameId string, workspaceId string, userId string) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "orgShortNameId", runtime.ParamLocationPath, orgShortNameId) + if err != nil { + return nil, err + } + + var pathParam1 string + + pathParam1, err = runtime.StyleParamWithLocation("simple", false, "workspaceId", runtime.ParamLocationPath, workspaceId) + if err != nil { + return nil, err + } + + var pathParam2 string + + pathParam2, err = runtime.StyleParamWithLocation("simple", false, "userId", runtime.ParamLocationPath, userId) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/organizations/%s/workspaces/%s/users/%s", pathParam0, pathParam1, pathParam2) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("DELETE", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewMutateWorkspaceUserRoleRequest calls the generic MutateWorkspaceUserRole builder with application/json body +func NewMutateWorkspaceUserRoleRequest(server string, orgShortNameId string, workspaceId string, userId string, body MutateWorkspaceUserRoleJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewMutateWorkspaceUserRoleRequestWithBody(server, orgShortNameId, workspaceId, userId, "application/json", bodyReader) +} + +// NewMutateWorkspaceUserRoleRequestWithBody generates requests for MutateWorkspaceUserRole with any type of body +func NewMutateWorkspaceUserRoleRequestWithBody(server string, orgShortNameId string, workspaceId string, userId string, contentType string, body io.Reader) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "orgShortNameId", runtime.ParamLocationPath, orgShortNameId) + if err != nil { + return nil, err + } + + var pathParam1 string + + pathParam1, err = runtime.StyleParamWithLocation("simple", false, "workspaceId", runtime.ParamLocationPath, workspaceId) + if err != nil { + return nil, err + } + + var pathParam2 string + + pathParam2, err = runtime.StyleParamWithLocation("simple", false, "userId", runtime.ParamLocationPath, userId) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/organizations/%s/workspaces/%s/users/%s/role", pathParam0, pathParam1, pathParam2) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("POST", queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + return req, nil +} + +// NewGetSelfUserRequest generates requests for GetSelfUser +func NewGetSelfUserRequest(server string, params *GetSelfUserParams) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/users/self") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + queryValues := queryURL.Query() + + if params.CreateIfNotExist != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "createIfNotExist", runtime.ParamLocationQuery, *params.CreateIfNotExist); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + queryURL.RawQuery = queryValues.Encode() + + req, err := http.NewRequest("GET", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewUpdateSelfUserInviteRequest calls the generic UpdateSelfUserInvite builder with application/json body +func NewUpdateSelfUserInviteRequest(server string, inviteId string, body UpdateSelfUserInviteJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewUpdateSelfUserInviteRequestWithBody(server, inviteId, "application/json", bodyReader) +} + +// NewUpdateSelfUserInviteRequestWithBody generates requests for UpdateSelfUserInvite with any type of body +func NewUpdateSelfUserInviteRequestWithBody(server string, inviteId string, contentType string, body io.Reader) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "inviteId", runtime.ParamLocationPath, inviteId) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/users/self/invites/%s", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("POST", queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + return req, nil +} + +func (c *Client) applyEditors(ctx context.Context, req *http.Request, additionalEditors []RequestEditorFn) error { + for _, r := range c.RequestEditors { + if err := r(ctx, req); err != nil { + return err + } + } + for _, r := range additionalEditors { + if err := r(ctx, req); err != nil { + return err + } + } + return nil +} + +// ClientWithResponses builds on ClientInterface to offer response payloads +type ClientWithResponses struct { + ClientInterface +} + +// NewClientWithResponses creates a new ClientWithResponses, which wraps +// Client with return type handling +func NewClientWithResponses(server string, opts ...ClientOption) (*ClientWithResponses, error) { + client, err := NewClient(server, opts...) + if err != nil { + return nil, err + } + return &ClientWithResponses{client}, nil +} + +// WithBaseURL overrides the baseURL. +func WithBaseURL(baseURL string) ClientOption { + return func(c *Client) error { + newBaseURL, err := url.Parse(baseURL) + if err != nil { + return err + } + c.Server = newBaseURL.String() + return nil + } +} + +// ClientWithResponsesInterface is the interface specification for the client with responses above. +type ClientWithResponsesInterface interface { + // GetUserInvite request + GetUserInviteWithResponse(ctx context.Context, inviteId string, reqEditors ...RequestEditorFn) (*GetUserInviteResponse, error) + + // ValidateSsoLogin request with any body + ValidateSsoLoginWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ValidateSsoLoginResponse, error) + + ValidateSsoLoginWithResponse(ctx context.Context, body ValidateSsoLoginJSONRequestBody, reqEditors ...RequestEditorFn) (*ValidateSsoLoginResponse, error) + + // GetSharedCluster request + GetSharedClusterWithResponse(ctx context.Context, params *GetSharedClusterParams, reqEditors ...RequestEditorFn) (*GetSharedClusterResponse, error) + + // GetClusterOptions request + GetClusterOptionsWithResponse(ctx context.Context, params *GetClusterOptionsParams, reqEditors ...RequestEditorFn) (*GetClusterOptionsResponse, error) + + // GetDeploymentOptions request + GetDeploymentOptionsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetDeploymentOptionsResponse, error) + + // ListOrganizationAuthIds request + ListOrganizationAuthIdsWithResponse(ctx context.Context, params *ListOrganizationAuthIdsParams, reqEditors ...RequestEditorFn) (*ListOrganizationAuthIdsResponse, error) + + // ListOrganizations request + ListOrganizationsWithResponse(ctx context.Context, params *ListOrganizationsParams, reqEditors ...RequestEditorFn) (*ListOrganizationsResponse, error) + + // CreateOrganization request with any body + CreateOrganizationWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateOrganizationResponse, error) + + CreateOrganizationWithResponse(ctx context.Context, body CreateOrganizationJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateOrganizationResponse, error) + + // GetOrganization request + GetOrganizationWithResponse(ctx context.Context, orgShortNameId string, params *GetOrganizationParams, reqEditors ...RequestEditorFn) (*GetOrganizationResponse, error) + + // UpdateOrganization request with any body + UpdateOrganizationWithBodyWithResponse(ctx context.Context, orgShortNameId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateOrganizationResponse, error) + + UpdateOrganizationWithResponse(ctx context.Context, orgShortNameId string, body UpdateOrganizationJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateOrganizationResponse, error) + + // ListOrganizationApiTokens request + ListOrganizationApiTokensWithResponse(ctx context.Context, orgShortNameId string, params *ListOrganizationApiTokensParams, reqEditors ...RequestEditorFn) (*ListOrganizationApiTokensResponse, error) + + // CreateOrganizationApiToken request with any body + CreateOrganizationApiTokenWithBodyWithResponse(ctx context.Context, orgShortNameId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateOrganizationApiTokenResponse, error) + + CreateOrganizationApiTokenWithResponse(ctx context.Context, orgShortNameId string, body CreateOrganizationApiTokenJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateOrganizationApiTokenResponse, error) + + // DeleteOrganizationApiToken request + DeleteOrganizationApiTokenWithResponse(ctx context.Context, orgShortNameId string, apiTokenId string, reqEditors ...RequestEditorFn) (*DeleteOrganizationApiTokenResponse, error) + + // GetOrganizationApiToken request + GetOrganizationApiTokenWithResponse(ctx context.Context, orgShortNameId string, apiTokenId string, reqEditors ...RequestEditorFn) (*GetOrganizationApiTokenResponse, error) + + // UpdateOrganizationApiToken request with any body + UpdateOrganizationApiTokenWithBodyWithResponse(ctx context.Context, orgShortNameId string, apiTokenId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateOrganizationApiTokenResponse, error) + + UpdateOrganizationApiTokenWithResponse(ctx context.Context, orgShortNameId string, apiTokenId string, body UpdateOrganizationApiTokenJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateOrganizationApiTokenResponse, error) + + // RotateOrganizationApiToken request + RotateOrganizationApiTokenWithResponse(ctx context.Context, orgShortNameId string, apiTokenId string, reqEditors ...RequestEditorFn) (*RotateOrganizationApiTokenResponse, error) + + // GetOrganizationAuditLogs request + GetOrganizationAuditLogsWithResponse(ctx context.Context, orgShortNameId string, params *GetOrganizationAuditLogsParams, reqEditors ...RequestEditorFn) (*GetOrganizationAuditLogsResponse, error) + + // ListClusters request + ListClustersWithResponse(ctx context.Context, orgShortNameId string, params *ListClustersParams, reqEditors ...RequestEditorFn) (*ListClustersResponse, error) + + // CreateAwsCluster request with any body + CreateAwsClusterWithBodyWithResponse(ctx context.Context, orgShortNameId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateAwsClusterResponse, error) + + CreateAwsClusterWithResponse(ctx context.Context, orgShortNameId string, body CreateAwsClusterJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateAwsClusterResponse, error) + + // UpdateAwsCluster request with any body + UpdateAwsClusterWithBodyWithResponse(ctx context.Context, orgShortNameId string, clusterId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateAwsClusterResponse, error) + + UpdateAwsClusterWithResponse(ctx context.Context, orgShortNameId string, clusterId string, body UpdateAwsClusterJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateAwsClusterResponse, error) + + // CreateAzureCluster request with any body + CreateAzureClusterWithBodyWithResponse(ctx context.Context, orgShortNameId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateAzureClusterResponse, error) + + CreateAzureClusterWithResponse(ctx context.Context, orgShortNameId string, body CreateAzureClusterJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateAzureClusterResponse, error) + + // UpdateAzureCluster request with any body + UpdateAzureClusterWithBodyWithResponse(ctx context.Context, orgShortNameId string, clusterId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateAzureClusterResponse, error) + + UpdateAzureClusterWithResponse(ctx context.Context, orgShortNameId string, clusterId string, body UpdateAzureClusterJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateAzureClusterResponse, error) + + // CreateGcpCluster request with any body + CreateGcpClusterWithBodyWithResponse(ctx context.Context, orgShortNameId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateGcpClusterResponse, error) + + CreateGcpClusterWithResponse(ctx context.Context, orgShortNameId string, body CreateGcpClusterJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateGcpClusterResponse, error) + + // UpdateGcpCluster request with any body + UpdateGcpClusterWithBodyWithResponse(ctx context.Context, orgShortNameId string, clusterId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateGcpClusterResponse, error) + + UpdateGcpClusterWithResponse(ctx context.Context, orgShortNameId string, clusterId string, body UpdateGcpClusterJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateGcpClusterResponse, error) + + // DeleteCluster request + DeleteClusterWithResponse(ctx context.Context, orgShortNameId string, clusterId string, reqEditors ...RequestEditorFn) (*DeleteClusterResponse, error) + + // GetCluster request + GetClusterWithResponse(ctx context.Context, orgShortNameId string, clusterId string, reqEditors ...RequestEditorFn) (*GetClusterResponse, error) + + // ListManagedDomains request + ListManagedDomainsWithResponse(ctx context.Context, orgShortNameId string, reqEditors ...RequestEditorFn) (*ListManagedDomainsResponse, error) + + // CreateManagedDomain request with any body + CreateManagedDomainWithBodyWithResponse(ctx context.Context, orgShortNameId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateManagedDomainResponse, error) + + CreateManagedDomainWithResponse(ctx context.Context, orgShortNameId string, body CreateManagedDomainJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateManagedDomainResponse, error) + + // DeleteManagedDomain request + DeleteManagedDomainWithResponse(ctx context.Context, orgShortNameId string, domainId string, reqEditors ...RequestEditorFn) (*DeleteManagedDomainResponse, error) + + // GetManagedDomain request + GetManagedDomainWithResponse(ctx context.Context, orgShortNameId string, domainId string, reqEditors ...RequestEditorFn) (*GetManagedDomainResponse, error) + + // UpdateManagedDomain request with any body + UpdateManagedDomainWithBodyWithResponse(ctx context.Context, orgShortNameId string, domainId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateManagedDomainResponse, error) + + UpdateManagedDomainWithResponse(ctx context.Context, orgShortNameId string, domainId string, body UpdateManagedDomainJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateManagedDomainResponse, error) + + // VerifyManagedDomain request + VerifyManagedDomainWithResponse(ctx context.Context, orgShortNameId string, domainId string, reqEditors ...RequestEditorFn) (*VerifyManagedDomainResponse, error) + + // GetDraftInvoice request + GetDraftInvoiceWithResponse(ctx context.Context, orgShortNameId string, reqEditors ...RequestEditorFn) (*GetDraftInvoiceResponse, error) + + // CreateUserInvite request with any body + CreateUserInviteWithBodyWithResponse(ctx context.Context, orgShortNameId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateUserInviteResponse, error) + + CreateUserInviteWithResponse(ctx context.Context, orgShortNameId string, body CreateUserInviteJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateUserInviteResponse, error) + + // DeleteUserInvite request + DeleteUserInviteWithResponse(ctx context.Context, orgShortNameId string, inviteId string, reqEditors ...RequestEditorFn) (*DeleteUserInviteResponse, error) + + // GetCreditSummary request + GetCreditSummaryWithResponse(ctx context.Context, orgShortNameId string, reqEditors ...RequestEditorFn) (*GetCreditSummaryResponse, error) + + // GetMetronomeDashboard request + GetMetronomeDashboardWithResponse(ctx context.Context, orgShortNameId string, pType GetMetronomeDashboardParamsType, params *GetMetronomeDashboardParams, reqEditors ...RequestEditorFn) (*GetMetronomeDashboardResponse, error) + + // GetPaymentMethod request + GetPaymentMethodWithResponse(ctx context.Context, orgShortNameId string, reqEditors ...RequestEditorFn) (*GetPaymentMethodResponse, error) + + // DeleteSsoBypassKey request + DeleteSsoBypassKeyWithResponse(ctx context.Context, orgShortNameId string, reqEditors ...RequestEditorFn) (*DeleteSsoBypassKeyResponse, error) + + // GetSsoBypassKey request + GetSsoBypassKeyWithResponse(ctx context.Context, orgShortNameId string, reqEditors ...RequestEditorFn) (*GetSsoBypassKeyResponse, error) + + // UpsertSsoBypassKey request + UpsertSsoBypassKeyWithResponse(ctx context.Context, orgShortNameId string, reqEditors ...RequestEditorFn) (*UpsertSsoBypassKeyResponse, error) + + // ListSsoConnections request + ListSsoConnectionsWithResponse(ctx context.Context, orgShortNameId string, reqEditors ...RequestEditorFn) (*ListSsoConnectionsResponse, error) + + // CreateSsoConnection request with any body + CreateSsoConnectionWithBodyWithResponse(ctx context.Context, orgShortNameId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateSsoConnectionResponse, error) + + CreateSsoConnectionWithResponse(ctx context.Context, orgShortNameId string, body CreateSsoConnectionJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateSsoConnectionResponse, error) + + // DeleteSsoConnection request + DeleteSsoConnectionWithResponse(ctx context.Context, orgShortNameId string, connectionId string, reqEditors ...RequestEditorFn) (*DeleteSsoConnectionResponse, error) + + // GetSsoConnection request + GetSsoConnectionWithResponse(ctx context.Context, orgShortNameId string, connectionId string, reqEditors ...RequestEditorFn) (*GetSsoConnectionResponse, error) + + // UpdateSsoConnection request with any body + UpdateSsoConnectionWithBodyWithResponse(ctx context.Context, orgShortNameId string, connectionId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateSsoConnectionResponse, error) + + UpdateSsoConnectionWithResponse(ctx context.Context, orgShortNameId string, connectionId string, body UpdateSsoConnectionJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateSsoConnectionResponse, error) + + // GetStripeClientSecret request + GetStripeClientSecretWithResponse(ctx context.Context, orgShortNameId string, pType GetStripeClientSecretParamsType, reqEditors ...RequestEditorFn) (*GetStripeClientSecretResponse, error) + + // ListOrganizationTeams request + ListOrganizationTeamsWithResponse(ctx context.Context, orgShortNameId string, params *ListOrganizationTeamsParams, reqEditors ...RequestEditorFn) (*ListOrganizationTeamsResponse, error) + + // CreateTeam request with any body + CreateTeamWithBodyWithResponse(ctx context.Context, orgShortNameId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateTeamResponse, error) + + CreateTeamWithResponse(ctx context.Context, orgShortNameId string, body CreateTeamJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateTeamResponse, error) + + // DeleteTeam request + DeleteTeamWithResponse(ctx context.Context, orgShortNameId string, teamId string, reqEditors ...RequestEditorFn) (*DeleteTeamResponse, error) + + // GetTeam request + GetTeamWithResponse(ctx context.Context, orgShortNameId string, teamId string, reqEditors ...RequestEditorFn) (*GetTeamResponse, error) + + // UpdateTeam request with any body + UpdateTeamWithBodyWithResponse(ctx context.Context, orgShortNameId string, teamId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateTeamResponse, error) + + UpdateTeamWithResponse(ctx context.Context, orgShortNameId string, teamId string, body UpdateTeamJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateTeamResponse, error) + + // AddTeamMembers request with any body + AddTeamMembersWithBodyWithResponse(ctx context.Context, orgShortNameId string, teamId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*AddTeamMembersResponse, error) + + AddTeamMembersWithResponse(ctx context.Context, orgShortNameId string, teamId string, body AddTeamMembersJSONRequestBody, reqEditors ...RequestEditorFn) (*AddTeamMembersResponse, error) + + // RemoveTeamMember request + RemoveTeamMemberWithResponse(ctx context.Context, orgShortNameId string, teamId string, memberId string, reqEditors ...RequestEditorFn) (*RemoveTeamMemberResponse, error) + + // ListOrgUsers request + ListOrgUsersWithResponse(ctx context.Context, orgShortNameId string, params *ListOrgUsersParams, reqEditors ...RequestEditorFn) (*ListOrgUsersResponse, error) + + // DeleteOrgUser request + DeleteOrgUserWithResponse(ctx context.Context, orgShortNameId string, userId string, reqEditors ...RequestEditorFn) (*DeleteOrgUserResponse, error) + + // GetUser request + GetUserWithResponse(ctx context.Context, orgShortNameId string, userId string, reqEditors ...RequestEditorFn) (*GetUserResponse, error) + + // MutateOrgUserRole request with any body + MutateOrgUserRoleWithBodyWithResponse(ctx context.Context, orgShortNameId string, userId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*MutateOrgUserRoleResponse, error) + + MutateOrgUserRoleWithResponse(ctx context.Context, orgShortNameId string, userId string, body MutateOrgUserRoleJSONRequestBody, reqEditors ...RequestEditorFn) (*MutateOrgUserRoleResponse, error) + + // ValidateCreditCardPayment request with any body + ValidateCreditCardPaymentWithBodyWithResponse(ctx context.Context, orgShortNameId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ValidateCreditCardPaymentResponse, error) + + ValidateCreditCardPaymentWithResponse(ctx context.Context, orgShortNameId string, body ValidateCreditCardPaymentJSONRequestBody, reqEditors ...RequestEditorFn) (*ValidateCreditCardPaymentResponse, error) + + // ListWorkspaces request + ListWorkspacesWithResponse(ctx context.Context, orgShortNameId string, params *ListWorkspacesParams, reqEditors ...RequestEditorFn) (*ListWorkspacesResponse, error) + + // CreateWorkspace request with any body + CreateWorkspaceWithBodyWithResponse(ctx context.Context, orgShortNameId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateWorkspaceResponse, error) + + CreateWorkspaceWithResponse(ctx context.Context, orgShortNameId string, body CreateWorkspaceJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateWorkspaceResponse, error) + + // DeleteWorkspace request + DeleteWorkspaceWithResponse(ctx context.Context, orgShortNameId string, workspaceId string, reqEditors ...RequestEditorFn) (*DeleteWorkspaceResponse, error) + + // GetWorkspace request + GetWorkspaceWithResponse(ctx context.Context, orgShortNameId string, workspaceId string, reqEditors ...RequestEditorFn) (*GetWorkspaceResponse, error) + + // UpdateWorkspace request with any body + UpdateWorkspaceWithBodyWithResponse(ctx context.Context, orgShortNameId string, workspaceId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateWorkspaceResponse, error) + + UpdateWorkspaceWithResponse(ctx context.Context, orgShortNameId string, workspaceId string, body UpdateWorkspaceJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateWorkspaceResponse, error) + + // ListWorkspaceApiTokens request + ListWorkspaceApiTokensWithResponse(ctx context.Context, orgShortNameId string, workspaceId string, params *ListWorkspaceApiTokensParams, reqEditors ...RequestEditorFn) (*ListWorkspaceApiTokensResponse, error) + + // CreateWorkspaceApiToken request with any body + CreateWorkspaceApiTokenWithBodyWithResponse(ctx context.Context, orgShortNameId string, workspaceId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateWorkspaceApiTokenResponse, error) + + CreateWorkspaceApiTokenWithResponse(ctx context.Context, orgShortNameId string, workspaceId string, body CreateWorkspaceApiTokenJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateWorkspaceApiTokenResponse, error) + + // DeleteWorkspaceApiToken request + DeleteWorkspaceApiTokenWithResponse(ctx context.Context, orgShortNameId string, workspaceId string, apiTokenId string, reqEditors ...RequestEditorFn) (*DeleteWorkspaceApiTokenResponse, error) + + // GetWorkspaceApiToken request + GetWorkspaceApiTokenWithResponse(ctx context.Context, orgShortNameId string, workspaceId string, apiTokenId string, reqEditors ...RequestEditorFn) (*GetWorkspaceApiTokenResponse, error) + + // UpdateWorkspaceApiToken request with any body + UpdateWorkspaceApiTokenWithBodyWithResponse(ctx context.Context, orgShortNameId string, workspaceId string, apiTokenId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateWorkspaceApiTokenResponse, error) + + UpdateWorkspaceApiTokenWithResponse(ctx context.Context, orgShortNameId string, workspaceId string, apiTokenId string, body UpdateWorkspaceApiTokenJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateWorkspaceApiTokenResponse, error) + + // RotateWorkspaceApiToken request + RotateWorkspaceApiTokenWithResponse(ctx context.Context, orgShortNameId string, workspaceId string, apiTokenId string, reqEditors ...RequestEditorFn) (*RotateWorkspaceApiTokenResponse, error) + + // ListWorkspaceDagFilters request + ListWorkspaceDagFiltersWithResponse(ctx context.Context, orgShortNameId string, workspaceId string, reqEditors ...RequestEditorFn) (*ListWorkspaceDagFiltersResponse, error) + + // ListWorkspaceDags request + ListWorkspaceDagsWithResponse(ctx context.Context, orgShortNameId string, workspaceId string, params *ListWorkspaceDagsParams, reqEditors ...RequestEditorFn) (*ListWorkspaceDagsResponse, error) + + // ListWorkspaceTeams request + ListWorkspaceTeamsWithResponse(ctx context.Context, orgShortNameId string, workspaceId string, params *ListWorkspaceTeamsParams, reqEditors ...RequestEditorFn) (*ListWorkspaceTeamsResponse, error) + + // DeleteWorkspaceTeam request + DeleteWorkspaceTeamWithResponse(ctx context.Context, orgShortNameId string, workspaceId string, teamId string, reqEditors ...RequestEditorFn) (*DeleteWorkspaceTeamResponse, error) + + // MutateWorkspaceTeamRole request with any body + MutateWorkspaceTeamRoleWithBodyWithResponse(ctx context.Context, orgShortNameId string, workspaceId string, teamId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*MutateWorkspaceTeamRoleResponse, error) + + MutateWorkspaceTeamRoleWithResponse(ctx context.Context, orgShortNameId string, workspaceId string, teamId string, body MutateWorkspaceTeamRoleJSONRequestBody, reqEditors ...RequestEditorFn) (*MutateWorkspaceTeamRoleResponse, error) + + // ListWorkspaceUsers request + ListWorkspaceUsersWithResponse(ctx context.Context, orgShortNameId string, workspaceId string, params *ListWorkspaceUsersParams, reqEditors ...RequestEditorFn) (*ListWorkspaceUsersResponse, error) + + // DeleteWorkspaceUser request + DeleteWorkspaceUserWithResponse(ctx context.Context, orgShortNameId string, workspaceId string, userId string, reqEditors ...RequestEditorFn) (*DeleteWorkspaceUserResponse, error) + + // MutateWorkspaceUserRole request with any body + MutateWorkspaceUserRoleWithBodyWithResponse(ctx context.Context, orgShortNameId string, workspaceId string, userId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*MutateWorkspaceUserRoleResponse, error) + + MutateWorkspaceUserRoleWithResponse(ctx context.Context, orgShortNameId string, workspaceId string, userId string, body MutateWorkspaceUserRoleJSONRequestBody, reqEditors ...RequestEditorFn) (*MutateWorkspaceUserRoleResponse, error) + + // GetSelfUser request + GetSelfUserWithResponse(ctx context.Context, params *GetSelfUserParams, reqEditors ...RequestEditorFn) (*GetSelfUserResponse, error) + + // UpdateSelfUserInvite request with any body + UpdateSelfUserInviteWithBodyWithResponse(ctx context.Context, inviteId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateSelfUserInviteResponse, error) + + UpdateSelfUserInviteWithResponse(ctx context.Context, inviteId string, body UpdateSelfUserInviteJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateSelfUserInviteResponse, error) +} + +type GetUserInviteResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *Invite + JSON400 *Error + JSON401 *Error + JSON403 *Error + JSON404 *Error + JSON500 *Error +} + +// Status returns HTTPResponse.Status +func (r GetUserInviteResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r GetUserInviteResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type ValidateSsoLoginResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *SsoLoginCallback + JSON400 *Error + JSON401 *Error + JSON403 *Error + JSON404 *Error + JSON500 *Error +} + +// Status returns HTTPResponse.Status +func (r ValidateSsoLoginResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r ValidateSsoLoginResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type GetSharedClusterResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *SharedCluster + JSON400 *Error + JSON401 *Error + JSON403 *Error + JSON404 *Error + JSON500 *Error +} + +// Status returns HTTPResponse.Status +func (r GetSharedClusterResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r GetSharedClusterResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type GetClusterOptionsResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *[]ClusterOptions + JSON400 *Error + JSON401 *Error + JSON403 *Error + JSON404 *Error + JSON500 *Error +} + +// Status returns HTTPResponse.Status +func (r GetClusterOptionsResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r GetClusterOptionsResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type GetDeploymentOptionsResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *DeploymentOptions + JSON400 *Error + JSON401 *Error + JSON403 *Error + JSON500 *Error +} + +// Status returns HTTPResponse.Status +func (r GetDeploymentOptionsResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r GetDeploymentOptionsResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type ListOrganizationAuthIdsResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *[]string + JSON400 *Error + JSON401 *Error + JSON403 *Error + JSON500 *Error +} + +// Status returns HTTPResponse.Status +func (r ListOrganizationAuthIdsResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r ListOrganizationAuthIdsResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type ListOrganizationsResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *[]Organization + JSON400 *Error + JSON401 *Error + JSON403 *Error + JSON500 *Error +} + +// Status returns HTTPResponse.Status +func (r ListOrganizationsResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r ListOrganizationsResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type CreateOrganizationResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *Organization + JSON400 *Error + JSON401 *Error + JSON403 *Error + JSON404 *Error + JSON500 *Error +} + +// Status returns HTTPResponse.Status +func (r CreateOrganizationResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r CreateOrganizationResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type GetOrganizationResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *Organization + JSON400 *Error + JSON401 *Error + JSON403 *Error + JSON404 *Error + JSON500 *Error +} + +// Status returns HTTPResponse.Status +func (r GetOrganizationResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r GetOrganizationResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type UpdateOrganizationResponse struct { + Body []byte + HTTPResponse *http.Response JSON200 *Organization JSON400 *Error JSON401 *Error @@ -7555,7 +8916,734 @@ type CreateOrganizationResponse struct { } // Status returns HTTPResponse.Status -func (r CreateOrganizationResponse) Status() string { +func (r UpdateOrganizationResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r UpdateOrganizationResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type ListOrganizationApiTokensResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *ListApiTokensPaginated + JSON400 *Error + JSON401 *Error + JSON403 *Error + JSON404 *Error + JSON500 *Error +} + +// Status returns HTTPResponse.Status +func (r ListOrganizationApiTokensResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r ListOrganizationApiTokensResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type CreateOrganizationApiTokenResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *ApiToken + JSON400 *Error + JSON401 *Error + JSON403 *Error + JSON404 *Error + JSON500 *Error +} + +// Status returns HTTPResponse.Status +func (r CreateOrganizationApiTokenResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r CreateOrganizationApiTokenResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type DeleteOrganizationApiTokenResponse struct { + Body []byte + HTTPResponse *http.Response + JSON400 *Error + JSON401 *Error + JSON403 *Error + JSON404 *Error + JSON500 *Error +} + +// Status returns HTTPResponse.Status +func (r DeleteOrganizationApiTokenResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r DeleteOrganizationApiTokenResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type GetOrganizationApiTokenResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *ApiToken + JSON400 *Error + JSON401 *Error + JSON403 *Error + JSON404 *Error + JSON500 *Error +} + +// Status returns HTTPResponse.Status +func (r GetOrganizationApiTokenResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r GetOrganizationApiTokenResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type UpdateOrganizationApiTokenResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *ApiToken + JSON400 *Error + JSON401 *Error + JSON403 *Error + JSON404 *Error + JSON500 *Error +} + +// Status returns HTTPResponse.Status +func (r UpdateOrganizationApiTokenResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r UpdateOrganizationApiTokenResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type RotateOrganizationApiTokenResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *ApiToken + JSON400 *Error + JSON401 *Error + JSON403 *Error + JSON404 *Error + JSON500 *Error +} + +// Status returns HTTPResponse.Status +func (r RotateOrganizationApiTokenResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r RotateOrganizationApiTokenResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type GetOrganizationAuditLogsResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *[]int + JSON400 *Error + JSON401 *Error + JSON403 *Error + JSON500 *Error +} + +// Status returns HTTPResponse.Status +func (r GetOrganizationAuditLogsResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r GetOrganizationAuditLogsResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type ListClustersResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *ClustersPaginated + JSON400 *Error + JSON401 *Error + JSON403 *Error + JSON500 *Error +} + +// Status returns HTTPResponse.Status +func (r ListClustersResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r ListClustersResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type CreateAwsClusterResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *Cluster + JSON400 *Error + JSON401 *Error + JSON403 *Error + JSON412 *Error + JSON500 *Error +} + +// Status returns HTTPResponse.Status +func (r CreateAwsClusterResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r CreateAwsClusterResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type UpdateAwsClusterResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *Cluster + JSON400 *Error + JSON401 *Error + JSON403 *Error + JSON404 *Error + JSON412 *Error + JSON500 *Error +} + +// Status returns HTTPResponse.Status +func (r UpdateAwsClusterResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r UpdateAwsClusterResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type CreateAzureClusterResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *Cluster + JSON400 *Error + JSON401 *Error + JSON403 *Error + JSON412 *Error + JSON500 *Error +} + +// Status returns HTTPResponse.Status +func (r CreateAzureClusterResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r CreateAzureClusterResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type UpdateAzureClusterResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *Cluster + JSON400 *Error + JSON401 *Error + JSON403 *Error + JSON404 *Error + JSON412 *Error + JSON500 *Error +} + +// Status returns HTTPResponse.Status +func (r UpdateAzureClusterResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r UpdateAzureClusterResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type CreateGcpClusterResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *Cluster + JSON400 *Error + JSON401 *Error + JSON403 *Error + JSON412 *Error + JSON500 *Error +} + +// Status returns HTTPResponse.Status +func (r CreateGcpClusterResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r CreateGcpClusterResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type UpdateGcpClusterResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *Cluster + JSON400 *Error + JSON401 *Error + JSON403 *Error + JSON404 *Error + JSON412 *Error + JSON500 *Error +} + +// Status returns HTTPResponse.Status +func (r UpdateGcpClusterResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r UpdateGcpClusterResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type DeleteClusterResponse struct { + Body []byte + HTTPResponse *http.Response + JSON400 *Error + JSON401 *Error + JSON403 *Error + JSON404 *Error + JSON500 *Error +} + +// Status returns HTTPResponse.Status +func (r DeleteClusterResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r DeleteClusterResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type GetClusterResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *ClusterDetailed + JSON400 *Error + JSON401 *Error + JSON403 *Error + JSON404 *Error + JSON500 *Error +} + +// Status returns HTTPResponse.Status +func (r GetClusterResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r GetClusterResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type ListManagedDomainsResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *[]ManagedDomain + JSON400 *Error + JSON401 *Error + JSON403 *Error + JSON404 *Error + JSON500 *Error +} + +// Status returns HTTPResponse.Status +func (r ListManagedDomainsResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r ListManagedDomainsResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type CreateManagedDomainResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *ManagedDomain + JSON400 *Error + JSON401 *Error + JSON403 *Error + JSON404 *Error + JSON500 *Error +} + +// Status returns HTTPResponse.Status +func (r CreateManagedDomainResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r CreateManagedDomainResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type DeleteManagedDomainResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *ManagedDomain + JSON400 *Error + JSON401 *Error + JSON403 *Error + JSON404 *Error + JSON500 *Error +} + +// Status returns HTTPResponse.Status +func (r DeleteManagedDomainResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r DeleteManagedDomainResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type GetManagedDomainResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *ManagedDomain + JSON400 *Error + JSON401 *Error + JSON403 *Error + JSON404 *Error + JSON500 *Error +} + +// Status returns HTTPResponse.Status +func (r GetManagedDomainResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r GetManagedDomainResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type UpdateManagedDomainResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *ManagedDomain + JSON400 *Error + JSON401 *Error + JSON403 *Error + JSON404 *Error + JSON500 *Error +} + +// Status returns HTTPResponse.Status +func (r UpdateManagedDomainResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r UpdateManagedDomainResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type VerifyManagedDomainResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *ManagedDomain + JSON400 *Error + JSON401 *Error + JSON403 *Error + JSON404 *Error + JSON500 *Error +} + +// Status returns HTTPResponse.Status +func (r VerifyManagedDomainResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r VerifyManagedDomainResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type GetDraftInvoiceResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *Invoice + JSON400 *Error + JSON401 *Error + JSON403 *Error + JSON404 *Error + JSON500 *Error +} + +// Status returns HTTPResponse.Status +func (r GetDraftInvoiceResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r GetDraftInvoiceResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type CreateUserInviteResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *Invite + JSON400 *Error + JSON401 *Error + JSON403 *Error + JSON404 *Error + JSON500 *Error +} + +// Status returns HTTPResponse.Status +func (r CreateUserInviteResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r CreateUserInviteResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type DeleteUserInviteResponse struct { + Body []byte + HTTPResponse *http.Response + JSON400 *Error + JSON401 *Error + JSON403 *Error + JSON404 *Error + JSON500 *Error +} + +// Status returns HTTPResponse.Status +func (r DeleteUserInviteResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r DeleteUserInviteResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type GetCreditSummaryResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *CreditSummary + JSON400 *Error + JSON401 *Error + JSON403 *Error + JSON404 *Error + JSON500 *Error +} + +// Status returns HTTPResponse.Status +func (r GetCreditSummaryResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r GetCreditSummaryResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type GetMetronomeDashboardResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *MetronomeDashboard + JSON400 *Error + JSON401 *Error + JSON403 *Error + JSON404 *Error + JSON500 *Error +} + +// Status returns HTTPResponse.Status +func (r GetMetronomeDashboardResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -7563,17 +9651,17 @@ func (r CreateOrganizationResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r CreateOrganizationResponse) StatusCode() int { +func (r GetMetronomeDashboardResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type GetOrganizationResponse struct { +type GetPaymentMethodResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *Organization + JSON200 *PaymentMethod JSON400 *Error JSON401 *Error JSON403 *Error @@ -7582,7 +9670,7 @@ type GetOrganizationResponse struct { } // Status returns HTTPResponse.Status -func (r GetOrganizationResponse) Status() string { +func (r GetPaymentMethodResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -7590,17 +9678,16 @@ func (r GetOrganizationResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r GetOrganizationResponse) StatusCode() int { +func (r GetPaymentMethodResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type UpdateOrganizationResponse struct { +type DeleteSsoBypassKeyResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *Organization JSON400 *Error JSON401 *Error JSON403 *Error @@ -7609,7 +9696,7 @@ type UpdateOrganizationResponse struct { } // Status returns HTTPResponse.Status -func (r UpdateOrganizationResponse) Status() string { +func (r DeleteSsoBypassKeyResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -7617,25 +9704,26 @@ func (r UpdateOrganizationResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r UpdateOrganizationResponse) StatusCode() int { +func (r DeleteSsoBypassKeyResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type GetOrganizationAuditLogsResponse struct { +type GetSsoBypassKeyResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *[]int + JSON200 *SsoBypassKey JSON400 *Error JSON401 *Error JSON403 *Error + JSON404 *Error JSON500 *Error } // Status returns HTTPResponse.Status -func (r GetOrganizationAuditLogsResponse) Status() string { +func (r GetSsoBypassKeyResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -7643,25 +9731,26 @@ func (r GetOrganizationAuditLogsResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r GetOrganizationAuditLogsResponse) StatusCode() int { +func (r GetSsoBypassKeyResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type ListClustersResponse struct { +type UpsertSsoBypassKeyResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *ClustersPaginated + JSON200 *SsoBypassKey JSON400 *Error JSON401 *Error JSON403 *Error + JSON404 *Error JSON500 *Error } // Status returns HTTPResponse.Status -func (r ListClustersResponse) Status() string { +func (r UpsertSsoBypassKeyResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -7669,26 +9758,26 @@ func (r ListClustersResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r ListClustersResponse) StatusCode() int { +func (r UpsertSsoBypassKeyResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type CreateAwsClusterResponse struct { +type ListSsoConnectionsResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *Cluster + JSON200 *[]SsoConnection JSON400 *Error JSON401 *Error JSON403 *Error - JSON412 *Error + JSON404 *Error JSON500 *Error } // Status returns HTTPResponse.Status -func (r CreateAwsClusterResponse) Status() string { +func (r ListSsoConnectionsResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -7696,27 +9785,26 @@ func (r CreateAwsClusterResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r CreateAwsClusterResponse) StatusCode() int { +func (r ListSsoConnectionsResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type UpdateAwsClusterResponse struct { +type CreateSsoConnectionResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *Cluster + JSON200 *SsoConnection JSON400 *Error JSON401 *Error JSON403 *Error JSON404 *Error - JSON412 *Error JSON500 *Error } // Status returns HTTPResponse.Status -func (r UpdateAwsClusterResponse) Status() string { +func (r CreateSsoConnectionResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -7724,26 +9812,26 @@ func (r UpdateAwsClusterResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r UpdateAwsClusterResponse) StatusCode() int { +func (r CreateSsoConnectionResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type CreateAzureClusterResponse struct { +type DeleteSsoConnectionResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *Cluster + JSON200 *SsoConnection JSON400 *Error JSON401 *Error JSON403 *Error - JSON412 *Error + JSON404 *Error JSON500 *Error } // Status returns HTTPResponse.Status -func (r CreateAzureClusterResponse) Status() string { +func (r DeleteSsoConnectionResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -7751,27 +9839,26 @@ func (r CreateAzureClusterResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r CreateAzureClusterResponse) StatusCode() int { +func (r DeleteSsoConnectionResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type UpdateAzureClusterResponse struct { +type GetSsoConnectionResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *Cluster + JSON200 *SsoConnection JSON400 *Error JSON401 *Error JSON403 *Error JSON404 *Error - JSON412 *Error JSON500 *Error } // Status returns HTTPResponse.Status -func (r UpdateAzureClusterResponse) Status() string { +func (r GetSsoConnectionResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -7779,26 +9866,26 @@ func (r UpdateAzureClusterResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r UpdateAzureClusterResponse) StatusCode() int { +func (r GetSsoConnectionResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type CreateGcpClusterResponse struct { +type UpdateSsoConnectionResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *Cluster + JSON200 *SsoConnection JSON400 *Error JSON401 *Error JSON403 *Error - JSON412 *Error + JSON404 *Error JSON500 *Error } // Status returns HTTPResponse.Status -func (r CreateGcpClusterResponse) Status() string { +func (r UpdateSsoConnectionResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -7806,27 +9893,26 @@ func (r CreateGcpClusterResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r CreateGcpClusterResponse) StatusCode() int { +func (r UpdateSsoConnectionResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type UpdateGcpClusterResponse struct { +type GetStripeClientSecretResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *Cluster + JSON200 *StripeClientSecret JSON400 *Error JSON401 *Error JSON403 *Error JSON404 *Error - JSON412 *Error JSON500 *Error } // Status returns HTTPResponse.Status -func (r UpdateGcpClusterResponse) Status() string { +func (r GetStripeClientSecretResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -7834,16 +9920,17 @@ func (r UpdateGcpClusterResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r UpdateGcpClusterResponse) StatusCode() int { +func (r GetStripeClientSecretResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type DeleteClusterResponse struct { +type ListOrganizationTeamsResponse struct { Body []byte HTTPResponse *http.Response + JSON200 *TeamsPaginated JSON400 *Error JSON401 *Error JSON403 *Error @@ -7852,7 +9939,7 @@ type DeleteClusterResponse struct { } // Status returns HTTPResponse.Status -func (r DeleteClusterResponse) Status() string { +func (r ListOrganizationTeamsResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -7860,17 +9947,17 @@ func (r DeleteClusterResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r DeleteClusterResponse) StatusCode() int { +func (r ListOrganizationTeamsResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type GetClusterResponse struct { +type CreateTeamResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *ClusterDetailed + JSON200 *Team JSON400 *Error JSON401 *Error JSON403 *Error @@ -7879,7 +9966,7 @@ type GetClusterResponse struct { } // Status returns HTTPResponse.Status -func (r GetClusterResponse) Status() string { +func (r CreateTeamResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -7887,26 +9974,158 @@ func (r GetClusterResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r GetClusterResponse) StatusCode() int { +func (r CreateTeamResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type ListManagedDomainsResponse struct { +type DeleteTeamResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *Team + JSON400 *Error + JSON401 *Error + JSON403 *Error + JSON404 *Error + JSON500 *Error +} + +// Status returns HTTPResponse.Status +func (r DeleteTeamResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r DeleteTeamResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type GetTeamResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *Team + JSON400 *Error + JSON401 *Error + JSON403 *Error + JSON404 *Error + JSON500 *Error +} + +// Status returns HTTPResponse.Status +func (r GetTeamResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r GetTeamResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type UpdateTeamResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *Team + JSON400 *Error + JSON401 *Error + JSON403 *Error + JSON404 *Error + JSON500 *Error +} + +// Status returns HTTPResponse.Status +func (r UpdateTeamResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r UpdateTeamResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type AddTeamMembersResponse struct { + Body []byte + HTTPResponse *http.Response + JSON400 *Error + JSON401 *Error + JSON403 *Error + JSON404 *Error + JSON500 *Error +} + +// Status returns HTTPResponse.Status +func (r AddTeamMembersResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r AddTeamMembersResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type RemoveTeamMemberResponse struct { + Body []byte + HTTPResponse *http.Response + JSON400 *Error + JSON401 *Error + JSON403 *Error + JSON404 *Error + JSON500 *Error +} + +// Status returns HTTPResponse.Status +func (r RemoveTeamMemberResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r RemoveTeamMemberResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type ListOrgUsersResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *[]ManagedDomain + JSON200 *UsersPaginated JSON400 *Error JSON401 *Error JSON403 *Error - JSON404 *Error JSON500 *Error } // Status returns HTTPResponse.Status -func (r ListManagedDomainsResponse) Status() string { +func (r ListOrgUsersResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -7914,17 +10133,17 @@ func (r ListManagedDomainsResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r ListManagedDomainsResponse) StatusCode() int { +func (r ListOrgUsersResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type CreateManagedDomainResponse struct { +type DeleteOrgUserResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *ManagedDomain + JSON200 *User JSON400 *Error JSON401 *Error JSON403 *Error @@ -7933,7 +10152,7 @@ type CreateManagedDomainResponse struct { } // Status returns HTTPResponse.Status -func (r CreateManagedDomainResponse) Status() string { +func (r DeleteOrgUserResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -7941,17 +10160,17 @@ func (r CreateManagedDomainResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r CreateManagedDomainResponse) StatusCode() int { +func (r DeleteOrgUserResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type DeleteManagedDomainResponse struct { +type GetUserResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *ManagedDomain + JSON200 *User JSON400 *Error JSON401 *Error JSON403 *Error @@ -7960,7 +10179,7 @@ type DeleteManagedDomainResponse struct { } // Status returns HTTPResponse.Status -func (r DeleteManagedDomainResponse) Status() string { +func (r GetUserResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -7968,17 +10187,17 @@ func (r DeleteManagedDomainResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r DeleteManagedDomainResponse) StatusCode() int { +func (r GetUserResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type GetManagedDomainResponse struct { +type MutateOrgUserRoleResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *ManagedDomain + JSON200 *UserRole JSON400 *Error JSON401 *Error JSON403 *Error @@ -7987,7 +10206,7 @@ type GetManagedDomainResponse struct { } // Status returns HTTPResponse.Status -func (r GetManagedDomainResponse) Status() string { +func (r MutateOrgUserRoleResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -7995,17 +10214,17 @@ func (r GetManagedDomainResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r GetManagedDomainResponse) StatusCode() int { +func (r MutateOrgUserRoleResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type UpdateManagedDomainResponse struct { +type ValidateCreditCardPaymentResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *ManagedDomain + JSON200 *ValidateCreditCardPayment JSON400 *Error JSON401 *Error JSON403 *Error @@ -8014,7 +10233,7 @@ type UpdateManagedDomainResponse struct { } // Status returns HTTPResponse.Status -func (r UpdateManagedDomainResponse) Status() string { +func (r ValidateCreditCardPaymentResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -8022,26 +10241,25 @@ func (r UpdateManagedDomainResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r UpdateManagedDomainResponse) StatusCode() int { +func (r ValidateCreditCardPaymentResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type VerifyManagedDomainResponse struct { +type ListWorkspacesResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *ManagedDomain + JSON200 *WorkspacesPaginated JSON400 *Error JSON401 *Error JSON403 *Error - JSON404 *Error JSON500 *Error } // Status returns HTTPResponse.Status -func (r VerifyManagedDomainResponse) Status() string { +func (r ListWorkspacesResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -8049,17 +10267,17 @@ func (r VerifyManagedDomainResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r VerifyManagedDomainResponse) StatusCode() int { +func (r ListWorkspacesResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type GetDraftInvoiceResponse struct { +type CreateWorkspaceResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *Invoice + JSON200 *Workspace JSON400 *Error JSON401 *Error JSON403 *Error @@ -8068,7 +10286,7 @@ type GetDraftInvoiceResponse struct { } // Status returns HTTPResponse.Status -func (r GetDraftInvoiceResponse) Status() string { +func (r CreateWorkspaceResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -8076,17 +10294,16 @@ func (r GetDraftInvoiceResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r GetDraftInvoiceResponse) StatusCode() int { +func (r CreateWorkspaceResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type CreateUserInviteResponse struct { +type DeleteWorkspaceResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *Invite JSON400 *Error JSON401 *Error JSON403 *Error @@ -8095,7 +10312,7 @@ type CreateUserInviteResponse struct { } // Status returns HTTPResponse.Status -func (r CreateUserInviteResponse) Status() string { +func (r DeleteWorkspaceResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -8103,16 +10320,17 @@ func (r CreateUserInviteResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r CreateUserInviteResponse) StatusCode() int { +func (r DeleteWorkspaceResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type DeleteUserInviteResponse struct { +type GetWorkspaceResponse struct { Body []byte HTTPResponse *http.Response + JSON200 *Workspace JSON400 *Error JSON401 *Error JSON403 *Error @@ -8121,7 +10339,7 @@ type DeleteUserInviteResponse struct { } // Status returns HTTPResponse.Status -func (r DeleteUserInviteResponse) Status() string { +func (r GetWorkspaceResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -8129,17 +10347,17 @@ func (r DeleteUserInviteResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r DeleteUserInviteResponse) StatusCode() int { +func (r GetWorkspaceResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type GetPaymentMethodResponse struct { +type UpdateWorkspaceResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *PaymentMethod + JSON200 *Workspace JSON400 *Error JSON401 *Error JSON403 *Error @@ -8148,7 +10366,7 @@ type GetPaymentMethodResponse struct { } // Status returns HTTPResponse.Status -func (r GetPaymentMethodResponse) Status() string { +func (r UpdateWorkspaceResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -8156,16 +10374,17 @@ func (r GetPaymentMethodResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r GetPaymentMethodResponse) StatusCode() int { +func (r UpdateWorkspaceResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type DeleteSsoBypassKeyResponse struct { +type ListWorkspaceApiTokensResponse struct { Body []byte HTTPResponse *http.Response + JSON200 *ListApiTokensPaginated JSON400 *Error JSON401 *Error JSON403 *Error @@ -8174,7 +10393,7 @@ type DeleteSsoBypassKeyResponse struct { } // Status returns HTTPResponse.Status -func (r DeleteSsoBypassKeyResponse) Status() string { +func (r ListWorkspaceApiTokensResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -8182,17 +10401,17 @@ func (r DeleteSsoBypassKeyResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r DeleteSsoBypassKeyResponse) StatusCode() int { +func (r ListWorkspaceApiTokensResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type GetSsoBypassKeyResponse struct { +type CreateWorkspaceApiTokenResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *SsoBypassKey + JSON200 *ApiToken JSON400 *Error JSON401 *Error JSON403 *Error @@ -8201,7 +10420,7 @@ type GetSsoBypassKeyResponse struct { } // Status returns HTTPResponse.Status -func (r GetSsoBypassKeyResponse) Status() string { +func (r CreateWorkspaceApiTokenResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -8209,17 +10428,16 @@ func (r GetSsoBypassKeyResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r GetSsoBypassKeyResponse) StatusCode() int { +func (r CreateWorkspaceApiTokenResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type UpsertSsoBypassKeyResponse struct { +type DeleteWorkspaceApiTokenResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *SsoBypassKey JSON400 *Error JSON401 *Error JSON403 *Error @@ -8228,7 +10446,7 @@ type UpsertSsoBypassKeyResponse struct { } // Status returns HTTPResponse.Status -func (r UpsertSsoBypassKeyResponse) Status() string { +func (r DeleteWorkspaceApiTokenResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -8236,17 +10454,17 @@ func (r UpsertSsoBypassKeyResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r UpsertSsoBypassKeyResponse) StatusCode() int { +func (r DeleteWorkspaceApiTokenResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type ListSsoConnectionsResponse struct { +type GetWorkspaceApiTokenResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *[]SsoConnection + JSON200 *ApiToken JSON400 *Error JSON401 *Error JSON403 *Error @@ -8255,7 +10473,7 @@ type ListSsoConnectionsResponse struct { } // Status returns HTTPResponse.Status -func (r ListSsoConnectionsResponse) Status() string { +func (r GetWorkspaceApiTokenResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -8263,17 +10481,17 @@ func (r ListSsoConnectionsResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r ListSsoConnectionsResponse) StatusCode() int { +func (r GetWorkspaceApiTokenResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type CreateSsoConnectionResponse struct { +type UpdateWorkspaceApiTokenResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *SsoConnection + JSON200 *ApiToken JSON400 *Error JSON401 *Error JSON403 *Error @@ -8282,7 +10500,7 @@ type CreateSsoConnectionResponse struct { } // Status returns HTTPResponse.Status -func (r CreateSsoConnectionResponse) Status() string { +func (r UpdateWorkspaceApiTokenResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -8290,17 +10508,17 @@ func (r CreateSsoConnectionResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r CreateSsoConnectionResponse) StatusCode() int { +func (r UpdateWorkspaceApiTokenResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type DeleteSsoConnectionResponse struct { +type RotateWorkspaceApiTokenResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *SsoConnection + JSON200 *ApiToken JSON400 *Error JSON401 *Error JSON403 *Error @@ -8309,7 +10527,7 @@ type DeleteSsoConnectionResponse struct { } // Status returns HTTPResponse.Status -func (r DeleteSsoConnectionResponse) Status() string { +func (r RotateWorkspaceApiTokenResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -8317,17 +10535,17 @@ func (r DeleteSsoConnectionResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r DeleteSsoConnectionResponse) StatusCode() int { +func (r RotateWorkspaceApiTokenResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type GetSsoConnectionResponse struct { +type ListWorkspaceDagFiltersResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *SsoConnection + JSON200 *DagFilters JSON400 *Error JSON401 *Error JSON403 *Error @@ -8336,7 +10554,7 @@ type GetSsoConnectionResponse struct { } // Status returns HTTPResponse.Status -func (r GetSsoConnectionResponse) Status() string { +func (r ListWorkspaceDagFiltersResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -8344,17 +10562,17 @@ func (r GetSsoConnectionResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r GetSsoConnectionResponse) StatusCode() int { +func (r ListWorkspaceDagFiltersResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type UpdateSsoConnectionResponse struct { +type ListWorkspaceDagsResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *SsoConnection + JSON200 *ListWorkspaceDags JSON400 *Error JSON401 *Error JSON403 *Error @@ -8363,7 +10581,7 @@ type UpdateSsoConnectionResponse struct { } // Status returns HTTPResponse.Status -func (r UpdateSsoConnectionResponse) Status() string { +func (r ListWorkspaceDagsResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -8371,17 +10589,17 @@ func (r UpdateSsoConnectionResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r UpdateSsoConnectionResponse) StatusCode() int { +func (r ListWorkspaceDagsResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type GetStripeClientSecretResponse struct { +type ListWorkspaceTeamsResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *StripeClientSecret + JSON200 *TeamsPaginated JSON400 *Error JSON401 *Error JSON403 *Error @@ -8390,7 +10608,7 @@ type GetStripeClientSecretResponse struct { } // Status returns HTTPResponse.Status -func (r GetStripeClientSecretResponse) Status() string { +func (r ListWorkspaceTeamsResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -8398,17 +10616,16 @@ func (r GetStripeClientSecretResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r GetStripeClientSecretResponse) StatusCode() int { +func (r ListWorkspaceTeamsResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type ListOrganizationTeamsResponse struct { +type DeleteWorkspaceTeamResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *TeamsPaginated JSON400 *Error JSON401 *Error JSON403 *Error @@ -8417,7 +10634,7 @@ type ListOrganizationTeamsResponse struct { } // Status returns HTTPResponse.Status -func (r ListOrganizationTeamsResponse) Status() string { +func (r DeleteWorkspaceTeamResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -8425,17 +10642,17 @@ func (r ListOrganizationTeamsResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r ListOrganizationTeamsResponse) StatusCode() int { +func (r DeleteWorkspaceTeamResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type CreateTeamResponse struct { +type MutateWorkspaceTeamRoleResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *Team + JSON200 *TeamRole JSON400 *Error JSON401 *Error JSON403 *Error @@ -8444,7 +10661,7 @@ type CreateTeamResponse struct { } // Status returns HTTPResponse.Status -func (r CreateTeamResponse) Status() string { +func (r MutateWorkspaceTeamRoleResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -8452,26 +10669,25 @@ func (r CreateTeamResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r CreateTeamResponse) StatusCode() int { +func (r MutateWorkspaceTeamRoleResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type DeleteTeamResponse struct { +type ListWorkspaceUsersResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *Team + JSON200 *UsersPaginated JSON400 *Error JSON401 *Error JSON403 *Error - JSON404 *Error JSON500 *Error } // Status returns HTTPResponse.Status -func (r DeleteTeamResponse) Status() string { +func (r ListWorkspaceUsersResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -8479,17 +10695,17 @@ func (r DeleteTeamResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r DeleteTeamResponse) StatusCode() int { +func (r ListWorkspaceUsersResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type GetTeamResponse struct { +type DeleteWorkspaceUserResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *Team + JSON200 *User JSON400 *Error JSON401 *Error JSON403 *Error @@ -8498,7 +10714,7 @@ type GetTeamResponse struct { } // Status returns HTTPResponse.Status -func (r GetTeamResponse) Status() string { +func (r DeleteWorkspaceUserResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -8506,17 +10722,17 @@ func (r GetTeamResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r GetTeamResponse) StatusCode() int { +func (r DeleteWorkspaceUserResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type UpdateTeamResponse struct { +type MutateWorkspaceUserRoleResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *Team + JSON200 *UserRole JSON400 *Error JSON401 *Error JSON403 *Error @@ -8525,7 +10741,7 @@ type UpdateTeamResponse struct { } // Status returns HTTPResponse.Status -func (r UpdateTeamResponse) Status() string { +func (r MutateWorkspaceUserRoleResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -8533,16 +10749,17 @@ func (r UpdateTeamResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r UpdateTeamResponse) StatusCode() int { +func (r MutateWorkspaceUserRoleResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type AddTeamMembersResponse struct { +type GetSelfUserResponse struct { Body []byte HTTPResponse *http.Response + JSON200 *Self JSON400 *Error JSON401 *Error JSON403 *Error @@ -8551,7 +10768,7 @@ type AddTeamMembersResponse struct { } // Status returns HTTPResponse.Status -func (r AddTeamMembersResponse) Status() string { +func (r GetSelfUserResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -8559,16 +10776,17 @@ func (r AddTeamMembersResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r AddTeamMembersResponse) StatusCode() int { +func (r GetSelfUserResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type RemoveTeamMemberResponse struct { +type UpdateSelfUserInviteResponse struct { Body []byte HTTPResponse *http.Response + JSON200 *Invite JSON400 *Error JSON401 *Error JSON403 *Error @@ -8577,7 +10795,7 @@ type RemoveTeamMemberResponse struct { } // Status returns HTTPResponse.Status -func (r RemoveTeamMemberResponse) Status() string { +func (r UpdateSelfUserInviteResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -8585,1350 +10803,1738 @@ func (r RemoveTeamMemberResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r RemoveTeamMemberResponse) StatusCode() int { +func (r UpdateSelfUserInviteResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } - return 0 + return 0 +} + +// GetUserInviteWithResponse request returning *GetUserInviteResponse +func (c *ClientWithResponses) GetUserInviteWithResponse(ctx context.Context, inviteId string, reqEditors ...RequestEditorFn) (*GetUserInviteResponse, error) { + rsp, err := c.GetUserInvite(ctx, inviteId, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetUserInviteResponse(rsp) +} + +// ValidateSsoLoginWithBodyWithResponse request with arbitrary body returning *ValidateSsoLoginResponse +func (c *ClientWithResponses) ValidateSsoLoginWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ValidateSsoLoginResponse, error) { + rsp, err := c.ValidateSsoLoginWithBody(ctx, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseValidateSsoLoginResponse(rsp) +} + +func (c *ClientWithResponses) ValidateSsoLoginWithResponse(ctx context.Context, body ValidateSsoLoginJSONRequestBody, reqEditors ...RequestEditorFn) (*ValidateSsoLoginResponse, error) { + rsp, err := c.ValidateSsoLogin(ctx, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseValidateSsoLoginResponse(rsp) +} + +// GetSharedClusterWithResponse request returning *GetSharedClusterResponse +func (c *ClientWithResponses) GetSharedClusterWithResponse(ctx context.Context, params *GetSharedClusterParams, reqEditors ...RequestEditorFn) (*GetSharedClusterResponse, error) { + rsp, err := c.GetSharedCluster(ctx, params, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetSharedClusterResponse(rsp) +} + +// GetClusterOptionsWithResponse request returning *GetClusterOptionsResponse +func (c *ClientWithResponses) GetClusterOptionsWithResponse(ctx context.Context, params *GetClusterOptionsParams, reqEditors ...RequestEditorFn) (*GetClusterOptionsResponse, error) { + rsp, err := c.GetClusterOptions(ctx, params, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetClusterOptionsResponse(rsp) +} + +// GetDeploymentOptionsWithResponse request returning *GetDeploymentOptionsResponse +func (c *ClientWithResponses) GetDeploymentOptionsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetDeploymentOptionsResponse, error) { + rsp, err := c.GetDeploymentOptions(ctx, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetDeploymentOptionsResponse(rsp) +} + +// ListOrganizationAuthIdsWithResponse request returning *ListOrganizationAuthIdsResponse +func (c *ClientWithResponses) ListOrganizationAuthIdsWithResponse(ctx context.Context, params *ListOrganizationAuthIdsParams, reqEditors ...RequestEditorFn) (*ListOrganizationAuthIdsResponse, error) { + rsp, err := c.ListOrganizationAuthIds(ctx, params, reqEditors...) + if err != nil { + return nil, err + } + return ParseListOrganizationAuthIdsResponse(rsp) +} + +// ListOrganizationsWithResponse request returning *ListOrganizationsResponse +func (c *ClientWithResponses) ListOrganizationsWithResponse(ctx context.Context, params *ListOrganizationsParams, reqEditors ...RequestEditorFn) (*ListOrganizationsResponse, error) { + rsp, err := c.ListOrganizations(ctx, params, reqEditors...) + if err != nil { + return nil, err + } + return ParseListOrganizationsResponse(rsp) +} + +// CreateOrganizationWithBodyWithResponse request with arbitrary body returning *CreateOrganizationResponse +func (c *ClientWithResponses) CreateOrganizationWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateOrganizationResponse, error) { + rsp, err := c.CreateOrganizationWithBody(ctx, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseCreateOrganizationResponse(rsp) } -type ListOrgUsersResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *UsersPaginated - JSON400 *Error - JSON401 *Error - JSON403 *Error - JSON500 *Error +func (c *ClientWithResponses) CreateOrganizationWithResponse(ctx context.Context, body CreateOrganizationJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateOrganizationResponse, error) { + rsp, err := c.CreateOrganization(ctx, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseCreateOrganizationResponse(rsp) } -// Status returns HTTPResponse.Status -func (r ListOrgUsersResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status +// GetOrganizationWithResponse request returning *GetOrganizationResponse +func (c *ClientWithResponses) GetOrganizationWithResponse(ctx context.Context, orgShortNameId string, params *GetOrganizationParams, reqEditors ...RequestEditorFn) (*GetOrganizationResponse, error) { + rsp, err := c.GetOrganization(ctx, orgShortNameId, params, reqEditors...) + if err != nil { + return nil, err } - return http.StatusText(0) + return ParseGetOrganizationResponse(rsp) } -// StatusCode returns HTTPResponse.StatusCode -func (r ListOrgUsersResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode +// UpdateOrganizationWithBodyWithResponse request with arbitrary body returning *UpdateOrganizationResponse +func (c *ClientWithResponses) UpdateOrganizationWithBodyWithResponse(ctx context.Context, orgShortNameId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateOrganizationResponse, error) { + rsp, err := c.UpdateOrganizationWithBody(ctx, orgShortNameId, contentType, body, reqEditors...) + if err != nil { + return nil, err } - return 0 + return ParseUpdateOrganizationResponse(rsp) } -type DeleteOrgUserResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *User - JSON400 *Error - JSON401 *Error - JSON403 *Error - JSON404 *Error - JSON500 *Error +func (c *ClientWithResponses) UpdateOrganizationWithResponse(ctx context.Context, orgShortNameId string, body UpdateOrganizationJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateOrganizationResponse, error) { + rsp, err := c.UpdateOrganization(ctx, orgShortNameId, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseUpdateOrganizationResponse(rsp) } -// Status returns HTTPResponse.Status -func (r DeleteOrgUserResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status +// ListOrganizationApiTokensWithResponse request returning *ListOrganizationApiTokensResponse +func (c *ClientWithResponses) ListOrganizationApiTokensWithResponse(ctx context.Context, orgShortNameId string, params *ListOrganizationApiTokensParams, reqEditors ...RequestEditorFn) (*ListOrganizationApiTokensResponse, error) { + rsp, err := c.ListOrganizationApiTokens(ctx, orgShortNameId, params, reqEditors...) + if err != nil { + return nil, err } - return http.StatusText(0) + return ParseListOrganizationApiTokensResponse(rsp) } -// StatusCode returns HTTPResponse.StatusCode -func (r DeleteOrgUserResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode +// CreateOrganizationApiTokenWithBodyWithResponse request with arbitrary body returning *CreateOrganizationApiTokenResponse +func (c *ClientWithResponses) CreateOrganizationApiTokenWithBodyWithResponse(ctx context.Context, orgShortNameId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateOrganizationApiTokenResponse, error) { + rsp, err := c.CreateOrganizationApiTokenWithBody(ctx, orgShortNameId, contentType, body, reqEditors...) + if err != nil { + return nil, err } - return 0 + return ParseCreateOrganizationApiTokenResponse(rsp) } -type GetUserResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *User - JSON400 *Error - JSON401 *Error - JSON403 *Error - JSON404 *Error - JSON500 *Error +func (c *ClientWithResponses) CreateOrganizationApiTokenWithResponse(ctx context.Context, orgShortNameId string, body CreateOrganizationApiTokenJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateOrganizationApiTokenResponse, error) { + rsp, err := c.CreateOrganizationApiToken(ctx, orgShortNameId, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseCreateOrganizationApiTokenResponse(rsp) } -// Status returns HTTPResponse.Status -func (r GetUserResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status +// DeleteOrganizationApiTokenWithResponse request returning *DeleteOrganizationApiTokenResponse +func (c *ClientWithResponses) DeleteOrganizationApiTokenWithResponse(ctx context.Context, orgShortNameId string, apiTokenId string, reqEditors ...RequestEditorFn) (*DeleteOrganizationApiTokenResponse, error) { + rsp, err := c.DeleteOrganizationApiToken(ctx, orgShortNameId, apiTokenId, reqEditors...) + if err != nil { + return nil, err } - return http.StatusText(0) + return ParseDeleteOrganizationApiTokenResponse(rsp) } -// StatusCode returns HTTPResponse.StatusCode -func (r GetUserResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode +// GetOrganizationApiTokenWithResponse request returning *GetOrganizationApiTokenResponse +func (c *ClientWithResponses) GetOrganizationApiTokenWithResponse(ctx context.Context, orgShortNameId string, apiTokenId string, reqEditors ...RequestEditorFn) (*GetOrganizationApiTokenResponse, error) { + rsp, err := c.GetOrganizationApiToken(ctx, orgShortNameId, apiTokenId, reqEditors...) + if err != nil { + return nil, err } - return 0 + return ParseGetOrganizationApiTokenResponse(rsp) } -type MutateOrgUserRoleResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *UserRole - JSON400 *Error - JSON401 *Error - JSON403 *Error - JSON404 *Error - JSON500 *Error +// UpdateOrganizationApiTokenWithBodyWithResponse request with arbitrary body returning *UpdateOrganizationApiTokenResponse +func (c *ClientWithResponses) UpdateOrganizationApiTokenWithBodyWithResponse(ctx context.Context, orgShortNameId string, apiTokenId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateOrganizationApiTokenResponse, error) { + rsp, err := c.UpdateOrganizationApiTokenWithBody(ctx, orgShortNameId, apiTokenId, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseUpdateOrganizationApiTokenResponse(rsp) } -// Status returns HTTPResponse.Status -func (r MutateOrgUserRoleResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status +func (c *ClientWithResponses) UpdateOrganizationApiTokenWithResponse(ctx context.Context, orgShortNameId string, apiTokenId string, body UpdateOrganizationApiTokenJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateOrganizationApiTokenResponse, error) { + rsp, err := c.UpdateOrganizationApiToken(ctx, orgShortNameId, apiTokenId, body, reqEditors...) + if err != nil { + return nil, err } - return http.StatusText(0) + return ParseUpdateOrganizationApiTokenResponse(rsp) } -// StatusCode returns HTTPResponse.StatusCode -func (r MutateOrgUserRoleResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode +// RotateOrganizationApiTokenWithResponse request returning *RotateOrganizationApiTokenResponse +func (c *ClientWithResponses) RotateOrganizationApiTokenWithResponse(ctx context.Context, orgShortNameId string, apiTokenId string, reqEditors ...RequestEditorFn) (*RotateOrganizationApiTokenResponse, error) { + rsp, err := c.RotateOrganizationApiToken(ctx, orgShortNameId, apiTokenId, reqEditors...) + if err != nil { + return nil, err } - return 0 + return ParseRotateOrganizationApiTokenResponse(rsp) } -type ValidateCreditCardPaymentResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *ValidateCreditCardPayment - JSON400 *Error - JSON401 *Error - JSON403 *Error - JSON404 *Error - JSON500 *Error +// GetOrganizationAuditLogsWithResponse request returning *GetOrganizationAuditLogsResponse +func (c *ClientWithResponses) GetOrganizationAuditLogsWithResponse(ctx context.Context, orgShortNameId string, params *GetOrganizationAuditLogsParams, reqEditors ...RequestEditorFn) (*GetOrganizationAuditLogsResponse, error) { + rsp, err := c.GetOrganizationAuditLogs(ctx, orgShortNameId, params, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetOrganizationAuditLogsResponse(rsp) } -// Status returns HTTPResponse.Status -func (r ValidateCreditCardPaymentResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status +// ListClustersWithResponse request returning *ListClustersResponse +func (c *ClientWithResponses) ListClustersWithResponse(ctx context.Context, orgShortNameId string, params *ListClustersParams, reqEditors ...RequestEditorFn) (*ListClustersResponse, error) { + rsp, err := c.ListClusters(ctx, orgShortNameId, params, reqEditors...) + if err != nil { + return nil, err } - return http.StatusText(0) + return ParseListClustersResponse(rsp) } -// StatusCode returns HTTPResponse.StatusCode -func (r ValidateCreditCardPaymentResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode +// CreateAwsClusterWithBodyWithResponse request with arbitrary body returning *CreateAwsClusterResponse +func (c *ClientWithResponses) CreateAwsClusterWithBodyWithResponse(ctx context.Context, orgShortNameId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateAwsClusterResponse, error) { + rsp, err := c.CreateAwsClusterWithBody(ctx, orgShortNameId, contentType, body, reqEditors...) + if err != nil { + return nil, err } - return 0 + return ParseCreateAwsClusterResponse(rsp) } -type ListWorkspacesResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *WorkspacesPaginated - JSON400 *Error - JSON401 *Error - JSON403 *Error - JSON500 *Error +func (c *ClientWithResponses) CreateAwsClusterWithResponse(ctx context.Context, orgShortNameId string, body CreateAwsClusterJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateAwsClusterResponse, error) { + rsp, err := c.CreateAwsCluster(ctx, orgShortNameId, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseCreateAwsClusterResponse(rsp) } -// Status returns HTTPResponse.Status -func (r ListWorkspacesResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status +// UpdateAwsClusterWithBodyWithResponse request with arbitrary body returning *UpdateAwsClusterResponse +func (c *ClientWithResponses) UpdateAwsClusterWithBodyWithResponse(ctx context.Context, orgShortNameId string, clusterId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateAwsClusterResponse, error) { + rsp, err := c.UpdateAwsClusterWithBody(ctx, orgShortNameId, clusterId, contentType, body, reqEditors...) + if err != nil { + return nil, err } - return http.StatusText(0) + return ParseUpdateAwsClusterResponse(rsp) } -// StatusCode returns HTTPResponse.StatusCode -func (r ListWorkspacesResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode +func (c *ClientWithResponses) UpdateAwsClusterWithResponse(ctx context.Context, orgShortNameId string, clusterId string, body UpdateAwsClusterJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateAwsClusterResponse, error) { + rsp, err := c.UpdateAwsCluster(ctx, orgShortNameId, clusterId, body, reqEditors...) + if err != nil { + return nil, err } - return 0 + return ParseUpdateAwsClusterResponse(rsp) } -type CreateWorkspaceResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *Workspace - JSON400 *Error - JSON401 *Error - JSON403 *Error - JSON404 *Error - JSON500 *Error +// CreateAzureClusterWithBodyWithResponse request with arbitrary body returning *CreateAzureClusterResponse +func (c *ClientWithResponses) CreateAzureClusterWithBodyWithResponse(ctx context.Context, orgShortNameId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateAzureClusterResponse, error) { + rsp, err := c.CreateAzureClusterWithBody(ctx, orgShortNameId, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseCreateAzureClusterResponse(rsp) } -// Status returns HTTPResponse.Status -func (r CreateWorkspaceResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status +func (c *ClientWithResponses) CreateAzureClusterWithResponse(ctx context.Context, orgShortNameId string, body CreateAzureClusterJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateAzureClusterResponse, error) { + rsp, err := c.CreateAzureCluster(ctx, orgShortNameId, body, reqEditors...) + if err != nil { + return nil, err } - return http.StatusText(0) + return ParseCreateAzureClusterResponse(rsp) } -// StatusCode returns HTTPResponse.StatusCode -func (r CreateWorkspaceResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode +// UpdateAzureClusterWithBodyWithResponse request with arbitrary body returning *UpdateAzureClusterResponse +func (c *ClientWithResponses) UpdateAzureClusterWithBodyWithResponse(ctx context.Context, orgShortNameId string, clusterId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateAzureClusterResponse, error) { + rsp, err := c.UpdateAzureClusterWithBody(ctx, orgShortNameId, clusterId, contentType, body, reqEditors...) + if err != nil { + return nil, err } - return 0 + return ParseUpdateAzureClusterResponse(rsp) } -type DeleteWorkspaceResponse struct { - Body []byte - HTTPResponse *http.Response - JSON400 *Error - JSON401 *Error - JSON403 *Error - JSON404 *Error - JSON500 *Error +func (c *ClientWithResponses) UpdateAzureClusterWithResponse(ctx context.Context, orgShortNameId string, clusterId string, body UpdateAzureClusterJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateAzureClusterResponse, error) { + rsp, err := c.UpdateAzureCluster(ctx, orgShortNameId, clusterId, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseUpdateAzureClusterResponse(rsp) } -// Status returns HTTPResponse.Status -func (r DeleteWorkspaceResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status +// CreateGcpClusterWithBodyWithResponse request with arbitrary body returning *CreateGcpClusterResponse +func (c *ClientWithResponses) CreateGcpClusterWithBodyWithResponse(ctx context.Context, orgShortNameId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateGcpClusterResponse, error) { + rsp, err := c.CreateGcpClusterWithBody(ctx, orgShortNameId, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseCreateGcpClusterResponse(rsp) +} + +func (c *ClientWithResponses) CreateGcpClusterWithResponse(ctx context.Context, orgShortNameId string, body CreateGcpClusterJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateGcpClusterResponse, error) { + rsp, err := c.CreateGcpCluster(ctx, orgShortNameId, body, reqEditors...) + if err != nil { + return nil, err } - return http.StatusText(0) + return ParseCreateGcpClusterResponse(rsp) } -// StatusCode returns HTTPResponse.StatusCode -func (r DeleteWorkspaceResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode +// UpdateGcpClusterWithBodyWithResponse request with arbitrary body returning *UpdateGcpClusterResponse +func (c *ClientWithResponses) UpdateGcpClusterWithBodyWithResponse(ctx context.Context, orgShortNameId string, clusterId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateGcpClusterResponse, error) { + rsp, err := c.UpdateGcpClusterWithBody(ctx, orgShortNameId, clusterId, contentType, body, reqEditors...) + if err != nil { + return nil, err } - return 0 + return ParseUpdateGcpClusterResponse(rsp) } -type GetWorkspaceResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *Workspace - JSON400 *Error - JSON401 *Error - JSON403 *Error - JSON404 *Error - JSON500 *Error +func (c *ClientWithResponses) UpdateGcpClusterWithResponse(ctx context.Context, orgShortNameId string, clusterId string, body UpdateGcpClusterJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateGcpClusterResponse, error) { + rsp, err := c.UpdateGcpCluster(ctx, orgShortNameId, clusterId, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseUpdateGcpClusterResponse(rsp) } -// Status returns HTTPResponse.Status -func (r GetWorkspaceResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status +// DeleteClusterWithResponse request returning *DeleteClusterResponse +func (c *ClientWithResponses) DeleteClusterWithResponse(ctx context.Context, orgShortNameId string, clusterId string, reqEditors ...RequestEditorFn) (*DeleteClusterResponse, error) { + rsp, err := c.DeleteCluster(ctx, orgShortNameId, clusterId, reqEditors...) + if err != nil { + return nil, err } - return http.StatusText(0) + return ParseDeleteClusterResponse(rsp) } -// StatusCode returns HTTPResponse.StatusCode -func (r GetWorkspaceResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode +// GetClusterWithResponse request returning *GetClusterResponse +func (c *ClientWithResponses) GetClusterWithResponse(ctx context.Context, orgShortNameId string, clusterId string, reqEditors ...RequestEditorFn) (*GetClusterResponse, error) { + rsp, err := c.GetCluster(ctx, orgShortNameId, clusterId, reqEditors...) + if err != nil { + return nil, err } - return 0 + return ParseGetClusterResponse(rsp) } -type UpdateWorkspaceResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *Workspace - JSON400 *Error - JSON401 *Error - JSON403 *Error - JSON404 *Error - JSON500 *Error +// ListManagedDomainsWithResponse request returning *ListManagedDomainsResponse +func (c *ClientWithResponses) ListManagedDomainsWithResponse(ctx context.Context, orgShortNameId string, reqEditors ...RequestEditorFn) (*ListManagedDomainsResponse, error) { + rsp, err := c.ListManagedDomains(ctx, orgShortNameId, reqEditors...) + if err != nil { + return nil, err + } + return ParseListManagedDomainsResponse(rsp) } -// Status returns HTTPResponse.Status -func (r UpdateWorkspaceResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status +// CreateManagedDomainWithBodyWithResponse request with arbitrary body returning *CreateManagedDomainResponse +func (c *ClientWithResponses) CreateManagedDomainWithBodyWithResponse(ctx context.Context, orgShortNameId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateManagedDomainResponse, error) { + rsp, err := c.CreateManagedDomainWithBody(ctx, orgShortNameId, contentType, body, reqEditors...) + if err != nil { + return nil, err } - return http.StatusText(0) + return ParseCreateManagedDomainResponse(rsp) } -// StatusCode returns HTTPResponse.StatusCode -func (r UpdateWorkspaceResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode +func (c *ClientWithResponses) CreateManagedDomainWithResponse(ctx context.Context, orgShortNameId string, body CreateManagedDomainJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateManagedDomainResponse, error) { + rsp, err := c.CreateManagedDomain(ctx, orgShortNameId, body, reqEditors...) + if err != nil { + return nil, err } - return 0 + return ParseCreateManagedDomainResponse(rsp) } -type ListWorkspaceDagFiltersResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *DagFilters - JSON400 *Error - JSON401 *Error - JSON403 *Error - JSON404 *Error - JSON500 *Error +// DeleteManagedDomainWithResponse request returning *DeleteManagedDomainResponse +func (c *ClientWithResponses) DeleteManagedDomainWithResponse(ctx context.Context, orgShortNameId string, domainId string, reqEditors ...RequestEditorFn) (*DeleteManagedDomainResponse, error) { + rsp, err := c.DeleteManagedDomain(ctx, orgShortNameId, domainId, reqEditors...) + if err != nil { + return nil, err + } + return ParseDeleteManagedDomainResponse(rsp) } -// Status returns HTTPResponse.Status -func (r ListWorkspaceDagFiltersResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status +// GetManagedDomainWithResponse request returning *GetManagedDomainResponse +func (c *ClientWithResponses) GetManagedDomainWithResponse(ctx context.Context, orgShortNameId string, domainId string, reqEditors ...RequestEditorFn) (*GetManagedDomainResponse, error) { + rsp, err := c.GetManagedDomain(ctx, orgShortNameId, domainId, reqEditors...) + if err != nil { + return nil, err } - return http.StatusText(0) + return ParseGetManagedDomainResponse(rsp) } -// StatusCode returns HTTPResponse.StatusCode -func (r ListWorkspaceDagFiltersResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode +// UpdateManagedDomainWithBodyWithResponse request with arbitrary body returning *UpdateManagedDomainResponse +func (c *ClientWithResponses) UpdateManagedDomainWithBodyWithResponse(ctx context.Context, orgShortNameId string, domainId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateManagedDomainResponse, error) { + rsp, err := c.UpdateManagedDomainWithBody(ctx, orgShortNameId, domainId, contentType, body, reqEditors...) + if err != nil { + return nil, err } - return 0 + return ParseUpdateManagedDomainResponse(rsp) } -type ListWorkspaceDagsResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *ListWorkspaceDags - JSON400 *Error - JSON401 *Error - JSON403 *Error - JSON404 *Error - JSON500 *Error +func (c *ClientWithResponses) UpdateManagedDomainWithResponse(ctx context.Context, orgShortNameId string, domainId string, body UpdateManagedDomainJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateManagedDomainResponse, error) { + rsp, err := c.UpdateManagedDomain(ctx, orgShortNameId, domainId, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseUpdateManagedDomainResponse(rsp) } -// Status returns HTTPResponse.Status -func (r ListWorkspaceDagsResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status +// VerifyManagedDomainWithResponse request returning *VerifyManagedDomainResponse +func (c *ClientWithResponses) VerifyManagedDomainWithResponse(ctx context.Context, orgShortNameId string, domainId string, reqEditors ...RequestEditorFn) (*VerifyManagedDomainResponse, error) { + rsp, err := c.VerifyManagedDomain(ctx, orgShortNameId, domainId, reqEditors...) + if err != nil { + return nil, err } - return http.StatusText(0) + return ParseVerifyManagedDomainResponse(rsp) } -// StatusCode returns HTTPResponse.StatusCode -func (r ListWorkspaceDagsResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode +// GetDraftInvoiceWithResponse request returning *GetDraftInvoiceResponse +func (c *ClientWithResponses) GetDraftInvoiceWithResponse(ctx context.Context, orgShortNameId string, reqEditors ...RequestEditorFn) (*GetDraftInvoiceResponse, error) { + rsp, err := c.GetDraftInvoice(ctx, orgShortNameId, reqEditors...) + if err != nil { + return nil, err } - return 0 + return ParseGetDraftInvoiceResponse(rsp) } -type ListWorkspaceTeamsResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *TeamsPaginated - JSON400 *Error - JSON401 *Error - JSON403 *Error - JSON404 *Error - JSON500 *Error +// CreateUserInviteWithBodyWithResponse request with arbitrary body returning *CreateUserInviteResponse +func (c *ClientWithResponses) CreateUserInviteWithBodyWithResponse(ctx context.Context, orgShortNameId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateUserInviteResponse, error) { + rsp, err := c.CreateUserInviteWithBody(ctx, orgShortNameId, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseCreateUserInviteResponse(rsp) } -// Status returns HTTPResponse.Status -func (r ListWorkspaceTeamsResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status +func (c *ClientWithResponses) CreateUserInviteWithResponse(ctx context.Context, orgShortNameId string, body CreateUserInviteJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateUserInviteResponse, error) { + rsp, err := c.CreateUserInvite(ctx, orgShortNameId, body, reqEditors...) + if err != nil { + return nil, err } - return http.StatusText(0) + return ParseCreateUserInviteResponse(rsp) } -// StatusCode returns HTTPResponse.StatusCode -func (r ListWorkspaceTeamsResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode +// DeleteUserInviteWithResponse request returning *DeleteUserInviteResponse +func (c *ClientWithResponses) DeleteUserInviteWithResponse(ctx context.Context, orgShortNameId string, inviteId string, reqEditors ...RequestEditorFn) (*DeleteUserInviteResponse, error) { + rsp, err := c.DeleteUserInvite(ctx, orgShortNameId, inviteId, reqEditors...) + if err != nil { + return nil, err } - return 0 + return ParseDeleteUserInviteResponse(rsp) } -type DeleteWorkspaceTeamResponse struct { - Body []byte - HTTPResponse *http.Response - JSON400 *Error - JSON401 *Error - JSON403 *Error - JSON404 *Error - JSON500 *Error +// GetCreditSummaryWithResponse request returning *GetCreditSummaryResponse +func (c *ClientWithResponses) GetCreditSummaryWithResponse(ctx context.Context, orgShortNameId string, reqEditors ...RequestEditorFn) (*GetCreditSummaryResponse, error) { + rsp, err := c.GetCreditSummary(ctx, orgShortNameId, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetCreditSummaryResponse(rsp) } -// Status returns HTTPResponse.Status -func (r DeleteWorkspaceTeamResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status +// GetMetronomeDashboardWithResponse request returning *GetMetronomeDashboardResponse +func (c *ClientWithResponses) GetMetronomeDashboardWithResponse(ctx context.Context, orgShortNameId string, pType GetMetronomeDashboardParamsType, params *GetMetronomeDashboardParams, reqEditors ...RequestEditorFn) (*GetMetronomeDashboardResponse, error) { + rsp, err := c.GetMetronomeDashboard(ctx, orgShortNameId, pType, params, reqEditors...) + if err != nil { + return nil, err } - return http.StatusText(0) + return ParseGetMetronomeDashboardResponse(rsp) } -// StatusCode returns HTTPResponse.StatusCode -func (r DeleteWorkspaceTeamResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode +// GetPaymentMethodWithResponse request returning *GetPaymentMethodResponse +func (c *ClientWithResponses) GetPaymentMethodWithResponse(ctx context.Context, orgShortNameId string, reqEditors ...RequestEditorFn) (*GetPaymentMethodResponse, error) { + rsp, err := c.GetPaymentMethod(ctx, orgShortNameId, reqEditors...) + if err != nil { + return nil, err } - return 0 + return ParseGetPaymentMethodResponse(rsp) } -type MutateWorkspaceTeamRoleResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *TeamRole - JSON400 *Error - JSON401 *Error - JSON403 *Error - JSON404 *Error - JSON500 *Error +// DeleteSsoBypassKeyWithResponse request returning *DeleteSsoBypassKeyResponse +func (c *ClientWithResponses) DeleteSsoBypassKeyWithResponse(ctx context.Context, orgShortNameId string, reqEditors ...RequestEditorFn) (*DeleteSsoBypassKeyResponse, error) { + rsp, err := c.DeleteSsoBypassKey(ctx, orgShortNameId, reqEditors...) + if err != nil { + return nil, err + } + return ParseDeleteSsoBypassKeyResponse(rsp) } -// Status returns HTTPResponse.Status -func (r MutateWorkspaceTeamRoleResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status +// GetSsoBypassKeyWithResponse request returning *GetSsoBypassKeyResponse +func (c *ClientWithResponses) GetSsoBypassKeyWithResponse(ctx context.Context, orgShortNameId string, reqEditors ...RequestEditorFn) (*GetSsoBypassKeyResponse, error) { + rsp, err := c.GetSsoBypassKey(ctx, orgShortNameId, reqEditors...) + if err != nil { + return nil, err } - return http.StatusText(0) + return ParseGetSsoBypassKeyResponse(rsp) } -// StatusCode returns HTTPResponse.StatusCode -func (r MutateWorkspaceTeamRoleResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode +// UpsertSsoBypassKeyWithResponse request returning *UpsertSsoBypassKeyResponse +func (c *ClientWithResponses) UpsertSsoBypassKeyWithResponse(ctx context.Context, orgShortNameId string, reqEditors ...RequestEditorFn) (*UpsertSsoBypassKeyResponse, error) { + rsp, err := c.UpsertSsoBypassKey(ctx, orgShortNameId, reqEditors...) + if err != nil { + return nil, err } - return 0 + return ParseUpsertSsoBypassKeyResponse(rsp) } -type ListWorkspaceUsersResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *UsersPaginated - JSON400 *Error - JSON401 *Error - JSON403 *Error - JSON500 *Error +// ListSsoConnectionsWithResponse request returning *ListSsoConnectionsResponse +func (c *ClientWithResponses) ListSsoConnectionsWithResponse(ctx context.Context, orgShortNameId string, reqEditors ...RequestEditorFn) (*ListSsoConnectionsResponse, error) { + rsp, err := c.ListSsoConnections(ctx, orgShortNameId, reqEditors...) + if err != nil { + return nil, err + } + return ParseListSsoConnectionsResponse(rsp) } -// Status returns HTTPResponse.Status -func (r ListWorkspaceUsersResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status +// CreateSsoConnectionWithBodyWithResponse request with arbitrary body returning *CreateSsoConnectionResponse +func (c *ClientWithResponses) CreateSsoConnectionWithBodyWithResponse(ctx context.Context, orgShortNameId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateSsoConnectionResponse, error) { + rsp, err := c.CreateSsoConnectionWithBody(ctx, orgShortNameId, contentType, body, reqEditors...) + if err != nil { + return nil, err } - return http.StatusText(0) + return ParseCreateSsoConnectionResponse(rsp) } -// StatusCode returns HTTPResponse.StatusCode -func (r ListWorkspaceUsersResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode +func (c *ClientWithResponses) CreateSsoConnectionWithResponse(ctx context.Context, orgShortNameId string, body CreateSsoConnectionJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateSsoConnectionResponse, error) { + rsp, err := c.CreateSsoConnection(ctx, orgShortNameId, body, reqEditors...) + if err != nil { + return nil, err } - return 0 + return ParseCreateSsoConnectionResponse(rsp) } -type DeleteWorkspaceUserResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *User - JSON400 *Error - JSON401 *Error - JSON403 *Error - JSON404 *Error - JSON500 *Error +// DeleteSsoConnectionWithResponse request returning *DeleteSsoConnectionResponse +func (c *ClientWithResponses) DeleteSsoConnectionWithResponse(ctx context.Context, orgShortNameId string, connectionId string, reqEditors ...RequestEditorFn) (*DeleteSsoConnectionResponse, error) { + rsp, err := c.DeleteSsoConnection(ctx, orgShortNameId, connectionId, reqEditors...) + if err != nil { + return nil, err + } + return ParseDeleteSsoConnectionResponse(rsp) } -// Status returns HTTPResponse.Status -func (r DeleteWorkspaceUserResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status +// GetSsoConnectionWithResponse request returning *GetSsoConnectionResponse +func (c *ClientWithResponses) GetSsoConnectionWithResponse(ctx context.Context, orgShortNameId string, connectionId string, reqEditors ...RequestEditorFn) (*GetSsoConnectionResponse, error) { + rsp, err := c.GetSsoConnection(ctx, orgShortNameId, connectionId, reqEditors...) + if err != nil { + return nil, err } - return http.StatusText(0) + return ParseGetSsoConnectionResponse(rsp) } -// StatusCode returns HTTPResponse.StatusCode -func (r DeleteWorkspaceUserResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode +// UpdateSsoConnectionWithBodyWithResponse request with arbitrary body returning *UpdateSsoConnectionResponse +func (c *ClientWithResponses) UpdateSsoConnectionWithBodyWithResponse(ctx context.Context, orgShortNameId string, connectionId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateSsoConnectionResponse, error) { + rsp, err := c.UpdateSsoConnectionWithBody(ctx, orgShortNameId, connectionId, contentType, body, reqEditors...) + if err != nil { + return nil, err } - return 0 + return ParseUpdateSsoConnectionResponse(rsp) } -type MutateWorkspaceUserRoleResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *UserRole - JSON400 *Error - JSON401 *Error - JSON403 *Error - JSON404 *Error - JSON500 *Error +func (c *ClientWithResponses) UpdateSsoConnectionWithResponse(ctx context.Context, orgShortNameId string, connectionId string, body UpdateSsoConnectionJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateSsoConnectionResponse, error) { + rsp, err := c.UpdateSsoConnection(ctx, orgShortNameId, connectionId, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseUpdateSsoConnectionResponse(rsp) } -// Status returns HTTPResponse.Status -func (r MutateWorkspaceUserRoleResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status +// GetStripeClientSecretWithResponse request returning *GetStripeClientSecretResponse +func (c *ClientWithResponses) GetStripeClientSecretWithResponse(ctx context.Context, orgShortNameId string, pType GetStripeClientSecretParamsType, reqEditors ...RequestEditorFn) (*GetStripeClientSecretResponse, error) { + rsp, err := c.GetStripeClientSecret(ctx, orgShortNameId, pType, reqEditors...) + if err != nil { + return nil, err } - return http.StatusText(0) + return ParseGetStripeClientSecretResponse(rsp) } -// StatusCode returns HTTPResponse.StatusCode -func (r MutateWorkspaceUserRoleResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode +// ListOrganizationTeamsWithResponse request returning *ListOrganizationTeamsResponse +func (c *ClientWithResponses) ListOrganizationTeamsWithResponse(ctx context.Context, orgShortNameId string, params *ListOrganizationTeamsParams, reqEditors ...RequestEditorFn) (*ListOrganizationTeamsResponse, error) { + rsp, err := c.ListOrganizationTeams(ctx, orgShortNameId, params, reqEditors...) + if err != nil { + return nil, err } - return 0 + return ParseListOrganizationTeamsResponse(rsp) } -type GetSelfUserResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *Self - JSON400 *Error - JSON401 *Error - JSON403 *Error - JSON404 *Error - JSON500 *Error +// CreateTeamWithBodyWithResponse request with arbitrary body returning *CreateTeamResponse +func (c *ClientWithResponses) CreateTeamWithBodyWithResponse(ctx context.Context, orgShortNameId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateTeamResponse, error) { + rsp, err := c.CreateTeamWithBody(ctx, orgShortNameId, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseCreateTeamResponse(rsp) } -// Status returns HTTPResponse.Status -func (r GetSelfUserResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status +func (c *ClientWithResponses) CreateTeamWithResponse(ctx context.Context, orgShortNameId string, body CreateTeamJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateTeamResponse, error) { + rsp, err := c.CreateTeam(ctx, orgShortNameId, body, reqEditors...) + if err != nil { + return nil, err } - return http.StatusText(0) + return ParseCreateTeamResponse(rsp) } -// StatusCode returns HTTPResponse.StatusCode -func (r GetSelfUserResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode +// DeleteTeamWithResponse request returning *DeleteTeamResponse +func (c *ClientWithResponses) DeleteTeamWithResponse(ctx context.Context, orgShortNameId string, teamId string, reqEditors ...RequestEditorFn) (*DeleteTeamResponse, error) { + rsp, err := c.DeleteTeam(ctx, orgShortNameId, teamId, reqEditors...) + if err != nil { + return nil, err } - return 0 + return ParseDeleteTeamResponse(rsp) } -type UpdateSelfUserInviteResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *Invite - JSON400 *Error - JSON401 *Error - JSON403 *Error - JSON404 *Error - JSON500 *Error +// GetTeamWithResponse request returning *GetTeamResponse +func (c *ClientWithResponses) GetTeamWithResponse(ctx context.Context, orgShortNameId string, teamId string, reqEditors ...RequestEditorFn) (*GetTeamResponse, error) { + rsp, err := c.GetTeam(ctx, orgShortNameId, teamId, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetTeamResponse(rsp) } -// Status returns HTTPResponse.Status -func (r UpdateSelfUserInviteResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status +// UpdateTeamWithBodyWithResponse request with arbitrary body returning *UpdateTeamResponse +func (c *ClientWithResponses) UpdateTeamWithBodyWithResponse(ctx context.Context, orgShortNameId string, teamId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateTeamResponse, error) { + rsp, err := c.UpdateTeamWithBody(ctx, orgShortNameId, teamId, contentType, body, reqEditors...) + if err != nil { + return nil, err } - return http.StatusText(0) + return ParseUpdateTeamResponse(rsp) } -// StatusCode returns HTTPResponse.StatusCode -func (r UpdateSelfUserInviteResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode +func (c *ClientWithResponses) UpdateTeamWithResponse(ctx context.Context, orgShortNameId string, teamId string, body UpdateTeamJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateTeamResponse, error) { + rsp, err := c.UpdateTeam(ctx, orgShortNameId, teamId, body, reqEditors...) + if err != nil { + return nil, err } - return 0 + return ParseUpdateTeamResponse(rsp) } -// GetUserInviteWithResponse request returning *GetUserInviteResponse -func (c *ClientWithResponses) GetUserInviteWithResponse(ctx context.Context, inviteId string, reqEditors ...RequestEditorFn) (*GetUserInviteResponse, error) { - rsp, err := c.GetUserInvite(ctx, inviteId, reqEditors...) +// AddTeamMembersWithBodyWithResponse request with arbitrary body returning *AddTeamMembersResponse +func (c *ClientWithResponses) AddTeamMembersWithBodyWithResponse(ctx context.Context, orgShortNameId string, teamId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*AddTeamMembersResponse, error) { + rsp, err := c.AddTeamMembersWithBody(ctx, orgShortNameId, teamId, contentType, body, reqEditors...) if err != nil { return nil, err } - return ParseGetUserInviteResponse(rsp) + return ParseAddTeamMembersResponse(rsp) } -// ValidateSsoLoginWithBodyWithResponse request with arbitrary body returning *ValidateSsoLoginResponse -func (c *ClientWithResponses) ValidateSsoLoginWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ValidateSsoLoginResponse, error) { - rsp, err := c.ValidateSsoLoginWithBody(ctx, contentType, body, reqEditors...) +func (c *ClientWithResponses) AddTeamMembersWithResponse(ctx context.Context, orgShortNameId string, teamId string, body AddTeamMembersJSONRequestBody, reqEditors ...RequestEditorFn) (*AddTeamMembersResponse, error) { + rsp, err := c.AddTeamMembers(ctx, orgShortNameId, teamId, body, reqEditors...) if err != nil { return nil, err } - return ParseValidateSsoLoginResponse(rsp) + return ParseAddTeamMembersResponse(rsp) } -func (c *ClientWithResponses) ValidateSsoLoginWithResponse(ctx context.Context, body ValidateSsoLoginJSONRequestBody, reqEditors ...RequestEditorFn) (*ValidateSsoLoginResponse, error) { - rsp, err := c.ValidateSsoLogin(ctx, body, reqEditors...) +// RemoveTeamMemberWithResponse request returning *RemoveTeamMemberResponse +func (c *ClientWithResponses) RemoveTeamMemberWithResponse(ctx context.Context, orgShortNameId string, teamId string, memberId string, reqEditors ...RequestEditorFn) (*RemoveTeamMemberResponse, error) { + rsp, err := c.RemoveTeamMember(ctx, orgShortNameId, teamId, memberId, reqEditors...) if err != nil { return nil, err } - return ParseValidateSsoLoginResponse(rsp) + return ParseRemoveTeamMemberResponse(rsp) } -// GetSharedClusterWithResponse request returning *GetSharedClusterResponse -func (c *ClientWithResponses) GetSharedClusterWithResponse(ctx context.Context, params *GetSharedClusterParams, reqEditors ...RequestEditorFn) (*GetSharedClusterResponse, error) { - rsp, err := c.GetSharedCluster(ctx, params, reqEditors...) +// ListOrgUsersWithResponse request returning *ListOrgUsersResponse +func (c *ClientWithResponses) ListOrgUsersWithResponse(ctx context.Context, orgShortNameId string, params *ListOrgUsersParams, reqEditors ...RequestEditorFn) (*ListOrgUsersResponse, error) { + rsp, err := c.ListOrgUsers(ctx, orgShortNameId, params, reqEditors...) if err != nil { return nil, err } - return ParseGetSharedClusterResponse(rsp) + return ParseListOrgUsersResponse(rsp) } -// GetClusterOptionsWithResponse request returning *GetClusterOptionsResponse -func (c *ClientWithResponses) GetClusterOptionsWithResponse(ctx context.Context, params *GetClusterOptionsParams, reqEditors ...RequestEditorFn) (*GetClusterOptionsResponse, error) { - rsp, err := c.GetClusterOptions(ctx, params, reqEditors...) +// DeleteOrgUserWithResponse request returning *DeleteOrgUserResponse +func (c *ClientWithResponses) DeleteOrgUserWithResponse(ctx context.Context, orgShortNameId string, userId string, reqEditors ...RequestEditorFn) (*DeleteOrgUserResponse, error) { + rsp, err := c.DeleteOrgUser(ctx, orgShortNameId, userId, reqEditors...) if err != nil { return nil, err } - return ParseGetClusterOptionsResponse(rsp) + return ParseDeleteOrgUserResponse(rsp) } -// GetDeploymentOptionsWithResponse request returning *GetDeploymentOptionsResponse -func (c *ClientWithResponses) GetDeploymentOptionsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetDeploymentOptionsResponse, error) { - rsp, err := c.GetDeploymentOptions(ctx, reqEditors...) +// GetUserWithResponse request returning *GetUserResponse +func (c *ClientWithResponses) GetUserWithResponse(ctx context.Context, orgShortNameId string, userId string, reqEditors ...RequestEditorFn) (*GetUserResponse, error) { + rsp, err := c.GetUser(ctx, orgShortNameId, userId, reqEditors...) if err != nil { return nil, err } - return ParseGetDeploymentOptionsResponse(rsp) + return ParseGetUserResponse(rsp) } -// ListOrganizationAuthIdsWithResponse request returning *ListOrganizationAuthIdsResponse -func (c *ClientWithResponses) ListOrganizationAuthIdsWithResponse(ctx context.Context, params *ListOrganizationAuthIdsParams, reqEditors ...RequestEditorFn) (*ListOrganizationAuthIdsResponse, error) { - rsp, err := c.ListOrganizationAuthIds(ctx, params, reqEditors...) +// MutateOrgUserRoleWithBodyWithResponse request with arbitrary body returning *MutateOrgUserRoleResponse +func (c *ClientWithResponses) MutateOrgUserRoleWithBodyWithResponse(ctx context.Context, orgShortNameId string, userId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*MutateOrgUserRoleResponse, error) { + rsp, err := c.MutateOrgUserRoleWithBody(ctx, orgShortNameId, userId, contentType, body, reqEditors...) if err != nil { return nil, err } - return ParseListOrganizationAuthIdsResponse(rsp) + return ParseMutateOrgUserRoleResponse(rsp) } -// ListOrganizationsWithResponse request returning *ListOrganizationsResponse -func (c *ClientWithResponses) ListOrganizationsWithResponse(ctx context.Context, params *ListOrganizationsParams, reqEditors ...RequestEditorFn) (*ListOrganizationsResponse, error) { - rsp, err := c.ListOrganizations(ctx, params, reqEditors...) +func (c *ClientWithResponses) MutateOrgUserRoleWithResponse(ctx context.Context, orgShortNameId string, userId string, body MutateOrgUserRoleJSONRequestBody, reqEditors ...RequestEditorFn) (*MutateOrgUserRoleResponse, error) { + rsp, err := c.MutateOrgUserRole(ctx, orgShortNameId, userId, body, reqEditors...) if err != nil { return nil, err } - return ParseListOrganizationsResponse(rsp) + return ParseMutateOrgUserRoleResponse(rsp) } -// CreateOrganizationWithBodyWithResponse request with arbitrary body returning *CreateOrganizationResponse -func (c *ClientWithResponses) CreateOrganizationWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateOrganizationResponse, error) { - rsp, err := c.CreateOrganizationWithBody(ctx, contentType, body, reqEditors...) +// ValidateCreditCardPaymentWithBodyWithResponse request with arbitrary body returning *ValidateCreditCardPaymentResponse +func (c *ClientWithResponses) ValidateCreditCardPaymentWithBodyWithResponse(ctx context.Context, orgShortNameId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ValidateCreditCardPaymentResponse, error) { + rsp, err := c.ValidateCreditCardPaymentWithBody(ctx, orgShortNameId, contentType, body, reqEditors...) if err != nil { return nil, err } - return ParseCreateOrganizationResponse(rsp) + return ParseValidateCreditCardPaymentResponse(rsp) } -func (c *ClientWithResponses) CreateOrganizationWithResponse(ctx context.Context, body CreateOrganizationJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateOrganizationResponse, error) { - rsp, err := c.CreateOrganization(ctx, body, reqEditors...) +func (c *ClientWithResponses) ValidateCreditCardPaymentWithResponse(ctx context.Context, orgShortNameId string, body ValidateCreditCardPaymentJSONRequestBody, reqEditors ...RequestEditorFn) (*ValidateCreditCardPaymentResponse, error) { + rsp, err := c.ValidateCreditCardPayment(ctx, orgShortNameId, body, reqEditors...) if err != nil { return nil, err } - return ParseCreateOrganizationResponse(rsp) + return ParseValidateCreditCardPaymentResponse(rsp) } -// GetOrganizationWithResponse request returning *GetOrganizationResponse -func (c *ClientWithResponses) GetOrganizationWithResponse(ctx context.Context, orgShortNameId string, params *GetOrganizationParams, reqEditors ...RequestEditorFn) (*GetOrganizationResponse, error) { - rsp, err := c.GetOrganization(ctx, orgShortNameId, params, reqEditors...) +// ListWorkspacesWithResponse request returning *ListWorkspacesResponse +func (c *ClientWithResponses) ListWorkspacesWithResponse(ctx context.Context, orgShortNameId string, params *ListWorkspacesParams, reqEditors ...RequestEditorFn) (*ListWorkspacesResponse, error) { + rsp, err := c.ListWorkspaces(ctx, orgShortNameId, params, reqEditors...) if err != nil { return nil, err } - return ParseGetOrganizationResponse(rsp) + return ParseListWorkspacesResponse(rsp) } -// UpdateOrganizationWithBodyWithResponse request with arbitrary body returning *UpdateOrganizationResponse -func (c *ClientWithResponses) UpdateOrganizationWithBodyWithResponse(ctx context.Context, orgShortNameId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateOrganizationResponse, error) { - rsp, err := c.UpdateOrganizationWithBody(ctx, orgShortNameId, contentType, body, reqEditors...) +// CreateWorkspaceWithBodyWithResponse request with arbitrary body returning *CreateWorkspaceResponse +func (c *ClientWithResponses) CreateWorkspaceWithBodyWithResponse(ctx context.Context, orgShortNameId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateWorkspaceResponse, error) { + rsp, err := c.CreateWorkspaceWithBody(ctx, orgShortNameId, contentType, body, reqEditors...) if err != nil { return nil, err } - return ParseUpdateOrganizationResponse(rsp) + return ParseCreateWorkspaceResponse(rsp) } -func (c *ClientWithResponses) UpdateOrganizationWithResponse(ctx context.Context, orgShortNameId string, body UpdateOrganizationJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateOrganizationResponse, error) { - rsp, err := c.UpdateOrganization(ctx, orgShortNameId, body, reqEditors...) +func (c *ClientWithResponses) CreateWorkspaceWithResponse(ctx context.Context, orgShortNameId string, body CreateWorkspaceJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateWorkspaceResponse, error) { + rsp, err := c.CreateWorkspace(ctx, orgShortNameId, body, reqEditors...) if err != nil { return nil, err } - return ParseUpdateOrganizationResponse(rsp) + return ParseCreateWorkspaceResponse(rsp) } -// GetOrganizationAuditLogsWithResponse request returning *GetOrganizationAuditLogsResponse -func (c *ClientWithResponses) GetOrganizationAuditLogsWithResponse(ctx context.Context, orgShortNameId string, params *GetOrganizationAuditLogsParams, reqEditors ...RequestEditorFn) (*GetOrganizationAuditLogsResponse, error) { - rsp, err := c.GetOrganizationAuditLogs(ctx, orgShortNameId, params, reqEditors...) +// DeleteWorkspaceWithResponse request returning *DeleteWorkspaceResponse +func (c *ClientWithResponses) DeleteWorkspaceWithResponse(ctx context.Context, orgShortNameId string, workspaceId string, reqEditors ...RequestEditorFn) (*DeleteWorkspaceResponse, error) { + rsp, err := c.DeleteWorkspace(ctx, orgShortNameId, workspaceId, reqEditors...) if err != nil { return nil, err } - return ParseGetOrganizationAuditLogsResponse(rsp) + return ParseDeleteWorkspaceResponse(rsp) } -// ListClustersWithResponse request returning *ListClustersResponse -func (c *ClientWithResponses) ListClustersWithResponse(ctx context.Context, orgShortNameId string, params *ListClustersParams, reqEditors ...RequestEditorFn) (*ListClustersResponse, error) { - rsp, err := c.ListClusters(ctx, orgShortNameId, params, reqEditors...) +// GetWorkspaceWithResponse request returning *GetWorkspaceResponse +func (c *ClientWithResponses) GetWorkspaceWithResponse(ctx context.Context, orgShortNameId string, workspaceId string, reqEditors ...RequestEditorFn) (*GetWorkspaceResponse, error) { + rsp, err := c.GetWorkspace(ctx, orgShortNameId, workspaceId, reqEditors...) if err != nil { return nil, err } - return ParseListClustersResponse(rsp) + return ParseGetWorkspaceResponse(rsp) } -// CreateAwsClusterWithBodyWithResponse request with arbitrary body returning *CreateAwsClusterResponse -func (c *ClientWithResponses) CreateAwsClusterWithBodyWithResponse(ctx context.Context, orgShortNameId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateAwsClusterResponse, error) { - rsp, err := c.CreateAwsClusterWithBody(ctx, orgShortNameId, contentType, body, reqEditors...) +// UpdateWorkspaceWithBodyWithResponse request with arbitrary body returning *UpdateWorkspaceResponse +func (c *ClientWithResponses) UpdateWorkspaceWithBodyWithResponse(ctx context.Context, orgShortNameId string, workspaceId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateWorkspaceResponse, error) { + rsp, err := c.UpdateWorkspaceWithBody(ctx, orgShortNameId, workspaceId, contentType, body, reqEditors...) if err != nil { return nil, err } - return ParseCreateAwsClusterResponse(rsp) + return ParseUpdateWorkspaceResponse(rsp) } -func (c *ClientWithResponses) CreateAwsClusterWithResponse(ctx context.Context, orgShortNameId string, body CreateAwsClusterJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateAwsClusterResponse, error) { - rsp, err := c.CreateAwsCluster(ctx, orgShortNameId, body, reqEditors...) +func (c *ClientWithResponses) UpdateWorkspaceWithResponse(ctx context.Context, orgShortNameId string, workspaceId string, body UpdateWorkspaceJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateWorkspaceResponse, error) { + rsp, err := c.UpdateWorkspace(ctx, orgShortNameId, workspaceId, body, reqEditors...) if err != nil { return nil, err } - return ParseCreateAwsClusterResponse(rsp) + return ParseUpdateWorkspaceResponse(rsp) } -// UpdateAwsClusterWithBodyWithResponse request with arbitrary body returning *UpdateAwsClusterResponse -func (c *ClientWithResponses) UpdateAwsClusterWithBodyWithResponse(ctx context.Context, orgShortNameId string, clusterId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateAwsClusterResponse, error) { - rsp, err := c.UpdateAwsClusterWithBody(ctx, orgShortNameId, clusterId, contentType, body, reqEditors...) +// ListWorkspaceApiTokensWithResponse request returning *ListWorkspaceApiTokensResponse +func (c *ClientWithResponses) ListWorkspaceApiTokensWithResponse(ctx context.Context, orgShortNameId string, workspaceId string, params *ListWorkspaceApiTokensParams, reqEditors ...RequestEditorFn) (*ListWorkspaceApiTokensResponse, error) { + rsp, err := c.ListWorkspaceApiTokens(ctx, orgShortNameId, workspaceId, params, reqEditors...) if err != nil { return nil, err } - return ParseUpdateAwsClusterResponse(rsp) + return ParseListWorkspaceApiTokensResponse(rsp) } -func (c *ClientWithResponses) UpdateAwsClusterWithResponse(ctx context.Context, orgShortNameId string, clusterId string, body UpdateAwsClusterJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateAwsClusterResponse, error) { - rsp, err := c.UpdateAwsCluster(ctx, orgShortNameId, clusterId, body, reqEditors...) +// CreateWorkspaceApiTokenWithBodyWithResponse request with arbitrary body returning *CreateWorkspaceApiTokenResponse +func (c *ClientWithResponses) CreateWorkspaceApiTokenWithBodyWithResponse(ctx context.Context, orgShortNameId string, workspaceId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateWorkspaceApiTokenResponse, error) { + rsp, err := c.CreateWorkspaceApiTokenWithBody(ctx, orgShortNameId, workspaceId, contentType, body, reqEditors...) if err != nil { return nil, err } - return ParseUpdateAwsClusterResponse(rsp) + return ParseCreateWorkspaceApiTokenResponse(rsp) } -// CreateAzureClusterWithBodyWithResponse request with arbitrary body returning *CreateAzureClusterResponse -func (c *ClientWithResponses) CreateAzureClusterWithBodyWithResponse(ctx context.Context, orgShortNameId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateAzureClusterResponse, error) { - rsp, err := c.CreateAzureClusterWithBody(ctx, orgShortNameId, contentType, body, reqEditors...) +func (c *ClientWithResponses) CreateWorkspaceApiTokenWithResponse(ctx context.Context, orgShortNameId string, workspaceId string, body CreateWorkspaceApiTokenJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateWorkspaceApiTokenResponse, error) { + rsp, err := c.CreateWorkspaceApiToken(ctx, orgShortNameId, workspaceId, body, reqEditors...) if err != nil { return nil, err } - return ParseCreateAzureClusterResponse(rsp) + return ParseCreateWorkspaceApiTokenResponse(rsp) } -func (c *ClientWithResponses) CreateAzureClusterWithResponse(ctx context.Context, orgShortNameId string, body CreateAzureClusterJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateAzureClusterResponse, error) { - rsp, err := c.CreateAzureCluster(ctx, orgShortNameId, body, reqEditors...) +// DeleteWorkspaceApiTokenWithResponse request returning *DeleteWorkspaceApiTokenResponse +func (c *ClientWithResponses) DeleteWorkspaceApiTokenWithResponse(ctx context.Context, orgShortNameId string, workspaceId string, apiTokenId string, reqEditors ...RequestEditorFn) (*DeleteWorkspaceApiTokenResponse, error) { + rsp, err := c.DeleteWorkspaceApiToken(ctx, orgShortNameId, workspaceId, apiTokenId, reqEditors...) if err != nil { return nil, err } - return ParseCreateAzureClusterResponse(rsp) + return ParseDeleteWorkspaceApiTokenResponse(rsp) } -// UpdateAzureClusterWithBodyWithResponse request with arbitrary body returning *UpdateAzureClusterResponse -func (c *ClientWithResponses) UpdateAzureClusterWithBodyWithResponse(ctx context.Context, orgShortNameId string, clusterId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateAzureClusterResponse, error) { - rsp, err := c.UpdateAzureClusterWithBody(ctx, orgShortNameId, clusterId, contentType, body, reqEditors...) +// GetWorkspaceApiTokenWithResponse request returning *GetWorkspaceApiTokenResponse +func (c *ClientWithResponses) GetWorkspaceApiTokenWithResponse(ctx context.Context, orgShortNameId string, workspaceId string, apiTokenId string, reqEditors ...RequestEditorFn) (*GetWorkspaceApiTokenResponse, error) { + rsp, err := c.GetWorkspaceApiToken(ctx, orgShortNameId, workspaceId, apiTokenId, reqEditors...) if err != nil { return nil, err } - return ParseUpdateAzureClusterResponse(rsp) + return ParseGetWorkspaceApiTokenResponse(rsp) } -func (c *ClientWithResponses) UpdateAzureClusterWithResponse(ctx context.Context, orgShortNameId string, clusterId string, body UpdateAzureClusterJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateAzureClusterResponse, error) { - rsp, err := c.UpdateAzureCluster(ctx, orgShortNameId, clusterId, body, reqEditors...) +// UpdateWorkspaceApiTokenWithBodyWithResponse request with arbitrary body returning *UpdateWorkspaceApiTokenResponse +func (c *ClientWithResponses) UpdateWorkspaceApiTokenWithBodyWithResponse(ctx context.Context, orgShortNameId string, workspaceId string, apiTokenId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateWorkspaceApiTokenResponse, error) { + rsp, err := c.UpdateWorkspaceApiTokenWithBody(ctx, orgShortNameId, workspaceId, apiTokenId, contentType, body, reqEditors...) if err != nil { return nil, err } - return ParseUpdateAzureClusterResponse(rsp) + return ParseUpdateWorkspaceApiTokenResponse(rsp) } -// CreateGcpClusterWithBodyWithResponse request with arbitrary body returning *CreateGcpClusterResponse -func (c *ClientWithResponses) CreateGcpClusterWithBodyWithResponse(ctx context.Context, orgShortNameId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateGcpClusterResponse, error) { - rsp, err := c.CreateGcpClusterWithBody(ctx, orgShortNameId, contentType, body, reqEditors...) +func (c *ClientWithResponses) UpdateWorkspaceApiTokenWithResponse(ctx context.Context, orgShortNameId string, workspaceId string, apiTokenId string, body UpdateWorkspaceApiTokenJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateWorkspaceApiTokenResponse, error) { + rsp, err := c.UpdateWorkspaceApiToken(ctx, orgShortNameId, workspaceId, apiTokenId, body, reqEditors...) if err != nil { return nil, err } - return ParseCreateGcpClusterResponse(rsp) + return ParseUpdateWorkspaceApiTokenResponse(rsp) } -func (c *ClientWithResponses) CreateGcpClusterWithResponse(ctx context.Context, orgShortNameId string, body CreateGcpClusterJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateGcpClusterResponse, error) { - rsp, err := c.CreateGcpCluster(ctx, orgShortNameId, body, reqEditors...) +// RotateWorkspaceApiTokenWithResponse request returning *RotateWorkspaceApiTokenResponse +func (c *ClientWithResponses) RotateWorkspaceApiTokenWithResponse(ctx context.Context, orgShortNameId string, workspaceId string, apiTokenId string, reqEditors ...RequestEditorFn) (*RotateWorkspaceApiTokenResponse, error) { + rsp, err := c.RotateWorkspaceApiToken(ctx, orgShortNameId, workspaceId, apiTokenId, reqEditors...) if err != nil { return nil, err } - return ParseCreateGcpClusterResponse(rsp) + return ParseRotateWorkspaceApiTokenResponse(rsp) } -// UpdateGcpClusterWithBodyWithResponse request with arbitrary body returning *UpdateGcpClusterResponse -func (c *ClientWithResponses) UpdateGcpClusterWithBodyWithResponse(ctx context.Context, orgShortNameId string, clusterId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateGcpClusterResponse, error) { - rsp, err := c.UpdateGcpClusterWithBody(ctx, orgShortNameId, clusterId, contentType, body, reqEditors...) +// ListWorkspaceDagFiltersWithResponse request returning *ListWorkspaceDagFiltersResponse +func (c *ClientWithResponses) ListWorkspaceDagFiltersWithResponse(ctx context.Context, orgShortNameId string, workspaceId string, reqEditors ...RequestEditorFn) (*ListWorkspaceDagFiltersResponse, error) { + rsp, err := c.ListWorkspaceDagFilters(ctx, orgShortNameId, workspaceId, reqEditors...) if err != nil { return nil, err } - return ParseUpdateGcpClusterResponse(rsp) + return ParseListWorkspaceDagFiltersResponse(rsp) } -func (c *ClientWithResponses) UpdateGcpClusterWithResponse(ctx context.Context, orgShortNameId string, clusterId string, body UpdateGcpClusterJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateGcpClusterResponse, error) { - rsp, err := c.UpdateGcpCluster(ctx, orgShortNameId, clusterId, body, reqEditors...) +// ListWorkspaceDagsWithResponse request returning *ListWorkspaceDagsResponse +func (c *ClientWithResponses) ListWorkspaceDagsWithResponse(ctx context.Context, orgShortNameId string, workspaceId string, params *ListWorkspaceDagsParams, reqEditors ...RequestEditorFn) (*ListWorkspaceDagsResponse, error) { + rsp, err := c.ListWorkspaceDags(ctx, orgShortNameId, workspaceId, params, reqEditors...) if err != nil { return nil, err } - return ParseUpdateGcpClusterResponse(rsp) + return ParseListWorkspaceDagsResponse(rsp) } -// DeleteClusterWithResponse request returning *DeleteClusterResponse -func (c *ClientWithResponses) DeleteClusterWithResponse(ctx context.Context, orgShortNameId string, clusterId string, reqEditors ...RequestEditorFn) (*DeleteClusterResponse, error) { - rsp, err := c.DeleteCluster(ctx, orgShortNameId, clusterId, reqEditors...) +// ListWorkspaceTeamsWithResponse request returning *ListWorkspaceTeamsResponse +func (c *ClientWithResponses) ListWorkspaceTeamsWithResponse(ctx context.Context, orgShortNameId string, workspaceId string, params *ListWorkspaceTeamsParams, reqEditors ...RequestEditorFn) (*ListWorkspaceTeamsResponse, error) { + rsp, err := c.ListWorkspaceTeams(ctx, orgShortNameId, workspaceId, params, reqEditors...) if err != nil { return nil, err } - return ParseDeleteClusterResponse(rsp) + return ParseListWorkspaceTeamsResponse(rsp) } -// GetClusterWithResponse request returning *GetClusterResponse -func (c *ClientWithResponses) GetClusterWithResponse(ctx context.Context, orgShortNameId string, clusterId string, reqEditors ...RequestEditorFn) (*GetClusterResponse, error) { - rsp, err := c.GetCluster(ctx, orgShortNameId, clusterId, reqEditors...) +// DeleteWorkspaceTeamWithResponse request returning *DeleteWorkspaceTeamResponse +func (c *ClientWithResponses) DeleteWorkspaceTeamWithResponse(ctx context.Context, orgShortNameId string, workspaceId string, teamId string, reqEditors ...RequestEditorFn) (*DeleteWorkspaceTeamResponse, error) { + rsp, err := c.DeleteWorkspaceTeam(ctx, orgShortNameId, workspaceId, teamId, reqEditors...) if err != nil { return nil, err } - return ParseGetClusterResponse(rsp) + return ParseDeleteWorkspaceTeamResponse(rsp) } -// ListManagedDomainsWithResponse request returning *ListManagedDomainsResponse -func (c *ClientWithResponses) ListManagedDomainsWithResponse(ctx context.Context, orgShortNameId string, reqEditors ...RequestEditorFn) (*ListManagedDomainsResponse, error) { - rsp, err := c.ListManagedDomains(ctx, orgShortNameId, reqEditors...) +// MutateWorkspaceTeamRoleWithBodyWithResponse request with arbitrary body returning *MutateWorkspaceTeamRoleResponse +func (c *ClientWithResponses) MutateWorkspaceTeamRoleWithBodyWithResponse(ctx context.Context, orgShortNameId string, workspaceId string, teamId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*MutateWorkspaceTeamRoleResponse, error) { + rsp, err := c.MutateWorkspaceTeamRoleWithBody(ctx, orgShortNameId, workspaceId, teamId, contentType, body, reqEditors...) if err != nil { return nil, err } - return ParseListManagedDomainsResponse(rsp) + return ParseMutateWorkspaceTeamRoleResponse(rsp) } -// CreateManagedDomainWithBodyWithResponse request with arbitrary body returning *CreateManagedDomainResponse -func (c *ClientWithResponses) CreateManagedDomainWithBodyWithResponse(ctx context.Context, orgShortNameId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateManagedDomainResponse, error) { - rsp, err := c.CreateManagedDomainWithBody(ctx, orgShortNameId, contentType, body, reqEditors...) +func (c *ClientWithResponses) MutateWorkspaceTeamRoleWithResponse(ctx context.Context, orgShortNameId string, workspaceId string, teamId string, body MutateWorkspaceTeamRoleJSONRequestBody, reqEditors ...RequestEditorFn) (*MutateWorkspaceTeamRoleResponse, error) { + rsp, err := c.MutateWorkspaceTeamRole(ctx, orgShortNameId, workspaceId, teamId, body, reqEditors...) if err != nil { return nil, err } - return ParseCreateManagedDomainResponse(rsp) + return ParseMutateWorkspaceTeamRoleResponse(rsp) } -func (c *ClientWithResponses) CreateManagedDomainWithResponse(ctx context.Context, orgShortNameId string, body CreateManagedDomainJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateManagedDomainResponse, error) { - rsp, err := c.CreateManagedDomain(ctx, orgShortNameId, body, reqEditors...) +// ListWorkspaceUsersWithResponse request returning *ListWorkspaceUsersResponse +func (c *ClientWithResponses) ListWorkspaceUsersWithResponse(ctx context.Context, orgShortNameId string, workspaceId string, params *ListWorkspaceUsersParams, reqEditors ...RequestEditorFn) (*ListWorkspaceUsersResponse, error) { + rsp, err := c.ListWorkspaceUsers(ctx, orgShortNameId, workspaceId, params, reqEditors...) if err != nil { return nil, err } - return ParseCreateManagedDomainResponse(rsp) + return ParseListWorkspaceUsersResponse(rsp) } -// DeleteManagedDomainWithResponse request returning *DeleteManagedDomainResponse -func (c *ClientWithResponses) DeleteManagedDomainWithResponse(ctx context.Context, orgShortNameId string, domainId string, reqEditors ...RequestEditorFn) (*DeleteManagedDomainResponse, error) { - rsp, err := c.DeleteManagedDomain(ctx, orgShortNameId, domainId, reqEditors...) +// DeleteWorkspaceUserWithResponse request returning *DeleteWorkspaceUserResponse +func (c *ClientWithResponses) DeleteWorkspaceUserWithResponse(ctx context.Context, orgShortNameId string, workspaceId string, userId string, reqEditors ...RequestEditorFn) (*DeleteWorkspaceUserResponse, error) { + rsp, err := c.DeleteWorkspaceUser(ctx, orgShortNameId, workspaceId, userId, reqEditors...) if err != nil { return nil, err } - return ParseDeleteManagedDomainResponse(rsp) + return ParseDeleteWorkspaceUserResponse(rsp) } -// GetManagedDomainWithResponse request returning *GetManagedDomainResponse -func (c *ClientWithResponses) GetManagedDomainWithResponse(ctx context.Context, orgShortNameId string, domainId string, reqEditors ...RequestEditorFn) (*GetManagedDomainResponse, error) { - rsp, err := c.GetManagedDomain(ctx, orgShortNameId, domainId, reqEditors...) +// MutateWorkspaceUserRoleWithBodyWithResponse request with arbitrary body returning *MutateWorkspaceUserRoleResponse +func (c *ClientWithResponses) MutateWorkspaceUserRoleWithBodyWithResponse(ctx context.Context, orgShortNameId string, workspaceId string, userId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*MutateWorkspaceUserRoleResponse, error) { + rsp, err := c.MutateWorkspaceUserRoleWithBody(ctx, orgShortNameId, workspaceId, userId, contentType, body, reqEditors...) if err != nil { return nil, err } - return ParseGetManagedDomainResponse(rsp) + return ParseMutateWorkspaceUserRoleResponse(rsp) } -// UpdateManagedDomainWithBodyWithResponse request with arbitrary body returning *UpdateManagedDomainResponse -func (c *ClientWithResponses) UpdateManagedDomainWithBodyWithResponse(ctx context.Context, orgShortNameId string, domainId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateManagedDomainResponse, error) { - rsp, err := c.UpdateManagedDomainWithBody(ctx, orgShortNameId, domainId, contentType, body, reqEditors...) +func (c *ClientWithResponses) MutateWorkspaceUserRoleWithResponse(ctx context.Context, orgShortNameId string, workspaceId string, userId string, body MutateWorkspaceUserRoleJSONRequestBody, reqEditors ...RequestEditorFn) (*MutateWorkspaceUserRoleResponse, error) { + rsp, err := c.MutateWorkspaceUserRole(ctx, orgShortNameId, workspaceId, userId, body, reqEditors...) if err != nil { return nil, err } - return ParseUpdateManagedDomainResponse(rsp) + return ParseMutateWorkspaceUserRoleResponse(rsp) } -func (c *ClientWithResponses) UpdateManagedDomainWithResponse(ctx context.Context, orgShortNameId string, domainId string, body UpdateManagedDomainJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateManagedDomainResponse, error) { - rsp, err := c.UpdateManagedDomain(ctx, orgShortNameId, domainId, body, reqEditors...) +// GetSelfUserWithResponse request returning *GetSelfUserResponse +func (c *ClientWithResponses) GetSelfUserWithResponse(ctx context.Context, params *GetSelfUserParams, reqEditors ...RequestEditorFn) (*GetSelfUserResponse, error) { + rsp, err := c.GetSelfUser(ctx, params, reqEditors...) if err != nil { return nil, err } - return ParseUpdateManagedDomainResponse(rsp) + return ParseGetSelfUserResponse(rsp) } -// VerifyManagedDomainWithResponse request returning *VerifyManagedDomainResponse -func (c *ClientWithResponses) VerifyManagedDomainWithResponse(ctx context.Context, orgShortNameId string, domainId string, reqEditors ...RequestEditorFn) (*VerifyManagedDomainResponse, error) { - rsp, err := c.VerifyManagedDomain(ctx, orgShortNameId, domainId, reqEditors...) +// UpdateSelfUserInviteWithBodyWithResponse request with arbitrary body returning *UpdateSelfUserInviteResponse +func (c *ClientWithResponses) UpdateSelfUserInviteWithBodyWithResponse(ctx context.Context, inviteId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateSelfUserInviteResponse, error) { + rsp, err := c.UpdateSelfUserInviteWithBody(ctx, inviteId, contentType, body, reqEditors...) if err != nil { return nil, err } - return ParseVerifyManagedDomainResponse(rsp) + return ParseUpdateSelfUserInviteResponse(rsp) } -// GetDraftInvoiceWithResponse request returning *GetDraftInvoiceResponse -func (c *ClientWithResponses) GetDraftInvoiceWithResponse(ctx context.Context, orgShortNameId string, reqEditors ...RequestEditorFn) (*GetDraftInvoiceResponse, error) { - rsp, err := c.GetDraftInvoice(ctx, orgShortNameId, reqEditors...) +func (c *ClientWithResponses) UpdateSelfUserInviteWithResponse(ctx context.Context, inviteId string, body UpdateSelfUserInviteJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateSelfUserInviteResponse, error) { + rsp, err := c.UpdateSelfUserInvite(ctx, inviteId, body, reqEditors...) if err != nil { return nil, err } - return ParseGetDraftInvoiceResponse(rsp) + return ParseUpdateSelfUserInviteResponse(rsp) } -// CreateUserInviteWithBodyWithResponse request with arbitrary body returning *CreateUserInviteResponse -func (c *ClientWithResponses) CreateUserInviteWithBodyWithResponse(ctx context.Context, orgShortNameId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateUserInviteResponse, error) { - rsp, err := c.CreateUserInviteWithBody(ctx, orgShortNameId, contentType, body, reqEditors...) +// ParseGetUserInviteResponse parses an HTTP response from a GetUserInviteWithResponse call +func ParseGetUserInviteResponse(rsp *http.Response) (*GetUserInviteResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - return ParseCreateUserInviteResponse(rsp) -} -func (c *ClientWithResponses) CreateUserInviteWithResponse(ctx context.Context, orgShortNameId string, body CreateUserInviteJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateUserInviteResponse, error) { - rsp, err := c.CreateUserInvite(ctx, orgShortNameId, body, reqEditors...) - if err != nil { - return nil, err + response := &GetUserInviteResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest Invite + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON401 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 403: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON403 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON500 = &dest + } - return ParseCreateUserInviteResponse(rsp) -} -// DeleteUserInviteWithResponse request returning *DeleteUserInviteResponse -func (c *ClientWithResponses) DeleteUserInviteWithResponse(ctx context.Context, orgShortNameId string, inviteId string, reqEditors ...RequestEditorFn) (*DeleteUserInviteResponse, error) { - rsp, err := c.DeleteUserInvite(ctx, orgShortNameId, inviteId, reqEditors...) - if err != nil { - return nil, err - } - return ParseDeleteUserInviteResponse(rsp) + return response, nil } -// GetPaymentMethodWithResponse request returning *GetPaymentMethodResponse -func (c *ClientWithResponses) GetPaymentMethodWithResponse(ctx context.Context, orgShortNameId string, reqEditors ...RequestEditorFn) (*GetPaymentMethodResponse, error) { - rsp, err := c.GetPaymentMethod(ctx, orgShortNameId, reqEditors...) +// ParseValidateSsoLoginResponse parses an HTTP response from a ValidateSsoLoginWithResponse call +func ParseValidateSsoLoginResponse(rsp *http.Response) (*ValidateSsoLoginResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - return ParseGetPaymentMethodResponse(rsp) -} -// DeleteSsoBypassKeyWithResponse request returning *DeleteSsoBypassKeyResponse -func (c *ClientWithResponses) DeleteSsoBypassKeyWithResponse(ctx context.Context, orgShortNameId string, reqEditors ...RequestEditorFn) (*DeleteSsoBypassKeyResponse, error) { - rsp, err := c.DeleteSsoBypassKey(ctx, orgShortNameId, reqEditors...) - if err != nil { - return nil, err + response := &ValidateSsoLoginResponse{ + Body: bodyBytes, + HTTPResponse: rsp, } - return ParseDeleteSsoBypassKeyResponse(rsp) -} -// GetSsoBypassKeyWithResponse request returning *GetSsoBypassKeyResponse -func (c *ClientWithResponses) GetSsoBypassKeyWithResponse(ctx context.Context, orgShortNameId string, reqEditors ...RequestEditorFn) (*GetSsoBypassKeyResponse, error) { - rsp, err := c.GetSsoBypassKey(ctx, orgShortNameId, reqEditors...) - if err != nil { - return nil, err - } - return ParseGetSsoBypassKeyResponse(rsp) -} + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest SsoLoginCallback + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest -// UpsertSsoBypassKeyWithResponse request returning *UpsertSsoBypassKeyResponse -func (c *ClientWithResponses) UpsertSsoBypassKeyWithResponse(ctx context.Context, orgShortNameId string, reqEditors ...RequestEditorFn) (*UpsertSsoBypassKeyResponse, error) { - rsp, err := c.UpsertSsoBypassKey(ctx, orgShortNameId, reqEditors...) - if err != nil { - return nil, err - } - return ParseUpsertSsoBypassKeyResponse(rsp) -} + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest -// ListSsoConnectionsWithResponse request returning *ListSsoConnectionsResponse -func (c *ClientWithResponses) ListSsoConnectionsWithResponse(ctx context.Context, orgShortNameId string, reqEditors ...RequestEditorFn) (*ListSsoConnectionsResponse, error) { - rsp, err := c.ListSsoConnections(ctx, orgShortNameId, reqEditors...) - if err != nil { - return nil, err - } - return ParseListSsoConnectionsResponse(rsp) -} + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON401 = &dest -// CreateSsoConnectionWithBodyWithResponse request with arbitrary body returning *CreateSsoConnectionResponse -func (c *ClientWithResponses) CreateSsoConnectionWithBodyWithResponse(ctx context.Context, orgShortNameId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateSsoConnectionResponse, error) { - rsp, err := c.CreateSsoConnectionWithBody(ctx, orgShortNameId, contentType, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseCreateSsoConnectionResponse(rsp) -} + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 403: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON403 = &dest -func (c *ClientWithResponses) CreateSsoConnectionWithResponse(ctx context.Context, orgShortNameId string, body CreateSsoConnectionJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateSsoConnectionResponse, error) { - rsp, err := c.CreateSsoConnection(ctx, orgShortNameId, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseCreateSsoConnectionResponse(rsp) -} + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest -// DeleteSsoConnectionWithResponse request returning *DeleteSsoConnectionResponse -func (c *ClientWithResponses) DeleteSsoConnectionWithResponse(ctx context.Context, orgShortNameId string, connectionId string, reqEditors ...RequestEditorFn) (*DeleteSsoConnectionResponse, error) { - rsp, err := c.DeleteSsoConnection(ctx, orgShortNameId, connectionId, reqEditors...) - if err != nil { - return nil, err - } - return ParseDeleteSsoConnectionResponse(rsp) -} + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON500 = &dest -// GetSsoConnectionWithResponse request returning *GetSsoConnectionResponse -func (c *ClientWithResponses) GetSsoConnectionWithResponse(ctx context.Context, orgShortNameId string, connectionId string, reqEditors ...RequestEditorFn) (*GetSsoConnectionResponse, error) { - rsp, err := c.GetSsoConnection(ctx, orgShortNameId, connectionId, reqEditors...) - if err != nil { - return nil, err } - return ParseGetSsoConnectionResponse(rsp) + + return response, nil } -// UpdateSsoConnectionWithBodyWithResponse request with arbitrary body returning *UpdateSsoConnectionResponse -func (c *ClientWithResponses) UpdateSsoConnectionWithBodyWithResponse(ctx context.Context, orgShortNameId string, connectionId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateSsoConnectionResponse, error) { - rsp, err := c.UpdateSsoConnectionWithBody(ctx, orgShortNameId, connectionId, contentType, body, reqEditors...) +// ParseGetSharedClusterResponse parses an HTTP response from a GetSharedClusterWithResponse call +func ParseGetSharedClusterResponse(rsp *http.Response) (*GetSharedClusterResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - return ParseUpdateSsoConnectionResponse(rsp) -} -func (c *ClientWithResponses) UpdateSsoConnectionWithResponse(ctx context.Context, orgShortNameId string, connectionId string, body UpdateSsoConnectionJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateSsoConnectionResponse, error) { - rsp, err := c.UpdateSsoConnection(ctx, orgShortNameId, connectionId, body, reqEditors...) - if err != nil { - return nil, err + response := &GetSharedClusterResponse{ + Body: bodyBytes, + HTTPResponse: rsp, } - return ParseUpdateSsoConnectionResponse(rsp) -} -// GetStripeClientSecretWithResponse request returning *GetStripeClientSecretResponse -func (c *ClientWithResponses) GetStripeClientSecretWithResponse(ctx context.Context, orgShortNameId string, pType GetStripeClientSecretParamsType, reqEditors ...RequestEditorFn) (*GetStripeClientSecretResponse, error) { - rsp, err := c.GetStripeClientSecret(ctx, orgShortNameId, pType, reqEditors...) - if err != nil { - return nil, err + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest SharedCluster + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON401 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 403: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON403 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON500 = &dest + } - return ParseGetStripeClientSecretResponse(rsp) + + return response, nil } -// ListOrganizationTeamsWithResponse request returning *ListOrganizationTeamsResponse -func (c *ClientWithResponses) ListOrganizationTeamsWithResponse(ctx context.Context, orgShortNameId string, params *ListOrganizationTeamsParams, reqEditors ...RequestEditorFn) (*ListOrganizationTeamsResponse, error) { - rsp, err := c.ListOrganizationTeams(ctx, orgShortNameId, params, reqEditors...) +// ParseGetClusterOptionsResponse parses an HTTP response from a GetClusterOptionsWithResponse call +func ParseGetClusterOptionsResponse(rsp *http.Response) (*GetClusterOptionsResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - return ParseListOrganizationTeamsResponse(rsp) -} -// CreateTeamWithBodyWithResponse request with arbitrary body returning *CreateTeamResponse -func (c *ClientWithResponses) CreateTeamWithBodyWithResponse(ctx context.Context, orgShortNameId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateTeamResponse, error) { - rsp, err := c.CreateTeamWithBody(ctx, orgShortNameId, contentType, body, reqEditors...) - if err != nil { - return nil, err + response := &GetClusterOptionsResponse{ + Body: bodyBytes, + HTTPResponse: rsp, } - return ParseCreateTeamResponse(rsp) -} -func (c *ClientWithResponses) CreateTeamWithResponse(ctx context.Context, orgShortNameId string, body CreateTeamJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateTeamResponse, error) { - rsp, err := c.CreateTeam(ctx, orgShortNameId, body, reqEditors...) - if err != nil { - return nil, err + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest []ClusterOptions + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON401 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 403: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON403 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON500 = &dest + } - return ParseCreateTeamResponse(rsp) + + return response, nil } -// DeleteTeamWithResponse request returning *DeleteTeamResponse -func (c *ClientWithResponses) DeleteTeamWithResponse(ctx context.Context, orgShortNameId string, teamId string, reqEditors ...RequestEditorFn) (*DeleteTeamResponse, error) { - rsp, err := c.DeleteTeam(ctx, orgShortNameId, teamId, reqEditors...) +// ParseGetDeploymentOptionsResponse parses an HTTP response from a GetDeploymentOptionsWithResponse call +func ParseGetDeploymentOptionsResponse(rsp *http.Response) (*GetDeploymentOptionsResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - return ParseDeleteTeamResponse(rsp) -} -// GetTeamWithResponse request returning *GetTeamResponse -func (c *ClientWithResponses) GetTeamWithResponse(ctx context.Context, orgShortNameId string, teamId string, reqEditors ...RequestEditorFn) (*GetTeamResponse, error) { - rsp, err := c.GetTeam(ctx, orgShortNameId, teamId, reqEditors...) - if err != nil { - return nil, err + response := &GetDeploymentOptionsResponse{ + Body: bodyBytes, + HTTPResponse: rsp, } - return ParseGetTeamResponse(rsp) -} -// UpdateTeamWithBodyWithResponse request with arbitrary body returning *UpdateTeamResponse -func (c *ClientWithResponses) UpdateTeamWithBodyWithResponse(ctx context.Context, orgShortNameId string, teamId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateTeamResponse, error) { - rsp, err := c.UpdateTeamWithBody(ctx, orgShortNameId, teamId, contentType, body, reqEditors...) - if err != nil { - return nil, err + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest DeploymentOptions + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON401 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 403: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON403 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON500 = &dest + } - return ParseUpdateTeamResponse(rsp) + + return response, nil } -func (c *ClientWithResponses) UpdateTeamWithResponse(ctx context.Context, orgShortNameId string, teamId string, body UpdateTeamJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateTeamResponse, error) { - rsp, err := c.UpdateTeam(ctx, orgShortNameId, teamId, body, reqEditors...) +// ParseListOrganizationAuthIdsResponse parses an HTTP response from a ListOrganizationAuthIdsWithResponse call +func ParseListOrganizationAuthIdsResponse(rsp *http.Response) (*ListOrganizationAuthIdsResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - return ParseUpdateTeamResponse(rsp) -} -// AddTeamMembersWithBodyWithResponse request with arbitrary body returning *AddTeamMembersResponse -func (c *ClientWithResponses) AddTeamMembersWithBodyWithResponse(ctx context.Context, orgShortNameId string, teamId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*AddTeamMembersResponse, error) { - rsp, err := c.AddTeamMembersWithBody(ctx, orgShortNameId, teamId, contentType, body, reqEditors...) - if err != nil { - return nil, err + response := &ListOrganizationAuthIdsResponse{ + Body: bodyBytes, + HTTPResponse: rsp, } - return ParseAddTeamMembersResponse(rsp) -} -func (c *ClientWithResponses) AddTeamMembersWithResponse(ctx context.Context, orgShortNameId string, teamId string, body AddTeamMembersJSONRequestBody, reqEditors ...RequestEditorFn) (*AddTeamMembersResponse, error) { - rsp, err := c.AddTeamMembers(ctx, orgShortNameId, teamId, body, reqEditors...) - if err != nil { - return nil, err + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest []string + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON401 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 403: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON403 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON500 = &dest + } - return ParseAddTeamMembersResponse(rsp) + + return response, nil } -// RemoveTeamMemberWithResponse request returning *RemoveTeamMemberResponse -func (c *ClientWithResponses) RemoveTeamMemberWithResponse(ctx context.Context, orgShortNameId string, teamId string, memberId string, reqEditors ...RequestEditorFn) (*RemoveTeamMemberResponse, error) { - rsp, err := c.RemoveTeamMember(ctx, orgShortNameId, teamId, memberId, reqEditors...) +// ParseListOrganizationsResponse parses an HTTP response from a ListOrganizationsWithResponse call +func ParseListOrganizationsResponse(rsp *http.Response) (*ListOrganizationsResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - return ParseRemoveTeamMemberResponse(rsp) -} -// ListOrgUsersWithResponse request returning *ListOrgUsersResponse -func (c *ClientWithResponses) ListOrgUsersWithResponse(ctx context.Context, orgShortNameId string, params *ListOrgUsersParams, reqEditors ...RequestEditorFn) (*ListOrgUsersResponse, error) { - rsp, err := c.ListOrgUsers(ctx, orgShortNameId, params, reqEditors...) - if err != nil { - return nil, err + response := &ListOrganizationsResponse{ + Body: bodyBytes, + HTTPResponse: rsp, } - return ParseListOrgUsersResponse(rsp) -} -// DeleteOrgUserWithResponse request returning *DeleteOrgUserResponse -func (c *ClientWithResponses) DeleteOrgUserWithResponse(ctx context.Context, orgShortNameId string, userId string, reqEditors ...RequestEditorFn) (*DeleteOrgUserResponse, error) { - rsp, err := c.DeleteOrgUser(ctx, orgShortNameId, userId, reqEditors...) - if err != nil { - return nil, err + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest []Organization + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON401 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 403: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON403 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON500 = &dest + } - return ParseDeleteOrgUserResponse(rsp) + + return response, nil } -// GetUserWithResponse request returning *GetUserResponse -func (c *ClientWithResponses) GetUserWithResponse(ctx context.Context, orgShortNameId string, userId string, reqEditors ...RequestEditorFn) (*GetUserResponse, error) { - rsp, err := c.GetUser(ctx, orgShortNameId, userId, reqEditors...) +// ParseCreateOrganizationResponse parses an HTTP response from a CreateOrganizationWithResponse call +func ParseCreateOrganizationResponse(rsp *http.Response) (*CreateOrganizationResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - return ParseGetUserResponse(rsp) -} -// MutateOrgUserRoleWithBodyWithResponse request with arbitrary body returning *MutateOrgUserRoleResponse -func (c *ClientWithResponses) MutateOrgUserRoleWithBodyWithResponse(ctx context.Context, orgShortNameId string, userId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*MutateOrgUserRoleResponse, error) { - rsp, err := c.MutateOrgUserRoleWithBody(ctx, orgShortNameId, userId, contentType, body, reqEditors...) - if err != nil { - return nil, err + response := &CreateOrganizationResponse{ + Body: bodyBytes, + HTTPResponse: rsp, } - return ParseMutateOrgUserRoleResponse(rsp) -} -func (c *ClientWithResponses) MutateOrgUserRoleWithResponse(ctx context.Context, orgShortNameId string, userId string, body MutateOrgUserRoleJSONRequestBody, reqEditors ...RequestEditorFn) (*MutateOrgUserRoleResponse, error) { - rsp, err := c.MutateOrgUserRole(ctx, orgShortNameId, userId, body, reqEditors...) - if err != nil { - return nil, err + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest Organization + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON401 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 403: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON403 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON500 = &dest + } - return ParseMutateOrgUserRoleResponse(rsp) -} -// ValidateCreditCardPaymentWithBodyWithResponse request with arbitrary body returning *ValidateCreditCardPaymentResponse -func (c *ClientWithResponses) ValidateCreditCardPaymentWithBodyWithResponse(ctx context.Context, orgShortNameId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ValidateCreditCardPaymentResponse, error) { - rsp, err := c.ValidateCreditCardPaymentWithBody(ctx, orgShortNameId, contentType, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseValidateCreditCardPaymentResponse(rsp) + return response, nil } -func (c *ClientWithResponses) ValidateCreditCardPaymentWithResponse(ctx context.Context, orgShortNameId string, body ValidateCreditCardPaymentJSONRequestBody, reqEditors ...RequestEditorFn) (*ValidateCreditCardPaymentResponse, error) { - rsp, err := c.ValidateCreditCardPayment(ctx, orgShortNameId, body, reqEditors...) +// ParseGetOrganizationResponse parses an HTTP response from a GetOrganizationWithResponse call +func ParseGetOrganizationResponse(rsp *http.Response) (*GetOrganizationResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - return ParseValidateCreditCardPaymentResponse(rsp) -} -// ListWorkspacesWithResponse request returning *ListWorkspacesResponse -func (c *ClientWithResponses) ListWorkspacesWithResponse(ctx context.Context, orgShortNameId string, params *ListWorkspacesParams, reqEditors ...RequestEditorFn) (*ListWorkspacesResponse, error) { - rsp, err := c.ListWorkspaces(ctx, orgShortNameId, params, reqEditors...) - if err != nil { - return nil, err + response := &GetOrganizationResponse{ + Body: bodyBytes, + HTTPResponse: rsp, } - return ParseListWorkspacesResponse(rsp) -} -// CreateWorkspaceWithBodyWithResponse request with arbitrary body returning *CreateWorkspaceResponse -func (c *ClientWithResponses) CreateWorkspaceWithBodyWithResponse(ctx context.Context, orgShortNameId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateWorkspaceResponse, error) { - rsp, err := c.CreateWorkspaceWithBody(ctx, orgShortNameId, contentType, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseCreateWorkspaceResponse(rsp) -} + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest Organization + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest -func (c *ClientWithResponses) CreateWorkspaceWithResponse(ctx context.Context, orgShortNameId string, body CreateWorkspaceJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateWorkspaceResponse, error) { - rsp, err := c.CreateWorkspace(ctx, orgShortNameId, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseCreateWorkspaceResponse(rsp) -} + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest -// DeleteWorkspaceWithResponse request returning *DeleteWorkspaceResponse -func (c *ClientWithResponses) DeleteWorkspaceWithResponse(ctx context.Context, orgShortNameId string, workspaceId string, reqEditors ...RequestEditorFn) (*DeleteWorkspaceResponse, error) { - rsp, err := c.DeleteWorkspace(ctx, orgShortNameId, workspaceId, reqEditors...) - if err != nil { - return nil, err - } - return ParseDeleteWorkspaceResponse(rsp) -} + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON401 = &dest -// GetWorkspaceWithResponse request returning *GetWorkspaceResponse -func (c *ClientWithResponses) GetWorkspaceWithResponse(ctx context.Context, orgShortNameId string, workspaceId string, reqEditors ...RequestEditorFn) (*GetWorkspaceResponse, error) { - rsp, err := c.GetWorkspace(ctx, orgShortNameId, workspaceId, reqEditors...) - if err != nil { - return nil, err - } - return ParseGetWorkspaceResponse(rsp) -} + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 403: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON403 = &dest -// UpdateWorkspaceWithBodyWithResponse request with arbitrary body returning *UpdateWorkspaceResponse -func (c *ClientWithResponses) UpdateWorkspaceWithBodyWithResponse(ctx context.Context, orgShortNameId string, workspaceId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateWorkspaceResponse, error) { - rsp, err := c.UpdateWorkspaceWithBody(ctx, orgShortNameId, workspaceId, contentType, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseUpdateWorkspaceResponse(rsp) -} + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest -func (c *ClientWithResponses) UpdateWorkspaceWithResponse(ctx context.Context, orgShortNameId string, workspaceId string, body UpdateWorkspaceJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateWorkspaceResponse, error) { - rsp, err := c.UpdateWorkspace(ctx, orgShortNameId, workspaceId, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseUpdateWorkspaceResponse(rsp) -} + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON500 = &dest -// ListWorkspaceDagFiltersWithResponse request returning *ListWorkspaceDagFiltersResponse -func (c *ClientWithResponses) ListWorkspaceDagFiltersWithResponse(ctx context.Context, orgShortNameId string, workspaceId string, reqEditors ...RequestEditorFn) (*ListWorkspaceDagFiltersResponse, error) { - rsp, err := c.ListWorkspaceDagFilters(ctx, orgShortNameId, workspaceId, reqEditors...) - if err != nil { - return nil, err } - return ParseListWorkspaceDagFiltersResponse(rsp) + + return response, nil } -// ListWorkspaceDagsWithResponse request returning *ListWorkspaceDagsResponse -func (c *ClientWithResponses) ListWorkspaceDagsWithResponse(ctx context.Context, orgShortNameId string, workspaceId string, params *ListWorkspaceDagsParams, reqEditors ...RequestEditorFn) (*ListWorkspaceDagsResponse, error) { - rsp, err := c.ListWorkspaceDags(ctx, orgShortNameId, workspaceId, params, reqEditors...) +// ParseUpdateOrganizationResponse parses an HTTP response from a UpdateOrganizationWithResponse call +func ParseUpdateOrganizationResponse(rsp *http.Response) (*UpdateOrganizationResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - return ParseListWorkspaceDagsResponse(rsp) -} -// ListWorkspaceTeamsWithResponse request returning *ListWorkspaceTeamsResponse -func (c *ClientWithResponses) ListWorkspaceTeamsWithResponse(ctx context.Context, orgShortNameId string, workspaceId string, params *ListWorkspaceTeamsParams, reqEditors ...RequestEditorFn) (*ListWorkspaceTeamsResponse, error) { - rsp, err := c.ListWorkspaceTeams(ctx, orgShortNameId, workspaceId, params, reqEditors...) - if err != nil { - return nil, err + response := &UpdateOrganizationResponse{ + Body: bodyBytes, + HTTPResponse: rsp, } - return ParseListWorkspaceTeamsResponse(rsp) -} -// DeleteWorkspaceTeamWithResponse request returning *DeleteWorkspaceTeamResponse -func (c *ClientWithResponses) DeleteWorkspaceTeamWithResponse(ctx context.Context, orgShortNameId string, workspaceId string, teamId string, reqEditors ...RequestEditorFn) (*DeleteWorkspaceTeamResponse, error) { - rsp, err := c.DeleteWorkspaceTeam(ctx, orgShortNameId, workspaceId, teamId, reqEditors...) - if err != nil { - return nil, err + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest Organization + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON401 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 403: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON403 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON500 = &dest + } - return ParseDeleteWorkspaceTeamResponse(rsp) + + return response, nil } -// MutateWorkspaceTeamRoleWithBodyWithResponse request with arbitrary body returning *MutateWorkspaceTeamRoleResponse -func (c *ClientWithResponses) MutateWorkspaceTeamRoleWithBodyWithResponse(ctx context.Context, orgShortNameId string, workspaceId string, teamId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*MutateWorkspaceTeamRoleResponse, error) { - rsp, err := c.MutateWorkspaceTeamRoleWithBody(ctx, orgShortNameId, workspaceId, teamId, contentType, body, reqEditors...) +// ParseListOrganizationApiTokensResponse parses an HTTP response from a ListOrganizationApiTokensWithResponse call +func ParseListOrganizationApiTokensResponse(rsp *http.Response) (*ListOrganizationApiTokensResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - return ParseMutateWorkspaceTeamRoleResponse(rsp) -} -func (c *ClientWithResponses) MutateWorkspaceTeamRoleWithResponse(ctx context.Context, orgShortNameId string, workspaceId string, teamId string, body MutateWorkspaceTeamRoleJSONRequestBody, reqEditors ...RequestEditorFn) (*MutateWorkspaceTeamRoleResponse, error) { - rsp, err := c.MutateWorkspaceTeamRole(ctx, orgShortNameId, workspaceId, teamId, body, reqEditors...) - if err != nil { - return nil, err + response := &ListOrganizationApiTokensResponse{ + Body: bodyBytes, + HTTPResponse: rsp, } - return ParseMutateWorkspaceTeamRoleResponse(rsp) -} -// ListWorkspaceUsersWithResponse request returning *ListWorkspaceUsersResponse -func (c *ClientWithResponses) ListWorkspaceUsersWithResponse(ctx context.Context, orgShortNameId string, workspaceId string, params *ListWorkspaceUsersParams, reqEditors ...RequestEditorFn) (*ListWorkspaceUsersResponse, error) { - rsp, err := c.ListWorkspaceUsers(ctx, orgShortNameId, workspaceId, params, reqEditors...) - if err != nil { - return nil, err + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest ListApiTokensPaginated + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON401 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 403: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON403 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON500 = &dest + } - return ParseListWorkspaceUsersResponse(rsp) + + return response, nil } -// DeleteWorkspaceUserWithResponse request returning *DeleteWorkspaceUserResponse -func (c *ClientWithResponses) DeleteWorkspaceUserWithResponse(ctx context.Context, orgShortNameId string, workspaceId string, userId string, reqEditors ...RequestEditorFn) (*DeleteWorkspaceUserResponse, error) { - rsp, err := c.DeleteWorkspaceUser(ctx, orgShortNameId, workspaceId, userId, reqEditors...) +// ParseCreateOrganizationApiTokenResponse parses an HTTP response from a CreateOrganizationApiTokenWithResponse call +func ParseCreateOrganizationApiTokenResponse(rsp *http.Response) (*CreateOrganizationApiTokenResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - return ParseDeleteWorkspaceUserResponse(rsp) -} -// MutateWorkspaceUserRoleWithBodyWithResponse request with arbitrary body returning *MutateWorkspaceUserRoleResponse -func (c *ClientWithResponses) MutateWorkspaceUserRoleWithBodyWithResponse(ctx context.Context, orgShortNameId string, workspaceId string, userId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*MutateWorkspaceUserRoleResponse, error) { - rsp, err := c.MutateWorkspaceUserRoleWithBody(ctx, orgShortNameId, workspaceId, userId, contentType, body, reqEditors...) - if err != nil { - return nil, err + response := &CreateOrganizationApiTokenResponse{ + Body: bodyBytes, + HTTPResponse: rsp, } - return ParseMutateWorkspaceUserRoleResponse(rsp) -} -func (c *ClientWithResponses) MutateWorkspaceUserRoleWithResponse(ctx context.Context, orgShortNameId string, workspaceId string, userId string, body MutateWorkspaceUserRoleJSONRequestBody, reqEditors ...RequestEditorFn) (*MutateWorkspaceUserRoleResponse, error) { - rsp, err := c.MutateWorkspaceUserRole(ctx, orgShortNameId, workspaceId, userId, body, reqEditors...) - if err != nil { - return nil, err + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest ApiToken + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON401 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 403: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON403 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON500 = &dest + } - return ParseMutateWorkspaceUserRoleResponse(rsp) + + return response, nil } -// GetSelfUserWithResponse request returning *GetSelfUserResponse -func (c *ClientWithResponses) GetSelfUserWithResponse(ctx context.Context, params *GetSelfUserParams, reqEditors ...RequestEditorFn) (*GetSelfUserResponse, error) { - rsp, err := c.GetSelfUser(ctx, params, reqEditors...) +// ParseDeleteOrganizationApiTokenResponse parses an HTTP response from a DeleteOrganizationApiTokenWithResponse call +func ParseDeleteOrganizationApiTokenResponse(rsp *http.Response) (*DeleteOrganizationApiTokenResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - return ParseGetSelfUserResponse(rsp) -} -// UpdateSelfUserInviteWithBodyWithResponse request with arbitrary body returning *UpdateSelfUserInviteResponse -func (c *ClientWithResponses) UpdateSelfUserInviteWithBodyWithResponse(ctx context.Context, inviteId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateSelfUserInviteResponse, error) { - rsp, err := c.UpdateSelfUserInviteWithBody(ctx, inviteId, contentType, body, reqEditors...) - if err != nil { - return nil, err + response := &DeleteOrganizationApiTokenResponse{ + Body: bodyBytes, + HTTPResponse: rsp, } - return ParseUpdateSelfUserInviteResponse(rsp) -} -func (c *ClientWithResponses) UpdateSelfUserInviteWithResponse(ctx context.Context, inviteId string, body UpdateSelfUserInviteJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateSelfUserInviteResponse, error) { - rsp, err := c.UpdateSelfUserInvite(ctx, inviteId, body, reqEditors...) - if err != nil { - return nil, err + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON401 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 403: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON403 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON500 = &dest + } - return ParseUpdateSelfUserInviteResponse(rsp) + + return response, nil } -// ParseGetUserInviteResponse parses an HTTP response from a GetUserInviteWithResponse call -func ParseGetUserInviteResponse(rsp *http.Response) (*GetUserInviteResponse, error) { +// ParseGetOrganizationApiTokenResponse parses an HTTP response from a GetOrganizationApiTokenWithResponse call +func ParseGetOrganizationApiTokenResponse(rsp *http.Response) (*GetOrganizationApiTokenResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &GetUserInviteResponse{ + response := &GetOrganizationApiTokenResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest Invite + var dest ApiToken if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -9974,22 +12580,22 @@ func ParseGetUserInviteResponse(rsp *http.Response) (*GetUserInviteResponse, err return response, nil } -// ParseValidateSsoLoginResponse parses an HTTP response from a ValidateSsoLoginWithResponse call -func ParseValidateSsoLoginResponse(rsp *http.Response) (*ValidateSsoLoginResponse, error) { +// ParseUpdateOrganizationApiTokenResponse parses an HTTP response from a UpdateOrganizationApiTokenWithResponse call +func ParseUpdateOrganizationApiTokenResponse(rsp *http.Response) (*UpdateOrganizationApiTokenResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &ValidateSsoLoginResponse{ + response := &UpdateOrganizationApiTokenResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest SsoLoginCallback + var dest ApiToken if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -10035,22 +12641,22 @@ func ParseValidateSsoLoginResponse(rsp *http.Response) (*ValidateSsoLoginRespons return response, nil } -// ParseGetSharedClusterResponse parses an HTTP response from a GetSharedClusterWithResponse call -func ParseGetSharedClusterResponse(rsp *http.Response) (*GetSharedClusterResponse, error) { +// ParseRotateOrganizationApiTokenResponse parses an HTTP response from a RotateOrganizationApiTokenWithResponse call +func ParseRotateOrganizationApiTokenResponse(rsp *http.Response) (*RotateOrganizationApiTokenResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &GetSharedClusterResponse{ + response := &RotateOrganizationApiTokenResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest SharedCluster + var dest ApiToken if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -10096,22 +12702,22 @@ func ParseGetSharedClusterResponse(rsp *http.Response) (*GetSharedClusterRespons return response, nil } -// ParseGetClusterOptionsResponse parses an HTTP response from a GetClusterOptionsWithResponse call -func ParseGetClusterOptionsResponse(rsp *http.Response) (*GetClusterOptionsResponse, error) { +// ParseGetOrganizationAuditLogsResponse parses an HTTP response from a GetOrganizationAuditLogsWithResponse call +func ParseGetOrganizationAuditLogsResponse(rsp *http.Response) (*GetOrganizationAuditLogsResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &GetClusterOptionsResponse{ + response := &GetOrganizationAuditLogsResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest []ClusterOptions + var dest []int if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -10138,12 +12744,59 @@ func ParseGetClusterOptionsResponse(rsp *http.Response) (*GetClusterOptionsRespo } response.JSON403 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: var dest Error if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON404 = &dest + response.JSON500 = &dest + + } + + return response, nil +} + +// ParseListClustersResponse parses an HTTP response from a ListClustersWithResponse call +func ParseListClustersResponse(rsp *http.Response) (*ListClustersResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &ListClustersResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest ClustersPaginated + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON401 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 403: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON403 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: var dest Error @@ -10157,22 +12810,22 @@ func ParseGetClusterOptionsResponse(rsp *http.Response) (*GetClusterOptionsRespo return response, nil } -// ParseGetDeploymentOptionsResponse parses an HTTP response from a GetDeploymentOptionsWithResponse call -func ParseGetDeploymentOptionsResponse(rsp *http.Response) (*GetDeploymentOptionsResponse, error) { +// ParseCreateAwsClusterResponse parses an HTTP response from a CreateAwsClusterWithResponse call +func ParseCreateAwsClusterResponse(rsp *http.Response) (*CreateAwsClusterResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &GetDeploymentOptionsResponse{ + response := &CreateAwsClusterResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest DeploymentOptions + var dest Cluster if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -10199,6 +12852,13 @@ func ParseGetDeploymentOptionsResponse(rsp *http.Response) (*GetDeploymentOption } response.JSON403 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 412: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON412 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: var dest Error if err := json.Unmarshal(bodyBytes, &dest); err != nil { @@ -10211,22 +12871,22 @@ func ParseGetDeploymentOptionsResponse(rsp *http.Response) (*GetDeploymentOption return response, nil } -// ParseListOrganizationAuthIdsResponse parses an HTTP response from a ListOrganizationAuthIdsWithResponse call -func ParseListOrganizationAuthIdsResponse(rsp *http.Response) (*ListOrganizationAuthIdsResponse, error) { +// ParseUpdateAwsClusterResponse parses an HTTP response from a UpdateAwsClusterWithResponse call +func ParseUpdateAwsClusterResponse(rsp *http.Response) (*UpdateAwsClusterResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &ListOrganizationAuthIdsResponse{ + response := &UpdateAwsClusterResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest []string + var dest Cluster if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -10253,6 +12913,20 @@ func ParseListOrganizationAuthIdsResponse(rsp *http.Response) (*ListOrganization } response.JSON403 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 412: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON412 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: var dest Error if err := json.Unmarshal(bodyBytes, &dest); err != nil { @@ -10265,22 +12939,22 @@ func ParseListOrganizationAuthIdsResponse(rsp *http.Response) (*ListOrganization return response, nil } -// ParseListOrganizationsResponse parses an HTTP response from a ListOrganizationsWithResponse call -func ParseListOrganizationsResponse(rsp *http.Response) (*ListOrganizationsResponse, error) { +// ParseCreateAzureClusterResponse parses an HTTP response from a CreateAzureClusterWithResponse call +func ParseCreateAzureClusterResponse(rsp *http.Response) (*CreateAzureClusterResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &ListOrganizationsResponse{ + response := &CreateAzureClusterResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest []Organization + var dest Cluster if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -10307,6 +12981,13 @@ func ParseListOrganizationsResponse(rsp *http.Response) (*ListOrganizationsRespo } response.JSON403 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 412: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON412 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: var dest Error if err := json.Unmarshal(bodyBytes, &dest); err != nil { @@ -10319,22 +13000,22 @@ func ParseListOrganizationsResponse(rsp *http.Response) (*ListOrganizationsRespo return response, nil } -// ParseCreateOrganizationResponse parses an HTTP response from a CreateOrganizationWithResponse call -func ParseCreateOrganizationResponse(rsp *http.Response) (*CreateOrganizationResponse, error) { +// ParseUpdateAzureClusterResponse parses an HTTP response from a UpdateAzureClusterWithResponse call +func ParseUpdateAzureClusterResponse(rsp *http.Response) (*UpdateAzureClusterResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &CreateOrganizationResponse{ + response := &UpdateAzureClusterResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest Organization + var dest Cluster if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -10368,6 +13049,13 @@ func ParseCreateOrganizationResponse(rsp *http.Response) (*CreateOrganizationRes } response.JSON404 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 412: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON412 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: var dest Error if err := json.Unmarshal(bodyBytes, &dest); err != nil { @@ -10380,22 +13068,22 @@ func ParseCreateOrganizationResponse(rsp *http.Response) (*CreateOrganizationRes return response, nil } -// ParseGetOrganizationResponse parses an HTTP response from a GetOrganizationWithResponse call -func ParseGetOrganizationResponse(rsp *http.Response) (*GetOrganizationResponse, error) { +// ParseCreateGcpClusterResponse parses an HTTP response from a CreateGcpClusterWithResponse call +func ParseCreateGcpClusterResponse(rsp *http.Response) (*CreateGcpClusterResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &GetOrganizationResponse{ + response := &CreateGcpClusterResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest Organization + var dest Cluster if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -10422,12 +13110,12 @@ func ParseGetOrganizationResponse(rsp *http.Response) (*GetOrganizationResponse, } response.JSON403 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 412: var dest Error if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON404 = &dest + response.JSON412 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: var dest Error @@ -10441,22 +13129,22 @@ func ParseGetOrganizationResponse(rsp *http.Response) (*GetOrganizationResponse, return response, nil } -// ParseUpdateOrganizationResponse parses an HTTP response from a UpdateOrganizationWithResponse call -func ParseUpdateOrganizationResponse(rsp *http.Response) (*UpdateOrganizationResponse, error) { +// ParseUpdateGcpClusterResponse parses an HTTP response from a UpdateGcpClusterWithResponse call +func ParseUpdateGcpClusterResponse(rsp *http.Response) (*UpdateGcpClusterResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &UpdateOrganizationResponse{ + response := &UpdateGcpClusterResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest Organization + var dest Cluster if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -10490,6 +13178,13 @@ func ParseUpdateOrganizationResponse(rsp *http.Response) (*UpdateOrganizationRes } response.JSON404 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 412: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON412 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: var dest Error if err := json.Unmarshal(bodyBytes, &dest); err != nil { @@ -10502,27 +13197,20 @@ func ParseUpdateOrganizationResponse(rsp *http.Response) (*UpdateOrganizationRes return response, nil } -// ParseGetOrganizationAuditLogsResponse parses an HTTP response from a GetOrganizationAuditLogsWithResponse call -func ParseGetOrganizationAuditLogsResponse(rsp *http.Response) (*GetOrganizationAuditLogsResponse, error) { +// ParseDeleteClusterResponse parses an HTTP response from a DeleteClusterWithResponse call +func ParseDeleteClusterResponse(rsp *http.Response) (*DeleteClusterResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &GetOrganizationAuditLogsResponse{ + response := &DeleteClusterResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest []int - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: var dest Error if err := json.Unmarshal(bodyBytes, &dest); err != nil { @@ -10544,6 +13232,13 @@ func ParseGetOrganizationAuditLogsResponse(rsp *http.Response) (*GetOrganization } response.JSON403 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: var dest Error if err := json.Unmarshal(bodyBytes, &dest); err != nil { @@ -10556,22 +13251,22 @@ func ParseGetOrganizationAuditLogsResponse(rsp *http.Response) (*GetOrganization return response, nil } -// ParseListClustersResponse parses an HTTP response from a ListClustersWithResponse call -func ParseListClustersResponse(rsp *http.Response) (*ListClustersResponse, error) { +// ParseGetClusterResponse parses an HTTP response from a GetClusterWithResponse call +func ParseGetClusterResponse(rsp *http.Response) (*GetClusterResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &ListClustersResponse{ + response := &GetClusterResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest ClustersPaginated + var dest ClusterDetailed if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -10598,6 +13293,13 @@ func ParseListClustersResponse(rsp *http.Response) (*ListClustersResponse, error } response.JSON403 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: var dest Error if err := json.Unmarshal(bodyBytes, &dest); err != nil { @@ -10610,22 +13312,22 @@ func ParseListClustersResponse(rsp *http.Response) (*ListClustersResponse, error return response, nil } -// ParseCreateAwsClusterResponse parses an HTTP response from a CreateAwsClusterWithResponse call -func ParseCreateAwsClusterResponse(rsp *http.Response) (*CreateAwsClusterResponse, error) { +// ParseListManagedDomainsResponse parses an HTTP response from a ListManagedDomainsWithResponse call +func ParseListManagedDomainsResponse(rsp *http.Response) (*ListManagedDomainsResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &CreateAwsClusterResponse{ + response := &ListManagedDomainsResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest Cluster + var dest []ManagedDomain if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -10652,12 +13354,12 @@ func ParseCreateAwsClusterResponse(rsp *http.Response) (*CreateAwsClusterRespons } response.JSON403 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 412: + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: var dest Error if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON412 = &dest + response.JSON404 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: var dest Error @@ -10671,22 +13373,22 @@ func ParseCreateAwsClusterResponse(rsp *http.Response) (*CreateAwsClusterRespons return response, nil } -// ParseUpdateAwsClusterResponse parses an HTTP response from a UpdateAwsClusterWithResponse call -func ParseUpdateAwsClusterResponse(rsp *http.Response) (*UpdateAwsClusterResponse, error) { +// ParseCreateManagedDomainResponse parses an HTTP response from a CreateManagedDomainWithResponse call +func ParseCreateManagedDomainResponse(rsp *http.Response) (*CreateManagedDomainResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &UpdateAwsClusterResponse{ + response := &CreateManagedDomainResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest Cluster + var dest ManagedDomain if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -10720,13 +13422,6 @@ func ParseUpdateAwsClusterResponse(rsp *http.Response) (*UpdateAwsClusterRespons } response.JSON404 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 412: - var dest Error - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON412 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: var dest Error if err := json.Unmarshal(bodyBytes, &dest); err != nil { @@ -10739,22 +13434,22 @@ func ParseUpdateAwsClusterResponse(rsp *http.Response) (*UpdateAwsClusterRespons return response, nil } -// ParseCreateAzureClusterResponse parses an HTTP response from a CreateAzureClusterWithResponse call -func ParseCreateAzureClusterResponse(rsp *http.Response) (*CreateAzureClusterResponse, error) { +// ParseDeleteManagedDomainResponse parses an HTTP response from a DeleteManagedDomainWithResponse call +func ParseDeleteManagedDomainResponse(rsp *http.Response) (*DeleteManagedDomainResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &CreateAzureClusterResponse{ + response := &DeleteManagedDomainResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest Cluster + var dest ManagedDomain if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -10781,12 +13476,12 @@ func ParseCreateAzureClusterResponse(rsp *http.Response) (*CreateAzureClusterRes } response.JSON403 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 412: + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: var dest Error if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON412 = &dest + response.JSON404 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: var dest Error @@ -10800,22 +13495,22 @@ func ParseCreateAzureClusterResponse(rsp *http.Response) (*CreateAzureClusterRes return response, nil } -// ParseUpdateAzureClusterResponse parses an HTTP response from a UpdateAzureClusterWithResponse call -func ParseUpdateAzureClusterResponse(rsp *http.Response) (*UpdateAzureClusterResponse, error) { +// ParseGetManagedDomainResponse parses an HTTP response from a GetManagedDomainWithResponse call +func ParseGetManagedDomainResponse(rsp *http.Response) (*GetManagedDomainResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &UpdateAzureClusterResponse{ + response := &GetManagedDomainResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest Cluster + var dest ManagedDomain if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -10849,13 +13544,6 @@ func ParseUpdateAzureClusterResponse(rsp *http.Response) (*UpdateAzureClusterRes } response.JSON404 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 412: - var dest Error - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON412 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: var dest Error if err := json.Unmarshal(bodyBytes, &dest); err != nil { @@ -10868,22 +13556,22 @@ func ParseUpdateAzureClusterResponse(rsp *http.Response) (*UpdateAzureClusterRes return response, nil } -// ParseCreateGcpClusterResponse parses an HTTP response from a CreateGcpClusterWithResponse call -func ParseCreateGcpClusterResponse(rsp *http.Response) (*CreateGcpClusterResponse, error) { +// ParseUpdateManagedDomainResponse parses an HTTP response from a UpdateManagedDomainWithResponse call +func ParseUpdateManagedDomainResponse(rsp *http.Response) (*UpdateManagedDomainResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &CreateGcpClusterResponse{ + response := &UpdateManagedDomainResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest Cluster + var dest ManagedDomain if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -10910,12 +13598,12 @@ func ParseCreateGcpClusterResponse(rsp *http.Response) (*CreateGcpClusterRespons } response.JSON403 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 412: + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: var dest Error if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON412 = &dest + response.JSON404 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: var dest Error @@ -10929,22 +13617,22 @@ func ParseCreateGcpClusterResponse(rsp *http.Response) (*CreateGcpClusterRespons return response, nil } -// ParseUpdateGcpClusterResponse parses an HTTP response from a UpdateGcpClusterWithResponse call -func ParseUpdateGcpClusterResponse(rsp *http.Response) (*UpdateGcpClusterResponse, error) { +// ParseVerifyManagedDomainResponse parses an HTTP response from a VerifyManagedDomainWithResponse call +func ParseVerifyManagedDomainResponse(rsp *http.Response) (*VerifyManagedDomainResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &UpdateGcpClusterResponse{ + response := &VerifyManagedDomainResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest Cluster + var dest ManagedDomain if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -10978,13 +13666,6 @@ func ParseUpdateGcpClusterResponse(rsp *http.Response) (*UpdateGcpClusterRespons } response.JSON404 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 412: - var dest Error - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON412 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: var dest Error if err := json.Unmarshal(bodyBytes, &dest); err != nil { @@ -10997,20 +13678,27 @@ func ParseUpdateGcpClusterResponse(rsp *http.Response) (*UpdateGcpClusterRespons return response, nil } -// ParseDeleteClusterResponse parses an HTTP response from a DeleteClusterWithResponse call -func ParseDeleteClusterResponse(rsp *http.Response) (*DeleteClusterResponse, error) { +// ParseGetDraftInvoiceResponse parses an HTTP response from a GetDraftInvoiceWithResponse call +func ParseGetDraftInvoiceResponse(rsp *http.Response) (*GetDraftInvoiceResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &DeleteClusterResponse{ + response := &GetDraftInvoiceResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest Invoice + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: var dest Error if err := json.Unmarshal(bodyBytes, &dest); err != nil { @@ -11051,22 +13739,22 @@ func ParseDeleteClusterResponse(rsp *http.Response) (*DeleteClusterResponse, err return response, nil } -// ParseGetClusterResponse parses an HTTP response from a GetClusterWithResponse call -func ParseGetClusterResponse(rsp *http.Response) (*GetClusterResponse, error) { +// ParseCreateUserInviteResponse parses an HTTP response from a CreateUserInviteWithResponse call +func ParseCreateUserInviteResponse(rsp *http.Response) (*CreateUserInviteResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &GetClusterResponse{ + response := &CreateUserInviteResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest ClusterDetailed + var dest Invite if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -11112,27 +13800,20 @@ func ParseGetClusterResponse(rsp *http.Response) (*GetClusterResponse, error) { return response, nil } -// ParseListManagedDomainsResponse parses an HTTP response from a ListManagedDomainsWithResponse call -func ParseListManagedDomainsResponse(rsp *http.Response) (*ListManagedDomainsResponse, error) { +// ParseDeleteUserInviteResponse parses an HTTP response from a DeleteUserInviteWithResponse call +func ParseDeleteUserInviteResponse(rsp *http.Response) (*DeleteUserInviteResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &ListManagedDomainsResponse{ + response := &DeleteUserInviteResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest []ManagedDomain - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: var dest Error if err := json.Unmarshal(bodyBytes, &dest); err != nil { @@ -11173,22 +13854,22 @@ func ParseListManagedDomainsResponse(rsp *http.Response) (*ListManagedDomainsRes return response, nil } -// ParseCreateManagedDomainResponse parses an HTTP response from a CreateManagedDomainWithResponse call -func ParseCreateManagedDomainResponse(rsp *http.Response) (*CreateManagedDomainResponse, error) { +// ParseGetCreditSummaryResponse parses an HTTP response from a GetCreditSummaryWithResponse call +func ParseGetCreditSummaryResponse(rsp *http.Response) (*GetCreditSummaryResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &CreateManagedDomainResponse{ + response := &GetCreditSummaryResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest ManagedDomain + var dest CreditSummary if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -11234,22 +13915,22 @@ func ParseCreateManagedDomainResponse(rsp *http.Response) (*CreateManagedDomainR return response, nil } -// ParseDeleteManagedDomainResponse parses an HTTP response from a DeleteManagedDomainWithResponse call -func ParseDeleteManagedDomainResponse(rsp *http.Response) (*DeleteManagedDomainResponse, error) { +// ParseGetMetronomeDashboardResponse parses an HTTP response from a GetMetronomeDashboardWithResponse call +func ParseGetMetronomeDashboardResponse(rsp *http.Response) (*GetMetronomeDashboardResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &DeleteManagedDomainResponse{ + response := &GetMetronomeDashboardResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest ManagedDomain + var dest MetronomeDashboard if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -11295,22 +13976,22 @@ func ParseDeleteManagedDomainResponse(rsp *http.Response) (*DeleteManagedDomainR return response, nil } -// ParseGetManagedDomainResponse parses an HTTP response from a GetManagedDomainWithResponse call -func ParseGetManagedDomainResponse(rsp *http.Response) (*GetManagedDomainResponse, error) { +// ParseGetPaymentMethodResponse parses an HTTP response from a GetPaymentMethodWithResponse call +func ParseGetPaymentMethodResponse(rsp *http.Response) (*GetPaymentMethodResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &GetManagedDomainResponse{ + response := &GetPaymentMethodResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest ManagedDomain + var dest PaymentMethod if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -11356,27 +14037,20 @@ func ParseGetManagedDomainResponse(rsp *http.Response) (*GetManagedDomainRespons return response, nil } -// ParseUpdateManagedDomainResponse parses an HTTP response from a UpdateManagedDomainWithResponse call -func ParseUpdateManagedDomainResponse(rsp *http.Response) (*UpdateManagedDomainResponse, error) { +// ParseDeleteSsoBypassKeyResponse parses an HTTP response from a DeleteSsoBypassKeyWithResponse call +func ParseDeleteSsoBypassKeyResponse(rsp *http.Response) (*DeleteSsoBypassKeyResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &UpdateManagedDomainResponse{ + response := &DeleteSsoBypassKeyResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest ManagedDomain - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: var dest Error if err := json.Unmarshal(bodyBytes, &dest); err != nil { @@ -11417,22 +14091,22 @@ func ParseUpdateManagedDomainResponse(rsp *http.Response) (*UpdateManagedDomainR return response, nil } -// ParseVerifyManagedDomainResponse parses an HTTP response from a VerifyManagedDomainWithResponse call -func ParseVerifyManagedDomainResponse(rsp *http.Response) (*VerifyManagedDomainResponse, error) { +// ParseGetSsoBypassKeyResponse parses an HTTP response from a GetSsoBypassKeyWithResponse call +func ParseGetSsoBypassKeyResponse(rsp *http.Response) (*GetSsoBypassKeyResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &VerifyManagedDomainResponse{ + response := &GetSsoBypassKeyResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest ManagedDomain + var dest SsoBypassKey if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -11478,22 +14152,22 @@ func ParseVerifyManagedDomainResponse(rsp *http.Response) (*VerifyManagedDomainR return response, nil } -// ParseGetDraftInvoiceResponse parses an HTTP response from a GetDraftInvoiceWithResponse call -func ParseGetDraftInvoiceResponse(rsp *http.Response) (*GetDraftInvoiceResponse, error) { +// ParseUpsertSsoBypassKeyResponse parses an HTTP response from a UpsertSsoBypassKeyWithResponse call +func ParseUpsertSsoBypassKeyResponse(rsp *http.Response) (*UpsertSsoBypassKeyResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &GetDraftInvoiceResponse{ + response := &UpsertSsoBypassKeyResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest Invoice + var dest SsoBypassKey if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -11539,22 +14213,22 @@ func ParseGetDraftInvoiceResponse(rsp *http.Response) (*GetDraftInvoiceResponse, return response, nil } -// ParseCreateUserInviteResponse parses an HTTP response from a CreateUserInviteWithResponse call -func ParseCreateUserInviteResponse(rsp *http.Response) (*CreateUserInviteResponse, error) { +// ParseListSsoConnectionsResponse parses an HTTP response from a ListSsoConnectionsWithResponse call +func ParseListSsoConnectionsResponse(rsp *http.Response) (*ListSsoConnectionsResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &CreateUserInviteResponse{ + response := &ListSsoConnectionsResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest Invite + var dest []SsoConnection if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -11600,20 +14274,27 @@ func ParseCreateUserInviteResponse(rsp *http.Response) (*CreateUserInviteRespons return response, nil } -// ParseDeleteUserInviteResponse parses an HTTP response from a DeleteUserInviteWithResponse call -func ParseDeleteUserInviteResponse(rsp *http.Response) (*DeleteUserInviteResponse, error) { +// ParseCreateSsoConnectionResponse parses an HTTP response from a CreateSsoConnectionWithResponse call +func ParseCreateSsoConnectionResponse(rsp *http.Response) (*CreateSsoConnectionResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &DeleteUserInviteResponse{ + response := &CreateSsoConnectionResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest SsoConnection + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: var dest Error if err := json.Unmarshal(bodyBytes, &dest); err != nil { @@ -11654,22 +14335,22 @@ func ParseDeleteUserInviteResponse(rsp *http.Response) (*DeleteUserInviteRespons return response, nil } -// ParseGetPaymentMethodResponse parses an HTTP response from a GetPaymentMethodWithResponse call -func ParseGetPaymentMethodResponse(rsp *http.Response) (*GetPaymentMethodResponse, error) { +// ParseDeleteSsoConnectionResponse parses an HTTP response from a DeleteSsoConnectionWithResponse call +func ParseDeleteSsoConnectionResponse(rsp *http.Response) (*DeleteSsoConnectionResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &GetPaymentMethodResponse{ + response := &DeleteSsoConnectionResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest PaymentMethod + var dest SsoConnection if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -11715,20 +14396,27 @@ func ParseGetPaymentMethodResponse(rsp *http.Response) (*GetPaymentMethodRespons return response, nil } -// ParseDeleteSsoBypassKeyResponse parses an HTTP response from a DeleteSsoBypassKeyWithResponse call -func ParseDeleteSsoBypassKeyResponse(rsp *http.Response) (*DeleteSsoBypassKeyResponse, error) { +// ParseGetSsoConnectionResponse parses an HTTP response from a GetSsoConnectionWithResponse call +func ParseGetSsoConnectionResponse(rsp *http.Response) (*GetSsoConnectionResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &DeleteSsoBypassKeyResponse{ + response := &GetSsoConnectionResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest SsoConnection + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: var dest Error if err := json.Unmarshal(bodyBytes, &dest); err != nil { @@ -11769,22 +14457,22 @@ func ParseDeleteSsoBypassKeyResponse(rsp *http.Response) (*DeleteSsoBypassKeyRes return response, nil } -// ParseGetSsoBypassKeyResponse parses an HTTP response from a GetSsoBypassKeyWithResponse call -func ParseGetSsoBypassKeyResponse(rsp *http.Response) (*GetSsoBypassKeyResponse, error) { +// ParseUpdateSsoConnectionResponse parses an HTTP response from a UpdateSsoConnectionWithResponse call +func ParseUpdateSsoConnectionResponse(rsp *http.Response) (*UpdateSsoConnectionResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &GetSsoBypassKeyResponse{ + response := &UpdateSsoConnectionResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest SsoBypassKey + var dest SsoConnection if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -11830,22 +14518,22 @@ func ParseGetSsoBypassKeyResponse(rsp *http.Response) (*GetSsoBypassKeyResponse, return response, nil } -// ParseUpsertSsoBypassKeyResponse parses an HTTP response from a UpsertSsoBypassKeyWithResponse call -func ParseUpsertSsoBypassKeyResponse(rsp *http.Response) (*UpsertSsoBypassKeyResponse, error) { +// ParseGetStripeClientSecretResponse parses an HTTP response from a GetStripeClientSecretWithResponse call +func ParseGetStripeClientSecretResponse(rsp *http.Response) (*GetStripeClientSecretResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &UpsertSsoBypassKeyResponse{ + response := &GetStripeClientSecretResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest SsoBypassKey + var dest StripeClientSecret if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -11891,22 +14579,22 @@ func ParseUpsertSsoBypassKeyResponse(rsp *http.Response) (*UpsertSsoBypassKeyRes return response, nil } -// ParseListSsoConnectionsResponse parses an HTTP response from a ListSsoConnectionsWithResponse call -func ParseListSsoConnectionsResponse(rsp *http.Response) (*ListSsoConnectionsResponse, error) { +// ParseListOrganizationTeamsResponse parses an HTTP response from a ListOrganizationTeamsWithResponse call +func ParseListOrganizationTeamsResponse(rsp *http.Response) (*ListOrganizationTeamsResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &ListSsoConnectionsResponse{ + response := &ListOrganizationTeamsResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest []SsoConnection + var dest TeamsPaginated if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -11952,22 +14640,22 @@ func ParseListSsoConnectionsResponse(rsp *http.Response) (*ListSsoConnectionsRes return response, nil } -// ParseCreateSsoConnectionResponse parses an HTTP response from a CreateSsoConnectionWithResponse call -func ParseCreateSsoConnectionResponse(rsp *http.Response) (*CreateSsoConnectionResponse, error) { +// ParseCreateTeamResponse parses an HTTP response from a CreateTeamWithResponse call +func ParseCreateTeamResponse(rsp *http.Response) (*CreateTeamResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &CreateSsoConnectionResponse{ + response := &CreateTeamResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest SsoConnection + var dest Team if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -12013,22 +14701,22 @@ func ParseCreateSsoConnectionResponse(rsp *http.Response) (*CreateSsoConnectionR return response, nil } -// ParseDeleteSsoConnectionResponse parses an HTTP response from a DeleteSsoConnectionWithResponse call -func ParseDeleteSsoConnectionResponse(rsp *http.Response) (*DeleteSsoConnectionResponse, error) { +// ParseDeleteTeamResponse parses an HTTP response from a DeleteTeamWithResponse call +func ParseDeleteTeamResponse(rsp *http.Response) (*DeleteTeamResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &DeleteSsoConnectionResponse{ + response := &DeleteTeamResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest SsoConnection + var dest Team if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -12074,22 +14762,22 @@ func ParseDeleteSsoConnectionResponse(rsp *http.Response) (*DeleteSsoConnectionR return response, nil } -// ParseGetSsoConnectionResponse parses an HTTP response from a GetSsoConnectionWithResponse call -func ParseGetSsoConnectionResponse(rsp *http.Response) (*GetSsoConnectionResponse, error) { +// ParseGetTeamResponse parses an HTTP response from a GetTeamWithResponse call +func ParseGetTeamResponse(rsp *http.Response) (*GetTeamResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &GetSsoConnectionResponse{ + response := &GetTeamResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest SsoConnection + var dest Team if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -12135,22 +14823,22 @@ func ParseGetSsoConnectionResponse(rsp *http.Response) (*GetSsoConnectionRespons return response, nil } -// ParseUpdateSsoConnectionResponse parses an HTTP response from a UpdateSsoConnectionWithResponse call -func ParseUpdateSsoConnectionResponse(rsp *http.Response) (*UpdateSsoConnectionResponse, error) { +// ParseUpdateTeamResponse parses an HTTP response from a UpdateTeamWithResponse call +func ParseUpdateTeamResponse(rsp *http.Response) (*UpdateTeamResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &UpdateSsoConnectionResponse{ + response := &UpdateTeamResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest SsoConnection + var dest Team if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -12196,27 +14884,20 @@ func ParseUpdateSsoConnectionResponse(rsp *http.Response) (*UpdateSsoConnectionR return response, nil } -// ParseGetStripeClientSecretResponse parses an HTTP response from a GetStripeClientSecretWithResponse call -func ParseGetStripeClientSecretResponse(rsp *http.Response) (*GetStripeClientSecretResponse, error) { +// ParseAddTeamMembersResponse parses an HTTP response from a AddTeamMembersWithResponse call +func ParseAddTeamMembersResponse(rsp *http.Response) (*AddTeamMembersResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &GetStripeClientSecretResponse{ + response := &AddTeamMembersResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest StripeClientSecret - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: var dest Error if err := json.Unmarshal(bodyBytes, &dest); err != nil { @@ -12257,27 +14938,20 @@ func ParseGetStripeClientSecretResponse(rsp *http.Response) (*GetStripeClientSec return response, nil } -// ParseListOrganizationTeamsResponse parses an HTTP response from a ListOrganizationTeamsWithResponse call -func ParseListOrganizationTeamsResponse(rsp *http.Response) (*ListOrganizationTeamsResponse, error) { +// ParseRemoveTeamMemberResponse parses an HTTP response from a RemoveTeamMemberWithResponse call +func ParseRemoveTeamMemberResponse(rsp *http.Response) (*RemoveTeamMemberResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &ListOrganizationTeamsResponse{ + response := &RemoveTeamMemberResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest TeamsPaginated - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: var dest Error if err := json.Unmarshal(bodyBytes, &dest); err != nil { @@ -12318,22 +14992,22 @@ func ParseListOrganizationTeamsResponse(rsp *http.Response) (*ListOrganizationTe return response, nil } -// ParseCreateTeamResponse parses an HTTP response from a CreateTeamWithResponse call -func ParseCreateTeamResponse(rsp *http.Response) (*CreateTeamResponse, error) { +// ParseListOrgUsersResponse parses an HTTP response from a ListOrgUsersWithResponse call +func ParseListOrgUsersResponse(rsp *http.Response) (*ListOrgUsersResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &CreateTeamResponse{ + response := &ListOrgUsersResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest Team + var dest UsersPaginated if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -12360,13 +15034,6 @@ func ParseCreateTeamResponse(rsp *http.Response) (*CreateTeamResponse, error) { } response.JSON403 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: - var dest Error - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON404 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: var dest Error if err := json.Unmarshal(bodyBytes, &dest); err != nil { @@ -12379,22 +15046,22 @@ func ParseCreateTeamResponse(rsp *http.Response) (*CreateTeamResponse, error) { return response, nil } -// ParseDeleteTeamResponse parses an HTTP response from a DeleteTeamWithResponse call -func ParseDeleteTeamResponse(rsp *http.Response) (*DeleteTeamResponse, error) { +// ParseDeleteOrgUserResponse parses an HTTP response from a DeleteOrgUserWithResponse call +func ParseDeleteOrgUserResponse(rsp *http.Response) (*DeleteOrgUserResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &DeleteTeamResponse{ + response := &DeleteOrgUserResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest Team + var dest User if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -12440,22 +15107,22 @@ func ParseDeleteTeamResponse(rsp *http.Response) (*DeleteTeamResponse, error) { return response, nil } -// ParseGetTeamResponse parses an HTTP response from a GetTeamWithResponse call -func ParseGetTeamResponse(rsp *http.Response) (*GetTeamResponse, error) { +// ParseGetUserResponse parses an HTTP response from a GetUserWithResponse call +func ParseGetUserResponse(rsp *http.Response) (*GetUserResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &GetTeamResponse{ + response := &GetUserResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest Team + var dest User if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -12501,22 +15168,22 @@ func ParseGetTeamResponse(rsp *http.Response) (*GetTeamResponse, error) { return response, nil } -// ParseUpdateTeamResponse parses an HTTP response from a UpdateTeamWithResponse call -func ParseUpdateTeamResponse(rsp *http.Response) (*UpdateTeamResponse, error) { +// ParseMutateOrgUserRoleResponse parses an HTTP response from a MutateOrgUserRoleWithResponse call +func ParseMutateOrgUserRoleResponse(rsp *http.Response) (*MutateOrgUserRoleResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &UpdateTeamResponse{ + response := &MutateOrgUserRoleResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest Team + var dest UserRole if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -12562,20 +15229,27 @@ func ParseUpdateTeamResponse(rsp *http.Response) (*UpdateTeamResponse, error) { return response, nil } -// ParseAddTeamMembersResponse parses an HTTP response from a AddTeamMembersWithResponse call -func ParseAddTeamMembersResponse(rsp *http.Response) (*AddTeamMembersResponse, error) { +// ParseValidateCreditCardPaymentResponse parses an HTTP response from a ValidateCreditCardPaymentWithResponse call +func ParseValidateCreditCardPaymentResponse(rsp *http.Response) (*ValidateCreditCardPaymentResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &AddTeamMembersResponse{ + response := &ValidateCreditCardPaymentResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest ValidateCreditCardPayment + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: var dest Error if err := json.Unmarshal(bodyBytes, &dest); err != nil { @@ -12616,20 +15290,27 @@ func ParseAddTeamMembersResponse(rsp *http.Response) (*AddTeamMembersResponse, e return response, nil } -// ParseRemoveTeamMemberResponse parses an HTTP response from a RemoveTeamMemberWithResponse call -func ParseRemoveTeamMemberResponse(rsp *http.Response) (*RemoveTeamMemberResponse, error) { +// ParseListWorkspacesResponse parses an HTTP response from a ListWorkspacesWithResponse call +func ParseListWorkspacesResponse(rsp *http.Response) (*ListWorkspacesResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &RemoveTeamMemberResponse{ + response := &ListWorkspacesResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest WorkspacesPaginated + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: var dest Error if err := json.Unmarshal(bodyBytes, &dest); err != nil { @@ -12651,13 +15332,6 @@ func ParseRemoveTeamMemberResponse(rsp *http.Response) (*RemoveTeamMemberRespons } response.JSON403 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: - var dest Error - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON404 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: var dest Error if err := json.Unmarshal(bodyBytes, &dest); err != nil { @@ -12670,22 +15344,22 @@ func ParseRemoveTeamMemberResponse(rsp *http.Response) (*RemoveTeamMemberRespons return response, nil } -// ParseListOrgUsersResponse parses an HTTP response from a ListOrgUsersWithResponse call -func ParseListOrgUsersResponse(rsp *http.Response) (*ListOrgUsersResponse, error) { +// ParseCreateWorkspaceResponse parses an HTTP response from a CreateWorkspaceWithResponse call +func ParseCreateWorkspaceResponse(rsp *http.Response) (*CreateWorkspaceResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &ListOrgUsersResponse{ + response := &CreateWorkspaceResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest UsersPaginated + var dest Workspace if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -12712,6 +15386,13 @@ func ParseListOrgUsersResponse(rsp *http.Response) (*ListOrgUsersResponse, error } response.JSON403 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: var dest Error if err := json.Unmarshal(bodyBytes, &dest); err != nil { @@ -12724,27 +15405,20 @@ func ParseListOrgUsersResponse(rsp *http.Response) (*ListOrgUsersResponse, error return response, nil } -// ParseDeleteOrgUserResponse parses an HTTP response from a DeleteOrgUserWithResponse call -func ParseDeleteOrgUserResponse(rsp *http.Response) (*DeleteOrgUserResponse, error) { +// ParseDeleteWorkspaceResponse parses an HTTP response from a DeleteWorkspaceWithResponse call +func ParseDeleteWorkspaceResponse(rsp *http.Response) (*DeleteWorkspaceResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &DeleteOrgUserResponse{ + response := &DeleteWorkspaceResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest User - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: var dest Error if err := json.Unmarshal(bodyBytes, &dest); err != nil { @@ -12785,22 +15459,22 @@ func ParseDeleteOrgUserResponse(rsp *http.Response) (*DeleteOrgUserResponse, err return response, nil } -// ParseGetUserResponse parses an HTTP response from a GetUserWithResponse call -func ParseGetUserResponse(rsp *http.Response) (*GetUserResponse, error) { +// ParseGetWorkspaceResponse parses an HTTP response from a GetWorkspaceWithResponse call +func ParseGetWorkspaceResponse(rsp *http.Response) (*GetWorkspaceResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &GetUserResponse{ + response := &GetWorkspaceResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest User + var dest Workspace if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -12846,22 +15520,22 @@ func ParseGetUserResponse(rsp *http.Response) (*GetUserResponse, error) { return response, nil } -// ParseMutateOrgUserRoleResponse parses an HTTP response from a MutateOrgUserRoleWithResponse call -func ParseMutateOrgUserRoleResponse(rsp *http.Response) (*MutateOrgUserRoleResponse, error) { +// ParseUpdateWorkspaceResponse parses an HTTP response from a UpdateWorkspaceWithResponse call +func ParseUpdateWorkspaceResponse(rsp *http.Response) (*UpdateWorkspaceResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &MutateOrgUserRoleResponse{ + response := &UpdateWorkspaceResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest UserRole + var dest Workspace if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -12907,22 +15581,22 @@ func ParseMutateOrgUserRoleResponse(rsp *http.Response) (*MutateOrgUserRoleRespo return response, nil } -// ParseValidateCreditCardPaymentResponse parses an HTTP response from a ValidateCreditCardPaymentWithResponse call -func ParseValidateCreditCardPaymentResponse(rsp *http.Response) (*ValidateCreditCardPaymentResponse, error) { +// ParseListWorkspaceApiTokensResponse parses an HTTP response from a ListWorkspaceApiTokensWithResponse call +func ParseListWorkspaceApiTokensResponse(rsp *http.Response) (*ListWorkspaceApiTokensResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &ValidateCreditCardPaymentResponse{ + response := &ListWorkspaceApiTokensResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest ValidateCreditCardPayment + var dest ListApiTokensPaginated if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -12968,22 +15642,22 @@ func ParseValidateCreditCardPaymentResponse(rsp *http.Response) (*ValidateCredit return response, nil } -// ParseListWorkspacesResponse parses an HTTP response from a ListWorkspacesWithResponse call -func ParseListWorkspacesResponse(rsp *http.Response) (*ListWorkspacesResponse, error) { +// ParseCreateWorkspaceApiTokenResponse parses an HTTP response from a CreateWorkspaceApiTokenWithResponse call +func ParseCreateWorkspaceApiTokenResponse(rsp *http.Response) (*CreateWorkspaceApiTokenResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &ListWorkspacesResponse{ + response := &CreateWorkspaceApiTokenResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest WorkspacesPaginated + var dest ApiToken if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -13010,6 +15684,13 @@ func ParseListWorkspacesResponse(rsp *http.Response) (*ListWorkspacesResponse, e } response.JSON403 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: var dest Error if err := json.Unmarshal(bodyBytes, &dest); err != nil { @@ -13022,27 +15703,20 @@ func ParseListWorkspacesResponse(rsp *http.Response) (*ListWorkspacesResponse, e return response, nil } -// ParseCreateWorkspaceResponse parses an HTTP response from a CreateWorkspaceWithResponse call -func ParseCreateWorkspaceResponse(rsp *http.Response) (*CreateWorkspaceResponse, error) { +// ParseDeleteWorkspaceApiTokenResponse parses an HTTP response from a DeleteWorkspaceApiTokenWithResponse call +func ParseDeleteWorkspaceApiTokenResponse(rsp *http.Response) (*DeleteWorkspaceApiTokenResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &CreateWorkspaceResponse{ + response := &DeleteWorkspaceApiTokenResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest Workspace - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: var dest Error if err := json.Unmarshal(bodyBytes, &dest); err != nil { @@ -13083,20 +15757,27 @@ func ParseCreateWorkspaceResponse(rsp *http.Response) (*CreateWorkspaceResponse, return response, nil } -// ParseDeleteWorkspaceResponse parses an HTTP response from a DeleteWorkspaceWithResponse call -func ParseDeleteWorkspaceResponse(rsp *http.Response) (*DeleteWorkspaceResponse, error) { +// ParseGetWorkspaceApiTokenResponse parses an HTTP response from a GetWorkspaceApiTokenWithResponse call +func ParseGetWorkspaceApiTokenResponse(rsp *http.Response) (*GetWorkspaceApiTokenResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &DeleteWorkspaceResponse{ + response := &GetWorkspaceApiTokenResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest ApiToken + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: var dest Error if err := json.Unmarshal(bodyBytes, &dest); err != nil { @@ -13137,22 +15818,22 @@ func ParseDeleteWorkspaceResponse(rsp *http.Response) (*DeleteWorkspaceResponse, return response, nil } -// ParseGetWorkspaceResponse parses an HTTP response from a GetWorkspaceWithResponse call -func ParseGetWorkspaceResponse(rsp *http.Response) (*GetWorkspaceResponse, error) { +// ParseUpdateWorkspaceApiTokenResponse parses an HTTP response from a UpdateWorkspaceApiTokenWithResponse call +func ParseUpdateWorkspaceApiTokenResponse(rsp *http.Response) (*UpdateWorkspaceApiTokenResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &GetWorkspaceResponse{ + response := &UpdateWorkspaceApiTokenResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest Workspace + var dest ApiToken if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -13198,22 +15879,22 @@ func ParseGetWorkspaceResponse(rsp *http.Response) (*GetWorkspaceResponse, error return response, nil } -// ParseUpdateWorkspaceResponse parses an HTTP response from a UpdateWorkspaceWithResponse call -func ParseUpdateWorkspaceResponse(rsp *http.Response) (*UpdateWorkspaceResponse, error) { +// ParseRotateWorkspaceApiTokenResponse parses an HTTP response from a RotateWorkspaceApiTokenWithResponse call +func ParseRotateWorkspaceApiTokenResponse(rsp *http.Response) (*RotateWorkspaceApiTokenResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &UpdateWorkspaceResponse{ + response := &RotateWorkspaceApiTokenResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest Workspace + var dest ApiToken if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } diff --git a/astro-client-core/mocks/client.go b/astro-client-core/mocks/client.go index 1c460dc60..764451eec 100644 --- a/astro-client-core/mocks/client.go +++ b/astro-client-core/mocks/client.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.14.0. DO NOT EDIT. +// Code generated by mockery v2.20.2. DO NOT EDIT. package astrocore_mocks @@ -29,6 +29,10 @@ func (_m *ClientWithResponsesInterface) AddTeamMembersWithBodyWithResponse(ctx c ret := _m.Called(_ca...) var r0 *astrocore.AddTeamMembersResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, string, string, io.Reader, ...astrocore.RequestEditorFn) (*astrocore.AddTeamMembersResponse, error)); ok { + return rf(ctx, orgShortNameId, teamId, contentType, body, reqEditors...) + } if rf, ok := ret.Get(0).(func(context.Context, string, string, string, io.Reader, ...astrocore.RequestEditorFn) *astrocore.AddTeamMembersResponse); ok { r0 = rf(ctx, orgShortNameId, teamId, contentType, body, reqEditors...) } else { @@ -37,7 +41,6 @@ func (_m *ClientWithResponsesInterface) AddTeamMembersWithBodyWithResponse(ctx c } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, string, string, io.Reader, ...astrocore.RequestEditorFn) error); ok { r1 = rf(ctx, orgShortNameId, teamId, contentType, body, reqEditors...) } else { @@ -59,6 +62,10 @@ func (_m *ClientWithResponsesInterface) AddTeamMembersWithResponse(ctx context.C ret := _m.Called(_ca...) var r0 *astrocore.AddTeamMembersResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, string, astrocore.AddTeamMembersRequest, ...astrocore.RequestEditorFn) (*astrocore.AddTeamMembersResponse, error)); ok { + return rf(ctx, orgShortNameId, teamId, body, reqEditors...) + } if rf, ok := ret.Get(0).(func(context.Context, string, string, astrocore.AddTeamMembersRequest, ...astrocore.RequestEditorFn) *astrocore.AddTeamMembersResponse); ok { r0 = rf(ctx, orgShortNameId, teamId, body, reqEditors...) } else { @@ -67,7 +74,6 @@ func (_m *ClientWithResponsesInterface) AddTeamMembersWithResponse(ctx context.C } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, string, astrocore.AddTeamMembersRequest, ...astrocore.RequestEditorFn) error); ok { r1 = rf(ctx, orgShortNameId, teamId, body, reqEditors...) } else { @@ -89,6 +95,10 @@ func (_m *ClientWithResponsesInterface) CreateAwsClusterWithBodyWithResponse(ctx ret := _m.Called(_ca...) var r0 *astrocore.CreateAwsClusterResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, string, io.Reader, ...astrocore.RequestEditorFn) (*astrocore.CreateAwsClusterResponse, error)); ok { + return rf(ctx, orgShortNameId, contentType, body, reqEditors...) + } if rf, ok := ret.Get(0).(func(context.Context, string, string, io.Reader, ...astrocore.RequestEditorFn) *astrocore.CreateAwsClusterResponse); ok { r0 = rf(ctx, orgShortNameId, contentType, body, reqEditors...) } else { @@ -97,7 +107,6 @@ func (_m *ClientWithResponsesInterface) CreateAwsClusterWithBodyWithResponse(ctx } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, string, io.Reader, ...astrocore.RequestEditorFn) error); ok { r1 = rf(ctx, orgShortNameId, contentType, body, reqEditors...) } else { @@ -119,6 +128,10 @@ func (_m *ClientWithResponsesInterface) CreateAwsClusterWithResponse(ctx context ret := _m.Called(_ca...) var r0 *astrocore.CreateAwsClusterResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, astrocore.CreateAwsClusterRequest, ...astrocore.RequestEditorFn) (*astrocore.CreateAwsClusterResponse, error)); ok { + return rf(ctx, orgShortNameId, body, reqEditors...) + } if rf, ok := ret.Get(0).(func(context.Context, string, astrocore.CreateAwsClusterRequest, ...astrocore.RequestEditorFn) *astrocore.CreateAwsClusterResponse); ok { r0 = rf(ctx, orgShortNameId, body, reqEditors...) } else { @@ -127,7 +140,6 @@ func (_m *ClientWithResponsesInterface) CreateAwsClusterWithResponse(ctx context } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, astrocore.CreateAwsClusterRequest, ...astrocore.RequestEditorFn) error); ok { r1 = rf(ctx, orgShortNameId, body, reqEditors...) } else { @@ -149,6 +161,10 @@ func (_m *ClientWithResponsesInterface) CreateAzureClusterWithBodyWithResponse(c ret := _m.Called(_ca...) var r0 *astrocore.CreateAzureClusterResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, string, io.Reader, ...astrocore.RequestEditorFn) (*astrocore.CreateAzureClusterResponse, error)); ok { + return rf(ctx, orgShortNameId, contentType, body, reqEditors...) + } if rf, ok := ret.Get(0).(func(context.Context, string, string, io.Reader, ...astrocore.RequestEditorFn) *astrocore.CreateAzureClusterResponse); ok { r0 = rf(ctx, orgShortNameId, contentType, body, reqEditors...) } else { @@ -157,7 +173,6 @@ func (_m *ClientWithResponsesInterface) CreateAzureClusterWithBodyWithResponse(c } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, string, io.Reader, ...astrocore.RequestEditorFn) error); ok { r1 = rf(ctx, orgShortNameId, contentType, body, reqEditors...) } else { @@ -179,6 +194,10 @@ func (_m *ClientWithResponsesInterface) CreateAzureClusterWithResponse(ctx conte ret := _m.Called(_ca...) var r0 *astrocore.CreateAzureClusterResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, astrocore.CreateAzureClusterRequest, ...astrocore.RequestEditorFn) (*astrocore.CreateAzureClusterResponse, error)); ok { + return rf(ctx, orgShortNameId, body, reqEditors...) + } if rf, ok := ret.Get(0).(func(context.Context, string, astrocore.CreateAzureClusterRequest, ...astrocore.RequestEditorFn) *astrocore.CreateAzureClusterResponse); ok { r0 = rf(ctx, orgShortNameId, body, reqEditors...) } else { @@ -187,7 +206,6 @@ func (_m *ClientWithResponsesInterface) CreateAzureClusterWithResponse(ctx conte } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, astrocore.CreateAzureClusterRequest, ...astrocore.RequestEditorFn) error); ok { r1 = rf(ctx, orgShortNameId, body, reqEditors...) } else { @@ -209,6 +227,10 @@ func (_m *ClientWithResponsesInterface) CreateGcpClusterWithBodyWithResponse(ctx ret := _m.Called(_ca...) var r0 *astrocore.CreateGcpClusterResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, string, io.Reader, ...astrocore.RequestEditorFn) (*astrocore.CreateGcpClusterResponse, error)); ok { + return rf(ctx, orgShortNameId, contentType, body, reqEditors...) + } if rf, ok := ret.Get(0).(func(context.Context, string, string, io.Reader, ...astrocore.RequestEditorFn) *astrocore.CreateGcpClusterResponse); ok { r0 = rf(ctx, orgShortNameId, contentType, body, reqEditors...) } else { @@ -217,7 +239,6 @@ func (_m *ClientWithResponsesInterface) CreateGcpClusterWithBodyWithResponse(ctx } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, string, io.Reader, ...astrocore.RequestEditorFn) error); ok { r1 = rf(ctx, orgShortNameId, contentType, body, reqEditors...) } else { @@ -239,6 +260,10 @@ func (_m *ClientWithResponsesInterface) CreateGcpClusterWithResponse(ctx context ret := _m.Called(_ca...) var r0 *astrocore.CreateGcpClusterResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, astrocore.CreateGcpClusterRequest, ...astrocore.RequestEditorFn) (*astrocore.CreateGcpClusterResponse, error)); ok { + return rf(ctx, orgShortNameId, body, reqEditors...) + } if rf, ok := ret.Get(0).(func(context.Context, string, astrocore.CreateGcpClusterRequest, ...astrocore.RequestEditorFn) *astrocore.CreateGcpClusterResponse); ok { r0 = rf(ctx, orgShortNameId, body, reqEditors...) } else { @@ -247,7 +272,6 @@ func (_m *ClientWithResponsesInterface) CreateGcpClusterWithResponse(ctx context } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, astrocore.CreateGcpClusterRequest, ...astrocore.RequestEditorFn) error); ok { r1 = rf(ctx, orgShortNameId, body, reqEditors...) } else { @@ -269,6 +293,10 @@ func (_m *ClientWithResponsesInterface) CreateManagedDomainWithBodyWithResponse( ret := _m.Called(_ca...) var r0 *astrocore.CreateManagedDomainResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, string, io.Reader, ...astrocore.RequestEditorFn) (*astrocore.CreateManagedDomainResponse, error)); ok { + return rf(ctx, orgShortNameId, contentType, body, reqEditors...) + } if rf, ok := ret.Get(0).(func(context.Context, string, string, io.Reader, ...astrocore.RequestEditorFn) *astrocore.CreateManagedDomainResponse); ok { r0 = rf(ctx, orgShortNameId, contentType, body, reqEditors...) } else { @@ -277,7 +305,6 @@ func (_m *ClientWithResponsesInterface) CreateManagedDomainWithBodyWithResponse( } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, string, io.Reader, ...astrocore.RequestEditorFn) error); ok { r1 = rf(ctx, orgShortNameId, contentType, body, reqEditors...) } else { @@ -299,6 +326,10 @@ func (_m *ClientWithResponsesInterface) CreateManagedDomainWithResponse(ctx cont ret := _m.Called(_ca...) var r0 *astrocore.CreateManagedDomainResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, astrocore.CreateManagedDomainRequest, ...astrocore.RequestEditorFn) (*astrocore.CreateManagedDomainResponse, error)); ok { + return rf(ctx, orgShortNameId, body, reqEditors...) + } if rf, ok := ret.Get(0).(func(context.Context, string, astrocore.CreateManagedDomainRequest, ...astrocore.RequestEditorFn) *astrocore.CreateManagedDomainResponse); ok { r0 = rf(ctx, orgShortNameId, body, reqEditors...) } else { @@ -307,7 +338,6 @@ func (_m *ClientWithResponsesInterface) CreateManagedDomainWithResponse(ctx cont } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, astrocore.CreateManagedDomainRequest, ...astrocore.RequestEditorFn) error); ok { r1 = rf(ctx, orgShortNameId, body, reqEditors...) } else { @@ -317,6 +347,72 @@ func (_m *ClientWithResponsesInterface) CreateManagedDomainWithResponse(ctx cont return r0, r1 } +// CreateOrganizationApiTokenWithBodyWithResponse provides a mock function with given fields: ctx, orgShortNameId, contentType, body, reqEditors +func (_m *ClientWithResponsesInterface) CreateOrganizationApiTokenWithBodyWithResponse(ctx context.Context, orgShortNameId string, contentType string, body io.Reader, reqEditors ...astrocore.RequestEditorFn) (*astrocore.CreateOrganizationApiTokenResponse, error) { + _va := make([]interface{}, len(reqEditors)) + for _i := range reqEditors { + _va[_i] = reqEditors[_i] + } + var _ca []interface{} + _ca = append(_ca, ctx, orgShortNameId, contentType, body) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + var r0 *astrocore.CreateOrganizationApiTokenResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, string, io.Reader, ...astrocore.RequestEditorFn) (*astrocore.CreateOrganizationApiTokenResponse, error)); ok { + return rf(ctx, orgShortNameId, contentType, body, reqEditors...) + } + if rf, ok := ret.Get(0).(func(context.Context, string, string, io.Reader, ...astrocore.RequestEditorFn) *astrocore.CreateOrganizationApiTokenResponse); ok { + r0 = rf(ctx, orgShortNameId, contentType, body, reqEditors...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*astrocore.CreateOrganizationApiTokenResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, string, string, io.Reader, ...astrocore.RequestEditorFn) error); ok { + r1 = rf(ctx, orgShortNameId, contentType, body, reqEditors...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// CreateOrganizationApiTokenWithResponse provides a mock function with given fields: ctx, orgShortNameId, body, reqEditors +func (_m *ClientWithResponsesInterface) CreateOrganizationApiTokenWithResponse(ctx context.Context, orgShortNameId string, body astrocore.CreateOrganizationApiTokenRequest, reqEditors ...astrocore.RequestEditorFn) (*astrocore.CreateOrganizationApiTokenResponse, error) { + _va := make([]interface{}, len(reqEditors)) + for _i := range reqEditors { + _va[_i] = reqEditors[_i] + } + var _ca []interface{} + _ca = append(_ca, ctx, orgShortNameId, body) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + var r0 *astrocore.CreateOrganizationApiTokenResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, astrocore.CreateOrganizationApiTokenRequest, ...astrocore.RequestEditorFn) (*astrocore.CreateOrganizationApiTokenResponse, error)); ok { + return rf(ctx, orgShortNameId, body, reqEditors...) + } + if rf, ok := ret.Get(0).(func(context.Context, string, astrocore.CreateOrganizationApiTokenRequest, ...astrocore.RequestEditorFn) *astrocore.CreateOrganizationApiTokenResponse); ok { + r0 = rf(ctx, orgShortNameId, body, reqEditors...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*astrocore.CreateOrganizationApiTokenResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, string, astrocore.CreateOrganizationApiTokenRequest, ...astrocore.RequestEditorFn) error); ok { + r1 = rf(ctx, orgShortNameId, body, reqEditors...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + // CreateOrganizationWithBodyWithResponse provides a mock function with given fields: ctx, contentType, body, reqEditors func (_m *ClientWithResponsesInterface) CreateOrganizationWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...astrocore.RequestEditorFn) (*astrocore.CreateOrganizationResponse, error) { _va := make([]interface{}, len(reqEditors)) @@ -329,6 +425,10 @@ func (_m *ClientWithResponsesInterface) CreateOrganizationWithBodyWithResponse(c ret := _m.Called(_ca...) var r0 *astrocore.CreateOrganizationResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, io.Reader, ...astrocore.RequestEditorFn) (*astrocore.CreateOrganizationResponse, error)); ok { + return rf(ctx, contentType, body, reqEditors...) + } if rf, ok := ret.Get(0).(func(context.Context, string, io.Reader, ...astrocore.RequestEditorFn) *astrocore.CreateOrganizationResponse); ok { r0 = rf(ctx, contentType, body, reqEditors...) } else { @@ -337,7 +437,6 @@ func (_m *ClientWithResponsesInterface) CreateOrganizationWithBodyWithResponse(c } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, io.Reader, ...astrocore.RequestEditorFn) error); ok { r1 = rf(ctx, contentType, body, reqEditors...) } else { @@ -359,6 +458,10 @@ func (_m *ClientWithResponsesInterface) CreateOrganizationWithResponse(ctx conte ret := _m.Called(_ca...) var r0 *astrocore.CreateOrganizationResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, astrocore.CreateOrganizationRequest, ...astrocore.RequestEditorFn) (*astrocore.CreateOrganizationResponse, error)); ok { + return rf(ctx, body, reqEditors...) + } if rf, ok := ret.Get(0).(func(context.Context, astrocore.CreateOrganizationRequest, ...astrocore.RequestEditorFn) *astrocore.CreateOrganizationResponse); ok { r0 = rf(ctx, body, reqEditors...) } else { @@ -367,7 +470,6 @@ func (_m *ClientWithResponsesInterface) CreateOrganizationWithResponse(ctx conte } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, astrocore.CreateOrganizationRequest, ...astrocore.RequestEditorFn) error); ok { r1 = rf(ctx, body, reqEditors...) } else { @@ -389,6 +491,10 @@ func (_m *ClientWithResponsesInterface) CreateSsoConnectionWithBodyWithResponse( ret := _m.Called(_ca...) var r0 *astrocore.CreateSsoConnectionResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, string, io.Reader, ...astrocore.RequestEditorFn) (*astrocore.CreateSsoConnectionResponse, error)); ok { + return rf(ctx, orgShortNameId, contentType, body, reqEditors...) + } if rf, ok := ret.Get(0).(func(context.Context, string, string, io.Reader, ...astrocore.RequestEditorFn) *astrocore.CreateSsoConnectionResponse); ok { r0 = rf(ctx, orgShortNameId, contentType, body, reqEditors...) } else { @@ -397,7 +503,6 @@ func (_m *ClientWithResponsesInterface) CreateSsoConnectionWithBodyWithResponse( } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, string, io.Reader, ...astrocore.RequestEditorFn) error); ok { r1 = rf(ctx, orgShortNameId, contentType, body, reqEditors...) } else { @@ -419,6 +524,10 @@ func (_m *ClientWithResponsesInterface) CreateSsoConnectionWithResponse(ctx cont ret := _m.Called(_ca...) var r0 *astrocore.CreateSsoConnectionResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, astrocore.CreateSsoConnectionRequest, ...astrocore.RequestEditorFn) (*astrocore.CreateSsoConnectionResponse, error)); ok { + return rf(ctx, orgShortNameId, body, reqEditors...) + } if rf, ok := ret.Get(0).(func(context.Context, string, astrocore.CreateSsoConnectionRequest, ...astrocore.RequestEditorFn) *astrocore.CreateSsoConnectionResponse); ok { r0 = rf(ctx, orgShortNameId, body, reqEditors...) } else { @@ -427,7 +536,6 @@ func (_m *ClientWithResponsesInterface) CreateSsoConnectionWithResponse(ctx cont } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, astrocore.CreateSsoConnectionRequest, ...astrocore.RequestEditorFn) error); ok { r1 = rf(ctx, orgShortNameId, body, reqEditors...) } else { @@ -449,6 +557,10 @@ func (_m *ClientWithResponsesInterface) CreateTeamWithBodyWithResponse(ctx conte ret := _m.Called(_ca...) var r0 *astrocore.CreateTeamResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, string, io.Reader, ...astrocore.RequestEditorFn) (*astrocore.CreateTeamResponse, error)); ok { + return rf(ctx, orgShortNameId, contentType, body, reqEditors...) + } if rf, ok := ret.Get(0).(func(context.Context, string, string, io.Reader, ...astrocore.RequestEditorFn) *astrocore.CreateTeamResponse); ok { r0 = rf(ctx, orgShortNameId, contentType, body, reqEditors...) } else { @@ -457,7 +569,6 @@ func (_m *ClientWithResponsesInterface) CreateTeamWithBodyWithResponse(ctx conte } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, string, io.Reader, ...astrocore.RequestEditorFn) error); ok { r1 = rf(ctx, orgShortNameId, contentType, body, reqEditors...) } else { @@ -479,6 +590,10 @@ func (_m *ClientWithResponsesInterface) CreateTeamWithResponse(ctx context.Conte ret := _m.Called(_ca...) var r0 *astrocore.CreateTeamResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, astrocore.CreateTeamRequest, ...astrocore.RequestEditorFn) (*astrocore.CreateTeamResponse, error)); ok { + return rf(ctx, orgShortNameId, body, reqEditors...) + } if rf, ok := ret.Get(0).(func(context.Context, string, astrocore.CreateTeamRequest, ...astrocore.RequestEditorFn) *astrocore.CreateTeamResponse); ok { r0 = rf(ctx, orgShortNameId, body, reqEditors...) } else { @@ -487,7 +602,6 @@ func (_m *ClientWithResponsesInterface) CreateTeamWithResponse(ctx context.Conte } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, astrocore.CreateTeamRequest, ...astrocore.RequestEditorFn) error); ok { r1 = rf(ctx, orgShortNameId, body, reqEditors...) } else { @@ -509,6 +623,10 @@ func (_m *ClientWithResponsesInterface) CreateUserInviteWithBodyWithResponse(ctx ret := _m.Called(_ca...) var r0 *astrocore.CreateUserInviteResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, string, io.Reader, ...astrocore.RequestEditorFn) (*astrocore.CreateUserInviteResponse, error)); ok { + return rf(ctx, orgShortNameId, contentType, body, reqEditors...) + } if rf, ok := ret.Get(0).(func(context.Context, string, string, io.Reader, ...astrocore.RequestEditorFn) *astrocore.CreateUserInviteResponse); ok { r0 = rf(ctx, orgShortNameId, contentType, body, reqEditors...) } else { @@ -517,7 +635,6 @@ func (_m *ClientWithResponsesInterface) CreateUserInviteWithBodyWithResponse(ctx } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, string, io.Reader, ...astrocore.RequestEditorFn) error); ok { r1 = rf(ctx, orgShortNameId, contentType, body, reqEditors...) } else { @@ -539,6 +656,10 @@ func (_m *ClientWithResponsesInterface) CreateUserInviteWithResponse(ctx context ret := _m.Called(_ca...) var r0 *astrocore.CreateUserInviteResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, astrocore.CreateUserInviteRequest, ...astrocore.RequestEditorFn) (*astrocore.CreateUserInviteResponse, error)); ok { + return rf(ctx, orgShortNameId, body, reqEditors...) + } if rf, ok := ret.Get(0).(func(context.Context, string, astrocore.CreateUserInviteRequest, ...astrocore.RequestEditorFn) *astrocore.CreateUserInviteResponse); ok { r0 = rf(ctx, orgShortNameId, body, reqEditors...) } else { @@ -547,7 +668,6 @@ func (_m *ClientWithResponsesInterface) CreateUserInviteWithResponse(ctx context } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, astrocore.CreateUserInviteRequest, ...astrocore.RequestEditorFn) error); ok { r1 = rf(ctx, orgShortNameId, body, reqEditors...) } else { @@ -557,6 +677,72 @@ func (_m *ClientWithResponsesInterface) CreateUserInviteWithResponse(ctx context return r0, r1 } +// CreateWorkspaceApiTokenWithBodyWithResponse provides a mock function with given fields: ctx, orgShortNameId, workspaceId, contentType, body, reqEditors +func (_m *ClientWithResponsesInterface) CreateWorkspaceApiTokenWithBodyWithResponse(ctx context.Context, orgShortNameId string, workspaceId string, contentType string, body io.Reader, reqEditors ...astrocore.RequestEditorFn) (*astrocore.CreateWorkspaceApiTokenResponse, error) { + _va := make([]interface{}, len(reqEditors)) + for _i := range reqEditors { + _va[_i] = reqEditors[_i] + } + var _ca []interface{} + _ca = append(_ca, ctx, orgShortNameId, workspaceId, contentType, body) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + var r0 *astrocore.CreateWorkspaceApiTokenResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, string, string, io.Reader, ...astrocore.RequestEditorFn) (*astrocore.CreateWorkspaceApiTokenResponse, error)); ok { + return rf(ctx, orgShortNameId, workspaceId, contentType, body, reqEditors...) + } + if rf, ok := ret.Get(0).(func(context.Context, string, string, string, io.Reader, ...astrocore.RequestEditorFn) *astrocore.CreateWorkspaceApiTokenResponse); ok { + r0 = rf(ctx, orgShortNameId, workspaceId, contentType, body, reqEditors...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*astrocore.CreateWorkspaceApiTokenResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, string, string, string, io.Reader, ...astrocore.RequestEditorFn) error); ok { + r1 = rf(ctx, orgShortNameId, workspaceId, contentType, body, reqEditors...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// CreateWorkspaceApiTokenWithResponse provides a mock function with given fields: ctx, orgShortNameId, workspaceId, body, reqEditors +func (_m *ClientWithResponsesInterface) CreateWorkspaceApiTokenWithResponse(ctx context.Context, orgShortNameId string, workspaceId string, body astrocore.CreateWorkspaceApiTokenRequest, reqEditors ...astrocore.RequestEditorFn) (*astrocore.CreateWorkspaceApiTokenResponse, error) { + _va := make([]interface{}, len(reqEditors)) + for _i := range reqEditors { + _va[_i] = reqEditors[_i] + } + var _ca []interface{} + _ca = append(_ca, ctx, orgShortNameId, workspaceId, body) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + var r0 *astrocore.CreateWorkspaceApiTokenResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, string, astrocore.CreateWorkspaceApiTokenRequest, ...astrocore.RequestEditorFn) (*astrocore.CreateWorkspaceApiTokenResponse, error)); ok { + return rf(ctx, orgShortNameId, workspaceId, body, reqEditors...) + } + if rf, ok := ret.Get(0).(func(context.Context, string, string, astrocore.CreateWorkspaceApiTokenRequest, ...astrocore.RequestEditorFn) *astrocore.CreateWorkspaceApiTokenResponse); ok { + r0 = rf(ctx, orgShortNameId, workspaceId, body, reqEditors...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*astrocore.CreateWorkspaceApiTokenResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, string, string, astrocore.CreateWorkspaceApiTokenRequest, ...astrocore.RequestEditorFn) error); ok { + r1 = rf(ctx, orgShortNameId, workspaceId, body, reqEditors...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + // CreateWorkspaceWithBodyWithResponse provides a mock function with given fields: ctx, orgShortNameId, contentType, body, reqEditors func (_m *ClientWithResponsesInterface) CreateWorkspaceWithBodyWithResponse(ctx context.Context, orgShortNameId string, contentType string, body io.Reader, reqEditors ...astrocore.RequestEditorFn) (*astrocore.CreateWorkspaceResponse, error) { _va := make([]interface{}, len(reqEditors)) @@ -569,6 +755,10 @@ func (_m *ClientWithResponsesInterface) CreateWorkspaceWithBodyWithResponse(ctx ret := _m.Called(_ca...) var r0 *astrocore.CreateWorkspaceResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, string, io.Reader, ...astrocore.RequestEditorFn) (*astrocore.CreateWorkspaceResponse, error)); ok { + return rf(ctx, orgShortNameId, contentType, body, reqEditors...) + } if rf, ok := ret.Get(0).(func(context.Context, string, string, io.Reader, ...astrocore.RequestEditorFn) *astrocore.CreateWorkspaceResponse); ok { r0 = rf(ctx, orgShortNameId, contentType, body, reqEditors...) } else { @@ -577,7 +767,6 @@ func (_m *ClientWithResponsesInterface) CreateWorkspaceWithBodyWithResponse(ctx } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, string, io.Reader, ...astrocore.RequestEditorFn) error); ok { r1 = rf(ctx, orgShortNameId, contentType, body, reqEditors...) } else { @@ -599,6 +788,10 @@ func (_m *ClientWithResponsesInterface) CreateWorkspaceWithResponse(ctx context. ret := _m.Called(_ca...) var r0 *astrocore.CreateWorkspaceResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, astrocore.MutateWorkspaceRequest, ...astrocore.RequestEditorFn) (*astrocore.CreateWorkspaceResponse, error)); ok { + return rf(ctx, orgShortNameId, body, reqEditors...) + } if rf, ok := ret.Get(0).(func(context.Context, string, astrocore.MutateWorkspaceRequest, ...astrocore.RequestEditorFn) *astrocore.CreateWorkspaceResponse); ok { r0 = rf(ctx, orgShortNameId, body, reqEditors...) } else { @@ -607,7 +800,6 @@ func (_m *ClientWithResponsesInterface) CreateWorkspaceWithResponse(ctx context. } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, astrocore.MutateWorkspaceRequest, ...astrocore.RequestEditorFn) error); ok { r1 = rf(ctx, orgShortNameId, body, reqEditors...) } else { @@ -629,6 +821,10 @@ func (_m *ClientWithResponsesInterface) DeleteClusterWithResponse(ctx context.Co ret := _m.Called(_ca...) var r0 *astrocore.DeleteClusterResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, string, ...astrocore.RequestEditorFn) (*astrocore.DeleteClusterResponse, error)); ok { + return rf(ctx, orgShortNameId, clusterId, reqEditors...) + } if rf, ok := ret.Get(0).(func(context.Context, string, string, ...astrocore.RequestEditorFn) *astrocore.DeleteClusterResponse); ok { r0 = rf(ctx, orgShortNameId, clusterId, reqEditors...) } else { @@ -637,7 +833,6 @@ func (_m *ClientWithResponsesInterface) DeleteClusterWithResponse(ctx context.Co } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, string, ...astrocore.RequestEditorFn) error); ok { r1 = rf(ctx, orgShortNameId, clusterId, reqEditors...) } else { @@ -659,6 +854,10 @@ func (_m *ClientWithResponsesInterface) DeleteManagedDomainWithResponse(ctx cont ret := _m.Called(_ca...) var r0 *astrocore.DeleteManagedDomainResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, string, ...astrocore.RequestEditorFn) (*astrocore.DeleteManagedDomainResponse, error)); ok { + return rf(ctx, orgShortNameId, domainId, reqEditors...) + } if rf, ok := ret.Get(0).(func(context.Context, string, string, ...astrocore.RequestEditorFn) *astrocore.DeleteManagedDomainResponse); ok { r0 = rf(ctx, orgShortNameId, domainId, reqEditors...) } else { @@ -667,7 +866,6 @@ func (_m *ClientWithResponsesInterface) DeleteManagedDomainWithResponse(ctx cont } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, string, ...astrocore.RequestEditorFn) error); ok { r1 = rf(ctx, orgShortNameId, domainId, reqEditors...) } else { @@ -689,6 +887,10 @@ func (_m *ClientWithResponsesInterface) DeleteOrgUserWithResponse(ctx context.Co ret := _m.Called(_ca...) var r0 *astrocore.DeleteOrgUserResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, string, ...astrocore.RequestEditorFn) (*astrocore.DeleteOrgUserResponse, error)); ok { + return rf(ctx, orgShortNameId, userId, reqEditors...) + } if rf, ok := ret.Get(0).(func(context.Context, string, string, ...astrocore.RequestEditorFn) *astrocore.DeleteOrgUserResponse); ok { r0 = rf(ctx, orgShortNameId, userId, reqEditors...) } else { @@ -697,7 +899,6 @@ func (_m *ClientWithResponsesInterface) DeleteOrgUserWithResponse(ctx context.Co } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, string, ...astrocore.RequestEditorFn) error); ok { r1 = rf(ctx, orgShortNameId, userId, reqEditors...) } else { @@ -707,6 +908,39 @@ func (_m *ClientWithResponsesInterface) DeleteOrgUserWithResponse(ctx context.Co return r0, r1 } +// DeleteOrganizationApiTokenWithResponse provides a mock function with given fields: ctx, orgShortNameId, apiTokenId, reqEditors +func (_m *ClientWithResponsesInterface) DeleteOrganizationApiTokenWithResponse(ctx context.Context, orgShortNameId string, apiTokenId string, reqEditors ...astrocore.RequestEditorFn) (*astrocore.DeleteOrganizationApiTokenResponse, error) { + _va := make([]interface{}, len(reqEditors)) + for _i := range reqEditors { + _va[_i] = reqEditors[_i] + } + var _ca []interface{} + _ca = append(_ca, ctx, orgShortNameId, apiTokenId) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + var r0 *astrocore.DeleteOrganizationApiTokenResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, string, ...astrocore.RequestEditorFn) (*astrocore.DeleteOrganizationApiTokenResponse, error)); ok { + return rf(ctx, orgShortNameId, apiTokenId, reqEditors...) + } + if rf, ok := ret.Get(0).(func(context.Context, string, string, ...astrocore.RequestEditorFn) *astrocore.DeleteOrganizationApiTokenResponse); ok { + r0 = rf(ctx, orgShortNameId, apiTokenId, reqEditors...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*astrocore.DeleteOrganizationApiTokenResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, string, string, ...astrocore.RequestEditorFn) error); ok { + r1 = rf(ctx, orgShortNameId, apiTokenId, reqEditors...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + // DeleteSsoBypassKeyWithResponse provides a mock function with given fields: ctx, orgShortNameId, reqEditors func (_m *ClientWithResponsesInterface) DeleteSsoBypassKeyWithResponse(ctx context.Context, orgShortNameId string, reqEditors ...astrocore.RequestEditorFn) (*astrocore.DeleteSsoBypassKeyResponse, error) { _va := make([]interface{}, len(reqEditors)) @@ -719,6 +953,10 @@ func (_m *ClientWithResponsesInterface) DeleteSsoBypassKeyWithResponse(ctx conte ret := _m.Called(_ca...) var r0 *astrocore.DeleteSsoBypassKeyResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, ...astrocore.RequestEditorFn) (*astrocore.DeleteSsoBypassKeyResponse, error)); ok { + return rf(ctx, orgShortNameId, reqEditors...) + } if rf, ok := ret.Get(0).(func(context.Context, string, ...astrocore.RequestEditorFn) *astrocore.DeleteSsoBypassKeyResponse); ok { r0 = rf(ctx, orgShortNameId, reqEditors...) } else { @@ -727,7 +965,6 @@ func (_m *ClientWithResponsesInterface) DeleteSsoBypassKeyWithResponse(ctx conte } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, ...astrocore.RequestEditorFn) error); ok { r1 = rf(ctx, orgShortNameId, reqEditors...) } else { @@ -749,6 +986,10 @@ func (_m *ClientWithResponsesInterface) DeleteSsoConnectionWithResponse(ctx cont ret := _m.Called(_ca...) var r0 *astrocore.DeleteSsoConnectionResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, string, ...astrocore.RequestEditorFn) (*astrocore.DeleteSsoConnectionResponse, error)); ok { + return rf(ctx, orgShortNameId, connectionId, reqEditors...) + } if rf, ok := ret.Get(0).(func(context.Context, string, string, ...astrocore.RequestEditorFn) *astrocore.DeleteSsoConnectionResponse); ok { r0 = rf(ctx, orgShortNameId, connectionId, reqEditors...) } else { @@ -757,7 +998,6 @@ func (_m *ClientWithResponsesInterface) DeleteSsoConnectionWithResponse(ctx cont } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, string, ...astrocore.RequestEditorFn) error); ok { r1 = rf(ctx, orgShortNameId, connectionId, reqEditors...) } else { @@ -779,6 +1019,10 @@ func (_m *ClientWithResponsesInterface) DeleteTeamWithResponse(ctx context.Conte ret := _m.Called(_ca...) var r0 *astrocore.DeleteTeamResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, string, ...astrocore.RequestEditorFn) (*astrocore.DeleteTeamResponse, error)); ok { + return rf(ctx, orgShortNameId, teamId, reqEditors...) + } if rf, ok := ret.Get(0).(func(context.Context, string, string, ...astrocore.RequestEditorFn) *astrocore.DeleteTeamResponse); ok { r0 = rf(ctx, orgShortNameId, teamId, reqEditors...) } else { @@ -787,7 +1031,6 @@ func (_m *ClientWithResponsesInterface) DeleteTeamWithResponse(ctx context.Conte } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, string, ...astrocore.RequestEditorFn) error); ok { r1 = rf(ctx, orgShortNameId, teamId, reqEditors...) } else { @@ -809,6 +1052,10 @@ func (_m *ClientWithResponsesInterface) DeleteUserInviteWithResponse(ctx context ret := _m.Called(_ca...) var r0 *astrocore.DeleteUserInviteResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, string, ...astrocore.RequestEditorFn) (*astrocore.DeleteUserInviteResponse, error)); ok { + return rf(ctx, orgShortNameId, inviteId, reqEditors...) + } if rf, ok := ret.Get(0).(func(context.Context, string, string, ...astrocore.RequestEditorFn) *astrocore.DeleteUserInviteResponse); ok { r0 = rf(ctx, orgShortNameId, inviteId, reqEditors...) } else { @@ -817,7 +1064,6 @@ func (_m *ClientWithResponsesInterface) DeleteUserInviteWithResponse(ctx context } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, string, ...astrocore.RequestEditorFn) error); ok { r1 = rf(ctx, orgShortNameId, inviteId, reqEditors...) } else { @@ -827,6 +1073,39 @@ func (_m *ClientWithResponsesInterface) DeleteUserInviteWithResponse(ctx context return r0, r1 } +// DeleteWorkspaceApiTokenWithResponse provides a mock function with given fields: ctx, orgShortNameId, workspaceId, apiTokenId, reqEditors +func (_m *ClientWithResponsesInterface) DeleteWorkspaceApiTokenWithResponse(ctx context.Context, orgShortNameId string, workspaceId string, apiTokenId string, reqEditors ...astrocore.RequestEditorFn) (*astrocore.DeleteWorkspaceApiTokenResponse, error) { + _va := make([]interface{}, len(reqEditors)) + for _i := range reqEditors { + _va[_i] = reqEditors[_i] + } + var _ca []interface{} + _ca = append(_ca, ctx, orgShortNameId, workspaceId, apiTokenId) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + var r0 *astrocore.DeleteWorkspaceApiTokenResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, string, string, ...astrocore.RequestEditorFn) (*astrocore.DeleteWorkspaceApiTokenResponse, error)); ok { + return rf(ctx, orgShortNameId, workspaceId, apiTokenId, reqEditors...) + } + if rf, ok := ret.Get(0).(func(context.Context, string, string, string, ...astrocore.RequestEditorFn) *astrocore.DeleteWorkspaceApiTokenResponse); ok { + r0 = rf(ctx, orgShortNameId, workspaceId, apiTokenId, reqEditors...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*astrocore.DeleteWorkspaceApiTokenResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, string, string, string, ...astrocore.RequestEditorFn) error); ok { + r1 = rf(ctx, orgShortNameId, workspaceId, apiTokenId, reqEditors...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + // DeleteWorkspaceTeamWithResponse provides a mock function with given fields: ctx, orgShortNameId, workspaceId, teamId, reqEditors func (_m *ClientWithResponsesInterface) DeleteWorkspaceTeamWithResponse(ctx context.Context, orgShortNameId string, workspaceId string, teamId string, reqEditors ...astrocore.RequestEditorFn) (*astrocore.DeleteWorkspaceTeamResponse, error) { _va := make([]interface{}, len(reqEditors)) @@ -839,6 +1118,10 @@ func (_m *ClientWithResponsesInterface) DeleteWorkspaceTeamWithResponse(ctx cont ret := _m.Called(_ca...) var r0 *astrocore.DeleteWorkspaceTeamResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, string, string, ...astrocore.RequestEditorFn) (*astrocore.DeleteWorkspaceTeamResponse, error)); ok { + return rf(ctx, orgShortNameId, workspaceId, teamId, reqEditors...) + } if rf, ok := ret.Get(0).(func(context.Context, string, string, string, ...astrocore.RequestEditorFn) *astrocore.DeleteWorkspaceTeamResponse); ok { r0 = rf(ctx, orgShortNameId, workspaceId, teamId, reqEditors...) } else { @@ -847,7 +1130,6 @@ func (_m *ClientWithResponsesInterface) DeleteWorkspaceTeamWithResponse(ctx cont } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, string, string, ...astrocore.RequestEditorFn) error); ok { r1 = rf(ctx, orgShortNameId, workspaceId, teamId, reqEditors...) } else { @@ -869,6 +1151,10 @@ func (_m *ClientWithResponsesInterface) DeleteWorkspaceUserWithResponse(ctx cont ret := _m.Called(_ca...) var r0 *astrocore.DeleteWorkspaceUserResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, string, string, ...astrocore.RequestEditorFn) (*astrocore.DeleteWorkspaceUserResponse, error)); ok { + return rf(ctx, orgShortNameId, workspaceId, userId, reqEditors...) + } if rf, ok := ret.Get(0).(func(context.Context, string, string, string, ...astrocore.RequestEditorFn) *astrocore.DeleteWorkspaceUserResponse); ok { r0 = rf(ctx, orgShortNameId, workspaceId, userId, reqEditors...) } else { @@ -877,7 +1163,6 @@ func (_m *ClientWithResponsesInterface) DeleteWorkspaceUserWithResponse(ctx cont } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, string, string, ...astrocore.RequestEditorFn) error); ok { r1 = rf(ctx, orgShortNameId, workspaceId, userId, reqEditors...) } else { @@ -899,6 +1184,10 @@ func (_m *ClientWithResponsesInterface) DeleteWorkspaceWithResponse(ctx context. ret := _m.Called(_ca...) var r0 *astrocore.DeleteWorkspaceResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, string, ...astrocore.RequestEditorFn) (*astrocore.DeleteWorkspaceResponse, error)); ok { + return rf(ctx, orgShortNameId, workspaceId, reqEditors...) + } if rf, ok := ret.Get(0).(func(context.Context, string, string, ...astrocore.RequestEditorFn) *astrocore.DeleteWorkspaceResponse); ok { r0 = rf(ctx, orgShortNameId, workspaceId, reqEditors...) } else { @@ -907,7 +1196,6 @@ func (_m *ClientWithResponsesInterface) DeleteWorkspaceWithResponse(ctx context. } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, string, ...astrocore.RequestEditorFn) error); ok { r1 = rf(ctx, orgShortNameId, workspaceId, reqEditors...) } else { @@ -929,6 +1217,10 @@ func (_m *ClientWithResponsesInterface) GetClusterOptionsWithResponse(ctx contex ret := _m.Called(_ca...) var r0 *astrocore.GetClusterOptionsResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *astrocore.GetClusterOptionsParams, ...astrocore.RequestEditorFn) (*astrocore.GetClusterOptionsResponse, error)); ok { + return rf(ctx, params, reqEditors...) + } if rf, ok := ret.Get(0).(func(context.Context, *astrocore.GetClusterOptionsParams, ...astrocore.RequestEditorFn) *astrocore.GetClusterOptionsResponse); ok { r0 = rf(ctx, params, reqEditors...) } else { @@ -937,7 +1229,6 @@ func (_m *ClientWithResponsesInterface) GetClusterOptionsWithResponse(ctx contex } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, *astrocore.GetClusterOptionsParams, ...astrocore.RequestEditorFn) error); ok { r1 = rf(ctx, params, reqEditors...) } else { @@ -959,6 +1250,10 @@ func (_m *ClientWithResponsesInterface) GetClusterWithResponse(ctx context.Conte ret := _m.Called(_ca...) var r0 *astrocore.GetClusterResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, string, ...astrocore.RequestEditorFn) (*astrocore.GetClusterResponse, error)); ok { + return rf(ctx, orgShortNameId, clusterId, reqEditors...) + } if rf, ok := ret.Get(0).(func(context.Context, string, string, ...astrocore.RequestEditorFn) *astrocore.GetClusterResponse); ok { r0 = rf(ctx, orgShortNameId, clusterId, reqEditors...) } else { @@ -967,7 +1262,6 @@ func (_m *ClientWithResponsesInterface) GetClusterWithResponse(ctx context.Conte } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, string, ...astrocore.RequestEditorFn) error); ok { r1 = rf(ctx, orgShortNameId, clusterId, reqEditors...) } else { @@ -977,6 +1271,39 @@ func (_m *ClientWithResponsesInterface) GetClusterWithResponse(ctx context.Conte return r0, r1 } +// GetCreditSummaryWithResponse provides a mock function with given fields: ctx, orgShortNameId, reqEditors +func (_m *ClientWithResponsesInterface) GetCreditSummaryWithResponse(ctx context.Context, orgShortNameId string, reqEditors ...astrocore.RequestEditorFn) (*astrocore.GetCreditSummaryResponse, error) { + _va := make([]interface{}, len(reqEditors)) + for _i := range reqEditors { + _va[_i] = reqEditors[_i] + } + var _ca []interface{} + _ca = append(_ca, ctx, orgShortNameId) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + var r0 *astrocore.GetCreditSummaryResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, ...astrocore.RequestEditorFn) (*astrocore.GetCreditSummaryResponse, error)); ok { + return rf(ctx, orgShortNameId, reqEditors...) + } + if rf, ok := ret.Get(0).(func(context.Context, string, ...astrocore.RequestEditorFn) *astrocore.GetCreditSummaryResponse); ok { + r0 = rf(ctx, orgShortNameId, reqEditors...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*astrocore.GetCreditSummaryResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, string, ...astrocore.RequestEditorFn) error); ok { + r1 = rf(ctx, orgShortNameId, reqEditors...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + // GetDeploymentOptionsWithResponse provides a mock function with given fields: ctx, reqEditors func (_m *ClientWithResponsesInterface) GetDeploymentOptionsWithResponse(ctx context.Context, reqEditors ...astrocore.RequestEditorFn) (*astrocore.GetDeploymentOptionsResponse, error) { _va := make([]interface{}, len(reqEditors)) @@ -989,6 +1316,10 @@ func (_m *ClientWithResponsesInterface) GetDeploymentOptionsWithResponse(ctx con ret := _m.Called(_ca...) var r0 *astrocore.GetDeploymentOptionsResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, ...astrocore.RequestEditorFn) (*astrocore.GetDeploymentOptionsResponse, error)); ok { + return rf(ctx, reqEditors...) + } if rf, ok := ret.Get(0).(func(context.Context, ...astrocore.RequestEditorFn) *astrocore.GetDeploymentOptionsResponse); ok { r0 = rf(ctx, reqEditors...) } else { @@ -997,7 +1328,6 @@ func (_m *ClientWithResponsesInterface) GetDeploymentOptionsWithResponse(ctx con } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, ...astrocore.RequestEditorFn) error); ok { r1 = rf(ctx, reqEditors...) } else { @@ -1019,6 +1349,10 @@ func (_m *ClientWithResponsesInterface) GetDraftInvoiceWithResponse(ctx context. ret := _m.Called(_ca...) var r0 *astrocore.GetDraftInvoiceResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, ...astrocore.RequestEditorFn) (*astrocore.GetDraftInvoiceResponse, error)); ok { + return rf(ctx, orgShortNameId, reqEditors...) + } if rf, ok := ret.Get(0).(func(context.Context, string, ...astrocore.RequestEditorFn) *astrocore.GetDraftInvoiceResponse); ok { r0 = rf(ctx, orgShortNameId, reqEditors...) } else { @@ -1027,7 +1361,6 @@ func (_m *ClientWithResponsesInterface) GetDraftInvoiceWithResponse(ctx context. } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, ...astrocore.RequestEditorFn) error); ok { r1 = rf(ctx, orgShortNameId, reqEditors...) } else { @@ -1049,6 +1382,10 @@ func (_m *ClientWithResponsesInterface) GetManagedDomainWithResponse(ctx context ret := _m.Called(_ca...) var r0 *astrocore.GetManagedDomainResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, string, ...astrocore.RequestEditorFn) (*astrocore.GetManagedDomainResponse, error)); ok { + return rf(ctx, orgShortNameId, domainId, reqEditors...) + } if rf, ok := ret.Get(0).(func(context.Context, string, string, ...astrocore.RequestEditorFn) *astrocore.GetManagedDomainResponse); ok { r0 = rf(ctx, orgShortNameId, domainId, reqEditors...) } else { @@ -1057,7 +1394,6 @@ func (_m *ClientWithResponsesInterface) GetManagedDomainWithResponse(ctx context } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, string, ...astrocore.RequestEditorFn) error); ok { r1 = rf(ctx, orgShortNameId, domainId, reqEditors...) } else { @@ -1067,6 +1403,72 @@ func (_m *ClientWithResponsesInterface) GetManagedDomainWithResponse(ctx context return r0, r1 } +// GetMetronomeDashboardWithResponse provides a mock function with given fields: ctx, orgShortNameId, pType, params, reqEditors +func (_m *ClientWithResponsesInterface) GetMetronomeDashboardWithResponse(ctx context.Context, orgShortNameId string, pType astrocore.GetMetronomeDashboardParamsType, params *astrocore.GetMetronomeDashboardParams, reqEditors ...astrocore.RequestEditorFn) (*astrocore.GetMetronomeDashboardResponse, error) { + _va := make([]interface{}, len(reqEditors)) + for _i := range reqEditors { + _va[_i] = reqEditors[_i] + } + var _ca []interface{} + _ca = append(_ca, ctx, orgShortNameId, pType, params) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + var r0 *astrocore.GetMetronomeDashboardResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, astrocore.GetMetronomeDashboardParamsType, *astrocore.GetMetronomeDashboardParams, ...astrocore.RequestEditorFn) (*astrocore.GetMetronomeDashboardResponse, error)); ok { + return rf(ctx, orgShortNameId, pType, params, reqEditors...) + } + if rf, ok := ret.Get(0).(func(context.Context, string, astrocore.GetMetronomeDashboardParamsType, *astrocore.GetMetronomeDashboardParams, ...astrocore.RequestEditorFn) *astrocore.GetMetronomeDashboardResponse); ok { + r0 = rf(ctx, orgShortNameId, pType, params, reqEditors...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*astrocore.GetMetronomeDashboardResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, string, astrocore.GetMetronomeDashboardParamsType, *astrocore.GetMetronomeDashboardParams, ...astrocore.RequestEditorFn) error); ok { + r1 = rf(ctx, orgShortNameId, pType, params, reqEditors...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// GetOrganizationApiTokenWithResponse provides a mock function with given fields: ctx, orgShortNameId, apiTokenId, reqEditors +func (_m *ClientWithResponsesInterface) GetOrganizationApiTokenWithResponse(ctx context.Context, orgShortNameId string, apiTokenId string, reqEditors ...astrocore.RequestEditorFn) (*astrocore.GetOrganizationApiTokenResponse, error) { + _va := make([]interface{}, len(reqEditors)) + for _i := range reqEditors { + _va[_i] = reqEditors[_i] + } + var _ca []interface{} + _ca = append(_ca, ctx, orgShortNameId, apiTokenId) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + var r0 *astrocore.GetOrganizationApiTokenResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, string, ...astrocore.RequestEditorFn) (*astrocore.GetOrganizationApiTokenResponse, error)); ok { + return rf(ctx, orgShortNameId, apiTokenId, reqEditors...) + } + if rf, ok := ret.Get(0).(func(context.Context, string, string, ...astrocore.RequestEditorFn) *astrocore.GetOrganizationApiTokenResponse); ok { + r0 = rf(ctx, orgShortNameId, apiTokenId, reqEditors...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*astrocore.GetOrganizationApiTokenResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, string, string, ...astrocore.RequestEditorFn) error); ok { + r1 = rf(ctx, orgShortNameId, apiTokenId, reqEditors...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + // GetOrganizationAuditLogsWithResponse provides a mock function with given fields: ctx, orgShortNameId, params, reqEditors func (_m *ClientWithResponsesInterface) GetOrganizationAuditLogsWithResponse(ctx context.Context, orgShortNameId string, params *astrocore.GetOrganizationAuditLogsParams, reqEditors ...astrocore.RequestEditorFn) (*astrocore.GetOrganizationAuditLogsResponse, error) { _va := make([]interface{}, len(reqEditors)) @@ -1079,6 +1481,10 @@ func (_m *ClientWithResponsesInterface) GetOrganizationAuditLogsWithResponse(ctx ret := _m.Called(_ca...) var r0 *astrocore.GetOrganizationAuditLogsResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, *astrocore.GetOrganizationAuditLogsParams, ...astrocore.RequestEditorFn) (*astrocore.GetOrganizationAuditLogsResponse, error)); ok { + return rf(ctx, orgShortNameId, params, reqEditors...) + } if rf, ok := ret.Get(0).(func(context.Context, string, *astrocore.GetOrganizationAuditLogsParams, ...astrocore.RequestEditorFn) *astrocore.GetOrganizationAuditLogsResponse); ok { r0 = rf(ctx, orgShortNameId, params, reqEditors...) } else { @@ -1087,7 +1493,6 @@ func (_m *ClientWithResponsesInterface) GetOrganizationAuditLogsWithResponse(ctx } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, *astrocore.GetOrganizationAuditLogsParams, ...astrocore.RequestEditorFn) error); ok { r1 = rf(ctx, orgShortNameId, params, reqEditors...) } else { @@ -1109,6 +1514,10 @@ func (_m *ClientWithResponsesInterface) GetOrganizationWithResponse(ctx context. ret := _m.Called(_ca...) var r0 *astrocore.GetOrganizationResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, *astrocore.GetOrganizationParams, ...astrocore.RequestEditorFn) (*astrocore.GetOrganizationResponse, error)); ok { + return rf(ctx, orgShortNameId, params, reqEditors...) + } if rf, ok := ret.Get(0).(func(context.Context, string, *astrocore.GetOrganizationParams, ...astrocore.RequestEditorFn) *astrocore.GetOrganizationResponse); ok { r0 = rf(ctx, orgShortNameId, params, reqEditors...) } else { @@ -1117,7 +1526,6 @@ func (_m *ClientWithResponsesInterface) GetOrganizationWithResponse(ctx context. } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, *astrocore.GetOrganizationParams, ...astrocore.RequestEditorFn) error); ok { r1 = rf(ctx, orgShortNameId, params, reqEditors...) } else { @@ -1139,6 +1547,10 @@ func (_m *ClientWithResponsesInterface) GetPaymentMethodWithResponse(ctx context ret := _m.Called(_ca...) var r0 *astrocore.GetPaymentMethodResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, ...astrocore.RequestEditorFn) (*astrocore.GetPaymentMethodResponse, error)); ok { + return rf(ctx, orgShortNameId, reqEditors...) + } if rf, ok := ret.Get(0).(func(context.Context, string, ...astrocore.RequestEditorFn) *astrocore.GetPaymentMethodResponse); ok { r0 = rf(ctx, orgShortNameId, reqEditors...) } else { @@ -1147,7 +1559,6 @@ func (_m *ClientWithResponsesInterface) GetPaymentMethodWithResponse(ctx context } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, ...astrocore.RequestEditorFn) error); ok { r1 = rf(ctx, orgShortNameId, reqEditors...) } else { @@ -1169,6 +1580,10 @@ func (_m *ClientWithResponsesInterface) GetSelfUserWithResponse(ctx context.Cont ret := _m.Called(_ca...) var r0 *astrocore.GetSelfUserResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *astrocore.GetSelfUserParams, ...astrocore.RequestEditorFn) (*astrocore.GetSelfUserResponse, error)); ok { + return rf(ctx, params, reqEditors...) + } if rf, ok := ret.Get(0).(func(context.Context, *astrocore.GetSelfUserParams, ...astrocore.RequestEditorFn) *astrocore.GetSelfUserResponse); ok { r0 = rf(ctx, params, reqEditors...) } else { @@ -1177,7 +1592,6 @@ func (_m *ClientWithResponsesInterface) GetSelfUserWithResponse(ctx context.Cont } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, *astrocore.GetSelfUserParams, ...astrocore.RequestEditorFn) error); ok { r1 = rf(ctx, params, reqEditors...) } else { @@ -1199,6 +1613,10 @@ func (_m *ClientWithResponsesInterface) GetSharedClusterWithResponse(ctx context ret := _m.Called(_ca...) var r0 *astrocore.GetSharedClusterResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *astrocore.GetSharedClusterParams, ...astrocore.RequestEditorFn) (*astrocore.GetSharedClusterResponse, error)); ok { + return rf(ctx, params, reqEditors...) + } if rf, ok := ret.Get(0).(func(context.Context, *astrocore.GetSharedClusterParams, ...astrocore.RequestEditorFn) *astrocore.GetSharedClusterResponse); ok { r0 = rf(ctx, params, reqEditors...) } else { @@ -1207,7 +1625,6 @@ func (_m *ClientWithResponsesInterface) GetSharedClusterWithResponse(ctx context } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, *astrocore.GetSharedClusterParams, ...astrocore.RequestEditorFn) error); ok { r1 = rf(ctx, params, reqEditors...) } else { @@ -1229,6 +1646,10 @@ func (_m *ClientWithResponsesInterface) GetSsoBypassKeyWithResponse(ctx context. ret := _m.Called(_ca...) var r0 *astrocore.GetSsoBypassKeyResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, ...astrocore.RequestEditorFn) (*astrocore.GetSsoBypassKeyResponse, error)); ok { + return rf(ctx, orgShortNameId, reqEditors...) + } if rf, ok := ret.Get(0).(func(context.Context, string, ...astrocore.RequestEditorFn) *astrocore.GetSsoBypassKeyResponse); ok { r0 = rf(ctx, orgShortNameId, reqEditors...) } else { @@ -1237,7 +1658,6 @@ func (_m *ClientWithResponsesInterface) GetSsoBypassKeyWithResponse(ctx context. } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, ...astrocore.RequestEditorFn) error); ok { r1 = rf(ctx, orgShortNameId, reqEditors...) } else { @@ -1259,6 +1679,10 @@ func (_m *ClientWithResponsesInterface) GetSsoConnectionWithResponse(ctx context ret := _m.Called(_ca...) var r0 *astrocore.GetSsoConnectionResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, string, ...astrocore.RequestEditorFn) (*astrocore.GetSsoConnectionResponse, error)); ok { + return rf(ctx, orgShortNameId, connectionId, reqEditors...) + } if rf, ok := ret.Get(0).(func(context.Context, string, string, ...astrocore.RequestEditorFn) *astrocore.GetSsoConnectionResponse); ok { r0 = rf(ctx, orgShortNameId, connectionId, reqEditors...) } else { @@ -1267,7 +1691,6 @@ func (_m *ClientWithResponsesInterface) GetSsoConnectionWithResponse(ctx context } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, string, ...astrocore.RequestEditorFn) error); ok { r1 = rf(ctx, orgShortNameId, connectionId, reqEditors...) } else { @@ -1289,6 +1712,10 @@ func (_m *ClientWithResponsesInterface) GetStripeClientSecretWithResponse(ctx co ret := _m.Called(_ca...) var r0 *astrocore.GetStripeClientSecretResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, astrocore.GetStripeClientSecretParamsType, ...astrocore.RequestEditorFn) (*astrocore.GetStripeClientSecretResponse, error)); ok { + return rf(ctx, orgShortNameId, pType, reqEditors...) + } if rf, ok := ret.Get(0).(func(context.Context, string, astrocore.GetStripeClientSecretParamsType, ...astrocore.RequestEditorFn) *astrocore.GetStripeClientSecretResponse); ok { r0 = rf(ctx, orgShortNameId, pType, reqEditors...) } else { @@ -1297,7 +1724,6 @@ func (_m *ClientWithResponsesInterface) GetStripeClientSecretWithResponse(ctx co } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, astrocore.GetStripeClientSecretParamsType, ...astrocore.RequestEditorFn) error); ok { r1 = rf(ctx, orgShortNameId, pType, reqEditors...) } else { @@ -1319,6 +1745,10 @@ func (_m *ClientWithResponsesInterface) GetTeamWithResponse(ctx context.Context, ret := _m.Called(_ca...) var r0 *astrocore.GetTeamResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, string, ...astrocore.RequestEditorFn) (*astrocore.GetTeamResponse, error)); ok { + return rf(ctx, orgShortNameId, teamId, reqEditors...) + } if rf, ok := ret.Get(0).(func(context.Context, string, string, ...astrocore.RequestEditorFn) *astrocore.GetTeamResponse); ok { r0 = rf(ctx, orgShortNameId, teamId, reqEditors...) } else { @@ -1327,7 +1757,6 @@ func (_m *ClientWithResponsesInterface) GetTeamWithResponse(ctx context.Context, } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, string, ...astrocore.RequestEditorFn) error); ok { r1 = rf(ctx, orgShortNameId, teamId, reqEditors...) } else { @@ -1349,6 +1778,10 @@ func (_m *ClientWithResponsesInterface) GetUserInviteWithResponse(ctx context.Co ret := _m.Called(_ca...) var r0 *astrocore.GetUserInviteResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, ...astrocore.RequestEditorFn) (*astrocore.GetUserInviteResponse, error)); ok { + return rf(ctx, inviteId, reqEditors...) + } if rf, ok := ret.Get(0).(func(context.Context, string, ...astrocore.RequestEditorFn) *astrocore.GetUserInviteResponse); ok { r0 = rf(ctx, inviteId, reqEditors...) } else { @@ -1357,7 +1790,6 @@ func (_m *ClientWithResponsesInterface) GetUserInviteWithResponse(ctx context.Co } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, ...astrocore.RequestEditorFn) error); ok { r1 = rf(ctx, inviteId, reqEditors...) } else { @@ -1379,6 +1811,10 @@ func (_m *ClientWithResponsesInterface) GetUserWithResponse(ctx context.Context, ret := _m.Called(_ca...) var r0 *astrocore.GetUserResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, string, ...astrocore.RequestEditorFn) (*astrocore.GetUserResponse, error)); ok { + return rf(ctx, orgShortNameId, userId, reqEditors...) + } if rf, ok := ret.Get(0).(func(context.Context, string, string, ...astrocore.RequestEditorFn) *astrocore.GetUserResponse); ok { r0 = rf(ctx, orgShortNameId, userId, reqEditors...) } else { @@ -1387,7 +1823,6 @@ func (_m *ClientWithResponsesInterface) GetUserWithResponse(ctx context.Context, } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, string, ...astrocore.RequestEditorFn) error); ok { r1 = rf(ctx, orgShortNameId, userId, reqEditors...) } else { @@ -1397,6 +1832,39 @@ func (_m *ClientWithResponsesInterface) GetUserWithResponse(ctx context.Context, return r0, r1 } +// GetWorkspaceApiTokenWithResponse provides a mock function with given fields: ctx, orgShortNameId, workspaceId, apiTokenId, reqEditors +func (_m *ClientWithResponsesInterface) GetWorkspaceApiTokenWithResponse(ctx context.Context, orgShortNameId string, workspaceId string, apiTokenId string, reqEditors ...astrocore.RequestEditorFn) (*astrocore.GetWorkspaceApiTokenResponse, error) { + _va := make([]interface{}, len(reqEditors)) + for _i := range reqEditors { + _va[_i] = reqEditors[_i] + } + var _ca []interface{} + _ca = append(_ca, ctx, orgShortNameId, workspaceId, apiTokenId) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + var r0 *astrocore.GetWorkspaceApiTokenResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, string, string, ...astrocore.RequestEditorFn) (*astrocore.GetWorkspaceApiTokenResponse, error)); ok { + return rf(ctx, orgShortNameId, workspaceId, apiTokenId, reqEditors...) + } + if rf, ok := ret.Get(0).(func(context.Context, string, string, string, ...astrocore.RequestEditorFn) *astrocore.GetWorkspaceApiTokenResponse); ok { + r0 = rf(ctx, orgShortNameId, workspaceId, apiTokenId, reqEditors...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*astrocore.GetWorkspaceApiTokenResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, string, string, string, ...astrocore.RequestEditorFn) error); ok { + r1 = rf(ctx, orgShortNameId, workspaceId, apiTokenId, reqEditors...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + // GetWorkspaceWithResponse provides a mock function with given fields: ctx, orgShortNameId, workspaceId, reqEditors func (_m *ClientWithResponsesInterface) GetWorkspaceWithResponse(ctx context.Context, orgShortNameId string, workspaceId string, reqEditors ...astrocore.RequestEditorFn) (*astrocore.GetWorkspaceResponse, error) { _va := make([]interface{}, len(reqEditors)) @@ -1409,6 +1877,10 @@ func (_m *ClientWithResponsesInterface) GetWorkspaceWithResponse(ctx context.Con ret := _m.Called(_ca...) var r0 *astrocore.GetWorkspaceResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, string, ...astrocore.RequestEditorFn) (*astrocore.GetWorkspaceResponse, error)); ok { + return rf(ctx, orgShortNameId, workspaceId, reqEditors...) + } if rf, ok := ret.Get(0).(func(context.Context, string, string, ...astrocore.RequestEditorFn) *astrocore.GetWorkspaceResponse); ok { r0 = rf(ctx, orgShortNameId, workspaceId, reqEditors...) } else { @@ -1417,7 +1889,6 @@ func (_m *ClientWithResponsesInterface) GetWorkspaceWithResponse(ctx context.Con } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, string, ...astrocore.RequestEditorFn) error); ok { r1 = rf(ctx, orgShortNameId, workspaceId, reqEditors...) } else { @@ -1439,6 +1910,10 @@ func (_m *ClientWithResponsesInterface) ListClustersWithResponse(ctx context.Con ret := _m.Called(_ca...) var r0 *astrocore.ListClustersResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, *astrocore.ListClustersParams, ...astrocore.RequestEditorFn) (*astrocore.ListClustersResponse, error)); ok { + return rf(ctx, orgShortNameId, params, reqEditors...) + } if rf, ok := ret.Get(0).(func(context.Context, string, *astrocore.ListClustersParams, ...astrocore.RequestEditorFn) *astrocore.ListClustersResponse); ok { r0 = rf(ctx, orgShortNameId, params, reqEditors...) } else { @@ -1447,7 +1922,6 @@ func (_m *ClientWithResponsesInterface) ListClustersWithResponse(ctx context.Con } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, *astrocore.ListClustersParams, ...astrocore.RequestEditorFn) error); ok { r1 = rf(ctx, orgShortNameId, params, reqEditors...) } else { @@ -1469,6 +1943,10 @@ func (_m *ClientWithResponsesInterface) ListManagedDomainsWithResponse(ctx conte ret := _m.Called(_ca...) var r0 *astrocore.ListManagedDomainsResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, ...astrocore.RequestEditorFn) (*astrocore.ListManagedDomainsResponse, error)); ok { + return rf(ctx, orgShortNameId, reqEditors...) + } if rf, ok := ret.Get(0).(func(context.Context, string, ...astrocore.RequestEditorFn) *astrocore.ListManagedDomainsResponse); ok { r0 = rf(ctx, orgShortNameId, reqEditors...) } else { @@ -1477,7 +1955,6 @@ func (_m *ClientWithResponsesInterface) ListManagedDomainsWithResponse(ctx conte } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, ...astrocore.RequestEditorFn) error); ok { r1 = rf(ctx, orgShortNameId, reqEditors...) } else { @@ -1499,6 +1976,10 @@ func (_m *ClientWithResponsesInterface) ListOrgUsersWithResponse(ctx context.Con ret := _m.Called(_ca...) var r0 *astrocore.ListOrgUsersResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, *astrocore.ListOrgUsersParams, ...astrocore.RequestEditorFn) (*astrocore.ListOrgUsersResponse, error)); ok { + return rf(ctx, orgShortNameId, params, reqEditors...) + } if rf, ok := ret.Get(0).(func(context.Context, string, *astrocore.ListOrgUsersParams, ...astrocore.RequestEditorFn) *astrocore.ListOrgUsersResponse); ok { r0 = rf(ctx, orgShortNameId, params, reqEditors...) } else { @@ -1507,7 +1988,6 @@ func (_m *ClientWithResponsesInterface) ListOrgUsersWithResponse(ctx context.Con } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, *astrocore.ListOrgUsersParams, ...astrocore.RequestEditorFn) error); ok { r1 = rf(ctx, orgShortNameId, params, reqEditors...) } else { @@ -1517,6 +1997,39 @@ func (_m *ClientWithResponsesInterface) ListOrgUsersWithResponse(ctx context.Con return r0, r1 } +// ListOrganizationApiTokensWithResponse provides a mock function with given fields: ctx, orgShortNameId, params, reqEditors +func (_m *ClientWithResponsesInterface) ListOrganizationApiTokensWithResponse(ctx context.Context, orgShortNameId string, params *astrocore.ListOrganizationApiTokensParams, reqEditors ...astrocore.RequestEditorFn) (*astrocore.ListOrganizationApiTokensResponse, error) { + _va := make([]interface{}, len(reqEditors)) + for _i := range reqEditors { + _va[_i] = reqEditors[_i] + } + var _ca []interface{} + _ca = append(_ca, ctx, orgShortNameId, params) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + var r0 *astrocore.ListOrganizationApiTokensResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, *astrocore.ListOrganizationApiTokensParams, ...astrocore.RequestEditorFn) (*astrocore.ListOrganizationApiTokensResponse, error)); ok { + return rf(ctx, orgShortNameId, params, reqEditors...) + } + if rf, ok := ret.Get(0).(func(context.Context, string, *astrocore.ListOrganizationApiTokensParams, ...astrocore.RequestEditorFn) *astrocore.ListOrganizationApiTokensResponse); ok { + r0 = rf(ctx, orgShortNameId, params, reqEditors...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*astrocore.ListOrganizationApiTokensResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, string, *astrocore.ListOrganizationApiTokensParams, ...astrocore.RequestEditorFn) error); ok { + r1 = rf(ctx, orgShortNameId, params, reqEditors...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + // ListOrganizationAuthIdsWithResponse provides a mock function with given fields: ctx, params, reqEditors func (_m *ClientWithResponsesInterface) ListOrganizationAuthIdsWithResponse(ctx context.Context, params *astrocore.ListOrganizationAuthIdsParams, reqEditors ...astrocore.RequestEditorFn) (*astrocore.ListOrganizationAuthIdsResponse, error) { _va := make([]interface{}, len(reqEditors)) @@ -1529,6 +2042,10 @@ func (_m *ClientWithResponsesInterface) ListOrganizationAuthIdsWithResponse(ctx ret := _m.Called(_ca...) var r0 *astrocore.ListOrganizationAuthIdsResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *astrocore.ListOrganizationAuthIdsParams, ...astrocore.RequestEditorFn) (*astrocore.ListOrganizationAuthIdsResponse, error)); ok { + return rf(ctx, params, reqEditors...) + } if rf, ok := ret.Get(0).(func(context.Context, *astrocore.ListOrganizationAuthIdsParams, ...astrocore.RequestEditorFn) *astrocore.ListOrganizationAuthIdsResponse); ok { r0 = rf(ctx, params, reqEditors...) } else { @@ -1537,7 +2054,6 @@ func (_m *ClientWithResponsesInterface) ListOrganizationAuthIdsWithResponse(ctx } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, *astrocore.ListOrganizationAuthIdsParams, ...astrocore.RequestEditorFn) error); ok { r1 = rf(ctx, params, reqEditors...) } else { @@ -1559,6 +2075,10 @@ func (_m *ClientWithResponsesInterface) ListOrganizationTeamsWithResponse(ctx co ret := _m.Called(_ca...) var r0 *astrocore.ListOrganizationTeamsResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, *astrocore.ListOrganizationTeamsParams, ...astrocore.RequestEditorFn) (*astrocore.ListOrganizationTeamsResponse, error)); ok { + return rf(ctx, orgShortNameId, params, reqEditors...) + } if rf, ok := ret.Get(0).(func(context.Context, string, *astrocore.ListOrganizationTeamsParams, ...astrocore.RequestEditorFn) *astrocore.ListOrganizationTeamsResponse); ok { r0 = rf(ctx, orgShortNameId, params, reqEditors...) } else { @@ -1567,7 +2087,6 @@ func (_m *ClientWithResponsesInterface) ListOrganizationTeamsWithResponse(ctx co } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, *astrocore.ListOrganizationTeamsParams, ...astrocore.RequestEditorFn) error); ok { r1 = rf(ctx, orgShortNameId, params, reqEditors...) } else { @@ -1589,6 +2108,10 @@ func (_m *ClientWithResponsesInterface) ListOrganizationsWithResponse(ctx contex ret := _m.Called(_ca...) var r0 *astrocore.ListOrganizationsResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *astrocore.ListOrganizationsParams, ...astrocore.RequestEditorFn) (*astrocore.ListOrganizationsResponse, error)); ok { + return rf(ctx, params, reqEditors...) + } if rf, ok := ret.Get(0).(func(context.Context, *astrocore.ListOrganizationsParams, ...astrocore.RequestEditorFn) *astrocore.ListOrganizationsResponse); ok { r0 = rf(ctx, params, reqEditors...) } else { @@ -1597,7 +2120,6 @@ func (_m *ClientWithResponsesInterface) ListOrganizationsWithResponse(ctx contex } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, *astrocore.ListOrganizationsParams, ...astrocore.RequestEditorFn) error); ok { r1 = rf(ctx, params, reqEditors...) } else { @@ -1618,18 +2140,54 @@ func (_m *ClientWithResponsesInterface) ListSsoConnectionsWithResponse(ctx conte _ca = append(_ca, _va...) ret := _m.Called(_ca...) - var r0 *astrocore.ListSsoConnectionsResponse - if rf, ok := ret.Get(0).(func(context.Context, string, ...astrocore.RequestEditorFn) *astrocore.ListSsoConnectionsResponse); ok { - r0 = rf(ctx, orgShortNameId, reqEditors...) + var r0 *astrocore.ListSsoConnectionsResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, ...astrocore.RequestEditorFn) (*astrocore.ListSsoConnectionsResponse, error)); ok { + return rf(ctx, orgShortNameId, reqEditors...) + } + if rf, ok := ret.Get(0).(func(context.Context, string, ...astrocore.RequestEditorFn) *astrocore.ListSsoConnectionsResponse); ok { + r0 = rf(ctx, orgShortNameId, reqEditors...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*astrocore.ListSsoConnectionsResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, string, ...astrocore.RequestEditorFn) error); ok { + r1 = rf(ctx, orgShortNameId, reqEditors...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ListWorkspaceApiTokensWithResponse provides a mock function with given fields: ctx, orgShortNameId, workspaceId, params, reqEditors +func (_m *ClientWithResponsesInterface) ListWorkspaceApiTokensWithResponse(ctx context.Context, orgShortNameId string, workspaceId string, params *astrocore.ListWorkspaceApiTokensParams, reqEditors ...astrocore.RequestEditorFn) (*astrocore.ListWorkspaceApiTokensResponse, error) { + _va := make([]interface{}, len(reqEditors)) + for _i := range reqEditors { + _va[_i] = reqEditors[_i] + } + var _ca []interface{} + _ca = append(_ca, ctx, orgShortNameId, workspaceId, params) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + var r0 *astrocore.ListWorkspaceApiTokensResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, string, *astrocore.ListWorkspaceApiTokensParams, ...astrocore.RequestEditorFn) (*astrocore.ListWorkspaceApiTokensResponse, error)); ok { + return rf(ctx, orgShortNameId, workspaceId, params, reqEditors...) + } + if rf, ok := ret.Get(0).(func(context.Context, string, string, *astrocore.ListWorkspaceApiTokensParams, ...astrocore.RequestEditorFn) *astrocore.ListWorkspaceApiTokensResponse); ok { + r0 = rf(ctx, orgShortNameId, workspaceId, params, reqEditors...) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*astrocore.ListSsoConnectionsResponse) + r0 = ret.Get(0).(*astrocore.ListWorkspaceApiTokensResponse) } } - var r1 error - if rf, ok := ret.Get(1).(func(context.Context, string, ...astrocore.RequestEditorFn) error); ok { - r1 = rf(ctx, orgShortNameId, reqEditors...) + if rf, ok := ret.Get(1).(func(context.Context, string, string, *astrocore.ListWorkspaceApiTokensParams, ...astrocore.RequestEditorFn) error); ok { + r1 = rf(ctx, orgShortNameId, workspaceId, params, reqEditors...) } else { r1 = ret.Error(1) } @@ -1649,6 +2207,10 @@ func (_m *ClientWithResponsesInterface) ListWorkspaceDagFiltersWithResponse(ctx ret := _m.Called(_ca...) var r0 *astrocore.ListWorkspaceDagFiltersResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, string, ...astrocore.RequestEditorFn) (*astrocore.ListWorkspaceDagFiltersResponse, error)); ok { + return rf(ctx, orgShortNameId, workspaceId, reqEditors...) + } if rf, ok := ret.Get(0).(func(context.Context, string, string, ...astrocore.RequestEditorFn) *astrocore.ListWorkspaceDagFiltersResponse); ok { r0 = rf(ctx, orgShortNameId, workspaceId, reqEditors...) } else { @@ -1657,7 +2219,6 @@ func (_m *ClientWithResponsesInterface) ListWorkspaceDagFiltersWithResponse(ctx } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, string, ...astrocore.RequestEditorFn) error); ok { r1 = rf(ctx, orgShortNameId, workspaceId, reqEditors...) } else { @@ -1679,6 +2240,10 @@ func (_m *ClientWithResponsesInterface) ListWorkspaceDagsWithResponse(ctx contex ret := _m.Called(_ca...) var r0 *astrocore.ListWorkspaceDagsResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, string, *astrocore.ListWorkspaceDagsParams, ...astrocore.RequestEditorFn) (*astrocore.ListWorkspaceDagsResponse, error)); ok { + return rf(ctx, orgShortNameId, workspaceId, params, reqEditors...) + } if rf, ok := ret.Get(0).(func(context.Context, string, string, *astrocore.ListWorkspaceDagsParams, ...astrocore.RequestEditorFn) *astrocore.ListWorkspaceDagsResponse); ok { r0 = rf(ctx, orgShortNameId, workspaceId, params, reqEditors...) } else { @@ -1687,7 +2252,6 @@ func (_m *ClientWithResponsesInterface) ListWorkspaceDagsWithResponse(ctx contex } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, string, *astrocore.ListWorkspaceDagsParams, ...astrocore.RequestEditorFn) error); ok { r1 = rf(ctx, orgShortNameId, workspaceId, params, reqEditors...) } else { @@ -1709,6 +2273,10 @@ func (_m *ClientWithResponsesInterface) ListWorkspaceTeamsWithResponse(ctx conte ret := _m.Called(_ca...) var r0 *astrocore.ListWorkspaceTeamsResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, string, *astrocore.ListWorkspaceTeamsParams, ...astrocore.RequestEditorFn) (*astrocore.ListWorkspaceTeamsResponse, error)); ok { + return rf(ctx, orgShortNameId, workspaceId, params, reqEditors...) + } if rf, ok := ret.Get(0).(func(context.Context, string, string, *astrocore.ListWorkspaceTeamsParams, ...astrocore.RequestEditorFn) *astrocore.ListWorkspaceTeamsResponse); ok { r0 = rf(ctx, orgShortNameId, workspaceId, params, reqEditors...) } else { @@ -1717,7 +2285,6 @@ func (_m *ClientWithResponsesInterface) ListWorkspaceTeamsWithResponse(ctx conte } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, string, *astrocore.ListWorkspaceTeamsParams, ...astrocore.RequestEditorFn) error); ok { r1 = rf(ctx, orgShortNameId, workspaceId, params, reqEditors...) } else { @@ -1739,6 +2306,10 @@ func (_m *ClientWithResponsesInterface) ListWorkspaceUsersWithResponse(ctx conte ret := _m.Called(_ca...) var r0 *astrocore.ListWorkspaceUsersResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, string, *astrocore.ListWorkspaceUsersParams, ...astrocore.RequestEditorFn) (*astrocore.ListWorkspaceUsersResponse, error)); ok { + return rf(ctx, orgShortNameId, workspaceId, params, reqEditors...) + } if rf, ok := ret.Get(0).(func(context.Context, string, string, *astrocore.ListWorkspaceUsersParams, ...astrocore.RequestEditorFn) *astrocore.ListWorkspaceUsersResponse); ok { r0 = rf(ctx, orgShortNameId, workspaceId, params, reqEditors...) } else { @@ -1747,7 +2318,6 @@ func (_m *ClientWithResponsesInterface) ListWorkspaceUsersWithResponse(ctx conte } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, string, *astrocore.ListWorkspaceUsersParams, ...astrocore.RequestEditorFn) error); ok { r1 = rf(ctx, orgShortNameId, workspaceId, params, reqEditors...) } else { @@ -1769,6 +2339,10 @@ func (_m *ClientWithResponsesInterface) ListWorkspacesWithResponse(ctx context.C ret := _m.Called(_ca...) var r0 *astrocore.ListWorkspacesResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, *astrocore.ListWorkspacesParams, ...astrocore.RequestEditorFn) (*astrocore.ListWorkspacesResponse, error)); ok { + return rf(ctx, orgShortNameId, params, reqEditors...) + } if rf, ok := ret.Get(0).(func(context.Context, string, *astrocore.ListWorkspacesParams, ...astrocore.RequestEditorFn) *astrocore.ListWorkspacesResponse); ok { r0 = rf(ctx, orgShortNameId, params, reqEditors...) } else { @@ -1777,7 +2351,6 @@ func (_m *ClientWithResponsesInterface) ListWorkspacesWithResponse(ctx context.C } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, *astrocore.ListWorkspacesParams, ...astrocore.RequestEditorFn) error); ok { r1 = rf(ctx, orgShortNameId, params, reqEditors...) } else { @@ -1799,6 +2372,10 @@ func (_m *ClientWithResponsesInterface) MutateOrgUserRoleWithBodyWithResponse(ct ret := _m.Called(_ca...) var r0 *astrocore.MutateOrgUserRoleResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, string, string, io.Reader, ...astrocore.RequestEditorFn) (*astrocore.MutateOrgUserRoleResponse, error)); ok { + return rf(ctx, orgShortNameId, userId, contentType, body, reqEditors...) + } if rf, ok := ret.Get(0).(func(context.Context, string, string, string, io.Reader, ...astrocore.RequestEditorFn) *astrocore.MutateOrgUserRoleResponse); ok { r0 = rf(ctx, orgShortNameId, userId, contentType, body, reqEditors...) } else { @@ -1807,7 +2384,6 @@ func (_m *ClientWithResponsesInterface) MutateOrgUserRoleWithBodyWithResponse(ct } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, string, string, io.Reader, ...astrocore.RequestEditorFn) error); ok { r1 = rf(ctx, orgShortNameId, userId, contentType, body, reqEditors...) } else { @@ -1829,6 +2405,10 @@ func (_m *ClientWithResponsesInterface) MutateOrgUserRoleWithResponse(ctx contex ret := _m.Called(_ca...) var r0 *astrocore.MutateOrgUserRoleResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, string, astrocore.MutateOrgUserRoleRequest, ...astrocore.RequestEditorFn) (*astrocore.MutateOrgUserRoleResponse, error)); ok { + return rf(ctx, orgShortNameId, userId, body, reqEditors...) + } if rf, ok := ret.Get(0).(func(context.Context, string, string, astrocore.MutateOrgUserRoleRequest, ...astrocore.RequestEditorFn) *astrocore.MutateOrgUserRoleResponse); ok { r0 = rf(ctx, orgShortNameId, userId, body, reqEditors...) } else { @@ -1837,7 +2417,6 @@ func (_m *ClientWithResponsesInterface) MutateOrgUserRoleWithResponse(ctx contex } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, string, astrocore.MutateOrgUserRoleRequest, ...astrocore.RequestEditorFn) error); ok { r1 = rf(ctx, orgShortNameId, userId, body, reqEditors...) } else { @@ -1859,6 +2438,10 @@ func (_m *ClientWithResponsesInterface) MutateWorkspaceTeamRoleWithBodyWithRespo ret := _m.Called(_ca...) var r0 *astrocore.MutateWorkspaceTeamRoleResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, string, string, string, io.Reader, ...astrocore.RequestEditorFn) (*astrocore.MutateWorkspaceTeamRoleResponse, error)); ok { + return rf(ctx, orgShortNameId, workspaceId, teamId, contentType, body, reqEditors...) + } if rf, ok := ret.Get(0).(func(context.Context, string, string, string, string, io.Reader, ...astrocore.RequestEditorFn) *astrocore.MutateWorkspaceTeamRoleResponse); ok { r0 = rf(ctx, orgShortNameId, workspaceId, teamId, contentType, body, reqEditors...) } else { @@ -1867,7 +2450,6 @@ func (_m *ClientWithResponsesInterface) MutateWorkspaceTeamRoleWithBodyWithRespo } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, string, string, string, io.Reader, ...astrocore.RequestEditorFn) error); ok { r1 = rf(ctx, orgShortNameId, workspaceId, teamId, contentType, body, reqEditors...) } else { @@ -1889,6 +2471,10 @@ func (_m *ClientWithResponsesInterface) MutateWorkspaceTeamRoleWithResponse(ctx ret := _m.Called(_ca...) var r0 *astrocore.MutateWorkspaceTeamRoleResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, string, string, astrocore.MutateWorkspaceTeamRoleRequest, ...astrocore.RequestEditorFn) (*astrocore.MutateWorkspaceTeamRoleResponse, error)); ok { + return rf(ctx, orgShortNameId, workspaceId, teamId, body, reqEditors...) + } if rf, ok := ret.Get(0).(func(context.Context, string, string, string, astrocore.MutateWorkspaceTeamRoleRequest, ...astrocore.RequestEditorFn) *astrocore.MutateWorkspaceTeamRoleResponse); ok { r0 = rf(ctx, orgShortNameId, workspaceId, teamId, body, reqEditors...) } else { @@ -1897,7 +2483,6 @@ func (_m *ClientWithResponsesInterface) MutateWorkspaceTeamRoleWithResponse(ctx } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, string, string, astrocore.MutateWorkspaceTeamRoleRequest, ...astrocore.RequestEditorFn) error); ok { r1 = rf(ctx, orgShortNameId, workspaceId, teamId, body, reqEditors...) } else { @@ -1919,6 +2504,10 @@ func (_m *ClientWithResponsesInterface) MutateWorkspaceUserRoleWithBodyWithRespo ret := _m.Called(_ca...) var r0 *astrocore.MutateWorkspaceUserRoleResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, string, string, string, io.Reader, ...astrocore.RequestEditorFn) (*astrocore.MutateWorkspaceUserRoleResponse, error)); ok { + return rf(ctx, orgShortNameId, workspaceId, userId, contentType, body, reqEditors...) + } if rf, ok := ret.Get(0).(func(context.Context, string, string, string, string, io.Reader, ...astrocore.RequestEditorFn) *astrocore.MutateWorkspaceUserRoleResponse); ok { r0 = rf(ctx, orgShortNameId, workspaceId, userId, contentType, body, reqEditors...) } else { @@ -1927,7 +2516,6 @@ func (_m *ClientWithResponsesInterface) MutateWorkspaceUserRoleWithBodyWithRespo } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, string, string, string, io.Reader, ...astrocore.RequestEditorFn) error); ok { r1 = rf(ctx, orgShortNameId, workspaceId, userId, contentType, body, reqEditors...) } else { @@ -1949,6 +2537,10 @@ func (_m *ClientWithResponsesInterface) MutateWorkspaceUserRoleWithResponse(ctx ret := _m.Called(_ca...) var r0 *astrocore.MutateWorkspaceUserRoleResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, string, string, astrocore.MutateWorkspaceUserRoleRequest, ...astrocore.RequestEditorFn) (*astrocore.MutateWorkspaceUserRoleResponse, error)); ok { + return rf(ctx, orgShortNameId, workspaceId, userId, body, reqEditors...) + } if rf, ok := ret.Get(0).(func(context.Context, string, string, string, astrocore.MutateWorkspaceUserRoleRequest, ...astrocore.RequestEditorFn) *astrocore.MutateWorkspaceUserRoleResponse); ok { r0 = rf(ctx, orgShortNameId, workspaceId, userId, body, reqEditors...) } else { @@ -1957,7 +2549,6 @@ func (_m *ClientWithResponsesInterface) MutateWorkspaceUserRoleWithResponse(ctx } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, string, string, astrocore.MutateWorkspaceUserRoleRequest, ...astrocore.RequestEditorFn) error); ok { r1 = rf(ctx, orgShortNameId, workspaceId, userId, body, reqEditors...) } else { @@ -1979,6 +2570,10 @@ func (_m *ClientWithResponsesInterface) RemoveTeamMemberWithResponse(ctx context ret := _m.Called(_ca...) var r0 *astrocore.RemoveTeamMemberResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, string, string, ...astrocore.RequestEditorFn) (*astrocore.RemoveTeamMemberResponse, error)); ok { + return rf(ctx, orgShortNameId, teamId, memberId, reqEditors...) + } if rf, ok := ret.Get(0).(func(context.Context, string, string, string, ...astrocore.RequestEditorFn) *astrocore.RemoveTeamMemberResponse); ok { r0 = rf(ctx, orgShortNameId, teamId, memberId, reqEditors...) } else { @@ -1987,7 +2582,6 @@ func (_m *ClientWithResponsesInterface) RemoveTeamMemberWithResponse(ctx context } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, string, string, ...astrocore.RequestEditorFn) error); ok { r1 = rf(ctx, orgShortNameId, teamId, memberId, reqEditors...) } else { @@ -1997,6 +2591,72 @@ func (_m *ClientWithResponsesInterface) RemoveTeamMemberWithResponse(ctx context return r0, r1 } +// RotateOrganizationApiTokenWithResponse provides a mock function with given fields: ctx, orgShortNameId, apiTokenId, reqEditors +func (_m *ClientWithResponsesInterface) RotateOrganizationApiTokenWithResponse(ctx context.Context, orgShortNameId string, apiTokenId string, reqEditors ...astrocore.RequestEditorFn) (*astrocore.RotateOrganizationApiTokenResponse, error) { + _va := make([]interface{}, len(reqEditors)) + for _i := range reqEditors { + _va[_i] = reqEditors[_i] + } + var _ca []interface{} + _ca = append(_ca, ctx, orgShortNameId, apiTokenId) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + var r0 *astrocore.RotateOrganizationApiTokenResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, string, ...astrocore.RequestEditorFn) (*astrocore.RotateOrganizationApiTokenResponse, error)); ok { + return rf(ctx, orgShortNameId, apiTokenId, reqEditors...) + } + if rf, ok := ret.Get(0).(func(context.Context, string, string, ...astrocore.RequestEditorFn) *astrocore.RotateOrganizationApiTokenResponse); ok { + r0 = rf(ctx, orgShortNameId, apiTokenId, reqEditors...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*astrocore.RotateOrganizationApiTokenResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, string, string, ...astrocore.RequestEditorFn) error); ok { + r1 = rf(ctx, orgShortNameId, apiTokenId, reqEditors...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// RotateWorkspaceApiTokenWithResponse provides a mock function with given fields: ctx, orgShortNameId, workspaceId, apiTokenId, reqEditors +func (_m *ClientWithResponsesInterface) RotateWorkspaceApiTokenWithResponse(ctx context.Context, orgShortNameId string, workspaceId string, apiTokenId string, reqEditors ...astrocore.RequestEditorFn) (*astrocore.RotateWorkspaceApiTokenResponse, error) { + _va := make([]interface{}, len(reqEditors)) + for _i := range reqEditors { + _va[_i] = reqEditors[_i] + } + var _ca []interface{} + _ca = append(_ca, ctx, orgShortNameId, workspaceId, apiTokenId) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + var r0 *astrocore.RotateWorkspaceApiTokenResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, string, string, ...astrocore.RequestEditorFn) (*astrocore.RotateWorkspaceApiTokenResponse, error)); ok { + return rf(ctx, orgShortNameId, workspaceId, apiTokenId, reqEditors...) + } + if rf, ok := ret.Get(0).(func(context.Context, string, string, string, ...astrocore.RequestEditorFn) *astrocore.RotateWorkspaceApiTokenResponse); ok { + r0 = rf(ctx, orgShortNameId, workspaceId, apiTokenId, reqEditors...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*astrocore.RotateWorkspaceApiTokenResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, string, string, string, ...astrocore.RequestEditorFn) error); ok { + r1 = rf(ctx, orgShortNameId, workspaceId, apiTokenId, reqEditors...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + // UpdateAwsClusterWithBodyWithResponse provides a mock function with given fields: ctx, orgShortNameId, clusterId, contentType, body, reqEditors func (_m *ClientWithResponsesInterface) UpdateAwsClusterWithBodyWithResponse(ctx context.Context, orgShortNameId string, clusterId string, contentType string, body io.Reader, reqEditors ...astrocore.RequestEditorFn) (*astrocore.UpdateAwsClusterResponse, error) { _va := make([]interface{}, len(reqEditors)) @@ -2009,6 +2669,10 @@ func (_m *ClientWithResponsesInterface) UpdateAwsClusterWithBodyWithResponse(ctx ret := _m.Called(_ca...) var r0 *astrocore.UpdateAwsClusterResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, string, string, io.Reader, ...astrocore.RequestEditorFn) (*astrocore.UpdateAwsClusterResponse, error)); ok { + return rf(ctx, orgShortNameId, clusterId, contentType, body, reqEditors...) + } if rf, ok := ret.Get(0).(func(context.Context, string, string, string, io.Reader, ...astrocore.RequestEditorFn) *astrocore.UpdateAwsClusterResponse); ok { r0 = rf(ctx, orgShortNameId, clusterId, contentType, body, reqEditors...) } else { @@ -2017,7 +2681,6 @@ func (_m *ClientWithResponsesInterface) UpdateAwsClusterWithBodyWithResponse(ctx } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, string, string, io.Reader, ...astrocore.RequestEditorFn) error); ok { r1 = rf(ctx, orgShortNameId, clusterId, contentType, body, reqEditors...) } else { @@ -2039,6 +2702,10 @@ func (_m *ClientWithResponsesInterface) UpdateAwsClusterWithResponse(ctx context ret := _m.Called(_ca...) var r0 *astrocore.UpdateAwsClusterResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, string, astrocore.UpdateAwsClusterRequest, ...astrocore.RequestEditorFn) (*astrocore.UpdateAwsClusterResponse, error)); ok { + return rf(ctx, orgShortNameId, clusterId, body, reqEditors...) + } if rf, ok := ret.Get(0).(func(context.Context, string, string, astrocore.UpdateAwsClusterRequest, ...astrocore.RequestEditorFn) *astrocore.UpdateAwsClusterResponse); ok { r0 = rf(ctx, orgShortNameId, clusterId, body, reqEditors...) } else { @@ -2047,7 +2714,6 @@ func (_m *ClientWithResponsesInterface) UpdateAwsClusterWithResponse(ctx context } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, string, astrocore.UpdateAwsClusterRequest, ...astrocore.RequestEditorFn) error); ok { r1 = rf(ctx, orgShortNameId, clusterId, body, reqEditors...) } else { @@ -2069,6 +2735,10 @@ func (_m *ClientWithResponsesInterface) UpdateAzureClusterWithBodyWithResponse(c ret := _m.Called(_ca...) var r0 *astrocore.UpdateAzureClusterResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, string, string, io.Reader, ...astrocore.RequestEditorFn) (*astrocore.UpdateAzureClusterResponse, error)); ok { + return rf(ctx, orgShortNameId, clusterId, contentType, body, reqEditors...) + } if rf, ok := ret.Get(0).(func(context.Context, string, string, string, io.Reader, ...astrocore.RequestEditorFn) *astrocore.UpdateAzureClusterResponse); ok { r0 = rf(ctx, orgShortNameId, clusterId, contentType, body, reqEditors...) } else { @@ -2077,7 +2747,6 @@ func (_m *ClientWithResponsesInterface) UpdateAzureClusterWithBodyWithResponse(c } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, string, string, io.Reader, ...astrocore.RequestEditorFn) error); ok { r1 = rf(ctx, orgShortNameId, clusterId, contentType, body, reqEditors...) } else { @@ -2099,6 +2768,10 @@ func (_m *ClientWithResponsesInterface) UpdateAzureClusterWithResponse(ctx conte ret := _m.Called(_ca...) var r0 *astrocore.UpdateAzureClusterResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, string, astrocore.UpdateAzureClusterRequest, ...astrocore.RequestEditorFn) (*astrocore.UpdateAzureClusterResponse, error)); ok { + return rf(ctx, orgShortNameId, clusterId, body, reqEditors...) + } if rf, ok := ret.Get(0).(func(context.Context, string, string, astrocore.UpdateAzureClusterRequest, ...astrocore.RequestEditorFn) *astrocore.UpdateAzureClusterResponse); ok { r0 = rf(ctx, orgShortNameId, clusterId, body, reqEditors...) } else { @@ -2107,7 +2780,6 @@ func (_m *ClientWithResponsesInterface) UpdateAzureClusterWithResponse(ctx conte } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, string, astrocore.UpdateAzureClusterRequest, ...astrocore.RequestEditorFn) error); ok { r1 = rf(ctx, orgShortNameId, clusterId, body, reqEditors...) } else { @@ -2129,6 +2801,10 @@ func (_m *ClientWithResponsesInterface) UpdateGcpClusterWithBodyWithResponse(ctx ret := _m.Called(_ca...) var r0 *astrocore.UpdateGcpClusterResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, string, string, io.Reader, ...astrocore.RequestEditorFn) (*astrocore.UpdateGcpClusterResponse, error)); ok { + return rf(ctx, orgShortNameId, clusterId, contentType, body, reqEditors...) + } if rf, ok := ret.Get(0).(func(context.Context, string, string, string, io.Reader, ...astrocore.RequestEditorFn) *astrocore.UpdateGcpClusterResponse); ok { r0 = rf(ctx, orgShortNameId, clusterId, contentType, body, reqEditors...) } else { @@ -2137,7 +2813,6 @@ func (_m *ClientWithResponsesInterface) UpdateGcpClusterWithBodyWithResponse(ctx } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, string, string, io.Reader, ...astrocore.RequestEditorFn) error); ok { r1 = rf(ctx, orgShortNameId, clusterId, contentType, body, reqEditors...) } else { @@ -2159,6 +2834,10 @@ func (_m *ClientWithResponsesInterface) UpdateGcpClusterWithResponse(ctx context ret := _m.Called(_ca...) var r0 *astrocore.UpdateGcpClusterResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, string, astrocore.UpdateGcpClusterRequest, ...astrocore.RequestEditorFn) (*astrocore.UpdateGcpClusterResponse, error)); ok { + return rf(ctx, orgShortNameId, clusterId, body, reqEditors...) + } if rf, ok := ret.Get(0).(func(context.Context, string, string, astrocore.UpdateGcpClusterRequest, ...astrocore.RequestEditorFn) *astrocore.UpdateGcpClusterResponse); ok { r0 = rf(ctx, orgShortNameId, clusterId, body, reqEditors...) } else { @@ -2167,7 +2846,6 @@ func (_m *ClientWithResponsesInterface) UpdateGcpClusterWithResponse(ctx context } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, string, astrocore.UpdateGcpClusterRequest, ...astrocore.RequestEditorFn) error); ok { r1 = rf(ctx, orgShortNameId, clusterId, body, reqEditors...) } else { @@ -2189,6 +2867,10 @@ func (_m *ClientWithResponsesInterface) UpdateManagedDomainWithBodyWithResponse( ret := _m.Called(_ca...) var r0 *astrocore.UpdateManagedDomainResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, string, string, io.Reader, ...astrocore.RequestEditorFn) (*astrocore.UpdateManagedDomainResponse, error)); ok { + return rf(ctx, orgShortNameId, domainId, contentType, body, reqEditors...) + } if rf, ok := ret.Get(0).(func(context.Context, string, string, string, io.Reader, ...astrocore.RequestEditorFn) *astrocore.UpdateManagedDomainResponse); ok { r0 = rf(ctx, orgShortNameId, domainId, contentType, body, reqEditors...) } else { @@ -2197,7 +2879,6 @@ func (_m *ClientWithResponsesInterface) UpdateManagedDomainWithBodyWithResponse( } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, string, string, io.Reader, ...astrocore.RequestEditorFn) error); ok { r1 = rf(ctx, orgShortNameId, domainId, contentType, body, reqEditors...) } else { @@ -2219,6 +2900,10 @@ func (_m *ClientWithResponsesInterface) UpdateManagedDomainWithResponse(ctx cont ret := _m.Called(_ca...) var r0 *astrocore.UpdateManagedDomainResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, string, astrocore.UpdateManagedDomainRequest, ...astrocore.RequestEditorFn) (*astrocore.UpdateManagedDomainResponse, error)); ok { + return rf(ctx, orgShortNameId, domainId, body, reqEditors...) + } if rf, ok := ret.Get(0).(func(context.Context, string, string, astrocore.UpdateManagedDomainRequest, ...astrocore.RequestEditorFn) *astrocore.UpdateManagedDomainResponse); ok { r0 = rf(ctx, orgShortNameId, domainId, body, reqEditors...) } else { @@ -2227,7 +2912,6 @@ func (_m *ClientWithResponsesInterface) UpdateManagedDomainWithResponse(ctx cont } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, string, astrocore.UpdateManagedDomainRequest, ...astrocore.RequestEditorFn) error); ok { r1 = rf(ctx, orgShortNameId, domainId, body, reqEditors...) } else { @@ -2237,6 +2921,72 @@ func (_m *ClientWithResponsesInterface) UpdateManagedDomainWithResponse(ctx cont return r0, r1 } +// UpdateOrganizationApiTokenWithBodyWithResponse provides a mock function with given fields: ctx, orgShortNameId, apiTokenId, contentType, body, reqEditors +func (_m *ClientWithResponsesInterface) UpdateOrganizationApiTokenWithBodyWithResponse(ctx context.Context, orgShortNameId string, apiTokenId string, contentType string, body io.Reader, reqEditors ...astrocore.RequestEditorFn) (*astrocore.UpdateOrganizationApiTokenResponse, error) { + _va := make([]interface{}, len(reqEditors)) + for _i := range reqEditors { + _va[_i] = reqEditors[_i] + } + var _ca []interface{} + _ca = append(_ca, ctx, orgShortNameId, apiTokenId, contentType, body) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + var r0 *astrocore.UpdateOrganizationApiTokenResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, string, string, io.Reader, ...astrocore.RequestEditorFn) (*astrocore.UpdateOrganizationApiTokenResponse, error)); ok { + return rf(ctx, orgShortNameId, apiTokenId, contentType, body, reqEditors...) + } + if rf, ok := ret.Get(0).(func(context.Context, string, string, string, io.Reader, ...astrocore.RequestEditorFn) *astrocore.UpdateOrganizationApiTokenResponse); ok { + r0 = rf(ctx, orgShortNameId, apiTokenId, contentType, body, reqEditors...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*astrocore.UpdateOrganizationApiTokenResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, string, string, string, io.Reader, ...astrocore.RequestEditorFn) error); ok { + r1 = rf(ctx, orgShortNameId, apiTokenId, contentType, body, reqEditors...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// UpdateOrganizationApiTokenWithResponse provides a mock function with given fields: ctx, orgShortNameId, apiTokenId, body, reqEditors +func (_m *ClientWithResponsesInterface) UpdateOrganizationApiTokenWithResponse(ctx context.Context, orgShortNameId string, apiTokenId string, body astrocore.UpdateOrganizationApiTokenRequest, reqEditors ...astrocore.RequestEditorFn) (*astrocore.UpdateOrganizationApiTokenResponse, error) { + _va := make([]interface{}, len(reqEditors)) + for _i := range reqEditors { + _va[_i] = reqEditors[_i] + } + var _ca []interface{} + _ca = append(_ca, ctx, orgShortNameId, apiTokenId, body) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + var r0 *astrocore.UpdateOrganizationApiTokenResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, string, astrocore.UpdateOrganizationApiTokenRequest, ...astrocore.RequestEditorFn) (*astrocore.UpdateOrganizationApiTokenResponse, error)); ok { + return rf(ctx, orgShortNameId, apiTokenId, body, reqEditors...) + } + if rf, ok := ret.Get(0).(func(context.Context, string, string, astrocore.UpdateOrganizationApiTokenRequest, ...astrocore.RequestEditorFn) *astrocore.UpdateOrganizationApiTokenResponse); ok { + r0 = rf(ctx, orgShortNameId, apiTokenId, body, reqEditors...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*astrocore.UpdateOrganizationApiTokenResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, string, string, astrocore.UpdateOrganizationApiTokenRequest, ...astrocore.RequestEditorFn) error); ok { + r1 = rf(ctx, orgShortNameId, apiTokenId, body, reqEditors...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + // UpdateOrganizationWithBodyWithResponse provides a mock function with given fields: ctx, orgShortNameId, contentType, body, reqEditors func (_m *ClientWithResponsesInterface) UpdateOrganizationWithBodyWithResponse(ctx context.Context, orgShortNameId string, contentType string, body io.Reader, reqEditors ...astrocore.RequestEditorFn) (*astrocore.UpdateOrganizationResponse, error) { _va := make([]interface{}, len(reqEditors)) @@ -2249,6 +2999,10 @@ func (_m *ClientWithResponsesInterface) UpdateOrganizationWithBodyWithResponse(c ret := _m.Called(_ca...) var r0 *astrocore.UpdateOrganizationResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, string, io.Reader, ...astrocore.RequestEditorFn) (*astrocore.UpdateOrganizationResponse, error)); ok { + return rf(ctx, orgShortNameId, contentType, body, reqEditors...) + } if rf, ok := ret.Get(0).(func(context.Context, string, string, io.Reader, ...astrocore.RequestEditorFn) *astrocore.UpdateOrganizationResponse); ok { r0 = rf(ctx, orgShortNameId, contentType, body, reqEditors...) } else { @@ -2257,7 +3011,6 @@ func (_m *ClientWithResponsesInterface) UpdateOrganizationWithBodyWithResponse(c } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, string, io.Reader, ...astrocore.RequestEditorFn) error); ok { r1 = rf(ctx, orgShortNameId, contentType, body, reqEditors...) } else { @@ -2279,6 +3032,10 @@ func (_m *ClientWithResponsesInterface) UpdateOrganizationWithResponse(ctx conte ret := _m.Called(_ca...) var r0 *astrocore.UpdateOrganizationResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, astrocore.UpdateOrganizationRequest, ...astrocore.RequestEditorFn) (*astrocore.UpdateOrganizationResponse, error)); ok { + return rf(ctx, orgShortNameId, body, reqEditors...) + } if rf, ok := ret.Get(0).(func(context.Context, string, astrocore.UpdateOrganizationRequest, ...astrocore.RequestEditorFn) *astrocore.UpdateOrganizationResponse); ok { r0 = rf(ctx, orgShortNameId, body, reqEditors...) } else { @@ -2287,7 +3044,6 @@ func (_m *ClientWithResponsesInterface) UpdateOrganizationWithResponse(ctx conte } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, astrocore.UpdateOrganizationRequest, ...astrocore.RequestEditorFn) error); ok { r1 = rf(ctx, orgShortNameId, body, reqEditors...) } else { @@ -2309,6 +3065,10 @@ func (_m *ClientWithResponsesInterface) UpdateSelfUserInviteWithBodyWithResponse ret := _m.Called(_ca...) var r0 *astrocore.UpdateSelfUserInviteResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, string, io.Reader, ...astrocore.RequestEditorFn) (*astrocore.UpdateSelfUserInviteResponse, error)); ok { + return rf(ctx, inviteId, contentType, body, reqEditors...) + } if rf, ok := ret.Get(0).(func(context.Context, string, string, io.Reader, ...astrocore.RequestEditorFn) *astrocore.UpdateSelfUserInviteResponse); ok { r0 = rf(ctx, inviteId, contentType, body, reqEditors...) } else { @@ -2317,7 +3077,6 @@ func (_m *ClientWithResponsesInterface) UpdateSelfUserInviteWithBodyWithResponse } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, string, io.Reader, ...astrocore.RequestEditorFn) error); ok { r1 = rf(ctx, inviteId, contentType, body, reqEditors...) } else { @@ -2339,6 +3098,10 @@ func (_m *ClientWithResponsesInterface) UpdateSelfUserInviteWithResponse(ctx con ret := _m.Called(_ca...) var r0 *astrocore.UpdateSelfUserInviteResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, astrocore.UpdateInviteRequest, ...astrocore.RequestEditorFn) (*astrocore.UpdateSelfUserInviteResponse, error)); ok { + return rf(ctx, inviteId, body, reqEditors...) + } if rf, ok := ret.Get(0).(func(context.Context, string, astrocore.UpdateInviteRequest, ...astrocore.RequestEditorFn) *astrocore.UpdateSelfUserInviteResponse); ok { r0 = rf(ctx, inviteId, body, reqEditors...) } else { @@ -2347,7 +3110,6 @@ func (_m *ClientWithResponsesInterface) UpdateSelfUserInviteWithResponse(ctx con } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, astrocore.UpdateInviteRequest, ...astrocore.RequestEditorFn) error); ok { r1 = rf(ctx, inviteId, body, reqEditors...) } else { @@ -2369,6 +3131,10 @@ func (_m *ClientWithResponsesInterface) UpdateSsoConnectionWithBodyWithResponse( ret := _m.Called(_ca...) var r0 *astrocore.UpdateSsoConnectionResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, string, string, io.Reader, ...astrocore.RequestEditorFn) (*astrocore.UpdateSsoConnectionResponse, error)); ok { + return rf(ctx, orgShortNameId, connectionId, contentType, body, reqEditors...) + } if rf, ok := ret.Get(0).(func(context.Context, string, string, string, io.Reader, ...astrocore.RequestEditorFn) *astrocore.UpdateSsoConnectionResponse); ok { r0 = rf(ctx, orgShortNameId, connectionId, contentType, body, reqEditors...) } else { @@ -2377,7 +3143,6 @@ func (_m *ClientWithResponsesInterface) UpdateSsoConnectionWithBodyWithResponse( } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, string, string, io.Reader, ...astrocore.RequestEditorFn) error); ok { r1 = rf(ctx, orgShortNameId, connectionId, contentType, body, reqEditors...) } else { @@ -2399,6 +3164,10 @@ func (_m *ClientWithResponsesInterface) UpdateSsoConnectionWithResponse(ctx cont ret := _m.Called(_ca...) var r0 *astrocore.UpdateSsoConnectionResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, string, astrocore.UpdateSsoConnectionRequest, ...astrocore.RequestEditorFn) (*astrocore.UpdateSsoConnectionResponse, error)); ok { + return rf(ctx, orgShortNameId, connectionId, body, reqEditors...) + } if rf, ok := ret.Get(0).(func(context.Context, string, string, astrocore.UpdateSsoConnectionRequest, ...astrocore.RequestEditorFn) *astrocore.UpdateSsoConnectionResponse); ok { r0 = rf(ctx, orgShortNameId, connectionId, body, reqEditors...) } else { @@ -2407,7 +3176,6 @@ func (_m *ClientWithResponsesInterface) UpdateSsoConnectionWithResponse(ctx cont } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, string, astrocore.UpdateSsoConnectionRequest, ...astrocore.RequestEditorFn) error); ok { r1 = rf(ctx, orgShortNameId, connectionId, body, reqEditors...) } else { @@ -2429,6 +3197,10 @@ func (_m *ClientWithResponsesInterface) UpdateTeamWithBodyWithResponse(ctx conte ret := _m.Called(_ca...) var r0 *astrocore.UpdateTeamResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, string, string, io.Reader, ...astrocore.RequestEditorFn) (*astrocore.UpdateTeamResponse, error)); ok { + return rf(ctx, orgShortNameId, teamId, contentType, body, reqEditors...) + } if rf, ok := ret.Get(0).(func(context.Context, string, string, string, io.Reader, ...astrocore.RequestEditorFn) *astrocore.UpdateTeamResponse); ok { r0 = rf(ctx, orgShortNameId, teamId, contentType, body, reqEditors...) } else { @@ -2437,7 +3209,6 @@ func (_m *ClientWithResponsesInterface) UpdateTeamWithBodyWithResponse(ctx conte } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, string, string, io.Reader, ...astrocore.RequestEditorFn) error); ok { r1 = rf(ctx, orgShortNameId, teamId, contentType, body, reqEditors...) } else { @@ -2459,6 +3230,10 @@ func (_m *ClientWithResponsesInterface) UpdateTeamWithResponse(ctx context.Conte ret := _m.Called(_ca...) var r0 *astrocore.UpdateTeamResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, string, astrocore.UpdateTeamRequest, ...astrocore.RequestEditorFn) (*astrocore.UpdateTeamResponse, error)); ok { + return rf(ctx, orgShortNameId, teamId, body, reqEditors...) + } if rf, ok := ret.Get(0).(func(context.Context, string, string, astrocore.UpdateTeamRequest, ...astrocore.RequestEditorFn) *astrocore.UpdateTeamResponse); ok { r0 = rf(ctx, orgShortNameId, teamId, body, reqEditors...) } else { @@ -2467,7 +3242,6 @@ func (_m *ClientWithResponsesInterface) UpdateTeamWithResponse(ctx context.Conte } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, string, astrocore.UpdateTeamRequest, ...astrocore.RequestEditorFn) error); ok { r1 = rf(ctx, orgShortNameId, teamId, body, reqEditors...) } else { @@ -2477,6 +3251,72 @@ func (_m *ClientWithResponsesInterface) UpdateTeamWithResponse(ctx context.Conte return r0, r1 } +// UpdateWorkspaceApiTokenWithBodyWithResponse provides a mock function with given fields: ctx, orgShortNameId, workspaceId, apiTokenId, contentType, body, reqEditors +func (_m *ClientWithResponsesInterface) UpdateWorkspaceApiTokenWithBodyWithResponse(ctx context.Context, orgShortNameId string, workspaceId string, apiTokenId string, contentType string, body io.Reader, reqEditors ...astrocore.RequestEditorFn) (*astrocore.UpdateWorkspaceApiTokenResponse, error) { + _va := make([]interface{}, len(reqEditors)) + for _i := range reqEditors { + _va[_i] = reqEditors[_i] + } + var _ca []interface{} + _ca = append(_ca, ctx, orgShortNameId, workspaceId, apiTokenId, contentType, body) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + var r0 *astrocore.UpdateWorkspaceApiTokenResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, string, string, string, io.Reader, ...astrocore.RequestEditorFn) (*astrocore.UpdateWorkspaceApiTokenResponse, error)); ok { + return rf(ctx, orgShortNameId, workspaceId, apiTokenId, contentType, body, reqEditors...) + } + if rf, ok := ret.Get(0).(func(context.Context, string, string, string, string, io.Reader, ...astrocore.RequestEditorFn) *astrocore.UpdateWorkspaceApiTokenResponse); ok { + r0 = rf(ctx, orgShortNameId, workspaceId, apiTokenId, contentType, body, reqEditors...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*astrocore.UpdateWorkspaceApiTokenResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, string, string, string, string, io.Reader, ...astrocore.RequestEditorFn) error); ok { + r1 = rf(ctx, orgShortNameId, workspaceId, apiTokenId, contentType, body, reqEditors...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// UpdateWorkspaceApiTokenWithResponse provides a mock function with given fields: ctx, orgShortNameId, workspaceId, apiTokenId, body, reqEditors +func (_m *ClientWithResponsesInterface) UpdateWorkspaceApiTokenWithResponse(ctx context.Context, orgShortNameId string, workspaceId string, apiTokenId string, body astrocore.UpdateWorkspaceApiTokenRequest, reqEditors ...astrocore.RequestEditorFn) (*astrocore.UpdateWorkspaceApiTokenResponse, error) { + _va := make([]interface{}, len(reqEditors)) + for _i := range reqEditors { + _va[_i] = reqEditors[_i] + } + var _ca []interface{} + _ca = append(_ca, ctx, orgShortNameId, workspaceId, apiTokenId, body) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + var r0 *astrocore.UpdateWorkspaceApiTokenResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, string, string, astrocore.UpdateWorkspaceApiTokenRequest, ...astrocore.RequestEditorFn) (*astrocore.UpdateWorkspaceApiTokenResponse, error)); ok { + return rf(ctx, orgShortNameId, workspaceId, apiTokenId, body, reqEditors...) + } + if rf, ok := ret.Get(0).(func(context.Context, string, string, string, astrocore.UpdateWorkspaceApiTokenRequest, ...astrocore.RequestEditorFn) *astrocore.UpdateWorkspaceApiTokenResponse); ok { + r0 = rf(ctx, orgShortNameId, workspaceId, apiTokenId, body, reqEditors...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*astrocore.UpdateWorkspaceApiTokenResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, string, string, string, astrocore.UpdateWorkspaceApiTokenRequest, ...astrocore.RequestEditorFn) error); ok { + r1 = rf(ctx, orgShortNameId, workspaceId, apiTokenId, body, reqEditors...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + // UpdateWorkspaceWithBodyWithResponse provides a mock function with given fields: ctx, orgShortNameId, workspaceId, contentType, body, reqEditors func (_m *ClientWithResponsesInterface) UpdateWorkspaceWithBodyWithResponse(ctx context.Context, orgShortNameId string, workspaceId string, contentType string, body io.Reader, reqEditors ...astrocore.RequestEditorFn) (*astrocore.UpdateWorkspaceResponse, error) { _va := make([]interface{}, len(reqEditors)) @@ -2489,6 +3329,10 @@ func (_m *ClientWithResponsesInterface) UpdateWorkspaceWithBodyWithResponse(ctx ret := _m.Called(_ca...) var r0 *astrocore.UpdateWorkspaceResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, string, string, io.Reader, ...astrocore.RequestEditorFn) (*astrocore.UpdateWorkspaceResponse, error)); ok { + return rf(ctx, orgShortNameId, workspaceId, contentType, body, reqEditors...) + } if rf, ok := ret.Get(0).(func(context.Context, string, string, string, io.Reader, ...astrocore.RequestEditorFn) *astrocore.UpdateWorkspaceResponse); ok { r0 = rf(ctx, orgShortNameId, workspaceId, contentType, body, reqEditors...) } else { @@ -2497,7 +3341,6 @@ func (_m *ClientWithResponsesInterface) UpdateWorkspaceWithBodyWithResponse(ctx } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, string, string, io.Reader, ...astrocore.RequestEditorFn) error); ok { r1 = rf(ctx, orgShortNameId, workspaceId, contentType, body, reqEditors...) } else { @@ -2519,6 +3362,10 @@ func (_m *ClientWithResponsesInterface) UpdateWorkspaceWithResponse(ctx context. ret := _m.Called(_ca...) var r0 *astrocore.UpdateWorkspaceResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, string, astrocore.MutateWorkspaceRequest, ...astrocore.RequestEditorFn) (*astrocore.UpdateWorkspaceResponse, error)); ok { + return rf(ctx, orgShortNameId, workspaceId, body, reqEditors...) + } if rf, ok := ret.Get(0).(func(context.Context, string, string, astrocore.MutateWorkspaceRequest, ...astrocore.RequestEditorFn) *astrocore.UpdateWorkspaceResponse); ok { r0 = rf(ctx, orgShortNameId, workspaceId, body, reqEditors...) } else { @@ -2527,7 +3374,6 @@ func (_m *ClientWithResponsesInterface) UpdateWorkspaceWithResponse(ctx context. } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, string, astrocore.MutateWorkspaceRequest, ...astrocore.RequestEditorFn) error); ok { r1 = rf(ctx, orgShortNameId, workspaceId, body, reqEditors...) } else { @@ -2549,6 +3395,10 @@ func (_m *ClientWithResponsesInterface) UpsertSsoBypassKeyWithResponse(ctx conte ret := _m.Called(_ca...) var r0 *astrocore.UpsertSsoBypassKeyResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, ...astrocore.RequestEditorFn) (*astrocore.UpsertSsoBypassKeyResponse, error)); ok { + return rf(ctx, orgShortNameId, reqEditors...) + } if rf, ok := ret.Get(0).(func(context.Context, string, ...astrocore.RequestEditorFn) *astrocore.UpsertSsoBypassKeyResponse); ok { r0 = rf(ctx, orgShortNameId, reqEditors...) } else { @@ -2557,7 +3407,6 @@ func (_m *ClientWithResponsesInterface) UpsertSsoBypassKeyWithResponse(ctx conte } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, ...astrocore.RequestEditorFn) error); ok { r1 = rf(ctx, orgShortNameId, reqEditors...) } else { @@ -2579,6 +3428,10 @@ func (_m *ClientWithResponsesInterface) ValidateCreditCardPaymentWithBodyWithRes ret := _m.Called(_ca...) var r0 *astrocore.ValidateCreditCardPaymentResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, string, io.Reader, ...astrocore.RequestEditorFn) (*astrocore.ValidateCreditCardPaymentResponse, error)); ok { + return rf(ctx, orgShortNameId, contentType, body, reqEditors...) + } if rf, ok := ret.Get(0).(func(context.Context, string, string, io.Reader, ...astrocore.RequestEditorFn) *astrocore.ValidateCreditCardPaymentResponse); ok { r0 = rf(ctx, orgShortNameId, contentType, body, reqEditors...) } else { @@ -2587,7 +3440,6 @@ func (_m *ClientWithResponsesInterface) ValidateCreditCardPaymentWithBodyWithRes } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, string, io.Reader, ...astrocore.RequestEditorFn) error); ok { r1 = rf(ctx, orgShortNameId, contentType, body, reqEditors...) } else { @@ -2609,6 +3461,10 @@ func (_m *ClientWithResponsesInterface) ValidateCreditCardPaymentWithResponse(ct ret := _m.Called(_ca...) var r0 *astrocore.ValidateCreditCardPaymentResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, astrocore.ValidateCreditCardPaymentRequest, ...astrocore.RequestEditorFn) (*astrocore.ValidateCreditCardPaymentResponse, error)); ok { + return rf(ctx, orgShortNameId, body, reqEditors...) + } if rf, ok := ret.Get(0).(func(context.Context, string, astrocore.ValidateCreditCardPaymentRequest, ...astrocore.RequestEditorFn) *astrocore.ValidateCreditCardPaymentResponse); ok { r0 = rf(ctx, orgShortNameId, body, reqEditors...) } else { @@ -2617,7 +3473,6 @@ func (_m *ClientWithResponsesInterface) ValidateCreditCardPaymentWithResponse(ct } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, astrocore.ValidateCreditCardPaymentRequest, ...astrocore.RequestEditorFn) error); ok { r1 = rf(ctx, orgShortNameId, body, reqEditors...) } else { @@ -2639,6 +3494,10 @@ func (_m *ClientWithResponsesInterface) ValidateSsoLoginWithBodyWithResponse(ctx ret := _m.Called(_ca...) var r0 *astrocore.ValidateSsoLoginResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, io.Reader, ...astrocore.RequestEditorFn) (*astrocore.ValidateSsoLoginResponse, error)); ok { + return rf(ctx, contentType, body, reqEditors...) + } if rf, ok := ret.Get(0).(func(context.Context, string, io.Reader, ...astrocore.RequestEditorFn) *astrocore.ValidateSsoLoginResponse); ok { r0 = rf(ctx, contentType, body, reqEditors...) } else { @@ -2647,7 +3506,6 @@ func (_m *ClientWithResponsesInterface) ValidateSsoLoginWithBodyWithResponse(ctx } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, io.Reader, ...astrocore.RequestEditorFn) error); ok { r1 = rf(ctx, contentType, body, reqEditors...) } else { @@ -2669,6 +3527,10 @@ func (_m *ClientWithResponsesInterface) ValidateSsoLoginWithResponse(ctx context ret := _m.Called(_ca...) var r0 *astrocore.ValidateSsoLoginResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, astrocore.ValidateSsoLoginRequest, ...astrocore.RequestEditorFn) (*astrocore.ValidateSsoLoginResponse, error)); ok { + return rf(ctx, body, reqEditors...) + } if rf, ok := ret.Get(0).(func(context.Context, astrocore.ValidateSsoLoginRequest, ...astrocore.RequestEditorFn) *astrocore.ValidateSsoLoginResponse); ok { r0 = rf(ctx, body, reqEditors...) } else { @@ -2677,7 +3539,6 @@ func (_m *ClientWithResponsesInterface) ValidateSsoLoginWithResponse(ctx context } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, astrocore.ValidateSsoLoginRequest, ...astrocore.RequestEditorFn) error); ok { r1 = rf(ctx, body, reqEditors...) } else { @@ -2699,6 +3560,10 @@ func (_m *ClientWithResponsesInterface) VerifyManagedDomainWithResponse(ctx cont ret := _m.Called(_ca...) var r0 *astrocore.VerifyManagedDomainResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, string, ...astrocore.RequestEditorFn) (*astrocore.VerifyManagedDomainResponse, error)); ok { + return rf(ctx, orgShortNameId, domainId, reqEditors...) + } if rf, ok := ret.Get(0).(func(context.Context, string, string, ...astrocore.RequestEditorFn) *astrocore.VerifyManagedDomainResponse); ok { r0 = rf(ctx, orgShortNameId, domainId, reqEditors...) } else { @@ -2707,7 +3572,6 @@ func (_m *ClientWithResponsesInterface) VerifyManagedDomainWithResponse(ctx cont } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, string, ...astrocore.RequestEditorFn) error); ok { r1 = rf(ctx, orgShortNameId, domainId, reqEditors...) } else { diff --git a/astro-client/mocks/Client.go b/astro-client/mocks/Client.go index 696f73299..7cdf5a09c 100644 --- a/astro-client/mocks/Client.go +++ b/astro-client/mocks/Client.go @@ -285,32 +285,6 @@ func (_m *Client) InitiateDagDeployment(input astro.InitiateDagDeploymentInput) return r0, r1 } -// ListClusters provides a mock function with given fields: organizationID -func (_m *Client) ListClusters(organizationID string) ([]astro.Cluster, error) { - ret := _m.Called(organizationID) - - var r0 []astro.Cluster - var r1 error - if rf, ok := ret.Get(0).(func(string) ([]astro.Cluster, error)); ok { - return rf(organizationID) - } - if rf, ok := ret.Get(0).(func(string) []astro.Cluster); ok { - r0 = rf(organizationID) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).([]astro.Cluster) - } - } - - if rf, ok := ret.Get(1).(func(string) error); ok { - r1 = rf(organizationID) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - // ListDeployments provides a mock function with given fields: organizationID, workspaceID func (_m *Client) ListDeployments(organizationID string, workspaceID string) ([]astro.Deployment, error) { ret := _m.Called(organizationID, workspaceID) diff --git a/cloud/organization/organization_token.go b/cloud/organization/organization_token.go new file mode 100644 index 000000000..5ac8312f4 --- /dev/null +++ b/cloud/organization/organization_token.go @@ -0,0 +1,192 @@ +package organization + +import ( + httpContext "context" + "errors" + "fmt" + "io" + "os" + "strconv" + + astrocore "github.com/astronomer/astro-cli/astro-client-core" + "github.com/astronomer/astro-cli/cloud/user" + "github.com/astronomer/astro-cli/context" + "github.com/astronomer/astro-cli/pkg/input" + "github.com/astronomer/astro-cli/pkg/printutil" +) + +var ( + errInvalidOrganizationTokenKey = errors.New("invalid Organization API token selection") + errOrganizationTokenNotFound = errors.New("organization token specified was not found") + errOrgTokenInWorkspace = errors.New("this Organization API token has already been added to the Workspace") + errBothNameAndID = errors.New("both an API token name and id were specified. Specify either the name or the id not both") +) + +const ( + workspaceEntity = "WORKSPACE" +) + +func newTokenSelectionTableOut() *printutil.Table { + return &printutil.Table{ + Padding: []int{44, 50}, + DynamicPadding: true, + Header: []string{"#", "NAME", "DESCRIPTION", "EXPIRES"}, + } +} + +func AddOrgTokenToWorkspace(id, name, role, workspace string, out io.Writer, client astrocore.CoreClient) error { + err := user.IsWorkspaceRoleValid(role) + if err != nil { + return err + } + ctx, err := context.GetCurrentContext() + if err != nil { + return err + } + if ctx.OrganizationShortName == "" { + return user.ErrNoShortName + } + if workspace == "" { + workspace = ctx.Workspace + } + tokens, err := getOrganizationTokens(client) + if err != nil { + return err + } + token, err := getOrganizationToken(id, name, "\nPlease select the Organization API token you would like to add to the Workspace:", tokens) + if err != nil { + return err + } + apiTokenID := token.Id + + var orgRole string + for i := range token.Roles { + if token.Roles[i].EntityId == workspaceEntity { + return errOrgTokenInWorkspace + } + + if token.Roles[i].EntityId == ctx.Organization { + orgRole = token.Roles[i].Role + } + } + + apiTokenWorkspaceRole := astrocore.ApiTokenWorkspaceRole{ + EntityId: workspace, + Role: role, + } + apiTokenWorkspaceRoles := []astrocore.ApiTokenWorkspaceRole{apiTokenWorkspaceRole} + + updateOrganizationAPITokenRoles := astrocore.UpdateOrganizationApiTokenRoles{ + Organization: orgRole, + Workspace: &apiTokenWorkspaceRoles, + } + updateOrganizationAPITokenRequest := astrocore.UpdateOrganizationApiTokenRequest{ + Name: token.Name, + Description: token.Description, + Roles: updateOrganizationAPITokenRoles, + } + + resp, err := client.UpdateOrganizationApiTokenWithResponse(httpContext.Background(), ctx.OrganizationShortName, apiTokenID, updateOrganizationAPITokenRequest) + if err != nil { + return err + } + err = astrocore.NormalizeAPIError(resp.HTTPResponse, resp.Body) + if err != nil { + return err + } + fmt.Fprintf(out, "Astro Organization API token %s was successfully added to the Workspace\n", token.Name) + return nil +} + +func selectTokens(apiTokens []astrocore.ApiToken) (astrocore.ApiToken, error) { + apiTokensMap := map[string]astrocore.ApiToken{} + tab := newTokenSelectionTableOut() + for i := range apiTokens { + name := apiTokens[i].Name + description := apiTokens[i].Description + expires := apiTokens[i].ExpiryPeriodInDays + + index := i + 1 + tab.AddRow([]string{ + strconv.Itoa(index), + name, + description, + fmt.Sprint(expires), + }, false) + apiTokensMap[strconv.Itoa(index)] = apiTokens[i] + } + + tab.Print(os.Stdout) + choice := input.Text("\n> ") + selected, ok := apiTokensMap[choice] + if !ok { + return astrocore.ApiToken{}, errInvalidOrganizationTokenKey + } + return selected, nil +} + +func getOrganizationToken(id, name, message string, tokens []astrocore.ApiToken) (token astrocore.ApiToken, err error) { //nolint:gocognit + switch { + case id == "" && name == "": + fmt.Println(message) + token, err = selectTokens(tokens) + if err != nil { + return astrocore.ApiToken{}, err + } + case name == "" && id != "": + for i := range tokens { + if tokens[i].Id == id { + token = tokens[i] + } + } + if token.Id == "" { + return astrocore.ApiToken{}, errOrganizationTokenNotFound + } + case name != "" && id == "": + var matchedTokens []astrocore.ApiToken + for i := range tokens { + if tokens[i].Name == name { + matchedTokens = append(matchedTokens, tokens[i]) + } + } + if len(matchedTokens) == 1 { + token = matchedTokens[0] + } else if len(matchedTokens) > 1 { + fmt.Printf("\nThere are more than one API tokens with name %s. Please select an API token:\n", name) + token, err = selectTokens(matchedTokens) + if err != nil { + return astrocore.ApiToken{}, err + } + } + case name != "" && id != "": + return astrocore.ApiToken{}, errBothNameAndID + } + if token.Id == "" { + return astrocore.ApiToken{}, errOrganizationTokenNotFound + } + return token, nil +} + +// get all organization tokens +func getOrganizationTokens(client astrocore.CoreClient) ([]astrocore.ApiToken, error) { + ctx, err := context.GetCurrentContext() + if err != nil { + return []astrocore.ApiToken{}, err + } + if ctx.OrganizationShortName == "" { + return []astrocore.ApiToken{}, user.ErrNoShortName + } + + resp, err := client.ListOrganizationApiTokensWithResponse(httpContext.Background(), ctx.OrganizationShortName, &astrocore.ListOrganizationApiTokensParams{}) + if err != nil { + return []astrocore.ApiToken{}, err + } + err = astrocore.NormalizeAPIError(resp.HTTPResponse, resp.Body) + if err != nil { + return []astrocore.ApiToken{}, err + } + + APITokens := resp.JSON200.ApiTokens + + return APITokens, nil +} diff --git a/cloud/organization/organization_token_test.go b/cloud/organization/organization_token_test.go new file mode 100644 index 000000000..fbd2fb65e --- /dev/null +++ b/cloud/organization/organization_token_test.go @@ -0,0 +1,199 @@ +package organization + +import ( + "bytes" + "encoding/json" + "net/http" + "os" + "testing" + "time" + + astrocore "github.com/astronomer/astro-cli/astro-client-core" + astrocore_mocks "github.com/astronomer/astro-cli/astro-client-core/mocks" + "github.com/astronomer/astro-cli/cloud/user" + testUtil "github.com/astronomer/astro-cli/pkg/testing" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" +) + +var ( + description1 = "Description 1" + description2 = "Description 2" + fullName1 = "User 1" + fullName2 = "User 2" + token = "token" + apiToken1 = astrocore.ApiToken{Id: "token1", Name: "Token 1", Token: &token, Description: description1, Type: "Type 1", Roles: []astrocore.ApiTokenRole{{EntityId: "WORKSPACE", Role: "WORKSPACE_MEMBER"}, {EntityId: "ORGANIZATION", Role: "ORGANIZATION_MEMBER"}}, CreatedAt: time.Now(), CreatedBy: &astrocore.BasicSubjectProfile{FullName: &fullName1}} + apiToken2 = astrocore.ApiToken{Id: "token1", Name: "Token 1", Token: &token, Description: description1, Type: "Type 1", Roles: []astrocore.ApiTokenRole{{EntityId: "ORGANIZATION", Role: "ORGANIZATION_MEMBER"}}, CreatedAt: time.Now(), CreatedBy: &astrocore.BasicSubjectProfile{FullName: &fullName1}} + apiTokens = []astrocore.ApiToken{ + apiToken1, + {Id: "token2", Name: "Token 2", Description: description2, Type: "Type 2", Roles: []astrocore.ApiTokenRole{{EntityId: "ORGANIZATION", Role: "ORGANIZATION_MEMBER"}}, CreatedAt: time.Now(), CreatedBy: &astrocore.BasicSubjectProfile{FullName: &fullName2}}, + } + apiTokens2 = []astrocore.ApiToken{ + apiToken1, + apiToken2, + } + ListOrganizationAPITokensResponseOK = astrocore.ListOrganizationApiTokensResponse{ + HTTPResponse: &http.Response{ + StatusCode: 200, + }, + JSON200: &astrocore.ListApiTokensPaginated{ + ApiTokens: apiTokens, + Limit: 1, + Offset: 0, + }, + } + ListOrganizationAPITokensResponse2OK = astrocore.ListOrganizationApiTokensResponse{ + HTTPResponse: &http.Response{ + StatusCode: 200, + }, + JSON200: &astrocore.ListApiTokensPaginated{ + ApiTokens: apiTokens2, + Limit: 1, + Offset: 0, + }, + } + errorBodyList, _ = json.Marshal(astrocore.Error{ + Message: "failed to list tokens", + }) + ListOrganizationAPITokensResponseError = astrocore.ListOrganizationApiTokensResponse{ + HTTPResponse: &http.Response{ + StatusCode: 500, + }, + Body: errorBodyList, + JSON200: nil, + } + UpdateOrganizationAPITokenResponseOK = astrocore.UpdateOrganizationApiTokenResponse{ + HTTPResponse: &http.Response{ + StatusCode: 200, + }, + JSON200: &apiToken1, + } + errorBodyUpdate, _ = json.Marshal(astrocore.Error{ + Message: "failed to update tokens", + }) + UpdateOrganizationAPITokenResponseError = astrocore.UpdateOrganizationApiTokenResponse{ + HTTPResponse: &http.Response{ + StatusCode: 500, + }, + Body: errorBodyUpdate, + JSON200: nil, + } +) + +func TestAddOrgTokenToWorkspace(t *testing.T) { + var ( + workspace = "testWorkspace" + role = "WORKSPACE_MEMBER" + selectedTokenID = "token1" + selectedTokenName = "Token 1" + selectedTokenID2 = "token2" + ) + + t.Run("return error for invalid workspace role", func(t *testing.T) { + testUtil.InitTestConfig(testUtil.CloudPlatform) + err := AddOrgTokenToWorkspace(selectedTokenID, selectedTokenName, "INVALID_ROLE", workspace, nil, nil) + assert.Error(t, err) + assert.Equal(t, user.ErrInvalidWorkspaceRole, err) + }) + + t.Run("return error for failed to get current context", func(t *testing.T) { + testUtil.InitTestConfig(testUtil.Initial) + mockClient := new(astrocore_mocks.ClientWithResponsesInterface) + err := AddOrgTokenToWorkspace(selectedTokenID, selectedTokenName, role, workspace, nil, mockClient) + assert.Error(t, err) + }) + + t.Run("return error for failed to list organization tokens", func(t *testing.T) { + testUtil.InitTestConfig(testUtil.CloudPlatform) + mockClient := new(astrocore_mocks.ClientWithResponsesInterface) + mockClient.On("ListOrganizationApiTokensWithResponse", mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(&ListOrganizationAPITokensResponseError, nil) + + err := AddOrgTokenToWorkspace(selectedTokenID, selectedTokenName, role, workspace, nil, mockClient) + assert.Error(t, err) + assert.ErrorContains(t, err, "failed to list tokens") + }) + + t.Run("return error for failed to select organization token", func(t *testing.T) { + testUtil.InitTestConfig(testUtil.CloudPlatform) + mockClient := new(astrocore_mocks.ClientWithResponsesInterface) + mockClient.On("ListOrganizationApiTokensWithResponse", mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(&ListOrganizationAPITokensResponseOK, nil) + mockClient.On("UpdateOrganizationApiTokenWithResponse", mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(&UpdateOrganizationAPITokenResponseOK, nil) + + err := AddOrgTokenToWorkspace("INVALID_ID", "", role, workspace, nil, mockClient) + assert.Error(t, err) + assert.Equal(t, errOrganizationTokenNotFound, err) + }) + + t.Run("return error for specifying both name and id", func(t *testing.T) { + testUtil.InitTestConfig(testUtil.CloudPlatform) + mockClient := new(astrocore_mocks.ClientWithResponsesInterface) + mockClient.On("ListOrganizationApiTokensWithResponse", mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(&ListOrganizationAPITokensResponseOK, nil) + + err := AddOrgTokenToWorkspace(selectedTokenID, selectedTokenName, role, workspace, nil, mockClient) + assert.Error(t, err) + assert.Equal(t, errBothNameAndID, err) + }) + + t.Run("return error for organization token already in workspace", func(t *testing.T) { + testUtil.InitTestConfig(testUtil.CloudPlatform) + mockClient := new(astrocore_mocks.ClientWithResponsesInterface) + mockClient.On("ListOrganizationApiTokensWithResponse", mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(&ListOrganizationAPITokensResponseOK, nil) + + err := AddOrgTokenToWorkspace(selectedTokenID, "", role, workspace, nil, mockClient) + assert.Error(t, err) + assert.Equal(t, errOrgTokenInWorkspace, err) + }) + + t.Run("successfully add organization token to workspace", func(t *testing.T) { + testUtil.InitTestConfig(testUtil.CloudPlatform) + out := new(bytes.Buffer) + mockClient := new(astrocore_mocks.ClientWithResponsesInterface) + mockClient.On("ListOrganizationApiTokensWithResponse", mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(&ListOrganizationAPITokensResponseOK, nil) + mockClient.On("UpdateOrganizationApiTokenWithResponse", mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(&UpdateOrganizationAPITokenResponseOK, nil) + + err := AddOrgTokenToWorkspace(selectedTokenID2, "", role, workspace, out, mockClient) + assert.NoError(t, err) + }) + + t.Run("successfully select and add organization token to workspace", func(t *testing.T) { + testUtil.InitTestConfig(testUtil.CloudPlatform) + out := new(bytes.Buffer) + mockClient := new(astrocore_mocks.ClientWithResponsesInterface) + mockClient.On("ListOrganizationApiTokensWithResponse", mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(&ListOrganizationAPITokensResponseOK, nil) + mockClient.On("UpdateOrganizationApiTokenWithResponse", mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(&UpdateOrganizationAPITokenResponseOK, nil) + // mock os.Stdin + expectedInput := []byte("2") + r, w, err := os.Pipe() + assert.NoError(t, err) + _, err = w.Write(expectedInput) + assert.NoError(t, err) + w.Close() + stdin := os.Stdin + // Restore stdin right after the test. + defer func() { os.Stdin = stdin }() + os.Stdin = r + err = AddOrgTokenToWorkspace("", "", role, workspace, out, mockClient) + assert.NoError(t, err) + }) + + t.Run("successfully select and add organization token to workspace", func(t *testing.T) { + testUtil.InitTestConfig(testUtil.CloudPlatform) + out := new(bytes.Buffer) + mockClient := new(astrocore_mocks.ClientWithResponsesInterface) + mockClient.On("ListOrganizationApiTokensWithResponse", mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(&ListOrganizationAPITokensResponse2OK, nil) + mockClient.On("UpdateOrganizationApiTokenWithResponse", mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(&UpdateOrganizationAPITokenResponseOK, nil) + // mock os.Stdin + expectedInput := []byte("2") + r, w, err := os.Pipe() + assert.NoError(t, err) + _, err = w.Write(expectedInput) + assert.NoError(t, err) + w.Close() + stdin := os.Stdin + // Restore stdin right after the test. + defer func() { os.Stdin = stdin }() + os.Stdin = r + err = AddOrgTokenToWorkspace("", selectedTokenName, role, workspace, out, mockClient) + assert.NoError(t, err) + }) +} diff --git a/cloud/workspace/workspace.go b/cloud/workspace/workspace.go index 87e77ed80..9b257b9ac 100644 --- a/cloud/workspace/workspace.go +++ b/cloud/workspace/workspace.go @@ -119,7 +119,6 @@ var GetWorkspaceSelection = func(client astro.Client, out io.Writer) (string, er return selected.ID, nil } -// Switch switches workspaces func Switch(id string, client astro.Client, out io.Writer) error { if id == "" { _id, err := GetWorkspaceSelection(client, out) @@ -177,7 +176,6 @@ func validateEnforceCD(enforceCD string) (bool, error) { return enforce, nil } -// Create creates workspaces func Create(name, description, enforceCD string, out io.Writer, client astrocore.CoreClient) error { if name == "" { return ErrInvalidName @@ -210,7 +208,6 @@ func Create(name, description, enforceCD string, out io.Writer, client astrocore return nil } -// Update updates workspaces func Update(id, name, description, enforceCD string, out io.Writer, client astrocore.CoreClient) error { ctx, err := context.GetCurrentContext() if err != nil { @@ -275,7 +272,6 @@ func Update(id, name, description, enforceCD string, out io.Writer, client astro return nil } -// Create creates workspaces func Delete(id string, out io.Writer, client astrocore.CoreClient) error { ctx, err := context.GetCurrentContext() if err != nil { diff --git a/cloud/workspace/workspace_token.go b/cloud/workspace/workspace_token.go new file mode 100644 index 000000000..2dbc1e79e --- /dev/null +++ b/cloud/workspace/workspace_token.go @@ -0,0 +1,433 @@ +package workspace + +import ( + httpContext "context" + "fmt" + "io" + "os" + "strconv" + "time" + + astro "github.com/astronomer/astro-cli/astro-client" + astrocore "github.com/astronomer/astro-cli/astro-client-core" + "github.com/astronomer/astro-cli/cloud/user" + "github.com/astronomer/astro-cli/context" + "github.com/astronomer/astro-cli/pkg/ansi" + "github.com/astronomer/astro-cli/pkg/input" + "github.com/astronomer/astro-cli/pkg/printutil" + "github.com/pkg/errors" +) + +func newTokenTableOut() *printutil.Table { + return &printutil.Table{ + Padding: []int{30, 50, 10, 50, 10, 10, 10}, + DynamicPadding: true, + Header: []string{"ID", "NAME", "DESCRIPTION", "SCOPE", "WORKSPACE ROLE", "CREATED", "CREATED BY"}, + } +} + +func newTokenSelectionTableOut() *printutil.Table { + return &printutil.Table{ + Padding: []int{30, 50, 10, 50, 10, 10, 10}, + DynamicPadding: true, + Header: []string{"#", "ID", "NAME", "DESCRIPTION", "SCOPE", "WORKSPACE ROLE", "CREATED", "CREATED BY"}, + } +} + +var ( + errInvalidWorkspaceTokenKey = errors.New("invalid Workspace API token selection") + ErrWorkspaceTokenNotFound = errors.New("no Workspace API token was found for the API token name you provided") + errBothNameAndID = errors.New("both an API token name and id were specified. Specify either the name or the id not both") +) + +const ( + workspaceEntity = "WORKSPACE" +) + +// List all workspace Tokens +func ListTokens(client astrocore.CoreClient, workspace string, out io.Writer) error { + ctx, err := context.GetCurrentContext() + if err != nil { + return err + } + + if workspace == "" { + workspace = ctx.Workspace + } + + apiTokens, err := getWorkspaceTokens(workspace, client) + if err != nil { + return errors.Wrap(err, astro.AstronomerConnectionErrMsg) + } + + tab := newTokenTableOut() + for i := range apiTokens { + id := apiTokens[i].Id + name := apiTokens[i].Name + description := apiTokens[i].Description + scope := apiTokens[i].Type + var role string + for j := range apiTokens[i].Roles { + if apiTokens[i].Roles[j].EntityId == workspace { + role = apiTokens[i].Roles[j].Role + } + } + created := TimeAgo(apiTokens[i].CreatedAt) + createdBy := apiTokens[i].CreatedBy.FullName + tab.AddRow([]string{id, name, description, string(scope), role, created, *createdBy}, false) + } + tab.Print(out) + + return nil +} + +// create a workspace token +func CreateToken(name, description, role, workspace string, expiration int, cleanOutput bool, out io.Writer, client astrocore.CoreClient) error { + err := user.IsWorkspaceRoleValid(role) + if err != nil { + return err + } + if name == "" { + return ErrInvalidName + } + ctx, err := context.GetCurrentContext() + if err != nil { + return err + } + if ctx.OrganizationShortName == "" { + return user.ErrNoShortName + } + if workspace == "" { + workspace = ctx.Workspace + } + CreateWorkspaceAPITokenRequest := astrocore.CreateWorkspaceApiTokenJSONRequestBody{ + Description: &description, + Name: name, + Role: role, + } + if expiration != 0 { + CreateWorkspaceAPITokenRequest.TokenExpiryPeriodInDays = &expiration + } + resp, err := client.CreateWorkspaceApiTokenWithResponse(httpContext.Background(), ctx.OrganizationShortName, workspace, CreateWorkspaceAPITokenRequest) + if err != nil { + return err + } + err = astrocore.NormalizeAPIError(resp.HTTPResponse, resp.Body) + if err != nil { + return err + } + APIToken := resp.JSON200 + if cleanOutput { + fmt.Println(*APIToken.Token) + } else { + fmt.Fprintf(out, "\nAstro Workspace API token %s was successfully created\n", name) + fmt.Println("Copy and paste this API token for your records.") + fmt.Println("\n" + *APIToken.Token) + fmt.Println("\nYou will not be shown this API token value again.") + } + return nil +} + +// Update a workspace token +func UpdateToken(id, name, newName, description, role, workspace string, out io.Writer, client astrocore.CoreClient) error { + ctx, err := context.GetCurrentContext() + if err != nil { + return err + } + if ctx.OrganizationShortName == "" { + return user.ErrNoShortName + } + if workspace == "" { + workspace = ctx.Workspace + } + tokens, err := getWorkspaceTokens(workspace, client) + if err != nil { + return err + } + token, err := getWorkspaceToken(id, name, workspace, "\nPlease select the Workspace API token you would like to update:", tokens) + if err != nil { + return err + } + apiTokenID := token.Id + + UpdateWorkspaceAPITokenRequest := astrocore.UpdateWorkspaceApiTokenJSONRequestBody{} + + if newName == "" { + UpdateWorkspaceAPITokenRequest.Name = token.Name + } else { + UpdateWorkspaceAPITokenRequest.Name = newName + } + + if description == "" { + UpdateWorkspaceAPITokenRequest.Description = token.Description + } else { + UpdateWorkspaceAPITokenRequest.Description = description + } + if role == "" { + for i := range token.Roles { + if token.Roles[i].EntityId == workspaceEntity { + role = token.Roles[i].Role + } + } + err := user.IsWorkspaceRoleValid(role) + if err != nil { + return err + } + UpdateWorkspaceAPITokenRequest.Role = role + } else { + err := user.IsWorkspaceRoleValid(role) + if err != nil { + return err + } + UpdateWorkspaceAPITokenRequest.Role = role + } + resp, err := client.UpdateWorkspaceApiTokenWithResponse(httpContext.Background(), ctx.OrganizationShortName, workspace, apiTokenID, UpdateWorkspaceAPITokenRequest) + if err != nil { + return err + } + err = astrocore.NormalizeAPIError(resp.HTTPResponse, resp.Body) + if err != nil { + return err + } + fmt.Fprintf(out, "Astro Workspace API token %s was successfully updated\n", token.Name) + return nil +} + +// rotate a workspace API token +func RotateToken(id, name, workspace string, cleanOutput, force bool, out io.Writer, client astrocore.CoreClient) error { + ctx, err := context.GetCurrentContext() + if err != nil { + return err + } + if ctx.OrganizationShortName == "" { + return user.ErrNoShortName + } + if workspace == "" { + workspace = ctx.Workspace + } + tokens, err := getWorkspaceTokens(workspace, client) + if err != nil { + return err + } + token, err := getWorkspaceToken(id, name, workspace, "\nPlease select the Workspace API token you would like to rotate:", tokens) + if err != nil { + return err + } + apiTokenID := token.Id + + if !force { + fmt.Println("WARNING: API Token rotation will invalidate the current token and cannot be undone.") + i, _ := input.Confirm( + fmt.Sprintf("\nAre you sure you want to rotate the %s API token?", ansi.Bold(token.Name))) + + if !i { + fmt.Println("Canceling token rotation") + return nil + } + } + resp, err := client.RotateWorkspaceApiTokenWithResponse(httpContext.Background(), ctx.OrganizationShortName, workspace, apiTokenID) + if err != nil { + return err + } + err = astrocore.NormalizeAPIError(resp.HTTPResponse, resp.Body) + if err != nil { + return err + } + APIToken := resp.JSON200 + if cleanOutput { + fmt.Println(*APIToken.Token) + } else { + fmt.Fprintf(out, "\nAstro Workspace API token %s was successfully rotated\n", name) + fmt.Println("Copy and paste this API token for your records.") + fmt.Println("\n" + *APIToken.Token) + fmt.Println("\nYou will not be shown this API token value again.") + } + return nil +} + +// delete a workspaces api token +func DeleteToken(id, name, workspace string, force bool, out io.Writer, client astrocore.CoreClient) error { + ctx, err := context.GetCurrentContext() + if err != nil { + return err + } + if ctx.OrganizationShortName == "" { + return user.ErrNoShortName + } + if workspace == "" { + workspace = ctx.Workspace + } + tokens, err := getWorkspaceTokens(workspace, client) + if err != nil { + return err + } + token, err := getWorkspaceToken(id, name, workspace, "\nPlease select the Workspace APItoken you would like to delete or remove:", tokens) + if err != nil { + return err + } + apiTokenID := token.Id + if string(token.Type) == workspaceEntity { + if !force { + fmt.Println("WARNING: API token deletion cannot be undone.") + i, _ := input.Confirm( + fmt.Sprintf("\nAre you sure you want to delete the %s API token?", ansi.Bold(token.Name))) + + if !i { + fmt.Println("Canceling API Token deletion") + return nil + } + } + } else { + if !force { + i, _ := input.Confirm( + fmt.Sprintf("\nAre you sure you want to remove the %s API token from the Workspace?", ansi.Bold(token.Name))) + + if !i { + fmt.Println("Canceling API Token removal") + return nil + } + } + } + + resp, err := client.DeleteWorkspaceApiTokenWithResponse(httpContext.Background(), ctx.OrganizationShortName, workspace, apiTokenID) + if err != nil { + return err + } + err = astrocore.NormalizeAPIError(resp.HTTPResponse, resp.Body) + if err != nil { + return err + } + if string(token.Type) == workspaceEntity { + fmt.Fprintf(out, "Astro Workspace API token %s was successfully deleted\n", token.Name) + } else { + fmt.Fprintf(out, "Astro Organization API token %s was successfully removed from the Workspace\n", token.Name) + } + return nil +} + +func selectTokens(workspace string, apiTokens []astrocore.ApiToken) (astrocore.ApiToken, error) { + apiTokensMap := map[string]astrocore.ApiToken{} + tab := newTokenSelectionTableOut() + for i := range apiTokens { + id := apiTokens[i].Id + name := apiTokens[i].Name + description := apiTokens[i].Description + scope := apiTokens[i].Type + var role string + for j := range apiTokens[i].Roles { + if apiTokens[i].Roles[j].EntityId == workspace { + role = apiTokens[i].Roles[j].Role + } + } + created := TimeAgo(apiTokens[i].CreatedAt) + createdBy := apiTokens[i].CreatedBy.FullName + + index := i + 1 + tab.AddRow([]string{ + strconv.Itoa(index), + id, + name, + description, + string(scope), + role, + created, + *createdBy, + }, false) + apiTokensMap[strconv.Itoa(index)] = apiTokens[i] + } + + tab.Print(os.Stdout) + choice := input.Text("\n> ") + selected, ok := apiTokensMap[choice] + if !ok { + return astrocore.ApiToken{}, errInvalidWorkspaceTokenKey + } + return selected, nil +} + +// get all workspace tokens +func getWorkspaceTokens(workspace string, client astrocore.CoreClient) ([]astrocore.ApiToken, error) { + ctx, err := context.GetCurrentContext() + if err != nil { + return []astrocore.ApiToken{}, err + } + if ctx.OrganizationShortName == "" { + return []astrocore.ApiToken{}, user.ErrNoShortName + } + if workspace == "" { + workspace = ctx.Workspace + } + + resp, err := client.ListWorkspaceApiTokensWithResponse(httpContext.Background(), ctx.OrganizationShortName, workspace, &astrocore.ListWorkspaceApiTokensParams{}) + if err != nil { + return []astrocore.ApiToken{}, err + } + err = astrocore.NormalizeAPIError(resp.HTTPResponse, resp.Body) + if err != nil { + return []astrocore.ApiToken{}, err + } + + APITokens := resp.JSON200.ApiTokens + + return APITokens, nil +} + +func getWorkspaceToken(id, name, workspace, message string, tokens []astrocore.ApiToken) (token astrocore.ApiToken, err error) { //nolint:gocognit + switch { + case id == "" && name == "": + fmt.Println(message) + token, err = selectTokens(workspace, tokens) + if err != nil { + return astrocore.ApiToken{}, err + } + case name == "" && id != "": + for i := range tokens { + if tokens[i].Id == id { + token = tokens[i] + } + } + if token.Id == "" { + return astrocore.ApiToken{}, ErrWorkspaceTokenNotFound + } + case name != "" && id == "": + var matchedTokens []astrocore.ApiToken + for i := range tokens { + if tokens[i].Name == name { + matchedTokens = append(matchedTokens, tokens[i]) + } + } + if len(matchedTokens) == 1 { + token = matchedTokens[0] + } else if len(matchedTokens) > 1 { + fmt.Printf("\nThere are more than one API tokens with name %s. Please select an API token:\n", name) + token, err = selectTokens(workspace, matchedTokens) + if err != nil { + return astrocore.ApiToken{}, err + } + } + case name != "" && id != "": + return astrocore.ApiToken{}, errBothNameAndID + } + if token.Id == "" { + return astrocore.ApiToken{}, ErrWorkspaceTokenNotFound + } + return token, nil +} + +func TimeAgo(date time.Time) string { + duration := time.Since(date) + days := int(duration.Hours() / 24) //nolint:gomnd + hours := int(duration.Hours()) + minutes := int(duration.Minutes()) + + switch { + case days > 0: + return fmt.Sprintf("%d days ago", days) + case hours > 0: + return fmt.Sprintf("%d hours ago", hours) + case minutes > 0: + return fmt.Sprintf("%d minutes ago", minutes) + default: + return "Just now" + } +} diff --git a/cloud/workspace/workspace_token_test.go b/cloud/workspace/workspace_token_test.go new file mode 100644 index 000000000..aead38ef4 --- /dev/null +++ b/cloud/workspace/workspace_token_test.go @@ -0,0 +1,504 @@ +package workspace + +import ( + "bytes" + "encoding/json" + "net/http" + "os" + "testing" + "time" + + astrocore "github.com/astronomer/astro-cli/astro-client-core" + astrocore_mocks "github.com/astronomer/astro-cli/astro-client-core/mocks" + "github.com/astronomer/astro-cli/cloud/user" + testUtil "github.com/astronomer/astro-cli/pkg/testing" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" +) + +var ( + description1 = "Description 1" + description2 = "Description 2" + fullName1 = "User 1" + fullName2 = "User 2" + token = "token" + apiToken1 = astrocore.ApiToken{Id: "token1", Name: "Token 1", Token: &token, Description: description1, Type: "WORKSPACE", Roles: []astrocore.ApiTokenRole{{EntityId: "WORKSPACE", Role: "WORKSPACE_MEMBER"}}, CreatedAt: time.Now(), CreatedBy: &astrocore.BasicSubjectProfile{FullName: &fullName1}} + apiTokens = []astrocore.ApiToken{ + apiToken1, + {Id: "token2", Name: "Token 2", Description: description2, Type: "ORGANIZATION", Roles: []astrocore.ApiTokenRole{{EntityId: "WORKSPACE", Role: "WORKSPACE_MEMBER"}}, CreatedAt: time.Now(), CreatedBy: &astrocore.BasicSubjectProfile{FullName: &fullName2}}, + } + apiTokens2 = []astrocore.ApiToken{ + apiToken1, + apiToken1, + {Id: "token2", Name: "Token 2", Description: description2, Type: "WORKSPACE", Roles: []astrocore.ApiTokenRole{{EntityId: "WORKSPACE", Role: "WORKSPACE_MEMBER"}}, CreatedAt: time.Now(), CreatedBy: &astrocore.BasicSubjectProfile{FullName: &fullName2}}, + } + ListWorkspaceAPITokensResponseOK = astrocore.ListWorkspaceApiTokensResponse{ + HTTPResponse: &http.Response{ + StatusCode: 200, + }, + JSON200: &astrocore.ListApiTokensPaginated{ + ApiTokens: apiTokens, + Limit: 1, + Offset: 0, + }, + } + ListWorkspaceAPITokensResponse2OK = astrocore.ListWorkspaceApiTokensResponse{ + HTTPResponse: &http.Response{ + StatusCode: 200, + }, + JSON200: &astrocore.ListApiTokensPaginated{ + ApiTokens: apiTokens2, + Limit: 1, + Offset: 0, + }, + } + errorBodyList, _ = json.Marshal(astrocore.Error{ + Message: "failed to list tokens", + }) + ListWorkspaceAPITokensResponseError = astrocore.ListWorkspaceApiTokensResponse{ + HTTPResponse: &http.Response{ + StatusCode: 500, + }, + Body: errorBodyList, + JSON200: nil, + } + CreateWorkspaceAPITokenResponseOK = astrocore.CreateWorkspaceApiTokenResponse{ + HTTPResponse: &http.Response{ + StatusCode: 200, + }, + JSON200: &apiToken1, + } + CreateWorkspaceAPITokenResponseError = astrocore.CreateWorkspaceApiTokenResponse{ + HTTPResponse: &http.Response{ + StatusCode: 500, + }, + Body: errorBodyCreate, + JSON200: nil, + } + UpdateWorkspaceAPITokenResponseOK = astrocore.UpdateWorkspaceApiTokenResponse{ + HTTPResponse: &http.Response{ + StatusCode: 200, + }, + JSON200: &apiToken1, + } + UpdateWorkspaceAPITokenResponseError = astrocore.UpdateWorkspaceApiTokenResponse{ + HTTPResponse: &http.Response{ + StatusCode: 500, + }, + Body: errorBodyUpdate, + JSON200: nil, + } + RotateWorkspaceAPITokenResponseOK = astrocore.RotateWorkspaceApiTokenResponse{ + HTTPResponse: &http.Response{ + StatusCode: 200, + }, + JSON200: &apiToken1, + } + RotateWorkspaceAPITokenResponseError = astrocore.RotateWorkspaceApiTokenResponse{ + HTTPResponse: &http.Response{ + StatusCode: 500, + }, + Body: errorBodyUpdate, + JSON200: nil, + } + DeleteWorkspaceAPITokenResponseOK = astrocore.DeleteWorkspaceApiTokenResponse{ + HTTPResponse: &http.Response{ + StatusCode: 200, + }, + } + DeleteWorkspaceAPITokenResponseError = astrocore.DeleteWorkspaceApiTokenResponse{ + HTTPResponse: &http.Response{ + StatusCode: 500, + }, + Body: errorBodyUpdate, + } +) + +func TestListTokens(t *testing.T) { + t.Run("happy path", func(t *testing.T) { + testUtil.InitTestConfig(testUtil.CloudPlatform) + out := new(bytes.Buffer) + mockClient := new(astrocore_mocks.ClientWithResponsesInterface) + mockClient.On("ListWorkspaceApiTokensWithResponse", mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(&ListWorkspaceAPITokensResponseOK, nil).Twice() + err := ListTokens(mockClient, "", out) + assert.NoError(t, err) + }) + + t.Run("with specified workspace", func(t *testing.T) { + testUtil.InitTestConfig(testUtil.CloudPlatform) + out := new(bytes.Buffer) + mockClient := new(astrocore_mocks.ClientWithResponsesInterface) + mockClient.On("ListWorkspaceApiTokensWithResponse", mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(&ListWorkspaceAPITokensResponseOK, nil).Twice() + + err := ListTokens(mockClient, "otherWorkspace", out) + + assert.NoError(t, err) + }) + + t.Run("error path when ListWorkspaceApiTokensWithResponse returns an error", func(t *testing.T) { + testUtil.InitTestConfig(testUtil.CloudPlatform) + out := new(bytes.Buffer) + mockClient := new(astrocore_mocks.ClientWithResponsesInterface) + mockClient.On("ListWorkspaceApiTokensWithResponse", mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(&ListWorkspaceAPITokensResponseError, nil).Twice() + err := ListTokens(mockClient, "otherWorkspace", out) + assert.ErrorContains(t, err, "failed to list tokens") + }) + + t.Run("error getting current context", func(t *testing.T) { + testUtil.InitTestConfig(testUtil.Initial) + out := new(bytes.Buffer) + mockClient := new(astrocore_mocks.ClientWithResponsesInterface) + err := ListTokens(mockClient, "", out) + + assert.Error(t, err) + }) +} + +func TestCreateToken(t *testing.T) { + t.Run("happy path", func(t *testing.T) { + testUtil.InitTestConfig(testUtil.CloudPlatform) + out := new(bytes.Buffer) + mockClient := new(astrocore_mocks.ClientWithResponsesInterface) + mockClient.On("CreateWorkspaceApiTokenWithResponse", mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(&CreateWorkspaceAPITokenResponseOK, nil) + + err := CreateToken("Token 1", "Description 1", "WORKSPACE_MEMBER", "", 0, false, out, mockClient) + + assert.NoError(t, err) + }) + + t.Run("error getting current context", func(t *testing.T) { + testUtil.InitTestConfig(testUtil.Initial) + out := new(bytes.Buffer) + mockClient := new(astrocore_mocks.ClientWithResponsesInterface) + + err := CreateToken("Token 1", "Description 1", "WORKSPACE_MEMBER", "", 0, false, out, mockClient) + + assert.Error(t, err) + }) + + t.Run("invalid role", func(t *testing.T) { + testUtil.InitTestConfig(testUtil.CloudPlatform) + out := new(bytes.Buffer) + mockClient := new(astrocore_mocks.ClientWithResponsesInterface) + + err := CreateToken("Token 1", "Description 1", "InvalidRole", "", 0, false, out, mockClient) + + assert.Error(t, err) + }) + + t.Run("empty name", func(t *testing.T) { + testUtil.InitTestConfig(testUtil.CloudPlatform) + out := new(bytes.Buffer) + mockClient := new(astrocore_mocks.ClientWithResponsesInterface) + + err := CreateToken("", "Description 1", "WORKSPACE_MEMBER", "", 0, true, out, mockClient) + + assert.Equal(t, ErrInvalidName, err) + }) +} + +func TestUpdateToken(t *testing.T) { + t.Run("happy path", func(t *testing.T) { + testUtil.InitTestConfig(testUtil.CloudPlatform) + out := new(bytes.Buffer) + mockClient := new(astrocore_mocks.ClientWithResponsesInterface) + mockClient.On("ListWorkspaceApiTokensWithResponse", mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(&ListWorkspaceAPITokensResponseOK, nil).Twice() + mockClient.On("UpdateWorkspaceApiTokenWithResponse", mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(&UpdateWorkspaceAPITokenResponseOK, nil) + err := UpdateToken("token1", "", "", "", "", "", out, mockClient) + assert.NoError(t, err) + }) + + t.Run("happy path no id", func(t *testing.T) { + testUtil.InitTestConfig(testUtil.CloudPlatform) + out := new(bytes.Buffer) + mockClient := new(astrocore_mocks.ClientWithResponsesInterface) + mockClient.On("ListWorkspaceApiTokensWithResponse", mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(&ListWorkspaceAPITokensResponseOK, nil).Twice() + mockClient.On("UpdateWorkspaceApiTokenWithResponse", mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(&UpdateWorkspaceAPITokenResponseOK, nil) + // mock os.Stdin + expectedInput := []byte("2") + r, w, err := os.Pipe() + assert.NoError(t, err) + _, err = w.Write(expectedInput) + assert.NoError(t, err) + w.Close() + stdin := os.Stdin + // Restore stdin right after the test. + defer func() { os.Stdin = stdin }() + os.Stdin = r + err = UpdateToken("", "", "", "", "", "", out, mockClient) + assert.NoError(t, err) + }) + + t.Run("happy path multiple name", func(t *testing.T) { + testUtil.InitTestConfig(testUtil.CloudPlatform) + out := new(bytes.Buffer) + mockClient := new(astrocore_mocks.ClientWithResponsesInterface) + mockClient.On("ListWorkspaceApiTokensWithResponse", mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(&ListWorkspaceAPITokensResponse2OK, nil).Twice() + mockClient.On("UpdateWorkspaceApiTokenWithResponse", mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(&UpdateWorkspaceAPITokenResponseOK, nil) + // mock os.Stdin + expectedInput := []byte("2") + r, w, err := os.Pipe() + assert.NoError(t, err) + _, err = w.Write(expectedInput) + assert.NoError(t, err) + w.Close() + stdin := os.Stdin + // Restore stdin right after the test. + defer func() { os.Stdin = stdin }() + os.Stdin = r + err = UpdateToken("", "Token 1", "", "", "", "", out, mockClient) + assert.NoError(t, err) + }) + + t.Run("happy path", func(t *testing.T) { + testUtil.InitTestConfig(testUtil.CloudPlatform) + out := new(bytes.Buffer) + mockClient := new(astrocore_mocks.ClientWithResponsesInterface) + mockClient.On("ListWorkspaceApiTokensWithResponse", mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(&ListWorkspaceAPITokensResponseOK, nil).Twice() + mockClient.On("UpdateWorkspaceApiTokenWithResponse", mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(&UpdateWorkspaceAPITokenResponseOK, nil) + err := UpdateToken("token1", "", "", "", "", "", out, mockClient) + assert.NoError(t, err) + }) + + t.Run("error both id and name", func(t *testing.T) { + testUtil.InitTestConfig(testUtil.CloudPlatform) + out := new(bytes.Buffer) + mockClient := new(astrocore_mocks.ClientWithResponsesInterface) + mockClient.On("ListWorkspaceApiTokensWithResponse", mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(&ListWorkspaceAPITokensResponseOK, nil) + mockClient.On("UpdateWorkspaceApiTokenWithResponse", mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(&UpdateWorkspaceAPITokenResponseOK, nil) + err := UpdateToken("token1", "Token 1", "", "", "", "", out, mockClient) + assert.ErrorIs(t, errBothNameAndID, err) + }) + + t.Run("error path when getWorkspaceTokens returns an error", func(t *testing.T) { + testUtil.InitTestConfig(testUtil.CloudPlatform) + out := new(bytes.Buffer) + mockClient := new(astrocore_mocks.ClientWithResponsesInterface) + mockClient.On("ListWorkspaceApiTokensWithResponse", mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(&ListWorkspaceAPITokensResponseError, nil) + err := UpdateToken("token1", "", "", "", "", "", out, mockClient) + assert.ErrorContains(t, err, "failed to list tokens") + }) + + t.Run("error path when getWorkspaceToken returns an error", func(t *testing.T) { + testUtil.InitTestConfig(testUtil.CloudPlatform) + out := new(bytes.Buffer) + mockClient := new(astrocore_mocks.ClientWithResponsesInterface) + mockClient.On("ListWorkspaceApiTokensWithResponse", mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(&ListWorkspaceAPITokensResponseOK, nil) + err := UpdateToken("token3", "", "", "", "", "", out, mockClient) + assert.Equal(t, ErrWorkspaceTokenNotFound, err) + }) + + t.Run("error path when UpdateWorkspaceApiTokenWithResponse returns an error", func(t *testing.T) { + testUtil.InitTestConfig(testUtil.CloudPlatform) + out := new(bytes.Buffer) + mockClient := new(astrocore_mocks.ClientWithResponsesInterface) + mockClient.On("ListWorkspaceApiTokensWithResponse", mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(&ListWorkspaceAPITokensResponseOK, nil) + mockClient.On("UpdateWorkspaceApiTokenWithResponse", mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(&UpdateWorkspaceAPITokenResponseError, nil) + err := UpdateToken("token1", "", "", "", "", "", out, mockClient) + assert.Equal(t, "failed to update workspace", err.Error()) + }) + + t.Run("error path when there is no context", func(t *testing.T) { + testUtil.InitTestConfig(testUtil.Initial) + out := new(bytes.Buffer) + mockClient := new(astrocore_mocks.ClientWithResponsesInterface) + err := UpdateToken("token1", "", "", "", "", "", out, mockClient) + assert.Error(t, err) + }) + + t.Run("error path when workspace role is invalid returns an error", func(t *testing.T) { + testUtil.InitTestConfig(testUtil.CloudPlatform) + out := new(bytes.Buffer) + mockClient := new(astrocore_mocks.ClientWithResponsesInterface) + mockClient.On("ListWorkspaceApiTokensWithResponse", mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(&ListWorkspaceAPITokensResponseOK, nil) + mockClient.On("UpdateWorkspaceApiTokenWithResponse", mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(&UpdateWorkspaceAPITokenResponseOK, nil) + err := UpdateToken("token1", "", "", "", "Invalid Role", "", out, mockClient) + assert.Equal(t, user.ErrInvalidWorkspaceRole.Error(), err.Error()) + }) + t.Run("Happy path when applying workspace role", func(t *testing.T) { + testUtil.InitTestConfig(testUtil.CloudPlatform) + out := new(bytes.Buffer) + mockClient := new(astrocore_mocks.ClientWithResponsesInterface) + mockClient.On("ListWorkspaceApiTokensWithResponse", mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(&ListWorkspaceAPITokensResponseOK, nil) + mockClient.On("UpdateWorkspaceApiTokenWithResponse", mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(&UpdateWorkspaceAPITokenResponseOK, nil) + err := UpdateToken("token1", "", "", "", "WORKSPACE_MEMBER", "", out, mockClient) + assert.NoError(t, err) + }) +} + +func TestRotateToken(t *testing.T) { + t.Run("happy path", func(t *testing.T) { + testUtil.InitTestConfig(testUtil.CloudPlatform) + out := new(bytes.Buffer) + mockClient := new(astrocore_mocks.ClientWithResponsesInterface) + mockClient.On("ListWorkspaceApiTokensWithResponse", mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(&ListWorkspaceAPITokensResponseOK, nil) + mockClient.On("RotateWorkspaceApiTokenWithResponse", mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(&RotateWorkspaceAPITokenResponseOK, nil) + err := RotateToken("token1", "", "", false, true, out, mockClient) + assert.NoError(t, err) + }) + + t.Run("happy path with confirmation", func(t *testing.T) { + testUtil.InitTestConfig(testUtil.CloudPlatform) + out := new(bytes.Buffer) + mockClient := new(astrocore_mocks.ClientWithResponsesInterface) + mockClient.On("ListWorkspaceApiTokensWithResponse", mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(&ListWorkspaceAPITokensResponseOK, nil) + mockClient.On("RotateWorkspaceApiTokenWithResponse", mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(&RotateWorkspaceAPITokenResponseOK, nil) + err := RotateToken("token1", "", "", true, false, out, mockClient) + assert.NoError(t, err) + }) + + t.Run("error path when there is no context", func(t *testing.T) { + testUtil.InitTestConfig(testUtil.Initial) + out := new(bytes.Buffer) + mockClient := new(astrocore_mocks.ClientWithResponsesInterface) + err := RotateToken("token1", "", "", false, false, out, mockClient) + assert.Error(t, err) + }) + + t.Run("error path when getWorkspaceTokens returns an error", func(t *testing.T) { + testUtil.InitTestConfig(testUtil.CloudPlatform) + out := new(bytes.Buffer) + mockClient := new(astrocore_mocks.ClientWithResponsesInterface) + mockClient.On("ListWorkspaceApiTokensWithResponse", mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(&ListWorkspaceAPITokensResponseError, nil) + err := RotateToken("token1", "", "", false, false, out, mockClient) + assert.ErrorContains(t, err, "failed to list tokens") + }) + + t.Run("error path when getWorkspaceToken returns an error", func(t *testing.T) { + testUtil.InitTestConfig(testUtil.CloudPlatform) + out := new(bytes.Buffer) + mockClient := new(astrocore_mocks.ClientWithResponsesInterface) + mockClient.On("ListWorkspaceApiTokensWithResponse", mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(&ListWorkspaceAPITokensResponseOK, nil) + err := RotateToken("token3", "", "", false, false, out, mockClient) + assert.Equal(t, ErrWorkspaceTokenNotFound, err) + }) + + t.Run("error path when RotateWorkspaceApiTokenWithResponse returns an error", func(t *testing.T) { + testUtil.InitTestConfig(testUtil.CloudPlatform) + out := new(bytes.Buffer) + mockClient := new(astrocore_mocks.ClientWithResponsesInterface) + mockClient.On("ListWorkspaceApiTokensWithResponse", mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(&ListWorkspaceAPITokensResponseOK, nil) + mockClient.On("RotateWorkspaceApiTokenWithResponse", mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(&RotateWorkspaceAPITokenResponseError, nil) + err := RotateToken("token1", "", "", false, true, out, mockClient) + assert.Equal(t, "failed to update workspace", err.Error()) + }) +} + +func TestDeleteToken(t *testing.T) { + t.Run("happy path - delete workspace token", func(t *testing.T) { + testUtil.InitTestConfig(testUtil.CloudPlatform) + out := new(bytes.Buffer) + mockClient := new(astrocore_mocks.ClientWithResponsesInterface) + mockClient.On("ListWorkspaceApiTokensWithResponse", mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(&ListWorkspaceAPITokensResponseOK, nil).Twice() + mockClient.On("DeleteWorkspaceApiTokenWithResponse", mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(&DeleteWorkspaceAPITokenResponseOK, nil) + err := DeleteToken("token1", "", "", false, out, mockClient) + assert.NoError(t, err) + }) + + t.Run("happy path - remove organization token", func(t *testing.T) { + testUtil.InitTestConfig(testUtil.CloudPlatform) + out := new(bytes.Buffer) + mockClient := new(astrocore_mocks.ClientWithResponsesInterface) + mockClient.On("ListWorkspaceApiTokensWithResponse", mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(&ListWorkspaceAPITokensResponseOK, nil).Twice() + mockClient.On("DeleteWorkspaceApiTokenWithResponse", mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(&DeleteWorkspaceAPITokenResponseOK, nil) + err := DeleteToken("token2", "", "", false, out, mockClient) + assert.NoError(t, err) + }) + + t.Run("error path when there is no context", func(t *testing.T) { + testUtil.InitTestConfig(testUtil.Initial) + out := new(bytes.Buffer) + mockClient := new(astrocore_mocks.ClientWithResponsesInterface) + err := DeleteToken("token1", "", "", false, out, mockClient) + assert.Error(t, err) + }) + + t.Run("error path when getWorkspaceTokens returns an error", func(t *testing.T) { + testUtil.InitTestConfig(testUtil.CloudPlatform) + out := new(bytes.Buffer) + mockClient := new(astrocore_mocks.ClientWithResponsesInterface) + mockClient.On("ListWorkspaceApiTokensWithResponse", mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(&ListWorkspaceAPITokensResponseError, nil) + err := DeleteToken("token1", "", "", false, out, mockClient) + assert.ErrorContains(t, err, "failed to list tokens") + }) + + t.Run("error path when getWorkspaceToken returns an error", func(t *testing.T) { + testUtil.InitTestConfig(testUtil.CloudPlatform) + out := new(bytes.Buffer) + mockClient := new(astrocore_mocks.ClientWithResponsesInterface) + mockClient.On("ListWorkspaceApiTokensWithResponse", mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(&ListWorkspaceAPITokensResponseOK, nil) + err := DeleteToken("token3", "", "", false, out, mockClient) + assert.Equal(t, ErrWorkspaceTokenNotFound, err) + }) + + t.Run("error path when DeleteWorkspaceApiTokenWithResponse returns an error", func(t *testing.T) { + testUtil.InitTestConfig(testUtil.CloudPlatform) + out := new(bytes.Buffer) + mockClient := new(astrocore_mocks.ClientWithResponsesInterface) + mockClient.On("ListWorkspaceApiTokensWithResponse", mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(&ListWorkspaceAPITokensResponseOK, nil) + mockClient.On("DeleteWorkspaceApiTokenWithResponse", mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(&DeleteWorkspaceAPITokenResponseError, nil) + err := DeleteToken("token1", "", "", true, out, mockClient) + assert.Equal(t, "failed to update workspace", err.Error()) + }) +} + +func TestGetWorkspaceToken(t *testing.T) { + t.Run("select token by id when name is empty", func(t *testing.T) { + mockClient := new(astrocore_mocks.ClientWithResponsesInterface) + mockClient.On("ListWorkspaceApiTokensWithResponse", mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(&ListWorkspaceAPITokensResponseOK, nil).Twice() + token, err := getWorkspaceToken("token1", "", "testWorkspace", "\nPlease select the workspace token you would like to delete or remove:", apiTokens) + assert.NoError(t, err) + assert.Equal(t, apiToken1, token) + }) + + t.Run("select token by name when id is empty and there is only one matching token", func(t *testing.T) { + mockClient := new(astrocore_mocks.ClientWithResponsesInterface) + mockClient.On("ListWorkspaceApiTokensWithResponse", mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(&ListWorkspaceAPITokensResponseOK, nil).Twice() + token, err := getWorkspaceToken("", "Token 2", "testWorkspace", "\nPlease select the workspace token you would like to delete or remove:", apiTokens) + assert.NoError(t, err) + assert.Equal(t, apiTokens[1], token) + }) + + t.Run("return error when token is not found by id", func(t *testing.T) { + mockClient := new(astrocore_mocks.ClientWithResponsesInterface) + mockClient.On("ListWorkspaceApiTokensWithResponse", mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(&ListWorkspaceAPITokensResponseOK, nil).Twice() + token, err := getWorkspaceToken("nonexistent", "", "testWorkspace", "\nPlease select the workspace token you would like to delete or remove:", apiTokens) + assert.Equal(t, ErrWorkspaceTokenNotFound, err) + assert.Equal(t, astrocore.ApiToken{}, token) + }) + + t.Run("return error when token is not found by name", func(t *testing.T) { + mockClient := new(astrocore_mocks.ClientWithResponsesInterface) + mockClient.On("ListWorkspaceApiTokensWithResponse", mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(&ListWorkspaceAPITokensResponseOK, nil).Twice() + token, err := getWorkspaceToken("", "Nonexistent Token", "testWorkspace", "\nPlease select the workspace token you would like to delete or remove:", apiTokens) + assert.Equal(t, ErrWorkspaceTokenNotFound, err) + assert.Equal(t, astrocore.ApiToken{}, token) + }) +} + +func TestTimeAgo(t *testing.T) { + currentTime := time.Now() + + t.Run("return 'Just now' for current time", func(t *testing.T) { + result := TimeAgo(currentTime) + assert.Equal(t, "Just now", result) + }) + + t.Run("return '30 minutes ago' for 30 minutes ago", func(t *testing.T) { + pastTime := currentTime.Add(-30 * time.Minute) + result := TimeAgo(pastTime) + assert.Equal(t, "30 minutes ago", result) + }) + + t.Run("return '5 hours ago' for 5 hours ago", func(t *testing.T) { + pastTime := currentTime.Add(-5 * time.Hour) + result := TimeAgo(pastTime) + assert.Equal(t, "5 hours ago", result) + }) + + t.Run("return '10 days ago' for 10 days ago", func(t *testing.T) { + pastTime := currentTime.Add(-10 * 24 * time.Hour) + result := TimeAgo(pastTime) + assert.Equal(t, "10 days ago", result) + }) +} diff --git a/cmd/cloud/workspace.go b/cmd/cloud/workspace.go index 0ffab7491..28a8ca225 100644 --- a/cmd/cloud/workspace.go +++ b/cmd/cloud/workspace.go @@ -1,25 +1,40 @@ package cloud import ( + "fmt" "io" + "os" + "strconv" "strings" + "github.com/astronomer/astro-cli/cloud/organization" "github.com/astronomer/astro-cli/cloud/team" "github.com/astronomer/astro-cli/cloud/user" "github.com/astronomer/astro-cli/cloud/workspace" "github.com/astronomer/astro-cli/pkg/input" + "github.com/astronomer/astro-cli/pkg/printutil" "github.com/pkg/errors" "github.com/spf13/cobra" ) var ( - workspaceID string - addWorkspaceRole string - updateWorkspaceRole string - workspaceName string - workspaceDescription string - enforceCD string + errInvalidWorkspaceRoleKey = errors.New("invalid workspace role selection") + workspaceID string + addWorkspaceRole string + updateWorkspaceRole string + workspaceName string + workspaceDescription string + enforceCD string + tokenName string + tokenDescription string + tokenRole string + orgTokenName string + tokenID string + orgTokenID string + cleanTokenOutput bool + forceRotate bool + tokenExpiration int ) func newWorkspaceCmd(out io.Writer) *cobra.Command { @@ -36,6 +51,7 @@ func newWorkspaceCmd(out io.Writer) *cobra.Command { newWorkspaceUpdateCmd(out), newWorkspaceDeleteCmd(out), newWorkspaceUserRootCmd(out), + newWorkspaceTokenRootCmd(out), newWorkspaceTeamRootCmd(out), ) return cmd @@ -79,7 +95,7 @@ func newWorkspaceCreateCmd(out io.Writer) *cobra.Command { }, } cmd.Flags().StringVarP(&workspaceName, "name", "n", "", "The Workspace's name. If the name contains a space, specify the entire name within quotes \"\" ") - cmd.Flags().StringVarP(&workspaceDescription, "description", "d", "", "Description of the Workspace. If the description contains a space, specify the entire workspace in quotes \"\"") + cmd.Flags().StringVarP(&workspaceDescription, "description", "d", "", "Description of the Workspace. If the description contains a space, specify the entire description in quotes \"\"") cmd.Flags().StringVarP(&enforceCD, "enforce-cicd", "e", "OFF", "Provide this flag either ON/OFF. ON means deploys to deployments must use an API Key or Token. This essentially forces Deploys to happen through CI/CD") return cmd } @@ -96,7 +112,7 @@ func newWorkspaceUpdateCmd(out io.Writer) *cobra.Command { }, } cmd.Flags().StringVarP(&workspaceName, "name", "n", "", "The Workspace's name. If the name contains a space, specify the entire name within quotes \"\" ") - cmd.Flags().StringVarP(&workspaceDescription, "description", "d", "", "Description of the Workspace. If the description contains a space, specify the entire workspace in quotes \"\"") + cmd.Flags().StringVarP(&workspaceDescription, "description", "d", "", "Description of the Workspace. If the description contains a space, specify the entire description in quotes \"\"") cmd.Flags().StringVarP(&enforceCD, "enforce-cicd", "e", "OFF", "Provide this flag either ON/OFF. ON means deploys to deployments must use an API Key or Token. This essentially forces Deploys to happen through CI/CD") return cmd } @@ -129,6 +145,8 @@ func newWorkspaceUserRootCmd(out io.Writer) *cobra.Command { newWorkspaceUserRemoveCmd(out), newWorkspaceUserAddCmd(out), ) + cmd.PersistentFlags().StringVar(&workspaceID, "workspace-id", "", "workspace where you'd like to manage users") + return cmd } @@ -189,6 +207,39 @@ func newWorkspaceUserRemoveCmd(out io.Writer) *cobra.Command { return cmd } +func newWorkspaceTokenRootCmd(out io.Writer) *cobra.Command { + cmd := &cobra.Command{ + Use: "token", + Aliases: []string{"to"}, + Short: "Manage tokens in your Astro Workspace", + Long: "Manage tokens in your Astro Workspace.", + } + cmd.SetOut(out) + cmd.AddCommand( + newWorkspaceTokenListCmd(out), + newWorkspaceTokenCreateCmd(out), + newWorkspaceTokenUpdateCmd(out), + newWorkspaceTokenRotateCmd(out), + newWorkspaceTokenDeleteCmd(out), + newWorkspaceTokenAddCmd(out), + ) + cmd.PersistentFlags().StringVar(&workspaceID, "workspace-id", "", "workspace where you would like to manage tokens") + return cmd +} + +func newWorkspaceTokenListCmd(out io.Writer) *cobra.Command { + cmd := &cobra.Command{ + Use: "list", + Aliases: []string{"ls"}, + Short: "List all the API tokens in an Astro Workspace", + Long: "List all the API tokens in an Astro Workspace", + RunE: func(cmd *cobra.Command, args []string) error { + return listWorkspaceToken(cmd, out) + }, + } + return cmd +} + func newWorkspaceTeamRootCmd(out io.Writer) *cobra.Command { cmd := &cobra.Command{ Use: "team", @@ -219,9 +270,92 @@ func newWorkspaceTeamListCmd(out io.Writer) *cobra.Command { return cmd } -func listWorkspaceTeam(cmd *cobra.Command, out io.Writer) error { - cmd.SilenceUsage = true - return team.ListWorkspaceTeams(out, astroCoreClient, "") +func newWorkspaceTokenCreateCmd(out io.Writer) *cobra.Command { + cmd := &cobra.Command{ + Use: "create", + Aliases: []string{"cr"}, + Short: "Create an API token in an Astro Workspace", + Long: "Create an API token in an Astro Workspace\n$astro workspace token create --name [token name] --role [WORKSPACE_MEMBER, " + + "WORKSPACE_OPERATOR, WORKSPACE_OWNER].", + RunE: func(cmd *cobra.Command, args []string) error { + return createWorkspaceToken(cmd, out) + }, + } + cmd.Flags().StringVarP(&tokenName, "name", "n", "", "The token's name. If the name contains a space, specify the entire name within quotes \"\" ") + cmd.Flags().BoolVarP(&cleanTokenOutput, "clean-output", "c", false, "Print only the token as output. For use of the command in scripts") + cmd.Flags().StringVarP(&tokenDescription, "description", "d", "", "Description of the token. If the description contains a space, specify the entire description within quotes \"\"") + cmd.Flags().StringVarP(&tokenRole, "role", "r", "", "The role for the "+ + "token. Possible values are WORKSPACE_MEMBER, WORKSPACE_OPERATOR and WORKSPACE_OWNER") + cmd.Flags().IntVarP(&tokenExpiration, "expiration", "e", 0, "Expiration of the token in days. If the flag isn't used the token won't have an expiration. Must be between 1 and 3650 days. ") + return cmd +} + +func newWorkspaceTokenUpdateCmd(out io.Writer) *cobra.Command { + cmd := &cobra.Command{ + Use: "update [TOKEN_ID]", + Aliases: []string{"up"}, + Short: "Update a Workspace or Organaization API token", + Long: "Update a Workspace or Organaization API token that has a role in an Astro Workspace\n$astro workspace token update [TOKEN_ID] --name [new token name] --role [WORKSPACE_MEMBER, " + + "WORKSPACE_OPERATOR, WORKSPACE_OWNER].", + RunE: func(cmd *cobra.Command, args []string) error { + return updateWorkspaceToken(cmd, args, out) + }, + } + cmd.Flags().StringVarP(&name, "name", "t", "", "The current name of the token. If the name contains a space, specify the entire name within quotes \"\" ") + cmd.Flags().StringVarP(&tokenName, "new-name", "n", "", "The token's new name. If the name contains a space, specify the entire name within quotes \"\" ") + cmd.Flags().StringVarP(&tokenDescription, "description", "d", "", "updated description of the token. If the description contains a space, specify the entire description in quotes \"\"") + cmd.Flags().StringVarP(&tokenRole, "role", "r", "", "The new role for the "+ + "token. Possible values are WORKSPACE_MEMBER, WORKSPACE_OPERATOR and WORKSPACE_OWNER ") + return cmd +} + +func newWorkspaceTokenRotateCmd(out io.Writer) *cobra.Command { + cmd := &cobra.Command{ + Use: "rotate [TOKEN_ID]", + Aliases: []string{"ro"}, + Short: "Rotate a Workspace API token", + Long: "Rotate a Workspace API token. You can only rotate Worspace API tokens. You cannot rotate Organization API tokens with this command", + RunE: func(cmd *cobra.Command, args []string) error { + return rotateWorkspaceToken(cmd, args, out) + }, + } + cmd.Flags().BoolVarP(&cleanTokenOutput, "clean-output", "c", false, "Print only the token as output. For use of the command in scripts") + cmd.Flags().StringVarP(&name, "name", "t", "", "The name of the token to be rotated. If the name contains a space, specify the entire name within quotes \"\" ") + cmd.Flags().BoolVarP(&forceRotate, "force", "f", false, "Rotate the Workspace API token without showing a warning") + + return cmd +} + +func newWorkspaceTokenDeleteCmd(out io.Writer) *cobra.Command { + cmd := &cobra.Command{ + Use: "delete [TOKEN_ID]", + Aliases: []string{"de"}, + Short: "Delete a Workspace API token or remove an Organization API token from a Workspace", + Long: "Delete a Workspace API token or remove an Organization API token from a Workspace", + RunE: func(cmd *cobra.Command, args []string) error { + return deleteWorkspaceToken(cmd, args, out) + }, + } + cmd.Flags().StringVarP(&name, "name", "t", "", "The name of the token to be deleted. If the name contains a space, specify the entire name within quotes \"\" ") + cmd.Flags().BoolVarP(&forceDelete, "force", "f", false, "Delete or remove the API token without showing a warning") + + return cmd +} + +func newWorkspaceTokenAddCmd(out io.Writer) *cobra.Command { + cmd := &cobra.Command{ + Use: "add [ORG_TOKEN_ID]", + Short: "Add an Organization API token to an Astro Workspace", + Long: "Add an Organization API token to an Astro Workspace\n$astro workspace token add [ORG_TOKEN_NAME] --name [new token name] --role [WORKSPACE_MEMBER, " + + "WORKSPACE_OPERATOR, WORKSPACE_OWNER].", + RunE: func(cmd *cobra.Command, args []string) error { + return addOrgTokenToWorkspace(cmd, args, out) + }, + } + cmd.Flags().StringVarP(&orgTokenName, "org-token-name", "n", "", "The name of the Organization API token you want to add to a Workspace. If the name contains a space, specify the entire name within quotes \"\" ") + cmd.Flags().StringVarP(&tokenRole, "role", "r", "", "The Workspace role to grant to the "+ + "Organization API token. Possible values are WORKSPACE_MEMBER, WORKSPACE_OPERATOR and WORKSPACE_OWNER ") + return cmd } func newWorkspaceTeamRemoveCmd(out io.Writer) *cobra.Command { @@ -237,6 +371,11 @@ func newWorkspaceTeamRemoveCmd(out io.Writer) *cobra.Command { return cmd } +func listWorkspaceTeam(cmd *cobra.Command, out io.Writer) error { + cmd.SilenceUsage = true + return team.ListWorkspaceTeams(out, astroCoreClient, "") +} + func removeWorkspaceTeam(cmd *cobra.Command, args []string, out io.Writer) error { var id string @@ -299,10 +438,13 @@ func updateWorkspaceTeam(cmd *cobra.Command, args []string, out io.Writer) error if len(args) > 0 { id = args[0] } - + var err error if updateWorkspaceRole == "" { // no role was provided so ask the user for it - updateWorkspaceRole = input.Text("Enter a team workspace role(WORKSPACE_MEMBER, WORKSPACE_OPERATOR and WORKSPACE_OWNER) to update team: ") + updateWorkspaceRole, err = selectWorkspaceRole() + if err != nil { + return err + } } cmd.SilenceUsage = true @@ -317,14 +459,13 @@ func workspaceList(cmd *cobra.Command, out io.Writer) error { func workspaceSwitch(cmd *cobra.Command, out io.Writer, args []string) error { // Silence Usage as we have now validated command input - cmd.SilenceUsage = true id := "" if len(args) == 1 { id = args[0] } - + cmd.SilenceUsage = true return workspace.Switch(id, astroClient, out) } @@ -334,26 +475,22 @@ func workspaceCreate(cmd *cobra.Command, out io.Writer) error { } func workspaceUpdate(cmd *cobra.Command, out io.Writer, args []string) error { - cmd.SilenceUsage = true - id := "" if len(args) == 1 { id = args[0] } - + cmd.SilenceUsage = true return workspace.Update(id, workspaceName, workspaceDescription, enforceCD, out, astroCoreClient) } func workspaceDelete(cmd *cobra.Command, out io.Writer, args []string) error { - cmd.SilenceUsage = true - id := "" if len(args) == 1 { id = args[0] } - + cmd.SilenceUsage = true return workspace.Delete(id, out, astroCoreClient) } @@ -367,12 +504,12 @@ func addWorkspaceUser(cmd *cobra.Command, args []string, out io.Writer) error { } cmd.SilenceUsage = true - return user.AddWorkspaceUser(email, addWorkspaceRole, "", out, astroCoreClient) + return user.AddWorkspaceUser(email, addWorkspaceRole, workspaceID, out, astroCoreClient) } func listWorkspaceUser(cmd *cobra.Command, out io.Writer) error { cmd.SilenceUsage = true - return user.ListWorkspaceUsers(out, astroCoreClient, "") + return user.ListWorkspaceUsers(out, astroCoreClient, workspaceID) } func updateWorkspaceUser(cmd *cobra.Command, args []string, out io.Writer) error { @@ -390,7 +527,7 @@ func updateWorkspaceUser(cmd *cobra.Command, args []string, out io.Writer) error } cmd.SilenceUsage = true - return user.UpdateWorkspaceUserRole(email, updateWorkspaceRole, "", out, astroCoreClient) + return user.UpdateWorkspaceUserRole(email, updateWorkspaceRole, workspaceID, out, astroCoreClient) } func removeWorkspaceUser(cmd *cobra.Command, args []string, out io.Writer) error { @@ -403,7 +540,83 @@ func removeWorkspaceUser(cmd *cobra.Command, args []string, out io.Writer) error } cmd.SilenceUsage = true - return user.RemoveWorkspaceUser(email, "", out, astroCoreClient) + return user.RemoveWorkspaceUser(email, workspaceID, out, astroCoreClient) +} + +func listWorkspaceToken(cmd *cobra.Command, out io.Writer) error { + cmd.SilenceUsage = true + return workspace.ListTokens(astroCoreClient, workspaceID, out) +} + +func createWorkspaceToken(cmd *cobra.Command, out io.Writer) error { + if tokenName == "" { + // no role was provided so ask the user for it + tokenName = input.Text("Enter a name for the new Workspace API token: ") + } + if tokenRole == "" { + fmt.Println("select a Workspace Role for the new API token:") + // no role was provided so ask the user for it + var err error + tokenRole, err = selectWorkspaceRole() + if err != nil { + return err + } + } + cmd.SilenceUsage = true + + return workspace.CreateToken(tokenName, tokenDescription, tokenRole, workspaceID, tokenExpiration, cleanTokenOutput, out, astroCoreClient) +} + +func updateWorkspaceToken(cmd *cobra.Command, args []string, out io.Writer) error { + // if an id was provided in the args we use it + if len(args) > 0 { + // make sure the id is lowercase + tokenID = strings.ToLower(args[0]) + } + + cmd.SilenceUsage = true + return workspace.UpdateToken(tokenID, name, tokenName, tokenDescription, tokenRole, workspaceID, out, astroCoreClient) +} + +func rotateWorkspaceToken(cmd *cobra.Command, args []string, out io.Writer) error { + // if an id was provided in the args we use it + if len(args) > 0 { + // make sure the id is lowercase + tokenID = strings.ToLower(args[0]) + } + + cmd.SilenceUsage = true + return workspace.RotateToken(tokenID, name, workspaceID, cleanTokenOutput, forceRotate, out, astroCoreClient) +} + +func deleteWorkspaceToken(cmd *cobra.Command, args []string, out io.Writer) error { + // if an id was provided in the args we use it + if len(args) > 0 { + // make sure the id is lowercase + tokenID = strings.ToLower(args[0]) + } + + cmd.SilenceUsage = true + return workspace.DeleteToken(tokenID, name, workspaceID, forceDelete, out, astroCoreClient) +} + +func addOrgTokenToWorkspace(cmd *cobra.Command, args []string, out io.Writer) error { + // if an id was provided in the args we use it + if len(args) > 0 { + // make sure the id is lowercase + orgTokenID = strings.ToLower(args[0]) + } + if tokenRole == "" { + fmt.Println("select a Workspace Role for the Organization Token:") + // no role was provided so ask the user for it + var err error + tokenRole, err = selectWorkspaceRole() + if err != nil { + return err + } + } + cmd.SilenceUsage = true + return organization.AddOrgTokenToWorkspace(orgTokenID, tokenName, tokenRole, workspaceID, out, astroCoreClient) } func coalesceWorkspace() (string, error) { @@ -423,3 +636,29 @@ func coalesceWorkspace() (string, error) { return "", errors.New("no valid Workspace source found") } + +func selectWorkspaceRole() (string, error) { + tokenRolesMap := map[string]string{} + tab := &printutil.Table{ + Padding: []int{44, 50}, + DynamicPadding: true, + Header: []string{"#", "ROLE"}, + } + roles := []string{"WORKSPACE_MEMBER", "WORKSPACE_OPERATOR", "WORKSPACE_OWNER"} + for i := range roles { + index := i + 1 + tab.AddRow([]string{ + strconv.Itoa(index), + roles[i], + }, false) + tokenRolesMap[strconv.Itoa(index)] = roles[i] + } + + tab.Print(os.Stdout) + choice := input.Text("\n> ") + selected, ok := tokenRolesMap[choice] + if !ok { + return "", errInvalidWorkspaceRoleKey + } + return selected, nil +} diff --git a/cmd/cloud/workspace_test.go b/cmd/cloud/workspace_test.go index 816dc1484..8c9aa5d6f 100644 --- a/cmd/cloud/workspace_test.go +++ b/cmd/cloud/workspace_test.go @@ -999,3 +999,584 @@ func TestWorkspaceTeamRemove(t *testing.T) { assert.Contains(t, resp, expectedOut) }) } + +// test workspace token commands + +var ( + description1 = "Description 1" + description2 = "Description 2" + fullName1 = "User 1" + fullName2 = "User 2" + token = "token" + apiToken1 = astrocore.ApiToken{Id: "token1", Name: "Token 1", Token: &token, Description: description1, Type: "Type 1", Roles: []astrocore.ApiTokenRole{{EntityId: "WORKSPACE", Role: "WORKSPACE_MEMBER"}}, CreatedAt: time.Now(), CreatedBy: &astrocore.BasicSubjectProfile{FullName: &fullName1}} + apiTokens = []astrocore.ApiToken{ + apiToken1, + {Id: "token2", Name: "Token 2", Description: description2, Type: "Type 2", Roles: []astrocore.ApiTokenRole{{EntityId: "WORKSPACE", Role: "WORKSPACE_MEMBER"}}, CreatedAt: time.Now(), CreatedBy: &astrocore.BasicSubjectProfile{FullName: &fullName2}}, + } + ListWorkspaceAPITokensResponseOK = astrocore.ListWorkspaceApiTokensResponse{ + HTTPResponse: &http.Response{ + StatusCode: 200, + }, + JSON200: &astrocore.ListApiTokensPaginated{ + ApiTokens: apiTokens, + Limit: 1, + Offset: 0, + }, + } + errorTokenList, _ = json.Marshal(astrocore.Error{ + Message: "failed to list tokens", + }) + ListWorkspaceAPITokensResponseError = astrocore.ListWorkspaceApiTokensResponse{ + HTTPResponse: &http.Response{ + StatusCode: 500, + }, + Body: errorTokenList, + JSON200: nil, + } + CreateWorkspaceAPITokenResponseOK = astrocore.CreateWorkspaceApiTokenResponse{ + HTTPResponse: &http.Response{ + StatusCode: 200, + }, + JSON200: &apiToken1, + } + CreateWorkspaceAPITokenResponseError = astrocore.CreateWorkspaceApiTokenResponse{ + HTTPResponse: &http.Response{ + StatusCode: 500, + }, + Body: errorBodyCreate, + JSON200: nil, + } + UpdateWorkspaceAPITokenResponseOK = astrocore.UpdateWorkspaceApiTokenResponse{ + HTTPResponse: &http.Response{ + StatusCode: 200, + }, + JSON200: &apiToken1, + } + errorTokenUpdate, _ = json.Marshal(astrocore.Error{ + Message: "failed to update token", + }) + UpdateWorkspaceAPITokenResponseError = astrocore.UpdateWorkspaceApiTokenResponse{ + HTTPResponse: &http.Response{ + StatusCode: 500, + }, + Body: errorTokenUpdate, + JSON200: nil, + } + RotateWorkspaceAPITokenResponseOK = astrocore.RotateWorkspaceApiTokenResponse{ + HTTPResponse: &http.Response{ + StatusCode: 200, + }, + JSON200: &apiToken1, + } + errorTokenRotate, _ = json.Marshal(astrocore.Error{ + Message: "failed to rotate token", + }) + RotateWorkspaceAPITokenResponseError = astrocore.RotateWorkspaceApiTokenResponse{ + HTTPResponse: &http.Response{ + StatusCode: 500, + }, + Body: errorTokenRotate, + JSON200: nil, + } + DeleteWorkspaceAPITokenResponseOK = astrocore.DeleteWorkspaceApiTokenResponse{ + HTTPResponse: &http.Response{ + StatusCode: 200, + }, + } + errorTokenDelete, _ = json.Marshal(astrocore.Error{ + Message: "failed to delete token", + }) + DeleteWorkspaceAPITokenResponseError = astrocore.DeleteWorkspaceApiTokenResponse{ + HTTPResponse: &http.Response{ + StatusCode: 500, + }, + Body: errorTokenDelete, + } +) + +func TestWorkspaceTokenRootCommand(t *testing.T) { + testUtil.InitTestConfig(testUtil.CloudPlatform) + buf := new(bytes.Buffer) + cmd := newWorkspaceCmd(os.Stdout) + cmd.SetOut(buf) + cmdArgs := []string{"token", "-h"} + _, err := execWorkspaceCmd(cmdArgs...) + assert.NoError(t, err) +} + +func TestWorkspaceTokenList(t *testing.T) { + expectedHelp := "List all the API tokens in an Astro Workspace" + testUtil.InitTestConfig(testUtil.CloudPlatform) + + t.Run("-h prints list help", func(t *testing.T) { + cmdArgs := []string{"token", "list", "-h"} + resp, err := execWorkspaceCmd(cmdArgs...) + assert.NoError(t, err) + assert.Contains(t, resp, expectedHelp) + }) + t.Run("any errors from api are returned and tokens are not listed", func(t *testing.T) { + testUtil.InitTestConfig(testUtil.CloudPlatform) + mockClient := new(astrocore_mocks.ClientWithResponsesInterface) + mockClient.On("ListWorkspaceApiTokensWithResponse", mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(&ListWorkspaceAPITokensResponseError, nil).Twice() + astroCoreClient = mockClient + cmdArgs := []string{"token", "list"} + _, err := execWorkspaceCmd(cmdArgs...) + assert.ErrorContains(t, err, "failed to list tokens") + }) + t.Run("any context errors from api are returned and tokens are not listed", func(t *testing.T) { + testUtil.InitTestConfig(testUtil.Initial) + mockClient := new(astrocore_mocks.ClientWithResponsesInterface) + mockClient.On("ListWorkspaceApiTokensWithResponse", mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(&ListWorkspaceAPITokensResponseOK, nil).Twice() + astroCoreClient = mockClient + cmdArgs := []string{"token", "list"} + _, err := execWorkspaceCmd(cmdArgs...) + assert.Error(t, err) + }) + + t.Run("tokens are listed", func(t *testing.T) { + testUtil.InitTestConfig(testUtil.CloudPlatform) + mockClient := new(astrocore_mocks.ClientWithResponsesInterface) + mockClient.On("ListWorkspaceApiTokensWithResponse", mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(&ListWorkspaceAPITokensResponseOK, nil).Twice() + astroCoreClient = mockClient + cmdArgs := []string{"token", "list"} + _, err := execWorkspaceCmd(cmdArgs...) + assert.NoError(t, err) + }) +} + +func TestWorkspaceTokenCreate(t *testing.T) { + expectedHelp := "Create an API token in an Astro Workspace" + testUtil.InitTestConfig(testUtil.CloudPlatform) + + t.Run("-h prints list help", func(t *testing.T) { + cmdArgs := []string{"token", "create", "-h"} + resp, err := execWorkspaceCmd(cmdArgs...) + assert.NoError(t, err) + assert.Contains(t, resp, expectedHelp) + }) + t.Run("any errors from api are returned and token is not created", func(t *testing.T) { + testUtil.InitTestConfig(testUtil.CloudPlatform) + mockClient := new(astrocore_mocks.ClientWithResponsesInterface) + mockClient.On("CreateWorkspaceApiTokenWithResponse", mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(&CreateWorkspaceAPITokenResponseError, nil) + astroCoreClient = mockClient + cmdArgs := []string{"token", "create", "--name", "Token 1", "--role", "WORKSPACE_MEMBER"} + _, err := execWorkspaceCmd(cmdArgs...) + assert.ErrorContains(t, err, "failed to create workspace") + }) + t.Run("any context errors from api are returned and token is not created", func(t *testing.T) { + testUtil.InitTestConfig(testUtil.Initial) + mockClient := new(astrocore_mocks.ClientWithResponsesInterface) + mockClient.On("CreateWorkspaceApiTokenWithResponse", mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(&CreateWorkspaceAPITokenResponseOK, nil) + astroCoreClient = mockClient + cmdArgs := []string{"token", "list"} + _, err := execWorkspaceCmd(cmdArgs...) + assert.Error(t, err) + }) + t.Run("token is created", func(t *testing.T) { + testUtil.InitTestConfig(testUtil.CloudPlatform) + mockClient := new(astrocore_mocks.ClientWithResponsesInterface) + mockClient.On("CreateWorkspaceApiTokenWithResponse", mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(&CreateWorkspaceAPITokenResponseOK, nil) + astroCoreClient = mockClient + cmdArgs := []string{"token", "create", "--name", "Token 1", "--role", "WORKSPACE_MEMBER"} + _, err := execWorkspaceCmd(cmdArgs...) + assert.NoError(t, err) + }) + t.Run("token is created with no name provided", func(t *testing.T) { + testUtil.InitTestConfig(testUtil.CloudPlatform) + mockClient := new(astrocore_mocks.ClientWithResponsesInterface) + mockClient.On("CreateWorkspaceApiTokenWithResponse", mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(&CreateWorkspaceAPITokenResponseOK, nil) + // mock os.Stdin + expectedInput := []byte("Token 1") + r, w, err := os.Pipe() + assert.NoError(t, err) + _, err = w.Write(expectedInput) + assert.NoError(t, err) + w.Close() + stdin := os.Stdin + // Restore stdin right after the test. + defer func() { os.Stdin = stdin }() + os.Stdin = r + astroCoreClient = mockClient + cmdArgs := []string{"token", "create", "--role", "WORKSPACE_MEMBER"} + _, err = execWorkspaceCmd(cmdArgs...) + assert.NoError(t, err) + }) + t.Run("token is created with no role provided", func(t *testing.T) { + testUtil.InitTestConfig(testUtil.CloudPlatform) + mockClient := new(astrocore_mocks.ClientWithResponsesInterface) + mockClient.On("CreateWorkspaceApiTokenWithResponse", mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(&CreateWorkspaceAPITokenResponseOK, nil) + // mock os.Stdin + expectedInput := []byte("1") + r, w, err := os.Pipe() + assert.NoError(t, err) + _, err = w.Write(expectedInput) + assert.NoError(t, err) + w.Close() + stdin := os.Stdin + // Restore stdin right after the test. + defer func() { os.Stdin = stdin }() + os.Stdin = r + astroCoreClient = mockClient + cmdArgs := []string{"token", "create", "--name", "Token 1"} + _, err = execWorkspaceCmd(cmdArgs...) + assert.NoError(t, err) + }) +} + +func TestWorkspaceTokenUpdate(t *testing.T) { + expectedHelp := "Update a Workspace or Organaization API token" + testUtil.InitTestConfig(testUtil.CloudPlatform) + + t.Run("-h prints list help", func(t *testing.T) { + cmdArgs := []string{"token", "update", "-h"} + resp, err := execWorkspaceCmd(cmdArgs...) + assert.NoError(t, err) + assert.Contains(t, resp, expectedHelp) + }) + t.Run("any errors from api are returned and token is not updated", func(t *testing.T) { + testUtil.InitTestConfig(testUtil.CloudPlatform) + mockClient := new(astrocore_mocks.ClientWithResponsesInterface) + mockClient.On("ListWorkspaceApiTokensWithResponse", mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(&ListWorkspaceAPITokensResponseOK, nil) + mockClient.On("UpdateWorkspaceApiTokenWithResponse", mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(&UpdateWorkspaceAPITokenResponseError, nil) + astroCoreClient = mockClient + cmdArgs := []string{"token", "update", "token1"} + _, err := execWorkspaceCmd(cmdArgs...) + assert.ErrorContains(t, err, "failed to update token") + }) + t.Run("any context errors from api are returned and token is not updated", func(t *testing.T) { + testUtil.InitTestConfig(testUtil.Initial) + mockClient := new(astrocore_mocks.ClientWithResponsesInterface) + mockClient.On("ListWorkspaceApiTokensWithResponse", mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(&ListWorkspaceAPITokensResponseOK, nil) + mockClient.On("UpdateWorkspaceApiTokenWithResponse", mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(&UpdateWorkspaceAPITokenResponseOK, nil) + astroCoreClient = mockClient + cmdArgs := []string{"token", "update", "token1"} + _, err := execWorkspaceCmd(cmdArgs...) + assert.Error(t, err) + }) + t.Run("token is updated", func(t *testing.T) { + testUtil.InitTestConfig(testUtil.CloudPlatform) + mockClient := new(astrocore_mocks.ClientWithResponsesInterface) + mockClient.On("ListWorkspaceApiTokensWithResponse", mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(&ListWorkspaceAPITokensResponseOK, nil) + mockClient.On("UpdateWorkspaceApiTokenWithResponse", mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(&UpdateWorkspaceAPITokenResponseOK, nil) + astroCoreClient = mockClient + cmdArgs := []string{"token", "update", "token1"} + _, err := execWorkspaceCmd(cmdArgs...) + assert.NoError(t, err) + }) + t.Run("token is created with no ID provided", func(t *testing.T) { + testUtil.InitTestConfig(testUtil.CloudPlatform) + mockClient := new(astrocore_mocks.ClientWithResponsesInterface) + mockClient.On("ListWorkspaceApiTokensWithResponse", mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(&ListWorkspaceAPITokensResponseOK, nil) + mockClient.On("UpdateWorkspaceApiTokenWithResponse", mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(&UpdateWorkspaceAPITokenResponseOK, nil) + // mock os.Stdin + expectedInput := []byte("1") + r, w, err := os.Pipe() + assert.NoError(t, err) + _, err = w.Write(expectedInput) + assert.NoError(t, err) + w.Close() + stdin := os.Stdin + // Restore stdin right after the test. + defer func() { os.Stdin = stdin }() + os.Stdin = r + astroCoreClient = mockClient + cmdArgs := []string{"token", "update"} + _, err = execWorkspaceCmd(cmdArgs...) + assert.NoError(t, err) + }) +} + +func TestWorkspaceTokenRotate(t *testing.T) { + expectedHelp := "Rotate a Workspace API token" + testUtil.InitTestConfig(testUtil.CloudPlatform) + + t.Run("-h prints list help", func(t *testing.T) { + cmdArgs := []string{"token", "rotate", "-h"} + resp, err := execWorkspaceCmd(cmdArgs...) + assert.NoError(t, err) + assert.Contains(t, resp, expectedHelp) + }) + t.Run("any errors from api are returned and token is not rotated", func(t *testing.T) { + testUtil.InitTestConfig(testUtil.CloudPlatform) + mockClient := new(astrocore_mocks.ClientWithResponsesInterface) + mockClient.On("ListWorkspaceApiTokensWithResponse", mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(&ListWorkspaceAPITokensResponseOK, nil) + mockClient.On("RotateWorkspaceApiTokenWithResponse", mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(&RotateWorkspaceAPITokenResponseError, nil) + astroCoreClient = mockClient + cmdArgs := []string{"token", "rotate", "token1", "--force"} + _, err := execWorkspaceCmd(cmdArgs...) + assert.ErrorContains(t, err, "failed to rotate token") + }) + t.Run("any context errors from api are returned and token is not rotated", func(t *testing.T) { + testUtil.InitTestConfig(testUtil.Initial) + mockClient := new(astrocore_mocks.ClientWithResponsesInterface) + mockClient.On("ListWorkspaceApiTokensWithResponse", mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(&ListWorkspaceAPITokensResponseOK, nil).Twice() + mockClient.On("RotateWorkspaceApiTokenWithResponse", mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(&RotateWorkspaceAPITokenResponseOK, nil) + astroCoreClient = mockClient + cmdArgs := []string{"token", "rotate", "token1"} + _, err := execWorkspaceCmd(cmdArgs...) + assert.Error(t, err) + }) + t.Run("token is rotated", func(t *testing.T) { + testUtil.InitTestConfig(testUtil.CloudPlatform) + mockClient := new(astrocore_mocks.ClientWithResponsesInterface) + mockClient.On("ListWorkspaceApiTokensWithResponse", mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(&ListWorkspaceAPITokensResponseOK, nil) + mockClient.On("RotateWorkspaceApiTokenWithResponse", mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(&RotateWorkspaceAPITokenResponseOK, nil) + astroCoreClient = mockClient + cmdArgs := []string{"token", "rotate", "token1", "--force"} + _, err := execWorkspaceCmd(cmdArgs...) + assert.NoError(t, err) + }) + t.Run("token is rotated with no ID provided", func(t *testing.T) { + testUtil.InitTestConfig(testUtil.CloudPlatform) + mockClient := new(astrocore_mocks.ClientWithResponsesInterface) + mockClient.On("ListWorkspaceApiTokensWithResponse", mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(&ListWorkspaceAPITokensResponseOK, nil) + mockClient.On("RotateWorkspaceApiTokenWithResponse", mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(&RotateWorkspaceAPITokenResponseOK, nil) + // mock os.Stdin + expectedInput := []byte("1") + r, w, err := os.Pipe() + assert.NoError(t, err) + _, err = w.Write(expectedInput) + assert.NoError(t, err) + w.Close() + stdin := os.Stdin + // Restore stdin right after the test. + defer func() { os.Stdin = stdin }() + os.Stdin = r + astroCoreClient = mockClient + cmdArgs := []string{"token", "rotate", "--force"} + _, err = execWorkspaceCmd(cmdArgs...) + assert.NoError(t, err) + }) + t.Run("token is rotated with and confirmed", func(t *testing.T) { + testUtil.InitTestConfig(testUtil.CloudPlatform) + mockClient := new(astrocore_mocks.ClientWithResponsesInterface) + mockClient.On("ListWorkspaceApiTokensWithResponse", mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(&ListWorkspaceAPITokensResponseOK, nil) + mockClient.On("RotateWorkspaceApiTokenWithResponse", mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(&RotateWorkspaceAPITokenResponseOK, nil) + // mock os.Stdin + expectedInput := []byte("y") + r, w, err := os.Pipe() + assert.NoError(t, err) + _, err = w.Write(expectedInput) + assert.NoError(t, err) + w.Close() + stdin := os.Stdin + // Restore stdin right after the test. + defer func() { os.Stdin = stdin }() + os.Stdin = r + astroCoreClient = mockClient + cmdArgs := []string{"token", "rotate", "token1"} + _, err = execWorkspaceCmd(cmdArgs...) + assert.NoError(t, err) + }) +} + +func TestWorkspaceTokenDelete(t *testing.T) { + expectedHelp := "Delete a Workspace API token or remove an Organization API token from a Workspace" + testUtil.InitTestConfig(testUtil.CloudPlatform) + + t.Run("-h prints list help", func(t *testing.T) { + cmdArgs := []string{"token", "delete", "-h"} + resp, err := execWorkspaceCmd(cmdArgs...) + assert.NoError(t, err) + assert.Contains(t, resp, expectedHelp) + }) + t.Run("any errors from api are returned and token is not deleted", func(t *testing.T) { + testUtil.InitTestConfig(testUtil.CloudPlatform) + mockClient := new(astrocore_mocks.ClientWithResponsesInterface) + mockClient.On("ListWorkspaceApiTokensWithResponse", mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(&ListWorkspaceAPITokensResponseOK, nil) + mockClient.On("DeleteWorkspaceApiTokenWithResponse", mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(&DeleteWorkspaceAPITokenResponseError, nil) + astroCoreClient = mockClient + cmdArgs := []string{"token", "delete", "token1", "--force"} + _, err := execWorkspaceCmd(cmdArgs...) + assert.ErrorContains(t, err, "failed to delete token") + }) + t.Run("any context errors from api are returned and token is not deleted", func(t *testing.T) { + testUtil.InitTestConfig(testUtil.Initial) + mockClient := new(astrocore_mocks.ClientWithResponsesInterface) + mockClient.On("ListWorkspaceApiTokensWithResponse", mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(&ListWorkspaceAPITokensResponseOK, nil).Twice() + mockClient.On("DeleteWorkspaceApiTokenWithResponse", mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(&DeleteWorkspaceAPITokenResponseOK, nil) + astroCoreClient = mockClient + cmdArgs := []string{"token", "delete", "token1"} + _, err := execWorkspaceCmd(cmdArgs...) + assert.Error(t, err) + }) + t.Run("token is deleted", func(t *testing.T) { + testUtil.InitTestConfig(testUtil.CloudPlatform) + mockClient := new(astrocore_mocks.ClientWithResponsesInterface) + mockClient.On("ListWorkspaceApiTokensWithResponse", mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(&ListWorkspaceAPITokensResponseOK, nil) + mockClient.On("DeleteWorkspaceApiTokenWithResponse", mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(&DeleteWorkspaceAPITokenResponseOK, nil) + astroCoreClient = mockClient + cmdArgs := []string{"token", "delete", "token1", "--force"} + _, err := execWorkspaceCmd(cmdArgs...) + assert.NoError(t, err) + }) + t.Run("token is deleted with no ID provided", func(t *testing.T) { + testUtil.InitTestConfig(testUtil.CloudPlatform) + mockClient := new(astrocore_mocks.ClientWithResponsesInterface) + mockClient.On("ListWorkspaceApiTokensWithResponse", mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(&ListWorkspaceAPITokensResponseOK, nil) + mockClient.On("DeleteWorkspaceApiTokenWithResponse", mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(&DeleteWorkspaceAPITokenResponseOK, nil) + // mock os.Stdin + expectedInput := []byte("1") + r, w, err := os.Pipe() + assert.NoError(t, err) + _, err = w.Write(expectedInput) + assert.NoError(t, err) + w.Close() + stdin := os.Stdin + // Restore stdin right after the test. + defer func() { os.Stdin = stdin }() + os.Stdin = r + astroCoreClient = mockClient + cmdArgs := []string{"token", "delete", "--force"} + _, err = execWorkspaceCmd(cmdArgs...) + assert.NoError(t, err) + }) + t.Run("token is delete with and confirmed", func(t *testing.T) { + testUtil.InitTestConfig(testUtil.CloudPlatform) + mockClient := new(astrocore_mocks.ClientWithResponsesInterface) + mockClient.On("ListWorkspaceApiTokensWithResponse", mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(&ListWorkspaceAPITokensResponseOK, nil) + mockClient.On("DeleteWorkspaceApiTokenWithResponse", mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(&DeleteWorkspaceAPITokenResponseOK, nil) + // mock os.Stdin + expectedInput := []byte("y") + r, w, err := os.Pipe() + assert.NoError(t, err) + _, err = w.Write(expectedInput) + assert.NoError(t, err) + w.Close() + stdin := os.Stdin + // Restore stdin right after the test. + defer func() { os.Stdin = stdin }() + os.Stdin = r + astroCoreClient = mockClient + cmdArgs := []string{"token", "delete", "token1"} + _, err = execWorkspaceCmd(cmdArgs...) + assert.NoError(t, err) + }) +} + +var ( + apiToken2 = astrocore.ApiToken{Id: "token1", Name: "Token 1", Token: &token, Description: description1, Type: "Type 1", Roles: []astrocore.ApiTokenRole{{EntityId: "WORKSPACE", Role: "WORKSPACE_MEMBER"}, {EntityId: "ORGANIZATION", Role: "ORGANIZATION_MEMBER"}}, CreatedAt: time.Now(), CreatedBy: &astrocore.BasicSubjectProfile{FullName: &fullName1}} + apiTokens2 = []astrocore.ApiToken{ + apiToken2, + {Id: "token2", Name: "Token 2", Description: description2, Type: "Type 2", Roles: []astrocore.ApiTokenRole{{EntityId: "ORGANIZATION", Role: "ORGANIZATION_MEMBER"}}, CreatedAt: time.Now(), CreatedBy: &astrocore.BasicSubjectProfile{FullName: &fullName2}}, + } + ListOrganizationAPITokensResponseOK = astrocore.ListOrganizationApiTokensResponse{ + HTTPResponse: &http.Response{ + StatusCode: 200, + }, + JSON200: &astrocore.ListApiTokensPaginated{ + ApiTokens: apiTokens2, + Limit: 1, + Offset: 0, + }, + } + errorOrgTokenList, _ = json.Marshal(astrocore.Error{ + Message: "failed to list tokens", + }) + ListOrganizationAPITokensResponseError = astrocore.ListOrganizationApiTokensResponse{ + HTTPResponse: &http.Response{ + StatusCode: 500, + }, + Body: errorOrgTokenList, + JSON200: nil, + } + UpdateOrganizationAPITokenResponseOK = astrocore.UpdateOrganizationApiTokenResponse{ + HTTPResponse: &http.Response{ + StatusCode: 200, + }, + JSON200: &apiToken1, + } + errorOrgTokenUpdate, _ = json.Marshal(astrocore.Error{ + Message: "failed to update tokens", + }) + UpdateOrganizationAPITokenResponseError = astrocore.UpdateOrganizationApiTokenResponse{ + HTTPResponse: &http.Response{ + StatusCode: 500, + }, + Body: errorOrgTokenUpdate, + JSON200: nil, + } +) + +func TestWorkspaceTokenAdd(t *testing.T) { + expectedHelp := "Add an Organization API token to an Astro Workspace" + testUtil.InitTestConfig(testUtil.CloudPlatform) + + t.Run("-h prints list help", func(t *testing.T) { + cmdArgs := []string{"token", "add", "-h"} + resp, err := execWorkspaceCmd(cmdArgs...) + assert.NoError(t, err) + assert.Contains(t, resp, expectedHelp) + }) + t.Run("any errors from api are returned and token is not added", func(t *testing.T) { + testUtil.InitTestConfig(testUtil.CloudPlatform) + mockClient := new(astrocore_mocks.ClientWithResponsesInterface) + mockClient.On("ListOrganizationApiTokensWithResponse", mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(&ListOrganizationAPITokensResponseError, nil) + astroCoreClient = mockClient + cmdArgs := []string{"token", "add", "token1", "--role", "WORKSPACE_MEMBER"} + _, err := execWorkspaceCmd(cmdArgs...) + assert.ErrorContains(t, err, "failed to list tokens") + }) + t.Run("any context errors from api are returned and token is not added", func(t *testing.T) { + testUtil.InitTestConfig(testUtil.Initial) + mockClient := new(astrocore_mocks.ClientWithResponsesInterface) + mockClient.On("ListOrganizationApiTokensWithResponse", mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(&ListOrganizationAPITokensResponseOK, nil) + mockClient.On("UpdateOrganizationApiTokenWithResponse", mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(&UpdateOrganizationAPITokenResponseOK, nil) + astroCoreClient = mockClient + cmdArgs := []string{"token", "update", "token1", "--role", "WORKSPACE_MEMBER"} + _, err := execWorkspaceCmd(cmdArgs...) + assert.Error(t, err) + }) + t.Run("token is added", func(t *testing.T) { + testUtil.InitTestConfig(testUtil.CloudPlatform) + mockClient := new(astrocore_mocks.ClientWithResponsesInterface) + mockClient.On("ListOrganizationApiTokensWithResponse", mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(&ListOrganizationAPITokensResponseOK, nil) + mockClient.On("UpdateOrganizationApiTokenWithResponse", mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(&UpdateOrganizationAPITokenResponseOK, nil) + astroCoreClient = mockClient + cmdArgs := []string{"token", "add", "token2", "--role", "WORKSPACE_MEMBER"} + _, err := execWorkspaceCmd(cmdArgs...) + assert.NoError(t, err) + }) + t.Run("token is created with no ID provided", func(t *testing.T) { + testUtil.InitTestConfig(testUtil.CloudPlatform) + mockClient := new(astrocore_mocks.ClientWithResponsesInterface) + mockClient.On("ListOrganizationApiTokensWithResponse", mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(&ListOrganizationAPITokensResponseOK, nil) + mockClient.On("UpdateOrganizationApiTokenWithResponse", mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(&UpdateOrganizationAPITokenResponseOK, nil) + // mock os.Stdin + expectedInput := []byte("2") + r, w, err := os.Pipe() + assert.NoError(t, err) + _, err = w.Write(expectedInput) + assert.NoError(t, err) + w.Close() + stdin := os.Stdin + // Restore stdin right after the test. + defer func() { os.Stdin = stdin }() + os.Stdin = r + astroCoreClient = mockClient + cmdArgs := []string{"token", "add", "--role", "WORKSPACE_MEMBER"} + _, err = execWorkspaceCmd(cmdArgs...) + assert.NoError(t, err) + }) + t.Run("token is created with no role provided", func(t *testing.T) { + testUtil.InitTestConfig(testUtil.CloudPlatform) + mockClient := new(astrocore_mocks.ClientWithResponsesInterface) + mockClient.On("ListOrganizationApiTokensWithResponse", mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(&ListOrganizationAPITokensResponseOK, nil) + mockClient.On("UpdateOrganizationApiTokenWithResponse", mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(&UpdateOrganizationAPITokenResponseOK, nil) + // mock os.Stdin + expectedInput := []byte("1") + r, w, err := os.Pipe() + assert.NoError(t, err) + _, err = w.Write(expectedInput) + assert.NoError(t, err) + w.Close() + stdin := os.Stdin + // Restore stdin right after the test. + defer func() { os.Stdin = stdin }() + os.Stdin = r + astroCoreClient = mockClient + cmdArgs := []string{"token", "add", "token2"} + _, err = execWorkspaceCmd(cmdArgs...) + assert.NoError(t, err) + }) +}