diff --git a/Makefile b/Makefile index b7f7fb5..b78a3ab 100644 --- a/Makefile +++ b/Makefile @@ -1,8 +1,28 @@ -.PHONY:gen format lint +.PHONY:gen format lint gen-schema-registry-client -gen: +gen: gen-mocks gen-schema-registry-client + +gen-mocks: mockery +gen-schema-registry-client: + @echo "Fetching OpenAPI schema from Redpanda..." + @mkdir -p gen/schema-registry + @curl -sSL https://docs.redpanda.com/api/doc/schema-registry.yaml -o gen/schema-registry/openapi2.yaml + @echo "Converting OpenAPI 2.0 to OpenAPI 3.0..." + @curl -sSL -X POST "https://converter.swagger.io/api/convert" \ + -H "Content-Type: application/yaml" \ + -H "Accept: application/yaml" \ + --data-binary @gen/schema-registry/openapi2.yaml \ + -o gen/schema-registry/openapi.yaml + @echo "Generating Go HTTP client..." + @cd gen/schema-registry && go run github.com/oapi-codegen/oapi-codegen/v2/cmd/oapi-codegen -config oapi-codegen.yaml openapi.yaml + @echo "Formatting generated code..." + @go fmt ./gen/schema-registry/client.go + @echo "Cleaning up schema files..." + @rm -f gen/schema-registry/openapi2.yaml gen/schema-registry/openapi.yaml + @echo "Schema registry client generated successfully in gen/schema-registry/client.go" + lint: golangci-lint run diff --git a/cmd/register.go b/cmd/register.go new file mode 100644 index 0000000..fb6cedc --- /dev/null +++ b/cmd/register.go @@ -0,0 +1,294 @@ +package cmd + +import ( + "os" + "path/filepath" + "strings" + "time" + + "github.com/pkg/errors" + "github.com/spf13/cobra" + "github.com/spf13/viper" + "go.uber.org/zap" + + "github.com/ChargePi/chargeflow/pkg/ocpp" + "github.com/ChargePi/chargeflow/pkg/schema_registry" + "github.com/ChargePi/chargeflow/pkg/schema_registry/registries" +) + +type registerConfig struct { + URL string + Username string + Password string + BearerToken string + APIKey string + APIKeyHeader string + CustomHeader string + CustomValue string + Timeout time.Duration + SchemaFile string + SchemaDir string + Action string +} + +var registerCfg = registerConfig{ + Timeout: 5 * time.Second, +} + +var register = &cobra.Command{ + Use: "register", + Short: "Register schemas on a remote schema registry", + Long: `Register OCPP schemas on a remote schema registry. +You can register a single schema file or all schemas from a directory. +The schema file names should match the OCPP action names (e.g., "BootNotificationRequest.json" or "BootNotificationResponse.json").`, + Example: ` # Register a single schema file + chargeflow --version 1.6 register --url http://localhost:8081 --file BootNotificationRequest.json --action BootNotificationRequest + + # Register all schemas from a directory + chargeflow --version 1.6 register --url http://localhost:8081 --dir ./schemas + + # Register with basic authentication + chargeflow register --url http://localhost:8081 --username admin --password secret --file schema.json --action BootNotificationRequest + + # Register with bearer token + chargeflow register --url http://localhost:8081 --bearer-token token123 --file schema.json --action BootNotificationRequest + + # Register with API key + chargeflow register --url http://localhost:8081 --api-key key123 --api-key-header X-API-Key --file schema.json --action BootNotificationRequest`, + SilenceUsage: true, + PreRunE: func(cmd *cobra.Command, args []string) error { + cfg := loadRegisterConfig() + + if cfg.URL == "" { + return errors.New("remote registry URL is required (use --url flag)") + } + + if cfg.SchemaFile == "" && cfg.SchemaDir == "" { + return errors.New("either --file or --dir must be specified") + } + + if cfg.SchemaFile != "" && cfg.SchemaDir != "" { + return errors.New("cannot specify both --file and --dir") + } + + if cfg.SchemaFile != "" && cfg.Action == "" { + return errors.New("--action is required when using --file") + } + + // Validate authentication options + if cfg.Username != "" || cfg.Password != "" { + if cfg.Username == "" || cfg.Password == "" { + return errors.New("both --username and --password are required for basic authentication") + } + } + if cfg.CustomHeader != "" || cfg.CustomValue != "" { + if cfg.CustomHeader == "" || cfg.CustomValue == "" { + return errors.New("both --custom-header and --custom-value are required for custom header authentication") + } + } + + return nil + }, + RunE: func(cmd *cobra.Command, args []string) error { + logger := zap.L() + + cfg := loadRegisterConfig() + ocppVersion := viper.GetString("ocpp.version") + version := ocpp.Version(ocppVersion) + + // Build remote registry options + opts := []registries.RemoteOptions{ + registries.WithTimeout(cfg.Timeout), + } + + // Add authentication option + switch { + case cfg.Username != "" && cfg.Password != "": + opts = append(opts, registries.WithBasicAuth(cfg.Username, cfg.Password)) + case cfg.BearerToken != "": + opts = append(opts, registries.WithBearerToken(cfg.BearerToken)) + case cfg.APIKey != "": + opts = append(opts, registries.WithAPIKey(cfg.APIKey, cfg.APIKeyHeader)) + case cfg.CustomHeader != "" && cfg.CustomValue != "": + opts = append(opts, registries.WithCustomHeader(cfg.CustomHeader, cfg.CustomValue)) + } + + // Create remote registry + remoteRegistry, err := registries.NewRemoteSchemaRegistry(cfg.URL, logger, opts...) + if err != nil { + return errors.Wrap(err, "failed to create remote schema registry") + } + + // Register schema(s) + switch { + case cfg.SchemaFile != "": + // Register single schema file + return registerSingleSchema(logger, remoteRegistry, version, cfg.SchemaFile, cfg.Action) + default: + // Register all schemas from directory + return registerSchemasFromDir(logger, remoteRegistry, version, cfg.SchemaDir) + } + }, +} + +func registerSingleSchema(logger *zap.Logger, registry *registries.RemoteSchemaRegistry, version ocpp.Version, filePath, action string) error { + logger.Info("Registering schema", + zap.String("file", filePath), + zap.String("action", action), + zap.String("version", version.String())) + + schemaData, err := os.ReadFile(filePath) + if err != nil { + return errors.Wrapf(err, "failed to read schema file: %s", filePath) + } + + if err := registry.RegisterSchema(version, action, schemaData); err != nil { + return errors.Wrapf(err, "failed to register schema for action %s", action) + } + + logger.Info("Successfully registered schema", + zap.String("action", action), + zap.String("version", version.String())) + return nil +} + +// registerSchemasFromDir registers all schemas from a directory to the given registry. +// This function is shared between validate and register commands. +func registerSchemasFromDir(logger *zap.Logger, registry schema_registry.SchemaRegistry, version ocpp.Version, dir string) error { + logger.Info("Registering schemas from directory", + zap.String("directory", dir), + zap.String("version", version.String())) + + entries, err := os.ReadDir(dir) + if err != nil { + return errors.Wrapf(err, "failed to read directory: %s", dir) + } + + successCount := 0 + errorCount := 0 + + for _, entry := range entries { + if entry.IsDir() { + continue + } + + fileName := entry.Name() + if !strings.HasSuffix(strings.ToLower(fileName), ".json") { + logger.Debug("Skipping non-JSON file", zap.String("file", fileName)) + continue + } + + // Extract action name from filename (remove .json extension) + action, _ := strings.CutSuffix(fileName, ".json") + + // Read schema file + schemaPath := filepath.Join(dir, fileName) + schemaData, err := os.ReadFile(schemaPath) + if err != nil { + logger.Error("Failed to read schema file", + zap.String("file", schemaPath), + zap.Error(err)) + errorCount++ + continue + } + + // Register schema + if err := registry.RegisterSchema(version, action, schemaData); err != nil { + logger.Error("Failed to register schema", + zap.String("file", schemaPath), + zap.String("action", action), + zap.Error(err)) + errorCount++ + continue + } + + logger.Debug("Successfully registered schema", + zap.String("action", action), + zap.String("file", fileName)) + successCount++ + } + + if errorCount > 0 { + return errors.Errorf("failed to register %d schema(s), %d succeeded", errorCount, successCount) + } + + logger.Info("Successfully registered schemas", zap.Int("count", successCount)) + return nil +} + +// loadRegisterConfig loads configuration from viper with fallback to flag values. +func loadRegisterConfig() registerConfig { + cfg := registerConfig{ + URL: getStringOrDefault("register.url", registerCfg.URL), + Username: getStringOrDefault("register.username", registerCfg.Username), + Password: getStringOrDefault("register.password", registerCfg.Password), + BearerToken: getStringOrDefault("register.bearer-token", registerCfg.BearerToken), + APIKey: getStringOrDefault("register.api-key", registerCfg.APIKey), + APIKeyHeader: getStringOrDefault("register.api-key-header", registerCfg.APIKeyHeader), + CustomHeader: getStringOrDefault("register.custom-header", registerCfg.CustomHeader), + CustomValue: getStringOrDefault("register.custom-value", registerCfg.CustomValue), + SchemaFile: getStringOrDefault("register.file", registerCfg.SchemaFile), + SchemaDir: getStringOrDefault("register.dir", registerCfg.SchemaDir), + Action: getStringOrDefault("register.action", registerCfg.Action), + Timeout: getDurationOrDefault("register.timeout", registerCfg.Timeout), + } + + // Set default API key header if API key is provided but header is not + if cfg.APIKey != "" && cfg.APIKeyHeader == "" { + cfg.APIKeyHeader = "X-API-Key" + } + + return cfg +} + +// getStringOrDefault returns the viper string value or the default if empty. +func getStringOrDefault(key string, defaultValue string) string { + if value := viper.GetString(key); value != "" { + return value + } + return defaultValue +} + +// getDurationOrDefault returns the viper duration value or the default if zero. +func getDurationOrDefault(key string, defaultValue time.Duration) time.Duration { + if value := viper.GetDuration(key); value != 0 { + return value + } + return defaultValue +} + +func init() { + // Registry URL + register.Flags().StringVar(®isterCfg.URL, "url", "", "Remote schema registry URL (required)") + + // Authentication options + register.Flags().StringVar(®isterCfg.Username, "username", "", "Username for basic authentication") + register.Flags().StringVar(®isterCfg.Password, "password", "", "Password for basic authentication") + register.Flags().StringVar(®isterCfg.BearerToken, "bearer-token", "", "Bearer token for authentication") + register.Flags().StringVar(®isterCfg.APIKey, "api-key", "", "API key for authentication") + register.Flags().StringVar(®isterCfg.APIKeyHeader, "api-key-header", "X-API-Key", "Header name for API key authentication") + register.Flags().StringVar(®isterCfg.CustomHeader, "custom-header", "", "Custom header name for authentication") + register.Flags().StringVar(®isterCfg.CustomValue, "custom-value", "", "Custom header value for authentication") + + // Schema input options + register.Flags().StringVarP(®isterCfg.SchemaFile, "file", "f", "", "Path to a single schema file to register") + register.Flags().StringVar(®isterCfg.SchemaDir, "dir", "", "Path to a directory containing schema files to register") + register.Flags().StringVarP(®isterCfg.Action, "action", "a", "", "OCPP action name (required when using --file, e.g., 'BootNotificationRequest')") + + // Timeout option + register.Flags().DurationVar(®isterCfg.Timeout, "timeout", 5*time.Second, "Request timeout duration") + + // Bind flags to viper + _ = viper.BindPFlag("register.url", register.Flags().Lookup("url")) + _ = viper.BindPFlag("register.username", register.Flags().Lookup("username")) + _ = viper.BindPFlag("register.password", register.Flags().Lookup("password")) + _ = viper.BindPFlag("register.bearer-token", register.Flags().Lookup("bearer-token")) + _ = viper.BindPFlag("register.api-key", register.Flags().Lookup("api-key")) + _ = viper.BindPFlag("register.api-key-header", register.Flags().Lookup("api-key-header")) + _ = viper.BindPFlag("register.custom-header", register.Flags().Lookup("custom-header")) + _ = viper.BindPFlag("register.custom-value", register.Flags().Lookup("custom-value")) + _ = viper.BindPFlag("register.file", register.Flags().Lookup("file")) + _ = viper.BindPFlag("register.dir", register.Flags().Lookup("dir")) + _ = viper.BindPFlag("register.action", register.Flags().Lookup("action")) + _ = viper.BindPFlag("register.timeout", register.Flags().Lookup("timeout")) +} diff --git a/cmd/root.go b/cmd/root.go index 448d49b..60332f7 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -32,6 +32,7 @@ var rootCmd = &cobra.Command{ func init() { rootCmd.AddCommand(validate) + rootCmd.AddCommand(register) } // setDefaults sets the default values for the configuration. diff --git a/cmd/validate.go b/cmd/validate.go index b522e09..5915927 100644 --- a/cmd/validate.go +++ b/cmd/validate.go @@ -2,20 +2,18 @@ package cmd import ( "embed" - "os" "path/filepath" "strings" - "github.com/ChargePi/chargeflow/internal/validation" - - "github.com/spf13/viper" - "github.com/pkg/errors" "github.com/spf13/cobra" + "github.com/spf13/viper" "go.uber.org/zap" + "github.com/ChargePi/chargeflow/internal/validation" "github.com/ChargePi/chargeflow/pkg/ocpp" "github.com/ChargePi/chargeflow/pkg/schema_registry" + "github.com/ChargePi/chargeflow/pkg/schema_registry/registries" ) var ( @@ -87,39 +85,6 @@ func registerSchemas(logger *zap.Logger, embeddedDir embed.FS, version ocpp.Vers return nil } -// registerAdditionalSchemas registers additional OCPP schemas from a specified directory. -// Files must be in JSON format and their names should match the OCPP message names (e.g. "BootNotificationRequest.json" or "BootNotificationResponse.json"). -func registerAdditionalSchemas(logger *zap.Logger, dir string) error { - ocppVersion := viper.GetString("ocpp.version") - logger.Debug("Registering additional OCPP schemas from directory", zap.String("directory", dir)) - - entries, err := os.ReadDir(dir) - if err != nil { - return errors.Wrap(err, "unable to read provided additional OCPP schemas directory") - } - - for _, entry := range entries { - if !entry.IsDir() { - fileName := entry.Name() - // Read the schema file - schema, err := os.ReadFile(filepath.Join(dir, fileName)) - if err != nil { - return errors.Wrap(err, "unable to read additional OCPP schemas directory") - } - - // Read the directory and register additional OCPP schemas - // Any existing schema with the same name will be overwritten - action, _ := strings.CutSuffix(fileName, ".json") - err = registry.RegisterSchema(ocpp.Version(ocppVersion), action, schema, schema_registry.WithOverwrite(true)) - if err != nil { - return errors.Wrap(err, "failed to register additional OCPP schemas") - } - } - } - - return nil -} - var validate = &cobra.Command{ Use: "validate", Short: "Validate the OCPP message(s) against the registered OCPP schemas", @@ -130,8 +95,18 @@ var validate = &cobra.Command{ PreRunE: func(cmd *cobra.Command, args []string) error { ocppVersion := viper.GetString("ocpp.version") logger := zap.L() + registryType := viper.GetString("schema.registry.type") - registry = schema_registry.NewInMemorySchemaRegistry(logger) + overwrite := additionalOcppSchemasFolder != "" + + // todo provision registries based on config + switch registryType { + default: + registry = registries.NewFileSchemaRegistry( + logger, + registries.WithOverwrite(overwrite), + ) + } // Populate the schema registry with OCPP schemas var err error @@ -158,8 +133,10 @@ var validate = &cobra.Command{ } } - if additionalOcppSchemasFolder != "" { - err := registerAdditionalSchemas(logger, additionalOcppSchemasFolder) + if overwrite { + ocppVersion := viper.GetString("ocpp.version") + version := ocpp.Version(ocppVersion) + err := registerSchemasFromDir(logger, registry, version, additionalOcppSchemasFolder) if err != nil { return err } diff --git a/cmd/validate_test.go b/cmd/validate_test.go index aa0e760..2e3101e 100644 --- a/cmd/validate_test.go +++ b/cmd/validate_test.go @@ -6,7 +6,7 @@ import ( "path/filepath" "testing" - "github.com/ChargePi/chargeflow/pkg/schema_registry" + "github.com/ChargePi/chargeflow/pkg/schema_registry/registries" "github.com/spf13/viper" "go.uber.org/zap" @@ -29,7 +29,7 @@ var ( func Test_registerAdditionalSchemas(t *testing.T) { logger := zap.L() - registry = schema_registry.NewInMemorySchemaRegistry(logger) + registry = registries.NewFileSchemaRegistry(logger) tests := []struct { name string @@ -80,9 +80,11 @@ func Test_registerAdditionalSchemas(t *testing.T) { r.NoError(err) // Call the function to register additional schemas - err = registerAdditionalSchemas(logger, tempDir) + version := ocpp.Version(test.defaultOcppVersion) + err = registerSchemasFromDir(logger, registry, version, tempDir) if test.expected != nil { - assert.ErrorContains(t, err, test.expected.Error()) + // The shared function returns aggregated errors, so we check that an error occurred + assert.Error(t, err) } else { assert.NoError(t, err) } diff --git a/gen/schema-registry/client.go b/gen/schema-registry/client.go new file mode 100644 index 0000000..8118d02 --- /dev/null +++ b/gen/schema-registry/client.go @@ -0,0 +1,6831 @@ +// Package schemaregistryclient provides primitives to interact with the openapi HTTP API. +// +// Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.5.1 DO NOT EDIT. +package schemaregistryclient + +import ( + "bytes" + "context" + "encoding/json" + "fmt" + "io" + "net/http" + "net/url" + "strings" + + "github.com/oapi-codegen/runtime" +) + +// Defines values for GetCompatibilityCompatibilityLevel. +const ( + GetCompatibilityCompatibilityLevelBACKWARD GetCompatibilityCompatibilityLevel = "BACKWARD" + GetCompatibilityCompatibilityLevelBACKWARDTRANSITIVE GetCompatibilityCompatibilityLevel = "BACKWARD_TRANSITIVE" + GetCompatibilityCompatibilityLevelFORWARD GetCompatibilityCompatibilityLevel = "FORWARD" + GetCompatibilityCompatibilityLevelFORWARDTRANSITIVE GetCompatibilityCompatibilityLevel = "FORWARD_TRANSITIVE" + GetCompatibilityCompatibilityLevelFULL GetCompatibilityCompatibilityLevel = "FULL" + GetCompatibilityCompatibilityLevelFULLTRANSITIVE GetCompatibilityCompatibilityLevel = "FULL_TRANSITIVE" + GetCompatibilityCompatibilityLevelNONE GetCompatibilityCompatibilityLevel = "NONE" +) + +// Defines values for ModeMode. +const ( + IMPORT ModeMode = "IMPORT" + READONLY ModeMode = "READONLY" + READWRITE ModeMode = "READWRITE" +) + +// Defines values for PutCompatibilityCompatibility. +const ( + PutCompatibilityCompatibilityBACKWARD PutCompatibilityCompatibility = "BACKWARD" + PutCompatibilityCompatibilityBACKWARDTRANSITIVE PutCompatibilityCompatibility = "BACKWARD_TRANSITIVE" + PutCompatibilityCompatibilityFORWARD PutCompatibilityCompatibility = "FORWARD" + PutCompatibilityCompatibilityFORWARDTRANSITIVE PutCompatibilityCompatibility = "FORWARD_TRANSITIVE" + PutCompatibilityCompatibilityFULL PutCompatibilityCompatibility = "FULL" + PutCompatibilityCompatibilityFULLTRANSITIVE PutCompatibilityCompatibility = "FULL_TRANSITIVE" + PutCompatibilityCompatibilityNONE PutCompatibilityCompatibility = "NONE" +) + +// Defines values for SecurityAclOperation. +const ( + SecurityAclOperationALL SecurityAclOperation = "ALL" + SecurityAclOperationALTERCONFIGS SecurityAclOperation = "ALTER_CONFIGS" + SecurityAclOperationDELETE SecurityAclOperation = "DELETE" + SecurityAclOperationDESCRIBE SecurityAclOperation = "DESCRIBE" + SecurityAclOperationDESCRIBECONFIGS SecurityAclOperation = "DESCRIBE_CONFIGS" + SecurityAclOperationREAD SecurityAclOperation = "READ" + SecurityAclOperationWRITE SecurityAclOperation = "WRITE" +) + +// Defines values for SecurityAclPatternType. +const ( + SecurityAclPatternTypeLITERAL SecurityAclPatternType = "LITERAL" + SecurityAclPatternTypePREFIXED SecurityAclPatternType = "PREFIXED" +) + +// Defines values for SecurityAclPermission. +const ( + SecurityAclPermissionALLOW SecurityAclPermission = "ALLOW" + SecurityAclPermissionDENY SecurityAclPermission = "DENY" +) + +// Defines values for SecurityAclResourceType. +const ( + SecurityAclResourceTypeREGISTRY SecurityAclResourceType = "REGISTRY" + SecurityAclResourceTypeSUBJECT SecurityAclResourceType = "SUBJECT" +) + +// Defines values for GetSecurityAclsParamsResourceType. +const ( + GetSecurityAclsParamsResourceTypeREGISTRY GetSecurityAclsParamsResourceType = "REGISTRY" + GetSecurityAclsParamsResourceTypeSUBJECT GetSecurityAclsParamsResourceType = "SUBJECT" +) + +// Defines values for GetSecurityAclsParamsPatternType. +const ( + GetSecurityAclsParamsPatternTypeLITERAL GetSecurityAclsParamsPatternType = "LITERAL" + GetSecurityAclsParamsPatternTypePREFIXED GetSecurityAclsParamsPatternType = "PREFIXED" +) + +// Defines values for GetSecurityAclsParamsOperation. +const ( + GetSecurityAclsParamsOperationALL GetSecurityAclsParamsOperation = "ALL" + GetSecurityAclsParamsOperationALTERCONFIGS GetSecurityAclsParamsOperation = "ALTER_CONFIGS" + GetSecurityAclsParamsOperationDELETE GetSecurityAclsParamsOperation = "DELETE" + GetSecurityAclsParamsOperationDESCRIBE GetSecurityAclsParamsOperation = "DESCRIBE" + GetSecurityAclsParamsOperationDESCRIBECONFIGS GetSecurityAclsParamsOperation = "DESCRIBE_CONFIGS" + GetSecurityAclsParamsOperationREAD GetSecurityAclsParamsOperation = "READ" + GetSecurityAclsParamsOperationWRITE GetSecurityAclsParamsOperation = "WRITE" +) + +// Defines values for GetSecurityAclsParamsPermission. +const ( + GetSecurityAclsParamsPermissionALLOW GetSecurityAclsParamsPermission = "ALLOW" + GetSecurityAclsParamsPermissionDENY GetSecurityAclsParamsPermission = "DENY" +) + +// ErrorBody defines model for error_body. +type ErrorBody struct { + ErrorCode *int `json:"error_code,omitempty"` + Message *string `json:"message,omitempty"` +} + +// GetCompatibility defines model for get_compatibility. +type GetCompatibility struct { + // CompatibilityLevel Compatibility level + CompatibilityLevel *GetCompatibilityCompatibilityLevel `json:"compatibilityLevel,omitempty"` +} + +// GetCompatibilityCompatibilityLevel Compatibility level +type GetCompatibilityCompatibilityLevel string + +// IsCompatibile defines model for is_compatibile. +type IsCompatibile struct { + IsCompatible *bool `json:"is_compatible,omitempty"` + Messages *[]string `json:"messages,omitempty"` +} + +// Mode defines model for mode. +type Mode struct { + Mode *ModeMode `json:"mode,omitempty"` +} + +// ModeMode defines model for Mode.Mode. +type ModeMode string + +// PutCompatibility defines model for put_compatibility. +type PutCompatibility struct { + // Compatibility Compatibility level + Compatibility *PutCompatibilityCompatibility `json:"compatibility,omitempty"` +} + +// PutCompatibilityCompatibility Compatibility level +type PutCompatibilityCompatibility string + +// SchemaDef defines model for schema_def. +type SchemaDef struct { + References *[]struct { + Name *string `json:"name,omitempty"` + Subject *string `json:"subject,omitempty"` + Version *int `json:"version,omitempty"` + } `json:"references,omitempty"` + Schema *string `json:"schema,omitempty"` + SchemaType *string `json:"schemaType,omitempty"` +} + +// SecurityAcl defines model for security_acl. +type SecurityAcl struct { + // Host Originating host for which this rule applies. Use "*" to represent a wildcard. + Host string `json:"host"` + + // Operation The operation to allow or deny. + Operation SecurityAclOperation `json:"operation"` + + // PatternType Pattern match type for the resource. Only applies when `resource_type` is SUBJECT. + PatternType SecurityAclPatternType `json:"pattern_type"` + + // Permission Specifies whether the operation is allowed or denied. + Permission SecurityAclPermission `json:"permission"` + + // Principal The name of the principal, for example, User:alice or RedpandaRole:admin. Use "*" to represent a wildcard. + Principal string `json:"principal"` + + // Resource The name of the resource. Use "*" to represent a wildcard. + Resource string `json:"resource"` + + // ResourceType The type of resource being secured. + ResourceType SecurityAclResourceType `json:"resource_type"` +} + +// SecurityAclOperation The operation to allow or deny. +type SecurityAclOperation string + +// SecurityAclPatternType Pattern match type for the resource. Only applies when `resource_type` is SUBJECT. +type SecurityAclPatternType string + +// SecurityAclPermission Specifies whether the operation is allowed or denied. +type SecurityAclPermission string + +// SecurityAclResourceType The type of resource being secured. +type SecurityAclResourceType string + +// StoredSchema defines model for stored_schema. +type StoredSchema struct { + Id *int `json:"id,omitempty"` + References *[]struct { + Name *string `json:"name,omitempty"` + Subject *string `json:"subject,omitempty"` + Version *int `json:"version,omitempty"` + } `json:"references,omitempty"` + Schema *string `json:"schema,omitempty"` + SchemaType *string `json:"schemaType,omitempty"` + Subject *string `json:"subject,omitempty"` + Version *int `json:"version,omitempty"` +} + +// CompatibilitySubjectVersionParams defines parameters for CompatibilitySubjectVersion. +type CompatibilitySubjectVersionParams struct { + // Verbose If true, includes more verbose information about the compatibility check, for example the reason the check failed. + Verbose *bool `form:"verbose,omitempty" json:"verbose,omitempty"` +} + +// GetConfigSubjectParams defines parameters for GetConfigSubject. +type GetConfigSubjectParams struct { + DefaultToGlobal *bool `form:"defaultToGlobal,omitempty" json:"defaultToGlobal,omitempty"` +} + +// PutModeParams defines parameters for PutMode. +type PutModeParams struct { + // Force If true, override the emptiness check when setting the global mode to IMPORT + Force *bool `form:"force,omitempty" json:"force,omitempty"` +} + +// GetModeSubjectParams defines parameters for GetModeSubject. +type GetModeSubjectParams struct { + // DefaultToGlobal If true, return the global mode if the subject doesn't have a mode set. + DefaultToGlobal *bool `form:"defaultToGlobal,omitempty" json:"defaultToGlobal,omitempty"` +} + +// PutModeSubjectParams defines parameters for PutModeSubject. +type PutModeSubjectParams struct { + // Force If true, override the emptiness check when setting a subject's mode to IMPORT + Force *bool `form:"force,omitempty" json:"force,omitempty"` +} + +// GetSchemasIdsIdParams defines parameters for GetSchemasIdsId. +type GetSchemasIdsIdParams struct { + // Format Redpanda version 25.2 or later. For Avro and Protobuf schemas only. Supported values: an empty string `''` returns the schema in its current format (default), and `serialized` (Protobuf only) returns the schema in its Base64-encoded wire binary format. Unsupported values return a 501 error. + Format *string `form:"format,omitempty" json:"format,omitempty"` +} + +// GetSchemasIdsIdSubjectsParams defines parameters for GetSchemasIdsIdSubjects. +type GetSchemasIdsIdSubjectsParams struct { + Deleted *bool `form:"deleted,omitempty" json:"deleted,omitempty"` +} + +// DeleteSecurityAclsJSONBody defines parameters for DeleteSecurityAcls. +type DeleteSecurityAclsJSONBody = []SecurityAcl + +// GetSecurityAclsParams defines parameters for GetSecurityAcls. +type GetSecurityAclsParams struct { + // Principal The name of the principal, for example, User:alice or RedpandaRole:admin. Use "*" to represent a wildcard. + Principal *string `form:"principal,omitempty" json:"principal,omitempty"` + + // Resource The name of the resource. Use "*" to represent a wildcard. + Resource *string `form:"resource,omitempty" json:"resource,omitempty"` + + // ResourceType The type of resource being secured. The REGISTRY type maps to top-level operations such as `GET /mode` and `GET /config`. The SUBJECT type maps to operations on the subject level, such as `GET /subjects` and `GET /config/{subject}`. + ResourceType *GetSecurityAclsParamsResourceType `form:"resource_type,omitempty" json:"resource_type,omitempty"` + + // PatternType Pattern match type for the resource. Only applies when `resource_type` is SUBJECT. + PatternType *GetSecurityAclsParamsPatternType `form:"pattern_type,omitempty" json:"pattern_type,omitempty"` + + // Host Originating host for which this rule applies. Use "*" to represent a wildcard. + Host *string `form:"host,omitempty" json:"host,omitempty"` + + // Operation The operation to allow or deny. + Operation *GetSecurityAclsParamsOperation `form:"operation,omitempty" json:"operation,omitempty"` + + // Permission Specifies whether the operation is allowed or denied. + Permission *GetSecurityAclsParamsPermission `form:"permission,omitempty" json:"permission,omitempty"` +} + +// GetSecurityAclsParamsResourceType defines parameters for GetSecurityAcls. +type GetSecurityAclsParamsResourceType string + +// GetSecurityAclsParamsPatternType defines parameters for GetSecurityAcls. +type GetSecurityAclsParamsPatternType string + +// GetSecurityAclsParamsOperation defines parameters for GetSecurityAcls. +type GetSecurityAclsParamsOperation string + +// GetSecurityAclsParamsPermission defines parameters for GetSecurityAcls. +type GetSecurityAclsParamsPermission string + +// PostSecurityAclsJSONBody defines parameters for PostSecurityAcls. +type PostSecurityAclsJSONBody = []SecurityAcl + +// GetSubjectsParams defines parameters for GetSubjects. +type GetSubjectsParams struct { + Deleted *bool `form:"deleted,omitempty" json:"deleted,omitempty"` + SubjectPrefix *string `form:"subjectPrefix,omitempty" json:"subjectPrefix,omitempty"` +} + +// DeleteSubjectParams defines parameters for DeleteSubject. +type DeleteSubjectParams struct { + Permanent *bool `form:"permanent,omitempty" json:"permanent,omitempty"` +} + +// PostSubjectParams defines parameters for PostSubject. +type PostSubjectParams struct { + Normalize *bool `form:"normalize,omitempty" json:"normalize,omitempty"` + Deleted *bool `form:"deleted,omitempty" json:"deleted,omitempty"` + + // Format Redpanda version 25.2 or later. For Avro and Protobuf schemas only. Supported values: an empty string `''` returns the schema in its current format (default), and `serialized` (Protobuf only) returns the schema in its Base64-encoded wire binary format. Unsupported values return a 501 error. + Format *string `form:"format,omitempty" json:"format,omitempty"` +} + +// GetSubjectVersionsParams defines parameters for GetSubjectVersions. +type GetSubjectVersionsParams struct { + Deleted *bool `form:"deleted,omitempty" json:"deleted,omitempty"` +} + +// PostSubjectVersionsParams defines parameters for PostSubjectVersions. +type PostSubjectVersionsParams struct { + Normalize *bool `form:"normalize,omitempty" json:"normalize,omitempty"` +} + +// DeleteSubjectVersionParams defines parameters for DeleteSubjectVersion. +type DeleteSubjectVersionParams struct { + Permanent *bool `form:"permanent,omitempty" json:"permanent,omitempty"` +} + +// GetSubjectVersionsVersionParams defines parameters for GetSubjectVersionsVersion. +type GetSubjectVersionsVersionParams struct { + Deleted *bool `form:"deleted,omitempty" json:"deleted,omitempty"` + + // Format Redpanda version 25.2 or later. For Avro and Protobuf schemas only. Supported values: an empty string `''` returns the schema in its current format (default), and `serialized` (Protobuf only) returns the schema in its Base64-encoded wire binary format. Unsupported values return a 501 error. + Format *string `form:"format,omitempty" json:"format,omitempty"` +} + +// GetSubjectVersionsVersionSchemaParams defines parameters for GetSubjectVersionsVersionSchema. +type GetSubjectVersionsVersionSchemaParams struct { + Deleted *bool `form:"deleted,omitempty" json:"deleted,omitempty"` + + // Format Redpanda version 25.2 or later. For Avro and Protobuf schemas only. Supported values: an empty string `''` returns the schema in its current format (default), and `serialized` (Protobuf only) returns the schema in its Base64-encoded wire binary format. Unsupported values return a 501 error. + Format *string `form:"format,omitempty" json:"format,omitempty"` +} + +// CompatibilitySubjectVersionJSONRequestBody defines body for CompatibilitySubjectVersion for application/json ContentType. +type CompatibilitySubjectVersionJSONRequestBody = SchemaDef + +// CompatibilitySubjectVersionApplicationVndSchemaregistryPlusJSONRequestBody defines body for CompatibilitySubjectVersion for application/vnd.schemaregistry+json ContentType. +type CompatibilitySubjectVersionApplicationVndSchemaregistryPlusJSONRequestBody = SchemaDef + +// CompatibilitySubjectVersionApplicationVndSchemaregistryV1PlusJSONRequestBody defines body for CompatibilitySubjectVersion for application/vnd.schemaregistry.v1+json ContentType. +type CompatibilitySubjectVersionApplicationVndSchemaregistryV1PlusJSONRequestBody = SchemaDef + +// PutConfigJSONRequestBody defines body for PutConfig for application/json ContentType. +type PutConfigJSONRequestBody = PutCompatibility + +// PutConfigApplicationVndSchemaregistryPlusJSONRequestBody defines body for PutConfig for application/vnd.schemaregistry+json ContentType. +type PutConfigApplicationVndSchemaregistryPlusJSONRequestBody = PutCompatibility + +// PutConfigApplicationVndSchemaregistryV1PlusJSONRequestBody defines body for PutConfig for application/vnd.schemaregistry.v1+json ContentType. +type PutConfigApplicationVndSchemaregistryV1PlusJSONRequestBody = PutCompatibility + +// PutConfigSubjectJSONRequestBody defines body for PutConfigSubject for application/json ContentType. +type PutConfigSubjectJSONRequestBody = PutCompatibility + +// PutConfigSubjectApplicationVndSchemaregistryPlusJSONRequestBody defines body for PutConfigSubject for application/vnd.schemaregistry+json ContentType. +type PutConfigSubjectApplicationVndSchemaregistryPlusJSONRequestBody = PutCompatibility + +// PutConfigSubjectApplicationVndSchemaregistryV1PlusJSONRequestBody defines body for PutConfigSubject for application/vnd.schemaregistry.v1+json ContentType. +type PutConfigSubjectApplicationVndSchemaregistryV1PlusJSONRequestBody = PutCompatibility + +// PutModeJSONRequestBody defines body for PutMode for application/json ContentType. +type PutModeJSONRequestBody = Mode + +// PutModeApplicationVndSchemaregistryPlusJSONRequestBody defines body for PutMode for application/vnd.schemaregistry+json ContentType. +type PutModeApplicationVndSchemaregistryPlusJSONRequestBody = Mode + +// PutModeApplicationVndSchemaregistryV1PlusJSONRequestBody defines body for PutMode for application/vnd.schemaregistry.v1+json ContentType. +type PutModeApplicationVndSchemaregistryV1PlusJSONRequestBody = Mode + +// PutModeSubjectJSONRequestBody defines body for PutModeSubject for application/json ContentType. +type PutModeSubjectJSONRequestBody = Mode + +// PutModeSubjectApplicationVndSchemaregistryPlusJSONRequestBody defines body for PutModeSubject for application/vnd.schemaregistry+json ContentType. +type PutModeSubjectApplicationVndSchemaregistryPlusJSONRequestBody = Mode + +// PutModeSubjectApplicationVndSchemaregistryV1PlusJSONRequestBody defines body for PutModeSubject for application/vnd.schemaregistry.v1+json ContentType. +type PutModeSubjectApplicationVndSchemaregistryV1PlusJSONRequestBody = Mode + +// DeleteSecurityAclsJSONRequestBody defines body for DeleteSecurityAcls for application/json ContentType. +type DeleteSecurityAclsJSONRequestBody = DeleteSecurityAclsJSONBody + +// PostSecurityAclsJSONRequestBody defines body for PostSecurityAcls for application/json ContentType. +type PostSecurityAclsJSONRequestBody = PostSecurityAclsJSONBody + +// PostSubjectJSONRequestBody defines body for PostSubject for application/json ContentType. +type PostSubjectJSONRequestBody = SchemaDef + +// PostSubjectApplicationVndSchemaregistryPlusJSONRequestBody defines body for PostSubject for application/vnd.schemaregistry+json ContentType. +type PostSubjectApplicationVndSchemaregistryPlusJSONRequestBody = SchemaDef + +// PostSubjectApplicationVndSchemaregistryV1PlusJSONRequestBody defines body for PostSubject for application/vnd.schemaregistry.v1+json ContentType. +type PostSubjectApplicationVndSchemaregistryV1PlusJSONRequestBody = SchemaDef + +// PostSubjectVersionsJSONRequestBody defines body for PostSubjectVersions for application/json ContentType. +type PostSubjectVersionsJSONRequestBody = StoredSchema + +// PostSubjectVersionsApplicationVndSchemaregistryPlusJSONRequestBody defines body for PostSubjectVersions for application/vnd.schemaregistry+json ContentType. +type PostSubjectVersionsApplicationVndSchemaregistryPlusJSONRequestBody = StoredSchema + +// PostSubjectVersionsApplicationVndSchemaregistryV1PlusJSONRequestBody defines body for PostSubjectVersions for application/vnd.schemaregistry.v1+json ContentType. +type PostSubjectVersionsApplicationVndSchemaregistryV1PlusJSONRequestBody = StoredSchema + +// RequestEditorFn is the function signature for the RequestEditor callback function +type RequestEditorFn func(ctx context.Context, req *http.Request) error + +// Doer performs HTTP requests. +// +// The standard http.Client implements this interface. +type HttpRequestDoer interface { + Do(req *http.Request) (*http.Response, error) +} + +// Client which conforms to the OpenAPI3 specification for this service. +type Client struct { + // The endpoint of the server conforming to this interface, with scheme, + // https://api.deepmap.com for example. This can contain a path relative + // to the server, such as https://api.deepmap.com/dev-test, and all the + // paths in the swagger spec will be appended to the server. + Server string + + // Doer for performing requests, typically a *http.Client with any + // customized settings, such as certificate chains. + Client HttpRequestDoer + + // A list of callbacks for modifying requests which are generated before sending over + // the network. + RequestEditors []RequestEditorFn +} + +// ClientOption allows setting custom parameters during construction +type ClientOption func(*Client) error + +// Creates a new Client, with reasonable defaults +func NewClient(server string, opts ...ClientOption) (*Client, error) { + // create a client with sane default values + client := Client{ + Server: server, + } + // mutate client and add all optional params + for _, o := range opts { + if err := o(&client); err != nil { + return nil, err + } + } + // ensure the server URL always has a trailing slash + if !strings.HasSuffix(client.Server, "/") { + client.Server += "/" + } + // create httpClient, if not already present + if client.Client == nil { + client.Client = &http.Client{} + } + return &client, nil +} + +// WithHTTPClient allows overriding the default Doer, which is +// automatically created using http.Client. This is useful for tests. +func WithHTTPClient(doer HttpRequestDoer) ClientOption { + return func(c *Client) error { + c.Client = doer + return nil + } +} + +// WithRequestEditorFn allows setting up a callback function, which will be +// called right before sending the request. This can be used to mutate the request. +func WithRequestEditorFn(fn RequestEditorFn) ClientOption { + return func(c *Client) error { + c.RequestEditors = append(c.RequestEditors, fn) + return nil + } +} + +// The interface specification for the client above. +type ClientInterface interface { + // CompatibilitySubjectVersionWithBody request with any body + CompatibilitySubjectVersionWithBody(ctx context.Context, subject string, version string, params *CompatibilitySubjectVersionParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + CompatibilitySubjectVersion(ctx context.Context, subject string, version string, params *CompatibilitySubjectVersionParams, body CompatibilitySubjectVersionJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + CompatibilitySubjectVersionWithApplicationVndSchemaregistryPlusJSONBody(ctx context.Context, subject string, version string, params *CompatibilitySubjectVersionParams, body CompatibilitySubjectVersionApplicationVndSchemaregistryPlusJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + CompatibilitySubjectVersionWithApplicationVndSchemaregistryV1PlusJSONBody(ctx context.Context, subject string, version string, params *CompatibilitySubjectVersionParams, body CompatibilitySubjectVersionApplicationVndSchemaregistryV1PlusJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // GetConfig request + GetConfig(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) + + // PutConfigWithBody request with any body + PutConfigWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + PutConfig(ctx context.Context, body PutConfigJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + PutConfigWithApplicationVndSchemaregistryPlusJSONBody(ctx context.Context, body PutConfigApplicationVndSchemaregistryPlusJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + PutConfigWithApplicationVndSchemaregistryV1PlusJSONBody(ctx context.Context, body PutConfigApplicationVndSchemaregistryV1PlusJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // DeleteConfigSubject request + DeleteConfigSubject(ctx context.Context, subject string, reqEditors ...RequestEditorFn) (*http.Response, error) + + // GetConfigSubject request + GetConfigSubject(ctx context.Context, subject string, params *GetConfigSubjectParams, reqEditors ...RequestEditorFn) (*http.Response, error) + + // PutConfigSubjectWithBody request with any body + PutConfigSubjectWithBody(ctx context.Context, subject string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + PutConfigSubject(ctx context.Context, subject string, body PutConfigSubjectJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + PutConfigSubjectWithApplicationVndSchemaregistryPlusJSONBody(ctx context.Context, subject string, body PutConfigSubjectApplicationVndSchemaregistryPlusJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + PutConfigSubjectWithApplicationVndSchemaregistryV1PlusJSONBody(ctx context.Context, subject string, body PutConfigSubjectApplicationVndSchemaregistryV1PlusJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // GetMode request + GetMode(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) + + // PutModeWithBody request with any body + PutModeWithBody(ctx context.Context, params *PutModeParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + PutMode(ctx context.Context, params *PutModeParams, body PutModeJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + PutModeWithApplicationVndSchemaregistryPlusJSONBody(ctx context.Context, params *PutModeParams, body PutModeApplicationVndSchemaregistryPlusJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + PutModeWithApplicationVndSchemaregistryV1PlusJSONBody(ctx context.Context, params *PutModeParams, body PutModeApplicationVndSchemaregistryV1PlusJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // DeleteModeSubject request + DeleteModeSubject(ctx context.Context, subject string, reqEditors ...RequestEditorFn) (*http.Response, error) + + // GetModeSubject request + GetModeSubject(ctx context.Context, subject string, params *GetModeSubjectParams, reqEditors ...RequestEditorFn) (*http.Response, error) + + // PutModeSubjectWithBody request with any body + PutModeSubjectWithBody(ctx context.Context, subject string, params *PutModeSubjectParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + PutModeSubject(ctx context.Context, subject string, params *PutModeSubjectParams, body PutModeSubjectJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + PutModeSubjectWithApplicationVndSchemaregistryPlusJSONBody(ctx context.Context, subject string, params *PutModeSubjectParams, body PutModeSubjectApplicationVndSchemaregistryPlusJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + PutModeSubjectWithApplicationVndSchemaregistryV1PlusJSONBody(ctx context.Context, subject string, params *PutModeSubjectParams, body PutModeSubjectApplicationVndSchemaregistryV1PlusJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // GetSchemasIdsId request + GetSchemasIdsId(ctx context.Context, id int, params *GetSchemasIdsIdParams, reqEditors ...RequestEditorFn) (*http.Response, error) + + // GetSchemasIdsIdSubjects request + GetSchemasIdsIdSubjects(ctx context.Context, id int, params *GetSchemasIdsIdSubjectsParams, reqEditors ...RequestEditorFn) (*http.Response, error) + + // GetSchemasIdsIdVersions request + GetSchemasIdsIdVersions(ctx context.Context, id int, reqEditors ...RequestEditorFn) (*http.Response, error) + + // GetSchemasTypes request + GetSchemasTypes(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) + + // DeleteSecurityAclsWithBody request with any body + DeleteSecurityAclsWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + DeleteSecurityAcls(ctx context.Context, body DeleteSecurityAclsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // GetSecurityAcls request + GetSecurityAcls(ctx context.Context, params *GetSecurityAclsParams, reqEditors ...RequestEditorFn) (*http.Response, error) + + // PostSecurityAclsWithBody request with any body + PostSecurityAclsWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + PostSecurityAcls(ctx context.Context, body PostSecurityAclsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // SchemaRegistryStatusReady request + SchemaRegistryStatusReady(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) + + // GetSubjects request + GetSubjects(ctx context.Context, params *GetSubjectsParams, reqEditors ...RequestEditorFn) (*http.Response, error) + + // DeleteSubject request + DeleteSubject(ctx context.Context, subject string, params *DeleteSubjectParams, reqEditors ...RequestEditorFn) (*http.Response, error) + + // PostSubjectWithBody request with any body + PostSubjectWithBody(ctx context.Context, subject string, params *PostSubjectParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + PostSubject(ctx context.Context, subject string, params *PostSubjectParams, body PostSubjectJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + PostSubjectWithApplicationVndSchemaregistryPlusJSONBody(ctx context.Context, subject string, params *PostSubjectParams, body PostSubjectApplicationVndSchemaregistryPlusJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + PostSubjectWithApplicationVndSchemaregistryV1PlusJSONBody(ctx context.Context, subject string, params *PostSubjectParams, body PostSubjectApplicationVndSchemaregistryV1PlusJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // GetSubjectVersions request + GetSubjectVersions(ctx context.Context, subject string, params *GetSubjectVersionsParams, reqEditors ...RequestEditorFn) (*http.Response, error) + + // PostSubjectVersionsWithBody request with any body + PostSubjectVersionsWithBody(ctx context.Context, subject string, params *PostSubjectVersionsParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + PostSubjectVersions(ctx context.Context, subject string, params *PostSubjectVersionsParams, body PostSubjectVersionsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + PostSubjectVersionsWithApplicationVndSchemaregistryPlusJSONBody(ctx context.Context, subject string, params *PostSubjectVersionsParams, body PostSubjectVersionsApplicationVndSchemaregistryPlusJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + PostSubjectVersionsWithApplicationVndSchemaregistryV1PlusJSONBody(ctx context.Context, subject string, params *PostSubjectVersionsParams, body PostSubjectVersionsApplicationVndSchemaregistryV1PlusJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // DeleteSubjectVersion request + DeleteSubjectVersion(ctx context.Context, subject string, version string, params *DeleteSubjectVersionParams, reqEditors ...RequestEditorFn) (*http.Response, error) + + // GetSubjectVersionsVersion request + GetSubjectVersionsVersion(ctx context.Context, subject string, version string, params *GetSubjectVersionsVersionParams, reqEditors ...RequestEditorFn) (*http.Response, error) + + // GetSubjectVersionsVersionReferencedByDeprecated request + GetSubjectVersionsVersionReferencedByDeprecated(ctx context.Context, subject string, version string, reqEditors ...RequestEditorFn) (*http.Response, error) + + // GetSubjectVersionsVersionReferencedBy request + GetSubjectVersionsVersionReferencedBy(ctx context.Context, subject string, version string, reqEditors ...RequestEditorFn) (*http.Response, error) + + // GetSubjectVersionsVersionSchema request + GetSubjectVersionsVersionSchema(ctx context.Context, subject string, version string, params *GetSubjectVersionsVersionSchemaParams, reqEditors ...RequestEditorFn) (*http.Response, error) +} + +func (c *Client) CompatibilitySubjectVersionWithBody(ctx context.Context, subject string, version string, params *CompatibilitySubjectVersionParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewCompatibilitySubjectVersionRequestWithBody(c.Server, subject, version, params, 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) CompatibilitySubjectVersion(ctx context.Context, subject string, version string, params *CompatibilitySubjectVersionParams, body CompatibilitySubjectVersionJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewCompatibilitySubjectVersionRequest(c.Server, subject, version, params, 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) CompatibilitySubjectVersionWithApplicationVndSchemaregistryPlusJSONBody(ctx context.Context, subject string, version string, params *CompatibilitySubjectVersionParams, body CompatibilitySubjectVersionApplicationVndSchemaregistryPlusJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewCompatibilitySubjectVersionRequestWithApplicationVndSchemaregistryPlusJSONBody(c.Server, subject, version, params, 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) CompatibilitySubjectVersionWithApplicationVndSchemaregistryV1PlusJSONBody(ctx context.Context, subject string, version string, params *CompatibilitySubjectVersionParams, body CompatibilitySubjectVersionApplicationVndSchemaregistryV1PlusJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewCompatibilitySubjectVersionRequestWithApplicationVndSchemaregistryV1PlusJSONBody(c.Server, subject, version, params, 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) GetConfig(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetConfigRequest(c.Server) + 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) PutConfigWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPutConfigRequestWithBody(c.Server, 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) PutConfig(ctx context.Context, body PutConfigJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPutConfigRequest(c.Server, 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) PutConfigWithApplicationVndSchemaregistryPlusJSONBody(ctx context.Context, body PutConfigApplicationVndSchemaregistryPlusJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPutConfigRequestWithApplicationVndSchemaregistryPlusJSONBody(c.Server, 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) PutConfigWithApplicationVndSchemaregistryV1PlusJSONBody(ctx context.Context, body PutConfigApplicationVndSchemaregistryV1PlusJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPutConfigRequestWithApplicationVndSchemaregistryV1PlusJSONBody(c.Server, 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) DeleteConfigSubject(ctx context.Context, subject string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewDeleteConfigSubjectRequest(c.Server, subject) + 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) GetConfigSubject(ctx context.Context, subject string, params *GetConfigSubjectParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetConfigSubjectRequest(c.Server, subject, 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) PutConfigSubjectWithBody(ctx context.Context, subject string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPutConfigSubjectRequestWithBody(c.Server, subject, 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) PutConfigSubject(ctx context.Context, subject string, body PutConfigSubjectJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPutConfigSubjectRequest(c.Server, subject, 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) PutConfigSubjectWithApplicationVndSchemaregistryPlusJSONBody(ctx context.Context, subject string, body PutConfigSubjectApplicationVndSchemaregistryPlusJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPutConfigSubjectRequestWithApplicationVndSchemaregistryPlusJSONBody(c.Server, subject, 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) PutConfigSubjectWithApplicationVndSchemaregistryV1PlusJSONBody(ctx context.Context, subject string, body PutConfigSubjectApplicationVndSchemaregistryV1PlusJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPutConfigSubjectRequestWithApplicationVndSchemaregistryV1PlusJSONBody(c.Server, subject, 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) GetMode(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetModeRequest(c.Server) + 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) PutModeWithBody(ctx context.Context, params *PutModeParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPutModeRequestWithBody(c.Server, params, 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) PutMode(ctx context.Context, params *PutModeParams, body PutModeJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPutModeRequest(c.Server, params, 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) PutModeWithApplicationVndSchemaregistryPlusJSONBody(ctx context.Context, params *PutModeParams, body PutModeApplicationVndSchemaregistryPlusJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPutModeRequestWithApplicationVndSchemaregistryPlusJSONBody(c.Server, params, 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) PutModeWithApplicationVndSchemaregistryV1PlusJSONBody(ctx context.Context, params *PutModeParams, body PutModeApplicationVndSchemaregistryV1PlusJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPutModeRequestWithApplicationVndSchemaregistryV1PlusJSONBody(c.Server, params, 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) DeleteModeSubject(ctx context.Context, subject string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewDeleteModeSubjectRequest(c.Server, subject) + 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) GetModeSubject(ctx context.Context, subject string, params *GetModeSubjectParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetModeSubjectRequest(c.Server, subject, 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) PutModeSubjectWithBody(ctx context.Context, subject string, params *PutModeSubjectParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPutModeSubjectRequestWithBody(c.Server, subject, params, 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) PutModeSubject(ctx context.Context, subject string, params *PutModeSubjectParams, body PutModeSubjectJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPutModeSubjectRequest(c.Server, subject, params, 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) PutModeSubjectWithApplicationVndSchemaregistryPlusJSONBody(ctx context.Context, subject string, params *PutModeSubjectParams, body PutModeSubjectApplicationVndSchemaregistryPlusJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPutModeSubjectRequestWithApplicationVndSchemaregistryPlusJSONBody(c.Server, subject, params, 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) PutModeSubjectWithApplicationVndSchemaregistryV1PlusJSONBody(ctx context.Context, subject string, params *PutModeSubjectParams, body PutModeSubjectApplicationVndSchemaregistryV1PlusJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPutModeSubjectRequestWithApplicationVndSchemaregistryV1PlusJSONBody(c.Server, subject, params, 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) GetSchemasIdsId(ctx context.Context, id int, params *GetSchemasIdsIdParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetSchemasIdsIdRequest(c.Server, id, 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) GetSchemasIdsIdSubjects(ctx context.Context, id int, params *GetSchemasIdsIdSubjectsParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetSchemasIdsIdSubjectsRequest(c.Server, id, 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) GetSchemasIdsIdVersions(ctx context.Context, id int, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetSchemasIdsIdVersionsRequest(c.Server, id) + 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) GetSchemasTypes(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetSchemasTypesRequest(c.Server) + 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) DeleteSecurityAclsWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewDeleteSecurityAclsRequestWithBody(c.Server, 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) DeleteSecurityAcls(ctx context.Context, body DeleteSecurityAclsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewDeleteSecurityAclsRequest(c.Server, 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) GetSecurityAcls(ctx context.Context, params *GetSecurityAclsParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetSecurityAclsRequest(c.Server, 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) PostSecurityAclsWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPostSecurityAclsRequestWithBody(c.Server, 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) PostSecurityAcls(ctx context.Context, body PostSecurityAclsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPostSecurityAclsRequest(c.Server, 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) SchemaRegistryStatusReady(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewSchemaRegistryStatusReadyRequest(c.Server) + 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) GetSubjects(ctx context.Context, params *GetSubjectsParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetSubjectsRequest(c.Server, 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) DeleteSubject(ctx context.Context, subject string, params *DeleteSubjectParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewDeleteSubjectRequest(c.Server, subject, 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) PostSubjectWithBody(ctx context.Context, subject string, params *PostSubjectParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPostSubjectRequestWithBody(c.Server, subject, params, 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) PostSubject(ctx context.Context, subject string, params *PostSubjectParams, body PostSubjectJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPostSubjectRequest(c.Server, subject, params, 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) PostSubjectWithApplicationVndSchemaregistryPlusJSONBody(ctx context.Context, subject string, params *PostSubjectParams, body PostSubjectApplicationVndSchemaregistryPlusJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPostSubjectRequestWithApplicationVndSchemaregistryPlusJSONBody(c.Server, subject, params, 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) PostSubjectWithApplicationVndSchemaregistryV1PlusJSONBody(ctx context.Context, subject string, params *PostSubjectParams, body PostSubjectApplicationVndSchemaregistryV1PlusJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPostSubjectRequestWithApplicationVndSchemaregistryV1PlusJSONBody(c.Server, subject, params, 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) GetSubjectVersions(ctx context.Context, subject string, params *GetSubjectVersionsParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetSubjectVersionsRequest(c.Server, subject, 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) PostSubjectVersionsWithBody(ctx context.Context, subject string, params *PostSubjectVersionsParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPostSubjectVersionsRequestWithBody(c.Server, subject, params, 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) PostSubjectVersions(ctx context.Context, subject string, params *PostSubjectVersionsParams, body PostSubjectVersionsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPostSubjectVersionsRequest(c.Server, subject, params, 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) PostSubjectVersionsWithApplicationVndSchemaregistryPlusJSONBody(ctx context.Context, subject string, params *PostSubjectVersionsParams, body PostSubjectVersionsApplicationVndSchemaregistryPlusJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPostSubjectVersionsRequestWithApplicationVndSchemaregistryPlusJSONBody(c.Server, subject, params, 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) PostSubjectVersionsWithApplicationVndSchemaregistryV1PlusJSONBody(ctx context.Context, subject string, params *PostSubjectVersionsParams, body PostSubjectVersionsApplicationVndSchemaregistryV1PlusJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPostSubjectVersionsRequestWithApplicationVndSchemaregistryV1PlusJSONBody(c.Server, subject, params, 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) DeleteSubjectVersion(ctx context.Context, subject string, version string, params *DeleteSubjectVersionParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewDeleteSubjectVersionRequest(c.Server, subject, version, 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) GetSubjectVersionsVersion(ctx context.Context, subject string, version string, params *GetSubjectVersionsVersionParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetSubjectVersionsVersionRequest(c.Server, subject, version, 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) GetSubjectVersionsVersionReferencedByDeprecated(ctx context.Context, subject string, version string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetSubjectVersionsVersionReferencedByDeprecatedRequest(c.Server, subject, version) + 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) GetSubjectVersionsVersionReferencedBy(ctx context.Context, subject string, version string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetSubjectVersionsVersionReferencedByRequest(c.Server, subject, version) + 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) GetSubjectVersionsVersionSchema(ctx context.Context, subject string, version string, params *GetSubjectVersionsVersionSchemaParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetSubjectVersionsVersionSchemaRequest(c.Server, subject, version, 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) +} + +// NewCompatibilitySubjectVersionRequest calls the generic CompatibilitySubjectVersion builder with application/json body +func NewCompatibilitySubjectVersionRequest(server string, subject string, version string, params *CompatibilitySubjectVersionParams, body CompatibilitySubjectVersionJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewCompatibilitySubjectVersionRequestWithBody(server, subject, version, params, "application/json", bodyReader) +} + +// NewCompatibilitySubjectVersionRequestWithApplicationVndSchemaregistryPlusJSONBody calls the generic CompatibilitySubjectVersion builder with application/vnd.schemaregistry+json body +func NewCompatibilitySubjectVersionRequestWithApplicationVndSchemaregistryPlusJSONBody(server string, subject string, version string, params *CompatibilitySubjectVersionParams, body CompatibilitySubjectVersionApplicationVndSchemaregistryPlusJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewCompatibilitySubjectVersionRequestWithBody(server, subject, version, params, "application/vnd.schemaregistry+json", bodyReader) +} + +// NewCompatibilitySubjectVersionRequestWithApplicationVndSchemaregistryV1PlusJSONBody calls the generic CompatibilitySubjectVersion builder with application/vnd.schemaregistry.v1+json body +func NewCompatibilitySubjectVersionRequestWithApplicationVndSchemaregistryV1PlusJSONBody(server string, subject string, version string, params *CompatibilitySubjectVersionParams, body CompatibilitySubjectVersionApplicationVndSchemaregistryV1PlusJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewCompatibilitySubjectVersionRequestWithBody(server, subject, version, params, "application/vnd.schemaregistry.v1+json", bodyReader) +} + +// NewCompatibilitySubjectVersionRequestWithBody generates requests for CompatibilitySubjectVersion with any type of body +func NewCompatibilitySubjectVersionRequestWithBody(server string, subject string, version string, params *CompatibilitySubjectVersionParams, contentType string, body io.Reader) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "subject", runtime.ParamLocationPath, subject) + if err != nil { + return nil, err + } + + var pathParam1 string + + pathParam1, err = runtime.StyleParamWithLocation("simple", false, "version", runtime.ParamLocationPath, version) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/compatibility/subjects/%s/versions/%s", pathParam0, pathParam1) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + if params != nil { + queryValues := queryURL.Query() + + if params.Verbose != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "verbose", runtime.ParamLocationQuery, *params.Verbose); 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("POST", queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + return req, nil +} + +// NewGetConfigRequest generates requests for GetConfig +func NewGetConfigRequest(server string) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/config") + 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 +} + +// NewPutConfigRequest calls the generic PutConfig builder with application/json body +func NewPutConfigRequest(server string, body PutConfigJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewPutConfigRequestWithBody(server, "application/json", bodyReader) +} + +// NewPutConfigRequestWithApplicationVndSchemaregistryPlusJSONBody calls the generic PutConfig builder with application/vnd.schemaregistry+json body +func NewPutConfigRequestWithApplicationVndSchemaregistryPlusJSONBody(server string, body PutConfigApplicationVndSchemaregistryPlusJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewPutConfigRequestWithBody(server, "application/vnd.schemaregistry+json", bodyReader) +} + +// NewPutConfigRequestWithApplicationVndSchemaregistryV1PlusJSONBody calls the generic PutConfig builder with application/vnd.schemaregistry.v1+json body +func NewPutConfigRequestWithApplicationVndSchemaregistryV1PlusJSONBody(server string, body PutConfigApplicationVndSchemaregistryV1PlusJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewPutConfigRequestWithBody(server, "application/vnd.schemaregistry.v1+json", bodyReader) +} + +// NewPutConfigRequestWithBody generates requests for PutConfig with any type of body +func NewPutConfigRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/config") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("PUT", queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + return req, nil +} + +// NewDeleteConfigSubjectRequest generates requests for DeleteConfigSubject +func NewDeleteConfigSubjectRequest(server string, subject string) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "subject", runtime.ParamLocationPath, subject) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/config/%s", 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 +} + +// NewGetConfigSubjectRequest generates requests for GetConfigSubject +func NewGetConfigSubjectRequest(server string, subject string, params *GetConfigSubjectParams) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "subject", runtime.ParamLocationPath, subject) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/config/%s", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + if params != nil { + queryValues := queryURL.Query() + + if params.DefaultToGlobal != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "defaultToGlobal", runtime.ParamLocationQuery, *params.DefaultToGlobal); 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 +} + +// NewPutConfigSubjectRequest calls the generic PutConfigSubject builder with application/json body +func NewPutConfigSubjectRequest(server string, subject string, body PutConfigSubjectJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewPutConfigSubjectRequestWithBody(server, subject, "application/json", bodyReader) +} + +// NewPutConfigSubjectRequestWithApplicationVndSchemaregistryPlusJSONBody calls the generic PutConfigSubject builder with application/vnd.schemaregistry+json body +func NewPutConfigSubjectRequestWithApplicationVndSchemaregistryPlusJSONBody(server string, subject string, body PutConfigSubjectApplicationVndSchemaregistryPlusJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewPutConfigSubjectRequestWithBody(server, subject, "application/vnd.schemaregistry+json", bodyReader) +} + +// NewPutConfigSubjectRequestWithApplicationVndSchemaregistryV1PlusJSONBody calls the generic PutConfigSubject builder with application/vnd.schemaregistry.v1+json body +func NewPutConfigSubjectRequestWithApplicationVndSchemaregistryV1PlusJSONBody(server string, subject string, body PutConfigSubjectApplicationVndSchemaregistryV1PlusJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewPutConfigSubjectRequestWithBody(server, subject, "application/vnd.schemaregistry.v1+json", bodyReader) +} + +// NewPutConfigSubjectRequestWithBody generates requests for PutConfigSubject with any type of body +func NewPutConfigSubjectRequestWithBody(server string, subject string, contentType string, body io.Reader) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "subject", runtime.ParamLocationPath, subject) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/config/%s", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("PUT", queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + return req, nil +} + +// NewGetModeRequest generates requests for GetMode +func NewGetModeRequest(server string) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/mode") + 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 +} + +// NewPutModeRequest calls the generic PutMode builder with application/json body +func NewPutModeRequest(server string, params *PutModeParams, body PutModeJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewPutModeRequestWithBody(server, params, "application/json", bodyReader) +} + +// NewPutModeRequestWithApplicationVndSchemaregistryPlusJSONBody calls the generic PutMode builder with application/vnd.schemaregistry+json body +func NewPutModeRequestWithApplicationVndSchemaregistryPlusJSONBody(server string, params *PutModeParams, body PutModeApplicationVndSchemaregistryPlusJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewPutModeRequestWithBody(server, params, "application/vnd.schemaregistry+json", bodyReader) +} + +// NewPutModeRequestWithApplicationVndSchemaregistryV1PlusJSONBody calls the generic PutMode builder with application/vnd.schemaregistry.v1+json body +func NewPutModeRequestWithApplicationVndSchemaregistryV1PlusJSONBody(server string, params *PutModeParams, body PutModeApplicationVndSchemaregistryV1PlusJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewPutModeRequestWithBody(server, params, "application/vnd.schemaregistry.v1+json", bodyReader) +} + +// NewPutModeRequestWithBody generates requests for PutMode with any type of body +func NewPutModeRequestWithBody(server string, params *PutModeParams, contentType string, body io.Reader) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/mode") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + if params != nil { + queryValues := queryURL.Query() + + if params.Force != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "force", runtime.ParamLocationQuery, *params.Force); 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("PUT", queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + return req, nil +} + +// NewDeleteModeSubjectRequest generates requests for DeleteModeSubject +func NewDeleteModeSubjectRequest(server string, subject string) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "subject", runtime.ParamLocationPath, subject) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/mode/%s", 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 +} + +// NewGetModeSubjectRequest generates requests for GetModeSubject +func NewGetModeSubjectRequest(server string, subject string, params *GetModeSubjectParams) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "subject", runtime.ParamLocationPath, subject) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/mode/%s", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + if params != nil { + queryValues := queryURL.Query() + + if params.DefaultToGlobal != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "defaultToGlobal", runtime.ParamLocationQuery, *params.DefaultToGlobal); 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 +} + +// NewPutModeSubjectRequest calls the generic PutModeSubject builder with application/json body +func NewPutModeSubjectRequest(server string, subject string, params *PutModeSubjectParams, body PutModeSubjectJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewPutModeSubjectRequestWithBody(server, subject, params, "application/json", bodyReader) +} + +// NewPutModeSubjectRequestWithApplicationVndSchemaregistryPlusJSONBody calls the generic PutModeSubject builder with application/vnd.schemaregistry+json body +func NewPutModeSubjectRequestWithApplicationVndSchemaregistryPlusJSONBody(server string, subject string, params *PutModeSubjectParams, body PutModeSubjectApplicationVndSchemaregistryPlusJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewPutModeSubjectRequestWithBody(server, subject, params, "application/vnd.schemaregistry+json", bodyReader) +} + +// NewPutModeSubjectRequestWithApplicationVndSchemaregistryV1PlusJSONBody calls the generic PutModeSubject builder with application/vnd.schemaregistry.v1+json body +func NewPutModeSubjectRequestWithApplicationVndSchemaregistryV1PlusJSONBody(server string, subject string, params *PutModeSubjectParams, body PutModeSubjectApplicationVndSchemaregistryV1PlusJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewPutModeSubjectRequestWithBody(server, subject, params, "application/vnd.schemaregistry.v1+json", bodyReader) +} + +// NewPutModeSubjectRequestWithBody generates requests for PutModeSubject with any type of body +func NewPutModeSubjectRequestWithBody(server string, subject string, params *PutModeSubjectParams, contentType string, body io.Reader) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "subject", runtime.ParamLocationPath, subject) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/mode/%s", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + if params != nil { + queryValues := queryURL.Query() + + if params.Force != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "force", runtime.ParamLocationQuery, *params.Force); 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("PUT", queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + return req, nil +} + +// NewGetSchemasIdsIdRequest generates requests for GetSchemasIdsId +func NewGetSchemasIdsIdRequest(server string, id int, params *GetSchemasIdsIdParams) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "id", runtime.ParamLocationPath, id) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/schemas/ids/%s", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + if params != nil { + queryValues := queryURL.Query() + + if params.Format != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "format", runtime.ParamLocationQuery, *params.Format); 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 +} + +// NewGetSchemasIdsIdSubjectsRequest generates requests for GetSchemasIdsIdSubjects +func NewGetSchemasIdsIdSubjectsRequest(server string, id int, params *GetSchemasIdsIdSubjectsParams) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "id", runtime.ParamLocationPath, id) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/schemas/ids/%s/subjects", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + if params != nil { + queryValues := queryURL.Query() + + if params.Deleted != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "deleted", runtime.ParamLocationQuery, *params.Deleted); 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 +} + +// NewGetSchemasIdsIdVersionsRequest generates requests for GetSchemasIdsIdVersions +func NewGetSchemasIdsIdVersionsRequest(server string, id int) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "id", runtime.ParamLocationPath, id) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/schemas/ids/%s/versions", 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 +} + +// NewGetSchemasTypesRequest generates requests for GetSchemasTypes +func NewGetSchemasTypesRequest(server string) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/schemas/types") + 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 +} + +// NewDeleteSecurityAclsRequest calls the generic DeleteSecurityAcls builder with application/json body +func NewDeleteSecurityAclsRequest(server string, body DeleteSecurityAclsJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewDeleteSecurityAclsRequestWithBody(server, "application/json", bodyReader) +} + +// NewDeleteSecurityAclsRequestWithBody generates requests for DeleteSecurityAcls with any type of body +func NewDeleteSecurityAclsRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/security/acls") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("DELETE", queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + return req, nil +} + +// NewGetSecurityAclsRequest generates requests for GetSecurityAcls +func NewGetSecurityAclsRequest(server string, params *GetSecurityAclsParams) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/security/acls") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + if params != nil { + queryValues := queryURL.Query() + + if params.Principal != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "principal", runtime.ParamLocationQuery, *params.Principal); 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.Resource != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "resource", runtime.ParamLocationQuery, *params.Resource); 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.ResourceType != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "resource_type", runtime.ParamLocationQuery, *params.ResourceType); 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.PatternType != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "pattern_type", runtime.ParamLocationQuery, *params.PatternType); 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.Host != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "host", runtime.ParamLocationQuery, *params.Host); 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.Operation != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "operation", runtime.ParamLocationQuery, *params.Operation); 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.Permission != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "permission", runtime.ParamLocationQuery, *params.Permission); 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 +} + +// NewPostSecurityAclsRequest calls the generic PostSecurityAcls builder with application/json body +func NewPostSecurityAclsRequest(server string, body PostSecurityAclsJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewPostSecurityAclsRequestWithBody(server, "application/json", bodyReader) +} + +// NewPostSecurityAclsRequestWithBody generates requests for PostSecurityAcls with any type of body +func NewPostSecurityAclsRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/security/acls") + 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 +} + +// NewSchemaRegistryStatusReadyRequest generates requests for SchemaRegistryStatusReady +func NewSchemaRegistryStatusReadyRequest(server string) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/status/ready") + 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 +} + +// NewGetSubjectsRequest generates requests for GetSubjects +func NewGetSubjectsRequest(server string, params *GetSubjectsParams) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/subjects") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + if params != nil { + queryValues := queryURL.Query() + + if params.Deleted != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "deleted", runtime.ParamLocationQuery, *params.Deleted); 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.SubjectPrefix != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "subjectPrefix", runtime.ParamLocationQuery, *params.SubjectPrefix); 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 +} + +// NewDeleteSubjectRequest generates requests for DeleteSubject +func NewDeleteSubjectRequest(server string, subject string, params *DeleteSubjectParams) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "subject", runtime.ParamLocationPath, subject) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/subjects/%s", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + if params != nil { + queryValues := queryURL.Query() + + if params.Permanent != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "permanent", runtime.ParamLocationQuery, *params.Permanent); 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("DELETE", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewPostSubjectRequest calls the generic PostSubject builder with application/json body +func NewPostSubjectRequest(server string, subject string, params *PostSubjectParams, body PostSubjectJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewPostSubjectRequestWithBody(server, subject, params, "application/json", bodyReader) +} + +// NewPostSubjectRequestWithApplicationVndSchemaregistryPlusJSONBody calls the generic PostSubject builder with application/vnd.schemaregistry+json body +func NewPostSubjectRequestWithApplicationVndSchemaregistryPlusJSONBody(server string, subject string, params *PostSubjectParams, body PostSubjectApplicationVndSchemaregistryPlusJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewPostSubjectRequestWithBody(server, subject, params, "application/vnd.schemaregistry+json", bodyReader) +} + +// NewPostSubjectRequestWithApplicationVndSchemaregistryV1PlusJSONBody calls the generic PostSubject builder with application/vnd.schemaregistry.v1+json body +func NewPostSubjectRequestWithApplicationVndSchemaregistryV1PlusJSONBody(server string, subject string, params *PostSubjectParams, body PostSubjectApplicationVndSchemaregistryV1PlusJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewPostSubjectRequestWithBody(server, subject, params, "application/vnd.schemaregistry.v1+json", bodyReader) +} + +// NewPostSubjectRequestWithBody generates requests for PostSubject with any type of body +func NewPostSubjectRequestWithBody(server string, subject string, params *PostSubjectParams, contentType string, body io.Reader) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "subject", runtime.ParamLocationPath, subject) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/subjects/%s", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + if params != nil { + queryValues := queryURL.Query() + + if params.Normalize != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "normalize", runtime.ParamLocationQuery, *params.Normalize); 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.Deleted != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "deleted", runtime.ParamLocationQuery, *params.Deleted); 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.Format != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "format", runtime.ParamLocationQuery, *params.Format); 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("POST", queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + return req, nil +} + +// NewGetSubjectVersionsRequest generates requests for GetSubjectVersions +func NewGetSubjectVersionsRequest(server string, subject string, params *GetSubjectVersionsParams) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "subject", runtime.ParamLocationPath, subject) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/subjects/%s/versions", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + if params != nil { + queryValues := queryURL.Query() + + if params.Deleted != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "deleted", runtime.ParamLocationQuery, *params.Deleted); 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 +} + +// NewPostSubjectVersionsRequest calls the generic PostSubjectVersions builder with application/json body +func NewPostSubjectVersionsRequest(server string, subject string, params *PostSubjectVersionsParams, body PostSubjectVersionsJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewPostSubjectVersionsRequestWithBody(server, subject, params, "application/json", bodyReader) +} + +// NewPostSubjectVersionsRequestWithApplicationVndSchemaregistryPlusJSONBody calls the generic PostSubjectVersions builder with application/vnd.schemaregistry+json body +func NewPostSubjectVersionsRequestWithApplicationVndSchemaregistryPlusJSONBody(server string, subject string, params *PostSubjectVersionsParams, body PostSubjectVersionsApplicationVndSchemaregistryPlusJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewPostSubjectVersionsRequestWithBody(server, subject, params, "application/vnd.schemaregistry+json", bodyReader) +} + +// NewPostSubjectVersionsRequestWithApplicationVndSchemaregistryV1PlusJSONBody calls the generic PostSubjectVersions builder with application/vnd.schemaregistry.v1+json body +func NewPostSubjectVersionsRequestWithApplicationVndSchemaregistryV1PlusJSONBody(server string, subject string, params *PostSubjectVersionsParams, body PostSubjectVersionsApplicationVndSchemaregistryV1PlusJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewPostSubjectVersionsRequestWithBody(server, subject, params, "application/vnd.schemaregistry.v1+json", bodyReader) +} + +// NewPostSubjectVersionsRequestWithBody generates requests for PostSubjectVersions with any type of body +func NewPostSubjectVersionsRequestWithBody(server string, subject string, params *PostSubjectVersionsParams, contentType string, body io.Reader) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "subject", runtime.ParamLocationPath, subject) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/subjects/%s/versions", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + if params != nil { + queryValues := queryURL.Query() + + if params.Normalize != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "normalize", runtime.ParamLocationQuery, *params.Normalize); 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("POST", queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + return req, nil +} + +// NewDeleteSubjectVersionRequest generates requests for DeleteSubjectVersion +func NewDeleteSubjectVersionRequest(server string, subject string, version string, params *DeleteSubjectVersionParams) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "subject", runtime.ParamLocationPath, subject) + if err != nil { + return nil, err + } + + var pathParam1 string + + pathParam1, err = runtime.StyleParamWithLocation("simple", false, "version", runtime.ParamLocationPath, version) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/subjects/%s/versions/%s", pathParam0, pathParam1) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + if params != nil { + queryValues := queryURL.Query() + + if params.Permanent != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "permanent", runtime.ParamLocationQuery, *params.Permanent); 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("DELETE", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewGetSubjectVersionsVersionRequest generates requests for GetSubjectVersionsVersion +func NewGetSubjectVersionsVersionRequest(server string, subject string, version string, params *GetSubjectVersionsVersionParams) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "subject", runtime.ParamLocationPath, subject) + if err != nil { + return nil, err + } + + var pathParam1 string + + pathParam1, err = runtime.StyleParamWithLocation("simple", false, "version", runtime.ParamLocationPath, version) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/subjects/%s/versions/%s", pathParam0, pathParam1) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + if params != nil { + queryValues := queryURL.Query() + + if params.Deleted != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "deleted", runtime.ParamLocationQuery, *params.Deleted); 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.Format != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "format", runtime.ParamLocationQuery, *params.Format); 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 +} + +// NewGetSubjectVersionsVersionReferencedByDeprecatedRequest generates requests for GetSubjectVersionsVersionReferencedByDeprecated +func NewGetSubjectVersionsVersionReferencedByDeprecatedRequest(server string, subject string, version string) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "subject", runtime.ParamLocationPath, subject) + if err != nil { + return nil, err + } + + var pathParam1 string + + pathParam1, err = runtime.StyleParamWithLocation("simple", false, "version", runtime.ParamLocationPath, version) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/subjects/%s/versions/%s/referencedBy", 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 +} + +// NewGetSubjectVersionsVersionReferencedByRequest generates requests for GetSubjectVersionsVersionReferencedBy +func NewGetSubjectVersionsVersionReferencedByRequest(server string, subject string, version string) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "subject", runtime.ParamLocationPath, subject) + if err != nil { + return nil, err + } + + var pathParam1 string + + pathParam1, err = runtime.StyleParamWithLocation("simple", false, "version", runtime.ParamLocationPath, version) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/subjects/%s/versions/%s/referencedby", 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 +} + +// NewGetSubjectVersionsVersionSchemaRequest generates requests for GetSubjectVersionsVersionSchema +func NewGetSubjectVersionsVersionSchemaRequest(server string, subject string, version string, params *GetSubjectVersionsVersionSchemaParams) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "subject", runtime.ParamLocationPath, subject) + if err != nil { + return nil, err + } + + var pathParam1 string + + pathParam1, err = runtime.StyleParamWithLocation("simple", false, "version", runtime.ParamLocationPath, version) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/subjects/%s/versions/%s/schema", pathParam0, pathParam1) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + if params != nil { + queryValues := queryURL.Query() + + if params.Deleted != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "deleted", runtime.ParamLocationQuery, *params.Deleted); 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.Format != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "format", runtime.ParamLocationQuery, *params.Format); 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 +} + +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 { + // CompatibilitySubjectVersionWithBodyWithResponse request with any body + CompatibilitySubjectVersionWithBodyWithResponse(ctx context.Context, subject string, version string, params *CompatibilitySubjectVersionParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CompatibilitySubjectVersionResponse, error) + + CompatibilitySubjectVersionWithResponse(ctx context.Context, subject string, version string, params *CompatibilitySubjectVersionParams, body CompatibilitySubjectVersionJSONRequestBody, reqEditors ...RequestEditorFn) (*CompatibilitySubjectVersionResponse, error) + + CompatibilitySubjectVersionWithApplicationVndSchemaregistryPlusJSONBodyWithResponse(ctx context.Context, subject string, version string, params *CompatibilitySubjectVersionParams, body CompatibilitySubjectVersionApplicationVndSchemaregistryPlusJSONRequestBody, reqEditors ...RequestEditorFn) (*CompatibilitySubjectVersionResponse, error) + + CompatibilitySubjectVersionWithApplicationVndSchemaregistryV1PlusJSONBodyWithResponse(ctx context.Context, subject string, version string, params *CompatibilitySubjectVersionParams, body CompatibilitySubjectVersionApplicationVndSchemaregistryV1PlusJSONRequestBody, reqEditors ...RequestEditorFn) (*CompatibilitySubjectVersionResponse, error) + + // GetConfigWithResponse request + GetConfigWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetConfigResponse, error) + + // PutConfigWithBodyWithResponse request with any body + PutConfigWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PutConfigResponse, error) + + PutConfigWithResponse(ctx context.Context, body PutConfigJSONRequestBody, reqEditors ...RequestEditorFn) (*PutConfigResponse, error) + + PutConfigWithApplicationVndSchemaregistryPlusJSONBodyWithResponse(ctx context.Context, body PutConfigApplicationVndSchemaregistryPlusJSONRequestBody, reqEditors ...RequestEditorFn) (*PutConfigResponse, error) + + PutConfigWithApplicationVndSchemaregistryV1PlusJSONBodyWithResponse(ctx context.Context, body PutConfigApplicationVndSchemaregistryV1PlusJSONRequestBody, reqEditors ...RequestEditorFn) (*PutConfigResponse, error) + + // DeleteConfigSubjectWithResponse request + DeleteConfigSubjectWithResponse(ctx context.Context, subject string, reqEditors ...RequestEditorFn) (*DeleteConfigSubjectResponse, error) + + // GetConfigSubjectWithResponse request + GetConfigSubjectWithResponse(ctx context.Context, subject string, params *GetConfigSubjectParams, reqEditors ...RequestEditorFn) (*GetConfigSubjectResponse, error) + + // PutConfigSubjectWithBodyWithResponse request with any body + PutConfigSubjectWithBodyWithResponse(ctx context.Context, subject string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PutConfigSubjectResponse, error) + + PutConfigSubjectWithResponse(ctx context.Context, subject string, body PutConfigSubjectJSONRequestBody, reqEditors ...RequestEditorFn) (*PutConfigSubjectResponse, error) + + PutConfigSubjectWithApplicationVndSchemaregistryPlusJSONBodyWithResponse(ctx context.Context, subject string, body PutConfigSubjectApplicationVndSchemaregistryPlusJSONRequestBody, reqEditors ...RequestEditorFn) (*PutConfigSubjectResponse, error) + + PutConfigSubjectWithApplicationVndSchemaregistryV1PlusJSONBodyWithResponse(ctx context.Context, subject string, body PutConfigSubjectApplicationVndSchemaregistryV1PlusJSONRequestBody, reqEditors ...RequestEditorFn) (*PutConfigSubjectResponse, error) + + // GetModeWithResponse request + GetModeWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetModeResponse, error) + + // PutModeWithBodyWithResponse request with any body + PutModeWithBodyWithResponse(ctx context.Context, params *PutModeParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PutModeResponse, error) + + PutModeWithResponse(ctx context.Context, params *PutModeParams, body PutModeJSONRequestBody, reqEditors ...RequestEditorFn) (*PutModeResponse, error) + + PutModeWithApplicationVndSchemaregistryPlusJSONBodyWithResponse(ctx context.Context, params *PutModeParams, body PutModeApplicationVndSchemaregistryPlusJSONRequestBody, reqEditors ...RequestEditorFn) (*PutModeResponse, error) + + PutModeWithApplicationVndSchemaregistryV1PlusJSONBodyWithResponse(ctx context.Context, params *PutModeParams, body PutModeApplicationVndSchemaregistryV1PlusJSONRequestBody, reqEditors ...RequestEditorFn) (*PutModeResponse, error) + + // DeleteModeSubjectWithResponse request + DeleteModeSubjectWithResponse(ctx context.Context, subject string, reqEditors ...RequestEditorFn) (*DeleteModeSubjectResponse, error) + + // GetModeSubjectWithResponse request + GetModeSubjectWithResponse(ctx context.Context, subject string, params *GetModeSubjectParams, reqEditors ...RequestEditorFn) (*GetModeSubjectResponse, error) + + // PutModeSubjectWithBodyWithResponse request with any body + PutModeSubjectWithBodyWithResponse(ctx context.Context, subject string, params *PutModeSubjectParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PutModeSubjectResponse, error) + + PutModeSubjectWithResponse(ctx context.Context, subject string, params *PutModeSubjectParams, body PutModeSubjectJSONRequestBody, reqEditors ...RequestEditorFn) (*PutModeSubjectResponse, error) + + PutModeSubjectWithApplicationVndSchemaregistryPlusJSONBodyWithResponse(ctx context.Context, subject string, params *PutModeSubjectParams, body PutModeSubjectApplicationVndSchemaregistryPlusJSONRequestBody, reqEditors ...RequestEditorFn) (*PutModeSubjectResponse, error) + + PutModeSubjectWithApplicationVndSchemaregistryV1PlusJSONBodyWithResponse(ctx context.Context, subject string, params *PutModeSubjectParams, body PutModeSubjectApplicationVndSchemaregistryV1PlusJSONRequestBody, reqEditors ...RequestEditorFn) (*PutModeSubjectResponse, error) + + // GetSchemasIdsIdWithResponse request + GetSchemasIdsIdWithResponse(ctx context.Context, id int, params *GetSchemasIdsIdParams, reqEditors ...RequestEditorFn) (*GetSchemasIdsIdResponse, error) + + // GetSchemasIdsIdSubjectsWithResponse request + GetSchemasIdsIdSubjectsWithResponse(ctx context.Context, id int, params *GetSchemasIdsIdSubjectsParams, reqEditors ...RequestEditorFn) (*GetSchemasIdsIdSubjectsResponse, error) + + // GetSchemasIdsIdVersionsWithResponse request + GetSchemasIdsIdVersionsWithResponse(ctx context.Context, id int, reqEditors ...RequestEditorFn) (*GetSchemasIdsIdVersionsResponse, error) + + // GetSchemasTypesWithResponse request + GetSchemasTypesWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetSchemasTypesResponse, error) + + // DeleteSecurityAclsWithBodyWithResponse request with any body + DeleteSecurityAclsWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*DeleteSecurityAclsResponse, error) + + DeleteSecurityAclsWithResponse(ctx context.Context, body DeleteSecurityAclsJSONRequestBody, reqEditors ...RequestEditorFn) (*DeleteSecurityAclsResponse, error) + + // GetSecurityAclsWithResponse request + GetSecurityAclsWithResponse(ctx context.Context, params *GetSecurityAclsParams, reqEditors ...RequestEditorFn) (*GetSecurityAclsResponse, error) + + // PostSecurityAclsWithBodyWithResponse request with any body + PostSecurityAclsWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostSecurityAclsResponse, error) + + PostSecurityAclsWithResponse(ctx context.Context, body PostSecurityAclsJSONRequestBody, reqEditors ...RequestEditorFn) (*PostSecurityAclsResponse, error) + + // SchemaRegistryStatusReadyWithResponse request + SchemaRegistryStatusReadyWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*SchemaRegistryStatusReadyResponse, error) + + // GetSubjectsWithResponse request + GetSubjectsWithResponse(ctx context.Context, params *GetSubjectsParams, reqEditors ...RequestEditorFn) (*GetSubjectsResponse, error) + + // DeleteSubjectWithResponse request + DeleteSubjectWithResponse(ctx context.Context, subject string, params *DeleteSubjectParams, reqEditors ...RequestEditorFn) (*DeleteSubjectResponse, error) + + // PostSubjectWithBodyWithResponse request with any body + PostSubjectWithBodyWithResponse(ctx context.Context, subject string, params *PostSubjectParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostSubjectResponse, error) + + PostSubjectWithResponse(ctx context.Context, subject string, params *PostSubjectParams, body PostSubjectJSONRequestBody, reqEditors ...RequestEditorFn) (*PostSubjectResponse, error) + + PostSubjectWithApplicationVndSchemaregistryPlusJSONBodyWithResponse(ctx context.Context, subject string, params *PostSubjectParams, body PostSubjectApplicationVndSchemaregistryPlusJSONRequestBody, reqEditors ...RequestEditorFn) (*PostSubjectResponse, error) + + PostSubjectWithApplicationVndSchemaregistryV1PlusJSONBodyWithResponse(ctx context.Context, subject string, params *PostSubjectParams, body PostSubjectApplicationVndSchemaregistryV1PlusJSONRequestBody, reqEditors ...RequestEditorFn) (*PostSubjectResponse, error) + + // GetSubjectVersionsWithResponse request + GetSubjectVersionsWithResponse(ctx context.Context, subject string, params *GetSubjectVersionsParams, reqEditors ...RequestEditorFn) (*GetSubjectVersionsResponse, error) + + // PostSubjectVersionsWithBodyWithResponse request with any body + PostSubjectVersionsWithBodyWithResponse(ctx context.Context, subject string, params *PostSubjectVersionsParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostSubjectVersionsResponse, error) + + PostSubjectVersionsWithResponse(ctx context.Context, subject string, params *PostSubjectVersionsParams, body PostSubjectVersionsJSONRequestBody, reqEditors ...RequestEditorFn) (*PostSubjectVersionsResponse, error) + + PostSubjectVersionsWithApplicationVndSchemaregistryPlusJSONBodyWithResponse(ctx context.Context, subject string, params *PostSubjectVersionsParams, body PostSubjectVersionsApplicationVndSchemaregistryPlusJSONRequestBody, reqEditors ...RequestEditorFn) (*PostSubjectVersionsResponse, error) + + PostSubjectVersionsWithApplicationVndSchemaregistryV1PlusJSONBodyWithResponse(ctx context.Context, subject string, params *PostSubjectVersionsParams, body PostSubjectVersionsApplicationVndSchemaregistryV1PlusJSONRequestBody, reqEditors ...RequestEditorFn) (*PostSubjectVersionsResponse, error) + + // DeleteSubjectVersionWithResponse request + DeleteSubjectVersionWithResponse(ctx context.Context, subject string, version string, params *DeleteSubjectVersionParams, reqEditors ...RequestEditorFn) (*DeleteSubjectVersionResponse, error) + + // GetSubjectVersionsVersionWithResponse request + GetSubjectVersionsVersionWithResponse(ctx context.Context, subject string, version string, params *GetSubjectVersionsVersionParams, reqEditors ...RequestEditorFn) (*GetSubjectVersionsVersionResponse, error) + + // GetSubjectVersionsVersionReferencedByDeprecatedWithResponse request + GetSubjectVersionsVersionReferencedByDeprecatedWithResponse(ctx context.Context, subject string, version string, reqEditors ...RequestEditorFn) (*GetSubjectVersionsVersionReferencedByDeprecatedResponse, error) + + // GetSubjectVersionsVersionReferencedByWithResponse request + GetSubjectVersionsVersionReferencedByWithResponse(ctx context.Context, subject string, version string, reqEditors ...RequestEditorFn) (*GetSubjectVersionsVersionReferencedByResponse, error) + + // GetSubjectVersionsVersionSchemaWithResponse request + GetSubjectVersionsVersionSchemaWithResponse(ctx context.Context, subject string, version string, params *GetSubjectVersionsVersionSchemaParams, reqEditors ...RequestEditorFn) (*GetSubjectVersionsVersionSchemaResponse, error) +} + +type CompatibilitySubjectVersionResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *IsCompatibile + ApplicationvndSchemaregistryJSON200 *IsCompatibile + ApplicationvndSchemaregistryV1JSON200 *IsCompatibile + JSON409 *ErrorBody + ApplicationvndSchemaregistryJSON409 *ErrorBody + ApplicationvndSchemaregistryV1JSON409 *ErrorBody + JSON422 *ErrorBody + ApplicationvndSchemaregistryJSON422 *ErrorBody + ApplicationvndSchemaregistryV1JSON422 *ErrorBody + JSON500 *ErrorBody + ApplicationvndSchemaregistryJSON500 *ErrorBody + ApplicationvndSchemaregistryV1JSON500 *ErrorBody +} + +// Status returns HTTPResponse.Status +func (r CompatibilitySubjectVersionResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r CompatibilitySubjectVersionResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type GetConfigResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *GetCompatibility + ApplicationvndSchemaregistryJSON200 *GetCompatibility + ApplicationvndSchemaregistryV1JSON200 *GetCompatibility + JSON500 *ErrorBody + ApplicationvndSchemaregistryJSON500 *ErrorBody + ApplicationvndSchemaregistryV1JSON500 *ErrorBody +} + +// Status returns HTTPResponse.Status +func (r GetConfigResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r GetConfigResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type PutConfigResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *PutCompatibility + ApplicationvndSchemaregistryJSON200 *PutCompatibility + ApplicationvndSchemaregistryV1JSON200 *PutCompatibility + JSON500 *ErrorBody + ApplicationvndSchemaregistryJSON500 *ErrorBody + ApplicationvndSchemaregistryV1JSON500 *ErrorBody +} + +// Status returns HTTPResponse.Status +func (r PutConfigResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r PutConfigResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type DeleteConfigSubjectResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *GetCompatibility + ApplicationvndSchemaregistryJSON200 *GetCompatibility + ApplicationvndSchemaregistryV1JSON200 *GetCompatibility + JSON404 *ErrorBody + ApplicationvndSchemaregistryJSON404 *ErrorBody + ApplicationvndSchemaregistryV1JSON404 *ErrorBody + JSON500 *ErrorBody + ApplicationvndSchemaregistryJSON500 *ErrorBody + ApplicationvndSchemaregistryV1JSON500 *ErrorBody +} + +// Status returns HTTPResponse.Status +func (r DeleteConfigSubjectResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r DeleteConfigSubjectResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type GetConfigSubjectResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *GetCompatibility + ApplicationvndSchemaregistryJSON200 *GetCompatibility + ApplicationvndSchemaregistryV1JSON200 *GetCompatibility + JSON500 *ErrorBody + ApplicationvndSchemaregistryJSON500 *ErrorBody + ApplicationvndSchemaregistryV1JSON500 *ErrorBody +} + +// Status returns HTTPResponse.Status +func (r GetConfigSubjectResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r GetConfigSubjectResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type PutConfigSubjectResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *PutCompatibility + ApplicationvndSchemaregistryJSON200 *PutCompatibility + ApplicationvndSchemaregistryV1JSON200 *PutCompatibility + JSON500 *ErrorBody + ApplicationvndSchemaregistryJSON500 *ErrorBody + ApplicationvndSchemaregistryV1JSON500 *ErrorBody +} + +// Status returns HTTPResponse.Status +func (r PutConfigSubjectResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r PutConfigSubjectResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type GetModeResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *Mode + ApplicationvndSchemaregistryJSON200 *Mode + ApplicationvndSchemaregistryV1JSON200 *Mode + JSON500 *ErrorBody + ApplicationvndSchemaregistryJSON500 *ErrorBody + ApplicationvndSchemaregistryV1JSON500 *ErrorBody +} + +// Status returns HTTPResponse.Status +func (r GetModeResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r GetModeResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type PutModeResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *Mode + ApplicationvndSchemaregistryJSON200 *Mode + ApplicationvndSchemaregistryV1JSON200 *Mode + JSON422 *ErrorBody + ApplicationvndSchemaregistryJSON422 *ErrorBody + ApplicationvndSchemaregistryV1JSON422 *ErrorBody + JSON500 *ErrorBody + ApplicationvndSchemaregistryJSON500 *ErrorBody + ApplicationvndSchemaregistryV1JSON500 *ErrorBody +} + +// Status returns HTTPResponse.Status +func (r PutModeResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r PutModeResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type DeleteModeSubjectResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *Mode + ApplicationvndSchemaregistryJSON200 *Mode + ApplicationvndSchemaregistryV1JSON200 *Mode + JSON404 *ErrorBody + ApplicationvndSchemaregistryJSON404 *ErrorBody + ApplicationvndSchemaregistryV1JSON404 *ErrorBody + JSON500 *ErrorBody + ApplicationvndSchemaregistryJSON500 *ErrorBody + ApplicationvndSchemaregistryV1JSON500 *ErrorBody +} + +// Status returns HTTPResponse.Status +func (r DeleteModeSubjectResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r DeleteModeSubjectResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type GetModeSubjectResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *Mode + ApplicationvndSchemaregistryJSON200 *Mode + ApplicationvndSchemaregistryV1JSON200 *Mode + JSON404 *ErrorBody + ApplicationvndSchemaregistryJSON404 *ErrorBody + ApplicationvndSchemaregistryV1JSON404 *ErrorBody + JSON500 *ErrorBody + ApplicationvndSchemaregistryJSON500 *ErrorBody + ApplicationvndSchemaregistryV1JSON500 *ErrorBody +} + +// Status returns HTTPResponse.Status +func (r GetModeSubjectResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r GetModeSubjectResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type PutModeSubjectResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *Mode + ApplicationvndSchemaregistryJSON200 *Mode + ApplicationvndSchemaregistryV1JSON200 *Mode + JSON404 *ErrorBody + ApplicationvndSchemaregistryJSON404 *ErrorBody + ApplicationvndSchemaregistryV1JSON404 *ErrorBody + JSON422 *ErrorBody + ApplicationvndSchemaregistryJSON422 *ErrorBody + ApplicationvndSchemaregistryV1JSON422 *ErrorBody + JSON500 *ErrorBody + ApplicationvndSchemaregistryJSON500 *ErrorBody + ApplicationvndSchemaregistryV1JSON500 *ErrorBody +} + +// Status returns HTTPResponse.Status +func (r PutModeSubjectResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r PutModeSubjectResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type GetSchemasIdsIdResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *SchemaDef + ApplicationvndSchemaregistryJSON200 *SchemaDef + ApplicationvndSchemaregistryV1JSON200 *SchemaDef + JSON404 *ErrorBody + ApplicationvndSchemaregistryJSON404 *ErrorBody + ApplicationvndSchemaregistryV1JSON404 *ErrorBody + JSON500 *ErrorBody + ApplicationvndSchemaregistryJSON500 *ErrorBody + ApplicationvndSchemaregistryV1JSON500 *ErrorBody + JSON501 *ErrorBody + ApplicationvndSchemaregistryJSON501 *ErrorBody + ApplicationvndSchemaregistryV1JSON501 *ErrorBody +} + +// Status returns HTTPResponse.Status +func (r GetSchemasIdsIdResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r GetSchemasIdsIdResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type GetSchemasIdsIdSubjectsResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *[]string + ApplicationvndSchemaregistryJSON200 *[]string + ApplicationvndSchemaregistryV1JSON200 *[]string + JSON404 *ErrorBody + ApplicationvndSchemaregistryJSON404 *ErrorBody + ApplicationvndSchemaregistryV1JSON404 *ErrorBody + JSON500 *ErrorBody + ApplicationvndSchemaregistryJSON500 *ErrorBody + ApplicationvndSchemaregistryV1JSON500 *ErrorBody +} + +// Status returns HTTPResponse.Status +func (r GetSchemasIdsIdSubjectsResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r GetSchemasIdsIdSubjectsResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type GetSchemasIdsIdVersionsResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *[]struct { + Subject *string `json:"subject,omitempty"` + Version *int `json:"version,omitempty"` + } + ApplicationvndSchemaregistryJSON200 *[]struct { + Subject *string `json:"subject,omitempty"` + Version *int `json:"version,omitempty"` + } + ApplicationvndSchemaregistryV1JSON200 *[]struct { + Subject *string `json:"subject,omitempty"` + Version *int `json:"version,omitempty"` + } + JSON404 *ErrorBody + ApplicationvndSchemaregistryJSON404 *ErrorBody + ApplicationvndSchemaregistryV1JSON404 *ErrorBody + JSON500 *ErrorBody + ApplicationvndSchemaregistryJSON500 *ErrorBody + ApplicationvndSchemaregistryV1JSON500 *ErrorBody +} + +// Status returns HTTPResponse.Status +func (r GetSchemasIdsIdVersionsResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r GetSchemasIdsIdVersionsResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type GetSchemasTypesResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *[]string + ApplicationvndSchemaregistryJSON200 *[]string + ApplicationvndSchemaregistryV1JSON200 *[]string + JSON500 *ErrorBody + ApplicationvndSchemaregistryJSON500 *ErrorBody + ApplicationvndSchemaregistryV1JSON500 *ErrorBody +} + +// Status returns HTTPResponse.Status +func (r GetSchemasTypesResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r GetSchemasTypesResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type DeleteSecurityAclsResponse struct { + Body []byte + HTTPResponse *http.Response +} + +// Status returns HTTPResponse.Status +func (r DeleteSecurityAclsResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r DeleteSecurityAclsResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type GetSecurityAclsResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *[]SecurityAcl + JSON401 *ErrorBody + JSON403 *ErrorBody + JSON500 *ErrorBody +} + +// Status returns HTTPResponse.Status +func (r GetSecurityAclsResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r GetSecurityAclsResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type PostSecurityAclsResponse struct { + Body []byte + HTTPResponse *http.Response + JSON400 *ErrorBody + JSON401 *ErrorBody + JSON403 *ErrorBody + JSON500 *ErrorBody +} + +// Status returns HTTPResponse.Status +func (r PostSecurityAclsResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r PostSecurityAclsResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type SchemaRegistryStatusReadyResponse struct { + Body []byte + HTTPResponse *http.Response +} + +// Status returns HTTPResponse.Status +func (r SchemaRegistryStatusReadyResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r SchemaRegistryStatusReadyResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type GetSubjectsResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *[]string + ApplicationvndSchemaregistryJSON200 *[]string + ApplicationvndSchemaregistryV1JSON200 *[]string + JSON500 *ErrorBody + ApplicationvndSchemaregistryJSON500 *ErrorBody + ApplicationvndSchemaregistryV1JSON500 *ErrorBody +} + +// Status returns HTTPResponse.Status +func (r GetSubjectsResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r GetSubjectsResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type DeleteSubjectResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *[]int + ApplicationvndSchemaregistryJSON200 *[]int + ApplicationvndSchemaregistryV1JSON200 *[]int + JSON404 *ErrorBody + ApplicationvndSchemaregistryJSON404 *ErrorBody + ApplicationvndSchemaregistryV1JSON404 *ErrorBody + JSON500 *ErrorBody + ApplicationvndSchemaregistryJSON500 *ErrorBody + ApplicationvndSchemaregistryV1JSON500 *ErrorBody +} + +// Status returns HTTPResponse.Status +func (r DeleteSubjectResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r DeleteSubjectResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type PostSubjectResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *StoredSchema + ApplicationvndSchemaregistryJSON200 *StoredSchema + ApplicationvndSchemaregistryV1JSON200 *StoredSchema + JSON404 *ErrorBody + ApplicationvndSchemaregistryJSON404 *ErrorBody + ApplicationvndSchemaregistryV1JSON404 *ErrorBody + JSON409 *ErrorBody + ApplicationvndSchemaregistryJSON409 *ErrorBody + ApplicationvndSchemaregistryV1JSON409 *ErrorBody + JSON422 *ErrorBody + ApplicationvndSchemaregistryJSON422 *ErrorBody + ApplicationvndSchemaregistryV1JSON422 *ErrorBody + JSON500 *ErrorBody + ApplicationvndSchemaregistryJSON500 *ErrorBody + ApplicationvndSchemaregistryV1JSON500 *ErrorBody + JSON501 *ErrorBody + ApplicationvndSchemaregistryJSON501 *ErrorBody + ApplicationvndSchemaregistryV1JSON501 *ErrorBody +} + +// Status returns HTTPResponse.Status +func (r PostSubjectResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r PostSubjectResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type GetSubjectVersionsResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *[]int + ApplicationvndSchemaregistryJSON200 *[]int + ApplicationvndSchemaregistryV1JSON200 *[]int + JSON404 *ErrorBody + ApplicationvndSchemaregistryJSON404 *ErrorBody + ApplicationvndSchemaregistryV1JSON404 *ErrorBody + JSON500 *ErrorBody + ApplicationvndSchemaregistryJSON500 *ErrorBody + ApplicationvndSchemaregistryV1JSON500 *ErrorBody +} + +// Status returns HTTPResponse.Status +func (r GetSubjectVersionsResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r GetSubjectVersionsResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type PostSubjectVersionsResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *struct { + Id *int `json:"id,omitempty"` + } + ApplicationvndSchemaregistryJSON200 *struct { + Id *int `json:"id,omitempty"` + } + ApplicationvndSchemaregistryV1JSON200 *struct { + Id *int `json:"id,omitempty"` + } + JSON409 *ErrorBody + ApplicationvndSchemaregistryJSON409 *ErrorBody + ApplicationvndSchemaregistryV1JSON409 *ErrorBody + JSON422 *ErrorBody + ApplicationvndSchemaregistryJSON422 *ErrorBody + ApplicationvndSchemaregistryV1JSON422 *ErrorBody + JSON500 *ErrorBody + ApplicationvndSchemaregistryJSON500 *ErrorBody + ApplicationvndSchemaregistryV1JSON500 *ErrorBody +} + +// Status returns HTTPResponse.Status +func (r PostSubjectVersionsResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r PostSubjectVersionsResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type DeleteSubjectVersionResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *int + ApplicationvndSchemaregistryJSON200 *int + ApplicationvndSchemaregistryV1JSON200 *int + JSON404 *ErrorBody + ApplicationvndSchemaregistryJSON404 *ErrorBody + ApplicationvndSchemaregistryV1JSON404 *ErrorBody + JSON422 *ErrorBody + ApplicationvndSchemaregistryJSON422 *ErrorBody + ApplicationvndSchemaregistryV1JSON422 *ErrorBody + JSON500 *ErrorBody + ApplicationvndSchemaregistryJSON500 *ErrorBody + ApplicationvndSchemaregistryV1JSON500 *ErrorBody +} + +// Status returns HTTPResponse.Status +func (r DeleteSubjectVersionResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r DeleteSubjectVersionResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type GetSubjectVersionsVersionResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *StoredSchema + ApplicationvndSchemaregistryJSON200 *StoredSchema + ApplicationvndSchemaregistryV1JSON200 *StoredSchema + JSON404 *ErrorBody + ApplicationvndSchemaregistryJSON404 *ErrorBody + ApplicationvndSchemaregistryV1JSON404 *ErrorBody + JSON422 *ErrorBody + ApplicationvndSchemaregistryJSON422 *ErrorBody + ApplicationvndSchemaregistryV1JSON422 *ErrorBody + JSON500 *ErrorBody + ApplicationvndSchemaregistryJSON500 *ErrorBody + ApplicationvndSchemaregistryV1JSON500 *ErrorBody + JSON501 *ErrorBody + ApplicationvndSchemaregistryJSON501 *ErrorBody + ApplicationvndSchemaregistryV1JSON501 *ErrorBody +} + +// Status returns HTTPResponse.Status +func (r GetSubjectVersionsVersionResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r GetSubjectVersionsVersionResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type GetSubjectVersionsVersionReferencedByDeprecatedResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *[]int + ApplicationvndSchemaregistryJSON200 *[]int + ApplicationvndSchemaregistryV1JSON200 *[]int + JSON404 *ErrorBody + ApplicationvndSchemaregistryJSON404 *ErrorBody + ApplicationvndSchemaregistryV1JSON404 *ErrorBody + JSON422 *ErrorBody + ApplicationvndSchemaregistryJSON422 *ErrorBody + ApplicationvndSchemaregistryV1JSON422 *ErrorBody + JSON500 *ErrorBody + ApplicationvndSchemaregistryJSON500 *ErrorBody + ApplicationvndSchemaregistryV1JSON500 *ErrorBody +} + +// Status returns HTTPResponse.Status +func (r GetSubjectVersionsVersionReferencedByDeprecatedResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r GetSubjectVersionsVersionReferencedByDeprecatedResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type GetSubjectVersionsVersionReferencedByResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *[]int + ApplicationvndSchemaregistryJSON200 *[]int + ApplicationvndSchemaregistryV1JSON200 *[]int + JSON404 *ErrorBody + ApplicationvndSchemaregistryJSON404 *ErrorBody + ApplicationvndSchemaregistryV1JSON404 *ErrorBody + JSON422 *ErrorBody + ApplicationvndSchemaregistryJSON422 *ErrorBody + ApplicationvndSchemaregistryV1JSON422 *ErrorBody + JSON500 *ErrorBody + ApplicationvndSchemaregistryJSON500 *ErrorBody + ApplicationvndSchemaregistryV1JSON500 *ErrorBody +} + +// Status returns HTTPResponse.Status +func (r GetSubjectVersionsVersionReferencedByResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r GetSubjectVersionsVersionReferencedByResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type GetSubjectVersionsVersionSchemaResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *string + ApplicationvndSchemaregistryJSON200 *string + ApplicationvndSchemaregistryV1JSON200 *string + JSON404 *ErrorBody + ApplicationvndSchemaregistryJSON404 *ErrorBody + ApplicationvndSchemaregistryV1JSON404 *ErrorBody + JSON422 *ErrorBody + ApplicationvndSchemaregistryJSON422 *ErrorBody + ApplicationvndSchemaregistryV1JSON422 *ErrorBody + JSON500 *ErrorBody + ApplicationvndSchemaregistryJSON500 *ErrorBody + ApplicationvndSchemaregistryV1JSON500 *ErrorBody + JSON501 *ErrorBody + ApplicationvndSchemaregistryJSON501 *ErrorBody + ApplicationvndSchemaregistryV1JSON501 *ErrorBody +} + +// Status returns HTTPResponse.Status +func (r GetSubjectVersionsVersionSchemaResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r GetSubjectVersionsVersionSchemaResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// CompatibilitySubjectVersionWithBodyWithResponse request with arbitrary body returning *CompatibilitySubjectVersionResponse +func (c *ClientWithResponses) CompatibilitySubjectVersionWithBodyWithResponse(ctx context.Context, subject string, version string, params *CompatibilitySubjectVersionParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CompatibilitySubjectVersionResponse, error) { + rsp, err := c.CompatibilitySubjectVersionWithBody(ctx, subject, version, params, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseCompatibilitySubjectVersionResponse(rsp) +} + +func (c *ClientWithResponses) CompatibilitySubjectVersionWithResponse(ctx context.Context, subject string, version string, params *CompatibilitySubjectVersionParams, body CompatibilitySubjectVersionJSONRequestBody, reqEditors ...RequestEditorFn) (*CompatibilitySubjectVersionResponse, error) { + rsp, err := c.CompatibilitySubjectVersion(ctx, subject, version, params, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseCompatibilitySubjectVersionResponse(rsp) +} + +func (c *ClientWithResponses) CompatibilitySubjectVersionWithApplicationVndSchemaregistryPlusJSONBodyWithResponse(ctx context.Context, subject string, version string, params *CompatibilitySubjectVersionParams, body CompatibilitySubjectVersionApplicationVndSchemaregistryPlusJSONRequestBody, reqEditors ...RequestEditorFn) (*CompatibilitySubjectVersionResponse, error) { + rsp, err := c.CompatibilitySubjectVersionWithApplicationVndSchemaregistryPlusJSONBody(ctx, subject, version, params, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseCompatibilitySubjectVersionResponse(rsp) +} + +func (c *ClientWithResponses) CompatibilitySubjectVersionWithApplicationVndSchemaregistryV1PlusJSONBodyWithResponse(ctx context.Context, subject string, version string, params *CompatibilitySubjectVersionParams, body CompatibilitySubjectVersionApplicationVndSchemaregistryV1PlusJSONRequestBody, reqEditors ...RequestEditorFn) (*CompatibilitySubjectVersionResponse, error) { + rsp, err := c.CompatibilitySubjectVersionWithApplicationVndSchemaregistryV1PlusJSONBody(ctx, subject, version, params, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseCompatibilitySubjectVersionResponse(rsp) +} + +// GetConfigWithResponse request returning *GetConfigResponse +func (c *ClientWithResponses) GetConfigWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetConfigResponse, error) { + rsp, err := c.GetConfig(ctx, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetConfigResponse(rsp) +} + +// PutConfigWithBodyWithResponse request with arbitrary body returning *PutConfigResponse +func (c *ClientWithResponses) PutConfigWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PutConfigResponse, error) { + rsp, err := c.PutConfigWithBody(ctx, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePutConfigResponse(rsp) +} + +func (c *ClientWithResponses) PutConfigWithResponse(ctx context.Context, body PutConfigJSONRequestBody, reqEditors ...RequestEditorFn) (*PutConfigResponse, error) { + rsp, err := c.PutConfig(ctx, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePutConfigResponse(rsp) +} + +func (c *ClientWithResponses) PutConfigWithApplicationVndSchemaregistryPlusJSONBodyWithResponse(ctx context.Context, body PutConfigApplicationVndSchemaregistryPlusJSONRequestBody, reqEditors ...RequestEditorFn) (*PutConfigResponse, error) { + rsp, err := c.PutConfigWithApplicationVndSchemaregistryPlusJSONBody(ctx, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePutConfigResponse(rsp) +} + +func (c *ClientWithResponses) PutConfigWithApplicationVndSchemaregistryV1PlusJSONBodyWithResponse(ctx context.Context, body PutConfigApplicationVndSchemaregistryV1PlusJSONRequestBody, reqEditors ...RequestEditorFn) (*PutConfigResponse, error) { + rsp, err := c.PutConfigWithApplicationVndSchemaregistryV1PlusJSONBody(ctx, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePutConfigResponse(rsp) +} + +// DeleteConfigSubjectWithResponse request returning *DeleteConfigSubjectResponse +func (c *ClientWithResponses) DeleteConfigSubjectWithResponse(ctx context.Context, subject string, reqEditors ...RequestEditorFn) (*DeleteConfigSubjectResponse, error) { + rsp, err := c.DeleteConfigSubject(ctx, subject, reqEditors...) + if err != nil { + return nil, err + } + return ParseDeleteConfigSubjectResponse(rsp) +} + +// GetConfigSubjectWithResponse request returning *GetConfigSubjectResponse +func (c *ClientWithResponses) GetConfigSubjectWithResponse(ctx context.Context, subject string, params *GetConfigSubjectParams, reqEditors ...RequestEditorFn) (*GetConfigSubjectResponse, error) { + rsp, err := c.GetConfigSubject(ctx, subject, params, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetConfigSubjectResponse(rsp) +} + +// PutConfigSubjectWithBodyWithResponse request with arbitrary body returning *PutConfigSubjectResponse +func (c *ClientWithResponses) PutConfigSubjectWithBodyWithResponse(ctx context.Context, subject string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PutConfigSubjectResponse, error) { + rsp, err := c.PutConfigSubjectWithBody(ctx, subject, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePutConfigSubjectResponse(rsp) +} + +func (c *ClientWithResponses) PutConfigSubjectWithResponse(ctx context.Context, subject string, body PutConfigSubjectJSONRequestBody, reqEditors ...RequestEditorFn) (*PutConfigSubjectResponse, error) { + rsp, err := c.PutConfigSubject(ctx, subject, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePutConfigSubjectResponse(rsp) +} + +func (c *ClientWithResponses) PutConfigSubjectWithApplicationVndSchemaregistryPlusJSONBodyWithResponse(ctx context.Context, subject string, body PutConfigSubjectApplicationVndSchemaregistryPlusJSONRequestBody, reqEditors ...RequestEditorFn) (*PutConfigSubjectResponse, error) { + rsp, err := c.PutConfigSubjectWithApplicationVndSchemaregistryPlusJSONBody(ctx, subject, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePutConfigSubjectResponse(rsp) +} + +func (c *ClientWithResponses) PutConfigSubjectWithApplicationVndSchemaregistryV1PlusJSONBodyWithResponse(ctx context.Context, subject string, body PutConfigSubjectApplicationVndSchemaregistryV1PlusJSONRequestBody, reqEditors ...RequestEditorFn) (*PutConfigSubjectResponse, error) { + rsp, err := c.PutConfigSubjectWithApplicationVndSchemaregistryV1PlusJSONBody(ctx, subject, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePutConfigSubjectResponse(rsp) +} + +// GetModeWithResponse request returning *GetModeResponse +func (c *ClientWithResponses) GetModeWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetModeResponse, error) { + rsp, err := c.GetMode(ctx, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetModeResponse(rsp) +} + +// PutModeWithBodyWithResponse request with arbitrary body returning *PutModeResponse +func (c *ClientWithResponses) PutModeWithBodyWithResponse(ctx context.Context, params *PutModeParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PutModeResponse, error) { + rsp, err := c.PutModeWithBody(ctx, params, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePutModeResponse(rsp) +} + +func (c *ClientWithResponses) PutModeWithResponse(ctx context.Context, params *PutModeParams, body PutModeJSONRequestBody, reqEditors ...RequestEditorFn) (*PutModeResponse, error) { + rsp, err := c.PutMode(ctx, params, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePutModeResponse(rsp) +} + +func (c *ClientWithResponses) PutModeWithApplicationVndSchemaregistryPlusJSONBodyWithResponse(ctx context.Context, params *PutModeParams, body PutModeApplicationVndSchemaregistryPlusJSONRequestBody, reqEditors ...RequestEditorFn) (*PutModeResponse, error) { + rsp, err := c.PutModeWithApplicationVndSchemaregistryPlusJSONBody(ctx, params, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePutModeResponse(rsp) +} + +func (c *ClientWithResponses) PutModeWithApplicationVndSchemaregistryV1PlusJSONBodyWithResponse(ctx context.Context, params *PutModeParams, body PutModeApplicationVndSchemaregistryV1PlusJSONRequestBody, reqEditors ...RequestEditorFn) (*PutModeResponse, error) { + rsp, err := c.PutModeWithApplicationVndSchemaregistryV1PlusJSONBody(ctx, params, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePutModeResponse(rsp) +} + +// DeleteModeSubjectWithResponse request returning *DeleteModeSubjectResponse +func (c *ClientWithResponses) DeleteModeSubjectWithResponse(ctx context.Context, subject string, reqEditors ...RequestEditorFn) (*DeleteModeSubjectResponse, error) { + rsp, err := c.DeleteModeSubject(ctx, subject, reqEditors...) + if err != nil { + return nil, err + } + return ParseDeleteModeSubjectResponse(rsp) +} + +// GetModeSubjectWithResponse request returning *GetModeSubjectResponse +func (c *ClientWithResponses) GetModeSubjectWithResponse(ctx context.Context, subject string, params *GetModeSubjectParams, reqEditors ...RequestEditorFn) (*GetModeSubjectResponse, error) { + rsp, err := c.GetModeSubject(ctx, subject, params, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetModeSubjectResponse(rsp) +} + +// PutModeSubjectWithBodyWithResponse request with arbitrary body returning *PutModeSubjectResponse +func (c *ClientWithResponses) PutModeSubjectWithBodyWithResponse(ctx context.Context, subject string, params *PutModeSubjectParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PutModeSubjectResponse, error) { + rsp, err := c.PutModeSubjectWithBody(ctx, subject, params, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePutModeSubjectResponse(rsp) +} + +func (c *ClientWithResponses) PutModeSubjectWithResponse(ctx context.Context, subject string, params *PutModeSubjectParams, body PutModeSubjectJSONRequestBody, reqEditors ...RequestEditorFn) (*PutModeSubjectResponse, error) { + rsp, err := c.PutModeSubject(ctx, subject, params, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePutModeSubjectResponse(rsp) +} + +func (c *ClientWithResponses) PutModeSubjectWithApplicationVndSchemaregistryPlusJSONBodyWithResponse(ctx context.Context, subject string, params *PutModeSubjectParams, body PutModeSubjectApplicationVndSchemaregistryPlusJSONRequestBody, reqEditors ...RequestEditorFn) (*PutModeSubjectResponse, error) { + rsp, err := c.PutModeSubjectWithApplicationVndSchemaregistryPlusJSONBody(ctx, subject, params, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePutModeSubjectResponse(rsp) +} + +func (c *ClientWithResponses) PutModeSubjectWithApplicationVndSchemaregistryV1PlusJSONBodyWithResponse(ctx context.Context, subject string, params *PutModeSubjectParams, body PutModeSubjectApplicationVndSchemaregistryV1PlusJSONRequestBody, reqEditors ...RequestEditorFn) (*PutModeSubjectResponse, error) { + rsp, err := c.PutModeSubjectWithApplicationVndSchemaregistryV1PlusJSONBody(ctx, subject, params, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePutModeSubjectResponse(rsp) +} + +// GetSchemasIdsIdWithResponse request returning *GetSchemasIdsIdResponse +func (c *ClientWithResponses) GetSchemasIdsIdWithResponse(ctx context.Context, id int, params *GetSchemasIdsIdParams, reqEditors ...RequestEditorFn) (*GetSchemasIdsIdResponse, error) { + rsp, err := c.GetSchemasIdsId(ctx, id, params, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetSchemasIdsIdResponse(rsp) +} + +// GetSchemasIdsIdSubjectsWithResponse request returning *GetSchemasIdsIdSubjectsResponse +func (c *ClientWithResponses) GetSchemasIdsIdSubjectsWithResponse(ctx context.Context, id int, params *GetSchemasIdsIdSubjectsParams, reqEditors ...RequestEditorFn) (*GetSchemasIdsIdSubjectsResponse, error) { + rsp, err := c.GetSchemasIdsIdSubjects(ctx, id, params, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetSchemasIdsIdSubjectsResponse(rsp) +} + +// GetSchemasIdsIdVersionsWithResponse request returning *GetSchemasIdsIdVersionsResponse +func (c *ClientWithResponses) GetSchemasIdsIdVersionsWithResponse(ctx context.Context, id int, reqEditors ...RequestEditorFn) (*GetSchemasIdsIdVersionsResponse, error) { + rsp, err := c.GetSchemasIdsIdVersions(ctx, id, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetSchemasIdsIdVersionsResponse(rsp) +} + +// GetSchemasTypesWithResponse request returning *GetSchemasTypesResponse +func (c *ClientWithResponses) GetSchemasTypesWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetSchemasTypesResponse, error) { + rsp, err := c.GetSchemasTypes(ctx, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetSchemasTypesResponse(rsp) +} + +// DeleteSecurityAclsWithBodyWithResponse request with arbitrary body returning *DeleteSecurityAclsResponse +func (c *ClientWithResponses) DeleteSecurityAclsWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*DeleteSecurityAclsResponse, error) { + rsp, err := c.DeleteSecurityAclsWithBody(ctx, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseDeleteSecurityAclsResponse(rsp) +} + +func (c *ClientWithResponses) DeleteSecurityAclsWithResponse(ctx context.Context, body DeleteSecurityAclsJSONRequestBody, reqEditors ...RequestEditorFn) (*DeleteSecurityAclsResponse, error) { + rsp, err := c.DeleteSecurityAcls(ctx, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseDeleteSecurityAclsResponse(rsp) +} + +// GetSecurityAclsWithResponse request returning *GetSecurityAclsResponse +func (c *ClientWithResponses) GetSecurityAclsWithResponse(ctx context.Context, params *GetSecurityAclsParams, reqEditors ...RequestEditorFn) (*GetSecurityAclsResponse, error) { + rsp, err := c.GetSecurityAcls(ctx, params, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetSecurityAclsResponse(rsp) +} + +// PostSecurityAclsWithBodyWithResponse request with arbitrary body returning *PostSecurityAclsResponse +func (c *ClientWithResponses) PostSecurityAclsWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostSecurityAclsResponse, error) { + rsp, err := c.PostSecurityAclsWithBody(ctx, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePostSecurityAclsResponse(rsp) +} + +func (c *ClientWithResponses) PostSecurityAclsWithResponse(ctx context.Context, body PostSecurityAclsJSONRequestBody, reqEditors ...RequestEditorFn) (*PostSecurityAclsResponse, error) { + rsp, err := c.PostSecurityAcls(ctx, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePostSecurityAclsResponse(rsp) +} + +// SchemaRegistryStatusReadyWithResponse request returning *SchemaRegistryStatusReadyResponse +func (c *ClientWithResponses) SchemaRegistryStatusReadyWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*SchemaRegistryStatusReadyResponse, error) { + rsp, err := c.SchemaRegistryStatusReady(ctx, reqEditors...) + if err != nil { + return nil, err + } + return ParseSchemaRegistryStatusReadyResponse(rsp) +} + +// GetSubjectsWithResponse request returning *GetSubjectsResponse +func (c *ClientWithResponses) GetSubjectsWithResponse(ctx context.Context, params *GetSubjectsParams, reqEditors ...RequestEditorFn) (*GetSubjectsResponse, error) { + rsp, err := c.GetSubjects(ctx, params, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetSubjectsResponse(rsp) +} + +// DeleteSubjectWithResponse request returning *DeleteSubjectResponse +func (c *ClientWithResponses) DeleteSubjectWithResponse(ctx context.Context, subject string, params *DeleteSubjectParams, reqEditors ...RequestEditorFn) (*DeleteSubjectResponse, error) { + rsp, err := c.DeleteSubject(ctx, subject, params, reqEditors...) + if err != nil { + return nil, err + } + return ParseDeleteSubjectResponse(rsp) +} + +// PostSubjectWithBodyWithResponse request with arbitrary body returning *PostSubjectResponse +func (c *ClientWithResponses) PostSubjectWithBodyWithResponse(ctx context.Context, subject string, params *PostSubjectParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostSubjectResponse, error) { + rsp, err := c.PostSubjectWithBody(ctx, subject, params, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePostSubjectResponse(rsp) +} + +func (c *ClientWithResponses) PostSubjectWithResponse(ctx context.Context, subject string, params *PostSubjectParams, body PostSubjectJSONRequestBody, reqEditors ...RequestEditorFn) (*PostSubjectResponse, error) { + rsp, err := c.PostSubject(ctx, subject, params, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePostSubjectResponse(rsp) +} + +func (c *ClientWithResponses) PostSubjectWithApplicationVndSchemaregistryPlusJSONBodyWithResponse(ctx context.Context, subject string, params *PostSubjectParams, body PostSubjectApplicationVndSchemaregistryPlusJSONRequestBody, reqEditors ...RequestEditorFn) (*PostSubjectResponse, error) { + rsp, err := c.PostSubjectWithApplicationVndSchemaregistryPlusJSONBody(ctx, subject, params, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePostSubjectResponse(rsp) +} + +func (c *ClientWithResponses) PostSubjectWithApplicationVndSchemaregistryV1PlusJSONBodyWithResponse(ctx context.Context, subject string, params *PostSubjectParams, body PostSubjectApplicationVndSchemaregistryV1PlusJSONRequestBody, reqEditors ...RequestEditorFn) (*PostSubjectResponse, error) { + rsp, err := c.PostSubjectWithApplicationVndSchemaregistryV1PlusJSONBody(ctx, subject, params, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePostSubjectResponse(rsp) +} + +// GetSubjectVersionsWithResponse request returning *GetSubjectVersionsResponse +func (c *ClientWithResponses) GetSubjectVersionsWithResponse(ctx context.Context, subject string, params *GetSubjectVersionsParams, reqEditors ...RequestEditorFn) (*GetSubjectVersionsResponse, error) { + rsp, err := c.GetSubjectVersions(ctx, subject, params, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetSubjectVersionsResponse(rsp) +} + +// PostSubjectVersionsWithBodyWithResponse request with arbitrary body returning *PostSubjectVersionsResponse +func (c *ClientWithResponses) PostSubjectVersionsWithBodyWithResponse(ctx context.Context, subject string, params *PostSubjectVersionsParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostSubjectVersionsResponse, error) { + rsp, err := c.PostSubjectVersionsWithBody(ctx, subject, params, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePostSubjectVersionsResponse(rsp) +} + +func (c *ClientWithResponses) PostSubjectVersionsWithResponse(ctx context.Context, subject string, params *PostSubjectVersionsParams, body PostSubjectVersionsJSONRequestBody, reqEditors ...RequestEditorFn) (*PostSubjectVersionsResponse, error) { + rsp, err := c.PostSubjectVersions(ctx, subject, params, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePostSubjectVersionsResponse(rsp) +} + +func (c *ClientWithResponses) PostSubjectVersionsWithApplicationVndSchemaregistryPlusJSONBodyWithResponse(ctx context.Context, subject string, params *PostSubjectVersionsParams, body PostSubjectVersionsApplicationVndSchemaregistryPlusJSONRequestBody, reqEditors ...RequestEditorFn) (*PostSubjectVersionsResponse, error) { + rsp, err := c.PostSubjectVersionsWithApplicationVndSchemaregistryPlusJSONBody(ctx, subject, params, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePostSubjectVersionsResponse(rsp) +} + +func (c *ClientWithResponses) PostSubjectVersionsWithApplicationVndSchemaregistryV1PlusJSONBodyWithResponse(ctx context.Context, subject string, params *PostSubjectVersionsParams, body PostSubjectVersionsApplicationVndSchemaregistryV1PlusJSONRequestBody, reqEditors ...RequestEditorFn) (*PostSubjectVersionsResponse, error) { + rsp, err := c.PostSubjectVersionsWithApplicationVndSchemaregistryV1PlusJSONBody(ctx, subject, params, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePostSubjectVersionsResponse(rsp) +} + +// DeleteSubjectVersionWithResponse request returning *DeleteSubjectVersionResponse +func (c *ClientWithResponses) DeleteSubjectVersionWithResponse(ctx context.Context, subject string, version string, params *DeleteSubjectVersionParams, reqEditors ...RequestEditorFn) (*DeleteSubjectVersionResponse, error) { + rsp, err := c.DeleteSubjectVersion(ctx, subject, version, params, reqEditors...) + if err != nil { + return nil, err + } + return ParseDeleteSubjectVersionResponse(rsp) +} + +// GetSubjectVersionsVersionWithResponse request returning *GetSubjectVersionsVersionResponse +func (c *ClientWithResponses) GetSubjectVersionsVersionWithResponse(ctx context.Context, subject string, version string, params *GetSubjectVersionsVersionParams, reqEditors ...RequestEditorFn) (*GetSubjectVersionsVersionResponse, error) { + rsp, err := c.GetSubjectVersionsVersion(ctx, subject, version, params, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetSubjectVersionsVersionResponse(rsp) +} + +// GetSubjectVersionsVersionReferencedByDeprecatedWithResponse request returning *GetSubjectVersionsVersionReferencedByDeprecatedResponse +func (c *ClientWithResponses) GetSubjectVersionsVersionReferencedByDeprecatedWithResponse(ctx context.Context, subject string, version string, reqEditors ...RequestEditorFn) (*GetSubjectVersionsVersionReferencedByDeprecatedResponse, error) { + rsp, err := c.GetSubjectVersionsVersionReferencedByDeprecated(ctx, subject, version, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetSubjectVersionsVersionReferencedByDeprecatedResponse(rsp) +} + +// GetSubjectVersionsVersionReferencedByWithResponse request returning *GetSubjectVersionsVersionReferencedByResponse +func (c *ClientWithResponses) GetSubjectVersionsVersionReferencedByWithResponse(ctx context.Context, subject string, version string, reqEditors ...RequestEditorFn) (*GetSubjectVersionsVersionReferencedByResponse, error) { + rsp, err := c.GetSubjectVersionsVersionReferencedBy(ctx, subject, version, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetSubjectVersionsVersionReferencedByResponse(rsp) +} + +// GetSubjectVersionsVersionSchemaWithResponse request returning *GetSubjectVersionsVersionSchemaResponse +func (c *ClientWithResponses) GetSubjectVersionsVersionSchemaWithResponse(ctx context.Context, subject string, version string, params *GetSubjectVersionsVersionSchemaParams, reqEditors ...RequestEditorFn) (*GetSubjectVersionsVersionSchemaResponse, error) { + rsp, err := c.GetSubjectVersionsVersionSchema(ctx, subject, version, params, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetSubjectVersionsVersionSchemaResponse(rsp) +} + +// ParseCompatibilitySubjectVersionResponse parses an HTTP response from a CompatibilitySubjectVersionWithResponse call +func ParseCompatibilitySubjectVersionResponse(rsp *http.Response) (*CompatibilitySubjectVersionResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &CompatibilitySubjectVersionResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case rsp.Header.Get("Content-Type") == "application/json" && rsp.StatusCode == 200: + var dest IsCompatibile + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case rsp.Header.Get("Content-Type") == "application/json" && rsp.StatusCode == 409: + var dest ErrorBody + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON409 = &dest + + case rsp.Header.Get("Content-Type") == "application/json" && rsp.StatusCode == 422: + var dest ErrorBody + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON422 = &dest + + case rsp.Header.Get("Content-Type") == "application/json" && rsp.StatusCode == 500: + var dest ErrorBody + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON500 = &dest + + case rsp.Header.Get("Content-Type") == "application/vnd.schemaregistry+json" && rsp.StatusCode == 200: + var dest IsCompatibile + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationvndSchemaregistryJSON200 = &dest + + case rsp.Header.Get("Content-Type") == "application/vnd.schemaregistry+json" && rsp.StatusCode == 409: + var dest ErrorBody + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationvndSchemaregistryJSON409 = &dest + + case rsp.Header.Get("Content-Type") == "application/vnd.schemaregistry+json" && rsp.StatusCode == 422: + var dest ErrorBody + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationvndSchemaregistryJSON422 = &dest + + case rsp.Header.Get("Content-Type") == "application/vnd.schemaregistry+json" && rsp.StatusCode == 500: + var dest ErrorBody + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationvndSchemaregistryJSON500 = &dest + + case rsp.Header.Get("Content-Type") == "application/vnd.schemaregistry.v1+json" && rsp.StatusCode == 200: + var dest IsCompatibile + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationvndSchemaregistryV1JSON200 = &dest + + case rsp.Header.Get("Content-Type") == "application/vnd.schemaregistry.v1+json" && rsp.StatusCode == 409: + var dest ErrorBody + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationvndSchemaregistryV1JSON409 = &dest + + case rsp.Header.Get("Content-Type") == "application/vnd.schemaregistry.v1+json" && rsp.StatusCode == 422: + var dest ErrorBody + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationvndSchemaregistryV1JSON422 = &dest + + case rsp.Header.Get("Content-Type") == "application/vnd.schemaregistry.v1+json" && rsp.StatusCode == 500: + var dest ErrorBody + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationvndSchemaregistryV1JSON500 = &dest + + } + + return response, nil +} + +// ParseGetConfigResponse parses an HTTP response from a GetConfigWithResponse call +func ParseGetConfigResponse(rsp *http.Response) (*GetConfigResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &GetConfigResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case rsp.Header.Get("Content-Type") == "application/json" && rsp.StatusCode == 200: + var dest GetCompatibility + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case rsp.Header.Get("Content-Type") == "application/json" && rsp.StatusCode == 500: + var dest ErrorBody + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON500 = &dest + + case rsp.Header.Get("Content-Type") == "application/vnd.schemaregistry+json" && rsp.StatusCode == 200: + var dest GetCompatibility + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationvndSchemaregistryJSON200 = &dest + + case rsp.Header.Get("Content-Type") == "application/vnd.schemaregistry+json" && rsp.StatusCode == 500: + var dest ErrorBody + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationvndSchemaregistryJSON500 = &dest + + case rsp.Header.Get("Content-Type") == "application/vnd.schemaregistry.v1+json" && rsp.StatusCode == 200: + var dest GetCompatibility + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationvndSchemaregistryV1JSON200 = &dest + + case rsp.Header.Get("Content-Type") == "application/vnd.schemaregistry.v1+json" && rsp.StatusCode == 500: + var dest ErrorBody + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationvndSchemaregistryV1JSON500 = &dest + + } + + return response, nil +} + +// ParsePutConfigResponse parses an HTTP response from a PutConfigWithResponse call +func ParsePutConfigResponse(rsp *http.Response) (*PutConfigResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &PutConfigResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case rsp.Header.Get("Content-Type") == "application/json" && rsp.StatusCode == 200: + var dest PutCompatibility + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case rsp.Header.Get("Content-Type") == "application/json" && rsp.StatusCode == 500: + var dest ErrorBody + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON500 = &dest + + case rsp.Header.Get("Content-Type") == "application/vnd.schemaregistry+json" && rsp.StatusCode == 200: + var dest PutCompatibility + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationvndSchemaregistryJSON200 = &dest + + case rsp.Header.Get("Content-Type") == "application/vnd.schemaregistry+json" && rsp.StatusCode == 500: + var dest ErrorBody + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationvndSchemaregistryJSON500 = &dest + + case rsp.Header.Get("Content-Type") == "application/vnd.schemaregistry.v1+json" && rsp.StatusCode == 200: + var dest PutCompatibility + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationvndSchemaregistryV1JSON200 = &dest + + case rsp.Header.Get("Content-Type") == "application/vnd.schemaregistry.v1+json" && rsp.StatusCode == 500: + var dest ErrorBody + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationvndSchemaregistryV1JSON500 = &dest + + } + + return response, nil +} + +// ParseDeleteConfigSubjectResponse parses an HTTP response from a DeleteConfigSubjectWithResponse call +func ParseDeleteConfigSubjectResponse(rsp *http.Response) (*DeleteConfigSubjectResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &DeleteConfigSubjectResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case rsp.Header.Get("Content-Type") == "application/json" && rsp.StatusCode == 200: + var dest GetCompatibility + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case rsp.Header.Get("Content-Type") == "application/json" && rsp.StatusCode == 404: + var dest ErrorBody + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest + + case rsp.Header.Get("Content-Type") == "application/json" && rsp.StatusCode == 500: + var dest ErrorBody + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON500 = &dest + + case rsp.Header.Get("Content-Type") == "application/vnd.schemaregistry+json" && rsp.StatusCode == 200: + var dest GetCompatibility + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationvndSchemaregistryJSON200 = &dest + + case rsp.Header.Get("Content-Type") == "application/vnd.schemaregistry+json" && rsp.StatusCode == 404: + var dest ErrorBody + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationvndSchemaregistryJSON404 = &dest + + case rsp.Header.Get("Content-Type") == "application/vnd.schemaregistry+json" && rsp.StatusCode == 500: + var dest ErrorBody + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationvndSchemaregistryJSON500 = &dest + + case rsp.Header.Get("Content-Type") == "application/vnd.schemaregistry.v1+json" && rsp.StatusCode == 200: + var dest GetCompatibility + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationvndSchemaregistryV1JSON200 = &dest + + case rsp.Header.Get("Content-Type") == "application/vnd.schemaregistry.v1+json" && rsp.StatusCode == 404: + var dest ErrorBody + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationvndSchemaregistryV1JSON404 = &dest + + case rsp.Header.Get("Content-Type") == "application/vnd.schemaregistry.v1+json" && rsp.StatusCode == 500: + var dest ErrorBody + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationvndSchemaregistryV1JSON500 = &dest + + } + + return response, nil +} + +// ParseGetConfigSubjectResponse parses an HTTP response from a GetConfigSubjectWithResponse call +func ParseGetConfigSubjectResponse(rsp *http.Response) (*GetConfigSubjectResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &GetConfigSubjectResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case rsp.Header.Get("Content-Type") == "application/json" && rsp.StatusCode == 200: + var dest GetCompatibility + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case rsp.Header.Get("Content-Type") == "application/json" && rsp.StatusCode == 500: + var dest ErrorBody + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON500 = &dest + + case rsp.Header.Get("Content-Type") == "application/vnd.schemaregistry+json" && rsp.StatusCode == 200: + var dest GetCompatibility + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationvndSchemaregistryJSON200 = &dest + + case rsp.Header.Get("Content-Type") == "application/vnd.schemaregistry+json" && rsp.StatusCode == 500: + var dest ErrorBody + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationvndSchemaregistryJSON500 = &dest + + case rsp.Header.Get("Content-Type") == "application/vnd.schemaregistry.v1+json" && rsp.StatusCode == 200: + var dest GetCompatibility + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationvndSchemaregistryV1JSON200 = &dest + + case rsp.Header.Get("Content-Type") == "application/vnd.schemaregistry.v1+json" && rsp.StatusCode == 500: + var dest ErrorBody + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationvndSchemaregistryV1JSON500 = &dest + + } + + return response, nil +} + +// ParsePutConfigSubjectResponse parses an HTTP response from a PutConfigSubjectWithResponse call +func ParsePutConfigSubjectResponse(rsp *http.Response) (*PutConfigSubjectResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &PutConfigSubjectResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case rsp.Header.Get("Content-Type") == "application/json" && rsp.StatusCode == 200: + var dest PutCompatibility + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case rsp.Header.Get("Content-Type") == "application/json" && rsp.StatusCode == 500: + var dest ErrorBody + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON500 = &dest + + case rsp.Header.Get("Content-Type") == "application/vnd.schemaregistry+json" && rsp.StatusCode == 200: + var dest PutCompatibility + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationvndSchemaregistryJSON200 = &dest + + case rsp.Header.Get("Content-Type") == "application/vnd.schemaregistry+json" && rsp.StatusCode == 500: + var dest ErrorBody + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationvndSchemaregistryJSON500 = &dest + + case rsp.Header.Get("Content-Type") == "application/vnd.schemaregistry.v1+json" && rsp.StatusCode == 200: + var dest PutCompatibility + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationvndSchemaregistryV1JSON200 = &dest + + case rsp.Header.Get("Content-Type") == "application/vnd.schemaregistry.v1+json" && rsp.StatusCode == 500: + var dest ErrorBody + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationvndSchemaregistryV1JSON500 = &dest + + } + + return response, nil +} + +// ParseGetModeResponse parses an HTTP response from a GetModeWithResponse call +func ParseGetModeResponse(rsp *http.Response) (*GetModeResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &GetModeResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case rsp.Header.Get("Content-Type") == "application/json" && rsp.StatusCode == 200: + var dest Mode + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case rsp.Header.Get("Content-Type") == "application/json" && rsp.StatusCode == 500: + var dest ErrorBody + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON500 = &dest + + case rsp.Header.Get("Content-Type") == "application/vnd.schemaregistry+json" && rsp.StatusCode == 200: + var dest Mode + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationvndSchemaregistryJSON200 = &dest + + case rsp.Header.Get("Content-Type") == "application/vnd.schemaregistry+json" && rsp.StatusCode == 500: + var dest ErrorBody + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationvndSchemaregistryJSON500 = &dest + + case rsp.Header.Get("Content-Type") == "application/vnd.schemaregistry.v1+json" && rsp.StatusCode == 200: + var dest Mode + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationvndSchemaregistryV1JSON200 = &dest + + case rsp.Header.Get("Content-Type") == "application/vnd.schemaregistry.v1+json" && rsp.StatusCode == 500: + var dest ErrorBody + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationvndSchemaregistryV1JSON500 = &dest + + } + + return response, nil +} + +// ParsePutModeResponse parses an HTTP response from a PutModeWithResponse call +func ParsePutModeResponse(rsp *http.Response) (*PutModeResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &PutModeResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case rsp.Header.Get("Content-Type") == "application/json" && rsp.StatusCode == 200: + var dest Mode + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case rsp.Header.Get("Content-Type") == "application/json" && rsp.StatusCode == 422: + var dest ErrorBody + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON422 = &dest + + case rsp.Header.Get("Content-Type") == "application/json" && rsp.StatusCode == 500: + var dest ErrorBody + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON500 = &dest + + case rsp.Header.Get("Content-Type") == "application/vnd.schemaregistry+json" && rsp.StatusCode == 200: + var dest Mode + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationvndSchemaregistryJSON200 = &dest + + case rsp.Header.Get("Content-Type") == "application/vnd.schemaregistry+json" && rsp.StatusCode == 422: + var dest ErrorBody + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationvndSchemaregistryJSON422 = &dest + + case rsp.Header.Get("Content-Type") == "application/vnd.schemaregistry+json" && rsp.StatusCode == 500: + var dest ErrorBody + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationvndSchemaregistryJSON500 = &dest + + case rsp.Header.Get("Content-Type") == "application/vnd.schemaregistry.v1+json" && rsp.StatusCode == 200: + var dest Mode + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationvndSchemaregistryV1JSON200 = &dest + + case rsp.Header.Get("Content-Type") == "application/vnd.schemaregistry.v1+json" && rsp.StatusCode == 422: + var dest ErrorBody + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationvndSchemaregistryV1JSON422 = &dest + + case rsp.Header.Get("Content-Type") == "application/vnd.schemaregistry.v1+json" && rsp.StatusCode == 500: + var dest ErrorBody + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationvndSchemaregistryV1JSON500 = &dest + + } + + return response, nil +} + +// ParseDeleteModeSubjectResponse parses an HTTP response from a DeleteModeSubjectWithResponse call +func ParseDeleteModeSubjectResponse(rsp *http.Response) (*DeleteModeSubjectResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &DeleteModeSubjectResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case rsp.Header.Get("Content-Type") == "application/json" && rsp.StatusCode == 200: + var dest Mode + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case rsp.Header.Get("Content-Type") == "application/json" && rsp.StatusCode == 404: + var dest ErrorBody + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest + + case rsp.Header.Get("Content-Type") == "application/json" && rsp.StatusCode == 500: + var dest ErrorBody + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON500 = &dest + + case rsp.Header.Get("Content-Type") == "application/vnd.schemaregistry+json" && rsp.StatusCode == 200: + var dest Mode + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationvndSchemaregistryJSON200 = &dest + + case rsp.Header.Get("Content-Type") == "application/vnd.schemaregistry+json" && rsp.StatusCode == 404: + var dest ErrorBody + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationvndSchemaregistryJSON404 = &dest + + case rsp.Header.Get("Content-Type") == "application/vnd.schemaregistry+json" && rsp.StatusCode == 500: + var dest ErrorBody + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationvndSchemaregistryJSON500 = &dest + + case rsp.Header.Get("Content-Type") == "application/vnd.schemaregistry.v1+json" && rsp.StatusCode == 200: + var dest Mode + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationvndSchemaregistryV1JSON200 = &dest + + case rsp.Header.Get("Content-Type") == "application/vnd.schemaregistry.v1+json" && rsp.StatusCode == 404: + var dest ErrorBody + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationvndSchemaregistryV1JSON404 = &dest + + case rsp.Header.Get("Content-Type") == "application/vnd.schemaregistry.v1+json" && rsp.StatusCode == 500: + var dest ErrorBody + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationvndSchemaregistryV1JSON500 = &dest + + } + + return response, nil +} + +// ParseGetModeSubjectResponse parses an HTTP response from a GetModeSubjectWithResponse call +func ParseGetModeSubjectResponse(rsp *http.Response) (*GetModeSubjectResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &GetModeSubjectResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case rsp.Header.Get("Content-Type") == "application/json" && rsp.StatusCode == 200: + var dest Mode + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case rsp.Header.Get("Content-Type") == "application/json" && rsp.StatusCode == 404: + var dest ErrorBody + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest + + case rsp.Header.Get("Content-Type") == "application/json" && rsp.StatusCode == 500: + var dest ErrorBody + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON500 = &dest + + case rsp.Header.Get("Content-Type") == "application/vnd.schemaregistry+json" && rsp.StatusCode == 200: + var dest Mode + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationvndSchemaregistryJSON200 = &dest + + case rsp.Header.Get("Content-Type") == "application/vnd.schemaregistry+json" && rsp.StatusCode == 404: + var dest ErrorBody + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationvndSchemaregistryJSON404 = &dest + + case rsp.Header.Get("Content-Type") == "application/vnd.schemaregistry+json" && rsp.StatusCode == 500: + var dest ErrorBody + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationvndSchemaregistryJSON500 = &dest + + case rsp.Header.Get("Content-Type") == "application/vnd.schemaregistry.v1+json" && rsp.StatusCode == 200: + var dest Mode + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationvndSchemaregistryV1JSON200 = &dest + + case rsp.Header.Get("Content-Type") == "application/vnd.schemaregistry.v1+json" && rsp.StatusCode == 404: + var dest ErrorBody + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationvndSchemaregistryV1JSON404 = &dest + + case rsp.Header.Get("Content-Type") == "application/vnd.schemaregistry.v1+json" && rsp.StatusCode == 500: + var dest ErrorBody + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationvndSchemaregistryV1JSON500 = &dest + + } + + return response, nil +} + +// ParsePutModeSubjectResponse parses an HTTP response from a PutModeSubjectWithResponse call +func ParsePutModeSubjectResponse(rsp *http.Response) (*PutModeSubjectResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &PutModeSubjectResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case rsp.Header.Get("Content-Type") == "application/json" && rsp.StatusCode == 200: + var dest Mode + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case rsp.Header.Get("Content-Type") == "application/json" && rsp.StatusCode == 404: + var dest ErrorBody + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest + + case rsp.Header.Get("Content-Type") == "application/json" && rsp.StatusCode == 422: + var dest ErrorBody + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON422 = &dest + + case rsp.Header.Get("Content-Type") == "application/json" && rsp.StatusCode == 500: + var dest ErrorBody + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON500 = &dest + + case rsp.Header.Get("Content-Type") == "application/vnd.schemaregistry+json" && rsp.StatusCode == 200: + var dest Mode + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationvndSchemaregistryJSON200 = &dest + + case rsp.Header.Get("Content-Type") == "application/vnd.schemaregistry+json" && rsp.StatusCode == 404: + var dest ErrorBody + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationvndSchemaregistryJSON404 = &dest + + case rsp.Header.Get("Content-Type") == "application/vnd.schemaregistry+json" && rsp.StatusCode == 422: + var dest ErrorBody + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationvndSchemaregistryJSON422 = &dest + + case rsp.Header.Get("Content-Type") == "application/vnd.schemaregistry+json" && rsp.StatusCode == 500: + var dest ErrorBody + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationvndSchemaregistryJSON500 = &dest + + case rsp.Header.Get("Content-Type") == "application/vnd.schemaregistry.v1+json" && rsp.StatusCode == 200: + var dest Mode + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationvndSchemaregistryV1JSON200 = &dest + + case rsp.Header.Get("Content-Type") == "application/vnd.schemaregistry.v1+json" && rsp.StatusCode == 404: + var dest ErrorBody + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationvndSchemaregistryV1JSON404 = &dest + + case rsp.Header.Get("Content-Type") == "application/vnd.schemaregistry.v1+json" && rsp.StatusCode == 422: + var dest ErrorBody + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationvndSchemaregistryV1JSON422 = &dest + + case rsp.Header.Get("Content-Type") == "application/vnd.schemaregistry.v1+json" && rsp.StatusCode == 500: + var dest ErrorBody + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationvndSchemaregistryV1JSON500 = &dest + + } + + return response, nil +} + +// ParseGetSchemasIdsIdResponse parses an HTTP response from a GetSchemasIdsIdWithResponse call +func ParseGetSchemasIdsIdResponse(rsp *http.Response) (*GetSchemasIdsIdResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &GetSchemasIdsIdResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case rsp.Header.Get("Content-Type") == "application/json" && rsp.StatusCode == 200: + var dest SchemaDef + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case rsp.Header.Get("Content-Type") == "application/json" && rsp.StatusCode == 404: + var dest ErrorBody + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest + + case rsp.Header.Get("Content-Type") == "application/json" && rsp.StatusCode == 500: + var dest ErrorBody + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON500 = &dest + + case rsp.Header.Get("Content-Type") == "application/json" && rsp.StatusCode == 501: + var dest ErrorBody + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON501 = &dest + + case rsp.Header.Get("Content-Type") == "application/vnd.schemaregistry+json" && rsp.StatusCode == 200: + var dest SchemaDef + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationvndSchemaregistryJSON200 = &dest + + case rsp.Header.Get("Content-Type") == "application/vnd.schemaregistry+json" && rsp.StatusCode == 404: + var dest ErrorBody + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationvndSchemaregistryJSON404 = &dest + + case rsp.Header.Get("Content-Type") == "application/vnd.schemaregistry+json" && rsp.StatusCode == 500: + var dest ErrorBody + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationvndSchemaregistryJSON500 = &dest + + case rsp.Header.Get("Content-Type") == "application/vnd.schemaregistry+json" && rsp.StatusCode == 501: + var dest ErrorBody + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationvndSchemaregistryJSON501 = &dest + + case rsp.Header.Get("Content-Type") == "application/vnd.schemaregistry.v1+json" && rsp.StatusCode == 200: + var dest SchemaDef + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationvndSchemaregistryV1JSON200 = &dest + + case rsp.Header.Get("Content-Type") == "application/vnd.schemaregistry.v1+json" && rsp.StatusCode == 404: + var dest ErrorBody + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationvndSchemaregistryV1JSON404 = &dest + + case rsp.Header.Get("Content-Type") == "application/vnd.schemaregistry.v1+json" && rsp.StatusCode == 500: + var dest ErrorBody + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationvndSchemaregistryV1JSON500 = &dest + + case rsp.Header.Get("Content-Type") == "application/vnd.schemaregistry.v1+json" && rsp.StatusCode == 501: + var dest ErrorBody + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationvndSchemaregistryV1JSON501 = &dest + + } + + return response, nil +} + +// ParseGetSchemasIdsIdSubjectsResponse parses an HTTP response from a GetSchemasIdsIdSubjectsWithResponse call +func ParseGetSchemasIdsIdSubjectsResponse(rsp *http.Response) (*GetSchemasIdsIdSubjectsResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &GetSchemasIdsIdSubjectsResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case rsp.Header.Get("Content-Type") == "application/json" && rsp.StatusCode == 200: + var dest []string + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case rsp.Header.Get("Content-Type") == "application/json" && rsp.StatusCode == 404: + var dest ErrorBody + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest + + case rsp.Header.Get("Content-Type") == "application/json" && rsp.StatusCode == 500: + var dest ErrorBody + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON500 = &dest + + case rsp.Header.Get("Content-Type") == "application/vnd.schemaregistry+json" && rsp.StatusCode == 200: + var dest []string + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationvndSchemaregistryJSON200 = &dest + + case rsp.Header.Get("Content-Type") == "application/vnd.schemaregistry+json" && rsp.StatusCode == 404: + var dest ErrorBody + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationvndSchemaregistryJSON404 = &dest + + case rsp.Header.Get("Content-Type") == "application/vnd.schemaregistry+json" && rsp.StatusCode == 500: + var dest ErrorBody + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationvndSchemaregistryJSON500 = &dest + + case rsp.Header.Get("Content-Type") == "application/vnd.schemaregistry.v1+json" && rsp.StatusCode == 200: + var dest []string + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationvndSchemaregistryV1JSON200 = &dest + + case rsp.Header.Get("Content-Type") == "application/vnd.schemaregistry.v1+json" && rsp.StatusCode == 404: + var dest ErrorBody + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationvndSchemaregistryV1JSON404 = &dest + + case rsp.Header.Get("Content-Type") == "application/vnd.schemaregistry.v1+json" && rsp.StatusCode == 500: + var dest ErrorBody + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationvndSchemaregistryV1JSON500 = &dest + + } + + return response, nil +} + +// ParseGetSchemasIdsIdVersionsResponse parses an HTTP response from a GetSchemasIdsIdVersionsWithResponse call +func ParseGetSchemasIdsIdVersionsResponse(rsp *http.Response) (*GetSchemasIdsIdVersionsResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &GetSchemasIdsIdVersionsResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case rsp.Header.Get("Content-Type") == "application/json" && rsp.StatusCode == 200: + var dest []struct { + Subject *string `json:"subject,omitempty"` + Version *int `json:"version,omitempty"` + } + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case rsp.Header.Get("Content-Type") == "application/json" && rsp.StatusCode == 404: + var dest ErrorBody + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest + + case rsp.Header.Get("Content-Type") == "application/json" && rsp.StatusCode == 500: + var dest ErrorBody + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON500 = &dest + + case rsp.Header.Get("Content-Type") == "application/vnd.schemaregistry+json" && rsp.StatusCode == 200: + var dest []struct { + Subject *string `json:"subject,omitempty"` + Version *int `json:"version,omitempty"` + } + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationvndSchemaregistryJSON200 = &dest + + case rsp.Header.Get("Content-Type") == "application/vnd.schemaregistry+json" && rsp.StatusCode == 404: + var dest ErrorBody + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationvndSchemaregistryJSON404 = &dest + + case rsp.Header.Get("Content-Type") == "application/vnd.schemaregistry+json" && rsp.StatusCode == 500: + var dest ErrorBody + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationvndSchemaregistryJSON500 = &dest + + case rsp.Header.Get("Content-Type") == "application/vnd.schemaregistry.v1+json" && rsp.StatusCode == 200: + var dest []struct { + Subject *string `json:"subject,omitempty"` + Version *int `json:"version,omitempty"` + } + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationvndSchemaregistryV1JSON200 = &dest + + case rsp.Header.Get("Content-Type") == "application/vnd.schemaregistry.v1+json" && rsp.StatusCode == 404: + var dest ErrorBody + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationvndSchemaregistryV1JSON404 = &dest + + case rsp.Header.Get("Content-Type") == "application/vnd.schemaregistry.v1+json" && rsp.StatusCode == 500: + var dest ErrorBody + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationvndSchemaregistryV1JSON500 = &dest + + } + + return response, nil +} + +// ParseGetSchemasTypesResponse parses an HTTP response from a GetSchemasTypesWithResponse call +func ParseGetSchemasTypesResponse(rsp *http.Response) (*GetSchemasTypesResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &GetSchemasTypesResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case rsp.Header.Get("Content-Type") == "application/json" && rsp.StatusCode == 200: + var dest []string + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case rsp.Header.Get("Content-Type") == "application/json" && rsp.StatusCode == 500: + var dest ErrorBody + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON500 = &dest + + case rsp.Header.Get("Content-Type") == "application/vnd.schemaregistry+json" && rsp.StatusCode == 200: + var dest []string + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationvndSchemaregistryJSON200 = &dest + + case rsp.Header.Get("Content-Type") == "application/vnd.schemaregistry+json" && rsp.StatusCode == 500: + var dest ErrorBody + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationvndSchemaregistryJSON500 = &dest + + case rsp.Header.Get("Content-Type") == "application/vnd.schemaregistry.v1+json" && rsp.StatusCode == 200: + var dest []string + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationvndSchemaregistryV1JSON200 = &dest + + case rsp.Header.Get("Content-Type") == "application/vnd.schemaregistry.v1+json" && rsp.StatusCode == 500: + var dest ErrorBody + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationvndSchemaregistryV1JSON500 = &dest + + } + + return response, nil +} + +// ParseDeleteSecurityAclsResponse parses an HTTP response from a DeleteSecurityAclsWithResponse call +func ParseDeleteSecurityAclsResponse(rsp *http.Response) (*DeleteSecurityAclsResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &DeleteSecurityAclsResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + return response, nil +} + +// ParseGetSecurityAclsResponse parses an HTTP response from a GetSecurityAclsWithResponse call +func ParseGetSecurityAclsResponse(rsp *http.Response) (*GetSecurityAclsResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &GetSecurityAclsResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest []SecurityAcl + 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 == 401: + var dest ErrorBody + 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 ErrorBody + 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 ErrorBody + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON500 = &dest + + } + + return response, nil +} + +// ParsePostSecurityAclsResponse parses an HTTP response from a PostSecurityAclsWithResponse call +func ParsePostSecurityAclsResponse(rsp *http.Response) (*PostSecurityAclsResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &PostSecurityAclsResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest ErrorBody + 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 ErrorBody + 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 ErrorBody + 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 ErrorBody + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON500 = &dest + + } + + return response, nil +} + +// ParseSchemaRegistryStatusReadyResponse parses an HTTP response from a SchemaRegistryStatusReadyWithResponse call +func ParseSchemaRegistryStatusReadyResponse(rsp *http.Response) (*SchemaRegistryStatusReadyResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &SchemaRegistryStatusReadyResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + return response, nil +} + +// ParseGetSubjectsResponse parses an HTTP response from a GetSubjectsWithResponse call +func ParseGetSubjectsResponse(rsp *http.Response) (*GetSubjectsResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &GetSubjectsResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case rsp.Header.Get("Content-Type") == "application/json" && rsp.StatusCode == 200: + var dest []string + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case rsp.Header.Get("Content-Type") == "application/json" && rsp.StatusCode == 500: + var dest ErrorBody + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON500 = &dest + + case rsp.Header.Get("Content-Type") == "application/vnd.schemaregistry+json" && rsp.StatusCode == 200: + var dest []string + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationvndSchemaregistryJSON200 = &dest + + case rsp.Header.Get("Content-Type") == "application/vnd.schemaregistry+json" && rsp.StatusCode == 500: + var dest ErrorBody + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationvndSchemaregistryJSON500 = &dest + + case rsp.Header.Get("Content-Type") == "application/vnd.schemaregistry.v1+json" && rsp.StatusCode == 200: + var dest []string + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationvndSchemaregistryV1JSON200 = &dest + + case rsp.Header.Get("Content-Type") == "application/vnd.schemaregistry.v1+json" && rsp.StatusCode == 500: + var dest ErrorBody + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationvndSchemaregistryV1JSON500 = &dest + + } + + return response, nil +} + +// ParseDeleteSubjectResponse parses an HTTP response from a DeleteSubjectWithResponse call +func ParseDeleteSubjectResponse(rsp *http.Response) (*DeleteSubjectResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &DeleteSubjectResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case rsp.Header.Get("Content-Type") == "application/json" && rsp.StatusCode == 200: + var dest []int + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case rsp.Header.Get("Content-Type") == "application/json" && rsp.StatusCode == 404: + var dest ErrorBody + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest + + case rsp.Header.Get("Content-Type") == "application/json" && rsp.StatusCode == 500: + var dest ErrorBody + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON500 = &dest + + case rsp.Header.Get("Content-Type") == "application/vnd.schemaregistry+json" && rsp.StatusCode == 200: + var dest []int + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationvndSchemaregistryJSON200 = &dest + + case rsp.Header.Get("Content-Type") == "application/vnd.schemaregistry+json" && rsp.StatusCode == 404: + var dest ErrorBody + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationvndSchemaregistryJSON404 = &dest + + case rsp.Header.Get("Content-Type") == "application/vnd.schemaregistry+json" && rsp.StatusCode == 500: + var dest ErrorBody + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationvndSchemaregistryJSON500 = &dest + + case rsp.Header.Get("Content-Type") == "application/vnd.schemaregistry.v1+json" && rsp.StatusCode == 200: + var dest []int + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationvndSchemaregistryV1JSON200 = &dest + + case rsp.Header.Get("Content-Type") == "application/vnd.schemaregistry.v1+json" && rsp.StatusCode == 404: + var dest ErrorBody + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationvndSchemaregistryV1JSON404 = &dest + + case rsp.Header.Get("Content-Type") == "application/vnd.schemaregistry.v1+json" && rsp.StatusCode == 500: + var dest ErrorBody + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationvndSchemaregistryV1JSON500 = &dest + + } + + return response, nil +} + +// ParsePostSubjectResponse parses an HTTP response from a PostSubjectWithResponse call +func ParsePostSubjectResponse(rsp *http.Response) (*PostSubjectResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &PostSubjectResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case rsp.Header.Get("Content-Type") == "application/json" && rsp.StatusCode == 200: + var dest StoredSchema + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case rsp.Header.Get("Content-Type") == "application/json" && rsp.StatusCode == 404: + var dest ErrorBody + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest + + case rsp.Header.Get("Content-Type") == "application/json" && rsp.StatusCode == 409: + var dest ErrorBody + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON409 = &dest + + case rsp.Header.Get("Content-Type") == "application/json" && rsp.StatusCode == 422: + var dest ErrorBody + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON422 = &dest + + case rsp.Header.Get("Content-Type") == "application/json" && rsp.StatusCode == 500: + var dest ErrorBody + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON500 = &dest + + case rsp.Header.Get("Content-Type") == "application/json" && rsp.StatusCode == 501: + var dest ErrorBody + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON501 = &dest + + case rsp.Header.Get("Content-Type") == "application/vnd.schemaregistry+json" && rsp.StatusCode == 200: + var dest StoredSchema + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationvndSchemaregistryJSON200 = &dest + + case rsp.Header.Get("Content-Type") == "application/vnd.schemaregistry+json" && rsp.StatusCode == 404: + var dest ErrorBody + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationvndSchemaregistryJSON404 = &dest + + case rsp.Header.Get("Content-Type") == "application/vnd.schemaregistry+json" && rsp.StatusCode == 409: + var dest ErrorBody + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationvndSchemaregistryJSON409 = &dest + + case rsp.Header.Get("Content-Type") == "application/vnd.schemaregistry+json" && rsp.StatusCode == 422: + var dest ErrorBody + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationvndSchemaregistryJSON422 = &dest + + case rsp.Header.Get("Content-Type") == "application/vnd.schemaregistry+json" && rsp.StatusCode == 500: + var dest ErrorBody + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationvndSchemaregistryJSON500 = &dest + + case rsp.Header.Get("Content-Type") == "application/vnd.schemaregistry+json" && rsp.StatusCode == 501: + var dest ErrorBody + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationvndSchemaregistryJSON501 = &dest + + case rsp.Header.Get("Content-Type") == "application/vnd.schemaregistry.v1+json" && rsp.StatusCode == 200: + var dest StoredSchema + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationvndSchemaregistryV1JSON200 = &dest + + case rsp.Header.Get("Content-Type") == "application/vnd.schemaregistry.v1+json" && rsp.StatusCode == 404: + var dest ErrorBody + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationvndSchemaregistryV1JSON404 = &dest + + case rsp.Header.Get("Content-Type") == "application/vnd.schemaregistry.v1+json" && rsp.StatusCode == 409: + var dest ErrorBody + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationvndSchemaregistryV1JSON409 = &dest + + case rsp.Header.Get("Content-Type") == "application/vnd.schemaregistry.v1+json" && rsp.StatusCode == 422: + var dest ErrorBody + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationvndSchemaregistryV1JSON422 = &dest + + case rsp.Header.Get("Content-Type") == "application/vnd.schemaregistry.v1+json" && rsp.StatusCode == 500: + var dest ErrorBody + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationvndSchemaregistryV1JSON500 = &dest + + case rsp.Header.Get("Content-Type") == "application/vnd.schemaregistry.v1+json" && rsp.StatusCode == 501: + var dest ErrorBody + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationvndSchemaregistryV1JSON501 = &dest + + } + + return response, nil +} + +// ParseGetSubjectVersionsResponse parses an HTTP response from a GetSubjectVersionsWithResponse call +func ParseGetSubjectVersionsResponse(rsp *http.Response) (*GetSubjectVersionsResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &GetSubjectVersionsResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case rsp.Header.Get("Content-Type") == "application/json" && rsp.StatusCode == 200: + var dest []int + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case rsp.Header.Get("Content-Type") == "application/json" && rsp.StatusCode == 404: + var dest ErrorBody + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest + + case rsp.Header.Get("Content-Type") == "application/json" && rsp.StatusCode == 500: + var dest ErrorBody + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON500 = &dest + + case rsp.Header.Get("Content-Type") == "application/vnd.schemaregistry+json" && rsp.StatusCode == 200: + var dest []int + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationvndSchemaregistryJSON200 = &dest + + case rsp.Header.Get("Content-Type") == "application/vnd.schemaregistry+json" && rsp.StatusCode == 404: + var dest ErrorBody + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationvndSchemaregistryJSON404 = &dest + + case rsp.Header.Get("Content-Type") == "application/vnd.schemaregistry+json" && rsp.StatusCode == 500: + var dest ErrorBody + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationvndSchemaregistryJSON500 = &dest + + case rsp.Header.Get("Content-Type") == "application/vnd.schemaregistry.v1+json" && rsp.StatusCode == 200: + var dest []int + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationvndSchemaregistryV1JSON200 = &dest + + case rsp.Header.Get("Content-Type") == "application/vnd.schemaregistry.v1+json" && rsp.StatusCode == 404: + var dest ErrorBody + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationvndSchemaregistryV1JSON404 = &dest + + case rsp.Header.Get("Content-Type") == "application/vnd.schemaregistry.v1+json" && rsp.StatusCode == 500: + var dest ErrorBody + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationvndSchemaregistryV1JSON500 = &dest + + } + + return response, nil +} + +// ParsePostSubjectVersionsResponse parses an HTTP response from a PostSubjectVersionsWithResponse call +func ParsePostSubjectVersionsResponse(rsp *http.Response) (*PostSubjectVersionsResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &PostSubjectVersionsResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case rsp.Header.Get("Content-Type") == "application/json" && rsp.StatusCode == 200: + var dest struct { + Id *int `json:"id,omitempty"` + } + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case rsp.Header.Get("Content-Type") == "application/json" && rsp.StatusCode == 409: + var dest ErrorBody + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON409 = &dest + + case rsp.Header.Get("Content-Type") == "application/json" && rsp.StatusCode == 422: + var dest ErrorBody + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON422 = &dest + + case rsp.Header.Get("Content-Type") == "application/json" && rsp.StatusCode == 500: + var dest ErrorBody + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON500 = &dest + + case rsp.Header.Get("Content-Type") == "application/vnd.schemaregistry+json" && rsp.StatusCode == 200: + var dest struct { + Id *int `json:"id,omitempty"` + } + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationvndSchemaregistryJSON200 = &dest + + case rsp.Header.Get("Content-Type") == "application/vnd.schemaregistry+json" && rsp.StatusCode == 409: + var dest ErrorBody + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationvndSchemaregistryJSON409 = &dest + + case rsp.Header.Get("Content-Type") == "application/vnd.schemaregistry+json" && rsp.StatusCode == 422: + var dest ErrorBody + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationvndSchemaregistryJSON422 = &dest + + case rsp.Header.Get("Content-Type") == "application/vnd.schemaregistry+json" && rsp.StatusCode == 500: + var dest ErrorBody + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationvndSchemaregistryJSON500 = &dest + + case rsp.Header.Get("Content-Type") == "application/vnd.schemaregistry.v1+json" && rsp.StatusCode == 200: + var dest struct { + Id *int `json:"id,omitempty"` + } + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationvndSchemaregistryV1JSON200 = &dest + + case rsp.Header.Get("Content-Type") == "application/vnd.schemaregistry.v1+json" && rsp.StatusCode == 409: + var dest ErrorBody + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationvndSchemaregistryV1JSON409 = &dest + + case rsp.Header.Get("Content-Type") == "application/vnd.schemaregistry.v1+json" && rsp.StatusCode == 422: + var dest ErrorBody + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationvndSchemaregistryV1JSON422 = &dest + + case rsp.Header.Get("Content-Type") == "application/vnd.schemaregistry.v1+json" && rsp.StatusCode == 500: + var dest ErrorBody + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationvndSchemaregistryV1JSON500 = &dest + + } + + return response, nil +} + +// ParseDeleteSubjectVersionResponse parses an HTTP response from a DeleteSubjectVersionWithResponse call +func ParseDeleteSubjectVersionResponse(rsp *http.Response) (*DeleteSubjectVersionResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &DeleteSubjectVersionResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case rsp.Header.Get("Content-Type") == "application/json" && rsp.StatusCode == 200: + var dest int + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case rsp.Header.Get("Content-Type") == "application/json" && rsp.StatusCode == 404: + var dest ErrorBody + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest + + case rsp.Header.Get("Content-Type") == "application/json" && rsp.StatusCode == 422: + var dest ErrorBody + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON422 = &dest + + case rsp.Header.Get("Content-Type") == "application/json" && rsp.StatusCode == 500: + var dest ErrorBody + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON500 = &dest + + case rsp.Header.Get("Content-Type") == "application/vnd.schemaregistry+json" && rsp.StatusCode == 200: + var dest int + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationvndSchemaregistryJSON200 = &dest + + case rsp.Header.Get("Content-Type") == "application/vnd.schemaregistry+json" && rsp.StatusCode == 404: + var dest ErrorBody + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationvndSchemaregistryJSON404 = &dest + + case rsp.Header.Get("Content-Type") == "application/vnd.schemaregistry+json" && rsp.StatusCode == 422: + var dest ErrorBody + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationvndSchemaregistryJSON422 = &dest + + case rsp.Header.Get("Content-Type") == "application/vnd.schemaregistry+json" && rsp.StatusCode == 500: + var dest ErrorBody + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationvndSchemaregistryJSON500 = &dest + + case rsp.Header.Get("Content-Type") == "application/vnd.schemaregistry.v1+json" && rsp.StatusCode == 200: + var dest int + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationvndSchemaregistryV1JSON200 = &dest + + case rsp.Header.Get("Content-Type") == "application/vnd.schemaregistry.v1+json" && rsp.StatusCode == 404: + var dest ErrorBody + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationvndSchemaregistryV1JSON404 = &dest + + case rsp.Header.Get("Content-Type") == "application/vnd.schemaregistry.v1+json" && rsp.StatusCode == 422: + var dest ErrorBody + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationvndSchemaregistryV1JSON422 = &dest + + case rsp.Header.Get("Content-Type") == "application/vnd.schemaregistry.v1+json" && rsp.StatusCode == 500: + var dest ErrorBody + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationvndSchemaregistryV1JSON500 = &dest + + } + + return response, nil +} + +// ParseGetSubjectVersionsVersionResponse parses an HTTP response from a GetSubjectVersionsVersionWithResponse call +func ParseGetSubjectVersionsVersionResponse(rsp *http.Response) (*GetSubjectVersionsVersionResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &GetSubjectVersionsVersionResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case rsp.Header.Get("Content-Type") == "application/json" && rsp.StatusCode == 200: + var dest StoredSchema + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case rsp.Header.Get("Content-Type") == "application/json" && rsp.StatusCode == 404: + var dest ErrorBody + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest + + case rsp.Header.Get("Content-Type") == "application/json" && rsp.StatusCode == 422: + var dest ErrorBody + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON422 = &dest + + case rsp.Header.Get("Content-Type") == "application/json" && rsp.StatusCode == 500: + var dest ErrorBody + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON500 = &dest + + case rsp.Header.Get("Content-Type") == "application/json" && rsp.StatusCode == 501: + var dest ErrorBody + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON501 = &dest + + case rsp.Header.Get("Content-Type") == "application/vnd.schemaregistry+json" && rsp.StatusCode == 200: + var dest StoredSchema + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationvndSchemaregistryJSON200 = &dest + + case rsp.Header.Get("Content-Type") == "application/vnd.schemaregistry+json" && rsp.StatusCode == 404: + var dest ErrorBody + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationvndSchemaregistryJSON404 = &dest + + case rsp.Header.Get("Content-Type") == "application/vnd.schemaregistry+json" && rsp.StatusCode == 422: + var dest ErrorBody + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationvndSchemaregistryJSON422 = &dest + + case rsp.Header.Get("Content-Type") == "application/vnd.schemaregistry+json" && rsp.StatusCode == 500: + var dest ErrorBody + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationvndSchemaregistryJSON500 = &dest + + case rsp.Header.Get("Content-Type") == "application/vnd.schemaregistry+json" && rsp.StatusCode == 501: + var dest ErrorBody + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationvndSchemaregistryJSON501 = &dest + + case rsp.Header.Get("Content-Type") == "application/vnd.schemaregistry.v1+json" && rsp.StatusCode == 200: + var dest StoredSchema + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationvndSchemaregistryV1JSON200 = &dest + + case rsp.Header.Get("Content-Type") == "application/vnd.schemaregistry.v1+json" && rsp.StatusCode == 404: + var dest ErrorBody + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationvndSchemaregistryV1JSON404 = &dest + + case rsp.Header.Get("Content-Type") == "application/vnd.schemaregistry.v1+json" && rsp.StatusCode == 422: + var dest ErrorBody + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationvndSchemaregistryV1JSON422 = &dest + + case rsp.Header.Get("Content-Type") == "application/vnd.schemaregistry.v1+json" && rsp.StatusCode == 500: + var dest ErrorBody + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationvndSchemaregistryV1JSON500 = &dest + + case rsp.Header.Get("Content-Type") == "application/vnd.schemaregistry.v1+json" && rsp.StatusCode == 501: + var dest ErrorBody + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationvndSchemaregistryV1JSON501 = &dest + + } + + return response, nil +} + +// ParseGetSubjectVersionsVersionReferencedByDeprecatedResponse parses an HTTP response from a GetSubjectVersionsVersionReferencedByDeprecatedWithResponse call +func ParseGetSubjectVersionsVersionReferencedByDeprecatedResponse(rsp *http.Response) (*GetSubjectVersionsVersionReferencedByDeprecatedResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &GetSubjectVersionsVersionReferencedByDeprecatedResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case rsp.Header.Get("Content-Type") == "application/json" && rsp.StatusCode == 200: + var dest []int + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case rsp.Header.Get("Content-Type") == "application/json" && rsp.StatusCode == 404: + var dest ErrorBody + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest + + case rsp.Header.Get("Content-Type") == "application/json" && rsp.StatusCode == 422: + var dest ErrorBody + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON422 = &dest + + case rsp.Header.Get("Content-Type") == "application/json" && rsp.StatusCode == 500: + var dest ErrorBody + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON500 = &dest + + case rsp.Header.Get("Content-Type") == "application/vnd.schemaregistry+json" && rsp.StatusCode == 200: + var dest []int + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationvndSchemaregistryJSON200 = &dest + + case rsp.Header.Get("Content-Type") == "application/vnd.schemaregistry+json" && rsp.StatusCode == 404: + var dest ErrorBody + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationvndSchemaregistryJSON404 = &dest + + case rsp.Header.Get("Content-Type") == "application/vnd.schemaregistry+json" && rsp.StatusCode == 422: + var dest ErrorBody + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationvndSchemaregistryJSON422 = &dest + + case rsp.Header.Get("Content-Type") == "application/vnd.schemaregistry+json" && rsp.StatusCode == 500: + var dest ErrorBody + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationvndSchemaregistryJSON500 = &dest + + case rsp.Header.Get("Content-Type") == "application/vnd.schemaregistry.v1+json" && rsp.StatusCode == 200: + var dest []int + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationvndSchemaregistryV1JSON200 = &dest + + case rsp.Header.Get("Content-Type") == "application/vnd.schemaregistry.v1+json" && rsp.StatusCode == 404: + var dest ErrorBody + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationvndSchemaregistryV1JSON404 = &dest + + case rsp.Header.Get("Content-Type") == "application/vnd.schemaregistry.v1+json" && rsp.StatusCode == 422: + var dest ErrorBody + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationvndSchemaregistryV1JSON422 = &dest + + case rsp.Header.Get("Content-Type") == "application/vnd.schemaregistry.v1+json" && rsp.StatusCode == 500: + var dest ErrorBody + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationvndSchemaregistryV1JSON500 = &dest + + } + + return response, nil +} + +// ParseGetSubjectVersionsVersionReferencedByResponse parses an HTTP response from a GetSubjectVersionsVersionReferencedByWithResponse call +func ParseGetSubjectVersionsVersionReferencedByResponse(rsp *http.Response) (*GetSubjectVersionsVersionReferencedByResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &GetSubjectVersionsVersionReferencedByResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case rsp.Header.Get("Content-Type") == "application/json" && rsp.StatusCode == 200: + var dest []int + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case rsp.Header.Get("Content-Type") == "application/json" && rsp.StatusCode == 404: + var dest ErrorBody + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest + + case rsp.Header.Get("Content-Type") == "application/json" && rsp.StatusCode == 422: + var dest ErrorBody + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON422 = &dest + + case rsp.Header.Get("Content-Type") == "application/json" && rsp.StatusCode == 500: + var dest ErrorBody + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON500 = &dest + + case rsp.Header.Get("Content-Type") == "application/vnd.schemaregistry+json" && rsp.StatusCode == 200: + var dest []int + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationvndSchemaregistryJSON200 = &dest + + case rsp.Header.Get("Content-Type") == "application/vnd.schemaregistry+json" && rsp.StatusCode == 404: + var dest ErrorBody + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationvndSchemaregistryJSON404 = &dest + + case rsp.Header.Get("Content-Type") == "application/vnd.schemaregistry+json" && rsp.StatusCode == 422: + var dest ErrorBody + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationvndSchemaregistryJSON422 = &dest + + case rsp.Header.Get("Content-Type") == "application/vnd.schemaregistry+json" && rsp.StatusCode == 500: + var dest ErrorBody + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationvndSchemaregistryJSON500 = &dest + + case rsp.Header.Get("Content-Type") == "application/vnd.schemaregistry.v1+json" && rsp.StatusCode == 200: + var dest []int + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationvndSchemaregistryV1JSON200 = &dest + + case rsp.Header.Get("Content-Type") == "application/vnd.schemaregistry.v1+json" && rsp.StatusCode == 404: + var dest ErrorBody + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationvndSchemaregistryV1JSON404 = &dest + + case rsp.Header.Get("Content-Type") == "application/vnd.schemaregistry.v1+json" && rsp.StatusCode == 422: + var dest ErrorBody + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationvndSchemaregistryV1JSON422 = &dest + + case rsp.Header.Get("Content-Type") == "application/vnd.schemaregistry.v1+json" && rsp.StatusCode == 500: + var dest ErrorBody + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationvndSchemaregistryV1JSON500 = &dest + + } + + return response, nil +} + +// ParseGetSubjectVersionsVersionSchemaResponse parses an HTTP response from a GetSubjectVersionsVersionSchemaWithResponse call +func ParseGetSubjectVersionsVersionSchemaResponse(rsp *http.Response) (*GetSubjectVersionsVersionSchemaResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &GetSubjectVersionsVersionSchemaResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case rsp.Header.Get("Content-Type") == "application/json" && rsp.StatusCode == 200: + var dest string + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case rsp.Header.Get("Content-Type") == "application/json" && rsp.StatusCode == 404: + var dest ErrorBody + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest + + case rsp.Header.Get("Content-Type") == "application/json" && rsp.StatusCode == 422: + var dest ErrorBody + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON422 = &dest + + case rsp.Header.Get("Content-Type") == "application/json" && rsp.StatusCode == 500: + var dest ErrorBody + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON500 = &dest + + case rsp.Header.Get("Content-Type") == "application/json" && rsp.StatusCode == 501: + var dest ErrorBody + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON501 = &dest + + case rsp.Header.Get("Content-Type") == "application/vnd.schemaregistry+json" && rsp.StatusCode == 200: + var dest string + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationvndSchemaregistryJSON200 = &dest + + case rsp.Header.Get("Content-Type") == "application/vnd.schemaregistry+json" && rsp.StatusCode == 404: + var dest ErrorBody + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationvndSchemaregistryJSON404 = &dest + + case rsp.Header.Get("Content-Type") == "application/vnd.schemaregistry+json" && rsp.StatusCode == 422: + var dest ErrorBody + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationvndSchemaregistryJSON422 = &dest + + case rsp.Header.Get("Content-Type") == "application/vnd.schemaregistry+json" && rsp.StatusCode == 500: + var dest ErrorBody + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationvndSchemaregistryJSON500 = &dest + + case rsp.Header.Get("Content-Type") == "application/vnd.schemaregistry+json" && rsp.StatusCode == 501: + var dest ErrorBody + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationvndSchemaregistryJSON501 = &dest + + case rsp.Header.Get("Content-Type") == "application/vnd.schemaregistry.v1+json" && rsp.StatusCode == 200: + var dest string + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationvndSchemaregistryV1JSON200 = &dest + + case rsp.Header.Get("Content-Type") == "application/vnd.schemaregistry.v1+json" && rsp.StatusCode == 404: + var dest ErrorBody + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationvndSchemaregistryV1JSON404 = &dest + + case rsp.Header.Get("Content-Type") == "application/vnd.schemaregistry.v1+json" && rsp.StatusCode == 422: + var dest ErrorBody + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationvndSchemaregistryV1JSON422 = &dest + + case rsp.Header.Get("Content-Type") == "application/vnd.schemaregistry.v1+json" && rsp.StatusCode == 500: + var dest ErrorBody + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationvndSchemaregistryV1JSON500 = &dest + + case rsp.Header.Get("Content-Type") == "application/vnd.schemaregistry.v1+json" && rsp.StatusCode == 501: + var dest ErrorBody + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.ApplicationvndSchemaregistryV1JSON501 = &dest + + } + + return response, nil +} diff --git a/gen/schema-registry/oapi-codegen.yaml b/gen/schema-registry/oapi-codegen.yaml new file mode 100644 index 0000000..dceebe1 --- /dev/null +++ b/gen/schema-registry/oapi-codegen.yaml @@ -0,0 +1,8 @@ +package: schemaregistryclient +output: ./client.go +generate: + models: true + client: true +output-options: + # to make sure that all types are generated + skip-prune: true \ No newline at end of file diff --git a/go.mod b/go.mod index 30c0812..d1949d0 100644 --- a/go.mod +++ b/go.mod @@ -1,29 +1,35 @@ module github.com/ChargePi/chargeflow -go 1.24 +go 1.24.0 require ( github.com/google/uuid v1.6.0 github.com/kaptinlin/jsonschema v0.4.1 + github.com/oapi-codegen/runtime v1.1.2 github.com/pkg/errors v0.9.1 github.com/spf13/cobra v1.9.1 github.com/spf13/viper v1.20.1 - github.com/stretchr/testify v1.10.0 + github.com/stretchr/testify v1.11.1 + github.com/testcontainers/testcontainers-go v0.40.0 + github.com/testcontainers/testcontainers-go/modules/redpanda v0.40.0 go.uber.org/zap v1.27.0 ) require ( 4d63.com/gocheckcompilerdirectives v1.3.0 // indirect 4d63.com/gochecknoglobals v0.2.2 // indirect + dario.cat/mergo v1.0.2 // indirect github.com/4meepo/tagalign v1.4.2 // indirect github.com/Abirdcfly/dupword v0.1.3 // indirect github.com/Antonboom/errname v1.1.0 // indirect github.com/Antonboom/nilnil v1.1.0 // indirect github.com/Antonboom/testifylint v1.6.1 // indirect + github.com/Azure/go-ansiterm v0.0.0-20250102033503-faa5f7b0171c // indirect github.com/BurntSushi/toml v1.5.0 // indirect github.com/Djarvur/go-err113 v0.0.0-20210108212216-aea10b59be24 // indirect github.com/GaijinEntertainment/go-exhaustruct/v3 v3.3.1 // indirect github.com/Masterminds/semver/v3 v3.3.1 // indirect + github.com/Microsoft/go-winio v0.6.2 // indirect github.com/OpenPeeDeeP/depguard/v2 v2.2.1 // indirect github.com/alecthomas/chroma/v2 v2.17.2 // indirect github.com/alecthomas/go-check-sumtype v0.3.1 // indirect @@ -31,6 +37,7 @@ require ( github.com/alexkohler/prealloc v1.0.0 // indirect github.com/alingse/asasalint v0.0.11 // indirect github.com/alingse/nilnesserr v0.2.0 // indirect + github.com/apapsch/go-jsonmerge/v2 v2.0.0 // indirect github.com/ashanbrown/forbidigo v1.6.0 // indirect github.com/ashanbrown/makezero v1.2.0 // indirect github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect @@ -45,6 +52,7 @@ require ( github.com/butuzov/mirror v1.3.0 // indirect github.com/catenacyber/perfsprint v0.9.1 // indirect github.com/ccojocar/zxcvbn-go v1.0.2 // indirect + github.com/cenkalti/backoff/v4 v4.3.0 // indirect github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/charithe/durationcheck v0.0.10 // indirect github.com/charmbracelet/colorprofile v0.2.3-0.20250311203215-f60798e515dc // indirect @@ -55,21 +63,35 @@ require ( github.com/chavacava/garif v0.1.0 // indirect github.com/chigopher/pathlib v0.19.1 // indirect github.com/ckaznocha/intrange v0.3.1 // indirect + github.com/containerd/errdefs v1.0.0 // indirect + github.com/containerd/errdefs/pkg v0.3.0 // indirect + github.com/containerd/log v0.1.0 // indirect + github.com/containerd/platforms v0.2.1 // indirect + github.com/cpuguy83/dockercfg v0.3.2 // indirect github.com/curioswitch/go-reassign v0.3.0 // indirect github.com/daixiang0/gci v0.13.6 // indirect github.com/dave/dst v0.27.3 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/denis-tingaikin/go-header v0.5.0 // indirect + github.com/distribution/reference v0.6.0 // indirect github.com/dlclark/regexp2 v1.11.5 // indirect + github.com/docker/docker v28.5.2+incompatible // indirect + github.com/docker/go-connections v0.6.0 // indirect + github.com/docker/go-units v0.5.0 // indirect + github.com/ebitengine/purego v0.9.1 // indirect github.com/ettle/strcase v0.2.0 // indirect github.com/fatih/color v1.18.0 // indirect github.com/fatih/structs v1.1.0 // indirect github.com/fatih/structtag v1.2.0 // indirect + github.com/felixge/httpsnoop v1.0.4 // indirect github.com/firefart/nonamedreturns v1.0.6 // indirect github.com/fsnotify/fsnotify v1.8.0 // indirect github.com/fzipp/gocyclo v0.6.0 // indirect github.com/ghostiam/protogetter v0.3.15 // indirect github.com/go-critic/go-critic v0.13.0 // indirect + github.com/go-logr/logr v1.4.3 // indirect + github.com/go-logr/stdr v1.2.2 // indirect + github.com/go-ole/go-ole v1.3.0 // indirect github.com/go-toolsmith/astcast v1.1.0 // indirect github.com/go-toolsmith/astcopy v1.1.0 // indirect github.com/go-toolsmith/astequal v1.2.0 // indirect @@ -116,6 +138,7 @@ require ( github.com/karamaru-alpha/copyloopvar v1.2.1 // indirect github.com/kisielk/errcheck v1.9.0 // indirect github.com/kkHAIKE/contextcheck v1.1.6 // indirect + github.com/klauspost/compress v1.18.1 // indirect github.com/knadh/koanf/maps v0.1.1 // indirect github.com/knadh/koanf/parsers/yaml v0.1.0 // indirect github.com/knadh/koanf/providers/env v1.0.0 // indirect @@ -133,7 +156,9 @@ require ( github.com/ldez/usetesting v0.4.3 // indirect github.com/leonklingele/grouper v1.1.2 // indirect github.com/lucasb-eyer/go-colorful v1.2.0 // indirect + github.com/lufia/plan9stats v0.0.0-20251013123823-9fd1530e3ec3 // indirect github.com/macabu/inamedparam v0.2.0 // indirect + github.com/magiconair/properties v1.8.10 // indirect github.com/manuelarte/funcorder v0.2.1 // indirect github.com/maratori/testableexamples v1.0.0 // indirect github.com/maratori/testpackage v1.1.1 // indirect @@ -146,16 +171,27 @@ require ( github.com/mitchellh/copystructure v1.2.0 // indirect github.com/mitchellh/go-homedir v1.1.0 // indirect github.com/mitchellh/reflectwalk v1.0.2 // indirect + github.com/moby/docker-image-spec v1.3.1 // indirect + github.com/moby/go-archive v0.1.0 // indirect + github.com/moby/patternmatcher v0.6.0 // indirect + github.com/moby/sys/sequential v0.6.0 // indirect + github.com/moby/sys/user v0.4.0 // indirect + github.com/moby/sys/userns v0.1.0 // indirect + github.com/moby/term v0.5.2 // indirect github.com/moricho/tparallel v0.3.2 // indirect + github.com/morikuni/aec v1.0.0 // indirect github.com/muesli/termenv v0.16.0 // indirect github.com/nakabonne/nestif v0.3.1 // indirect github.com/nishanths/exhaustive v0.12.0 // indirect github.com/nishanths/predeclared v0.2.2 // indirect github.com/nunnatsa/ginkgolinter v0.19.1 // indirect github.com/olekukonko/tablewriter v0.0.5 // indirect + github.com/opencontainers/go-digest v1.0.0 // indirect + github.com/opencontainers/image-spec v1.1.1 // indirect github.com/pelletier/go-toml/v2 v2.2.4 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/polyfloyd/go-errorlint v1.8.0 // indirect + github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 // indirect github.com/prometheus/client_golang v1.12.1 // indirect github.com/prometheus/client_model v0.2.0 // indirect github.com/prometheus/common v0.32.1 // indirect @@ -177,6 +213,7 @@ require ( github.com/sashamelentyev/interfacebloat v1.1.0 // indirect github.com/sashamelentyev/usestdlibvars v1.28.0 // indirect github.com/securego/gosec/v2 v2.22.3 // indirect + github.com/shirou/gopsutil/v4 v4.25.10 // indirect github.com/sirupsen/logrus v1.9.3 // indirect github.com/sivchari/containedctx v1.0.3 // indirect github.com/sonatard/noctx v0.1.0 // indirect @@ -193,6 +230,8 @@ require ( github.com/tetafro/godot v1.5.1 // indirect github.com/timakin/bodyclose v0.0.0-20241222091800-1db5c5ca4d67 // indirect github.com/timonwong/loggercheck v0.11.0 // indirect + github.com/tklauser/go-sysconf v0.3.16 // indirect + github.com/tklauser/numcpus v0.11.0 // indirect github.com/tomarrell/wrapcheck/v2 v2.11.0 // indirect github.com/tommy-muehle/go-mnd/v2 v2.5.1 // indirect github.com/ultraware/funlen v0.2.0 // indirect @@ -208,21 +247,32 @@ require ( github.com/yagipy/maintidx v1.0.0 // indirect github.com/yeya24/promlinter v0.3.0 // indirect github.com/ykadowak/zerologlint v0.1.5 // indirect + github.com/yusufpapurcu/wmi v1.2.4 // indirect gitlab.com/bosi/decorder v0.4.2 // indirect go-simpler.org/musttag v0.13.1 // indirect go-simpler.org/sloglint v0.11.0 // indirect go.augendre.info/fatcontext v0.8.0 // indirect + go.opentelemetry.io/auto/sdk v1.2.1 // indirect + go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.63.0 // indirect + go.opentelemetry.io/otel v1.38.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.38.0 // indirect + go.opentelemetry.io/otel/metric v1.38.0 // indirect + go.opentelemetry.io/otel/trace v1.38.0 // indirect + go.opentelemetry.io/proto/otlp v1.9.0 // indirect go.uber.org/automaxprocs v1.6.0 // indirect go.uber.org/multierr v1.11.0 // indirect + golang.org/x/crypto v0.45.0 // indirect golang.org/x/exp v0.0.0-20240909161429-701f63a606c0 // indirect golang.org/x/exp/typeparams v0.0.0-20250210185358-939b2ce775ac // indirect - golang.org/x/mod v0.24.0 // indirect - golang.org/x/sync v0.14.0 // indirect - golang.org/x/sys v0.33.0 // indirect - golang.org/x/term v0.29.0 // indirect - golang.org/x/text v0.25.0 // indirect - golang.org/x/tools v0.33.0 // indirect - google.golang.org/protobuf v1.36.6 // indirect + golang.org/x/mod v0.29.0 // indirect + golang.org/x/sync v0.18.0 // indirect + golang.org/x/sys v0.38.0 // indirect + golang.org/x/term v0.37.0 // indirect + golang.org/x/text v0.31.0 // indirect + golang.org/x/tools v0.38.0 // indirect + golang.org/x/tools/go/expect v0.1.1-deprecated // indirect + golang.org/x/tools/go/packages/packagestest v0.1.1-deprecated // indirect + google.golang.org/protobuf v1.36.10 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect honnef.co/go/tools v0.6.1 // indirect @@ -230,6 +280,38 @@ require ( mvdan.cc/unparam v0.0.0-20250301125049-0df0534333a4 // indirect ) +exclude ( + google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8 + google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19 + google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7 + google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb + google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873 + google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64 + google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55 + google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51 + google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a + google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9 + google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1 + google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb + google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba + google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150 + google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90 + google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce + google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63 + google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383 + google.golang.org/genproto v0.0.0-20200305110556-506484158171 + google.golang.org/genproto v0.0.0-20200312145019-da6875a35672 + google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940 + google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84 + google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380 + google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587 + google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013 + google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790 + google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f + google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c + google.golang.org/genproto v0.0.0-20200825200019-8632dd797987 +) + tool ( github.com/golangci/golangci-lint/v2/cmd/golangci-lint github.com/vektra/mockery/v3 diff --git a/go.sum b/go.sum index 0a95d7a..79a7b8f 100644 --- a/go.sum +++ b/go.sum @@ -34,17 +34,23 @@ cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0Zeo cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= +dario.cat/mergo v1.0.2 h1:85+piFYR1tMbRrLcDwR18y4UKJ3aH1Tbzi24VRW1TK8= +dario.cat/mergo v1.0.2/go.mod h1:E/hbnu0NxMFBjpMIE34DRGLWqDy0g5FuKDhCb31ngxA= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= github.com/4meepo/tagalign v1.4.2 h1:0hcLHPGMjDyM1gHG58cS73aQF8J4TdVR96TZViorO9E= github.com/4meepo/tagalign v1.4.2/go.mod h1:+p4aMyFM+ra7nb41CnFG6aSDXqRxU/w1VQqScKqDARI= github.com/Abirdcfly/dupword v0.1.3 h1:9Pa1NuAsZvpFPi9Pqkd93I7LIYRURj+A//dFd5tgBeE= github.com/Abirdcfly/dupword v0.1.3/go.mod h1:8VbB2t7e10KRNdwTVoxdBaxla6avbhGzb8sCTygUMhw= +github.com/AdaLogics/go-fuzz-headers v0.0.0-20240806141605-e8a1dd7889d6 h1:He8afgbRMd7mFxO99hRNu+6tazq8nFF9lIwo9JFroBk= +github.com/AdaLogics/go-fuzz-headers v0.0.0-20240806141605-e8a1dd7889d6/go.mod h1:8o94RPi1/7XTJvwPpRSzSUedZrtlirdB3r9Z20bi2f8= github.com/Antonboom/errname v1.1.0 h1:A+ucvdpMwlo/myWrkHEUEBWc/xuXdud23S8tmTb/oAE= github.com/Antonboom/errname v1.1.0/go.mod h1:O1NMrzgUcVBGIfi3xlVuvX8Q/VP/73sseCaAppfjqZw= github.com/Antonboom/nilnil v1.1.0 h1:jGxJxjgYS3VUUtOTNk8Z1icwT5ESpLH/426fjmQG+ng= github.com/Antonboom/nilnil v1.1.0/go.mod h1:b7sAlogQjFa1wV8jUW3o4PMzDVFLbTux+xnQdvzdcIE= github.com/Antonboom/testifylint v1.6.1 h1:6ZSytkFWatT8mwZlmRCHkWz1gPi+q6UBSbieji2Gj/o= github.com/Antonboom/testifylint v1.6.1/go.mod h1:k+nEkathI2NFjKO6HvwmSrbzUcQ6FAnbZV+ZRrnXPLI= +github.com/Azure/go-ansiterm v0.0.0-20250102033503-faa5f7b0171c h1:udKWzYgxTojEKWjV8V+WSxDXJ4NFATAsZjh8iIbsQIg= +github.com/Azure/go-ansiterm v0.0.0-20250102033503-faa5f7b0171c/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/toml v1.5.0 h1:W5quZX/G/csjUnuI8SUYlsHs9M38FC7znL0lIO+DvMg= github.com/BurntSushi/toml v1.5.0/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho= @@ -55,8 +61,11 @@ github.com/GaijinEntertainment/go-exhaustruct/v3 v3.3.1 h1:Sz1JIXEcSfhz7fUi7xHnh github.com/GaijinEntertainment/go-exhaustruct/v3 v3.3.1/go.mod h1:n/LSCXNuIYqVfBlVXyHfMQkZDdp1/mmxfSjADd3z1Zg= github.com/Masterminds/semver/v3 v3.3.1 h1:QtNSWtVZ3nBfk8mAOu/B6v7FMJ+NHTIgUPi7rj+4nv4= github.com/Masterminds/semver/v3 v3.3.1/go.mod h1:4V+yj/TJE1HU9XfppCwVMZq3I84lprf4nC11bSS5beM= +github.com/Microsoft/go-winio v0.6.2 h1:F2VQgta7ecxGYO8k3ZZz3RS8fVIXVxONVUPlNERoyfY= +github.com/Microsoft/go-winio v0.6.2/go.mod h1:yd8OoFMLzJbo9gZq8j5qaps8bJ9aShtEA8Ipt1oGCvU= github.com/OpenPeeDeeP/depguard/v2 v2.2.1 h1:vckeWVESWp6Qog7UZSARNqfu/cZqvki8zsuj3piCMx4= github.com/OpenPeeDeeP/depguard/v2 v2.2.1/go.mod h1:q4DKzC4UcVaAvcfd41CZh0PWpGgzrVxUYBlgKNGquUo= +github.com/RaveNoX/go-jsoncommentstrip v1.0.0/go.mod h1:78ihd09MekBnJnxpICcwzCMzGrKSKYe4AqU6PDYYpjk= github.com/alecthomas/assert/v2 v2.11.0 h1:2Q9r3ki8+JYXvGsDyBXwH3LcJ+WK5D0gc5E8vS6K3D0= github.com/alecthomas/assert/v2 v2.11.0/go.mod h1:Bze95FyfUr7x34QZrjL+XP+0qgp/zg8yS+TtBj1WA3k= github.com/alecthomas/chroma/v2 v2.17.2 h1:Rm81SCZ2mPoH+Q8ZCc/9YvzPUN/E7HgPiPJD8SLV6GI= @@ -78,6 +87,8 @@ github.com/alingse/asasalint v0.0.11 h1:SFwnQXJ49Kx/1GghOFz1XGqHYKp21Kq1nHad/0WQ github.com/alingse/asasalint v0.0.11/go.mod h1:nCaoMhw7a9kSJObvQyVzNTPBDbNpdocqrSP7t/cW5+I= github.com/alingse/nilnesserr v0.2.0 h1:raLem5KG7EFVb4UIDAXgrv3N2JIaffeKNtcEXkEWd/w= github.com/alingse/nilnesserr v0.2.0/go.mod h1:1xJPrXonEtX7wyTq8Dytns5P2hNzoWymVUIaKm4HNFg= +github.com/apapsch/go-jsonmerge/v2 v2.0.0 h1:axGnT1gRIfimI7gJifB699GoE/oq+F2MU7Dml6nw9rQ= +github.com/apapsch/go-jsonmerge/v2 v2.0.0/go.mod h1:lvDnEdqiQrp0O42VQGgmlKpxL1AP2+08jFMw88y4klk= github.com/ashanbrown/forbidigo v1.6.0 h1:D3aewfM37Yb3pxHujIPSpTf6oQk9sc9WZi8gerOIVIY= github.com/ashanbrown/forbidigo v1.6.0/go.mod h1:Y8j9jy9ZYAEHXdu723cUlraTqbzjKF1MUyfOKL+AjcU= github.com/ashanbrown/makezero v1.2.0 h1:/2Lp1bypdmK9wDIq7uWBlDF1iMUpIIS4A+pF6C9IEUU= @@ -92,6 +103,7 @@ github.com/bkielbasa/cyclop v1.2.3 h1:faIVMIGDIANuGPWH031CZJTi2ymOQBULs9H21HSMa5 github.com/bkielbasa/cyclop v1.2.3/go.mod h1:kHTwA9Q0uZqOADdupvcFJQtp/ksSnytRMe8ztxG8Fuo= github.com/blizzy78/varnamelen v0.8.0 h1:oqSblyuQvFsW1hbBHh1zfwrKe3kcSj0rnXkKzsQ089M= github.com/blizzy78/varnamelen v0.8.0/go.mod h1:V9TzQZ4fLJ1DSrjVDfl89H7aMnTvKkApdHeyESmyR7k= +github.com/bmatcuk/doublestar v1.1.1/go.mod h1:UD6OnuiIn0yFxxA2le/rnRU1G4RaI4UvFv1sNto9p6w= github.com/bombsimon/wsl/v4 v4.7.0 h1:1Ilm9JBPRczjyUs6hvOPKvd7VL1Q++PL8M0SXBDf+jQ= github.com/bombsimon/wsl/v4 v4.7.0/go.mod h1:uV/+6BkffuzSAVYD+yGyld1AChO7/EuLrCF/8xTiapg= github.com/breml/bidichk v0.3.3 h1:WSM67ztRusf1sMoqH6/c4OBCUlRVTKq+CbSeo0R17sE= @@ -108,6 +120,8 @@ github.com/catenacyber/perfsprint v0.9.1 h1:5LlTp4RwTooQjJCvGEFV6XksZvWE7wCOUvjD github.com/catenacyber/perfsprint v0.9.1/go.mod h1:q//VWC2fWbcdSLEY1R3l8n0zQCDPdE4IjZwyY1HMunM= github.com/ccojocar/zxcvbn-go v1.0.2 h1:na/czXU8RrhXO4EZme6eQJLR4PzcGsahsBOAwU6I3Vg= github.com/ccojocar/zxcvbn-go v1.0.2/go.mod h1:g1qkXtUSvHP8lhHp5GrSmTz6uWALGRMQdw6Qnz/hi60= +github.com/cenkalti/backoff/v4 v4.3.0 h1:MyRJ/UdXutAwSAT+s3wNd7MfTIcy71VQueUuFK343L8= +github.com/cenkalti/backoff/v4 v4.3.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= @@ -136,8 +150,20 @@ github.com/ckaznocha/intrange v0.3.1 h1:j1onQyXvHUsPWujDH6WIjhyH26gkRt/txNlV7Lsp github.com/ckaznocha/intrange v0.3.1/go.mod h1:QVepyz1AkUoFQkpEqksSYpNpUo3c5W7nWh/s6SHIJJk= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= +github.com/containerd/errdefs v1.0.0 h1:tg5yIfIlQIrxYtu9ajqY42W3lpS19XqdxRQeEwYG8PI= +github.com/containerd/errdefs v1.0.0/go.mod h1:+YBYIdtsnF4Iw6nWZhJcqGSg/dwvV7tyJ/kCkyJ2k+M= +github.com/containerd/errdefs/pkg v0.3.0 h1:9IKJ06FvyNlexW690DXuQNx2KA2cUJXx151Xdx3ZPPE= +github.com/containerd/errdefs/pkg v0.3.0/go.mod h1:NJw6s9HwNuRhnjJhM7pylWwMyAkmCQvQ4GpJHEqRLVk= +github.com/containerd/log v0.1.0 h1:TCJt7ioM2cr/tfR8GPbGf9/VRAX8D2B4PjzCpfX540I= +github.com/containerd/log v0.1.0/go.mod h1:VRRf09a7mHDIRezVKTRCrOq78v577GXq3bSa3EhrzVo= +github.com/containerd/platforms v0.2.1 h1:zvwtM3rz2YHPQsF2CHYM8+KtB5dvhISiXh5ZpSBQv6A= +github.com/containerd/platforms v0.2.1/go.mod h1:XHCb+2/hzowdiut9rkudds9bE5yJ7npe7dG/wG+uFPw= github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= +github.com/cpuguy83/dockercfg v0.3.2 h1:DlJTyZGBDlXqUZ2Dk2Q3xHs/FtnooJJVaad2S9GKorA= +github.com/cpuguy83/dockercfg v0.3.2/go.mod h1:sugsbF4//dDlL/i+S+rtpIWp+5h0BHJHfjj5/jFyUJc= github.com/cpuguy83/go-md2man/v2 v2.0.6/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g= +github.com/creack/pty v1.1.18 h1:n56/Zwd5o6whRC5PMGretI4IdRLlmBXYNjScPaBgsbY= +github.com/creack/pty v1.1.18/go.mod h1:MOBLtS5ELjhRRrroQr9kyvTxUAFNvYEK993ew/Vr4O4= github.com/curioswitch/go-reassign v0.3.0 h1:dh3kpQHuADL3cobV/sSGETA8DOv457dwl+fbBAhrQPs= github.com/curioswitch/go-reassign v0.3.0/go.mod h1:nApPCCTtqLJN/s8HfItCcKV0jIPwluBOvZP+dsJGA88= github.com/daixiang0/gci v0.13.6 h1:RKuEOSkGpSadkGbvZ6hJ4ddItT3cVZ9Vn9Rybk6xjl8= @@ -152,8 +178,18 @@ github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1 github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/denis-tingaikin/go-header v0.5.0 h1:SRdnP5ZKvcO9KKRP1KJrhFR3RrlGuD+42t4429eC9k8= github.com/denis-tingaikin/go-header v0.5.0/go.mod h1:mMenU5bWrok6Wl2UsZjy+1okegmwQ3UgWl4V1D8gjlY= +github.com/distribution/reference v0.6.0 h1:0IXCQ5g4/QMHHkarYzh5l+u8T3t73zM5QvfrDyIgxBk= +github.com/distribution/reference v0.6.0/go.mod h1:BbU0aIcezP1/5jX/8MP0YiH4SdvB5Y4f/wlDRiLyi3E= github.com/dlclark/regexp2 v1.11.5 h1:Q/sSnsKerHeCkc/jSTNq1oCm7KiVgUMZRDUoRu0JQZQ= github.com/dlclark/regexp2 v1.11.5/go.mod h1:DHkYz0B9wPfa6wondMfaivmHpzrQ3v9q8cnmRbL6yW8= +github.com/docker/docker v28.5.2+incompatible h1:DBX0Y0zAjZbSrm1uzOkdr1onVghKaftjlSWt4AFexzM= +github.com/docker/docker v28.5.2+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= +github.com/docker/go-connections v0.6.0 h1:LlMG9azAe1TqfR7sO+NJttz1gy6KO7VJBh+pMmjSD94= +github.com/docker/go-connections v0.6.0/go.mod h1:AahvXYshr6JgfUJGdDCs2b5EZG/vmaMAntpSFH5BFKE= +github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4= +github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= +github.com/ebitengine/purego v0.9.1 h1:a/k2f2HQU3Pi399RPW1MOaZyhKJL9w/xFpKAg4q1s0A= +github.com/ebitengine/purego v0.9.1/go.mod h1:iIjxzd6CiRiOG0UyXP+V1+jWqUXVjPKLAI0mRfJZTmQ= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= @@ -166,6 +202,8 @@ github.com/fatih/structs v1.1.0 h1:Q7juDM0QtcnhCpeyLGQKyg4TOIghuNXrkL32pHAUMxo= github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= github.com/fatih/structtag v1.2.0 h1:/OdNE99OxoI/PqaW/SuSK9uxxT3f/tcSZgon/ssNSx4= github.com/fatih/structtag v1.2.0/go.mod h1:mBJUNpUnHmRKrKlQQlmCrh5PuhftFbNv8Ys4/aAZl94= +github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg= +github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= github.com/firefart/nonamedreturns v1.0.6 h1:vmiBcKV/3EqKY3ZiPxCINmpS431OcE1S47AQUwhrg8E= github.com/firefart/nonamedreturns v1.0.6/go.mod h1:R8NisJnSIpvPWheCq0mNRXJok6D8h7fagJTF8EMEwCo= github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8= @@ -187,8 +225,14 @@ github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vb github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= -github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY= -github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= +github.com/go-logr/logr v1.4.3 h1:CjnDlHq8ikf6E492q6eKboGOC0T8CDaOvkHCIg8idEI= +github.com/go-logr/logr v1.4.3/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= +github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= +github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= +github.com/go-ole/go-ole v1.3.0 h1:Dt6ye7+vXGIKZ7Xtk4s6/xVdGDQynvom7xCFEdWr6uE= +github.com/go-ole/go-ole v1.3.0/go.mod h1:5LS6F96DhAwUc7C+1HLexzMXY1xGRSryjyPPKW6zv78= github.com/go-quicktest/qt v1.101.0 h1:O1K29Txy5P2OK0dGo59b7b0LR6wKfIhttaAhHUyn7eI= github.com/go-quicktest/qt v1.101.0/go.mod h1:14Bz/f7NwaXPtdYEgzsx46kqSxVwTbzVZsDC26tQJow= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= @@ -326,6 +370,8 @@ github.com/gotnospirit/makeplural v0.0.0-20180622080156-a5f48d94d976 h1:b70jEaX2 github.com/gotnospirit/makeplural v0.0.0-20180622080156-a5f48d94d976/go.mod h1:ZGQeOwybjD8lkCjIyJfqR5LD2wMVHJ31d6GdPxoTsWY= github.com/gotnospirit/messageformat v0.0.0-20221001023931-dfe49f1eb092 h1:c7gcNWTSr1gtLp6PyYi3wzvFCEcHJ4YRobDgqmIgf7Q= github.com/gotnospirit/messageformat v0.0.0-20221001023931-dfe49f1eb092/go.mod h1:ZZAN4fkkful3l1lpJwF8JbW41ZiG9TwJ2ZlqzQovBNU= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.27.2 h1:8Tjv8EJ+pM1xP8mK6egEbD1OgnVTyacbefKhmbLhIhU= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.27.2/go.mod h1:pkJQ2tZHJ0aFOVEEot6oZmaVEZcRme73eIFmhiVuRWs= github.com/hashicorp/go-immutable-radix/v2 v2.1.0 h1:CUW5RYIcysz+D3B+l1mDeXrQ7fUvGGCwJfdASSzbrfo= github.com/hashicorp/go-immutable-radix/v2 v2.1.0/go.mod h1:hgdqLXA4f6NIjRVisM1TJ9aOJVNRqKZj+xDGF6m7PBw= github.com/hashicorp/go-uuid v1.0.3 h1:2gKiV6YVmrJ1i2CKKa9obLvRieoRGviZFL26PcT/Co8= @@ -359,6 +405,7 @@ github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/ github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= +github.com/juju/gnuflag v0.0.0-20171113085948-2ce1bb71843d/go.mod h1:2PavIy+JPciBPrBUjwbNvtwB6RQlve+hkpll6QSNmOE= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= github.com/julz/importas v0.2.0 h1:y+MJN/UdL63QbFJHws9BVC5RpA2iq0kpjrFajTGivjQ= @@ -374,6 +421,8 @@ github.com/kisielk/errcheck v1.9.0/go.mod h1:kQxWMMVZgIkDq7U8xtG/n2juOjbLgZtedi0 github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/kkHAIKE/contextcheck v1.1.6 h1:7HIyRcnyzxL9Lz06NGhiKvenXq7Zw6Q0UQu/ttjfJCE= github.com/kkHAIKE/contextcheck v1.1.6/go.mod h1:3dDbMRNBFaq8HFXWC1JyvDSPm43CmE6IuHam8Wr0rkg= +github.com/klauspost/compress v1.18.1 h1:bcSGx7UbpBqMChDtsF28Lw6v/G94LPrrbMbdC3JH2co= +github.com/klauspost/compress v1.18.1/go.mod h1:ZQFFVG+MdnR0P+l6wpXgIL4NTtwiKIdBnrBd8Nrxr+0= github.com/knadh/koanf/maps v0.1.1 h1:G5TjmUh2D7G2YWf5SQQqSiHRJEjaicvU0KpypqB3NIs= github.com/knadh/koanf/maps v0.1.1/go.mod h1:npD/QZY3V6ghQDdcQzl1W4ICNVTkohC8E73eI2xW4yI= github.com/knadh/koanf/parsers/yaml v0.1.0 h1:ZZ8/iGfRLvKSaMEECEBPM1HQslrZADk8fP1XFUxVI5w= @@ -418,8 +467,12 @@ github.com/leonklingele/grouper v1.1.2 h1:o1ARBDLOmmasUaNDesWqWCIFH3u7hoFlM84Yrj github.com/leonklingele/grouper v1.1.2/go.mod h1:6D0M/HVkhs2yRKRFZUoGjeDy7EZTfFBE9gl4kjmIGkA= github.com/lucasb-eyer/go-colorful v1.2.0 h1:1nnpGOrhyZZuNyfu1QjKiUICQ74+3FNCN69Aj6K7nkY= github.com/lucasb-eyer/go-colorful v1.2.0/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i7ruzyGqttikkLy0= +github.com/lufia/plan9stats v0.0.0-20251013123823-9fd1530e3ec3 h1:PwQumkgq4/acIiZhtifTV5OUqqiP82UAl0h87xj/l9k= +github.com/lufia/plan9stats v0.0.0-20251013123823-9fd1530e3ec3/go.mod h1:autxFIvghDt3jPTLoqZ9OZ7s9qTGNAWmYCjVFWPX/zg= github.com/macabu/inamedparam v0.2.0 h1:VyPYpOc10nkhI2qeNUdh3Zket4fcZjEWe35poddBCpE= github.com/macabu/inamedparam v0.2.0/go.mod h1:+Pee9/YfGe5LJ62pYXqB89lJ+0k5bsR8Wgz/C0Zlq3U= +github.com/magiconair/properties v1.8.10 h1:s31yESBquKXCV9a/ScB3ESkOjUYYv+X0rg8SYxI99mE= +github.com/magiconair/properties v1.8.10/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= github.com/manuelarte/funcorder v0.2.1 h1:7QJsw3qhljoZ5rH0xapIvjw31EcQeFbF31/7kQ/xS34= github.com/manuelarte/funcorder v0.2.1/go.mod h1:BQQ0yW57+PF9ZpjpeJDKOffEsQbxDFKW8F8zSMe/Zd0= github.com/maratori/testableexamples v1.0.0 h1:dU5alXRrD8WKSjOUnmJZuzdxWOEQ57+7s93SLMxb2vI= @@ -442,6 +495,8 @@ github.com/mattn/go-runewidth v0.0.16 h1:E5ScNMtiwvlvB5paMFdw9p4kSQzbXFikJ5SQO6T github.com/mattn/go-runewidth v0.0.16/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= +github.com/mdelapenya/tlscert v0.2.0 h1:7H81W6Z/4weDvZBNOfQte5GpIMo0lGYEeWbkGp5LJHI= +github.com/mdelapenya/tlscert v0.2.0/go.mod h1:O4njj3ELLnJjGdkN7M/vIVCpZ+Cf0L6muqOG4tLSl8o= github.com/mgechev/revive v1.9.0 h1:8LaA62XIKrb8lM6VsBSQ92slt/o92z5+hTw3CmrvSrM= github.com/mgechev/revive v1.9.0/go.mod h1:LAPq3+MgOf7GcL5PlWIkHb0PT7XH4NuC2LdWymhb9Mo= github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw= @@ -450,6 +505,22 @@ github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ= github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= +github.com/moby/docker-image-spec v1.3.1 h1:jMKff3w6PgbfSa69GfNg+zN/XLhfXJGnEx3Nl2EsFP0= +github.com/moby/docker-image-spec v1.3.1/go.mod h1:eKmb5VW8vQEh/BAr2yvVNvuiJuY6UIocYsFu/DxxRpo= +github.com/moby/go-archive v0.1.0 h1:Kk/5rdW/g+H8NHdJW2gsXyZ7UnzvJNOy6VKJqueWdcQ= +github.com/moby/go-archive v0.1.0/go.mod h1:G9B+YoujNohJmrIYFBpSd54GTUB4lt9S+xVQvsJyFuo= +github.com/moby/patternmatcher v0.6.0 h1:GmP9lR19aU5GqSSFko+5pRqHi+Ohk1O69aFiKkVGiPk= +github.com/moby/patternmatcher v0.6.0/go.mod h1:hDPoyOpDY7OrrMDLaYoY3hf52gNCR/YOUYxkhApJIxc= +github.com/moby/sys/atomicwriter v0.1.0 h1:kw5D/EqkBwsBFi0ss9v1VG3wIkVhzGvLklJ+w3A14Sw= +github.com/moby/sys/atomicwriter v0.1.0/go.mod h1:Ul8oqv2ZMNHOceF643P6FKPXeCmYtlQMvpizfsSoaWs= +github.com/moby/sys/sequential v0.6.0 h1:qrx7XFUd/5DxtqcoH1h438hF5TmOvzC/lspjy7zgvCU= +github.com/moby/sys/sequential v0.6.0/go.mod h1:uyv8EUTrca5PnDsdMGXhZe6CCe8U/UiTWd+lL+7b/Ko= +github.com/moby/sys/user v0.4.0 h1:jhcMKit7SA80hivmFJcbB1vqmw//wU61Zdui2eQXuMs= +github.com/moby/sys/user v0.4.0/go.mod h1:bG+tYYYJgaMtRKgEmuueC0hJEAZWwtIbZTB+85uoHjs= +github.com/moby/sys/userns v0.1.0 h1:tVLXkFOxVu9A64/yh59slHVv9ahO9UIev4JZusOLG/g= +github.com/moby/sys/userns v0.1.0/go.mod h1:IHUYgu/kao6N8YZlp9Cf444ySSvCmDlmzUcYfDHOl28= +github.com/moby/term v0.5.2 h1:6qk3FJAFDs6i/q3W/pQ97SX192qKfZgGjCQqfCJkgzQ= +github.com/moby/term v0.5.2/go.mod h1:d3djjFCrjnB+fl8NJux+EJzu0msscUP+f8it8hPkFLc= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= @@ -457,6 +528,8 @@ github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3Rllmb github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/moricho/tparallel v0.3.2 h1:odr8aZVFA3NZrNybggMkYO3rgPRcqjeQUlBBFVxKHTI= github.com/moricho/tparallel v0.3.2/go.mod h1:OQ+K3b4Ln3l2TZveGCywybl68glfLEwFGqvnjok8b+U= +github.com/morikuni/aec v1.0.0 h1:nP9CBfwrvYnBRgY6qfDQkygYDmYwOilePFkwzv4dU8A= +github.com/morikuni/aec v1.0.0/go.mod h1:BbKIizmSmc5MMPqRYbxO4ZU0S0+P200+tUnFx7PXmsc= github.com/muesli/termenv v0.16.0 h1:S5AlUN9dENB57rsbnkPyfdGuWIlkmzJjbFf0Tf5FWUc= github.com/muesli/termenv v0.16.0/go.mod h1:ZRfOIKPFDYQoDFF4Olj7/QJbW60Ol/kL1pU3VfY/Cnk= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= @@ -469,12 +542,18 @@ github.com/nishanths/predeclared v0.2.2 h1:V2EPdZPliZymNAn79T8RkNApBjMmVKh5XRpLm github.com/nishanths/predeclared v0.2.2/go.mod h1:RROzoN6TnGQupbC+lqggsOlcgysk3LMK/HI84Mp280c= github.com/nunnatsa/ginkgolinter v0.19.1 h1:mjwbOlDQxZi9Cal+KfbEJTCz327OLNfwNvoZ70NJ+c4= github.com/nunnatsa/ginkgolinter v0.19.1/go.mod h1:jkQ3naZDmxaZMXPWaS9rblH+i+GWXQCaS/JFIWcOH2s= +github.com/oapi-codegen/runtime v1.1.2 h1:P2+CubHq8fO4Q6fV1tqDBZHCwpVpvPg7oKiYzQgXIyI= +github.com/oapi-codegen/runtime v1.1.2/go.mod h1:SK9X900oXmPWilYR5/WKPzt3Kqxn/uS/+lbpREv+eCg= github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec= github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY= github.com/onsi/ginkgo/v2 v2.23.3 h1:edHxnszytJ4lD9D5Jjc4tiDkPBZ3siDeJJkUZJJVkp0= github.com/onsi/ginkgo/v2 v2.23.3/go.mod h1:zXTP6xIp3U8aVuXN8ENK9IXRaTjFnpVB9mGmaSRvxnM= github.com/onsi/gomega v1.36.3 h1:hID7cr8t3Wp26+cYnfcjR6HpJ00fdogN6dqZ1t6IylU= github.com/onsi/gomega v1.36.3/go.mod h1:8D9+Txp43QWKhM24yyOBEdpkzN8FvJyAwecBgsU4KU0= +github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= +github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= +github.com/opencontainers/image-spec v1.1.1 h1:y0fUlFfIZhPF1W537XOLg0/fcx6zcHCJwooC2xJA040= +github.com/opencontainers/image-spec v1.1.1/go.mod h1:qpqAh3Dmcf36wStyyWU+kCeDgrGnAve2nCC8+7h8Q0M= github.com/otiai10/copy v1.2.0/go.mod h1:rrF5dJ5F0t/EWSYODDu4j9/vEeYHMkc8jt0zJChqQWw= github.com/otiai10/copy v1.14.0 h1:dCI/t1iTdYGtkvCuBG2BgR6KZa83PTclw4U5n2wAllU= github.com/otiai10/copy v1.14.0/go.mod h1:ECfuL02W+/FkTWZWgQqXPWZgW9oeKCSQ5qVfSc4qc4w= @@ -484,6 +563,8 @@ github.com/otiai10/mint v1.3.0/go.mod h1:F5AjcsTsWUqX+Na9fpHb52P8pcRX2CI6A3ctIT9 github.com/otiai10/mint v1.3.1/go.mod h1:/yxELlJQ0ufhjUwhshSj+wFjZ78CnZ48/1wtmBH1OTc= github.com/pelletier/go-toml/v2 v2.2.4 h1:mye9XuhQ6gvn5h28+VilKrrPoQVanw5PMw/TB0t5Ec4= github.com/pelletier/go-toml/v2 v2.2.4/go.mod h1:2gIqNv+qfxSVS7cM2xJQKtLSTLUE9V8t9Stt+h56mCY= +github.com/pierrec/lz4/v4 v4.1.19 h1:tYLzDnjDXh9qIxSTKHwXwOYmm9d887Y7Y1ZkyXYHAN4= +github.com/pierrec/lz4/v4 v4.1.19/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= @@ -493,6 +574,8 @@ github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRI github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/polyfloyd/go-errorlint v1.8.0 h1:DL4RestQqRLr8U4LygLw8g2DX6RN1eBJOpa2mzsrl1Q= github.com/polyfloyd/go-errorlint v1.8.0/go.mod h1:G2W0Q5roxbLCt0ZQbdoxQxXktTjwNyDbEaj3n7jvl4s= +github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 h1:o4JXh1EVt9k/+g42oCprj/FisM4qX9L3sZB3upGN2ZU= +github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= github.com/prashantv/gostub v1.1.0 h1:BTyx3RfQjRHnUWaGF9oQos79AlQ5k8WNktv7VGvVH4g= github.com/prashantv/gostub v1.1.0/go.mod h1:A5zLQHz7ieHGG7is6LLXLz7I8+3LZzsrV0P1IAHhP5U= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= @@ -557,6 +640,8 @@ github.com/securego/gosec/v2 v2.22.3 h1:mRrCNmRF2NgZp4RJ8oJ6yPJ7G4x6OCiAXHd8x4tr github.com/securego/gosec/v2 v2.22.3/go.mod h1:42M9Xs0v1WseinaB/BmNGO8AVqG8vRfhC2686ACY48k= github.com/sergi/go-diff v1.2.0 h1:XU+rvMAioB0UC3q1MFrIQy4Vo5/4VsRDQQXHsEya6xQ= github.com/sergi/go-diff v1.2.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= +github.com/shirou/gopsutil/v4 v4.25.10 h1:at8lk/5T1OgtuCp+AwrDofFRjnvosn0nkN2OLQ6g8tA= +github.com/shirou/gopsutil/v4 v4.25.10/go.mod h1:+kSwyC8DRUD9XXEHCAFjK+0nuArFJM0lva+StQAcskM= github.com/shurcooL/go v0.0.0-20180423040247-9e1955d9fb6e/go.mod h1:TDJrrUr11Vxrven61rcy3hJMUqaf/CLWYhHNPmT14Lk= github.com/shurcooL/go-goon v0.0.0-20170922171312-37c2f522c041/go.mod h1:N5mDOmsrJOB+vfqUK+7DmDyjhSLIIBnXo9lvZJj3MWQ= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= @@ -583,6 +668,7 @@ github.com/spf13/pflag v1.0.6 h1:jFzHGLGAlb3ruxLB8MhbI6A8+AQX/2eW4qeyNZXNp2o= github.com/spf13/pflag v1.0.6/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/spf13/viper v1.20.1 h1:ZMi+z/lvLyPSCoNtFCpqjy0S4kPbirhpTMwl8BkW9X4= github.com/spf13/viper v1.20.1/go.mod h1:P9Mdzt1zoHIG8m2eZQinpiBjo6kCmZSKBClNNqjJvu4= +github.com/spkg/bom v0.0.0-20160624110644-59b7046e48ad/go.mod h1:qLr4V1qq6nMqFKkMo8ZTx3f+BZEkzsRUY10Xsm2mwU0= github.com/ssgreg/nlreturn/v2 v2.2.1 h1:X4XDI7jstt3ySqGU86YGAURbxw3oTDPK9sPEi6YEwQ0= github.com/ssgreg/nlreturn/v2 v2.2.1/go.mod h1:E/iiPB78hV7Szg2YfRgyIrk1AD6JVMTRkkxBiELzh2I= github.com/stbenjam/no-sprintf-host-port v0.2.0 h1:i8pxvGrt1+4G0czLr/WnmyH7zbZ8Bg8etvARQ1rpyl4= @@ -601,8 +687,8 @@ github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= -github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U= +github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U= github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8= github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU= github.com/tdakkota/asciicheck v0.4.1 h1:bm0tbcmi0jezRA2b5kg4ozmMuGAFotKI3RZfrhfovg8= @@ -611,16 +697,30 @@ github.com/tenntenn/modver v1.0.1 h1:2klLppGhDgzJrScMpkj9Ujy3rXPUspSjAcev9tSEBgA github.com/tenntenn/modver v1.0.1/go.mod h1:bePIyQPb7UeioSRkw3Q0XeMhYZSMx9B8ePqg6SAMGH0= github.com/tenntenn/text/transform v0.0.0-20200319021203-7eef512accb3 h1:f+jULpRQGxTSkNYKJ51yaw6ChIqO+Je8UqsTKN/cDag= github.com/tenntenn/text/transform v0.0.0-20200319021203-7eef512accb3/go.mod h1:ON8b8w4BN/kE1EOhwT0o+d62W65a6aPw1nouo9LMgyY= +github.com/testcontainers/testcontainers-go v0.40.0 h1:pSdJYLOVgLE8YdUY2FHQ1Fxu+aMnb6JfVz1mxk7OeMU= +github.com/testcontainers/testcontainers-go v0.40.0/go.mod h1:FSXV5KQtX2HAMlm7U3APNyLkkap35zNLxukw9oBi/MY= +github.com/testcontainers/testcontainers-go/modules/redpanda v0.40.0 h1:B8f4pGYc2aRlG/3aEEdn/jqLfJL3+q8xAPJypxk2ttg= +github.com/testcontainers/testcontainers-go/modules/redpanda v0.40.0/go.mod h1:PFyDDGtSHEsVmWFzqKudRh1dRBRLywmAgFqtcUatA78= github.com/tetafro/godot v1.5.1 h1:PZnjCol4+FqaEzvZg5+O8IY2P3hfY9JzRBNPv1pEDS4= github.com/tetafro/godot v1.5.1/go.mod h1:cCdPtEndkmqqrhiCfkmxDodMQJ/f3L1BCNskCUZdTwk= github.com/timakin/bodyclose v0.0.0-20241222091800-1db5c5ca4d67 h1:9LPGD+jzxMlnk5r6+hJnar67cgpDIz/iyD+rfl5r2Vk= github.com/timakin/bodyclose v0.0.0-20241222091800-1db5c5ca4d67/go.mod h1:mkjARE7Yr8qU23YcGMSALbIxTQ9r9QBVahQOBRfU460= github.com/timonwong/loggercheck v0.11.0 h1:jdaMpYBl+Uq9mWPXv1r8jc5fC3gyXx4/WGwTnnNKn4M= github.com/timonwong/loggercheck v0.11.0/go.mod h1:HEAWU8djynujaAVX7QI65Myb8qgfcZ1uKbdpg3ZzKl8= +github.com/tklauser/go-sysconf v0.3.16 h1:frioLaCQSsF5Cy1jgRBrzr6t502KIIwQ0MArYICU0nA= +github.com/tklauser/go-sysconf v0.3.16/go.mod h1:/qNL9xxDhc7tx3HSRsLWNnuzbVfh3e7gh/BmM179nYI= +github.com/tklauser/numcpus v0.11.0 h1:nSTwhKH5e1dMNsCdVBukSZrURJRoHbSEQjdEbY+9RXw= +github.com/tklauser/numcpus v0.11.0/go.mod h1:z+LwcLq54uWZTX0u/bGobaV34u6V7KNlTZejzM6/3MQ= github.com/tomarrell/wrapcheck/v2 v2.11.0 h1:BJSt36snX9+4WTIXeJ7nvHBQBcm1h2SjQMSlmQ6aFSU= github.com/tomarrell/wrapcheck/v2 v2.11.0/go.mod h1:wFL9pDWDAbXhhPZZt+nG8Fu+h29TtnZ2MW6Lx4BRXIU= github.com/tommy-muehle/go-mnd/v2 v2.5.1 h1:NowYhSdyE/1zwK9QCLeRb6USWdoif80Ie+v+yU8u1Zw= github.com/tommy-muehle/go-mnd/v2 v2.5.1/go.mod h1:WsUAkMJMYww6l/ufffCD3m+P7LEvr8TnZn9lwVDlgzw= +github.com/twmb/franz-go v1.16.1 h1:rpWc7fB9jd7TgmCyfxzenBI+QbgS8ZfJOUQE+tzPtbE= +github.com/twmb/franz-go v1.16.1/go.mod h1:/pER254UPPGp/4WfGqRi+SIRGE50RSQzVubQp6+N4FA= +github.com/twmb/franz-go/pkg/kadm v1.11.0 h1:FfeWJ0qadntFpAcQt8JzNXW4dijjytZNLrzJuzzzuxA= +github.com/twmb/franz-go/pkg/kadm v1.11.0/go.mod h1:qrhkdH+SWS3ivmbqOgHbpgVHamhaKcjH0UM+uOp0M1A= +github.com/twmb/franz-go/pkg/kmsg v1.7.0 h1:a457IbvezYfA5UkiBvyV3zj0Is3y1i8EJgqjJYoij2E= +github.com/twmb/franz-go/pkg/kmsg v1.7.0/go.mod h1:se9Mjdt0Nwzc9lnjJ0HyDtLyBnaBDAd7pCje47OhSyw= github.com/ultraware/funlen v0.2.0 h1:gCHmCn+d2/1SemTdYMiKLAHFYxTYz7z9VIDRaTGyLkI= github.com/ultraware/funlen v0.2.0/go.mod h1:ZE0q4TsJ8T1SQcjmkhN/w+MceuatI6pBFSxxyteHIJA= github.com/ultraware/whitespace v0.2.0 h1:TYowo2m9Nfj1baEQBjuHzvMRbp19i+RCcRYrSWoFa+g= @@ -654,6 +754,8 @@ github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9dec github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yuin/goldmark v1.4.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= +github.com/yusufpapurcu/wmi v1.2.4 h1:zFUKzehAFReQwLys1b/iSMl+JQGSCSjtVqQn9bBrPo0= +github.com/yusufpapurcu/wmi v1.2.4/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0= gitlab.com/bosi/decorder v0.4.2 h1:qbQaV3zgwnBZ4zPMhGLW4KZe7A7NwxEhJx39R3shffo= gitlab.com/bosi/decorder v0.4.2/go.mod h1:muuhHoaJkA9QLcYHq4Mj8FJUwDZ+EirSHRiaTcTf6T8= go-simpler.org/assert v0.9.0 h1:PfpmcSvL7yAnWyChSjOz6Sp6m9j5lyK8Ok9pEL31YkQ= @@ -669,6 +771,26 @@ go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opentelemetry.io/auto/sdk v1.2.1 h1:jXsnJ4Lmnqd11kwkBV2LgLoFMZKizbCi5fNZ/ipaZ64= +go.opentelemetry.io/auto/sdk v1.2.1/go.mod h1:KRTj+aOaElaLi+wW1kO/DZRXwkF4C5xPbEe3ZiIhN7Y= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.63.0 h1:RbKq8BG0FI8OiXhBfcRtqqHcZcka+gU3cskNuf05R18= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.63.0/go.mod h1:h06DGIukJOevXaj/xrNjhi/2098RZzcLTbc0jDAUbsg= +go.opentelemetry.io/otel v1.38.0 h1:RkfdswUDRimDg0m2Az18RKOsnI8UDzppJAtj01/Ymk8= +go.opentelemetry.io/otel v1.38.0/go.mod h1:zcmtmQ1+YmQM9wrNsTGV/q/uyusom3P8RxwExxkZhjM= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.38.0 h1:GqRJVj7UmLjCVyVJ3ZFLdPRmhDUp2zFmQe3RHIOsw24= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.38.0/go.mod h1:ri3aaHSmCTVYu2AWv44YMauwAQc0aqI9gHKIcSbI1pU= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.19.0 h1:IeMeyr1aBvBiPVYihXIaeIZba6b8E1bYp7lbdxK8CQg= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.19.0/go.mod h1:oVdCUtjq9MK9BlS7TtucsQwUcXcymNiEDjgDD2jMtZU= +go.opentelemetry.io/otel/metric v1.38.0 h1:Kl6lzIYGAh5M159u9NgiRkmoMKjvbsKtYRwgfrA6WpA= +go.opentelemetry.io/otel/metric v1.38.0/go.mod h1:kB5n/QoRM8YwmUahxvI3bO34eVtQf2i4utNVLr9gEmI= +go.opentelemetry.io/otel/sdk v1.38.0 h1:l48sr5YbNf2hpCUj/FoGhW9yDkl+Ma+LrVl8qaM5b+E= +go.opentelemetry.io/otel/sdk v1.38.0/go.mod h1:ghmNdGlVemJI3+ZB5iDEuk4bWA3GkTpW+DOoZMYBVVg= +go.opentelemetry.io/otel/sdk/metric v1.38.0 h1:aSH66iL0aZqo//xXzQLYozmWrXxyFkBJ6qT5wthqPoM= +go.opentelemetry.io/otel/sdk/metric v1.38.0/go.mod h1:dg9PBnW9XdQ1Hd6ZnRz689CbtrUp0wMMs9iPcgT9EZA= +go.opentelemetry.io/otel/trace v1.38.0 h1:Fxk5bKrDZJUH+AMyyIXGcFAPah0oRcT+LuNtJrmcNLE= +go.opentelemetry.io/otel/trace v1.38.0/go.mod h1:j1P9ivuFsTceSWe1oY+EeW3sc+Pp42sO++GHkg4wwhs= +go.opentelemetry.io/proto/otlp v1.9.0 h1:l706jCMITVouPOqEnii2fIAuO3IVGBRPV5ICjceRb/A= +go.opentelemetry.io/proto/otlp v1.9.0/go.mod h1:xE+Cx5E/eEHw+ISFkwPLwCZefwVjY+pqKg1qcK03+/4= go.uber.org/automaxprocs v1.6.0 h1:O3y2/QNTOdbF+e/dpXNNW7Rx2hZ4sTIPyybbxyNqTUs= go.uber.org/automaxprocs v1.6.0/go.mod h1:ifeIMSnPZuznNm6jmdzmU3/bfk01Fe2fotchwEFJ8r8= go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= @@ -686,6 +808,8 @@ golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPh golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.13.0/go.mod h1:y6Z2r+Rw4iayiXXAIxJIDAJ1zMW4yaTpebo8fPOliYc= golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4= +golang.org/x/crypto v0.45.0 h1:jMBrvKuj23MTlT0bQEOBcAE0mjg8mK9RXFhRH6nyF3Q= +golang.org/x/crypto v0.45.0/go.mod h1:XTGrrkGJve7CYK7J8PEww4aY7gM3qMCElcJQ8n8JdX4= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -705,7 +829,6 @@ golang.org/x/exp/typeparams v0.0.0-20250210185358-939b2ce775ac/go.mod h1:AbB0pIl golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= -golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= @@ -731,13 +854,12 @@ golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.9.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.13.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= -golang.org/x/mod v0.24.0 h1:ZfthKaKaT4NrhGVZHO1/WDTwGES4De8KtWO0SIbNJMU= -golang.org/x/mod v0.24.0/go.mod h1:IXM97Txy2VM4PJ3gI61r1YEk/gAj6zAHN3AdZt6S9Ww= +golang.org/x/mod v0.29.0 h1:HV8lRxZC4l2cr3Zq1LvtOsi/ThTgWnUk/y64QSs8GwA= +golang.org/x/mod v0.29.0/go.mod h1:NyhrlYXJ2H4eJiRy/WDBO6HMqZQ6q9nk4JzS3NuCK+w= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= @@ -773,8 +895,8 @@ golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= golang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk= golang.org/x/net v0.16.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= -golang.org/x/net v0.40.0 h1:79Xs7wF06Gbdcg4kdCCIQArK11Z1hr5POQ6+fIYHNuY= -golang.org/x/net v0.40.0/go.mod h1:y0hY0exeL2Pku80/zKK7tpntoX23cqL3Oa6njdgRtds= +golang.org/x/net v0.47.0 h1:Mx+4dIFzqraBXUugkia1OOvlD6LemFo1ALMHjrXDOhY= +golang.org/x/net v0.47.0/go.mod h1:/jNxtkgq5yWUGYkaZGqo27cfGZ1c5Nen03aYrrKpVRU= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -796,8 +918,8 @@ golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= golang.org/x/sync v0.4.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= -golang.org/x/sync v0.14.0 h1:woo0S4Yywslg6hp4eUFjTVOyKt0RookbpAHG4c1HmhQ= -golang.org/x/sync v0.14.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA= +golang.org/x/sync v0.18.0 h1:kr88TuHDroi+UVf+0hZnirlk8o8T+4MrK6mr60WkH/I= +golang.org/x/sync v0.18.0/go.mod h1:9KTHXmSnoGruLpwFjVSX0lNNA75CykiMECbovNTZqGI= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -810,6 +932,7 @@ golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -831,12 +954,14 @@ golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201204225414-ed752295db88/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211105183446-c75c47738b0c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -844,14 +969,15 @@ golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.33.0 h1:q3i8TbbEz+JRD9ywIRlyRAQbM0qF7hu24q3teo2hbuw= -golang.org/x/sys v0.33.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= +golang.org/x/sys v0.38.0 h1:3yZWxaJjBmCWXqhN1qh02AkOnCQ1poK6oF+a7xWL6Gc= +golang.org/x/sys v0.38.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= @@ -860,8 +986,8 @@ golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= golang.org/x/term v0.12.0/go.mod h1:owVbMEjm3cBLCHdkQu9b1opXd4ETQWc3BhuQGKgXgvU= golang.org/x/term v0.13.0/go.mod h1:LTmsnFJwVN6bCy1rVCoS+qHT1HhALEFxKncY3WNNh4U= -golang.org/x/term v0.29.0 h1:L6pJp37ocefwRRtYPKSWOWzOtWSxVajvz2ldH/xi3iU= -golang.org/x/term v0.29.0/go.mod h1:6bl4lRlvVuDgSf3179VpIxBF0o10JUpXWOnI7nErv7s= +golang.org/x/term v0.37.0 h1:8EGAD0qCmHYZg6J17DvsMy9/wJ7/D/4pV/wfnld5lTU= +golang.org/x/term v0.37.0/go.mod h1:5pB4lxRNYYVZuTLmy8oR2BH8dflOR+IbTYFD8fi3254= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -874,14 +1000,15 @@ golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= -golang.org/x/text v0.25.0 h1:qVyWApTSYLk/drJRO5mDlNYskwQznZmkpV2c8q9zls4= -golang.org/x/text v0.25.0/go.mod h1:WEdwpYrmk1qmdHvhkSTNPm3app7v4rsT8F2UD6+VHIA= +golang.org/x/text v0.31.0 h1:aC8ghyu4JhP8VojJ2lEHBnochRno1sgL6nEi9WGFGMM= +golang.org/x/text v0.31.0/go.mod h1:tKRAlv61yKIjGGHX/4tP1LTbc13YSec1pxVEWXzfoeM= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.11.0 h1:/bpjEDfN9tkoN/ryeYHnv5hcMlc8ncjMcM4XBk5NWV0= +golang.org/x/time v0.11.0/go.mod h1:CDIdPxbZBQxdj6cxyCIdrNogrJKMJ7pr37NYpMcMDSg= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= @@ -935,8 +1062,12 @@ golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= golang.org/x/tools v0.7.0/go.mod h1:4pg6aUX35JBAogB10C9AtvVL+qowtN4pT3CGSQex14s= golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58= golang.org/x/tools v0.14.0/go.mod h1:uYBEerGOWcJyEORxN+Ek8+TT266gXkNlHdJBwexUsBg= -golang.org/x/tools v0.33.0 h1:4qz2S3zmRxbGIhDIAgjxvFutSvH5EfnsYrRBj0UI0bc= -golang.org/x/tools v0.33.0/go.mod h1:CIJMaWEY88juyUfo7UbgPqbC8rU2OqfAV1h2Qp0oMYI= +golang.org/x/tools v0.38.0 h1:Hx2Xv8hISq8Lm16jvBZ2VQf+RLmbd7wVUsALibYI/IQ= +golang.org/x/tools v0.38.0/go.mod h1:yEsQ/d/YK8cjh0L6rZlY8tgtlKiBNTL14pGDJPJpYQs= +golang.org/x/tools/go/expect v0.1.1-deprecated h1:jpBZDwmgPhXsKZC6WhL20P4b/wmnpsEAGHaNy0n/rJM= +golang.org/x/tools/go/expect v0.1.1-deprecated/go.mod h1:eihoPOH+FgIqa3FpoTwguz/bVUSGBlGQU67vpBeOrBY= +golang.org/x/tools/go/packages/packagestest v0.1.1-deprecated h1:1h2MnaIAIXISqTFKdENegdpAgUXz6NrPEsbIeWaBRvM= +golang.org/x/tools/go/packages/packagestest v0.1.1-deprecated/go.mod h1:RVAQXBGNv1ib0J382/DPCRS/BPnsGebyM1Gj5VSDpG8= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -963,35 +1094,10 @@ google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7 google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= -google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= -google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= -google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA= -google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U= -google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= -google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= -google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto/googleapis/api v0.0.0-20250825161204-c5933d9347a5 h1:BIRfGDEjiHRrk0QKZe3Xv2ieMhtgRGeLcZQ0mIVn4EY= +google.golang.org/genproto/googleapis/api v0.0.0-20250825161204-c5933d9347a5/go.mod h1:j3QtIyytwqGr1JUDtYXwtMXWPKsEa5LtzIFN1Wn5WvE= +google.golang.org/genproto/googleapis/rpc v0.0.0-20250825161204-c5933d9347a5 h1:eaY8u2EuxbRv7c3NiGK0/NedzVsCcV6hDuU5qPX5EGE= +google.golang.org/genproto/googleapis/rpc v0.0.0-20250825161204-c5933d9347a5/go.mod h1:M4/wBTSeyLxupu3W3tJtOgB14jILAS/XWPSSa3TAlJc= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= @@ -1004,6 +1110,8 @@ google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKa google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.75.1 h1:/ODCNEuf9VghjgO3rqLcfg8fiOP0nSluljWFlDxELLI= +google.golang.org/grpc v1.75.1/go.mod h1:JtPAzKiq4v1xcAB2hydNlWI2RnF85XXcV0mhKXr2ecQ= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= @@ -1011,13 +1119,11 @@ google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miE google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.36.6 h1:z1NpPI8ku2WgiWnf+t9wTPsn6eP1L7ksHUlkfLvd9xY= -google.golang.org/protobuf v1.36.6/go.mod h1:jduwjTPXsFjZGTmRluh+L6NjiWu7pchiJ2/5YcXBHnY= +google.golang.org/protobuf v1.36.10 h1:AYd7cD/uASjIL6Q9LiTjz8JLcrh/88q5UObnmY3aOOE= +google.golang.org/protobuf v1.36.10/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -1035,6 +1141,8 @@ gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gotest.tools/v3 v3.5.2 h1:7koQfIKdy+I8UTetycgUqXWSDwpgv193Ka+qRsmBY8Q= +gotest.tools/v3 v3.5.2/go.mod h1:LtdLGcnqToBH83WByAAi/wiwSFCArdFIUV/xxN4pcjA= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= diff --git a/internal/validation/service.go b/internal/validation/service.go index f34dc7f..d61aead 100644 --- a/internal/validation/service.go +++ b/internal/validation/service.go @@ -55,7 +55,6 @@ func (s *Service) ValidateMessage(message string, ocppVersion ocpp.Version) erro // ValidateMessageWithReport validates the message and returns the generated report. // This is used by the CLI when an output file path is requested. func (s *Service) ValidateMessageWithReport(message string, ocppVersion ocpp.Version) (*report.Report, error) { - _, _ = s.logger, ocppVersion validationReport, err := s.parseAndValidate(ocppVersion, []string{message}) if err != nil { return nil, errors.Wrap(err, "failed to parse message") diff --git a/pkg/schema_registry/options.go b/pkg/schema_registry/options.go deleted file mode 100644 index 160003d..0000000 --- a/pkg/schema_registry/options.go +++ /dev/null @@ -1,15 +0,0 @@ -package schema_registry - -type Options struct { - // Whether to allow overwriting existing schemasPerOcppVersion in the registry or not. - overwrite bool -} - -type Option func(*Options) - -// WithOverwrite allows overwriting existing schemasPerOcppVersion in the registry -func WithOverwrite(overwrite bool) Option { - return func(o *Options) { - o.overwrite = overwrite - } -} diff --git a/pkg/schema_registry/options_test.go b/pkg/schema_registry/options_test.go deleted file mode 100644 index d662a70..0000000 --- a/pkg/schema_registry/options_test.go +++ /dev/null @@ -1,50 +0,0 @@ -package schema_registry - -import ( - "testing" - - "github.com/stretchr/testify/suite" -) - -type optionsTestSuite struct { - suite.Suite -} - -func (s *optionsTestSuite) TestOptions() { - tests := []struct { - name string - opts []Option - expected Options - }{ - { - name: "default options", - opts: []Option{}, - expected: Options{ - overwrite: false, - }, - }, - { - name: "WithOverwrite", - opts: []Option{ - WithOverwrite(true), - }, - expected: Options{ - overwrite: true, - }, - }, - } - - for _, tt := range tests { - s.Run(tt.name, func() { - options := &Options{} - for _, opt := range tt.opts { - opt(options) - } - s.Equal(tt.expected, *options) - }) - } -} - -func TestRegistrySchemaOptions(t *testing.T) { - suite.Run(t, new(optionsTestSuite)) -} diff --git a/pkg/schema_registry/registries/factory.go b/pkg/schema_registry/registries/factory.go new file mode 100644 index 0000000..1a4869a --- /dev/null +++ b/pkg/schema_registry/registries/factory.go @@ -0,0 +1 @@ +package registries diff --git a/pkg/schema_registry/registries/file.go b/pkg/schema_registry/registries/file.go new file mode 100644 index 0000000..397f0b8 --- /dev/null +++ b/pkg/schema_registry/registries/file.go @@ -0,0 +1,134 @@ +package registries + +import ( + "encoding/json" + "strings" + "sync" + + "github.com/kaptinlin/jsonschema" + "github.com/pkg/errors" + "go.uber.org/zap" + + "github.com/ChargePi/chargeflow/pkg/ocpp" +) + +const ( + RequestSuffix = "Request" + ResponseSuffix = "Response" +) + +type fileRegistryOptions struct { + // Whether to allow overwriting existing schemasPerOcppVersion in the registry or not. + overwrite bool +} + +type FileRegistryOption func(*fileRegistryOptions) + +// WithOverwrite allows overwriting existing schemasPerOcppVersion in the registry +func WithOverwrite(overwrite bool) FileRegistryOption { + return func(o *fileRegistryOptions) { + o.overwrite = overwrite + } +} + +var compiler = jsonschema.NewCompiler() + +type FileSchemaRegistry struct { + logger *zap.Logger + config fileRegistryOptions + + mu sync.RWMutex // Protects concurrent access to schemasPerOcppVersion map + // Map of schema compilers registered per OCPP version + schemasPerOcppVersion map[ocpp.Version]map[string]*jsonschema.Schema +} + +func NewFileSchemaRegistry(logger *zap.Logger, opts ...FileRegistryOption) *FileSchemaRegistry { + // Default to not overwriting existing schemas + defaultOpts := fileRegistryOptions{ + overwrite: false, + } + + for _, opt := range opts { + opt(&defaultOpts) + } + + registry := &FileSchemaRegistry{ + logger: logger.Named("file_schema_registry"), + schemasPerOcppVersion: make(map[ocpp.Version]map[string]*jsonschema.Schema), + config: defaultOpts, + } + + return registry +} + +// RegisterSchema registers a new schema for a specific OCPP version and action. +// Example: you would register a schema for the action "BootNotification" in OCPP 1.6 like this: +// +// err := schemaRegistry.RegisterSchema(ocpp.V16, "BootNotificationRequest", "{...}") +// +// The rawSchema should be a valid JSON schema in raw format. +// The action is the name of the OCPP action that this schema applies to. Must be suffixed with either "Request" or "Response". +func (fsr *FileSchemaRegistry) RegisterSchema(ocppVersion ocpp.Version, action string, rawSchema json.RawMessage) error { + logger := fsr.logger.With(zap.String("ocppVersion", ocppVersion.String()), zap.String("action", action)) + logger.Debug("Registering schema") + + // Validate the OCPP version + if !ocpp.IsValidProtocolVersion(ocppVersion) { + return errors.Errorf("invalid OCPP version: %s", ocppVersion) + } + + // Must be a valid action name ending with "Request" or "Response" + if !(strings.HasSuffix(action, RequestSuffix) || strings.HasSuffix(action, ResponseSuffix)) { + return errors.Errorf("action must end with 'Request' or 'Response': %s", action) + } + + logger.Debug("Compiling schema") + // Compile the schema using the jsonschema compiler + schema, err := compiler.Compile(rawSchema) + if err != nil { + return errors.Wrap(err, "failed to compile schema") + } + + // Acquire write lock to modify the schemasPerOcppVersion map + fsr.mu.Lock() + defer fsr.mu.Unlock() + + if _, exists := fsr.schemasPerOcppVersion[ocppVersion]; !exists { + fsr.schemasPerOcppVersion[ocppVersion] = make(map[string]*jsonschema.Schema) + } + + if !fsr.config.overwrite { + logger.Debug("Overwriting previous schema") + // Check if the schema already exists for the given action + if _, exists := fsr.schemasPerOcppVersion[ocppVersion][action]; exists { + return errors.Errorf("schema for action %s already exists for OCPP version %s", action, ocppVersion) + } + } + + // Register the schema for the specific action + fsr.schemasPerOcppVersion[ocppVersion][action] = schema + + return nil +} + +// GetSchema retrieves a schema for a specific OCPP version and action. +func (fsr *FileSchemaRegistry) GetSchema(ocppVersion ocpp.Version, action string) (*jsonschema.Schema, bool) { + fsr.logger.Debug("Getting schema", zap.String("ocppVersion", ocppVersion.String()), zap.String("action", action)) + + fsr.mu.RLock() + defer fsr.mu.RUnlock() + + // Check if the OCPP version exists in the registry + if schemas, exists := fsr.schemasPerOcppVersion[ocppVersion]; exists { + // Check if the action exists for the given OCPP version + if schema, exists := schemas[action]; exists { + return schema, true + } + } + + return nil, false +} + +func (fsr *FileSchemaRegistry) Type() string { + return "file" +} diff --git a/pkg/schema_registry/registry_test.go b/pkg/schema_registry/registries/file_test.go similarity index 79% rename from pkg/schema_registry/registry_test.go rename to pkg/schema_registry/registries/file_test.go index 061fba0..ed0611b 100644 --- a/pkg/schema_registry/registry_test.go +++ b/pkg/schema_registry/registries/file_test.go @@ -1,4 +1,4 @@ -package schema_registry +package registries import ( "encoding/json" @@ -11,28 +11,28 @@ import ( "github.com/ChargePi/chargeflow/pkg/ocpp" ) -type registryTestSuite struct { +type fileRegistryTestSuite struct { suite.Suite logger *zap.Logger } -func (s *registryTestSuite) SetupSuite() { +func (s *fileRegistryTestSuite) SetupSuite() { s.logger = zap.L() } -func (s *registryTestSuite) TestRegisterSchema() { +func (s *fileRegistryTestSuite) TestRegisterSchema() { tests := []struct { name string - preconfigure func(registry SchemaRegistry) + preconfigure func(registry *FileSchemaRegistry) ocppVersion ocpp.Version action string schema json.RawMessage - opts []Option + opts []FileRegistryOption expectedErr error }{ { name: "Register schema for OCPP 1.6", - preconfigure: func(registry SchemaRegistry) {}, + preconfigure: func(registry *FileSchemaRegistry) {}, ocppVersion: ocpp.V16, action: "AuthorizeRequest", schema: json.RawMessage(`{ "$schema": "http://json-schema.org/draft-04/schema#", "id": "urn:OCPP:1.6:2019:12:AuthorizeRequest", "title": "AuthorizeRequest", "type": "object", "properties": { "idTag": { "type": "string", "maxLength": 20 } }, "additionalProperties": false, "required": [ "idTag" ]}`), @@ -41,7 +41,7 @@ func (s *registryTestSuite) TestRegisterSchema() { }, { name: "Register schema for OCPP 2.0", - preconfigure: func(registry SchemaRegistry) {}, + preconfigure: func(registry *FileSchemaRegistry) {}, ocppVersion: ocpp.V20, action: "AuthorizeRequest", schema: json.RawMessage(`{ "$schema": "http://json-schema.org/draft-04/schema#", "id": "urn:OCPP:1.6:2019:12:AuthorizeRequest", "title": "AuthorizeRequest", "type": "object", "properties": { "idTag": { "type": "string", "maxLength": 20 } }, "additionalProperties": false, "required": [ "idTag" ]}`), @@ -75,40 +75,40 @@ func (s *registryTestSuite) TestRegisterSchema() { { name: "Schema already registered, overwrite disabled", ocppVersion: ocpp.V16, - preconfigure: func(registry SchemaRegistry) { + preconfigure: func(registry *FileSchemaRegistry) { _ = registry.RegisterSchema(ocpp.V16, "AuthorizeRequest", json.RawMessage(`{ "$schema": "http://json-schema.org/draft-04/schema#", "id": "urn:OCPP:1.6:2019:12:AuthorizeRequest", "title": "AuthorizeRequest", "type": "object", "properties": { "idTag": { "type": "string", "maxLength": 20 } }, "additionalProperties": false, "required": [ "idTag" ]}`)) }, action: "AuthorizeRequest", schema: json.RawMessage(`{ "$schema": "http://json-schema.org/draft-04/schema#", "id": "urn:OCPP:1.6:2019:12:AuthorizeRequest", "title": "AuthorizeRequest", "type": "object", "properties": { "idTag": { "type": "string", "maxLength": 20 } }, "additionalProperties": false, "required": [ "idTag" ]}`), - opts: []Option{WithOverwrite(false)}, + opts: []FileRegistryOption{WithOverwrite(false)}, expectedErr: errors.New("schema for action AuthorizeRequest already exists for OCPP version 1.6"), }, { name: "Schema already registered, overwrite enabled", ocppVersion: ocpp.V16, - preconfigure: func(registry SchemaRegistry) { + preconfigure: func(registry *FileSchemaRegistry) { _ = registry.RegisterSchema(ocpp.V16, "AuthorizeRequest", json.RawMessage(`{ "$schema": "http://json-schema.org/draft-04/schema#", "id": "urn:OCPP:1.6:2019:12:AuthorizeRequest", "title": "AuthorizeRequest", "type": "object", "properties": { "idTag": { "type": "string", "maxLength": 20 } }, "additionalProperties": false, "required": [ "idTag" ]}`)) }, action: "AuthorizeRequest", schema: json.RawMessage(`{ "$schema": "http://json-schema.org/draft-04/schema#", "id": "urn:OCPP:1.6:2019:12:AuthorizeRequest", "title": "AuthorizeRequest", "type": "object", "properties": { "idTag": { "type": "string", "maxLength": 20 } }, "additionalProperties": false, "required": [ "idTag" ]}`), - opts: []Option{WithOverwrite(true)}, + opts: []FileRegistryOption{WithOverwrite(true)}, expectedErr: nil, }, } for _, tt := range tests { s.Run(tt.name, func() { - registry := NewInMemorySchemaRegistry(s.logger) + if tt.opts == nil { + tt.opts = []FileRegistryOption{} + } + + registry := NewFileSchemaRegistry(s.logger, tt.opts...) if tt.preconfigure != nil { tt.preconfigure(registry) } - if tt.opts == nil { - tt.opts = []Option{} - } - - err := registry.RegisterSchema(tt.ocppVersion, tt.action, tt.schema, tt.opts...) + err := registry.RegisterSchema(tt.ocppVersion, tt.action, tt.schema) if tt.expectedErr != nil { s.ErrorContains(err, tt.expectedErr.Error()) } else { @@ -118,17 +118,17 @@ func (s *registryTestSuite) TestRegisterSchema() { } } -func (s *registryTestSuite) TestGetSchema() { +func (s *fileRegistryTestSuite) TestGetSchema() { tests := []struct { name string - preconfigure func(registry SchemaRegistry) + preconfigure func(registry *FileSchemaRegistry) ocppVersion ocpp.Version action string expectedFound bool }{ { name: "Get schema for OCPP 1.6", - preconfigure: func(registry SchemaRegistry) { + preconfigure: func(registry *FileSchemaRegistry) { _ = registry.RegisterSchema(ocpp.V16, "AuthorizeRequest", json.RawMessage(`{ "$schema": "http://json-schema.org/draft-04/schema#", "id": "urn:OCPP:1.6:2019:12:AuthorizeRequest", "title": "AuthorizeRequest", "type": "object", "properties": { "idTag": { "type": "string", "maxLength": 20 } }, "additionalProperties": false, "required": [ "idTag" ]}`)) }, ocppVersion: ocpp.V16, @@ -137,7 +137,7 @@ func (s *registryTestSuite) TestGetSchema() { }, { name: "Get schema for OCPP 2.0", - preconfigure: func(registry SchemaRegistry) { + preconfigure: func(registry *FileSchemaRegistry) { _ = registry.RegisterSchema(ocpp.V20, "AuthorizeRequest", json.RawMessage(`{ "$schema": "http://json-schema.org/draft-04/schema#", "id": "urn:OCPP:1.6:2019:12:AuthorizeRequest", "title": "AuthorizeRequest", "type": "object", "properties": { "idTag": { "type": "string", "maxLength": 20 } }, "additionalProperties": false, "required": [ "idTag" ]}`)) }, ocppVersion: ocpp.V20, @@ -160,7 +160,7 @@ func (s *registryTestSuite) TestGetSchema() { for _, test := range tests { s.Run(test.name, func() { - registry := NewInMemorySchemaRegistry(s.logger) + registry := NewFileSchemaRegistry(s.logger) if test.preconfigure != nil { test.preconfigure(registry) @@ -177,6 +177,41 @@ func (s *registryTestSuite) TestGetSchema() { } } -func TestRegistry(t *testing.T) { - suite.Run(t, new(registryTestSuite)) +func (s *fileRegistryTestSuite) TestOptions() { + tests := []struct { + name string + opts []FileRegistryOption + expected fileRegistryOptions + }{ + { + name: "default options", + opts: []FileRegistryOption{}, + expected: fileRegistryOptions{ + overwrite: false, + }, + }, + { + name: "WithOverwrite", + opts: []FileRegistryOption{ + WithOverwrite(true), + }, + expected: fileRegistryOptions{ + overwrite: true, + }, + }, + } + + for _, tt := range tests { + s.Run(tt.name, func() { + options := &fileRegistryOptions{} + for _, opt := range tt.opts { + opt(options) + } + s.Equal(tt.expected, *options) + }) + } +} + +func TestInMemoryRegistry(t *testing.T) { + suite.Run(t, new(fileRegistryTestSuite)) } diff --git a/pkg/schema_registry/registries/remote.go b/pkg/schema_registry/registries/remote.go new file mode 100644 index 0000000..8b35f2f --- /dev/null +++ b/pkg/schema_registry/registries/remote.go @@ -0,0 +1,519 @@ +package registries + +import ( + "bytes" + "context" + "encoding/base64" + "encoding/json" + "fmt" + "io" + "net/http" + "net/url" + "slices" + "strings" + "sync" + "time" + + "github.com/kaptinlin/jsonschema" + "github.com/pkg/errors" + "go.uber.org/zap" + + "github.com/ChargePi/chargeflow/pkg/ocpp" +) + +type authConfig struct { + authType authType + username string + password string + bearerToken string + apiKey string + apiKeyHeader string + customHeaderName string + customHeaderValue string +} + +type authType int + +const ( + authTypeNone authType = iota + authTypeBasic + authTypeBearer + authTypeAPIKey + authTypeCustomHeader +) + +type remoteRegistryConfig struct { + url string + // Cache settings + cacheRefresh time.Duration + timeout time.Duration + auth authConfig +} + +type RemoteOptions func(*remoteRegistryConfig) + +func WithCacheRefreshDuration(d time.Duration) RemoteOptions { + return func(c *remoteRegistryConfig) { + c.cacheRefresh = d + } +} + +func WithTimeout(d time.Duration) RemoteOptions { + return func(c *remoteRegistryConfig) { + c.timeout = d + } +} + +// WithBasicAuth configures basic authentication with username and password. +func WithBasicAuth(username, password string) RemoteOptions { + return func(c *remoteRegistryConfig) { + c.auth = authConfig{ + authType: authTypeBasic, + username: username, + password: password, + } + } +} + +// WithBearerToken configures bearer token authentication. +func WithBearerToken(token string) RemoteOptions { + return func(c *remoteRegistryConfig) { + c.auth = authConfig{ + authType: authTypeBearer, + bearerToken: token, + } + } +} + +// WithAPIKey configures API key authentication with a custom header name. +// If headerName is empty, it defaults to "X-API-Key". +func WithAPIKey(apiKey, headerName string) RemoteOptions { + if headerName == "" { + headerName = "X-API-Key" + } + return func(c *remoteRegistryConfig) { + c.auth = authConfig{ + authType: authTypeAPIKey, + apiKey: apiKey, + apiKeyHeader: headerName, + } + } +} + +// WithCustomHeader configures a custom header for authentication. +func WithCustomHeader(headerName, headerValue string) RemoteOptions { + return func(c *remoteRegistryConfig) { + c.auth = authConfig{ + authType: authTypeCustomHeader, + customHeaderName: headerName, + customHeaderValue: headerValue, + } + } +} + +type cachedSchema struct { + schema *jsonschema.Schema + cachedAt time.Time +} + +// RemoteSchemaRegistry fetches schemas from a remote schema registry service and caches them locally to reduce latency and network calls. +type RemoteSchemaRegistry struct { + logger *zap.Logger + + config remoteRegistryConfig + httpClient *http.Client + baseURL string + + mu sync.RWMutex // Protects concurrent access to cache + // Map of cached schemas per OCPP version and action + cache map[ocpp.Version]map[string]*cachedSchema + + compiler *jsonschema.Compiler +} + +// applyAuthHeaders adds authentication headers to the request based on the auth config. +func (r *RemoteSchemaRegistry) applyAuthHeaders(req *http.Request) { + switch r.config.auth.authType { + case authTypeBasic: + credentials := base64.StdEncoding.EncodeToString([]byte(r.config.auth.username + ":" + r.config.auth.password)) + req.Header.Set("Authorization", "Basic "+credentials) + case authTypeBearer: + req.Header.Set("Authorization", "Bearer "+r.config.auth.bearerToken) + case authTypeAPIKey: + req.Header.Set(r.config.auth.apiKeyHeader, r.config.auth.apiKey) + case authTypeCustomHeader: + req.Header.Set(r.config.auth.customHeaderName, r.config.auth.customHeaderValue) + } +} + +// logRequestBody logs the request body if present. +func (r *RemoteSchemaRegistry) logRequestBody(method, url string, bodyBytes []byte) { + if len(bodyBytes) == 0 { + r.logger.Info("Executing request", + zap.String("method", method), + zap.String("url", url)) + return + } + + // Try to pretty-print JSON if possible, otherwise use raw string + var bodyStr string + var jsonBody interface{} + if err := json.Unmarshal(bodyBytes, &jsonBody); err == nil { + if prettyJSON, err := json.MarshalIndent(jsonBody, "", " "); err == nil { + bodyStr = string(prettyJSON) + } else { + bodyStr = string(bodyBytes) + } + } else { + bodyStr = string(bodyBytes) + } + + r.logger.Info("Executing request", + zap.String("method", method), + zap.String("url", url), + zap.String("body", bodyStr)) +} + +// doRequest performs an HTTP request with authentication and logging. +func (r *RemoteSchemaRegistry) doRequest(ctx context.Context, method, path string, body []byte) (*http.Response, error) { + fullURL, err := url.JoinPath(r.baseURL, path) + if err != nil { + return nil, errors.Wrapf(err, "failed to build URL for path %s", path) + } + + var bodyReader io.Reader + if body != nil { + bodyReader = bytes.NewReader(body) + // Log request body before sending + if method == http.MethodPost || method == http.MethodPut || method == http.MethodPatch { + r.logRequestBody(method, fullURL, body) + } + } + r.logger.Info("Executing request", + zap.String("method", method), + zap.String("url", fullURL)) + + req, err := http.NewRequestWithContext(ctx, method, fullURL, bodyReader) + if err != nil { + return nil, errors.Wrapf(err, "failed to create request for %s %s", method, path) + } + + // Apply authentication headers + r.applyAuthHeaders(req) + + // Set content type for POST/PUT/PATCH requests + if body != nil { + req.Header.Set("Content-Type", "application/json") + } + req.Header.Set("Accept", "application/vnd.schemaregistry.v1+json, application/vnd.schemaregistry+json, application/json") + + return r.httpClient.Do(req) +} + +func NewRemoteSchemaRegistry(baseURL string, logger *zap.Logger, opts ...RemoteOptions) (*RemoteSchemaRegistry, error) { + // Default configuration + config := remoteRegistryConfig{ + url: baseURL, + cacheRefresh: 10 * time.Minute, + timeout: 5 * time.Second, + auth: authConfig{authType: authTypeNone}, + } + + // Apply options + for _, opt := range opts { + opt(&config) + } + + // Ensure baseURL ends with a slash + if !strings.HasSuffix(baseURL, "/") { + baseURL += "/" + } + + // Create HTTP client with timeout + httpClient := &http.Client{ + Timeout: config.timeout, + } + + return &RemoteSchemaRegistry{ + config: config, + httpClient: httpClient, + baseURL: baseURL, + cache: make(map[ocpp.Version]map[string]*cachedSchema), + compiler: jsonschema.NewCompiler(), + logger: logger, + }, nil +} + +// buildSubjectName constructs a subject name from OCPP version and action. +// Format: ocpp-{version}-{action} +// Example: ocpp-1.6-BootNotificationRequest +func buildSubjectName(ocppVersion ocpp.Version, action string) string { + versionStr := strings.ReplaceAll(ocppVersion.String(), ".", "-") + return fmt.Sprintf("ocpp-%s-%s", versionStr, action) +} + +// getLatestVersion fetches the latest version number for a subject from the remote registry. +func (r *RemoteSchemaRegistry) getLatestVersion(ctx context.Context, subject string) (int, error) { + path := fmt.Sprintf("subjects/%s/versions", url.PathEscape(subject)) + resp, err := r.doRequest(ctx, http.MethodGet, path, nil) + if err != nil { + return 0, errors.Wrapf(err, "failed to get versions for subject %s", subject) + } + defer resp.Body.Close() + + bodyBytes, err := io.ReadAll(resp.Body) + if err != nil { + return 0, errors.Wrapf(err, "failed to read response body for subject %s", subject) + } + + var versions []int + switch resp.StatusCode { + case http.StatusOK: + if err := json.Unmarshal(bodyBytes, &versions); err != nil { + return 0, errors.Wrapf(err, "failed to parse versions response for subject %s", subject) + } + case http.StatusNotFound: + return 0, errors.Errorf("subject %s not found", subject) + case http.StatusInternalServerError: + return 0, errors.Errorf("internal server error when fetching versions for subject %s", subject) + default: + return 0, errors.Errorf("unexpected status code %d when fetching versions for subject %s", resp.StatusCode, subject) + } + + if len(versions) == 0 { + return 0, errors.Errorf("no versions found for subject %s", subject) + } + + // Find the latest version (maximum version number) + return slices.Max(versions), nil +} + +// fetchSchemaFromRemote fetches a schema from the remote registry for a given subject and version. +func (r *RemoteSchemaRegistry) fetchSchemaFromRemote(ctx context.Context, subject string, version int) (json.RawMessage, error) { + versionStr := fmt.Sprintf("%d", version) + path := fmt.Sprintf("subjects/%s/versions/%s/schema", url.PathEscape(subject), url.PathEscape(versionStr)) + resp, err := r.doRequest(ctx, http.MethodGet, path, nil) + if err != nil { + return nil, errors.Wrapf(err, "failed to fetch schema for subject %s version %d", subject, version) + } + defer resp.Body.Close() + + bodyBytes, err := io.ReadAll(resp.Body) + if err != nil { + return nil, errors.Wrapf(err, "failed to read response body for subject %s version %d", subject, version) + } + + var schemaResponse struct { + Schema string `json:"schema"` + } + + switch resp.StatusCode { + case http.StatusOK: + // Try to parse as structured response first + if err := json.Unmarshal(bodyBytes, &schemaResponse); err == nil && schemaResponse.Schema != "" { + return json.RawMessage(schemaResponse.Schema), nil + } + // If structured parsing fails, try as direct string + var schemaStr string + if err := json.Unmarshal(bodyBytes, &schemaStr); err == nil { + return json.RawMessage(schemaStr), nil + } + // If both fail, return raw bytes + return bodyBytes, nil + case http.StatusNotFound: + return nil, errors.Errorf("schema not found for subject %s version %d", subject, version) + case http.StatusUnprocessableEntity: + return nil, errors.Errorf("invalid request for subject %s version %d", subject, version) + case http.StatusInternalServerError: + return nil, errors.Errorf("internal server error when fetching schema for subject %s version %d", subject, version) + default: + return nil, errors.Errorf("unexpected status code %d when fetching schema for subject %s version %d", resp.StatusCode, subject, version) + } +} + +func (r *RemoteSchemaRegistry) RegisterSchema(ocppVersion ocpp.Version, action string, rawSchema json.RawMessage) error { + logger := r.logger.With(zap.String("ocppVersion", ocppVersion.String()), zap.String("action", action)) + logger.Debug("Registering schema to remote registry") + + // Validate the OCPP version + if !ocpp.IsValidProtocolVersion(ocppVersion) { + return errors.Errorf("invalid OCPP version: %s", ocppVersion) + } + + // Must be a valid action name ending with "Request" or "Response" + if !(strings.HasSuffix(action, RequestSuffix) || strings.HasSuffix(action, ResponseSuffix)) { + return errors.Errorf("action must end with 'Request' or 'Response': %s", action) + } + + subject := buildSubjectName(ocppVersion, action) + + ctx, cancel := context.WithTimeout(context.Background(), r.config.timeout) + defer cancel() + + // Validate and normalize the schema before sending + // First, try to compile it to ensure it's valid JSON Schema + _, err := r.compiler.Compile(rawSchema) + if err != nil { + return errors.Wrapf(err, "invalid JSON schema format for subject %s", subject) + } + + // Clear any formatting by unmarshaling and re-marshaling as compact JSON + // This ensures the schema is normalized without any whitespace/formatting or escaping issues + var schemaObj interface{} + if err := json.Unmarshal(rawSchema, &schemaObj); err != nil { + return errors.Wrapf(err, "failed to parse schema JSON for subject %s", subject) + } + + // Marshal back as compact JSON (no formatting/whitespace) + // This produces clean, unescaped JSON bytes + normalizedBytes, err := json.Marshal(schemaObj) + if err != nil { + return errors.Wrapf(err, "failed to normalize schema JSON for subject %s", subject) + } + + // The schema must be sent as a JSON string + // Convert normalized bytes to string - this is raw JSON without any escaping + // json.Marshal will properly escape this string when serializing the request body + schemaStr := string(normalizedBytes) + + logger.Debug("Schema string prepared for registration", + zap.String("subject", subject), + zap.Int("schemaLength", len(schemaStr))) + + // Create the request payload + schemaType := "JSON" + payload := map[string]interface{}{ + "schema": schemaStr, + "schemaType": schemaType, + } + + // Serialize the payload + payloadBytes, err := json.Marshal(payload) + if err != nil { + return errors.Wrapf(err, "failed to serialize request payload for subject %s", subject) + } + + logger.Debug("Normalized schema for registration", + zap.String("subject", subject), + zap.Int("schemaLength", len(schemaStr)), + zap.Int("payloadLength", len(payloadBytes))) + + // Make the request + path := fmt.Sprintf("subjects/%s/versions", url.PathEscape(subject)) + resp, err := r.doRequest(ctx, http.MethodPost, path, payloadBytes) + if err != nil { + return errors.Wrapf(err, "failed to register schema for subject %s", subject) + } + defer resp.Body.Close() + + bodyBytes, err := io.ReadAll(resp.Body) + if err != nil { + return errors.Wrapf(err, "failed to read response body for subject %s", subject) + } + + switch resp.StatusCode { + case http.StatusOK: + // Success - schema registered + case http.StatusConflict: + return errors.Errorf("schema already exists for subject %s", subject) + case http.StatusUnprocessableEntity: + // Try to get more details from the error response + var errorResponse struct { + Message string `json:"message"` + } + if err := json.Unmarshal(bodyBytes, &errorResponse); err == nil && errorResponse.Message != "" { + return errors.Errorf("invalid schema format for subject %s: %s", subject, errorResponse.Message) + } + return errors.Errorf("invalid schema format for subject %s", subject) + case http.StatusInternalServerError: + return errors.Errorf("internal server error when registering schema for subject %s", subject) + default: + return errors.Errorf("unexpected status code %d when registering schema for subject %s", resp.StatusCode, subject) + } + + // Invalidate cache for this schema + r.mu.Lock() + if _, exists := r.cache[ocppVersion]; exists { + delete(r.cache[ocppVersion], action) + } + r.mu.Unlock() + + logger.Debug("Successfully registered schema to remote registry") + return nil +} + +func (r *RemoteSchemaRegistry) GetSchema(ocppVersion ocpp.Version, action string) (*jsonschema.Schema, bool) { + logger := r.logger.With(zap.String("ocppVersion", ocppVersion.String()), zap.String("action", action)) + logger.Debug("Getting schema") + + // Validate the OCPP version + if !ocpp.IsValidProtocolVersion(ocppVersion) { + logger.Warn("Invalid OCPP version") + return nil, false + } + + // Must be a valid action name ending with "Request" or "Response" + if !(strings.HasSuffix(action, RequestSuffix) || strings.HasSuffix(action, ResponseSuffix)) { + logger.Warn("Invalid action name") + return nil, false + } + + // Check cache first + r.mu.RLock() + if schemas, exists := r.cache[ocppVersion]; exists { + if cached, exists := schemas[action]; exists { + // Check if cache is still valid + if time.Since(cached.cachedAt) < r.config.cacheRefresh { + logger.Debug("Returning schema from cache") + r.mu.RUnlock() + return cached.schema, true + } + logger.Debug("Cache expired, fetching from remote") + } + } + r.mu.RUnlock() + + // Cache miss or expired - fetch from remote + subject := buildSubjectName(ocppVersion, action) + ctx, cancel := context.WithTimeout(context.Background(), r.config.timeout) + defer cancel() + + // Get the latest version + latestVersion, err := r.getLatestVersion(ctx, subject) + if err != nil { + logger.Warn("Failed to get latest version", zap.Error(err)) + return nil, false + } + + // Fetch the schema + rawSchema, err := r.fetchSchemaFromRemote(ctx, subject, latestVersion) + if err != nil { + logger.Warn("Failed to fetch schema from remote", zap.Error(err)) + return nil, false + } + + // Compile the schema + schema, err := r.compiler.Compile(rawSchema) + if err != nil { + logger.Warn("Failed to compile schema", zap.Error(err)) + return nil, false + } + + // Update cache + r.mu.Lock() + if _, exists := r.cache[ocppVersion]; !exists { + r.cache[ocppVersion] = make(map[string]*cachedSchema) + } + r.cache[ocppVersion][action] = &cachedSchema{ + schema: schema, + cachedAt: time.Now(), + } + r.mu.Unlock() + + logger.Debug("Successfully fetched and cached schema from remote") + return schema, true +} + +func (r *RemoteSchemaRegistry) Type() string { + return "remote" +} diff --git a/pkg/schema_registry/registries/remote_test.go b/pkg/schema_registry/registries/remote_test.go new file mode 100644 index 0000000..92944dd --- /dev/null +++ b/pkg/schema_registry/registries/remote_test.go @@ -0,0 +1,482 @@ +package registries + +import ( + "context" + "encoding/base64" + "encoding/json" + "net/http" + "testing" + "time" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/suite" + "github.com/testcontainers/testcontainers-go" + "github.com/testcontainers/testcontainers-go/modules/redpanda" + "go.uber.org/zap" + + "github.com/ChargePi/chargeflow/pkg/ocpp" +) + +type remoteRegistryIntegrationTestSuite struct { + suite.Suite + redpandaContainer testcontainers.Container + registryURL string + logger *zap.Logger +} + +func (s *remoteRegistryIntegrationTestSuite) SetupSuite() { + ctx := context.Background() + // s.logger = zaptest.NewLogger(s.T()) + s.logger, _ = zap.NewDevelopment() + + // Start Redpanda container with Schema Registry enabled + redpandaContainer, err := redpanda.Run(ctx, "docker.redpanda.com/redpandadata/redpanda:v23.1.7") + s.Require().NoError(err, "Failed to start Redpanda container") + + s.redpandaContainer = redpandaContainer + + // Get the schema registry URL + schemaRegistryURL, err := redpandaContainer.SchemaRegistryAddress(ctx) + s.Require().NoError(err, "Failed to get schema registry address") + + s.registryURL = schemaRegistryURL +} + +func (s *remoteRegistryIntegrationTestSuite) TearDownSuite() { + if s.redpandaContainer != nil { + ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second) + defer cancel() + err := s.redpandaContainer.Terminate(ctx) + s.NoError(err, "Failed to terminate Redpanda container") + } +} + +func (s *remoteRegistryIntegrationTestSuite) TestRegisterSchema() { + registry, err := NewRemoteSchemaRegistry( + s.registryURL, + s.logger, + WithTimeout(10*time.Second), + ) + s.Require().NoError(err) + + validSchema := json.RawMessage(`{ + "$schema": "http://json-schema.org/draft-04/schema#", + "id": "urn:OCPP:1.6:2019:12:BootNotificationRequest", + "title": "BootNotificationRequest", + "type": "object", + "properties": { + "chargePointVendor": { + "type": "string", + "maxLength": 20 + }, + "chargePointModel": { + "type": "string", + "maxLength": 20 + } + }, + "additionalProperties": false, + "required": ["chargePointVendor", "chargePointModel"] + }`) + + tests := []struct { + name string + ocppVersion ocpp.Version + action string + schema json.RawMessage + expectError bool + }{ + { + name: "Register valid schema for OCPP 1.6", + ocppVersion: ocpp.V16, + action: "BootNotificationRequest", + schema: validSchema, + expectError: false, + }, + { + name: "Register valid schema for OCPP 2.0", + ocppVersion: ocpp.V20, + action: "BootNotificationRequest", + schema: validSchema, + expectError: false, + }, + { + name: "Register schema with Response suffix", + ocppVersion: ocpp.V16, + action: "BootNotificationResponse", + schema: validSchema, + expectError: false, + }, + { + name: "Invalid OCPP version", + ocppVersion: ocpp.Version("unsupported"), + action: "BootNotificationRequest", + schema: validSchema, + expectError: true, + }, + { + name: "Invalid action suffix", + ocppVersion: ocpp.V16, + action: "BootNotification", + schema: validSchema, + expectError: true, + }, + } + + for _, tt := range tests { + s.Run(tt.name, func() { + err := registry.RegisterSchema(tt.ocppVersion, tt.action, tt.schema) + if tt.expectError { + s.Error(err) + } else { + s.NoError(err) + } + }) + } +} + +func (s *remoteRegistryIntegrationTestSuite) TestGetSchema() { + registry, err := NewRemoteSchemaRegistry( + s.registryURL, + s.logger, + WithTimeout(10*time.Second), + ) + s.Require().NoError(err) + + validSchema := json.RawMessage(`{ + "$schema": "http://json-schema.org/draft-04/schema#", + "id": "urn:OCPP:1.6:2019:12:AuthorizeRequest", + "title": "AuthorizeRequest", + "type": "object", + "properties": { + "idTag": { + "type": "string", + "maxLength": 20 + } + }, + "additionalProperties": false, + "required": ["idTag"] + }`) + + // First register a schema + err = registry.RegisterSchema(ocpp.V16, "AuthorizeRequest", validSchema) + s.Require().NoError(err) + + // Test getting the schema + schema, found := registry.GetSchema(ocpp.V16, "AuthorizeRequest") + s.True(found, "Schema should be found") + s.NotNil(schema, "Schema should not be nil") + + // Test getting non-existent schema + _, found = registry.GetSchema(ocpp.V16, "NonExistentRequest") + s.False(found, "Non-existent schema should not be found") + + // Test getting schema for non-existent OCPP version + _, found = registry.GetSchema(ocpp.V20, "AuthorizeRequest") + s.False(found, "Schema for different OCPP version should not be found") +} + +func (s *remoteRegistryIntegrationTestSuite) TestGetSchema_Caching() { + // Use a short cache refresh duration for testing + cacheRefresh := 2 * time.Second + registry, err := NewRemoteSchemaRegistry( + s.registryURL, + s.logger, + WithTimeout(10*time.Second), + WithCacheRefreshDuration(cacheRefresh), + ) + s.Require().NoError(err) + + validSchema := json.RawMessage(`{ + "$schema": "http://json-schema.org/draft-04/schema#", + "id": "urn:OCPP:1.6:2019:12:StatusNotificationRequest", + "title": "StatusNotificationRequest", + "type": "object", + "properties": { + "connectorId": { + "type": "integer" + }, + "status": { + "type": "string", + "enum": ["Available", "Preparing", "Charging", "SuspendedEVSE", "SuspendedEV", "Finishing", "Reserved", "Unavailable", "Faulted"] + } + }, + "additionalProperties": false, + "required": ["connectorId", "status"] + }`) + + // Register the schema + err = registry.RegisterSchema(ocpp.V16, "StatusNotificationRequest", validSchema) + s.Require().NoError(err) + + // First fetch - should fetch from remote + schema1, found := registry.GetSchema(ocpp.V16, "StatusNotificationRequest") + s.True(found) + s.NotNil(schema1) + + // Second fetch immediately - should use cache + schema2, found := registry.GetSchema(ocpp.V16, "StatusNotificationRequest") + s.True(found) + s.NotNil(schema2) + s.Equal(schema1, schema2, "Should return the same schema instance from cache") + + // Wait for cache to expire + time.Sleep(cacheRefresh + 500*time.Millisecond) + + // Third fetch after cache expiry - should fetch from remote again + schema3, found := registry.GetSchema(ocpp.V16, "StatusNotificationRequest") + s.True(found) + s.NotNil(schema3) + // Note: schema3 will be a new instance, but should validate the same data +} + +func (s *remoteRegistryIntegrationTestSuite) TestGetSchema_MultipleVersions() { + registry, err := NewRemoteSchemaRegistry( + s.registryURL, + s.logger, + WithTimeout(10*time.Second), + ) + s.Require().NoError(err) + + schemaV1 := json.RawMessage(`{ + "$schema": "http://json-schema.org/draft-04/schema#", + "id": "urn:OCPP:1.6:2019:12:HeartbeatRequest", + "title": "HeartbeatRequest", + "type": "object", + "properties": {}, + "additionalProperties": false + }`) + + schemaV2 := json.RawMessage(`{ + "$schema": "http://json-schema.org/draft-04/schema#", + "id": "urn:OCPP:1.6:2019:12:HeartbeatRequest", + "title": "HeartbeatRequest", + "type": "object", + "properties": { + "timestamp": { + "type": "string", + "format": "date-time" + } + }, + "additionalProperties": false + }`) + + // Register first version + err = registry.RegisterSchema(ocpp.V16, "HeartbeatRequest", schemaV1) + s.Require().NoError(err) + + // Register second version (should create a new version in the registry) + err = registry.RegisterSchema(ocpp.V16, "HeartbeatRequest", schemaV2) + s.Require().NoError(err) + + // GetSchema should return the latest version + schema, found := registry.GetSchema(ocpp.V16, "HeartbeatRequest") + s.True(found) + s.NotNil(schema) +} + +func (s *remoteRegistryIntegrationTestSuite) TestGetSchema_InvalidInputs() { + registry, err := NewRemoteSchemaRegistry( + s.registryURL, + s.logger, + WithTimeout(10*time.Second), + ) + s.Require().NoError(err) + + tests := []struct { + name string + ocppVersion ocpp.Version + action string + }{ + { + name: "Invalid OCPP version", + ocppVersion: ocpp.Version("invalid"), + action: "BootNotificationRequest", + }, + { + name: "Invalid action suffix", + ocppVersion: ocpp.V16, + action: "InvalidAction", + }, + } + + for _, tt := range tests { + s.Run(tt.name, func() { + schema, found := registry.GetSchema(tt.ocppVersion, tt.action) + s.False(found, "Should not find schema for invalid input") + s.Nil(schema, "Schema should be nil for invalid input") + }) + } +} + +func (s *remoteRegistryIntegrationTestSuite) TestGetSchema_DifferentOCPPVersions() { + registry, err := NewRemoteSchemaRegistry( + s.registryURL, + s.logger, + WithTimeout(10*time.Second), + ) + s.Require().NoError(err) + + schema16 := json.RawMessage(`{ + "$schema": "http://json-schema.org/draft-04/schema#", + "id": "urn:OCPP:1.6:2019:12:StartTransactionRequest", + "title": "StartTransactionRequest", + "type": "object", + "properties": { + "connectorId": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": ["connectorId"] + }`) + + schema20 := json.RawMessage(`{ + "$schema": "http://json-schema.org/draft-04/schema#", + "id": "urn:OCPP:2.0:2019:12:StartTransactionRequest", + "title": "StartTransactionRequest", + "type": "object", + "properties": { + "evseId": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": ["evseId"] + }`) + + // Register schemas for different OCPP versions + err = registry.RegisterSchema(ocpp.V16, "StartTransactionRequest", schema16) + s.Require().NoError(err) + + err = registry.RegisterSchema(ocpp.V20, "StartTransactionRequest", schema20) + s.Require().NoError(err) + + // Verify both schemas can be retrieved independently + schema1, found1 := registry.GetSchema(ocpp.V16, "StartTransactionRequest") + s.True(found1, "OCPP 1.6 schema should be found") + s.NotNil(schema1) + + schema2, found2 := registry.GetSchema(ocpp.V20, "StartTransactionRequest") + s.True(found2, "OCPP 2.0 schema should be found") + s.NotNil(schema2) + + // Schemas should be different + s.NotEqual(schema1, schema2, "Schemas for different OCPP versions should be different") +} + +func (s *remoteRegistryIntegrationTestSuite) TestGetSchema_ResponseSuffix() { + registry, err := NewRemoteSchemaRegistry( + s.registryURL, + s.logger, + WithTimeout(10*time.Second), + ) + s.Require().NoError(err) + + responseSchema := json.RawMessage(`{ + "$schema": "http://json-schema.org/draft-04/schema#", + "id": "urn:OCPP:1.6:2019:12:BootNotificationResponse", + "title": "BootNotificationResponse", + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": ["Accepted", "Pending", "Rejected"] + }, + "currentTime": { + "type": "string", + "format": "date-time" + }, + "interval": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": ["status", "currentTime"] + }`) + + // Register response schema + err = registry.RegisterSchema(ocpp.V16, "BootNotificationResponse", responseSchema) + s.Require().NoError(err) + + // Retrieve response schema + schema, found := registry.GetSchema(ocpp.V16, "BootNotificationResponse") + s.True(found, "Response schema should be found") + s.NotNil(schema, "Response schema should not be nil") +} + +func TestRemoteRegistryIntegration(t *testing.T) { + if testing.Short() { + t.Skip("Skipping integration test in short mode") + } + suite.Run(t, new(remoteRegistryIntegrationTestSuite)) +} + +func TestAuthOptions(t *testing.T) { + tests := []struct { + name string + opts []RemoteOptions + expectedHeader string + expectedValue string + }{ + { + name: "Basic Auth", + opts: []RemoteOptions{ + WithBasicAuth("testuser", "testpass"), + }, + expectedHeader: "Authorization", + expectedValue: "Basic " + base64.StdEncoding.EncodeToString([]byte("testuser:testpass")), + }, + { + name: "Bearer Token", + opts: []RemoteOptions{ + WithBearerToken("test-token-123"), + }, + expectedHeader: "Authorization", + expectedValue: "Bearer test-token-123", + }, + { + name: "API Key with default header", + opts: []RemoteOptions{ + WithAPIKey("test-api-key", ""), + }, + expectedHeader: "X-API-Key", + expectedValue: "test-api-key", + }, + { + name: "API Key with custom header", + opts: []RemoteOptions{ + WithAPIKey("test-api-key", "X-Custom-API-Key"), + }, + expectedHeader: "X-Custom-API-Key", + expectedValue: "test-api-key", + }, + { + name: "Custom Header", + opts: []RemoteOptions{ + WithCustomHeader("X-Custom-Auth", "custom-value"), + }, + expectedHeader: "X-Custom-Auth", + expectedValue: "custom-value", + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + // Create a config and apply options + config := remoteRegistryConfig{ + auth: authConfig{authType: authTypeNone}, + } + for _, opt := range tt.opts { + opt(&config) + } + + // Create a test request + req, err := http.NewRequest("GET", "http://example.com/test", nil) + assert.NoError(t, err) + + // Verify the header was set correctly + actualValue := req.Header.Get(tt.expectedHeader) + assert.Equal(t, tt.expectedValue, actualValue, "Header value should match expected value") + }) + } +} diff --git a/pkg/schema_registry/registry.go b/pkg/schema_registry/registry.go index 2f576e6..e41d3b8 100644 --- a/pkg/schema_registry/registry.go +++ b/pkg/schema_registry/registry.go @@ -2,110 +2,14 @@ package schema_registry import ( "encoding/json" - "strings" - "sync" "github.com/kaptinlin/jsonschema" - "github.com/pkg/errors" - "go.uber.org/zap" "github.com/ChargePi/chargeflow/pkg/ocpp" ) -var compiler = jsonschema.NewCompiler() - type SchemaRegistry interface { - RegisterSchema(ocppVersion ocpp.Version, action string, rawSchema json.RawMessage, opts ...Option) error + RegisterSchema(ocppVersion ocpp.Version, action string, rawSchema json.RawMessage) error GetSchema(ocppVersion ocpp.Version, action string) (*jsonschema.Schema, bool) -} - -type InMemorySchemaRegistry struct { - logger *zap.Logger - mu sync.RWMutex // Protects concurrent access to schemasPerOcppVersion map - - // Map of schema compilers registered per OCPP version - schemasPerOcppVersion map[ocpp.Version]map[string]*jsonschema.Schema -} - -func NewInMemorySchemaRegistry(logger *zap.Logger) *InMemorySchemaRegistry { - return &InMemorySchemaRegistry{ - logger: logger.Named("schema_registry"), - schemasPerOcppVersion: make(map[ocpp.Version]map[string]*jsonschema.Schema), - } -} - -// RegisterSchema registers a new schema for a specific OCPP version and action. -// Example: you would register a schema for the action "BootNotification" in OCPP 1.6 like this: -// -// err := schemaRegistry.RegisterSchema(ocpp.V16, "BootNotificationRequest", "{...}") -// -// The rawSchema should be a valid JSON schema in raw format. -// The action is the name of the OCPP action that this schema applies to. Must be suffixed with either "Request" or "Response". -func (fsr *InMemorySchemaRegistry) RegisterSchema(ocppVersion ocpp.Version, action string, rawSchema json.RawMessage, opts ...Option) error { - logger := fsr.logger.With(zap.String("ocppVersion", ocppVersion.String()), zap.String("action", action)) - logger.Debug("Registering schema") - - // Validate the OCPP version - if !ocpp.IsValidProtocolVersion(ocppVersion) { - return errors.Errorf("invalid OCPP version: %s", ocppVersion) - } - - // Must be a valid action name ending with "Request" or "Response" - if !(strings.HasSuffix(action, "Request") || strings.HasSuffix(action, "Response")) { - return errors.Errorf("action must end with 'Request' or 'Response': %s", action) - } - - logger.Debug("Compiling schema") - // Compile the schema using the jsonschema compiler - schema, err := compiler.Compile(rawSchema) - if err != nil { - return errors.Wrap(err, "failed to compile schema") - } - - // Default to not overwriting existing schemas - defaultOpts := &Options{ - overwrite: false, - } - for _, opt := range opts { - opt(defaultOpts) - } - - // Acquire write lock to modify the schemasPerOcppVersion map - fsr.mu.Lock() - defer fsr.mu.Unlock() - - if _, exists := fsr.schemasPerOcppVersion[ocppVersion]; !exists { - fsr.schemasPerOcppVersion[ocppVersion] = make(map[string]*jsonschema.Schema) - } - - if !defaultOpts.overwrite { - logger.Debug("Overwriting previous schema") - // Check if the schema already exists for the given action - if _, exists := fsr.schemasPerOcppVersion[ocppVersion][action]; exists { - return errors.Errorf("schema for action %s already exists for OCPP version %s", action, ocppVersion) - } - } - - // Register the schema for the specific action - fsr.schemasPerOcppVersion[ocppVersion][action] = schema - - return nil -} - -// GetSchema retrieves a schema for a specific OCPP version and action. -func (fsr *InMemorySchemaRegistry) GetSchema(ocppVersion ocpp.Version, action string) (*jsonschema.Schema, bool) { - fsr.logger.Debug("Getting schema", zap.String("ocppVersion", ocppVersion.String()), zap.String("action", action)) - - fsr.mu.RLock() - defer fsr.mu.RUnlock() - - // Check if the OCPP version exists in the registry - if schemas, exists := fsr.schemasPerOcppVersion[ocppVersion]; exists { - // Check if the action exists for the given OCPP version - if schema, exists := schemas[action]; exists { - return schema, true - } - } - - return nil, false + Type() string } diff --git a/pkg/validator/result.go b/pkg/validator/result.go index 1f0d74d..ee8521c 100644 --- a/pkg/validator/result.go +++ b/pkg/validator/result.go @@ -20,10 +20,7 @@ func NewValidationResult() *ValidationResult { } func (v *ValidationResult) AddError(err string) { - if v.isValid != false { - v.isValid = false - } - + v.isValid = false v.errors = append(v.errors, err) } diff --git a/pkg/validator/validator.go b/pkg/validator/validator.go index d6375c1..f2fc8b8 100644 --- a/pkg/validator/validator.go +++ b/pkg/validator/validator.go @@ -130,6 +130,13 @@ func (v *Validator) validatePayload(ocppVersion ocpp.Version, payload interface{ return nil } + switch v.registry.Type() { + case "remote": + // For remote, we can validate the payload against the schema directly + case "local": + + } + // Get the schema for the action and OCPP version schema, found := v.registry.GetSchema(ocppVersion, action) if !found {