From b725bdea6ee766eec1227ba9edd1769fc9a7aba2 Mon Sep 17 00:00:00 2001 From: Julien Clarysse Date: Tue, 22 Sep 2026 12:20:57 +0200 Subject: [PATCH] feat(byocon): add KafkaConnectCustomPlugin endpoints --- client_generated.go | 4 + config.yaml | 16 + .../kafkaconnectcustomplugin.go | 537 ++++++++++++++++++ 3 files changed, 557 insertions(+) create mode 100644 handler/kafkaconnectcustomplugin/kafkaconnectcustomplugin.go diff --git a/client_generated.go b/client_generated.go index 4649e51..70e6253 100644 --- a/client_generated.go +++ b/client_generated.go @@ -26,6 +26,7 @@ import ( flinkjob "github.com/aiven/go-client-codegen/handler/flinkjob" kafka "github.com/aiven/go-client-codegen/handler/kafka" kafkaconnect "github.com/aiven/go-client-codegen/handler/kafkaconnect" + kafkaconnectcustomplugin "github.com/aiven/go-client-codegen/handler/kafkaconnectcustomplugin" kafkamirrormaker "github.com/aiven/go-client-codegen/handler/kafkamirrormaker" kafkaschemaregistry "github.com/aiven/go-client-codegen/handler/kafkaschemaregistry" kafkatopic "github.com/aiven/go-client-codegen/handler/kafkatopic" @@ -76,6 +77,7 @@ func newClient(doer doer) Client { FlinkJarApplicationHandler: flinkjarapplication.NewHandler(doer), FlinkJarApplicationVersionHandler: flinkjarapplicationversion.NewHandler(doer), FlinkJobHandler: flinkjob.NewHandler(doer), + KafkaConnectCustomPluginHandler: kafkaconnectcustomplugin.NewHandler(doer), KafkaConnectHandler: kafkaconnect.NewHandler(doer), KafkaHandler: kafka.NewHandler(doer), KafkaMirrorMakerHandler: kafkamirrormaker.NewHandler(doer), @@ -125,6 +127,7 @@ type client struct { flinkjob.FlinkJobHandler kafka.KafkaHandler kafkaconnect.KafkaConnectHandler + kafkaconnectcustomplugin.KafkaConnectCustomPluginHandler kafkamirrormaker.KafkaMirrorMakerHandler kafkaschemaregistry.KafkaSchemaRegistryHandler kafkatopic.KafkaTopicHandler @@ -170,6 +173,7 @@ type Client interface { flinkjob.Handler kafka.Handler kafkaconnect.Handler + kafkaconnectcustomplugin.Handler kafkamirrormaker.Handler kafkaschemaregistry.Handler kafkatopic.Handler diff --git a/config.yaml b/config.yaml index ee6ce01..a1c6510 100644 --- a/config.yaml +++ b/config.yaml @@ -166,6 +166,22 @@ KafkaConnect: - ServiceKafkaConnectRestartConnector - ServiceKafkaConnectRestartConnectorTask - ServiceKafkaConnectResumeConnector +KafkaConnectCustomPlugin: + - KafkaConnectCustomPluginClassGet + - KafkaConnectCustomPluginClassList + - KafkaConnectCustomPluginClassListByName + - KafkaConnectCustomPluginClassUpdate + - KafkaConnectCustomPluginDelete + - KafkaConnectCustomPluginFileClassList + - KafkaConnectCustomPluginFileCreate + - KafkaConnectCustomPluginFileDelete + - KafkaConnectCustomPluginFileGet + - KafkaConnectCustomPluginFileList + - KafkaConnectCustomPluginFileListByName + - KafkaConnectCustomPluginFileUpdate + - KafkaConnectCustomPluginGet + - KafkaConnectCustomPluginList + - KafkaConnectCustomPluginUpdate KafkaMirrorMaker: - ServiceKafkaMirrorMakerCreateReplicationFlow - ServiceKafkaMirrorMakerDeleteReplicationFlow diff --git a/handler/kafkaconnectcustomplugin/kafkaconnectcustomplugin.go b/handler/kafkaconnectcustomplugin/kafkaconnectcustomplugin.go new file mode 100644 index 0000000..f59e45e --- /dev/null +++ b/handler/kafkaconnectcustomplugin/kafkaconnectcustomplugin.go @@ -0,0 +1,537 @@ +// Code generated by Aiven. DO NOT EDIT. + +package kafkaconnectcustomplugin + +import ( + "context" + "encoding/json" + "fmt" + "net/url" + "time" +) + +type Handler interface { + // KafkaConnectCustomPluginClassGet get a single plugin class by fully-qualified class name + // GET /v1/organization/{organization_id}/kafka-connect/custom-plugin-classes/{plugin_class_name} + // https://api.aiven.io/doc/#tag/Kafka_Connect_Custom_Plugins/operation/KafkaConnectCustomPluginClassGet + KafkaConnectCustomPluginClassGet(ctx context.Context, organizationId string, pluginClassName string) (*KafkaConnectCustomPluginClassGetOut, error) + + // KafkaConnectCustomPluginClassList list all plugin classes for the organization + // GET /v1/organization/{organization_id}/kafka-connect/custom-plugin-classes + // https://api.aiven.io/doc/#tag/Kafka_Connect_Custom_Plugins/operation/KafkaConnectCustomPluginClassList + KafkaConnectCustomPluginClassList(ctx context.Context, organizationId string) ([]PluginClasseOut, error) + + // KafkaConnectCustomPluginClassListByName list connector classes for a plugin, deduplicated by retaining the class from the latest non-deleted file version (by semver) + // GET /v1/organization/{organization_id}/kafka-connect/custom-plugins/{plugin_name}/classes + // https://api.aiven.io/doc/#tag/Kafka_Connect_Custom_Plugins/operation/KafkaConnectCustomPluginClassListByName + KafkaConnectCustomPluginClassListByName(ctx context.Context, organizationId string, pluginName string) ([]PluginClasseOut, error) + + // KafkaConnectCustomPluginClassUpdate update user-editable metadata of a plugin class + // PUT /v1/organization/{organization_id}/kafka-connect/custom-plugin-classes/{plugin_class_name} + // https://api.aiven.io/doc/#tag/Kafka_Connect_Custom_Plugins/operation/KafkaConnectCustomPluginClassUpdate + KafkaConnectCustomPluginClassUpdate(ctx context.Context, organizationId string, pluginClassName string, in *KafkaConnectCustomPluginClassUpdateIn) (*KafkaConnectCustomPluginClassUpdateOut, error) + + // KafkaConnectCustomPluginDelete soft-delete a custom plugin and all its non-deleted file versions + // DELETE /v1/organization/{organization_id}/kafka-connect/custom-plugins/{plugin_name} + // https://api.aiven.io/doc/#tag/Kafka_Connect_Custom_Plugins/operation/KafkaConnectCustomPluginDelete + KafkaConnectCustomPluginDelete(ctx context.Context, organizationId string, pluginName string) error + + // KafkaConnectCustomPluginFileClassList list all plugin classes discovered for a custom plugin file + // GET /v1/organization/{organization_id}/kafka-connect/custom-plugin-files/{plugin_file_id}/classes + // https://api.aiven.io/doc/#tag/Kafka_Connect_Custom_Plugins/operation/KafkaConnectCustomPluginFileClassList + KafkaConnectCustomPluginFileClassList(ctx context.Context, organizationId string, pluginFileId string) ([]PluginClasseOut, error) + + // KafkaConnectCustomPluginFileCreate initiate a custom plugin file upload + // POST /v1/organization/{organization_id}/kafka-connect/custom-plugin-files + // https://api.aiven.io/doc/#tag/Kafka_Connect_Custom_Plugins/operation/KafkaConnectCustomPluginFileCreate + KafkaConnectCustomPluginFileCreate(ctx context.Context, organizationId string, in *KafkaConnectCustomPluginFileCreateIn) (*KafkaConnectCustomPluginFileCreateOut, error) + + // KafkaConnectCustomPluginFileDelete soft-delete a custom plugin file and its solely-associated plugin classes + // DELETE /v1/organization/{organization_id}/kafka-connect/custom-plugin-files/{plugin_file_id} + // https://api.aiven.io/doc/#tag/Kafka_Connect_Custom_Plugins/operation/KafkaConnectCustomPluginFileDelete + KafkaConnectCustomPluginFileDelete(ctx context.Context, organizationId string, pluginFileId string) error + + // KafkaConnectCustomPluginFileGet get a single custom plugin file with its discovered plugin classes + // GET /v1/organization/{organization_id}/kafka-connect/custom-plugin-files/{plugin_file_id} + // https://api.aiven.io/doc/#tag/Kafka_Connect_Custom_Plugins/operation/KafkaConnectCustomPluginFileGet + KafkaConnectCustomPluginFileGet(ctx context.Context, organizationId string, pluginFileId string) (*KafkaConnectCustomPluginFileGetOut, error) + + // KafkaConnectCustomPluginFileList list all non-deleted custom plugin files for the organization + // GET /v1/organization/{organization_id}/kafka-connect/custom-plugin-files + // https://api.aiven.io/doc/#tag/Kafka_Connect_Custom_Plugins/operation/KafkaConnectCustomPluginFileList + KafkaConnectCustomPluginFileList(ctx context.Context, organizationId string) ([]PluginFileOut, error) + + // KafkaConnectCustomPluginFileListByName list all non-deleted file versions for a given plugin name + // GET /v1/organization/{organization_id}/kafka-connect/custom-plugins/{plugin_name}/files + // https://api.aiven.io/doc/#tag/Kafka_Connect_Custom_Plugins/operation/KafkaConnectCustomPluginFileListByName + KafkaConnectCustomPluginFileListByName(ctx context.Context, organizationId string, pluginName string) ([]PluginFileOut, error) + + // KafkaConnectCustomPluginFileUpdate update user-editable metadata of a custom plugin file + // PUT /v1/organization/{organization_id}/kafka-connect/custom-plugin-files/{plugin_file_id} + // https://api.aiven.io/doc/#tag/Kafka_Connect_Custom_Plugins/operation/KafkaConnectCustomPluginFileUpdate + KafkaConnectCustomPluginFileUpdate(ctx context.Context, organizationId string, pluginFileId string, in *KafkaConnectCustomPluginFileUpdateIn) (*KafkaConnectCustomPluginFileUpdateOut, error) + + // KafkaConnectCustomPluginGet get a single custom plugin by plugin name + // GET /v1/organization/{organization_id}/kafka-connect/custom-plugins/{plugin_name} + // https://api.aiven.io/doc/#tag/Kafka_Connect_Custom_Plugins/operation/KafkaConnectCustomPluginGet + KafkaConnectCustomPluginGet(ctx context.Context, organizationId string, pluginName string) (*KafkaConnectCustomPluginGetOut, error) + + // KafkaConnectCustomPluginList list all non-deleted custom plugins for the organization + // GET /v1/organization/{organization_id}/kafka-connect/custom-plugins + // https://api.aiven.io/doc/#tag/Kafka_Connect_Custom_Plugins/operation/KafkaConnectCustomPluginList + KafkaConnectCustomPluginList(ctx context.Context, organizationId string) ([]PluginOut, error) + + // KafkaConnectCustomPluginUpdate update user-editable metadata of a custom plugin + // PUT /v1/organization/{organization_id}/kafka-connect/custom-plugins/{plugin_name} + // https://api.aiven.io/doc/#tag/Kafka_Connect_Custom_Plugins/operation/KafkaConnectCustomPluginUpdate + KafkaConnectCustomPluginUpdate(ctx context.Context, organizationId string, pluginName string, in *KafkaConnectCustomPluginUpdateIn) (*KafkaConnectCustomPluginUpdateOut, error) +} + +// doer http client +type doer interface { + Do(ctx context.Context, operationID, method, path string, in any, query ...[2]string) ([]byte, error) +} + +func NewHandler(doer doer) KafkaConnectCustomPluginHandler { + return KafkaConnectCustomPluginHandler{doer} +} + +type KafkaConnectCustomPluginHandler struct { + doer doer +} + +func (h *KafkaConnectCustomPluginHandler) KafkaConnectCustomPluginClassGet(ctx context.Context, organizationId string, pluginClassName string) (*KafkaConnectCustomPluginClassGetOut, error) { + path := fmt.Sprintf("/v1/organization/%s/kafka-connect/custom-plugin-classes/%s", url.PathEscape(organizationId), url.PathEscape(pluginClassName)) + b, err := h.doer.Do(ctx, "KafkaConnectCustomPluginClassGet", "GET", path, nil) + if err != nil { + return nil, err + } + out := new(KafkaConnectCustomPluginClassGetOut) + err = json.Unmarshal(b, out) + if err != nil { + return nil, err + } + return out, nil +} +func (h *KafkaConnectCustomPluginHandler) KafkaConnectCustomPluginClassList(ctx context.Context, organizationId string) ([]PluginClasseOut, error) { + path := fmt.Sprintf("/v1/organization/%s/kafka-connect/custom-plugin-classes", url.PathEscape(organizationId)) + b, err := h.doer.Do(ctx, "KafkaConnectCustomPluginClassList", "GET", path, nil) + if err != nil { + return nil, err + } + out := new(kafkaConnectCustomPluginClassListOut) + err = json.Unmarshal(b, out) + if err != nil { + return nil, err + } + return out.PluginClasses, nil +} +func (h *KafkaConnectCustomPluginHandler) KafkaConnectCustomPluginClassListByName(ctx context.Context, organizationId string, pluginName string) ([]PluginClasseOut, error) { + path := fmt.Sprintf("/v1/organization/%s/kafka-connect/custom-plugins/%s/classes", url.PathEscape(organizationId), url.PathEscape(pluginName)) + b, err := h.doer.Do(ctx, "KafkaConnectCustomPluginClassListByName", "GET", path, nil) + if err != nil { + return nil, err + } + out := new(kafkaConnectCustomPluginClassListByNameOut) + err = json.Unmarshal(b, out) + if err != nil { + return nil, err + } + return out.PluginClasses, nil +} +func (h *KafkaConnectCustomPluginHandler) KafkaConnectCustomPluginClassUpdate(ctx context.Context, organizationId string, pluginClassName string, in *KafkaConnectCustomPluginClassUpdateIn) (*KafkaConnectCustomPluginClassUpdateOut, error) { + path := fmt.Sprintf("/v1/organization/%s/kafka-connect/custom-plugin-classes/%s", url.PathEscape(organizationId), url.PathEscape(pluginClassName)) + b, err := h.doer.Do(ctx, "KafkaConnectCustomPluginClassUpdate", "PUT", path, in) + if err != nil { + return nil, err + } + out := new(KafkaConnectCustomPluginClassUpdateOut) + err = json.Unmarshal(b, out) + if err != nil { + return nil, err + } + return out, nil +} +func (h *KafkaConnectCustomPluginHandler) KafkaConnectCustomPluginDelete(ctx context.Context, organizationId string, pluginName string) error { + path := fmt.Sprintf("/v1/organization/%s/kafka-connect/custom-plugins/%s", url.PathEscape(organizationId), url.PathEscape(pluginName)) + _, err := h.doer.Do(ctx, "KafkaConnectCustomPluginDelete", "DELETE", path, nil) + return err +} +func (h *KafkaConnectCustomPluginHandler) KafkaConnectCustomPluginFileClassList(ctx context.Context, organizationId string, pluginFileId string) ([]PluginClasseOut, error) { + path := fmt.Sprintf("/v1/organization/%s/kafka-connect/custom-plugin-files/%s/classes", url.PathEscape(organizationId), url.PathEscape(pluginFileId)) + b, err := h.doer.Do(ctx, "KafkaConnectCustomPluginFileClassList", "GET", path, nil) + if err != nil { + return nil, err + } + out := new(kafkaConnectCustomPluginFileClassListOut) + err = json.Unmarshal(b, out) + if err != nil { + return nil, err + } + return out.PluginClasses, nil +} +func (h *KafkaConnectCustomPluginHandler) KafkaConnectCustomPluginFileCreate(ctx context.Context, organizationId string, in *KafkaConnectCustomPluginFileCreateIn) (*KafkaConnectCustomPluginFileCreateOut, error) { + path := fmt.Sprintf("/v1/organization/%s/kafka-connect/custom-plugin-files", url.PathEscape(organizationId)) + b, err := h.doer.Do(ctx, "KafkaConnectCustomPluginFileCreate", "POST", path, in) + if err != nil { + return nil, err + } + out := new(KafkaConnectCustomPluginFileCreateOut) + err = json.Unmarshal(b, out) + if err != nil { + return nil, err + } + return out, nil +} +func (h *KafkaConnectCustomPluginHandler) KafkaConnectCustomPluginFileDelete(ctx context.Context, organizationId string, pluginFileId string) error { + path := fmt.Sprintf("/v1/organization/%s/kafka-connect/custom-plugin-files/%s", url.PathEscape(organizationId), url.PathEscape(pluginFileId)) + _, err := h.doer.Do(ctx, "KafkaConnectCustomPluginFileDelete", "DELETE", path, nil) + return err +} +func (h *KafkaConnectCustomPluginHandler) KafkaConnectCustomPluginFileGet(ctx context.Context, organizationId string, pluginFileId string) (*KafkaConnectCustomPluginFileGetOut, error) { + path := fmt.Sprintf("/v1/organization/%s/kafka-connect/custom-plugin-files/%s", url.PathEscape(organizationId), url.PathEscape(pluginFileId)) + b, err := h.doer.Do(ctx, "KafkaConnectCustomPluginFileGet", "GET", path, nil) + if err != nil { + return nil, err + } + out := new(KafkaConnectCustomPluginFileGetOut) + err = json.Unmarshal(b, out) + if err != nil { + return nil, err + } + return out, nil +} +func (h *KafkaConnectCustomPluginHandler) KafkaConnectCustomPluginFileList(ctx context.Context, organizationId string) ([]PluginFileOut, error) { + path := fmt.Sprintf("/v1/organization/%s/kafka-connect/custom-plugin-files", url.PathEscape(organizationId)) + b, err := h.doer.Do(ctx, "KafkaConnectCustomPluginFileList", "GET", path, nil) + if err != nil { + return nil, err + } + out := new(kafkaConnectCustomPluginFileListOut) + err = json.Unmarshal(b, out) + if err != nil { + return nil, err + } + return out.PluginFiles, nil +} +func (h *KafkaConnectCustomPluginHandler) KafkaConnectCustomPluginFileListByName(ctx context.Context, organizationId string, pluginName string) ([]PluginFileOut, error) { + path := fmt.Sprintf("/v1/organization/%s/kafka-connect/custom-plugins/%s/files", url.PathEscape(organizationId), url.PathEscape(pluginName)) + b, err := h.doer.Do(ctx, "KafkaConnectCustomPluginFileListByName", "GET", path, nil) + if err != nil { + return nil, err + } + out := new(kafkaConnectCustomPluginFileListByNameOut) + err = json.Unmarshal(b, out) + if err != nil { + return nil, err + } + return out.PluginFiles, nil +} +func (h *KafkaConnectCustomPluginHandler) KafkaConnectCustomPluginFileUpdate(ctx context.Context, organizationId string, pluginFileId string, in *KafkaConnectCustomPluginFileUpdateIn) (*KafkaConnectCustomPluginFileUpdateOut, error) { + path := fmt.Sprintf("/v1/organization/%s/kafka-connect/custom-plugin-files/%s", url.PathEscape(organizationId), url.PathEscape(pluginFileId)) + b, err := h.doer.Do(ctx, "KafkaConnectCustomPluginFileUpdate", "PUT", path, in) + if err != nil { + return nil, err + } + out := new(KafkaConnectCustomPluginFileUpdateOut) + err = json.Unmarshal(b, out) + if err != nil { + return nil, err + } + return out, nil +} +func (h *KafkaConnectCustomPluginHandler) KafkaConnectCustomPluginGet(ctx context.Context, organizationId string, pluginName string) (*KafkaConnectCustomPluginGetOut, error) { + path := fmt.Sprintf("/v1/organization/%s/kafka-connect/custom-plugins/%s", url.PathEscape(organizationId), url.PathEscape(pluginName)) + b, err := h.doer.Do(ctx, "KafkaConnectCustomPluginGet", "GET", path, nil) + if err != nil { + return nil, err + } + out := new(KafkaConnectCustomPluginGetOut) + err = json.Unmarshal(b, out) + if err != nil { + return nil, err + } + return out, nil +} +func (h *KafkaConnectCustomPluginHandler) KafkaConnectCustomPluginList(ctx context.Context, organizationId string) ([]PluginOut, error) { + path := fmt.Sprintf("/v1/organization/%s/kafka-connect/custom-plugins", url.PathEscape(organizationId)) + b, err := h.doer.Do(ctx, "KafkaConnectCustomPluginList", "GET", path, nil) + if err != nil { + return nil, err + } + out := new(kafkaConnectCustomPluginListOut) + err = json.Unmarshal(b, out) + if err != nil { + return nil, err + } + return out.Plugins, nil +} +func (h *KafkaConnectCustomPluginHandler) KafkaConnectCustomPluginUpdate(ctx context.Context, organizationId string, pluginName string, in *KafkaConnectCustomPluginUpdateIn) (*KafkaConnectCustomPluginUpdateOut, error) { + path := fmt.Sprintf("/v1/organization/%s/kafka-connect/custom-plugins/%s", url.PathEscape(organizationId), url.PathEscape(pluginName)) + b, err := h.doer.Do(ctx, "KafkaConnectCustomPluginUpdate", "PUT", path, in) + if err != nil { + return nil, err + } + out := new(KafkaConnectCustomPluginUpdateOut) + err = json.Unmarshal(b, out) + if err != nil { + return nil, err + } + return out, nil +} + +type ContentType string + +const ( + ContentTypeApplicationJavaArchive ContentType = "application/java-archive" + ContentTypeApplicationZip ContentType = "application/zip" +) + +func ContentTypeChoices() []string { + return []string{"application/java-archive", "application/zip"} +} + +type FileStatusType string + +const ( + FileStatusTypeFailed FileStatusType = "FAILED" + FileStatusTypeInitial FileStatusType = "INITIAL" + FileStatusTypeReady FileStatusType = "READY" +) + +func FileStatusTypeChoices() []string { + return []string{"FAILED", "INITIAL", "READY"} +} + +// KafkaConnectCustomPluginClassGetOut KafkaConnectCustomPluginClassGetResponse +type KafkaConnectCustomPluginClassGetOut struct { + Author *string `json:"author,omitempty"` // Plugin author, initially populated from META-INF/MANIFEST.MF (Specification-Vendor or Implementation-Vendor) and user-updatable. + CreatedAt time.Time `json:"created_at"` // Creation timestamp in ISO 8601 format, always in UTC. + CreatedBy string `json:"created_by"` // Email address of the user who created this entity. + Description *string `json:"description,omitempty"` // Optional user-provided description of the plugin class. + DocUrl *string `json:"doc_url,omitempty"` // URL to the plugin class documentation. + PluginClass string `json:"plugin_class"` // Fully qualified connector class name. Immutable after creation. + PluginClassType PluginClassType `json:"plugin_class_type"` // Type of plugin class: source, sink, transformation. + Title string `json:"title"` // Human-readable plugin class title. + UpdatedAt time.Time `json:"updated_at"` // Last update timestamp in ISO 8601 format, always in UTC. + UpdatedBy *string `json:"updated_by,omitempty"` // Email address of the user who last updated this entity. +} + +// KafkaConnectCustomPluginClassUpdateIn KafkaConnectCustomPluginClassUpdateRequestBody +type KafkaConnectCustomPluginClassUpdateIn struct { + Author *string `json:"author,omitempty"` // Plugin author. + Description *string `json:"description,omitempty"` // Optional user-provided description of the plugin class. + DocUrl *string `json:"doc_url,omitempty"` // URL to the plugin class documentation. + Title *string `json:"title,omitempty"` // Human-readable plugin class title. +} + +// KafkaConnectCustomPluginClassUpdateOut KafkaConnectCustomPluginClassUpdateResponse +type KafkaConnectCustomPluginClassUpdateOut struct { + Author *string `json:"author,omitempty"` // Plugin author, initially populated from META-INF/MANIFEST.MF (Specification-Vendor or Implementation-Vendor) and user-updatable. + CreatedAt time.Time `json:"created_at"` // Creation timestamp in ISO 8601 format, always in UTC. + CreatedBy string `json:"created_by"` // Email address of the user who created this entity. + Description *string `json:"description,omitempty"` // Optional user-provided description of the plugin class. + DocUrl *string `json:"doc_url,omitempty"` // URL to the plugin class documentation. + PluginClass string `json:"plugin_class"` // Fully qualified connector class name. Immutable after creation. + PluginClassType PluginClassType `json:"plugin_class_type"` // Type of plugin class: source, sink, transformation. + Title string `json:"title"` // Human-readable plugin class title. + UpdatedAt time.Time `json:"updated_at"` // Last update timestamp in ISO 8601 format, always in UTC. + UpdatedBy *string `json:"updated_by,omitempty"` // Email address of the user who last updated this entity. +} + +// KafkaConnectCustomPluginFileCreateIn KafkaConnectCustomPluginFileCreateRequestBody +type KafkaConnectCustomPluginFileCreateIn struct { + ContentType ContentType `json:"content_type,omitempty"` // MIME type of the plugin file being uploaded. Use 'application/java-archive' for a single JAR file or 'application/zip' for a ZIP plugin bundle. Defaults to 'application/java-archive' when omitted. + FileDescription *string `json:"file_description,omitempty"` // Optional human-readable change notes specific to this plugin version. + PluginDescription *string `json:"plugin_description,omitempty"` // Optional human-readable description of the plugin (applies to all versions). + PluginName string `json:"plugin_name"` // User-provided name identifying this custom plugin (e.g. 'my-custom-connectors'). + PluginVersion string `json:"plugin_version"` // User-provided version string for this plugin upload. Must be a valid PEP 440 version (e.g. '2.7.14', '1.0.0a1', '2.7.14.dev0'). + ServiceType ServiceType `json:"service_type"` // The Aiven service type this plugin is intended for. +} + +// KafkaConnectCustomPluginFileCreateOut KafkaConnectCustomPluginFileCreateResponse +type KafkaConnectCustomPluginFileCreateOut struct { + CreatedAt time.Time `json:"created_at"` // Creation timestamp in ISO 8601 format, always in UTC. + CreatedBy string `json:"created_by"` // Email address of the user who created this entity. + FileDescription *string `json:"file_description,omitempty"` // Optional human-readable change notes specific to this plugin version. + FileSha256 *string `json:"file_sha256,omitempty"` // SHA-256 hash of the uploaded file, populated after successful verification. + FileSize *int `json:"file_size,omitempty"` // Size of the uploaded file in bytes, populated after successful verification. + FileStatus FileStatusType `json:"file_status"` // Verification status of the uploaded JAR. INITIAL: upload pending or in progress. READY: verified and plugin classes discovered. FAILED: verification failed. + PluginFileId string `json:"plugin_file_id"` // Unique identifier for this custom plugin file upload. + PluginId string `json:"plugin_id"` // Unique identifier for the plugin identity record (shared across all versions). + PluginName string `json:"plugin_name"` // User-provided name identifying this custom plugin. + PluginVersion string `json:"plugin_version"` // User-provided version string for this plugin upload. + UpdatedAt time.Time `json:"updated_at"` // Last update timestamp in ISO 8601 format, always in UTC. + UpdatedBy *string `json:"updated_by,omitempty"` // Email address of the user who last updated this entity. + UploadInfo UploadInfoOut `json:"upload_info"` // Information required to upload the JAR to S3. + VerifyErrorCode *int `json:"verify_error_code,omitempty"` // Machine-readable error code when file_status is FAILED. + VerifyErrorMessage *string `json:"verify_error_message,omitempty"` // Human-readable error message when file_status is FAILED. +} + +// KafkaConnectCustomPluginFileGetOut KafkaConnectCustomPluginFileGetResponse +type KafkaConnectCustomPluginFileGetOut struct { + CreatedAt time.Time `json:"created_at"` // Creation timestamp in ISO 8601 format, always in UTC. + CreatedBy string `json:"created_by"` // Email address of the user who created this entity. + FileDescription *string `json:"file_description,omitempty"` // Optional human-readable change notes specific to this plugin version. + FileSha256 *string `json:"file_sha256,omitempty"` // SHA-256 hash of the uploaded file, populated after successful verification. + FileSize *int `json:"file_size,omitempty"` // Size of the uploaded file in bytes, populated after successful verification. + FileStatus FileStatusType `json:"file_status"` // Verification status of the uploaded JAR. INITIAL: upload pending or in progress. READY: verified and plugin classes discovered. FAILED: verification failed. + PluginClasses []PluginClasseOut `json:"plugin_classes"` // Plugin classes discovered within this JAR after successful verification. Empty until file_status is READY. + PluginFileId string `json:"plugin_file_id"` // Unique identifier for this custom plugin file upload. + PluginId string `json:"plugin_id"` // Unique identifier for the plugin identity record (shared across all versions). + PluginName string `json:"plugin_name"` // User-provided name identifying this custom plugin. + PluginVersion string `json:"plugin_version"` // User-provided version string for this plugin upload. + UpdatedAt time.Time `json:"updated_at"` // Last update timestamp in ISO 8601 format, always in UTC. + UpdatedBy *string `json:"updated_by,omitempty"` // Email address of the user who last updated this entity. + VerifyErrorCode *int `json:"verify_error_code,omitempty"` // Machine-readable error code when file_status is FAILED. + VerifyErrorMessage *string `json:"verify_error_message,omitempty"` // Human-readable error message when file_status is FAILED. +} + +// KafkaConnectCustomPluginFileUpdateIn KafkaConnectCustomPluginFileUpdateRequestBody +type KafkaConnectCustomPluginFileUpdateIn struct { + FileDescription *string `json:"file_description,omitempty"` // Optional human-readable change notes specific to this plugin version. +} + +// KafkaConnectCustomPluginFileUpdateOut KafkaConnectCustomPluginFileUpdateResponse +type KafkaConnectCustomPluginFileUpdateOut struct { + CreatedAt time.Time `json:"created_at"` // Creation timestamp in ISO 8601 format, always in UTC. + CreatedBy string `json:"created_by"` // Email address of the user who created this entity. + FileDescription *string `json:"file_description,omitempty"` // Optional human-readable change notes specific to this plugin version. + FileSha256 *string `json:"file_sha256,omitempty"` // SHA-256 hash of the uploaded file, populated after successful verification. + FileSize *int `json:"file_size,omitempty"` // Size of the uploaded file in bytes, populated after successful verification. + FileStatus FileStatusType `json:"file_status"` // Verification status of the uploaded JAR. INITIAL: upload pending or in progress. READY: verified and plugin classes discovered. FAILED: verification failed. + PluginFileId string `json:"plugin_file_id"` // Unique identifier for this custom plugin file upload. + PluginId string `json:"plugin_id"` // Unique identifier for the plugin identity record (shared across all versions). + PluginName string `json:"plugin_name"` // User-provided name identifying this custom plugin. + PluginVersion string `json:"plugin_version"` // User-provided version string for this plugin upload. + UpdatedAt time.Time `json:"updated_at"` // Last update timestamp in ISO 8601 format, always in UTC. + UpdatedBy *string `json:"updated_by,omitempty"` // Email address of the user who last updated this entity. + VerifyErrorCode *int `json:"verify_error_code,omitempty"` // Machine-readable error code when file_status is FAILED. + VerifyErrorMessage *string `json:"verify_error_message,omitempty"` // Human-readable error message when file_status is FAILED. +} + +// KafkaConnectCustomPluginGetOut KafkaConnectCustomPluginGetResponse +type KafkaConnectCustomPluginGetOut struct { + CreatedAt time.Time `json:"created_at"` // Creation timestamp in ISO 8601 format, always in UTC. + CreatedBy string `json:"created_by"` // Email address of the user who created this entity. + PluginDescription *string `json:"plugin_description,omitempty"` // Optional human-readable description of the plugin (applies to all versions). + PluginId string `json:"plugin_id"` // Unique identifier for the plugin identity record (shared across all versions). + PluginName string `json:"plugin_name"` // User-provided name identifying this custom plugin. + ServiceType ServiceType `json:"service_type"` // The Aiven service type this plugin is intended for. + UpdatedAt time.Time `json:"updated_at"` // Last update timestamp in ISO 8601 format, always in UTC. + UpdatedBy *string `json:"updated_by,omitempty"` // Email address of the user who last updated this entity. +} + +// KafkaConnectCustomPluginUpdateIn KafkaConnectCustomPluginUpdateRequestBody +type KafkaConnectCustomPluginUpdateIn struct { + PluginDescription *string `json:"plugin_description,omitempty"` // Optional human-readable description of the plugin (applies to all versions). +} + +// KafkaConnectCustomPluginUpdateOut KafkaConnectCustomPluginUpdateResponse +type KafkaConnectCustomPluginUpdateOut struct { + CreatedAt time.Time `json:"created_at"` // Creation timestamp in ISO 8601 format, always in UTC. + CreatedBy string `json:"created_by"` // Email address of the user who created this entity. + PluginDescription *string `json:"plugin_description,omitempty"` // Optional human-readable description of the plugin (applies to all versions). + PluginId string `json:"plugin_id"` // Unique identifier for the plugin identity record (shared across all versions). + PluginName string `json:"plugin_name"` // User-provided name identifying this custom plugin. + ServiceType ServiceType `json:"service_type"` // The Aiven service type this plugin is intended for. + UpdatedAt time.Time `json:"updated_at"` // Last update timestamp in ISO 8601 format, always in UTC. + UpdatedBy *string `json:"updated_by,omitempty"` // Email address of the user who last updated this entity. +} +type PluginClassType string + +const ( + PluginClassTypeSink PluginClassType = "sink" + PluginClassTypeSource PluginClassType = "source" + PluginClassTypeTransformation PluginClassType = "transformation" +) + +func PluginClassTypeChoices() []string { + return []string{"sink", "source", "transformation"} +} + +type PluginClasseOut struct { + Author *string `json:"author,omitempty"` // Plugin author, initially populated from META-INF/MANIFEST.MF (Specification-Vendor or Implementation-Vendor) and user-updatable. + CreatedAt time.Time `json:"created_at"` // Creation timestamp in ISO 8601 format, always in UTC. + CreatedBy string `json:"created_by"` // Email address of the user who created this entity. + Description *string `json:"description,omitempty"` // Optional user-provided description of the plugin class. + DocUrl *string `json:"doc_url,omitempty"` // URL to the plugin class documentation. + PluginClass string `json:"plugin_class"` // Fully qualified connector class name. Immutable after creation. + PluginClassType PluginClassType `json:"plugin_class_type"` // Type of plugin class: source, sink, transformation. + Title string `json:"title"` // Human-readable plugin class title. + UpdatedAt time.Time `json:"updated_at"` // Last update timestamp in ISO 8601 format, always in UTC. + UpdatedBy *string `json:"updated_by,omitempty"` // Email address of the user who last updated this entity. +} +type PluginFileOut struct { + CreatedAt time.Time `json:"created_at"` // Creation timestamp in ISO 8601 format, always in UTC. + CreatedBy string `json:"created_by"` // Email address of the user who created this entity. + FileDescription *string `json:"file_description,omitempty"` // Optional human-readable change notes specific to this plugin version. + FileSha256 *string `json:"file_sha256,omitempty"` // SHA-256 hash of the uploaded file, populated after successful verification. + FileSize *int `json:"file_size,omitempty"` // Size of the uploaded file in bytes, populated after successful verification. + FileStatus FileStatusType `json:"file_status"` // Verification status of the uploaded JAR. INITIAL: upload pending or in progress. READY: verified and plugin classes discovered. FAILED: verification failed. + PluginFileId string `json:"plugin_file_id"` // Unique identifier for this custom plugin file upload. + PluginId string `json:"plugin_id"` // Unique identifier for the plugin identity record (shared across all versions). + PluginName string `json:"plugin_name"` // User-provided name identifying this custom plugin. + PluginVersion string `json:"plugin_version"` // User-provided version string for this plugin upload. + UpdatedAt time.Time `json:"updated_at"` // Last update timestamp in ISO 8601 format, always in UTC. + UpdatedBy *string `json:"updated_by,omitempty"` // Email address of the user who last updated this entity. + VerifyErrorCode *int `json:"verify_error_code,omitempty"` // Machine-readable error code when file_status is FAILED. + VerifyErrorMessage *string `json:"verify_error_message,omitempty"` // Human-readable error message when file_status is FAILED. +} +type PluginOut struct { + CreatedAt time.Time `json:"created_at"` // Creation timestamp in ISO 8601 format, always in UTC. + CreatedBy string `json:"created_by"` // Email address of the user who created this entity. + PluginDescription *string `json:"plugin_description,omitempty"` // Optional human-readable description of the plugin (applies to all versions). + PluginId string `json:"plugin_id"` // Unique identifier for the plugin identity record (shared across all versions). + PluginName string `json:"plugin_name"` // User-provided name identifying this custom plugin. + ServiceType ServiceType `json:"service_type"` // The Aiven service type this plugin is intended for. + UpdatedAt time.Time `json:"updated_at"` // Last update timestamp in ISO 8601 format, always in UTC. + UpdatedBy *string `json:"updated_by,omitempty"` // Email address of the user who last updated this entity. +} +type ServiceType string + +const ( + ServiceTypeKafkaConnect ServiceType = "kafka_connect" +) + +func ServiceTypeChoices() []string { + return []string{"kafka_connect"} +} + +// UploadInfoOut Information required to upload the JAR to S3. +type UploadInfoOut struct { + ContentType ContentType `json:"content_type"` // The Content-Type header value the client must set when issuing the S3 PUT request. + MaxFileSizeBytes int `json:"max_file_size_bytes"` // Maximum allowed file size in bytes. Files exceeding this limit will be rejected. + UploadExpirySeconds int `json:"upload_expiry_seconds"` // Number of seconds the presigned URL remains valid. + Url *string `json:"url,omitempty"` // Presigned S3 URL to upload the JAR directly. Becomes null once file_status transitions to READY or FAILED. +} + +// kafkaConnectCustomPluginClassListByNameOut KafkaConnectCustomPluginClassListByNameResponse +type kafkaConnectCustomPluginClassListByNameOut struct { + PluginClasses []PluginClasseOut `json:"plugin_classes"` // List of custom plugin classes. +} + +// kafkaConnectCustomPluginClassListOut KafkaConnectCustomPluginClassListResponse +type kafkaConnectCustomPluginClassListOut struct { + PluginClasses []PluginClasseOut `json:"plugin_classes"` // List of custom plugin classes. +} + +// kafkaConnectCustomPluginFileClassListOut KafkaConnectCustomPluginFileClassListResponse +type kafkaConnectCustomPluginFileClassListOut struct { + PluginClasses []PluginClasseOut `json:"plugin_classes"` // List of custom plugin classes. +} + +// kafkaConnectCustomPluginFileListByNameOut KafkaConnectCustomPluginFileListByNameResponse +type kafkaConnectCustomPluginFileListByNameOut struct { + PluginFiles []PluginFileOut `json:"plugin_files"` // List of custom plugin files. +} + +// kafkaConnectCustomPluginFileListOut KafkaConnectCustomPluginFileListResponse +type kafkaConnectCustomPluginFileListOut struct { + PluginFiles []PluginFileOut `json:"plugin_files"` // List of custom plugin files. +} + +// kafkaConnectCustomPluginListOut KafkaConnectCustomPluginListResponse +type kafkaConnectCustomPluginListOut struct { + Plugins []PluginOut `json:"plugins"` // List of custom plugins. +}