# Packages

No description provided by the author

# README

Go API client for v1

REST API for the Schema Registry

Overview

This API client was generated by the OpenAPI Generator project. By using the OpenAPI-spec from a remote server, you can easily generate an API client.

Installation

Install the following dependencies:

go get github.com/stretchr/testify/assert
go get golang.org/x/oauth2
go get golang.org/x/net/context

Put the package under your project folder and add the following in import:

import sw "./v1"

To use a proxy, set the environment variable HTTP_PROXY:

os.Setenv("HTTP_PROXY", "http://proxy_name:proxy_port")

Configuration of Server URL

Default configuration comes with Servers field that contains server objects as defined in the OpenAPI specification.

Select Server Configuration

For using other server than the one defined on index 0 set context value sw.ContextServerIndex of type int.

ctx := context.WithValue(context.Background(), sw.ContextServerIndex, 1)

Templated Server URL

Templated server URL is formatted using default variables from configuration or from context value sw.ContextServerVariables of type map[string]string.

ctx := context.WithValue(context.Background(), sw.ContextServerVariables, map[string]string{
	"basePath": "v2",
})

Note, enum values are always validated and all unused variables are silently ignored.

URLs Configuration per Operation

Each operation can use different server URL defined using OperationServers map in the Configuration. An operation is uniquely identified by "{classname}Service.{nickname}" string. Similar rules for overriding default operation server index and variables applies by using sw.ContextOperationServerIndices and sw.ContextOperationServerVariables context maps.

ctx := context.WithValue(context.Background(), sw.ContextOperationServerIndices, map[string]int{
	"{classname}Service.{nickname}": 2,
})
ctx = context.WithValue(context.Background(), sw.ContextOperationServerVariables, map[string]map[string]string{
	"{classname}Service.{nickname}": {
		"port": "8443",
	},
})

Documentation for API Endpoints

All URIs are relative to https://psrc-00000.region.provider.confluent.cloud

