mirror of https://github.com/vernonkeenan/lib
feat(members): add governed Database metadata client (#28)
parent
08763a7bbc
commit
175a16a96a
|
|
@ -0,0 +1,184 @@
|
||||||
|
package members_client_test
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"os"
|
||||||
|
"path/filepath"
|
||||||
|
"reflect"
|
||||||
|
"regexp"
|
||||||
|
"strings"
|
||||||
|
"testing"
|
||||||
|
|
||||||
|
"code.tnxs.net/vernonkeenan/lib/api/members/members_client"
|
||||||
|
"code.tnxs.net/vernonkeenan/lib/api/members/members_client/databases"
|
||||||
|
"code.tnxs.net/vernonkeenan/lib/api/members/members_models"
|
||||||
|
openapiruntime "github.com/go-openapi/runtime"
|
||||||
|
"github.com/go-openapi/strfmt"
|
||||||
|
)
|
||||||
|
|
||||||
|
type databaseMetadataCaptureTransport struct {
|
||||||
|
operation *openapiruntime.ClientOperation
|
||||||
|
}
|
||||||
|
|
||||||
|
func (transport *databaseMetadataCaptureTransport) Submit(
|
||||||
|
operation *openapiruntime.ClientOperation,
|
||||||
|
) (any, error) {
|
||||||
|
return transport.SubmitContext(context.Background(), operation)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (transport *databaseMetadataCaptureTransport) SubmitContext(
|
||||||
|
_ context.Context,
|
||||||
|
operation *openapiruntime.ClientOperation,
|
||||||
|
) (any, error) {
|
||||||
|
transport.operation = operation
|
||||||
|
if operation.ID != "getDatabases" {
|
||||||
|
panic("unexpected generated Database metadata operation: " + operation.ID)
|
||||||
|
}
|
||||||
|
return databases.NewGetDatabasesOK(), nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestGeneratedDatabaseMetadataOperationIsFixedReadOnlyAndAuthenticated(t *testing.T) {
|
||||||
|
transport := &databaseMetadataCaptureTransport{}
|
||||||
|
auth := openapiruntime.ClientAuthInfoWriterFunc(
|
||||||
|
func(openapiruntime.ClientRequest, strfmt.Registry) error { return nil },
|
||||||
|
)
|
||||||
|
tenantID := strfmt.UUID("77777777-7777-4777-8777-777777777777")
|
||||||
|
databaseID := strfmt.UUID("88888888-8888-4888-8888-888888888888")
|
||||||
|
params := databases.NewGetDatabasesParams().
|
||||||
|
WithTenantID(tenantID).
|
||||||
|
WithDatabaseID(&databaseID)
|
||||||
|
_, err := databases.New(transport, strfmt.Default).GetDatabases(params, auth)
|
||||||
|
if err != nil {
|
||||||
|
t.Fatalf("generated Database metadata operation failed: %v", err)
|
||||||
|
}
|
||||||
|
if transport.operation == nil {
|
||||||
|
t.Fatal("generated client did not submit an operation")
|
||||||
|
}
|
||||||
|
if transport.operation.ID != "getDatabases" ||
|
||||||
|
transport.operation.Method != "GET" ||
|
||||||
|
transport.operation.PathPattern != "/databases" {
|
||||||
|
t.Fatalf(
|
||||||
|
"operation = %s %s %s, want getDatabases GET /databases",
|
||||||
|
transport.operation.ID,
|
||||||
|
transport.operation.Method,
|
||||||
|
transport.operation.PathPattern,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
if transport.operation.AuthInfo == nil {
|
||||||
|
t.Fatal("generated operation discarded its compound auth writer")
|
||||||
|
}
|
||||||
|
if params.TenantID != tenantID || params.DatabaseID == nil ||
|
||||||
|
*params.DatabaseID != databaseID {
|
||||||
|
t.Fatal("generated Database metadata client lost tenant or record filter")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestDatabaseMetadataSpecRequiresExactScopeTenantAndCompoundAuth(t *testing.T) {
|
||||||
|
specText := readMembersLearningSpec(t)
|
||||||
|
pathBlock := learningSpecPathBlock(t, specText, "/databases")
|
||||||
|
for _, forbidden := range []string{" post:", " put:", " patch:", " delete:"} {
|
||||||
|
if strings.Contains(pathBlock, forbidden) {
|
||||||
|
t.Errorf("/databases exposes unsupported %s", strings.TrimSpace(forbidden))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
block := learningSpecOperationBlock(t, specText, "/databases", "get")
|
||||||
|
for _, required := range []string{
|
||||||
|
" operationId: getDatabases\n",
|
||||||
|
"members:database:read",
|
||||||
|
`- $ref: "#/parameters/databaseTenantId"`,
|
||||||
|
" security:\n - ApiKeyAuth: []\n kvSessionCookie: []",
|
||||||
|
} {
|
||||||
|
if !strings.Contains(block, required) {
|
||||||
|
t.Errorf("GET /databases lost required contract %q", required)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestDatabaseMetadataModelContainsOnlyCredentialFreeFields(t *testing.T) {
|
||||||
|
assertExactModelFields(t, members_models.DatabaseMetadata{}, map[string]string{
|
||||||
|
"Active": "*bool",
|
||||||
|
"ClusterID": "*strfmt.UUID",
|
||||||
|
"CreatedDate": "*strfmt.DateTime",
|
||||||
|
"DatabaseName": "*string",
|
||||||
|
"ID": "*strfmt.UUID",
|
||||||
|
"LastModifiedDate": "*strfmt.DateTime",
|
||||||
|
"Status": "*string",
|
||||||
|
"TenantID": "*strfmt.UUID",
|
||||||
|
"Type": "*string",
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestDatabaseMetadataClientHasNoProvisioningMutation(t *testing.T) {
|
||||||
|
contract := reflect.TypeOf((*databases.ClientService)(nil)).Elem()
|
||||||
|
for index := 0; index < contract.NumMethod(); index++ {
|
||||||
|
method := contract.Method(index).Name
|
||||||
|
for _, forbidden := range []string{
|
||||||
|
"Post", "Put", "Patch", "Delete", "Create", "Update",
|
||||||
|
"Provision", "DSN", "Credential",
|
||||||
|
} {
|
||||||
|
if strings.Contains(method, forbidden) {
|
||||||
|
t.Errorf("Database metadata client exposes forbidden method %s", method)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
root := reflect.TypeOf(members_client.Members{})
|
||||||
|
if _, exists := root.FieldByName("Databases"); !exists {
|
||||||
|
t.Fatal("root Members client does not expose Database metadata")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestGeneratedDatabaseMetadataSurfaceHasNoRetiredOrSecretCoupling(t *testing.T) {
|
||||||
|
repoRoot := learningRepoRoot(t)
|
||||||
|
targets := []string{
|
||||||
|
filepath.Join(repoRoot, "api", "members", "members_client", "databases"),
|
||||||
|
filepath.Join(
|
||||||
|
repoRoot, "api", "members", "members_models", "database_metadata.go",
|
||||||
|
),
|
||||||
|
filepath.Join(
|
||||||
|
repoRoot,
|
||||||
|
"api",
|
||||||
|
"members",
|
||||||
|
"members_models",
|
||||||
|
"database_metadata_response.go",
|
||||||
|
),
|
||||||
|
}
|
||||||
|
credentialLiteral := regexp.MustCompile(
|
||||||
|
`(?i)(api[_-]?key|password|secret)\s*[:=]\s*["'][^"']+["']`,
|
||||||
|
)
|
||||||
|
for _, target := range targets {
|
||||||
|
err := filepath.WalkDir(target, func(
|
||||||
|
path string,
|
||||||
|
entry os.DirEntry,
|
||||||
|
walkErr error,
|
||||||
|
) error {
|
||||||
|
if walkErr != nil {
|
||||||
|
return walkErr
|
||||||
|
}
|
||||||
|
if entry.IsDir() || !strings.HasSuffix(path, ".go") ||
|
||||||
|
strings.HasSuffix(path, "_test.go") {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
content, err := os.ReadFile(path)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
lower := strings.ToLower(string(content))
|
||||||
|
for _, forbidden := range []string{
|
||||||
|
"salesforce", "sf-gate", "go-force", "cache",
|
||||||
|
"processortoken",
|
||||||
|
"postdatabases", "putdatabases", "deletedatabases",
|
||||||
|
} {
|
||||||
|
if strings.Contains(lower, forbidden) {
|
||||||
|
t.Errorf("%s contains forbidden boundary %q", path, forbidden)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if credentialLiteral.Match(content) {
|
||||||
|
t.Errorf("%s contains a credential-shaped literal", path)
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
})
|
||||||
|
if err != nil {
|
||||||
|
t.Fatalf("scan generated Database metadata target %s: %v", target, err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -60,30 +60,18 @@ type ClientOption func(*runtime.ClientOperation)
|
||||||
// ClientService is the interface for Client methods.
|
// ClientService is the interface for Client methods.
|
||||||
type ClientService interface {
|
type ClientService interface {
|
||||||
|
|
||||||
// GetDatabases get a list databases.
|
// GetDatabases get sanitized database metadata.
|
||||||
GetDatabases(params *GetDatabasesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetDatabasesOK, error)
|
GetDatabases(params *GetDatabasesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetDatabasesOK, error)
|
||||||
|
|
||||||
// GetDatabasesContext get a list databases.
|
// GetDatabasesContext get sanitized database metadata.
|
||||||
GetDatabasesContext(ctx context.Context, params *GetDatabasesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetDatabasesOK, error)
|
GetDatabasesContext(ctx context.Context, params *GetDatabasesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetDatabasesOK, error)
|
||||||
|
|
||||||
// PostDatabases create new databases.
|
|
||||||
PostDatabases(params *PostDatabasesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostDatabasesOK, error)
|
|
||||||
|
|
||||||
// PostDatabasesContext create new databases.
|
|
||||||
PostDatabasesContext(ctx context.Context, params *PostDatabasesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostDatabasesOK, error)
|
|
||||||
|
|
||||||
// PutDatabases update databases.
|
|
||||||
PutDatabases(params *PutDatabasesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutDatabasesOK, error)
|
|
||||||
|
|
||||||
// PutDatabasesContext update databases.
|
|
||||||
PutDatabasesContext(ctx context.Context, params *PutDatabasesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutDatabasesOK, error)
|
|
||||||
|
|
||||||
SetTransport(transport runtime.ContextualTransport)
|
SetTransport(transport runtime.ContextualTransport)
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetDatabases gets a list databases.
|
// GetDatabases gets sanitized database metadata.
|
||||||
//
|
//
|
||||||
// Return a list of Database records from the datastore.
|
// Tenant-bound read of sanitized Database metadata. Requires members:database:read and active human membership. DSN, provisioning credentials, and audit identities are absent. Provisioning writes remain unavailable..
|
||||||
//
|
//
|
||||||
// This method does not support injected context.
|
// This method does not support injected context.
|
||||||
// However, timeout and opentracing contexts are honored whenever enabled.
|
// However, timeout and opentracing contexts are honored whenever enabled.
|
||||||
|
|
@ -100,9 +88,9 @@ func (a *Client) GetDatabases(params *GetDatabasesParams, authInfo runtime.Clien
|
||||||
return a.GetDatabasesContext(ctx, params, authInfo, opts...)
|
return a.GetDatabasesContext(ctx, params, authInfo, opts...)
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetDatabasesContext gets a list databases.
|
// GetDatabasesContext gets sanitized database metadata.
|
||||||
//
|
//
|
||||||
// Return a list of Database records from the datastore.
|
// Tenant-bound read of sanitized Database metadata. Requires members:database:read and active human membership. DSN, provisioning credentials, and audit identities are absent. Provisioning writes remain unavailable..
|
||||||
//
|
//
|
||||||
// Do not use the deprecated [GetDatabasesParams.Context] with this method: it would be ignored.
|
// Do not use the deprecated [GetDatabasesParams.Context] with this method: it would be ignored.
|
||||||
func (a *Client) GetDatabasesContext(ctx context.Context, params *GetDatabasesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetDatabasesOK, error) {
|
func (a *Client) GetDatabasesContext(ctx context.Context, params *GetDatabasesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetDatabasesOK, error) {
|
||||||
|
|
@ -148,140 +136,6 @@ func (a *Client) GetDatabasesContext(ctx context.Context, params *GetDatabasesPa
|
||||||
panic(msg)
|
panic(msg)
|
||||||
}
|
}
|
||||||
|
|
||||||
// PostDatabases creates new databases.
|
|
||||||
//
|
|
||||||
// Create Databases.
|
|
||||||
//
|
|
||||||
// This method does not support injected context.
|
|
||||||
// However, timeout and opentracing contexts are honored whenever enabled.
|
|
||||||
//
|
|
||||||
// If you need to pass a specific context, use [Client.PostDatabasesContext] instead.
|
|
||||||
func (a *Client) PostDatabases(params *PostDatabasesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostDatabasesOK, error) {
|
|
||||||
var ctx context.Context
|
|
||||||
if params.inner.ctx != nil {
|
|
||||||
ctx = params.inner.ctx
|
|
||||||
} else {
|
|
||||||
ctx = context.Background()
|
|
||||||
}
|
|
||||||
|
|
||||||
return a.PostDatabasesContext(ctx, params, authInfo, opts...)
|
|
||||||
}
|
|
||||||
|
|
||||||
// PostDatabasesContext creates new databases.
|
|
||||||
//
|
|
||||||
// Create Databases.
|
|
||||||
//
|
|
||||||
// Do not use the deprecated [PostDatabasesParams.Context] with this method: it would be ignored.
|
|
||||||
func (a *Client) PostDatabasesContext(ctx context.Context, params *PostDatabasesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostDatabasesOK, error) {
|
|
||||||
// NOTE: parameters are not validated before sending
|
|
||||||
if params == nil {
|
|
||||||
params = NewPostDatabasesParams()
|
|
||||||
}
|
|
||||||
|
|
||||||
op := &runtime.ClientOperation{
|
|
||||||
ID: "postDatabases",
|
|
||||||
Method: "POST",
|
|
||||||
PathPattern: "/databases",
|
|
||||||
ProducesMediaTypes: []string{"application/json"},
|
|
||||||
ConsumesMediaTypes: []string{"application/json"},
|
|
||||||
Schemes: []string{"http"},
|
|
||||||
Params: params,
|
|
||||||
Reader: &PostDatabasesReader{formats: a.formats},
|
|
||||||
AuthInfo: authInfo,
|
|
||||||
Client: params.HTTPClient,
|
|
||||||
}
|
|
||||||
|
|
||||||
for _, opt := range opts {
|
|
||||||
opt(op)
|
|
||||||
}
|
|
||||||
|
|
||||||
result, err := a.transport.SubmitContext(ctx, op)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
// only one success response has to be checked
|
|
||||||
success, ok := result.(*PostDatabasesOK)
|
|
||||||
if ok {
|
|
||||||
return success, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// unexpected success response.
|
|
||||||
|
|
||||||
// no default response is defined.
|
|
||||||
//
|
|
||||||
// safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue
|
|
||||||
msg := fmt.Sprintf("unexpected success response for postDatabases: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
|
||||||
panic(msg)
|
|
||||||
}
|
|
||||||
|
|
||||||
// PutDatabases updates databases.
|
|
||||||
//
|
|
||||||
// Update Database.
|
|
||||||
//
|
|
||||||
// This method does not support injected context.
|
|
||||||
// However, timeout and opentracing contexts are honored whenever enabled.
|
|
||||||
//
|
|
||||||
// If you need to pass a specific context, use [Client.PutDatabasesContext] instead.
|
|
||||||
func (a *Client) PutDatabases(params *PutDatabasesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutDatabasesOK, error) {
|
|
||||||
var ctx context.Context
|
|
||||||
if params.inner.ctx != nil {
|
|
||||||
ctx = params.inner.ctx
|
|
||||||
} else {
|
|
||||||
ctx = context.Background()
|
|
||||||
}
|
|
||||||
|
|
||||||
return a.PutDatabasesContext(ctx, params, authInfo, opts...)
|
|
||||||
}
|
|
||||||
|
|
||||||
// PutDatabasesContext updates databases.
|
|
||||||
//
|
|
||||||
// Update Database.
|
|
||||||
//
|
|
||||||
// Do not use the deprecated [PutDatabasesParams.Context] with this method: it would be ignored.
|
|
||||||
func (a *Client) PutDatabasesContext(ctx context.Context, params *PutDatabasesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutDatabasesOK, error) {
|
|
||||||
// NOTE: parameters are not validated before sending
|
|
||||||
if params == nil {
|
|
||||||
params = NewPutDatabasesParams()
|
|
||||||
}
|
|
||||||
|
|
||||||
op := &runtime.ClientOperation{
|
|
||||||
ID: "putDatabases",
|
|
||||||
Method: "PUT",
|
|
||||||
PathPattern: "/databases",
|
|
||||||
ProducesMediaTypes: []string{"application/json"},
|
|
||||||
ConsumesMediaTypes: []string{"application/json"},
|
|
||||||
Schemes: []string{"http"},
|
|
||||||
Params: params,
|
|
||||||
Reader: &PutDatabasesReader{formats: a.formats},
|
|
||||||
AuthInfo: authInfo,
|
|
||||||
Client: params.HTTPClient,
|
|
||||||
}
|
|
||||||
|
|
||||||
for _, opt := range opts {
|
|
||||||
opt(op)
|
|
||||||
}
|
|
||||||
|
|
||||||
result, err := a.transport.SubmitContext(ctx, op)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
// only one success response has to be checked
|
|
||||||
success, ok := result.(*PutDatabasesOK)
|
|
||||||
if ok {
|
|
||||||
return success, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// unexpected success response.
|
|
||||||
|
|
||||||
// no default response is defined.
|
|
||||||
//
|
|
||||||
// safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue
|
|
||||||
msg := fmt.Sprintf("unexpected success response for putDatabases: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
|
||||||
panic(msg)
|
|
||||||
}
|
|
||||||
|
|
||||||
// SetTransport changes the transport on the client
|
// SetTransport changes the transport on the client
|
||||||
func (a *Client) SetTransport(transport runtime.ContextualTransport) {
|
func (a *Client) SetTransport(transport runtime.ContextualTransport) {
|
||||||
a.transport = transport
|
a.transport = transport
|
||||||
|
|
|
||||||
|
|
@ -69,8 +69,10 @@ type GetDatabasesParams struct {
|
||||||
|
|
||||||
// DatabaseID.
|
// DatabaseID.
|
||||||
//
|
//
|
||||||
// Record Id of a Database
|
// Record ID of sanitized Database metadata
|
||||||
DatabaseID string
|
//
|
||||||
|
// Format: uuid
|
||||||
|
DatabaseID *strfmt.UUID
|
||||||
|
|
||||||
// Limit.
|
// Limit.
|
||||||
//
|
//
|
||||||
|
|
@ -86,6 +88,13 @@ type GetDatabasesParams struct {
|
||||||
// Format: int64
|
// Format: int64
|
||||||
Offset *int64
|
Offset *int64
|
||||||
|
|
||||||
|
// TenantID.
|
||||||
|
//
|
||||||
|
// Tenant that owns the Database metadata. Members verifies active human membership and never returns DSN or provisioning credentials.
|
||||||
|
//
|
||||||
|
// Format: uuid
|
||||||
|
TenantID strfmt.UUID
|
||||||
|
|
||||||
HTTPClient *http.Client
|
HTTPClient *http.Client
|
||||||
|
|
||||||
inner innerParams
|
inner innerParams
|
||||||
|
|
@ -144,13 +153,13 @@ func (o *GetDatabasesParams) SetHTTPClient(client *http.Client) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// WithDatabaseID adds the databaseID to the get databases params.
|
// WithDatabaseID adds the databaseID to the get databases params.
|
||||||
func (o *GetDatabasesParams) WithDatabaseID(databaseID string) *GetDatabasesParams {
|
func (o *GetDatabasesParams) WithDatabaseID(databaseID *strfmt.UUID) *GetDatabasesParams {
|
||||||
o.SetDatabaseID(databaseID)
|
o.SetDatabaseID(databaseID)
|
||||||
return o
|
return o
|
||||||
}
|
}
|
||||||
|
|
||||||
// SetDatabaseID adds the databaseId to the get databases params.
|
// SetDatabaseID adds the databaseId to the get databases params.
|
||||||
func (o *GetDatabasesParams) SetDatabaseID(databaseID string) {
|
func (o *GetDatabasesParams) SetDatabaseID(databaseID *strfmt.UUID) {
|
||||||
o.DatabaseID = databaseID
|
o.DatabaseID = databaseID
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -176,6 +185,17 @@ func (o *GetDatabasesParams) SetOffset(offset *int64) {
|
||||||
o.Offset = offset
|
o.Offset = offset
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// WithTenantID adds the tenantID to the get databases params.
|
||||||
|
func (o *GetDatabasesParams) WithTenantID(tenantID strfmt.UUID) *GetDatabasesParams {
|
||||||
|
o.SetTenantID(tenantID)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetTenantID adds the tenantId to the get databases params.
|
||||||
|
func (o *GetDatabasesParams) SetTenantID(tenantID strfmt.UUID) {
|
||||||
|
o.TenantID = tenantID
|
||||||
|
}
|
||||||
|
|
||||||
// WriteToRequest writes these params to a [runtime.ClientRequest].
|
// WriteToRequest writes these params to a [runtime.ClientRequest].
|
||||||
func (o *GetDatabasesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
func (o *GetDatabasesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||||
if err := r.SetTimeout(o.inner.timeout); err != nil {
|
if err := r.SetTimeout(o.inner.timeout); err != nil {
|
||||||
|
|
@ -183,13 +203,20 @@ func (o *GetDatabasesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.
|
||||||
}
|
}
|
||||||
var res []error
|
var res []error
|
||||||
|
|
||||||
// query param databaseId
|
if o.DatabaseID != nil {
|
||||||
qrDatabaseID := o.DatabaseID
|
|
||||||
qDatabaseID := qrDatabaseID
|
|
||||||
if qDatabaseID != "" {
|
|
||||||
|
|
||||||
if err := r.SetQueryParam("databaseId", qDatabaseID); err != nil {
|
// query param databaseId
|
||||||
return err
|
var qrDatabaseID strfmt.UUID
|
||||||
|
|
||||||
|
if o.DatabaseID != nil {
|
||||||
|
qrDatabaseID = *o.DatabaseID
|
||||||
|
}
|
||||||
|
qDatabaseID := qrDatabaseID.String()
|
||||||
|
if qDatabaseID != "" {
|
||||||
|
|
||||||
|
if err := r.SetQueryParam("databaseId", qDatabaseID); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -227,6 +254,16 @@ func (o *GetDatabasesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// query param tenantId
|
||||||
|
qrTenantID := o.TenantID
|
||||||
|
qTenantID := qrTenantID.String()
|
||||||
|
if qTenantID != "" {
|
||||||
|
|
||||||
|
if err := r.SetQueryParam("tenantId", qTenantID); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if len(res) > 0 {
|
if len(res) > 0 {
|
||||||
return errors.CompositeValidationError(res...)
|
return errors.CompositeValidationError(res...)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -73,9 +73,9 @@ func NewGetDatabasesOK() *GetDatabasesOK {
|
||||||
|
|
||||||
// GetDatabasesOK describes a response with status code 200, with default header values.
|
// GetDatabasesOK describes a response with status code 200, with default header values.
|
||||||
//
|
//
|
||||||
// Response with Database objects
|
// Response with tenant-bound, credential-free Database metadata
|
||||||
type GetDatabasesOK struct {
|
type GetDatabasesOK struct {
|
||||||
Payload *members_models.DatabaseResponse
|
Payload *members_models.DatabaseMetadataResponse
|
||||||
}
|
}
|
||||||
|
|
||||||
// IsSuccess returns true when this get databases o k response has a 2xx status code
|
// IsSuccess returns true when this get databases o k response has a 2xx status code
|
||||||
|
|
@ -118,13 +118,13 @@ func (o *GetDatabasesOK) String() string {
|
||||||
return fmt.Sprintf("[GET /databases][%d] getDatabasesOK %s", 200, payload)
|
return fmt.Sprintf("[GET /databases][%d] getDatabasesOK %s", 200, payload)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (o *GetDatabasesOK) GetPayload() *members_models.DatabaseResponse {
|
func (o *GetDatabasesOK) GetPayload() *members_models.DatabaseMetadataResponse {
|
||||||
return o.Payload
|
return o.Payload
|
||||||
}
|
}
|
||||||
|
|
||||||
func (o *GetDatabasesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
func (o *GetDatabasesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||||
|
|
||||||
o.Payload = new(members_models.DatabaseResponse)
|
o.Payload = new(members_models.DatabaseMetadataResponse)
|
||||||
|
|
||||||
// response payload
|
// response payload
|
||||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
|
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
|
||||||
|
|
|
||||||
|
|
@ -1,159 +0,0 @@
|
||||||
// Code generated by go-swagger; DO NOT EDIT.
|
|
||||||
|
|
||||||
// (c) 2012-2020 by Taxnexus, Inc.
|
|
||||||
// All rights reserved worldwide.
|
|
||||||
// Proprietary product; unlicensed use is not allowed
|
|
||||||
|
|
||||||
package databases
|
|
||||||
|
|
||||||
import (
|
|
||||||
"context"
|
|
||||||
"net/http"
|
|
||||||
"time"
|
|
||||||
|
|
||||||
"code.tnxs.net/vernonkeenan/lib/api/members/members_models"
|
|
||||||
"github.com/go-openapi/errors"
|
|
||||||
"github.com/go-openapi/runtime"
|
|
||||||
cr "github.com/go-openapi/runtime/client"
|
|
||||||
"github.com/go-openapi/strfmt"
|
|
||||||
)
|
|
||||||
|
|
||||||
// NewPostDatabasesParams creates a new PostDatabasesParams object,
|
|
||||||
// with the default timeout for this client.
|
|
||||||
//
|
|
||||||
// Default values are not hydrated, since defaults are normally applied by the API server side.
|
|
||||||
//
|
|
||||||
// To enforce default values in parameter, use SetDefaults or WithDefaults.
|
|
||||||
func NewPostDatabasesParams() *PostDatabasesParams {
|
|
||||||
return NewPostDatabasesParamsWithTimeout(cr.DefaultTimeout)
|
|
||||||
}
|
|
||||||
|
|
||||||
// NewPostDatabasesParamsWithTimeout creates a new PostDatabasesParams object
|
|
||||||
// with the ability to set a timeout on a request.
|
|
||||||
func NewPostDatabasesParamsWithTimeout(timeout time.Duration) *PostDatabasesParams {
|
|
||||||
return &PostDatabasesParams{
|
|
||||||
inner: innerParams{
|
|
||||||
timeout: timeout,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// NewPostDatabasesParamsWithContext creates a new PostDatabasesParams object
|
|
||||||
// with the ability to set a context for a request.
|
|
||||||
//
|
|
||||||
// Deprecated: use the operation call with context to pass the context instead of [PostDatabasesParams].
|
|
||||||
func NewPostDatabasesParamsWithContext(ctx context.Context) *PostDatabasesParams {
|
|
||||||
return &PostDatabasesParams{
|
|
||||||
inner: innerParams{
|
|
||||||
ctx: ctx,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// NewPostDatabasesParamsWithHTTPClient creates a new PostDatabasesParams object
|
|
||||||
// with the ability to set a custom HTTPClient for a request.
|
|
||||||
func NewPostDatabasesParamsWithHTTPClient(client *http.Client) *PostDatabasesParams {
|
|
||||||
return &PostDatabasesParams{
|
|
||||||
HTTPClient: client,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
PostDatabasesParams contains all the parameters to send to the API endpoint
|
|
||||||
|
|
||||||
for the post databases operation.
|
|
||||||
|
|
||||||
Typically these are written to a http.Request.
|
|
||||||
*/
|
|
||||||
type PostDatabasesParams struct {
|
|
||||||
|
|
||||||
// DatabaseRequest.
|
|
||||||
//
|
|
||||||
// An array of Database records
|
|
||||||
DatabaseRequest *members_models.DatabaseRequest
|
|
||||||
|
|
||||||
HTTPClient *http.Client
|
|
||||||
|
|
||||||
inner innerParams
|
|
||||||
}
|
|
||||||
|
|
||||||
// WithDefaults hydrates default values in the post databases params (not the query body).
|
|
||||||
//
|
|
||||||
// All values with no default are reset to their zero value.
|
|
||||||
func (o *PostDatabasesParams) WithDefaults() *PostDatabasesParams {
|
|
||||||
o.SetDefaults()
|
|
||||||
return o
|
|
||||||
}
|
|
||||||
|
|
||||||
// SetDefaults hydrates default values in the post databases params (not the query body).
|
|
||||||
//
|
|
||||||
// All values with no default are reset to their zero value.
|
|
||||||
func (o *PostDatabasesParams) SetDefaults() {
|
|
||||||
// no default values defined for this parameter
|
|
||||||
}
|
|
||||||
|
|
||||||
// WithTimeout adds the timeout to the post databases params.
|
|
||||||
func (o *PostDatabasesParams) WithTimeout(timeout time.Duration) *PostDatabasesParams {
|
|
||||||
o.SetTimeout(timeout)
|
|
||||||
return o
|
|
||||||
}
|
|
||||||
|
|
||||||
// SetTimeout adds the timeout to the post databases params.
|
|
||||||
func (o *PostDatabasesParams) SetTimeout(timeout time.Duration) {
|
|
||||||
o.inner.timeout = timeout
|
|
||||||
}
|
|
||||||
|
|
||||||
// WithContext adds the context to the post databases params.
|
|
||||||
//
|
|
||||||
// Deprecated: use the operation call with context to pass the context instead of [PostDatabasesParams].
|
|
||||||
func (o *PostDatabasesParams) WithContext(ctx context.Context) *PostDatabasesParams {
|
|
||||||
o.SetContext(ctx)
|
|
||||||
return o
|
|
||||||
}
|
|
||||||
|
|
||||||
// SetContext adds the context to the post databases params.
|
|
||||||
//
|
|
||||||
// Deprecated: use the operation call with context to pass the context instead of [PostDatabasesParams].
|
|
||||||
func (o *PostDatabasesParams) SetContext(ctx context.Context) {
|
|
||||||
o.inner.ctx = ctx
|
|
||||||
}
|
|
||||||
|
|
||||||
// WithHTTPClient adds the HTTPClient to the post databases params.
|
|
||||||
func (o *PostDatabasesParams) WithHTTPClient(client *http.Client) *PostDatabasesParams {
|
|
||||||
o.SetHTTPClient(client)
|
|
||||||
return o
|
|
||||||
}
|
|
||||||
|
|
||||||
// SetHTTPClient adds the HTTPClient to the post databases params.
|
|
||||||
func (o *PostDatabasesParams) SetHTTPClient(client *http.Client) {
|
|
||||||
o.HTTPClient = client
|
|
||||||
}
|
|
||||||
|
|
||||||
// WithDatabaseRequest adds the databaseRequest to the post databases params.
|
|
||||||
func (o *PostDatabasesParams) WithDatabaseRequest(databaseRequest *members_models.DatabaseRequest) *PostDatabasesParams {
|
|
||||||
o.SetDatabaseRequest(databaseRequest)
|
|
||||||
return o
|
|
||||||
}
|
|
||||||
|
|
||||||
// SetDatabaseRequest adds the databaseRequest to the post databases params.
|
|
||||||
func (o *PostDatabasesParams) SetDatabaseRequest(databaseRequest *members_models.DatabaseRequest) {
|
|
||||||
o.DatabaseRequest = databaseRequest
|
|
||||||
}
|
|
||||||
|
|
||||||
// WriteToRequest writes these params to a [runtime.ClientRequest].
|
|
||||||
func (o *PostDatabasesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
|
||||||
if err := r.SetTimeout(o.inner.timeout); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
var res []error
|
|
||||||
if o.DatabaseRequest != nil {
|
|
||||||
if err := r.SetBodyParam(o.DatabaseRequest); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if len(res) > 0 {
|
|
||||||
return errors.CompositeValidationError(res...)
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
@ -1,484 +0,0 @@
|
||||||
// Code generated by go-swagger; DO NOT EDIT.
|
|
||||||
|
|
||||||
// (c) 2012-2020 by Taxnexus, Inc.
|
|
||||||
// All rights reserved worldwide.
|
|
||||||
// Proprietary product; unlicensed use is not allowed
|
|
||||||
|
|
||||||
package databases
|
|
||||||
|
|
||||||
import (
|
|
||||||
"encoding/json"
|
|
||||||
stderrors "errors"
|
|
||||||
"fmt"
|
|
||||||
"io"
|
|
||||||
|
|
||||||
"code.tnxs.net/vernonkeenan/lib/api/members/members_models"
|
|
||||||
"github.com/go-openapi/runtime"
|
|
||||||
"github.com/go-openapi/strfmt"
|
|
||||||
)
|
|
||||||
|
|
||||||
// PostDatabasesReader is a Reader for the PostDatabases structure.
|
|
||||||
type PostDatabasesReader struct {
|
|
||||||
formats strfmt.Registry
|
|
||||||
}
|
|
||||||
|
|
||||||
// ReadResponse reads a server response into the received o.
|
|
||||||
func (o *PostDatabasesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) {
|
|
||||||
switch response.Code() {
|
|
||||||
case 200:
|
|
||||||
result := NewPostDatabasesOK()
|
|
||||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
return result, nil
|
|
||||||
case 401:
|
|
||||||
result := NewPostDatabasesUnauthorized()
|
|
||||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
return nil, result
|
|
||||||
case 403:
|
|
||||||
result := NewPostDatabasesForbidden()
|
|
||||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
return nil, result
|
|
||||||
case 404:
|
|
||||||
result := NewPostDatabasesNotFound()
|
|
||||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
return nil, result
|
|
||||||
case 422:
|
|
||||||
result := NewPostDatabasesUnprocessableEntity()
|
|
||||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
return nil, result
|
|
||||||
case 500:
|
|
||||||
result := NewPostDatabasesInternalServerError()
|
|
||||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
return nil, result
|
|
||||||
default:
|
|
||||||
return nil, runtime.NewAPIError("[POST /databases] postDatabases", response, response.Code())
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// NewPostDatabasesOK creates a PostDatabasesOK with default headers values
|
|
||||||
func NewPostDatabasesOK() *PostDatabasesOK {
|
|
||||||
return &PostDatabasesOK{}
|
|
||||||
}
|
|
||||||
|
|
||||||
// PostDatabasesOK describes a response with status code 200, with default header values.
|
|
||||||
//
|
|
||||||
// Response with Database objects
|
|
||||||
type PostDatabasesOK struct {
|
|
||||||
Payload *members_models.DatabaseResponse
|
|
||||||
}
|
|
||||||
|
|
||||||
// IsSuccess returns true when this post databases o k response has a 2xx status code
|
|
||||||
func (o *PostDatabasesOK) IsSuccess() bool {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
|
|
||||||
// IsRedirect returns true when this post databases o k response has a 3xx status code
|
|
||||||
func (o *PostDatabasesOK) IsRedirect() bool {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
||||||
// IsClientError returns true when this post databases o k response has a 4xx status code
|
|
||||||
func (o *PostDatabasesOK) IsClientError() bool {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
||||||
// IsServerError returns true when this post databases o k response has a 5xx status code
|
|
||||||
func (o *PostDatabasesOK) IsServerError() bool {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
||||||
// IsCode returns true when this post databases o k response a status code equal to that given
|
|
||||||
func (o *PostDatabasesOK) IsCode(code int) bool {
|
|
||||||
return code == 200
|
|
||||||
}
|
|
||||||
|
|
||||||
// Code gets the status code for the post databases o k response
|
|
||||||
func (o *PostDatabasesOK) Code() int {
|
|
||||||
return 200
|
|
||||||
}
|
|
||||||
|
|
||||||
func (o *PostDatabasesOK) Error() string {
|
|
||||||
payload, _ := json.Marshal(o.Payload)
|
|
||||||
return fmt.Sprintf("[POST /databases][%d] postDatabasesOK %s", 200, payload)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (o *PostDatabasesOK) String() string {
|
|
||||||
payload, _ := json.Marshal(o.Payload)
|
|
||||||
return fmt.Sprintf("[POST /databases][%d] postDatabasesOK %s", 200, payload)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (o *PostDatabasesOK) GetPayload() *members_models.DatabaseResponse {
|
|
||||||
return o.Payload
|
|
||||||
}
|
|
||||||
|
|
||||||
func (o *PostDatabasesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
|
||||||
|
|
||||||
o.Payload = new(members_models.DatabaseResponse)
|
|
||||||
|
|
||||||
// response payload
|
|
||||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// NewPostDatabasesUnauthorized creates a PostDatabasesUnauthorized with default headers values
|
|
||||||
func NewPostDatabasesUnauthorized() *PostDatabasesUnauthorized {
|
|
||||||
return &PostDatabasesUnauthorized{}
|
|
||||||
}
|
|
||||||
|
|
||||||
// PostDatabasesUnauthorized describes a response with status code 401, with default header values.
|
|
||||||
//
|
|
||||||
// Access Unauthorized, invalid API-KEY was used
|
|
||||||
type PostDatabasesUnauthorized struct {
|
|
||||||
Payload *members_models.Error
|
|
||||||
}
|
|
||||||
|
|
||||||
// IsSuccess returns true when this post databases unauthorized response has a 2xx status code
|
|
||||||
func (o *PostDatabasesUnauthorized) IsSuccess() bool {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
||||||
// IsRedirect returns true when this post databases unauthorized response has a 3xx status code
|
|
||||||
func (o *PostDatabasesUnauthorized) IsRedirect() bool {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
||||||
// IsClientError returns true when this post databases unauthorized response has a 4xx status code
|
|
||||||
func (o *PostDatabasesUnauthorized) IsClientError() bool {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
|
|
||||||
// IsServerError returns true when this post databases unauthorized response has a 5xx status code
|
|
||||||
func (o *PostDatabasesUnauthorized) IsServerError() bool {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
||||||
// IsCode returns true when this post databases unauthorized response a status code equal to that given
|
|
||||||
func (o *PostDatabasesUnauthorized) IsCode(code int) bool {
|
|
||||||
return code == 401
|
|
||||||
}
|
|
||||||
|
|
||||||
// Code gets the status code for the post databases unauthorized response
|
|
||||||
func (o *PostDatabasesUnauthorized) Code() int {
|
|
||||||
return 401
|
|
||||||
}
|
|
||||||
|
|
||||||
func (o *PostDatabasesUnauthorized) Error() string {
|
|
||||||
payload, _ := json.Marshal(o.Payload)
|
|
||||||
return fmt.Sprintf("[POST /databases][%d] postDatabasesUnauthorized %s", 401, payload)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (o *PostDatabasesUnauthorized) String() string {
|
|
||||||
payload, _ := json.Marshal(o.Payload)
|
|
||||||
return fmt.Sprintf("[POST /databases][%d] postDatabasesUnauthorized %s", 401, payload)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (o *PostDatabasesUnauthorized) GetPayload() *members_models.Error {
|
|
||||||
return o.Payload
|
|
||||||
}
|
|
||||||
|
|
||||||
func (o *PostDatabasesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
|
||||||
|
|
||||||
o.Payload = new(members_models.Error)
|
|
||||||
|
|
||||||
// response payload
|
|
||||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// NewPostDatabasesForbidden creates a PostDatabasesForbidden with default headers values
|
|
||||||
func NewPostDatabasesForbidden() *PostDatabasesForbidden {
|
|
||||||
return &PostDatabasesForbidden{}
|
|
||||||
}
|
|
||||||
|
|
||||||
// PostDatabasesForbidden describes a response with status code 403, with default header values.
|
|
||||||
//
|
|
||||||
// Access forbidden, account lacks access
|
|
||||||
type PostDatabasesForbidden struct {
|
|
||||||
AccessControlAllowOrigin string
|
|
||||||
|
|
||||||
Payload *members_models.Error
|
|
||||||
}
|
|
||||||
|
|
||||||
// IsSuccess returns true when this post databases forbidden response has a 2xx status code
|
|
||||||
func (o *PostDatabasesForbidden) IsSuccess() bool {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
||||||
// IsRedirect returns true when this post databases forbidden response has a 3xx status code
|
|
||||||
func (o *PostDatabasesForbidden) IsRedirect() bool {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
||||||
// IsClientError returns true when this post databases forbidden response has a 4xx status code
|
|
||||||
func (o *PostDatabasesForbidden) IsClientError() bool {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
|
|
||||||
// IsServerError returns true when this post databases forbidden response has a 5xx status code
|
|
||||||
func (o *PostDatabasesForbidden) IsServerError() bool {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
||||||
// IsCode returns true when this post databases forbidden response a status code equal to that given
|
|
||||||
func (o *PostDatabasesForbidden) IsCode(code int) bool {
|
|
||||||
return code == 403
|
|
||||||
}
|
|
||||||
|
|
||||||
// Code gets the status code for the post databases forbidden response
|
|
||||||
func (o *PostDatabasesForbidden) Code() int {
|
|
||||||
return 403
|
|
||||||
}
|
|
||||||
|
|
||||||
func (o *PostDatabasesForbidden) Error() string {
|
|
||||||
payload, _ := json.Marshal(o.Payload)
|
|
||||||
return fmt.Sprintf("[POST /databases][%d] postDatabasesForbidden %s", 403, payload)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (o *PostDatabasesForbidden) String() string {
|
|
||||||
payload, _ := json.Marshal(o.Payload)
|
|
||||||
return fmt.Sprintf("[POST /databases][%d] postDatabasesForbidden %s", 403, payload)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (o *PostDatabasesForbidden) GetPayload() *members_models.Error {
|
|
||||||
return o.Payload
|
|
||||||
}
|
|
||||||
|
|
||||||
func (o *PostDatabasesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
|
||||||
|
|
||||||
// hydrates response header Access-Control-Allow-Origin
|
|
||||||
hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin")
|
|
||||||
|
|
||||||
if hdrAccessControlAllowOrigin != "" {
|
|
||||||
o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin
|
|
||||||
}
|
|
||||||
|
|
||||||
o.Payload = new(members_models.Error)
|
|
||||||
|
|
||||||
// response payload
|
|
||||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// NewPostDatabasesNotFound creates a PostDatabasesNotFound with default headers values
|
|
||||||
func NewPostDatabasesNotFound() *PostDatabasesNotFound {
|
|
||||||
return &PostDatabasesNotFound{}
|
|
||||||
}
|
|
||||||
|
|
||||||
// PostDatabasesNotFound describes a response with status code 404, with default header values.
|
|
||||||
//
|
|
||||||
// Resource was not found
|
|
||||||
type PostDatabasesNotFound struct {
|
|
||||||
Payload *members_models.Error
|
|
||||||
}
|
|
||||||
|
|
||||||
// IsSuccess returns true when this post databases not found response has a 2xx status code
|
|
||||||
func (o *PostDatabasesNotFound) IsSuccess() bool {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
||||||
// IsRedirect returns true when this post databases not found response has a 3xx status code
|
|
||||||
func (o *PostDatabasesNotFound) IsRedirect() bool {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
||||||
// IsClientError returns true when this post databases not found response has a 4xx status code
|
|
||||||
func (o *PostDatabasesNotFound) IsClientError() bool {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
|
|
||||||
// IsServerError returns true when this post databases not found response has a 5xx status code
|
|
||||||
func (o *PostDatabasesNotFound) IsServerError() bool {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
||||||
// IsCode returns true when this post databases not found response a status code equal to that given
|
|
||||||
func (o *PostDatabasesNotFound) IsCode(code int) bool {
|
|
||||||
return code == 404
|
|
||||||
}
|
|
||||||
|
|
||||||
// Code gets the status code for the post databases not found response
|
|
||||||
func (o *PostDatabasesNotFound) Code() int {
|
|
||||||
return 404
|
|
||||||
}
|
|
||||||
|
|
||||||
func (o *PostDatabasesNotFound) Error() string {
|
|
||||||
payload, _ := json.Marshal(o.Payload)
|
|
||||||
return fmt.Sprintf("[POST /databases][%d] postDatabasesNotFound %s", 404, payload)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (o *PostDatabasesNotFound) String() string {
|
|
||||||
payload, _ := json.Marshal(o.Payload)
|
|
||||||
return fmt.Sprintf("[POST /databases][%d] postDatabasesNotFound %s", 404, payload)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (o *PostDatabasesNotFound) GetPayload() *members_models.Error {
|
|
||||||
return o.Payload
|
|
||||||
}
|
|
||||||
|
|
||||||
func (o *PostDatabasesNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
|
||||||
|
|
||||||
o.Payload = new(members_models.Error)
|
|
||||||
|
|
||||||
// response payload
|
|
||||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// NewPostDatabasesUnprocessableEntity creates a PostDatabasesUnprocessableEntity with default headers values
|
|
||||||
func NewPostDatabasesUnprocessableEntity() *PostDatabasesUnprocessableEntity {
|
|
||||||
return &PostDatabasesUnprocessableEntity{}
|
|
||||||
}
|
|
||||||
|
|
||||||
// PostDatabasesUnprocessableEntity describes a response with status code 422, with default header values.
|
|
||||||
//
|
|
||||||
// Unprocessable Entity, likely a bad parameter
|
|
||||||
type PostDatabasesUnprocessableEntity struct {
|
|
||||||
Payload *members_models.Error
|
|
||||||
}
|
|
||||||
|
|
||||||
// IsSuccess returns true when this post databases unprocessable entity response has a 2xx status code
|
|
||||||
func (o *PostDatabasesUnprocessableEntity) IsSuccess() bool {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
||||||
// IsRedirect returns true when this post databases unprocessable entity response has a 3xx status code
|
|
||||||
func (o *PostDatabasesUnprocessableEntity) IsRedirect() bool {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
||||||
// IsClientError returns true when this post databases unprocessable entity response has a 4xx status code
|
|
||||||
func (o *PostDatabasesUnprocessableEntity) IsClientError() bool {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
|
|
||||||
// IsServerError returns true when this post databases unprocessable entity response has a 5xx status code
|
|
||||||
func (o *PostDatabasesUnprocessableEntity) IsServerError() bool {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
||||||
// IsCode returns true when this post databases unprocessable entity response a status code equal to that given
|
|
||||||
func (o *PostDatabasesUnprocessableEntity) IsCode(code int) bool {
|
|
||||||
return code == 422
|
|
||||||
}
|
|
||||||
|
|
||||||
// Code gets the status code for the post databases unprocessable entity response
|
|
||||||
func (o *PostDatabasesUnprocessableEntity) Code() int {
|
|
||||||
return 422
|
|
||||||
}
|
|
||||||
|
|
||||||
func (o *PostDatabasesUnprocessableEntity) Error() string {
|
|
||||||
payload, _ := json.Marshal(o.Payload)
|
|
||||||
return fmt.Sprintf("[POST /databases][%d] postDatabasesUnprocessableEntity %s", 422, payload)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (o *PostDatabasesUnprocessableEntity) String() string {
|
|
||||||
payload, _ := json.Marshal(o.Payload)
|
|
||||||
return fmt.Sprintf("[POST /databases][%d] postDatabasesUnprocessableEntity %s", 422, payload)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (o *PostDatabasesUnprocessableEntity) GetPayload() *members_models.Error {
|
|
||||||
return o.Payload
|
|
||||||
}
|
|
||||||
|
|
||||||
func (o *PostDatabasesUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
|
||||||
|
|
||||||
o.Payload = new(members_models.Error)
|
|
||||||
|
|
||||||
// response payload
|
|
||||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// NewPostDatabasesInternalServerError creates a PostDatabasesInternalServerError with default headers values
|
|
||||||
func NewPostDatabasesInternalServerError() *PostDatabasesInternalServerError {
|
|
||||||
return &PostDatabasesInternalServerError{}
|
|
||||||
}
|
|
||||||
|
|
||||||
// PostDatabasesInternalServerError describes a response with status code 500, with default header values.
|
|
||||||
//
|
|
||||||
// Server Internal Error
|
|
||||||
type PostDatabasesInternalServerError struct {
|
|
||||||
Payload *members_models.Error
|
|
||||||
}
|
|
||||||
|
|
||||||
// IsSuccess returns true when this post databases internal server error response has a 2xx status code
|
|
||||||
func (o *PostDatabasesInternalServerError) IsSuccess() bool {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
||||||
// IsRedirect returns true when this post databases internal server error response has a 3xx status code
|
|
||||||
func (o *PostDatabasesInternalServerError) IsRedirect() bool {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
||||||
// IsClientError returns true when this post databases internal server error response has a 4xx status code
|
|
||||||
func (o *PostDatabasesInternalServerError) IsClientError() bool {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
||||||
// IsServerError returns true when this post databases internal server error response has a 5xx status code
|
|
||||||
func (o *PostDatabasesInternalServerError) IsServerError() bool {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
|
|
||||||
// IsCode returns true when this post databases internal server error response a status code equal to that given
|
|
||||||
func (o *PostDatabasesInternalServerError) IsCode(code int) bool {
|
|
||||||
return code == 500
|
|
||||||
}
|
|
||||||
|
|
||||||
// Code gets the status code for the post databases internal server error response
|
|
||||||
func (o *PostDatabasesInternalServerError) Code() int {
|
|
||||||
return 500
|
|
||||||
}
|
|
||||||
|
|
||||||
func (o *PostDatabasesInternalServerError) Error() string {
|
|
||||||
payload, _ := json.Marshal(o.Payload)
|
|
||||||
return fmt.Sprintf("[POST /databases][%d] postDatabasesInternalServerError %s", 500, payload)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (o *PostDatabasesInternalServerError) String() string {
|
|
||||||
payload, _ := json.Marshal(o.Payload)
|
|
||||||
return fmt.Sprintf("[POST /databases][%d] postDatabasesInternalServerError %s", 500, payload)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (o *PostDatabasesInternalServerError) GetPayload() *members_models.Error {
|
|
||||||
return o.Payload
|
|
||||||
}
|
|
||||||
|
|
||||||
func (o *PostDatabasesInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
|
||||||
|
|
||||||
o.Payload = new(members_models.Error)
|
|
||||||
|
|
||||||
// response payload
|
|
||||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
@ -1,159 +0,0 @@
|
||||||
// Code generated by go-swagger; DO NOT EDIT.
|
|
||||||
|
|
||||||
// (c) 2012-2020 by Taxnexus, Inc.
|
|
||||||
// All rights reserved worldwide.
|
|
||||||
// Proprietary product; unlicensed use is not allowed
|
|
||||||
|
|
||||||
package databases
|
|
||||||
|
|
||||||
import (
|
|
||||||
"context"
|
|
||||||
"net/http"
|
|
||||||
"time"
|
|
||||||
|
|
||||||
"code.tnxs.net/vernonkeenan/lib/api/members/members_models"
|
|
||||||
"github.com/go-openapi/errors"
|
|
||||||
"github.com/go-openapi/runtime"
|
|
||||||
cr "github.com/go-openapi/runtime/client"
|
|
||||||
"github.com/go-openapi/strfmt"
|
|
||||||
)
|
|
||||||
|
|
||||||
// NewPutDatabasesParams creates a new PutDatabasesParams object,
|
|
||||||
// with the default timeout for this client.
|
|
||||||
//
|
|
||||||
// Default values are not hydrated, since defaults are normally applied by the API server side.
|
|
||||||
//
|
|
||||||
// To enforce default values in parameter, use SetDefaults or WithDefaults.
|
|
||||||
func NewPutDatabasesParams() *PutDatabasesParams {
|
|
||||||
return NewPutDatabasesParamsWithTimeout(cr.DefaultTimeout)
|
|
||||||
}
|
|
||||||
|
|
||||||
// NewPutDatabasesParamsWithTimeout creates a new PutDatabasesParams object
|
|
||||||
// with the ability to set a timeout on a request.
|
|
||||||
func NewPutDatabasesParamsWithTimeout(timeout time.Duration) *PutDatabasesParams {
|
|
||||||
return &PutDatabasesParams{
|
|
||||||
inner: innerParams{
|
|
||||||
timeout: timeout,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// NewPutDatabasesParamsWithContext creates a new PutDatabasesParams object
|
|
||||||
// with the ability to set a context for a request.
|
|
||||||
//
|
|
||||||
// Deprecated: use the operation call with context to pass the context instead of [PutDatabasesParams].
|
|
||||||
func NewPutDatabasesParamsWithContext(ctx context.Context) *PutDatabasesParams {
|
|
||||||
return &PutDatabasesParams{
|
|
||||||
inner: innerParams{
|
|
||||||
ctx: ctx,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// NewPutDatabasesParamsWithHTTPClient creates a new PutDatabasesParams object
|
|
||||||
// with the ability to set a custom HTTPClient for a request.
|
|
||||||
func NewPutDatabasesParamsWithHTTPClient(client *http.Client) *PutDatabasesParams {
|
|
||||||
return &PutDatabasesParams{
|
|
||||||
HTTPClient: client,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
PutDatabasesParams contains all the parameters to send to the API endpoint
|
|
||||||
|
|
||||||
for the put databases operation.
|
|
||||||
|
|
||||||
Typically these are written to a http.Request.
|
|
||||||
*/
|
|
||||||
type PutDatabasesParams struct {
|
|
||||||
|
|
||||||
// DatabaseRequest.
|
|
||||||
//
|
|
||||||
// An array of Database records
|
|
||||||
DatabaseRequest *members_models.DatabaseRequest
|
|
||||||
|
|
||||||
HTTPClient *http.Client
|
|
||||||
|
|
||||||
inner innerParams
|
|
||||||
}
|
|
||||||
|
|
||||||
// WithDefaults hydrates default values in the put databases params (not the query body).
|
|
||||||
//
|
|
||||||
// All values with no default are reset to their zero value.
|
|
||||||
func (o *PutDatabasesParams) WithDefaults() *PutDatabasesParams {
|
|
||||||
o.SetDefaults()
|
|
||||||
return o
|
|
||||||
}
|
|
||||||
|
|
||||||
// SetDefaults hydrates default values in the put databases params (not the query body).
|
|
||||||
//
|
|
||||||
// All values with no default are reset to their zero value.
|
|
||||||
func (o *PutDatabasesParams) SetDefaults() {
|
|
||||||
// no default values defined for this parameter
|
|
||||||
}
|
|
||||||
|
|
||||||
// WithTimeout adds the timeout to the put databases params.
|
|
||||||
func (o *PutDatabasesParams) WithTimeout(timeout time.Duration) *PutDatabasesParams {
|
|
||||||
o.SetTimeout(timeout)
|
|
||||||
return o
|
|
||||||
}
|
|
||||||
|
|
||||||
// SetTimeout adds the timeout to the put databases params.
|
|
||||||
func (o *PutDatabasesParams) SetTimeout(timeout time.Duration) {
|
|
||||||
o.inner.timeout = timeout
|
|
||||||
}
|
|
||||||
|
|
||||||
// WithContext adds the context to the put databases params.
|
|
||||||
//
|
|
||||||
// Deprecated: use the operation call with context to pass the context instead of [PutDatabasesParams].
|
|
||||||
func (o *PutDatabasesParams) WithContext(ctx context.Context) *PutDatabasesParams {
|
|
||||||
o.SetContext(ctx)
|
|
||||||
return o
|
|
||||||
}
|
|
||||||
|
|
||||||
// SetContext adds the context to the put databases params.
|
|
||||||
//
|
|
||||||
// Deprecated: use the operation call with context to pass the context instead of [PutDatabasesParams].
|
|
||||||
func (o *PutDatabasesParams) SetContext(ctx context.Context) {
|
|
||||||
o.inner.ctx = ctx
|
|
||||||
}
|
|
||||||
|
|
||||||
// WithHTTPClient adds the HTTPClient to the put databases params.
|
|
||||||
func (o *PutDatabasesParams) WithHTTPClient(client *http.Client) *PutDatabasesParams {
|
|
||||||
o.SetHTTPClient(client)
|
|
||||||
return o
|
|
||||||
}
|
|
||||||
|
|
||||||
// SetHTTPClient adds the HTTPClient to the put databases params.
|
|
||||||
func (o *PutDatabasesParams) SetHTTPClient(client *http.Client) {
|
|
||||||
o.HTTPClient = client
|
|
||||||
}
|
|
||||||
|
|
||||||
// WithDatabaseRequest adds the databaseRequest to the put databases params.
|
|
||||||
func (o *PutDatabasesParams) WithDatabaseRequest(databaseRequest *members_models.DatabaseRequest) *PutDatabasesParams {
|
|
||||||
o.SetDatabaseRequest(databaseRequest)
|
|
||||||
return o
|
|
||||||
}
|
|
||||||
|
|
||||||
// SetDatabaseRequest adds the databaseRequest to the put databases params.
|
|
||||||
func (o *PutDatabasesParams) SetDatabaseRequest(databaseRequest *members_models.DatabaseRequest) {
|
|
||||||
o.DatabaseRequest = databaseRequest
|
|
||||||
}
|
|
||||||
|
|
||||||
// WriteToRequest writes these params to a [runtime.ClientRequest].
|
|
||||||
func (o *PutDatabasesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
|
||||||
if err := r.SetTimeout(o.inner.timeout); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
var res []error
|
|
||||||
if o.DatabaseRequest != nil {
|
|
||||||
if err := r.SetBodyParam(o.DatabaseRequest); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if len(res) > 0 {
|
|
||||||
return errors.CompositeValidationError(res...)
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
@ -1,484 +0,0 @@
|
||||||
// Code generated by go-swagger; DO NOT EDIT.
|
|
||||||
|
|
||||||
// (c) 2012-2020 by Taxnexus, Inc.
|
|
||||||
// All rights reserved worldwide.
|
|
||||||
// Proprietary product; unlicensed use is not allowed
|
|
||||||
|
|
||||||
package databases
|
|
||||||
|
|
||||||
import (
|
|
||||||
"encoding/json"
|
|
||||||
stderrors "errors"
|
|
||||||
"fmt"
|
|
||||||
"io"
|
|
||||||
|
|
||||||
"code.tnxs.net/vernonkeenan/lib/api/members/members_models"
|
|
||||||
"github.com/go-openapi/runtime"
|
|
||||||
"github.com/go-openapi/strfmt"
|
|
||||||
)
|
|
||||||
|
|
||||||
// PutDatabasesReader is a Reader for the PutDatabases structure.
|
|
||||||
type PutDatabasesReader struct {
|
|
||||||
formats strfmt.Registry
|
|
||||||
}
|
|
||||||
|
|
||||||
// ReadResponse reads a server response into the received o.
|
|
||||||
func (o *PutDatabasesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) {
|
|
||||||
switch response.Code() {
|
|
||||||
case 200:
|
|
||||||
result := NewPutDatabasesOK()
|
|
||||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
return result, nil
|
|
||||||
case 401:
|
|
||||||
result := NewPutDatabasesUnauthorized()
|
|
||||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
return nil, result
|
|
||||||
case 403:
|
|
||||||
result := NewPutDatabasesForbidden()
|
|
||||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
return nil, result
|
|
||||||
case 404:
|
|
||||||
result := NewPutDatabasesNotFound()
|
|
||||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
return nil, result
|
|
||||||
case 422:
|
|
||||||
result := NewPutDatabasesUnprocessableEntity()
|
|
||||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
return nil, result
|
|
||||||
case 500:
|
|
||||||
result := NewPutDatabasesInternalServerError()
|
|
||||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
return nil, result
|
|
||||||
default:
|
|
||||||
return nil, runtime.NewAPIError("[PUT /databases] putDatabases", response, response.Code())
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// NewPutDatabasesOK creates a PutDatabasesOK with default headers values
|
|
||||||
func NewPutDatabasesOK() *PutDatabasesOK {
|
|
||||||
return &PutDatabasesOK{}
|
|
||||||
}
|
|
||||||
|
|
||||||
// PutDatabasesOK describes a response with status code 200, with default header values.
|
|
||||||
//
|
|
||||||
// Response with Database objects
|
|
||||||
type PutDatabasesOK struct {
|
|
||||||
Payload *members_models.DatabaseResponse
|
|
||||||
}
|
|
||||||
|
|
||||||
// IsSuccess returns true when this put databases o k response has a 2xx status code
|
|
||||||
func (o *PutDatabasesOK) IsSuccess() bool {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
|
|
||||||
// IsRedirect returns true when this put databases o k response has a 3xx status code
|
|
||||||
func (o *PutDatabasesOK) IsRedirect() bool {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
||||||
// IsClientError returns true when this put databases o k response has a 4xx status code
|
|
||||||
func (o *PutDatabasesOK) IsClientError() bool {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
||||||
// IsServerError returns true when this put databases o k response has a 5xx status code
|
|
||||||
func (o *PutDatabasesOK) IsServerError() bool {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
||||||
// IsCode returns true when this put databases o k response a status code equal to that given
|
|
||||||
func (o *PutDatabasesOK) IsCode(code int) bool {
|
|
||||||
return code == 200
|
|
||||||
}
|
|
||||||
|
|
||||||
// Code gets the status code for the put databases o k response
|
|
||||||
func (o *PutDatabasesOK) Code() int {
|
|
||||||
return 200
|
|
||||||
}
|
|
||||||
|
|
||||||
func (o *PutDatabasesOK) Error() string {
|
|
||||||
payload, _ := json.Marshal(o.Payload)
|
|
||||||
return fmt.Sprintf("[PUT /databases][%d] putDatabasesOK %s", 200, payload)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (o *PutDatabasesOK) String() string {
|
|
||||||
payload, _ := json.Marshal(o.Payload)
|
|
||||||
return fmt.Sprintf("[PUT /databases][%d] putDatabasesOK %s", 200, payload)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (o *PutDatabasesOK) GetPayload() *members_models.DatabaseResponse {
|
|
||||||
return o.Payload
|
|
||||||
}
|
|
||||||
|
|
||||||
func (o *PutDatabasesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
|
||||||
|
|
||||||
o.Payload = new(members_models.DatabaseResponse)
|
|
||||||
|
|
||||||
// response payload
|
|
||||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// NewPutDatabasesUnauthorized creates a PutDatabasesUnauthorized with default headers values
|
|
||||||
func NewPutDatabasesUnauthorized() *PutDatabasesUnauthorized {
|
|
||||||
return &PutDatabasesUnauthorized{}
|
|
||||||
}
|
|
||||||
|
|
||||||
// PutDatabasesUnauthorized describes a response with status code 401, with default header values.
|
|
||||||
//
|
|
||||||
// Access Unauthorized, invalid API-KEY was used
|
|
||||||
type PutDatabasesUnauthorized struct {
|
|
||||||
Payload *members_models.Error
|
|
||||||
}
|
|
||||||
|
|
||||||
// IsSuccess returns true when this put databases unauthorized response has a 2xx status code
|
|
||||||
func (o *PutDatabasesUnauthorized) IsSuccess() bool {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
||||||
// IsRedirect returns true when this put databases unauthorized response has a 3xx status code
|
|
||||||
func (o *PutDatabasesUnauthorized) IsRedirect() bool {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
||||||
// IsClientError returns true when this put databases unauthorized response has a 4xx status code
|
|
||||||
func (o *PutDatabasesUnauthorized) IsClientError() bool {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
|
|
||||||
// IsServerError returns true when this put databases unauthorized response has a 5xx status code
|
|
||||||
func (o *PutDatabasesUnauthorized) IsServerError() bool {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
||||||
// IsCode returns true when this put databases unauthorized response a status code equal to that given
|
|
||||||
func (o *PutDatabasesUnauthorized) IsCode(code int) bool {
|
|
||||||
return code == 401
|
|
||||||
}
|
|
||||||
|
|
||||||
// Code gets the status code for the put databases unauthorized response
|
|
||||||
func (o *PutDatabasesUnauthorized) Code() int {
|
|
||||||
return 401
|
|
||||||
}
|
|
||||||
|
|
||||||
func (o *PutDatabasesUnauthorized) Error() string {
|
|
||||||
payload, _ := json.Marshal(o.Payload)
|
|
||||||
return fmt.Sprintf("[PUT /databases][%d] putDatabasesUnauthorized %s", 401, payload)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (o *PutDatabasesUnauthorized) String() string {
|
|
||||||
payload, _ := json.Marshal(o.Payload)
|
|
||||||
return fmt.Sprintf("[PUT /databases][%d] putDatabasesUnauthorized %s", 401, payload)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (o *PutDatabasesUnauthorized) GetPayload() *members_models.Error {
|
|
||||||
return o.Payload
|
|
||||||
}
|
|
||||||
|
|
||||||
func (o *PutDatabasesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
|
||||||
|
|
||||||
o.Payload = new(members_models.Error)
|
|
||||||
|
|
||||||
// response payload
|
|
||||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// NewPutDatabasesForbidden creates a PutDatabasesForbidden with default headers values
|
|
||||||
func NewPutDatabasesForbidden() *PutDatabasesForbidden {
|
|
||||||
return &PutDatabasesForbidden{}
|
|
||||||
}
|
|
||||||
|
|
||||||
// PutDatabasesForbidden describes a response with status code 403, with default header values.
|
|
||||||
//
|
|
||||||
// Access forbidden, account lacks access
|
|
||||||
type PutDatabasesForbidden struct {
|
|
||||||
AccessControlAllowOrigin string
|
|
||||||
|
|
||||||
Payload *members_models.Error
|
|
||||||
}
|
|
||||||
|
|
||||||
// IsSuccess returns true when this put databases forbidden response has a 2xx status code
|
|
||||||
func (o *PutDatabasesForbidden) IsSuccess() bool {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
||||||
// IsRedirect returns true when this put databases forbidden response has a 3xx status code
|
|
||||||
func (o *PutDatabasesForbidden) IsRedirect() bool {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
||||||
// IsClientError returns true when this put databases forbidden response has a 4xx status code
|
|
||||||
func (o *PutDatabasesForbidden) IsClientError() bool {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
|
|
||||||
// IsServerError returns true when this put databases forbidden response has a 5xx status code
|
|
||||||
func (o *PutDatabasesForbidden) IsServerError() bool {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
||||||
// IsCode returns true when this put databases forbidden response a status code equal to that given
|
|
||||||
func (o *PutDatabasesForbidden) IsCode(code int) bool {
|
|
||||||
return code == 403
|
|
||||||
}
|
|
||||||
|
|
||||||
// Code gets the status code for the put databases forbidden response
|
|
||||||
func (o *PutDatabasesForbidden) Code() int {
|
|
||||||
return 403
|
|
||||||
}
|
|
||||||
|
|
||||||
func (o *PutDatabasesForbidden) Error() string {
|
|
||||||
payload, _ := json.Marshal(o.Payload)
|
|
||||||
return fmt.Sprintf("[PUT /databases][%d] putDatabasesForbidden %s", 403, payload)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (o *PutDatabasesForbidden) String() string {
|
|
||||||
payload, _ := json.Marshal(o.Payload)
|
|
||||||
return fmt.Sprintf("[PUT /databases][%d] putDatabasesForbidden %s", 403, payload)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (o *PutDatabasesForbidden) GetPayload() *members_models.Error {
|
|
||||||
return o.Payload
|
|
||||||
}
|
|
||||||
|
|
||||||
func (o *PutDatabasesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
|
||||||
|
|
||||||
// hydrates response header Access-Control-Allow-Origin
|
|
||||||
hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin")
|
|
||||||
|
|
||||||
if hdrAccessControlAllowOrigin != "" {
|
|
||||||
o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin
|
|
||||||
}
|
|
||||||
|
|
||||||
o.Payload = new(members_models.Error)
|
|
||||||
|
|
||||||
// response payload
|
|
||||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// NewPutDatabasesNotFound creates a PutDatabasesNotFound with default headers values
|
|
||||||
func NewPutDatabasesNotFound() *PutDatabasesNotFound {
|
|
||||||
return &PutDatabasesNotFound{}
|
|
||||||
}
|
|
||||||
|
|
||||||
// PutDatabasesNotFound describes a response with status code 404, with default header values.
|
|
||||||
//
|
|
||||||
// Resource was not found
|
|
||||||
type PutDatabasesNotFound struct {
|
|
||||||
Payload *members_models.Error
|
|
||||||
}
|
|
||||||
|
|
||||||
// IsSuccess returns true when this put databases not found response has a 2xx status code
|
|
||||||
func (o *PutDatabasesNotFound) IsSuccess() bool {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
||||||
// IsRedirect returns true when this put databases not found response has a 3xx status code
|
|
||||||
func (o *PutDatabasesNotFound) IsRedirect() bool {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
||||||
// IsClientError returns true when this put databases not found response has a 4xx status code
|
|
||||||
func (o *PutDatabasesNotFound) IsClientError() bool {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
|
|
||||||
// IsServerError returns true when this put databases not found response has a 5xx status code
|
|
||||||
func (o *PutDatabasesNotFound) IsServerError() bool {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
||||||
// IsCode returns true when this put databases not found response a status code equal to that given
|
|
||||||
func (o *PutDatabasesNotFound) IsCode(code int) bool {
|
|
||||||
return code == 404
|
|
||||||
}
|
|
||||||
|
|
||||||
// Code gets the status code for the put databases not found response
|
|
||||||
func (o *PutDatabasesNotFound) Code() int {
|
|
||||||
return 404
|
|
||||||
}
|
|
||||||
|
|
||||||
func (o *PutDatabasesNotFound) Error() string {
|
|
||||||
payload, _ := json.Marshal(o.Payload)
|
|
||||||
return fmt.Sprintf("[PUT /databases][%d] putDatabasesNotFound %s", 404, payload)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (o *PutDatabasesNotFound) String() string {
|
|
||||||
payload, _ := json.Marshal(o.Payload)
|
|
||||||
return fmt.Sprintf("[PUT /databases][%d] putDatabasesNotFound %s", 404, payload)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (o *PutDatabasesNotFound) GetPayload() *members_models.Error {
|
|
||||||
return o.Payload
|
|
||||||
}
|
|
||||||
|
|
||||||
func (o *PutDatabasesNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
|
||||||
|
|
||||||
o.Payload = new(members_models.Error)
|
|
||||||
|
|
||||||
// response payload
|
|
||||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// NewPutDatabasesUnprocessableEntity creates a PutDatabasesUnprocessableEntity with default headers values
|
|
||||||
func NewPutDatabasesUnprocessableEntity() *PutDatabasesUnprocessableEntity {
|
|
||||||
return &PutDatabasesUnprocessableEntity{}
|
|
||||||
}
|
|
||||||
|
|
||||||
// PutDatabasesUnprocessableEntity describes a response with status code 422, with default header values.
|
|
||||||
//
|
|
||||||
// Unprocessable Entity, likely a bad parameter
|
|
||||||
type PutDatabasesUnprocessableEntity struct {
|
|
||||||
Payload *members_models.Error
|
|
||||||
}
|
|
||||||
|
|
||||||
// IsSuccess returns true when this put databases unprocessable entity response has a 2xx status code
|
|
||||||
func (o *PutDatabasesUnprocessableEntity) IsSuccess() bool {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
||||||
// IsRedirect returns true when this put databases unprocessable entity response has a 3xx status code
|
|
||||||
func (o *PutDatabasesUnprocessableEntity) IsRedirect() bool {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
||||||
// IsClientError returns true when this put databases unprocessable entity response has a 4xx status code
|
|
||||||
func (o *PutDatabasesUnprocessableEntity) IsClientError() bool {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
|
|
||||||
// IsServerError returns true when this put databases unprocessable entity response has a 5xx status code
|
|
||||||
func (o *PutDatabasesUnprocessableEntity) IsServerError() bool {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
||||||
// IsCode returns true when this put databases unprocessable entity response a status code equal to that given
|
|
||||||
func (o *PutDatabasesUnprocessableEntity) IsCode(code int) bool {
|
|
||||||
return code == 422
|
|
||||||
}
|
|
||||||
|
|
||||||
// Code gets the status code for the put databases unprocessable entity response
|
|
||||||
func (o *PutDatabasesUnprocessableEntity) Code() int {
|
|
||||||
return 422
|
|
||||||
}
|
|
||||||
|
|
||||||
func (o *PutDatabasesUnprocessableEntity) Error() string {
|
|
||||||
payload, _ := json.Marshal(o.Payload)
|
|
||||||
return fmt.Sprintf("[PUT /databases][%d] putDatabasesUnprocessableEntity %s", 422, payload)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (o *PutDatabasesUnprocessableEntity) String() string {
|
|
||||||
payload, _ := json.Marshal(o.Payload)
|
|
||||||
return fmt.Sprintf("[PUT /databases][%d] putDatabasesUnprocessableEntity %s", 422, payload)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (o *PutDatabasesUnprocessableEntity) GetPayload() *members_models.Error {
|
|
||||||
return o.Payload
|
|
||||||
}
|
|
||||||
|
|
||||||
func (o *PutDatabasesUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
|
||||||
|
|
||||||
o.Payload = new(members_models.Error)
|
|
||||||
|
|
||||||
// response payload
|
|
||||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// NewPutDatabasesInternalServerError creates a PutDatabasesInternalServerError with default headers values
|
|
||||||
func NewPutDatabasesInternalServerError() *PutDatabasesInternalServerError {
|
|
||||||
return &PutDatabasesInternalServerError{}
|
|
||||||
}
|
|
||||||
|
|
||||||
// PutDatabasesInternalServerError describes a response with status code 500, with default header values.
|
|
||||||
//
|
|
||||||
// Server Internal Error
|
|
||||||
type PutDatabasesInternalServerError struct {
|
|
||||||
Payload *members_models.Error
|
|
||||||
}
|
|
||||||
|
|
||||||
// IsSuccess returns true when this put databases internal server error response has a 2xx status code
|
|
||||||
func (o *PutDatabasesInternalServerError) IsSuccess() bool {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
||||||
// IsRedirect returns true when this put databases internal server error response has a 3xx status code
|
|
||||||
func (o *PutDatabasesInternalServerError) IsRedirect() bool {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
||||||
// IsClientError returns true when this put databases internal server error response has a 4xx status code
|
|
||||||
func (o *PutDatabasesInternalServerError) IsClientError() bool {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
||||||
// IsServerError returns true when this put databases internal server error response has a 5xx status code
|
|
||||||
func (o *PutDatabasesInternalServerError) IsServerError() bool {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
|
|
||||||
// IsCode returns true when this put databases internal server error response a status code equal to that given
|
|
||||||
func (o *PutDatabasesInternalServerError) IsCode(code int) bool {
|
|
||||||
return code == 500
|
|
||||||
}
|
|
||||||
|
|
||||||
// Code gets the status code for the put databases internal server error response
|
|
||||||
func (o *PutDatabasesInternalServerError) Code() int {
|
|
||||||
return 500
|
|
||||||
}
|
|
||||||
|
|
||||||
func (o *PutDatabasesInternalServerError) Error() string {
|
|
||||||
payload, _ := json.Marshal(o.Payload)
|
|
||||||
return fmt.Sprintf("[PUT /databases][%d] putDatabasesInternalServerError %s", 500, payload)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (o *PutDatabasesInternalServerError) String() string {
|
|
||||||
payload, _ := json.Marshal(o.Payload)
|
|
||||||
return fmt.Sprintf("[PUT /databases][%d] putDatabasesInternalServerError %s", 500, payload)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (o *PutDatabasesInternalServerError) GetPayload() *members_models.Error {
|
|
||||||
return o.Payload
|
|
||||||
}
|
|
||||||
|
|
||||||
func (o *PutDatabasesInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
|
||||||
|
|
||||||
o.Payload = new(members_models.Error)
|
|
||||||
|
|
||||||
// response payload
|
|
||||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
@ -23,7 +23,7 @@ import (
|
||||||
"github.com/go-openapi/strfmt"
|
"github.com/go-openapi/strfmt"
|
||||||
)
|
)
|
||||||
|
|
||||||
const membersProviderSpecSHA256 = "4b7d409b5e989632ca4b0ab9a5a868dc1234a89b4dc3ba1fef307cd306478a6c"
|
const membersProviderSpecSHA256 = "fac8e386cb348993648644ba89c1bc14effbce679b2323ecdc332d1b4401d6ea"
|
||||||
|
|
||||||
var learningTestAuth = openapiruntime.ClientAuthInfoWriterFunc(func(openapiruntime.ClientRequest, strfmt.Registry) error {
|
var learningTestAuth = openapiruntime.ClientAuthInfoWriterFunc(func(openapiruntime.ClientRequest, strfmt.Registry) error {
|
||||||
return nil
|
return nil
|
||||||
|
|
@ -517,7 +517,7 @@ func TestMembersSpecIsPinnedToProviderSource(t *testing.T) {
|
||||||
}
|
}
|
||||||
sum := sha256.Sum256(mainSpec)
|
sum := sha256.Sum256(mainSpec)
|
||||||
if got := hex.EncodeToString(sum[:]); got != membersProviderSpecSHA256 {
|
if got := hex.EncodeToString(sum[:]); got != membersProviderSpecSHA256 {
|
||||||
t.Fatalf("Members spec drifted from the integrated TrackEvent, Transaction, TrackTopic, and TrackUser provider contract: SHA-256 = %s, want %s", got, membersProviderSpecSHA256)
|
t.Fatalf("Members spec drifted from the integrated TrackEvent, Transaction, TrackTopic, TrackUser, and Database metadata provider contract: SHA-256 = %s, want %s", got, membersProviderSpecSHA256)
|
||||||
}
|
}
|
||||||
|
|
||||||
externalSpec, err := os.ReadFile(filepath.Join(repoRoot, "swagger", "external", "members-vernonkeenan.yaml"))
|
externalSpec, err := os.ReadFile(filepath.Join(repoRoot, "swagger", "external", "members-vernonkeenan.yaml"))
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@ import (
|
||||||
"github.com/go-openapi/strfmt"
|
"github.com/go-openapi/strfmt"
|
||||||
)
|
)
|
||||||
|
|
||||||
const membersTrackSpecSHA256 = "4b7d409b5e989632ca4b0ab9a5a868dc1234a89b4dc3ba1fef307cd306478a6c"
|
const membersTrackSpecSHA256 = "fac8e386cb348993648644ba89c1bc14effbce679b2323ecdc332d1b4401d6ea"
|
||||||
|
|
||||||
var trackTestAuth = openapiruntime.ClientAuthInfoWriterFunc(
|
var trackTestAuth = openapiruntime.ClientAuthInfoWriterFunc(
|
||||||
func(openapiruntime.ClientRequest, strfmt.Registry) error { return nil },
|
func(openapiruntime.ClientRequest, strfmt.Registry) error { return nil },
|
||||||
|
|
@ -203,7 +203,7 @@ func TestMembersSpecIsPinnedToTrackProviderCommit(t *testing.T) {
|
||||||
sum := sha256.Sum256(mainSpec)
|
sum := sha256.Sum256(mainSpec)
|
||||||
if got := hex.EncodeToString(sum[:]); got != membersTrackSpecSHA256 {
|
if got := hex.EncodeToString(sum[:]); got != membersTrackSpecSHA256 {
|
||||||
t.Fatalf(
|
t.Fatalf(
|
||||||
"Members spec drifted from the integrated TrackEvent, Transaction, TrackTopic, and TrackUser provider contract: SHA-256 = %s, want %s",
|
"Members spec drifted from the integrated TrackEvent, Transaction, TrackTopic, TrackUser, and Database metadata provider contract: SHA-256 = %s, want %s",
|
||||||
got, membersTrackSpecSHA256,
|
got, membersTrackSpecSHA256,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,172 @@
|
||||||
|
// Code generated by go-swagger; DO NOT EDIT.
|
||||||
|
|
||||||
|
// (c) 2012-2020 by Taxnexus, Inc.
|
||||||
|
// All rights reserved worldwide.
|
||||||
|
// Proprietary product; unlicensed use is not allowed
|
||||||
|
|
||||||
|
package members_models
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
|
||||||
|
"github.com/go-openapi/errors"
|
||||||
|
"github.com/go-openapi/strfmt"
|
||||||
|
"github.com/go-openapi/swag/jsonutils"
|
||||||
|
"github.com/go-openapi/swag/typeutils"
|
||||||
|
"github.com/go-openapi/validate"
|
||||||
|
)
|
||||||
|
|
||||||
|
// DatabaseMetadata Credential-free metadata for a Database provisioned and owned by a Tenant
|
||||||
|
//
|
||||||
|
// swagger:model DatabaseMetadata
|
||||||
|
type DatabaseMetadata struct {
|
||||||
|
|
||||||
|
// Whether the Database is active
|
||||||
|
Active *bool `json:"Active,omitempty"`
|
||||||
|
|
||||||
|
// Optional Cluster in the same Tenant
|
||||||
|
// Format: uuid
|
||||||
|
ClusterID *strfmt.UUID `json:"ClusterID,omitempty"`
|
||||||
|
|
||||||
|
// Server-owned creation timestamp
|
||||||
|
// Format: date-time
|
||||||
|
CreatedDate *strfmt.DateTime `json:"CreatedDate,omitempty"`
|
||||||
|
|
||||||
|
// Physical Database name
|
||||||
|
DatabaseName *string `json:"DatabaseName,omitempty"`
|
||||||
|
|
||||||
|
// Server-owned Database record ID
|
||||||
|
// Required: true
|
||||||
|
// Format: uuid
|
||||||
|
ID *strfmt.UUID `json:"ID"`
|
||||||
|
|
||||||
|
// Server-owned modification timestamp
|
||||||
|
// Format: date-time
|
||||||
|
LastModifiedDate *strfmt.DateTime `json:"LastModifiedDate,omitempty"`
|
||||||
|
|
||||||
|
// Database status metadata
|
||||||
|
Status *string `json:"Status,omitempty"`
|
||||||
|
|
||||||
|
// Tenant that owns the Database
|
||||||
|
// Required: true
|
||||||
|
// Format: uuid
|
||||||
|
TenantID *strfmt.UUID `json:"TenantID"`
|
||||||
|
|
||||||
|
// Database engine type
|
||||||
|
Type *string `json:"Type,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// Validate validates this database metadata
|
||||||
|
func (m *DatabaseMetadata) Validate(formats strfmt.Registry) error {
|
||||||
|
var res []error
|
||||||
|
|
||||||
|
if err := m.validateClusterID(formats); err != nil {
|
||||||
|
res = append(res, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := m.validateCreatedDate(formats); err != nil {
|
||||||
|
res = append(res, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := m.validateID(formats); err != nil {
|
||||||
|
res = append(res, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := m.validateLastModifiedDate(formats); err != nil {
|
||||||
|
res = append(res, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := m.validateTenantID(formats); err != nil {
|
||||||
|
res = append(res, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(res) > 0 {
|
||||||
|
return errors.CompositeValidationError(res...)
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *DatabaseMetadata) validateClusterID(formats strfmt.Registry) error {
|
||||||
|
if typeutils.IsZero(m.ClusterID) { // not required
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := validate.FormatOf("ClusterID", "body", "uuid", m.ClusterID.String(), formats); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *DatabaseMetadata) validateCreatedDate(formats strfmt.Registry) error {
|
||||||
|
if typeutils.IsZero(m.CreatedDate) { // not required
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := validate.FormatOf("CreatedDate", "body", "date-time", m.CreatedDate.String(), formats); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *DatabaseMetadata) validateID(formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
if err := validate.Required("ID", "body", m.ID); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := validate.FormatOf("ID", "body", "uuid", m.ID.String(), formats); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *DatabaseMetadata) validateLastModifiedDate(formats strfmt.Registry) error {
|
||||||
|
if typeutils.IsZero(m.LastModifiedDate) { // not required
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := validate.FormatOf("LastModifiedDate", "body", "date-time", m.LastModifiedDate.String(), formats); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *DatabaseMetadata) validateTenantID(formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
if err := validate.Required("TenantID", "body", m.TenantID); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := validate.FormatOf("TenantID", "body", "uuid", m.TenantID.String(), formats); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// ContextValidate validates this database metadata based on context it is used
|
||||||
|
func (m *DatabaseMetadata) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// MarshalBinary interface implementation
|
||||||
|
func (m *DatabaseMetadata) MarshalBinary() ([]byte, error) {
|
||||||
|
if m == nil {
|
||||||
|
return nil, nil
|
||||||
|
}
|
||||||
|
return jsonutils.WriteJSON(m)
|
||||||
|
}
|
||||||
|
|
||||||
|
// UnmarshalBinary interface implementation
|
||||||
|
func (m *DatabaseMetadata) UnmarshalBinary(b []byte) error {
|
||||||
|
var res DatabaseMetadata
|
||||||
|
if err := jsonutils.ReadJSON(b, &res); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
*m = res
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,191 @@
|
||||||
|
// Code generated by go-swagger; DO NOT EDIT.
|
||||||
|
|
||||||
|
// (c) 2012-2020 by Taxnexus, Inc.
|
||||||
|
// All rights reserved worldwide.
|
||||||
|
// Proprietary product; unlicensed use is not allowed
|
||||||
|
|
||||||
|
package members_models
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
stderrors "errors"
|
||||||
|
"strconv"
|
||||||
|
|
||||||
|
"github.com/go-openapi/errors"
|
||||||
|
"github.com/go-openapi/strfmt"
|
||||||
|
"github.com/go-openapi/swag/jsonutils"
|
||||||
|
"github.com/go-openapi/swag/typeutils"
|
||||||
|
)
|
||||||
|
|
||||||
|
// DatabaseMetadataResponse Tenant-bound Database metadata with DSN and provisioning credentials omitted
|
||||||
|
//
|
||||||
|
// swagger:model DatabaseMetadataResponse
|
||||||
|
type DatabaseMetadataResponse struct {
|
||||||
|
|
||||||
|
// data
|
||||||
|
Data []*DatabaseMetadata `json:"Data"`
|
||||||
|
|
||||||
|
// meta
|
||||||
|
Meta *ResponseMeta `json:"Meta,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// Validate validates this database metadata response
|
||||||
|
func (m *DatabaseMetadataResponse) Validate(formats strfmt.Registry) error {
|
||||||
|
var res []error
|
||||||
|
|
||||||
|
if err := m.validateData(formats); err != nil {
|
||||||
|
res = append(res, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := m.validateMeta(formats); err != nil {
|
||||||
|
res = append(res, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(res) > 0 {
|
||||||
|
return errors.CompositeValidationError(res...)
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *DatabaseMetadataResponse) validateData(formats strfmt.Registry) error {
|
||||||
|
if typeutils.IsZero(m.Data) { // not required
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
for i := 0; i < len(m.Data); i++ {
|
||||||
|
if typeutils.IsZero(m.Data[i]) { // not required
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
if m.Data[i] != nil {
|
||||||
|
if err := m.Data[i].Validate(formats); err != nil {
|
||||||
|
ve := new(errors.Validation)
|
||||||
|
if stderrors.As(err, &ve) {
|
||||||
|
return ve.ValidateName("Data" + "." + strconv.Itoa(i))
|
||||||
|
}
|
||||||
|
ce := new(errors.CompositeError)
|
||||||
|
if stderrors.As(err, &ce) {
|
||||||
|
return ce.ValidateName("Data" + "." + strconv.Itoa(i))
|
||||||
|
}
|
||||||
|
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *DatabaseMetadataResponse) validateMeta(formats strfmt.Registry) error {
|
||||||
|
if typeutils.IsZero(m.Meta) { // not required
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
if m.Meta != nil {
|
||||||
|
if err := m.Meta.Validate(formats); err != nil {
|
||||||
|
ve := new(errors.Validation)
|
||||||
|
if stderrors.As(err, &ve) {
|
||||||
|
return ve.ValidateName("Meta")
|
||||||
|
}
|
||||||
|
ce := new(errors.CompositeError)
|
||||||
|
if stderrors.As(err, &ce) {
|
||||||
|
return ce.ValidateName("Meta")
|
||||||
|
}
|
||||||
|
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// ContextValidate validate this database metadata response based on the context it is used
|
||||||
|
func (m *DatabaseMetadataResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
|
||||||
|
var res []error
|
||||||
|
|
||||||
|
if err := m.contextValidateData(ctx, formats); err != nil {
|
||||||
|
res = append(res, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := m.contextValidateMeta(ctx, formats); err != nil {
|
||||||
|
res = append(res, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(res) > 0 {
|
||||||
|
return errors.CompositeValidationError(res...)
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *DatabaseMetadataResponse) contextValidateData(ctx context.Context, formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
for i := 0; i < len(m.Data); i++ {
|
||||||
|
|
||||||
|
if m.Data[i] != nil {
|
||||||
|
|
||||||
|
if typeutils.IsZero(m.Data[i]) { // not required
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := m.Data[i].ContextValidate(ctx, formats); err != nil {
|
||||||
|
ve := new(errors.Validation)
|
||||||
|
if stderrors.As(err, &ve) {
|
||||||
|
return ve.ValidateName("Data" + "." + strconv.Itoa(i))
|
||||||
|
}
|
||||||
|
ce := new(errors.CompositeError)
|
||||||
|
if stderrors.As(err, &ce) {
|
||||||
|
return ce.ValidateName("Data" + "." + strconv.Itoa(i))
|
||||||
|
}
|
||||||
|
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *DatabaseMetadataResponse) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
if m.Meta != nil {
|
||||||
|
|
||||||
|
if typeutils.IsZero(m.Meta) { // not required
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := m.Meta.ContextValidate(ctx, formats); err != nil {
|
||||||
|
ve := new(errors.Validation)
|
||||||
|
if stderrors.As(err, &ve) {
|
||||||
|
return ve.ValidateName("Meta")
|
||||||
|
}
|
||||||
|
ce := new(errors.CompositeError)
|
||||||
|
if stderrors.As(err, &ce) {
|
||||||
|
return ce.ValidateName("Meta")
|
||||||
|
}
|
||||||
|
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// MarshalBinary interface implementation
|
||||||
|
func (m *DatabaseMetadataResponse) MarshalBinary() ([]byte, error) {
|
||||||
|
if m == nil {
|
||||||
|
return nil, nil
|
||||||
|
}
|
||||||
|
return jsonutils.WriteJSON(m)
|
||||||
|
}
|
||||||
|
|
||||||
|
// UnmarshalBinary interface implementation
|
||||||
|
func (m *DatabaseMetadataResponse) UnmarshalBinary(b []byte) error {
|
||||||
|
var res DatabaseMetadataResponse
|
||||||
|
if err := jsonutils.ReadJSON(b, &res); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
*m = res
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,28 @@
|
||||||
|
# Members Database metadata client
|
||||||
|
|
||||||
|
Date: 2026-07-24
|
||||||
|
|
||||||
|
Provider source: Members commit
|
||||||
|
`6931b1177610a4bb41bf1bee488680b7146aa32b`.
|
||||||
|
|
||||||
|
The generated Members client exposes only:
|
||||||
|
|
||||||
|
- `GET /databases` with required `tenantId`;
|
||||||
|
- optional `databaseId`, `limit`, and `offset` filters;
|
||||||
|
- a dedicated `DatabaseMetadata` response model.
|
||||||
|
|
||||||
|
The provider requires compound API-key plus native member-session
|
||||||
|
authentication and exact `members:database:read` machine scope. Active tenant
|
||||||
|
members may read metadata; Contributors remain read-only.
|
||||||
|
|
||||||
|
`DatabaseMetadata` contains ID, TenantID, optional ClusterID, Active,
|
||||||
|
DatabaseName, Status, Type, CreatedDate, and LastModifiedDate. It has no DSN,
|
||||||
|
provisioning credential, processor token, password, or actor audit identity.
|
||||||
|
The generated Database client has no create, update, delete, provisioning,
|
||||||
|
generic-resource, Salesforce, sf-gate, or Cache operation.
|
||||||
|
|
||||||
|
The Ticket provider remains unavailable because its tenant/ownership,
|
||||||
|
decimal-money, inventory, and lifecycle contracts are not authoritative.
|
||||||
|
Database metadata is the safe DBMS discovery fallback and does not authorize
|
||||||
|
infrastructure writes. Production use remains blocked on a separately governed
|
||||||
|
exact-scope seed and provider release.
|
||||||
|
|
@ -466,11 +466,19 @@ parameters:
|
||||||
required: false
|
required: false
|
||||||
type: string
|
type: string
|
||||||
databaseIdQuery:
|
databaseIdQuery:
|
||||||
description: Record Id of a Database
|
description: Record ID of sanitized Database metadata
|
||||||
in: query
|
in: query
|
||||||
name: databaseId
|
name: databaseId
|
||||||
type: string
|
type: string
|
||||||
|
format: uuid
|
||||||
|
required: false
|
||||||
|
databaseTenantId:
|
||||||
|
description: Tenant that owns the Database metadata. Members verifies active human membership and never returns DSN or provisioning credentials.
|
||||||
|
in: query
|
||||||
|
name: tenantId
|
||||||
required: true
|
required: true
|
||||||
|
type: string
|
||||||
|
format: uuid
|
||||||
databaseRequest:
|
databaseRequest:
|
||||||
description: An array of Database records
|
description: An array of Database records
|
||||||
in: body
|
in: body
|
||||||
|
|
@ -583,6 +591,10 @@ responses:
|
||||||
description: Response with Database objects
|
description: Response with Database objects
|
||||||
schema:
|
schema:
|
||||||
$ref: "#/definitions/DatabaseResponse"
|
$ref: "#/definitions/DatabaseResponse"
|
||||||
|
DatabaseMetadataResponse:
|
||||||
|
description: Response with tenant-bound, credential-free Database metadata
|
||||||
|
schema:
|
||||||
|
$ref: "#/definitions/DatabaseMetadataResponse"
|
||||||
DocumentResponse:
|
DocumentResponse:
|
||||||
description: Document Response Object
|
description: Document Response Object
|
||||||
schema:
|
schema:
|
||||||
|
|
@ -2173,15 +2185,16 @@ paths:
|
||||||
- Courses
|
- Courses
|
||||||
/databases:
|
/databases:
|
||||||
get:
|
get:
|
||||||
description: Return a list of Database records from the datastore
|
description: Tenant-bound read of sanitized Database metadata. Requires members:database:read and active human membership. DSN, provisioning credentials, and audit identities are absent. Provisioning writes remain unavailable.
|
||||||
operationId: getDatabases
|
operationId: getDatabases
|
||||||
parameters:
|
parameters:
|
||||||
- $ref: "#/parameters/databaseIdQuery"
|
- $ref: "#/parameters/databaseIdQuery"
|
||||||
|
- $ref: "#/parameters/databaseTenantId"
|
||||||
- $ref: "#/parameters/limitQuery"
|
- $ref: "#/parameters/limitQuery"
|
||||||
- $ref: "#/parameters/offsetQuery"
|
- $ref: "#/parameters/offsetQuery"
|
||||||
responses:
|
responses:
|
||||||
"200":
|
"200":
|
||||||
$ref: "#/responses/DatabaseResponse"
|
$ref: "#/responses/DatabaseMetadataResponse"
|
||||||
"401":
|
"401":
|
||||||
$ref: "#/responses/Unauthorized"
|
$ref: "#/responses/Unauthorized"
|
||||||
"403":
|
"403":
|
||||||
|
|
@ -2194,53 +2207,8 @@ paths:
|
||||||
$ref: "#/responses/ServerError"
|
$ref: "#/responses/ServerError"
|
||||||
security:
|
security:
|
||||||
- ApiKeyAuth: []
|
- ApiKeyAuth: []
|
||||||
summary: Get a list Databases
|
kvSessionCookie: []
|
||||||
tags:
|
summary: Get sanitized Database metadata
|
||||||
- Databases
|
|
||||||
post:
|
|
||||||
description: Create Databases
|
|
||||||
operationId: postDatabases
|
|
||||||
parameters:
|
|
||||||
- $ref: "#/parameters/databaseRequest"
|
|
||||||
responses:
|
|
||||||
"200":
|
|
||||||
$ref: "#/responses/DatabaseResponse"
|
|
||||||
"401":
|
|
||||||
$ref: "#/responses/Unauthorized"
|
|
||||||
"403":
|
|
||||||
$ref: "#/responses/AccessForbidden"
|
|
||||||
"404":
|
|
||||||
$ref: "#/responses/NotFound"
|
|
||||||
"422":
|
|
||||||
$ref: "#/responses/UnprocessableEntity"
|
|
||||||
"500":
|
|
||||||
$ref: "#/responses/ServerError"
|
|
||||||
security:
|
|
||||||
- ApiKeyAuth: []
|
|
||||||
summary: Create new Databases
|
|
||||||
tags:
|
|
||||||
- Databases
|
|
||||||
put:
|
|
||||||
description: Update Database
|
|
||||||
operationId: putDatabases
|
|
||||||
parameters:
|
|
||||||
- $ref: "#/parameters/databaseRequest"
|
|
||||||
responses:
|
|
||||||
"200":
|
|
||||||
$ref: "#/responses/DatabaseResponse"
|
|
||||||
"401":
|
|
||||||
$ref: "#/responses/Unauthorized"
|
|
||||||
"403":
|
|
||||||
$ref: "#/responses/AccessForbidden"
|
|
||||||
"404":
|
|
||||||
$ref: "#/responses/NotFound"
|
|
||||||
"422":
|
|
||||||
$ref: "#/responses/UnprocessableEntity"
|
|
||||||
"500":
|
|
||||||
$ref: "#/responses/ServerError"
|
|
||||||
security:
|
|
||||||
- ApiKeyAuth: []
|
|
||||||
summary: Update Databases
|
|
||||||
tags:
|
tags:
|
||||||
- Databases
|
- Databases
|
||||||
/documents:
|
/documents:
|
||||||
|
|
@ -5497,6 +5465,62 @@ definitions:
|
||||||
$ref: "#/definitions/CourseSection"
|
$ref: "#/definitions/CourseSection"
|
||||||
type: array
|
type: array
|
||||||
type: object
|
type: object
|
||||||
|
DatabaseMetadata:
|
||||||
|
description: Credential-free metadata for a Database provisioned and owned by a Tenant
|
||||||
|
type: object
|
||||||
|
required:
|
||||||
|
- ID
|
||||||
|
- TenantID
|
||||||
|
properties:
|
||||||
|
ID:
|
||||||
|
description: Server-owned Database record ID
|
||||||
|
type: string
|
||||||
|
format: uuid
|
||||||
|
Active:
|
||||||
|
description: Whether the Database is active
|
||||||
|
type: boolean
|
||||||
|
x-nullable: true
|
||||||
|
ClusterID:
|
||||||
|
description: Optional Cluster in the same Tenant
|
||||||
|
type: string
|
||||||
|
format: uuid
|
||||||
|
x-nullable: true
|
||||||
|
CreatedDate:
|
||||||
|
description: Server-owned creation timestamp
|
||||||
|
type: string
|
||||||
|
format: date-time
|
||||||
|
x-nullable: true
|
||||||
|
DatabaseName:
|
||||||
|
description: Physical Database name
|
||||||
|
type: string
|
||||||
|
x-nullable: true
|
||||||
|
LastModifiedDate:
|
||||||
|
description: Server-owned modification timestamp
|
||||||
|
type: string
|
||||||
|
format: date-time
|
||||||
|
x-nullable: true
|
||||||
|
Status:
|
||||||
|
description: Database status metadata
|
||||||
|
type: string
|
||||||
|
x-nullable: true
|
||||||
|
TenantID:
|
||||||
|
description: Tenant that owns the Database
|
||||||
|
type: string
|
||||||
|
format: uuid
|
||||||
|
Type:
|
||||||
|
description: Database engine type
|
||||||
|
type: string
|
||||||
|
x-nullable: true
|
||||||
|
DatabaseMetadataResponse:
|
||||||
|
description: Tenant-bound Database metadata with DSN and provisioning credentials omitted
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
Data:
|
||||||
|
type: array
|
||||||
|
items:
|
||||||
|
$ref: "#/definitions/DatabaseMetadata"
|
||||||
|
Meta:
|
||||||
|
$ref: "#/definitions/ResponseMeta"
|
||||||
DatabaseRequest:
|
DatabaseRequest:
|
||||||
description: An array of Database objects
|
description: An array of Database objects
|
||||||
properties:
|
properties:
|
||||||
|
|
|
||||||
|
|
@ -466,11 +466,19 @@ parameters:
|
||||||
required: false
|
required: false
|
||||||
type: string
|
type: string
|
||||||
databaseIdQuery:
|
databaseIdQuery:
|
||||||
description: Record Id of a Database
|
description: Record ID of sanitized Database metadata
|
||||||
in: query
|
in: query
|
||||||
name: databaseId
|
name: databaseId
|
||||||
type: string
|
type: string
|
||||||
|
format: uuid
|
||||||
|
required: false
|
||||||
|
databaseTenantId:
|
||||||
|
description: Tenant that owns the Database metadata. Members verifies active human membership and never returns DSN or provisioning credentials.
|
||||||
|
in: query
|
||||||
|
name: tenantId
|
||||||
required: true
|
required: true
|
||||||
|
type: string
|
||||||
|
format: uuid
|
||||||
databaseRequest:
|
databaseRequest:
|
||||||
description: An array of Database records
|
description: An array of Database records
|
||||||
in: body
|
in: body
|
||||||
|
|
@ -583,6 +591,10 @@ responses:
|
||||||
description: Response with Database objects
|
description: Response with Database objects
|
||||||
schema:
|
schema:
|
||||||
$ref: "#/definitions/DatabaseResponse"
|
$ref: "#/definitions/DatabaseResponse"
|
||||||
|
DatabaseMetadataResponse:
|
||||||
|
description: Response with tenant-bound, credential-free Database metadata
|
||||||
|
schema:
|
||||||
|
$ref: "#/definitions/DatabaseMetadataResponse"
|
||||||
DocumentResponse:
|
DocumentResponse:
|
||||||
description: Document Response Object
|
description: Document Response Object
|
||||||
schema:
|
schema:
|
||||||
|
|
@ -2173,15 +2185,16 @@ paths:
|
||||||
- Courses
|
- Courses
|
||||||
/databases:
|
/databases:
|
||||||
get:
|
get:
|
||||||
description: Return a list of Database records from the datastore
|
description: Tenant-bound read of sanitized Database metadata. Requires members:database:read and active human membership. DSN, provisioning credentials, and audit identities are absent. Provisioning writes remain unavailable.
|
||||||
operationId: getDatabases
|
operationId: getDatabases
|
||||||
parameters:
|
parameters:
|
||||||
- $ref: "#/parameters/databaseIdQuery"
|
- $ref: "#/parameters/databaseIdQuery"
|
||||||
|
- $ref: "#/parameters/databaseTenantId"
|
||||||
- $ref: "#/parameters/limitQuery"
|
- $ref: "#/parameters/limitQuery"
|
||||||
- $ref: "#/parameters/offsetQuery"
|
- $ref: "#/parameters/offsetQuery"
|
||||||
responses:
|
responses:
|
||||||
"200":
|
"200":
|
||||||
$ref: "#/responses/DatabaseResponse"
|
$ref: "#/responses/DatabaseMetadataResponse"
|
||||||
"401":
|
"401":
|
||||||
$ref: "#/responses/Unauthorized"
|
$ref: "#/responses/Unauthorized"
|
||||||
"403":
|
"403":
|
||||||
|
|
@ -2194,53 +2207,8 @@ paths:
|
||||||
$ref: "#/responses/ServerError"
|
$ref: "#/responses/ServerError"
|
||||||
security:
|
security:
|
||||||
- ApiKeyAuth: []
|
- ApiKeyAuth: []
|
||||||
summary: Get a list Databases
|
kvSessionCookie: []
|
||||||
tags:
|
summary: Get sanitized Database metadata
|
||||||
- Databases
|
|
||||||
post:
|
|
||||||
description: Create Databases
|
|
||||||
operationId: postDatabases
|
|
||||||
parameters:
|
|
||||||
- $ref: "#/parameters/databaseRequest"
|
|
||||||
responses:
|
|
||||||
"200":
|
|
||||||
$ref: "#/responses/DatabaseResponse"
|
|
||||||
"401":
|
|
||||||
$ref: "#/responses/Unauthorized"
|
|
||||||
"403":
|
|
||||||
$ref: "#/responses/AccessForbidden"
|
|
||||||
"404":
|
|
||||||
$ref: "#/responses/NotFound"
|
|
||||||
"422":
|
|
||||||
$ref: "#/responses/UnprocessableEntity"
|
|
||||||
"500":
|
|
||||||
$ref: "#/responses/ServerError"
|
|
||||||
security:
|
|
||||||
- ApiKeyAuth: []
|
|
||||||
summary: Create new Databases
|
|
||||||
tags:
|
|
||||||
- Databases
|
|
||||||
put:
|
|
||||||
description: Update Database
|
|
||||||
operationId: putDatabases
|
|
||||||
parameters:
|
|
||||||
- $ref: "#/parameters/databaseRequest"
|
|
||||||
responses:
|
|
||||||
"200":
|
|
||||||
$ref: "#/responses/DatabaseResponse"
|
|
||||||
"401":
|
|
||||||
$ref: "#/responses/Unauthorized"
|
|
||||||
"403":
|
|
||||||
$ref: "#/responses/AccessForbidden"
|
|
||||||
"404":
|
|
||||||
$ref: "#/responses/NotFound"
|
|
||||||
"422":
|
|
||||||
$ref: "#/responses/UnprocessableEntity"
|
|
||||||
"500":
|
|
||||||
$ref: "#/responses/ServerError"
|
|
||||||
security:
|
|
||||||
- ApiKeyAuth: []
|
|
||||||
summary: Update Databases
|
|
||||||
tags:
|
tags:
|
||||||
- Databases
|
- Databases
|
||||||
/documents:
|
/documents:
|
||||||
|
|
@ -5497,6 +5465,62 @@ definitions:
|
||||||
$ref: "#/definitions/CourseSection"
|
$ref: "#/definitions/CourseSection"
|
||||||
type: array
|
type: array
|
||||||
type: object
|
type: object
|
||||||
|
DatabaseMetadata:
|
||||||
|
description: Credential-free metadata for a Database provisioned and owned by a Tenant
|
||||||
|
type: object
|
||||||
|
required:
|
||||||
|
- ID
|
||||||
|
- TenantID
|
||||||
|
properties:
|
||||||
|
ID:
|
||||||
|
description: Server-owned Database record ID
|
||||||
|
type: string
|
||||||
|
format: uuid
|
||||||
|
Active:
|
||||||
|
description: Whether the Database is active
|
||||||
|
type: boolean
|
||||||
|
x-nullable: true
|
||||||
|
ClusterID:
|
||||||
|
description: Optional Cluster in the same Tenant
|
||||||
|
type: string
|
||||||
|
format: uuid
|
||||||
|
x-nullable: true
|
||||||
|
CreatedDate:
|
||||||
|
description: Server-owned creation timestamp
|
||||||
|
type: string
|
||||||
|
format: date-time
|
||||||
|
x-nullable: true
|
||||||
|
DatabaseName:
|
||||||
|
description: Physical Database name
|
||||||
|
type: string
|
||||||
|
x-nullable: true
|
||||||
|
LastModifiedDate:
|
||||||
|
description: Server-owned modification timestamp
|
||||||
|
type: string
|
||||||
|
format: date-time
|
||||||
|
x-nullable: true
|
||||||
|
Status:
|
||||||
|
description: Database status metadata
|
||||||
|
type: string
|
||||||
|
x-nullable: true
|
||||||
|
TenantID:
|
||||||
|
description: Tenant that owns the Database
|
||||||
|
type: string
|
||||||
|
format: uuid
|
||||||
|
Type:
|
||||||
|
description: Database engine type
|
||||||
|
type: string
|
||||||
|
x-nullable: true
|
||||||
|
DatabaseMetadataResponse:
|
||||||
|
description: Tenant-bound Database metadata with DSN and provisioning credentials omitted
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
Data:
|
||||||
|
type: array
|
||||||
|
items:
|
||||||
|
$ref: "#/definitions/DatabaseMetadata"
|
||||||
|
Meta:
|
||||||
|
$ref: "#/definitions/ResponseMeta"
|
||||||
DatabaseRequest:
|
DatabaseRequest:
|
||||||
description: An array of Database objects
|
description: An array of Database objects
|
||||||
properties:
|
properties:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue