diff --git a/client_test.go b/client_test.go index 68c02f3..bda978f 100644 --- a/client_test.go +++ b/client_test.go @@ -106,7 +106,7 @@ func TestServiceCreate(t *testing.T) { stats, err := c.ServiceClickHouseQueryStats( ctx, project, in.ServiceName, clickhouse.ServiceClickHouseQueryStatsLimit(1), - clickhouse.ServiceClickHouseQueryStatsOrderByType(clickhouse.OrderByTypeMaxTimeasc), + clickhouse.ServiceClickHouseQueryStatsOrderByType(clickhouse.OrderByTypeMaxTimeAsc), ) require.NoError(t, err) assert.Len(t, stats, 1) diff --git a/generator/main.go b/generator/main.go index 2d6b054..d383d39 100644 --- a/generator/main.go +++ b/generator/main.go @@ -405,7 +405,7 @@ func exec() error { if rsp.CamelName != schemaOut.CamelName { // Takes original name and turns to camel. // "CamelName" field might have been modified because of name collisions - outReturn.Dot(strcase.ToCamel(rsp.name)) + outReturn.Dot(customCamelCase(rsp.name)) if forcePointer { // return &out.Foo @@ -488,7 +488,7 @@ func writeStruct(f *jen.File, s *Schema) error { continue } - constant := s.CamelName + strcase.ToCamel(literal) + constant := s.CamelName + customCamelCase(literal) // KafkaMirror ReplicationPolicyClassType makes bad generated name if strings.HasPrefix(literal, "org.apache.kafka.connect.mirror.") { @@ -529,7 +529,7 @@ func fmtStruct(s *Schema) *jen.Statement { fields := make([]jen.Code, 0, len(s.Properties)) for _, k := range s.propertyNames { p := s.Properties[k] - field := jen.Id(strcase.ToCamel(k)).Add(getType(p)) + field := jen.Id(customCamelCase(k)).Add(getType(p)) tag := k if !p.required { @@ -648,3 +648,14 @@ func fmtQueryParam(funcName, queryParamType string, p *Parameter) (*jen.Statemen func fmtQueryParamType() *jen.Statement { return jen.Index(jen.Lit(queryParamArraySize)).String() } + +func customCamelCase(s string) string { + // Split the string by ":" + parts := strings.Split(s, ":") + for i, part := range parts { + // Convert each part to camelCase using strcase.ToCamel + parts[i] = strcase.ToCamel(part) + } + // Join the parts back together + return strings.Join(parts, "") +} diff --git a/generator/models.go b/generator/models.go index 0d7b54c..0c99d04 100644 --- a/generator/models.go +++ b/generator/models.go @@ -199,14 +199,14 @@ func (s *Schema) init(doc *Doc, scope map[string]*Schema, name string) { } s.name = name - s.CamelName = strcase.ToCamel(s.name) + s.CamelName = customCamelCase(s.name) if s.isEnum() { const enumTypeSuffix = "Type" betterName := getEnumName(s) if betterName != s.name { - s.CamelName = cleanEnumName.ReplaceAllString(strcase.ToCamel(betterName), "") + s.CamelName + s.CamelName = cleanEnumName.ReplaceAllString(customCamelCase(betterName), "") + s.CamelName } if !strings.Contains(s.CamelName, enumTypeSuffix) { @@ -236,7 +236,7 @@ func (s *Schema) init(doc *Doc, scope map[string]*Schema, name string) { } if s.parent != nil && s.parent.isPrivate() { - s.CamelName = strcase.ToCamel(s.parent.CamelName) + s.CamelName = customCamelCase(s.parent.CamelName) } // Some cases just impossible to cover @@ -305,9 +305,9 @@ func (s *Schema) init(doc *Doc, scope map[string]*Schema, name string) { } if parent.isPrivate() { - s.CamelName = strcase.ToCamel(parent.CamelName) + s.CamelName = customCamelCase(parent.CamelName) } else { - s.CamelName = strings.TrimSuffix(strcase.ToCamel(parent.CamelName), suffix) + s.CamelName + s.CamelName = strings.TrimSuffix(customCamelCase(parent.CamelName), suffix) + s.CamelName } // Marks all have collision diff --git a/handler/account/account.go b/handler/account/account.go index 60de50f..ea5b28d 100644 --- a/handler/account/account.go +++ b/handler/account/account.go @@ -549,27 +549,29 @@ type EventOut struct { type MemberType string const ( - MemberTypeAdmin MemberType = "admin" - MemberTypeDeveloper MemberType = "developer" - MemberTypeOperator MemberType = "operator" - MemberTypeProjectpermissionsread MemberType = "project:permissions:read" - MemberTypeReadOnly MemberType = "read_only" - MemberTypeServicelogsread MemberType = "service:logs:read" + MemberTypeAdmin MemberType = "admin" + MemberTypeDeveloper MemberType = "developer" + MemberTypeOperator MemberType = "operator" + MemberTypeProjectIntegrationsRead MemberType = "project:integrations:read" + MemberTypeProjectPermissionsRead MemberType = "project:permissions:read" + MemberTypeProjectServicesRead MemberType = "project:services:read" + MemberTypeReadOnly MemberType = "read_only" + MemberTypeServiceLogsRead MemberType = "service:logs:read" ) func MemberTypeChoices() []string { - return []string{"admin", "developer", "operator", "project:permissions:read", "read_only", "service:logs:read"} + return []string{"admin", "developer", "operator", "project:integrations:read", "project:permissions:read", "project:services:read", "read_only", "service:logs:read"} } type OrderByType string const ( - OrderByTypeUserEmailasc OrderByType = "user_email:asc" - OrderByTypeUserEmaildesc OrderByType = "user_email:desc" - OrderByTypeUserIdasc OrderByType = "user_id:asc" - OrderByTypeUserIddesc OrderByType = "user_id:desc" - OrderByTypeRealNameasc OrderByType = "real_name:asc" - OrderByTypeRealNamedesc OrderByType = "real_name:desc" + OrderByTypeUserEmailAsc OrderByType = "user_email:asc" + OrderByTypeUserEmailDesc OrderByType = "user_email:desc" + OrderByTypeUserIdAsc OrderByType = "user_id:asc" + OrderByTypeUserIdDesc OrderByType = "user_id:desc" + OrderByTypeRealNameAsc OrderByType = "real_name:asc" + OrderByTypeRealNameDesc OrderByType = "real_name:desc" ) func OrderByTypeChoices() []string { @@ -634,16 +636,18 @@ type TeamOut struct { type TeamType string const ( - TeamTypeAdmin TeamType = "admin" - TeamTypeOperator TeamType = "operator" - TeamTypeDeveloper TeamType = "developer" - TeamTypeReadOnly TeamType = "read_only" - TeamTypeProjectpermissionsread TeamType = "project:permissions:read" - TeamTypeServicelogsread TeamType = "service:logs:read" + TeamTypeAdmin TeamType = "admin" + TeamTypeOperator TeamType = "operator" + TeamTypeDeveloper TeamType = "developer" + TeamTypeReadOnly TeamType = "read_only" + TeamTypeProjectIntegrationsRead TeamType = "project:integrations:read" + TeamTypeProjectPermissionsRead TeamType = "project:permissions:read" + TeamTypeServiceLogsRead TeamType = "service:logs:read" + TeamTypeProjectServicesRead TeamType = "project:services:read" ) func TeamTypeChoices() []string { - return []string{"admin", "operator", "developer", "read_only", "project:permissions:read", "service:logs:read"} + return []string{"admin", "operator", "developer", "read_only", "project:integrations:read", "project:permissions:read", "service:logs:read", "project:services:read"} } type TechEmailOut struct { diff --git a/handler/accountauthentication/accountauthentication.go b/handler/accountauthentication/accountauthentication.go index 81f2bc1..6d1473a 100644 --- a/handler/accountauthentication/accountauthentication.go +++ b/handler/accountauthentication/accountauthentication.go @@ -125,6 +125,7 @@ type AccountAuthenticationMethodCreateIn struct { SamlFieldMapping *SamlFieldMappingIn `json:"saml_field_mapping,omitempty"` // SAMLFieldMapping SamlIdpLoginAllowed *bool `json:"saml_idp_login_allowed,omitempty"` // Set to 'true' to enable IdP initiated login SamlIdpUrl *string `json:"saml_idp_url,omitempty"` // Saml Idp Url + SamlJoinGroups *bool `json:"saml_join_groups,omitempty"` // SAML join groups enabled SamlRequestedAuthnContextEnabled *bool `json:"saml_requested_authn_context_enabled,omitempty"` // Set to 'false' to disable RequestedAuthnContext SamlSignatureAlgorithm SamlSignatureAlgorithmType `json:"saml_signature_algorithm,omitempty"` // SAMLSignatureAlgorithm SamlVariant SamlVariantType `json:"saml_variant,omitempty"` // SAMLVariant @@ -227,6 +228,7 @@ type AccountAuthenticationMethodUpdateIn struct { SamlFieldMapping *SamlFieldMappingIn `json:"saml_field_mapping,omitempty"` // SAMLFieldMapping SamlIdpLoginAllowed *bool `json:"saml_idp_login_allowed,omitempty"` // Set to 'true' to enable IdP initiated login SamlIdpUrl *string `json:"saml_idp_url,omitempty"` // Saml Idp Url + SamlJoinGroups *bool `json:"saml_join_groups,omitempty"` // SAML join groups enabled SamlRequestedAuthnContextEnabled *bool `json:"saml_requested_authn_context_enabled,omitempty"` // Set to 'false' to disable RequestedAuthnContext SamlSignatureAlgorithm SamlSignatureAlgorithmType `json:"saml_signature_algorithm,omitempty"` // SAMLSignatureAlgorithm SamlVariant SamlVariantType `json:"saml_variant,omitempty"` // SAMLVariant @@ -363,6 +365,7 @@ func SamlDigestAlgorithmTypeChoices() []string { type SamlFieldMappingIn struct { Email *string `json:"email,omitempty"` // Field name for user email FirstName *string `json:"first_name,omitempty"` // Field name for user's first name + Groups *string `json:"groups,omitempty"` // Field name for user's groups memberships. Contents of this field are used to handle group memberships when SCIM is not available and SAML is used to manage group memberships. Identity *string `json:"identity,omitempty"` // Field name for user's identity. This field must always exist in responses, and must be immutable and unique. Contents of this field are used to identify the user. Using user ID (such as unix user ID) is highly recommended, as email address may change, requiring relinking user to Aiven user. LastName *string `json:"last_name,omitempty"` // Field name for user's lastname RealName *string `json:"real_name,omitempty"` // Field name for user's full name. If specified, first_name and last_name mappings are ignored @@ -372,6 +375,7 @@ type SamlFieldMappingIn struct { type SamlFieldMappingOut struct { Email *string `json:"email,omitempty"` // Field name for user email FirstName *string `json:"first_name,omitempty"` // Field name for user's first name + Groups *string `json:"groups,omitempty"` // Field name for user's groups memberships. Contents of this field are used to handle group memberships when SCIM is not available and SAML is used to manage group memberships. Identity *string `json:"identity,omitempty"` // Field name for user's identity. This field must always exist in responses, and must be immutable and unique. Contents of this field are used to identify the user. Using user ID (such as unix user ID) is highly recommended, as email address may change, requiring relinking user to Aiven user. LastName *string `json:"last_name,omitempty"` // Field name for user's lastname RealName *string `json:"real_name,omitempty"` // Field name for user's full name. If specified, first_name and last_name mappings are ignored diff --git a/handler/accountteam/accountteam.go b/handler/accountteam/accountteam.go index 0a0d49a..198596d 100644 --- a/handler/accountteam/accountteam.go +++ b/handler/accountteam/accountteam.go @@ -244,16 +244,18 @@ type TeamOut struct { type TeamType string const ( - TeamTypeAdmin TeamType = "admin" - TeamTypeOperator TeamType = "operator" - TeamTypeDeveloper TeamType = "developer" - TeamTypeReadOnly TeamType = "read_only" - TeamTypeProjectpermissionsread TeamType = "project:permissions:read" - TeamTypeServicelogsread TeamType = "service:logs:read" + TeamTypeAdmin TeamType = "admin" + TeamTypeOperator TeamType = "operator" + TeamTypeDeveloper TeamType = "developer" + TeamTypeReadOnly TeamType = "read_only" + TeamTypeProjectIntegrationsRead TeamType = "project:integrations:read" + TeamTypeProjectPermissionsRead TeamType = "project:permissions:read" + TeamTypeServiceLogsRead TeamType = "service:logs:read" + TeamTypeProjectServicesRead TeamType = "project:services:read" ) func TeamTypeChoices() []string { - return []string{"admin", "operator", "developer", "read_only", "project:permissions:read", "service:logs:read"} + return []string{"admin", "operator", "developer", "read_only", "project:integrations:read", "project:permissions:read", "service:logs:read", "project:services:read"} } // accountTeamCreateOut AccountTeamCreateResponse diff --git a/handler/clickhouse/clickhouse.go b/handler/clickhouse/clickhouse.go index 414860b..9464451 100644 --- a/handler/clickhouse/clickhouse.go +++ b/handler/clickhouse/clickhouse.go @@ -187,20 +187,20 @@ type MetaOut struct { type OrderByType string const ( - OrderByTypeCallsasc OrderByType = "calls:asc" - OrderByTypeCallsdesc OrderByType = "calls:desc" - OrderByTypeMinTimeasc OrderByType = "min_time:asc" - OrderByTypeMinTimedesc OrderByType = "min_time:desc" - OrderByTypeMaxTimeasc OrderByType = "max_time:asc" - OrderByTypeMaxTimedesc OrderByType = "max_time:desc" - OrderByTypeMeanTimeasc OrderByType = "mean_time:asc" - OrderByTypeMeanTimedesc OrderByType = "mean_time:desc" - OrderByTypeP95Timeasc OrderByType = "p95_time:asc" - OrderByTypeP95Timedesc OrderByType = "p95_time:desc" - OrderByTypeStddevTimeasc OrderByType = "stddev_time:asc" - OrderByTypeStddevTimedesc OrderByType = "stddev_time:desc" - OrderByTypeTotalTimeasc OrderByType = "total_time:asc" - OrderByTypeTotalTimedesc OrderByType = "total_time:desc" + OrderByTypeCallsAsc OrderByType = "calls:asc" + OrderByTypeCallsDesc OrderByType = "calls:desc" + OrderByTypeMinTimeAsc OrderByType = "min_time:asc" + OrderByTypeMinTimeDesc OrderByType = "min_time:desc" + OrderByTypeMaxTimeAsc OrderByType = "max_time:asc" + OrderByTypeMaxTimeDesc OrderByType = "max_time:desc" + OrderByTypeMeanTimeAsc OrderByType = "mean_time:asc" + OrderByTypeMeanTimeDesc OrderByType = "mean_time:desc" + OrderByTypeP95TimeAsc OrderByType = "p95_time:asc" + OrderByTypeP95TimeDesc OrderByType = "p95_time:desc" + OrderByTypeStddevTimeAsc OrderByType = "stddev_time:asc" + OrderByTypeStddevTimeDesc OrderByType = "stddev_time:desc" + OrderByTypeTotalTimeAsc OrderByType = "total_time:asc" + OrderByTypeTotalTimeDesc OrderByType = "total_time:desc" ) func OrderByTypeChoices() []string { diff --git a/handler/project/project.go b/handler/project/project.go index 3a1b863..5bc67ef 100644 --- a/handler/project/project.go +++ b/handler/project/project.go @@ -447,16 +447,18 @@ type AlloydbomniOut struct { type AnyType string const ( - AnyTypeAdmin AnyType = "admin" - AnyTypeDeveloper AnyType = "developer" - AnyTypeOperator AnyType = "operator" - AnyTypeProjectpermissionsread AnyType = "project:permissions:read" - AnyTypeReadOnly AnyType = "read_only" - AnyTypeServicelogsread AnyType = "service:logs:read" + AnyTypeAdmin AnyType = "admin" + AnyTypeDeveloper AnyType = "developer" + AnyTypeOperator AnyType = "operator" + AnyTypeProjectIntegrationsRead AnyType = "project:integrations:read" + AnyTypeProjectPermissionsRead AnyType = "project:permissions:read" + AnyTypeProjectServicesRead AnyType = "project:services:read" + AnyTypeReadOnly AnyType = "read_only" + AnyTypeServiceLogsRead AnyType = "service:logs:read" ) func AnyTypeChoices() []string { - return []string{"admin", "developer", "operator", "project:permissions:read", "read_only", "service:logs:read"} + return []string{"admin", "developer", "operator", "project:integrations:read", "project:permissions:read", "project:services:read", "read_only", "service:logs:read"} } // BackupConfigOut Backup configuration for this service plan @@ -623,16 +625,18 @@ type KafkaOut struct { type MemberType string const ( - MemberTypeAdmin MemberType = "admin" - MemberTypeDeveloper MemberType = "developer" - MemberTypeOperator MemberType = "operator" - MemberTypeProjectpermissionsread MemberType = "project:permissions:read" - MemberTypeReadOnly MemberType = "read_only" - MemberTypeServicelogsread MemberType = "service:logs:read" + MemberTypeAdmin MemberType = "admin" + MemberTypeDeveloper MemberType = "developer" + MemberTypeOperator MemberType = "operator" + MemberTypeProjectIntegrationsRead MemberType = "project:integrations:read" + MemberTypeProjectPermissionsRead MemberType = "project:permissions:read" + MemberTypeProjectServicesRead MemberType = "project:services:read" + MemberTypeReadOnly MemberType = "read_only" + MemberTypeServiceLogsRead MemberType = "service:logs:read" ) func MemberTypeChoices() []string { - return []string{"admin", "developer", "operator", "project:permissions:read", "read_only", "service:logs:read"} + return []string{"admin", "developer", "operator", "project:integrations:read", "project:permissions:read", "project:services:read", "read_only", "service:logs:read"} } // MysqlOut Service type information diff --git a/handler/service/service.go b/handler/service/service.go index 7afd3b3..1ea8eee 100644 --- a/handler/service/service.go +++ b/handler/service/service.go @@ -1091,6 +1091,7 @@ const ( EndpointTypeExternalMysql EndpointType = "external_mysql" EndpointTypeExternalOpensearchLogs EndpointType = "external_opensearch_logs" EndpointTypeExternalPostgresql EndpointType = "external_postgresql" + EndpointTypeExternalPrometheus EndpointType = "external_prometheus" EndpointTypeExternalRedis EndpointType = "external_redis" EndpointTypeExternalSchemaRegistry EndpointType = "external_schema_registry" EndpointTypeExternalSumologicLogs EndpointType = "external_sumologic_logs" @@ -1100,7 +1101,7 @@ const ( ) func EndpointTypeChoices() []string { - return []string{"autoscaler", "datadog", "external_aws_cloudwatch_logs", "external_aws_cloudwatch_metrics", "external_aws_s3", "external_clickhouse", "external_elasticsearch_logs", "external_google_cloud_bigquery", "external_google_cloud_logging", "external_kafka", "external_mysql", "external_opensearch_logs", "external_postgresql", "external_redis", "external_schema_registry", "external_sumologic_logs", "jolokia", "prometheus", "rsyslog"} + return []string{"autoscaler", "datadog", "external_aws_cloudwatch_logs", "external_aws_cloudwatch_metrics", "external_aws_s3", "external_clickhouse", "external_elasticsearch_logs", "external_google_cloud_bigquery", "external_google_cloud_logging", "external_kafka", "external_mysql", "external_opensearch_logs", "external_postgresql", "external_prometheus", "external_redis", "external_schema_registry", "external_sumologic_logs", "jolokia", "prometheus", "rsyslog"} } type EndpointTypeOut struct { diff --git a/handler/user/user.go b/handler/user/user.go index 55d5731..ec7e6d6 100644 --- a/handler/user/user.go +++ b/handler/user/user.go @@ -515,16 +515,18 @@ func ActionTypeChoices() []string { type AnyType string const ( - AnyTypeAdmin AnyType = "admin" - AnyTypeDeveloper AnyType = "developer" - AnyTypeOperator AnyType = "operator" - AnyTypeProjectpermissionsread AnyType = "project:permissions:read" - AnyTypeReadOnly AnyType = "read_only" - AnyTypeServicelogsread AnyType = "service:logs:read" + AnyTypeAdmin AnyType = "admin" + AnyTypeDeveloper AnyType = "developer" + AnyTypeOperator AnyType = "operator" + AnyTypeProjectIntegrationsRead AnyType = "project:integrations:read" + AnyTypeProjectPermissionsRead AnyType = "project:permissions:read" + AnyTypeProjectServicesRead AnyType = "project:services:read" + AnyTypeReadOnly AnyType = "read_only" + AnyTypeServiceLogsRead AnyType = "service:logs:read" ) func AnyTypeChoices() []string { - return []string{"admin", "developer", "operator", "project:permissions:read", "read_only", "service:logs:read"} + return []string{"admin", "developer", "operator", "project:integrations:read", "project:permissions:read", "project:services:read", "read_only", "service:logs:read"} } type AuthenticationMethodOut struct {