ClassMethodHTTP requestDescription
CompatibilityV1ApiTestCompatibilityBySubjectNamePost /compatibility/subjects/{subject}/versions/{version}Test schema compatibility against a particular schema subject-version
CompatibilityV1ApiTestCompatibilityForSubjectPost /compatibility/subjects/{subject}/versionsTest schema compatibility against all schemas under a subject
ConfigV1ApiDeleteSubjectConfigDelete /config/{subject}Delete subject compatibility level
ConfigV1ApiDeleteTopLevelConfigDelete /configDelete global compatibility level
ConfigV1ApiGetClusterConfigGet /clusterconfigGet cluster config
ConfigV1ApiGetSubjectLevelConfigGet /config/{subject}Get subject compatibility level
ConfigV1ApiGetTopLevelConfigGet /configGet global compatibility level
ConfigV1ApiUpdateSubjectLevelConfigPut /config/{subject}Update subject compatibility level
ConfigV1ApiUpdateTopLevelConfigPut /configUpdate global compatibility level
ContextsV1ApiListContextsGet /contextsList contexts
DataEncryptionKeysV1ApiCreateDekPost /dek-registry/v1/keks/{name}/deksCreate a dek.
DataEncryptionKeysV1ApiDeleteDekVersionDelete /dek-registry/v1/keks/{name}/deks/{subject}/versions/{version}Delete a dek version.
DataEncryptionKeysV1ApiDeleteDekVersionsDelete /dek-registry/v1/keks/{name}/deks/{subject}Delete all versions of a dek.
DataEncryptionKeysV1ApiGetDekGet /dek-registry/v1/keks/{name}/deks/{subject}Get a dek by subject.
DataEncryptionKeysV1ApiGetDekByVersionGet /dek-registry/v1/keks/{name}/deks/{subject}/versions/{version}Get a dek by subject and version.
DataEncryptionKeysV1ApiGetDekSubjectsGet /dek-registry/v1/keks/{name}/deksGet a list of dek subjects.
DataEncryptionKeysV1ApiGetDekVersionsGet /dek-registry/v1/keks/{name}/deks/{subject}/versionsList versions of dek.
DataEncryptionKeysV1ApiUndeleteDekVersionPost /dek-registry/v1/keks/{name}/deks/{subject}/versions/{version}/undeleteUndelete a dek version.
DataEncryptionKeysV1ApiUndeleteDekVersionsPost /dek-registry/v1/keks/{name}/deks/{subject}/undeleteUndelete all versions of a dek.
ExportersV1ApiDeleteExporterDelete /exporters/{name}Delete schema exporter by name.
ExportersV1ApiGetExporterConfigByNameGet /exporters/{name}/configGets schema exporter config by name.
ExportersV1ApiGetExporterInfoByNameGet /exporters/{name}Gets schema exporter by name.
ExportersV1ApiGetExporterStatusByNameGet /exporters/{name}/statusGets schema exporter status by name.
ExportersV1ApiListExportersGet /exportersGets all schema exporters.
ExportersV1ApiPauseExporterByNamePut /exporters/{name}/pausePause schema exporter by name.
ExportersV1ApiRegisterExporterPost /exportersCreates a new schema exporter.
ExportersV1ApiResetExporterByNamePut /exporters/{name}/resetReset schema exporter by name.
ExportersV1ApiResumeExporterByNamePut /exporters/{name}/resumeResume schema exporter by name.
ExportersV1ApiUpdateExporterConfigByNamePut /exporters/{name}/configUpdate schema exporter config by name.
ExportersV1ApiUpdateExporterInfoPut /exporters/{name}Update schema exporter by name.
KeyEncryptionKeysV1ApiCreateKekPost /dek-registry/v1/keksCreate a kek.
KeyEncryptionKeysV1ApiDeleteKekDelete /dek-registry/v1/keks/{name}Delete a kek.
KeyEncryptionKeysV1ApiGetKekGet /dek-registry/v1/keks/{name}Get a kek by name.
KeyEncryptionKeysV1ApiGetKekNamesGet /dek-registry/v1/keksGet a list of kek names.
KeyEncryptionKeysV1ApiPutKekPut /dek-registry/v1/keks/{name}Alters a kek.
KeyEncryptionKeysV1ApiUndeleteKekPost /dek-registry/v1/keks/{name}/undeleteUndelete a kek.
ModesV1ApiDeleteSubjectModeDelete /mode/{subject}Delete subject mode
ModesV1ApiGetModeGet /mode/{subject}Get subject mode
ModesV1ApiGetTopLevelModeGet /modeGet global mode
ModesV1ApiUpdateModePut /mode/{subject}Update subject mode
ModesV1ApiUpdateTopLevelModePut /modeUpdate global mode
SchemasV1ApiGetSchemaGet /schemas/ids/{id}Get schema string by ID
SchemasV1ApiGetSchemaOnlyGet /schemas/ids/{id}/schemaGet schema by ID
SchemasV1ApiGetSchemaTypesGet /schemas/typesList supported schema types
SchemasV1ApiGetSchemasGet /schemasList schemas
SchemasV1ApiGetSubjectsGet /schemas/ids/{id}/subjectsList subjects associated to schema ID
SchemasV1ApiGetVersionsGet /schemas/ids/{id}/versionsList subject-versions associated to schema ID
SubjectsV1ApiDeleteSchemaVersionDelete /subjects/{subject}/versions/{version}Delete schema version
SubjectsV1ApiDeleteSubjectDelete /subjects/{subject}Delete subject
SubjectsV1ApiGetReferencedByGet /subjects/{subject}/versions/{version}/referencedbyList schemas referencing a schema
SubjectsV1ApiGetSchemaByVersionGet /subjects/{subject}/versions/{version}Get schema by version
SubjectsV1ApiGetSchemaOnly1Get /subjects/{subject}/versions/{version}/schemaGet schema string by version
SubjectsV1ApiListGet /subjectsList subjects
SubjectsV1ApiListVersionsGet /subjects/{subject}/versionsList versions under subject
SubjectsV1ApiLookUpSchemaUnderSubjectPost /subjects/{subject}Lookup schema under subject
SubjectsV1ApiRegisterPost /subjects/{subject}/versionsRegister schema under a subject

Documentation For Models

Documentation For Authorization

external-access-token

  • Type: OAuth
  • Flow: application
  • Authorization URL:
  • Scopes: N/A

Example

auth := context.WithValue(context.Background(), sw.ContextAccessToken, "ACCESSTOKENSTRING")
r, err := client.Service.Operation(auth, args)

Or via OAuth2 module to automatically refresh tokens and perform user authentication.

import "golang.org/x/oauth2"

/* Perform OAuth2 round trip request and obtain a token */

tokenSource := oauth2cfg.TokenSource(createContext(httpClient), &token)
auth := context.WithValue(oauth2.NoContext, sw.ContextOAuth2, tokenSource)
r, err := client.Service.Operation(auth, args)

resource-api-key

  • Type: HTTP basic authentication

Example

auth := context.WithValue(context.Background(), sw.ContextBasicAuth, sw.BasicAuth{
    UserName: "username",
    Password: "password",
})
r, err := client.Service.Operation(auth, args)

Documentation for Utility Methods

Due to the fact that model structure members are all pointers, this package contains a number of utility functions to easily obtain pointers to values of basic types. Each of these functions takes a value of the given basic type and returns a pointer to it:

  • PtrBool
  • PtrInt
  • PtrInt32
  • PtrInt64
  • PtrFloat
  • PtrFloat32
  • PtrFloat64
  • PtrString
  • PtrTime

Author

[email protected]